sensor_emon .ipp for energy and kwh & ws objects
system_time .h for clock definitions. delay not implemented (yet)
ignoring energy calc for the current test, since samples are out-of-sync
also ignoring timeout state, as it syncs with the clock time
amends 8edb7b6333
- streamline event handling through time_point & to_minutes
instead of sometimes seconds, sometimes minutes and sometimes both
- minor refactoring cref -> value for time point and durations function args
refactor mqtt root topic & topic handling, add external module for mqtt validation
check whether root topic contains #, error out when it is missing
check whether generic topics or suffixes contain # or +, error out when they are present
special handling for settings topic to pick a single level /+/ as a key and payload as a value
resolve#2617
tests for mqtt topic filtering and validation
consistent with string_view::substr behaviour, without the 'throw'ing part
allow to distinguish sv pointing to nothing and sv originating from some
kind of string (here, result of a slice) by comparing its pointer with nullptr
- probe for double and missing hours when daylight saving time happens
this is specific to local time schedules, utc should remain unaffected
- try to stay consistent with current pattern matching happening in loop
when an hour is missing, simply skip to the next schedule
when hour is repeated, make sure to recheck 'earlier' matches
- clean-up tests previously using very-very internal structs
try to handle everything (sic) using `handle_*` functions
from the corresponding namespace
Reference calendar time of other schedules, user-created named events
or the sun{rise,set} (when enabled)
For example
- '15m before sunset'
- '30m after cal#0'
- '1h15m after "foobar"'
Empty time spec is allowed, defaults to '1m'
'before sunrise' is the same as '1m before sunrise'
Internals are reworked to handle a more generalized 'Event' type, based
on the 'time point' and 'event' base classes fron sunrise and sunset
Sunrise and sunset should also track 'last' event as well as 'next
(not currently displayed anywhere, though)
ffs -> clz minus int size, otherwise multiple match order is broken
experiment with future masking, using ffs correctly this time
update tests to handle all branches of closest_delta, both future and past
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
certain actions need to happen when
- starting restore()
- switching date within restore()
- stopping restore()
pretty good fit for an object and raii. so, using context struct to handle
sun{rise,set} initialization and per-schedule time match updates
sun{rise,set} event happens on a specific date, make sure it is also checked
fix double action trigger by comparing minutes, not raw timestamp seconds
experimenting with 'invalid state' i.e. when timestamp was not generated
include restore logic in tests, as code now lives in .ipp
separate convesions from the main source to allow test builds
extra unit to verify that both duration plain input and
spec work as intended
also fix wdt triggered when unknown symbols are encountered at the end
of duration string (e.g. 10000y)
solves edge-case when we move our storage nearby a previously erased kv,
causing it to be treated as a key or a value with length 255 (... 0x00 0xff)
also stop set() from erasing data when it is not possible to store it in
the first place
additional test case similar to permutations one, make sure keys don't
disappear while we write to the storage a lot of times and possibly
introduce the two cases above
* stateless callbacks for mqttRegister. no module uses the lambda / std
func with captures or otherwise, so it is kind of pointless to have it
* make sure we know topic and payload length at all invocations and
not constantly trying to re-parse the same string over and over again
* clean-up api related to string parsing and make sure we allow
stringview as input
* clean-up id / unsigned number parsing to work with views instead of
using a generic strto{,u}l; sometimes this works, sometimes doesn't.
as noticed previously with IR implementation, it *will* parse until
the '\0' is found in the input and we can't interpret parts of the
string without doing a copy for the strtoul
* fixing additional bugs caught in ifan, leds, sensors and lights that
were causing build failures. plus, more range-based parsing code for
the same reason as described above
* globally accessible system timer class; help out with our internal
scheduling by always using strongly typed duration and dynamic
time adjustment for durations longer than system limits
(see `os_timer_t` documentation)
* our own class for scheduled callbacks which are either choosing a
simple function pointer or std function wrapper, depending on the type
passed into the constructor. specifically for scheduled functions,
this allows us to filter globally scheduled functions and push them to
the front of the queue when necessary to ensure certain order of calls
* replace Ticker instances with SystemTimer
* allow types {h, cpp} in unit tests
- setup uart at boot instead of delaying until some module needs it
removes global `SERIAL_BAUDRATE` and `DEBUG_PORT` in favour or
globally accessible numbered port configurations with `MODULE_NAME_PORT`
- automagically enable uart support for sensors that need it
- allow every sensor to configure uart0 (normal and swapped), uart1
and an optional software-serial mode support with an extra build flag
remove individual includes across the sensors
- settings queries and runtime port configuration (prefixed with uart)
- update dependencies header to cross-reference used ports at build time
- update deprecations header with serial baudrate notice
- clean-up comparison routines and get rid of most of the casts
- reduces total number of calls to terminalRegisterCommand
replace with a func accepting list of commands, which in
turn get instantiated as constexpr PROGMEM arrays
- reduce ram fragmentation, since we don't need to alloc as much
- reduce flash consumption b/c of lambda -> standalone func conversion