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
* 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
* 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
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
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
- 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
Otherwise, some things are still hidden
(or, depend on the order of incoming messages)
Make thermostat code use those as well, instead of injecting
thermostatVisible in every json payload
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
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.