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
- simplified abstraction for overflowing clock.
revert to core one (millis) for the mqtt loop
- fix duration type for readyflag, use native clock type directly
- drop redundant check 'now' ge 'until', since wrapping already implicitly does it
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
repurpose sv string as an ok flag. nil when ok, non-nil for error.
consistent return state when exiting settings callback w/ raii helper
differentiate between errors and reconnects
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
- customize will topic qos and retain, ref. #2616
- allow to fully replace will and json topics.
empty string means the default <root>/<name>
replacement is taken as-is, after applying placeholders
- validate will and data topic structure before connecting
- validate {suf,post}fix as {suf,post}fix, not as topic
- track 'network' connection, not wifi specifically
currently, there is only wifi, hence register a callback after sta event
- initial timer setup was counting from millis() zero when booting
count from network connection instead, like it would after disconnect
using timed flags for both skip and retry timers
- 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
get rid of ptr calculations, use fixed offset & len on the string
cherry-pick char -> int conversion funcs from build .h
adjust datetime struct to be able to use aggregate ctor pre-c++17
> (node:1916) Warning: Closing file descriptor 31 on garbage collection
> (Use `node --trace-warnings ...` to show where the warning was created)
> (node:1916) [DEP0137] DeprecationWarning: Closing a FileHandle object on garbage collection is deprecated. Please close FileHandle objects explicitly using FileHandle.prototype.close(). In the future, an error will be thrown if a file descriptor is closed during garbage collection.
> (node:1916) Warning: Closing file descriptor 32 on garbage collection
per https://nodejs.org/api/deprecations.html#DEP0137
explicitly close after reading
- replace 'pulse #ID TIME TOGGLE' TOGGLE param with 'timer #ID TIME'
- drop timers list command, use 'pulse' or 'timer' interchangeably
- adjust api to use new command string, allow mqtt & http to pulse without 'toggle'
amends 530b64b1