3866 Commits

Author SHA1 Message Date
Maxim Prokhorov
571de15e3d core: bump version 2024-05-16 01:25:50 +03:00
Maxim Prokhorov
d2e18744dc scheduler: backport remainder impl, fix ambiguous name 2024-05-16 01:25:50 +03:00
Maxim Prokhorov
b070b908a7 test: scheduler 2024-05-16 01:25:50 +03:00
Maxim Prokhorov
bfc716894d webui: scheduler 2024-05-16 01:25:50 +03:00
Maxim Prokhorov
a21caeb931 build: whitespace 2024-05-16 01:25:50 +03:00
Maxim Prokhorov
e4b6929f94 scheduler: v2
- allow to specify year, month and day in addition to weekdays and time
  2024-05-15 Monday 00:00 <=> runs *only* on May 15th 2024
  year is optional, 05-15 <=> any May 15th on any year
- last day of month, Nth week, reversed day-of-month (starting from last)
  *-W1 00:00 <==> run at midnight on the first week of month
  01-L2 6:00 <==> run at six, but only on the second to last day of January
  05-L 12:00 <==> run at twelve, but only on the last day of May
- allow multiple time settings per schedule specified as ranges
  12,13,14:00 <=> run at 12:00, 13:00 and 14:00
  Friday..Sunday 12:00 <=> run at 12:00, but only only on Friday, Saturday and Sunday
- similar to weekdays default, allow asterisk (*) to avoid using exact value
  *:30 <=> every hour at 30 minutes
  10:* <=> every minute at 10 o'clock
- repetition value for more control over steps between runs
  *:0/5 <==> every 5 minutes, starting with 0
  0/2:00 <==> every 2 hours, starting with 0

- rework api and settings storage to use 1 key for time setting
  type and 'enabled' state moved into one
- implement sunrise & sunset suggested in #2417
  should be specified instead of HH:MM
2024-05-16 01:25:50 +03:00
Maxim Prokhorov
58a4cc4702 settings: setter should serialize vs. just using string ctor
note that there is an issue with overload resolution, since template
requires serilize() to be available *before template* and not at the
point of the caller.

serialize converted to template should fix it, though
2024-05-16 01:25:50 +03:00
Maxim Prokhorov
e529e38ec6 pio: update for re2c 3.0 and fix exit handling 2024-05-16 00:04:00 +03:00
Maxim Prokhorov
87197470cb web: group delete button should not assume it is at the top 2024-05-16 00:00:32 +03:00
Maxim Prokhorov
5b2799cec7 util: while loop for stringview split 2024-05-15 23:59:08 +03:00
Maxim Prokhorov
c50817955a datetime: prep utility funcs for scheduler
everything related to calendar time vs. system one
no need to include ntp for formatting, too
2024-05-15 23:58:19 +03:00
Maxim Prokhorov
fcafafef1c util: export converter defaults 2024-05-15 23:53:31 +03:00
Maxim Prokhorov
448c7961e4 settings: serializer for system durations 2024-05-15 23:52:36 +03:00
Maxim Prokhorov
a87c96e3af curtain: external api uses generic names 2024-05-15 23:51:18 +03:00
Maxim Prokhorov
3aff986468 light: export string adjustments 2024-04-22 17:47:01 +03:00
Maxim Prokhorov
4e00982577 util: long op from lights 2024-04-22 17:32:24 +03:00
Maxim Prokhorov
c81a72b296 sns: unused 2024-04-15 01:23:08 +03:00
Maxim Prokhorov
07743c5e41 settings: query for setting, not value 2024-04-15 01:23:08 +03:00
Maxim Prokhorov
dd6bedeec7 webui: style save button 2024-04-15 01:23:08 +03:00
Maxim Prokhorov
c3ab86bbd7 settings: query for specific entry
separate search and value retrieval
2024-04-14 21:50:58 +03:00
Maxim Prokhorov
20583c7454 sns: digital sensor & digital magnitude settings collission 2024-04-12 00:22:38 +03:00
Maxim Prokhorov
73c58c507c settings: explicit prefix check 2024-04-12 00:22:38 +03:00
Maxim Prokhorov
424e1930d2 settings: enumeration string from sv, not cstring 2024-04-12 00:22:38 +03:00
Maxim Prokhorov
d9a7743d04 sns: digital sensor settings and setup checks 2024-04-12 00:22:38 +03:00
Maxim Prokhorov
7a68ff161a sys: allow to check timer start 2024-04-12 00:22:38 +03:00
Maxim Prokhorov
a1b9bf5199 sns: schedule reads after completing init 2024-04-12 00:22:38 +03:00
Maxim Prokhorov
c70fe1a016 web: bump html-validate@8 again
fixes 3f1cf8cd *-dup false positives
2024-04-12 00:22:38 +03:00
Maxim Prokhorov
f75d379d20 pio: toolchain version from platform 2024-04-10 23:19:57 +03:00
Maxim Prokhorov
5cb59fed5c ha: already checked in loop 2024-04-10 23:19:57 +03:00
Maxim Prokhorov
5e599ec277 sns: span type access fixes
pointer to pointer array access
2024-04-10 23:19:57 +03:00
Maxim Prokhorov
3827192de8 sns: init magnitude energy tracker exactly once 2024-04-10 23:19:57 +03:00
Maxim Prokhorov
3c61604403 sns: pre-init and recover dallas ability to init later 2024-04-10 23:19:57 +03:00
Maxim Prokhorov
56a772e729 sns: more annoying dummy sensor 2024-04-10 23:19:56 +03:00
Maxim Prokhorov
0d84c76477 relay: optional pulse time in terminal, default to 0 2024-03-30 01:16:44 +03:00
Maxim Prokhorov
530b64b13f relay: consistent pulse requirements and startup
purge timers based on target status, do not check 'armed' state
allow to schedule timer and keep it inactive until relay loop

fixing bug with pulse api not respecting before / after delays.
activate timers when switching to an opposite state.
deactive existing timers when with the same state.

print debug after completing actions, making sure accidental yield would
not change expected state while still modifying it
2024-03-30 01:06:36 +03:00
Maxim Prokhorov
3a8992704d relay: pulse timer is transferable as basic timer 2024-03-28 19:49:44 +03:00
Maxim Prokhorov
8c68a72c8f ha: wait for sensors and longer retries
do not publish until sensor are actually ready to be read
some refactoring of internal state to make ptr objects earlier
2024-03-27 21:24:54 +03:00
Maxim Prokhorov
b580dd4d1c dallas: keep waiting for notify() 2024-03-19 22:17:33 +03:00
Maxim Prokhorov
4cc0936a9c sns: delayed initialization fixes
- configure magnitudes right after they are created.
  if any sensor fails begin(), this would leave .filter uninitialized
- poll on flags instead of raw timestamps.
  minor change to get rid of the init state.
- system::timer::SystemTimerFlag -> system::ReadyFlag
2024-03-19 22:16:15 +03:00
Maxim Prokhorov
992dc193d3 ha: -16bytes 2024-03-19 21:53:41 +03:00
Maxim Prokhorov
2d19d8e1e9 sns: per-magnitude read count 2024-03-19 20:01:25 +03:00
Maxim Prokhorov
68f15a5728 sys: alternative to bool(timer) 2024-03-19 19:51:53 +03:00
Maxim Prokhorov
e08bd519df ha: get rid of sent-once yet again 2024-03-19 19:51:53 +03:00
Maxim Prokhorov
58fc010bb2 ha: typo 2024-03-19 19:51:53 +03:00
Maxim Prokhorov
af797fddb7 ha: reorder settings in webui 2024-03-19 19:51:53 +03:00
Maxim Prokhorov
5a0767786b ws: module clean-up 2024-03-19 19:51:53 +03:00
Maxim Prokhorov
e92be04eea dallas: try to safeguard against bogus readings
in case wire reset() somehow allows reading to pass
2024-03-19 19:51:53 +03:00
Maxim Prokhorov
3f1cf8cd04 webui: autocomplete="off" fixes
update dev html-validate@8 and eslint
workaround for form-dup-name (false-positive?)
2024-03-19 19:51:53 +03:00
Maxim Prokhorov
b354b6b1d2 webui: rebuild blobs 2024-03-19 19:51:53 +03:00
Maxim Prokhorov
be6536bf8f sns: missing internal linkage
global espurna::sensor::(anonymous) instead of wrapping every internal one
(pretty sure this is a left-over from incorrectly applying them originally)
2024-03-19 19:51:53 +03:00