424 Commits

Author SHA1 Message Date
Maxim Prokhorov
0853a8e346 webui(build): .ico -> .svg favicon
initial generation via https://picsvg.com/
> Created by potrace 1.10, written by Peter Selinger 2001-2011

compressed via https://jakearchibald.github.io/svgomg/
2025-04-14 01:14:13 +03:00
Maxim Prokhorov
9dc57878c1 webui(build): build params & vite dev support
- experimental vite dev server support
- gulp webui_build & webui_PRESET -> build
- gulp task params for build and dev server
- bundle sources using rollup in both gulp and vite
- PRESET lib to manage available modules and their constants
  replacing 'define' method of .js code treeshaking
2025-04-14 01:14:13 +03:00
Maxim Prokhorov
4975a2382c webui: removing original .html & .js & .css 2024-06-24 22:42:00 +03:00
Maxim Prokhorov
d6f807d68c scheduler: midnight as default HH:MM
allow just "UTC", "Monday", "05-01", etc.
clarify webui paragraph and mention KEYWORD as an element

ignore sunrise and sunset keywords when sun module is disabled

move all of parsing to time module, test whether combined match works
2024-05-27 19:10:25 +03:00
Maxim Prokhorov
8735f4d762 scheduler: webui sun module, utc cannot be alone 2024-05-16 19:59:49 +03:00
Maxim Prokhorov
bfc716894d webui: scheduler 2024-05-16 01:25:50 +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
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
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
b1bdfd927c webui: update blobs 2022-11-25 05:09:12 +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
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
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
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
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
3aef6adf7d webui: update "select" options to use text values 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
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
Maxim Prokhorov
eb59726b4f sns: report both used & supported units to the webui
Generic way to find out which units the magnitude type supports.
Clean-up UI related to temperature, energy and power units.
Resolves #2482

Also apply some refactoring to the 'schema'-generated
payloads by using the EnumerableConfig helper class.
Class received some new features:
- optional callback, verifying that index should be used at all
  specific use-case is magnitudes list that needs only 'counted' ones
- std::iota / ranges::iota_view -like helper object for sequences
  starting with something other than 0

Reordered payloads, prefer queueing over sending everything at once.
2021-10-24 14:22:08 +03:00
Maxim Prokhorov
6f132ef3c5 webui: debug SEND button should be type=submit
ref. #2476
2021-10-03 20:44:58 +03:00
Maxim Prokhorov
444fcec890 webui: fix relay and curtain config change detection
resolve #2470
2021-10-03 20:44:58 +03:00
Maxim Prokhorov
37b46a040f domoticz: update changelog and webui 2021-08-11 14:25:12 +03:00
Maxim Prokhorov
fa3deeffbf webui: remove jquery dependencies and clean-up websocket API
Refactor WebUI:
- remove jquery dependency from the base custom.js and use vanilla JS
- remove jquery + jquery-datatables dependency from the RFM69 module
- replace jquery-datatables handlers with pure-css table + some basic cell filtering
  (may be incomplete, but tbh it is not worth additional 50Kb to the .bin size)
- introduce a common way to notify about the app errors, show small text notification
  at the top of the page instead of relying on user to find out about errors by using the Web Developer Tools
- replace <span name=...> with <span data-settings-key=...>
- replace <div> templates with <template>, disallowing modification
  without an explicit DOM clone
- run `eslint` on html/custom.js and `html-validate` on html/index.html,
  and fix issues detected by both tools

Streamline settings group handling in custom.js & index.html
- drop module-specific button-add-... in favour of button-add-settings-group
- only enforce data-settings-max requirement when the property actually exists
- re-create label for=... and input id=... when settings group is
  modified, so checkboxes refer to the correct element
- introduce additional data-... properties to generalize settings group additions
- introduce Enumerable object to track some common list elements for
  <select>, allow to re-create <option> list when messages come in
  different order

Minor fixes that also came with this:
- fix relay code incorrectly parsing the payload, causing no relay names
  to be displayed in the SWITCHES panel
- fix scheduler code accidentally combining keys b/c of the way C parses
  string literals on separate lines, without any commas in-between
- thermostat should not reference tmpUnit directly in the webui, replace with
  module-specific thermostatUnit that is handled on the device itself
- fix index.html initial setup invalid adminPass ids
- fix index.html layout when removing specific schedules
2021-07-18 23:30:32 +03:00
Maxim Prokhorov
50f247bd18 webui: fix scheduler template layout
Additional div made the mutator think we still have some active elements.
Also, small clean-up for type consistency in the WS part.
2021-07-05 03:26:38 +03:00
Maxim Prokhorov
1a36efb8f2 sns: rename generic pwr keys with a typed prefix
Ratio, Mains are specific to a magnitude type.
Make keys use global index, and do a (temporary) WebUI workaround
to use 0 index instead of the global key.
Migrate to the new settings keys.

Local magnitude-specific index is still in play, pending changes in the rest of sensors
(ADE7953, PZEM004T{,V30}, ...) to remove it completely.

Local sensor index could still be useful though, to help out with some settings
in the future as we don't really enforce magnitude type uniqueness within sensors.
2021-06-18 12:12:09 +03:00
Maxim Prokhorov
bd3a588977 hardware: lightfox fixes & buttonAdd
Should be buildable once again

Restore the behaviour from #1468, where button clicks were triggered
Inject relay provider using the relayAdd, add buttonAdd to provide input handling

Remove extra button handling code from the WebUI

Still assuming that DUAL code really needs a syncronized way to handle
input & output with relays, so we can't treat it as a real button.
Without the device it is only guessing, and various issues / comments
are not really clear on that part :/
2021-06-09 11:20:07 +03:00
Maxim Prokhorov
e22f67e5d6 scheduler: fix schedule restore flag & refactoring
Restore was unintentionally broken after switching from per-relay to
per-schedule setting. Instead of using schedules count it used the
number of relays (or curtains), and never light channels.

Instead, loop over available schedules and check the 'restore' flag,
calling the action when the schedule was supposed to be active.
Similar to the old approach, check for the most recent action and call
it (also, discarding the same type & target pairs, to avoid scheduling
conflicting actions)

time_t seconds offset is refactored into tm.tm_mday offset.
this causes the function to only work with local time, however
it *should* correctly offset day-by-day in case it somehow stumbles
upon dst transition

For settings:
- schSwitch renamed into schTarget
- schTarget default is no longer 0xff, but 0
- schType is a mandatory setting, instead of 1 (switch) default to 0 (none)
- move getSetting into functions to reduce code size
- delSetting case moved into the initial block that runs before restore() and check()

Plus, refactor C-style naming into namespaces similar to the other modules
2021-05-30 05:53:13 +03:00
Maxim Prokhorov
7226a7d37f webui: new format for the scan 2021-04-01 01:10:34 +03:00
Maxim Prokhorov
b6934d395d led: fixup configuration in the webui
Also fix the rogue typos from the scheduler change
2021-03-31 09:41:04 +03:00
Maxim Prokhorov
f5940b7083 webui: rework initialization for relay and scheduler
Send out keys as schema, fill given template based on the 4 common input types.
Also, refactor relayLastSch into schRestore and move into the schedule template.

Moving relayCount to a wide int, this will probably not build...
2021-03-31 09:41:04 +03:00
Maxim Prokhorov
14c69a4a52 webui: get rid of tabindex completely
Prefer tabindex=-1 to ignore elements instead of listing them
explicitly, as browsers already handle that based on what is visible
2021-03-31 09:41:04 +03:00
Maxim Prokhorov
d60fb47ca9 webui: external url clean-up
- .js injects both target and rel when class=external
- also inject tabindex so that TAB skips those links
2021-03-31 09:41:04 +03:00
Maxim Prokhorov
1627e3119f webui: remove hard-coded group key list
Custom attribute for key inputs to send them as lists.
Template proxy function to make sure we don't have to type that out each time.
2021-03-31 09:41:04 +03:00