disallow using toSpan() and toView() when storage does not implement data()
since overloading is used, stop building by simply not writing any function
otherwise, it is finicky w/ compiler support and / or selected -std=...
reduce the number of times one byte read()s are used
since espXX implementation deals with memory blob most of the time,
just return the data pointer to the buffer position and work w/ that
internal rules for obj construction relaxed, fix implicit operator= deletion
by using pointers instead of references. allow more default output objs
prefer that reader / writer live only for the duration of the function
and are shared explicitly only when it is necessary
- correctly parse delays when 'repeats' is missing and avoid doing pointer math on nullptr
empty pattern allowed in all cases, not just 0,0
- parse should signal about invalid inputs
- parse & serialize updated to support empty repeats
- [Rr] in addition to 0,0 as pattern repeat marker
also fixes led.h vs. led_internal.h usage in parser code
w/ another -fsanitize=address hint, use separate objects instead of
relying on pattern itself holding everything api *may* need
combine pattern and preset patterns currently separate timers
pattern container reworked to allow small-size optimization
introduce a special '0,0' marker, repeating the whole pattern (instead
of just one delay at the end)
since pattern is part of the led struct proper, display it in settings query
update tests & reuse time parsing routines from utils
update string search logic to use brute-force for a full string, not just a single char
(ref. c++17/c++20 algorithm std::search defaults)
original code mixed lineview/buffer logic outside of the terminal parser
instead, make sure that delimited classes never return delimiter itself
line classes do so as well, equaly handling both '\n' and '\r\n'
existing terminal api now handles implicitly terminated strings by default
reworked linebuffer initialization order to use inheritance in place of
plain member init. as a bonus, its main methods are no longer templated
reducing the resulting code size per linebuffer specialization (not by very much, though)
- extra flag to include new-line after the input ends
- keep tokens sv to the original string.
unless escaped characters appear, prefer to not make extra buffers
(only matters for >12byte tokens; smaller strings do not allocate)
- keep remaining sv, after line break encountered by the parser.
update api caller to re-use the parser, no need for a separate line delim class
update tests & externalize event hanlding implementation
prevent spurious .last == .next when .next never did or cannot happen
ref. 758ff844, in case update routine is called repeatedly
ref. #2629, 'event' should output coherent values
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