- 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)
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
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'.
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.
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
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
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
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.
- 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
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.
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
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 :/
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
* Fix for domoticz relay IDs not being populated with stored values
* Fix for domoticz relay IDs not being populated with stored values - part 2: magnitudes
Co-authored-by: mkozlowski <gitcmt@empeka.pl>