646 Commits

Author SHA1 Message Date
Maxim Prokhorov
bfc716894d webui: scheduler 2024-05-16 01:25:50 +03:00
Maxim Prokhorov
87197470cb web: group delete button should not assume it is at the top 2024-05-16 00:00:32 +03:00
Maxim Prokhorov
dd6bedeec7 webui: style save button 2024-04-15 01:23:08 +03:00
Maxim Prokhorov
c70fe1a016 web: bump html-validate@8 again
fixes 3f1cf8cd *-dup false positives
2024-04-12 00:22:38 +03:00
Maxim Prokhorov
af797fddb7 ha: reorder settings in webui 2024-03-19 19:51:53 +03:00
Maxim Prokhorov
3f1cf8cd04 webui: autocomplete="off" fixes
update dev html-validate@8 and eslint
workaround for form-dup-name (false-positive?)
2024-03-19 19:51:53 +03:00
Maxim Prokhorov
452cd78c41 ha: handle homeassistant/status
birth message should trigger discovery, enabled by default
ref. #1637

clean-up discovery code to properly re-init when something goes wrong
also restore manual discovery trigger from WebUI
2024-03-19 19:51:35 +03:00
Dmitry
238dc130af garland: fixes and updates (#2600)
* garland: fix issue with division by zero in first scene setup

* garland: update setters code

* garland: fix web UI

* garland: update scene default settings

* garland: update palettes, add random run animation

* garland: enable and update anim_glow

* garland: update anim_spread

* garland: add anim_crossing

* garland: get rid of redundant variables in main class

* garland: provide anims with all palettes

* garland: unify anim_waves and anim_run to use ColorWave class

* garland: update format for color_wave.h and garland.cpp

* graland: update anim code with clear rands and auto counters

* garland: implement pixel caching for color waves to reduce redundant calculations

* garland: fix anim dolphins out of range issue

* garland: tune anim comets

* garland: combine all wave-based anims; add wave comet anim

* garland: fixes for PR notes
2024-01-20 22:23:05 +03:00
Maxim Prokhorov
f3c3efca4a dcz: typo in relay settings key
resolve #2596
2023-11-05 00:37:45 +03:00
Indu Prakash
2e19de7a44 webui: show message only for real pin-lock failures (#2584) 2023-03-17 14:39:03 +03:00
Maxim Prokhorov
3a1e041f51 gpio: notify about failed locks 2023-03-16 14:45:04 +03:00
Maxim Prokhorov
909949b5cc light: hide extra toggle in webui
amend b5a03dac72
2023-01-12 03:16:07 +03:00
Maxim Prokhorov
b5a03dac72 light: experiment with relay state provider
* dynamic relays should not overlap with configuration
* prefer explicit relay configuration vs. dynamic addition

resolve #2568
2023-01-11 05:46:38 +03:00
Maxim Prokhorov
767cd72e36 lights: allow to recover from a fully black rgb 2022-12-12 14:28:25 +03:00
Maxim Prokhorov
9126a9832b light: cct for rgb, rgbww and ww cases
- revert to ignoring rgb in color+white+cct case by resetting all its
  inputs to minimum and only controlling white channels
- ignore ww and cw in rgb+cct case; use approximated color, thus allowing
  us to set a different 'cold temperature' limit
- fix webui layout rules based on root element class(es) and consistent
  order for our control elements that does not depend on the order in which
  `processData` handles configuration kvs
- internal refactoring to flatten input processing funcs selection
  (to possibly replace our boolean flags with a simple list)
2022-12-01 00:30:26 +03:00
Maxim Prokhorov
4021c4d14d light: hide colorpicker when color is disabled 2022-11-27 03:43:41 +03:00
Maxim Prokhorov
b1bdfd927c webui: update blobs 2022-11-25 05:09:12 +03:00
Maxim Prokhorov
99b5ed9b57 webui: normalize light channel tags 2022-11-25 05:04:25 +03:00
Maxim Prokhorov
d029414f6e webui: always display brightness 2022-11-25 05:03:58 +03:00
Maxim Prokhorov
909b2a0786 webui: lights styling through classes 2022-11-25 05:03:29 +03:00
Maxim Prokhorov
e84fbf7366 webui: correct TZ yet again
amends 94f0786ed5
2022-11-17 23:05:40 +03:00
Maxim Prokhorov
94f0786ed5 webui: simple tz could either be with hyphen or without
looking at <...> TZ values, previous version seemed true
2022-11-17 17:23:06 +03:00
Maxim Prokhorov
70d25aea06 webui: ntp offsets from tzdata/etcetera
refer to our docs for the script output
see #2548
2022-11-17 01:46:51 +03:00
Maxim Prokhorov
f37f380c04 webui: 2nd try at using css for light controls
register channels with their respective tags, instead of using count
both on backend and frontend

revert to useCCT mireds slider rule, disallow white channels with useWhite
2022-11-17 00:54:10 +03:00
Maxim Prokhorov
1be7623143 webui: emon hints visibility through css 2022-11-17 00:54:10 +03:00
Maxim Prokhorov
f1d5b62146 light: webui color and cct fixes
* correct id=... and element references, partial changes to element
  order were not using the new global 'light' container
* separate block for picker, does not seem consistent to depend on json
  key order when processing device cfg
* visibility != display; make sure color picker is hidden when there is
  no color control, but not visible when color is on but state is off
2022-10-29 02:08:50 +03:00
Maxim Prokhorov
2a7cabb4d3 light: rework hsv input in webui
* make sure we don't apply hsv and brightnesss, only take hue and saturation
  when calculating inputs. use value as brightness percentage, wrapping
  the original function (which also makes other modules use this codepath)
* deduce interface elements based on both setting and incoming
  properties. wrap everything in {light: ...} in both inputs and
  outputs, alse allow to update multiple properties at the same time
* add light state toggle when special lights relay is not set up
* remove channel, state and brightness elements through css styling
  instead of going to the elements directly. no need to chech whether
  certain elements exist
2022-10-23 03:18:57 +03:00
Maxim Prokhorov
fc8bdef7d5 terminal: fixing web socket interface
Make the buffer work on '\n' instead of a limit, flush asap.
Still using single 'DEBUG' output for both terminal and debug prints;
we no longer have 'pre' and 'msg' distinction - there is just 'msg'.
2022-09-08 15:50:30 +03:00
Maxim Prokhorov
ef202109e7 terminal: remove shared output
Make every available call site 'private'
e.g. typing command in telnet no longer prints to serial or WebUI

Serial input is now optional, see `TERMINAL_SERIAL_SUPPORT`.
Telnet using async server is a proper Print implementation now.
WebUI, MQTT and HTTP input is allowed to inject multiple lines at once.

Modernize our helper classes and remove legacy 2.3.0 quirks.
Replace global Terminal object and allow to separately
split, parse ARGV list and perform command search and invocation with
standalone function calls.
(but, notice that we still depend on a globally shared 'commands' list)

This greatly reduces used RAM (but, slightly increases our ROM).

Update our test suite to use namespaces and new calling convention.
2022-09-08 13:39:11 +03:00
Maxim Prokhorov
84017214d2 webui: detect when sensor unit changes
also split energy info into a separate payload & handler
2022-06-12 20:36:01 +03:00
Maxim Prokhorov
3275f4921f sns: the rest of magnitude settings
As mentioned in the #2491
Hides parent element when these groups are empty
2022-05-06 18:56:54 +03:00
Maxim Prokhorov
59bd14966e webui: rebuild blobs 2022-05-05 22:49:02 +03:00
Maxim Prokhorov
62b2edadc4 sns: show and edit correction values in webui
fixes #2491
2022-05-05 22:35:34 +03:00
Maxim Prokhorov
28aa9622bb rfbridge: handle rfb{ON,OFF} just like any other setting
removes the extra 'save' button from the ui and the code that handles it
also make sure to use the updated foreach_prefix when looking for the
match in the settings

resolve #2502
2022-02-09 16:00:41 +03:00
Maxim Prokhorov
5c6a6dacfb webui: fix class typos and add more control groups 2022-01-16 03:53:20 +03:00
Maxim Prokhorov
588b1c46b1 webui: hint is not a class anymore and fix alexa element group 2022-01-15 19:18:12 +03:00
Maxim Prokhorov
05c696f869 webui: fix lint 2022-01-14 03:50:23 +03:00
Maxim Prokhorov
288b79c549 webui: reposition elements and trying to fix autoscroll
Since 'Enter' is also a submit button and another style gets applied,
both seem to overlap. Not very important on a desktop, but might be
easier to navigate on mobile screen
(plus, move settings backup buttons back at the top, accidentally moved
those to the bottom in the previous commit)

On the DEBUG page as well, trying to fix the scrolling behaviour when the
logging stream just started and will only jump after it spends some time at
the top row. Watching the element state to pause the autoscroll when we
manually move the slider, and resume it once the slider touches the bottom
of the textarea. Entering the command will reset the state and enable
the autoscrolling immediately
2022-01-14 03:28:32 +03:00
Maxim Prokhorov
594763e349 webui: update blobs 2022-01-13 02:21:35 +03:00
Maxim Prokhorov
4c178948b5 webui: revamp grid elements
Make more use of control-groups instead of adding a manual alignment
class to each element. Surprisingly, this is slightly larger than the
previous .gz.html output, but not enough to not consider the readability.

Status page updated to take the lengthy hostnames and version strings
into an account, remove those from the sidebar.

Clean-up terminal module. Use the same style for both input and output,
move the terminal handler and debug handler into an appropriate .cpp
2022-01-13 02:16:28 +03:00
Maxim Prokhorov
b5dca42cbc webui: revamp group addition & deletion
Generate explicit events. Don't have a separate group observer that
tracks deletion, but handle it immediately from the 'button' event

Replace kv array with a direct key updates. While the backed part still
must optimize for size, from this side we should operate on keys directly
2022-01-12 17:26:30 +03:00
Maxim Prokhorov
5dd2009214 webui: fix checkbox styling under pure-form
Using a more 'specific' CSS rule to override it's width and height
2021-12-30 02:03:03 +03:00
Maxim Prokhorov
3aef6adf7d webui: update "select" options to use text values 2021-12-30 02:03:03 +03:00
Maxim Prokhorov
710f45c2b1 webui: magnitude should not print missing unit
In case the measurement is unitless, make sure to substitute the empty
.units[id] value with an empty string instead of the ambigious 'undefined'
2021-12-30 02:03:03 +03:00
Maxim Prokhorov
40c50f910e webui: do not lose select original=value when nothing is selected 2021-12-30 02:03:03 +03:00
Maxim Prokhorov
e213b58db2 settings: continue refactoring internal constants
Settling on naming 'options' for enumerations (...possibly, everything
else in the future, would that make sense to store for 'setting' object)

Update terminal commands that were reporting status to also report a
full list of 'indexed' settings for the specific entity
Also updates the WebUI outputs which are (hopefuly) are already handled
as-is through the .js processing pipeline and the .html properties
receiving certain special string values

More namespacing and save ~2KiB of RAM by reducing the amount of loaded keys strings
However, ROM side of things may suffer b/c of template specializations for the
generic conversion functions when there are many different types involved.
2021-12-30 02:03:03 +03:00
Maxim Prokhorov
5865654950 led: fixup findme-wifi and relays modes
Renamings, and fix duplicate code paths and actually use all of relays
for the status check instead of just one (like the FOLLOW does)
2021-12-23 12:51:43 +03:00
Maxim Prokhorov
f9ad9d44e1 webui: find all span elements, not just one 2021-12-09 01:15:11 +03:00
Maxim Prokhorov
8f7f1c968f sns: unify settings & settings page actions
- remove 'local' index and replace sensor code depending on it with the
  existing 'slot' aka 'magnitude index' used in value() and type()
- common method to store and retrieve ratios for voltage, current,
  active power and energy. default implementation is no-op, sensor
  should implement ratio adjustment & calculations to use 'slot' indexes
- re-implement 'expected' values ui. display the actual ratio values,
  and have a separate page for updating them in a more apparent way
- remove legacy settings that were adjusting expected values
- remove legacy settings that were resetting ratios and analog calibration
- generic webui action caller, add ratios and analog calibration resets

all of 'emon' sensors were updated to utilize the new approach to the
ratio handling. pulsemeter is somewhat an outlier, but it is unclear
whether removing the energy ratio is justified

terminal part was also updated
- implement `expected` command that hooks into the new ratioFromValue
  (and what webui uses to calculate ratios)
- implement `energy` command to list only MAGNITUDE_ENERGY
- remove old pzem004t commands doing ratio reset and total energy count

another global update is related to espurna::duration
- rework module-local heartbeat and led durations into a global
  espurna::duration
- update sensor internals to use specific units instead of multiplying things
  on line-by-line basis. export count() to the api
2021-11-23 02:36:28 +03:00
Maxim Prokhorov
f456d9622a webui: display switch pretty name for dcz and tspk 2021-10-24 14:22:32 +03:00