Commit Graph

3876 Commits

Author SHA1 Message Date
Maxim Prokhorov
8ff1cd9404 scheduler: clang-tidy being clever 2024-05-23 00:27:23 +03:00
Maxim Prokhorov
7ac9fd7489 relay: delay before mqtt disconnect action
https://github.com/xoseperez/espurna/issues/1550#issuecomment-2103315452
wait 30s for reconnection, perform status change after timer expires
2024-05-16 20:35:42 +03:00
Maxim Prokhorov
865c7bfc1b scheduler: formatting 2024-05-16 20:03:04 +03:00
Maxim Prokhorov
8735f4d762 scheduler: webui sun module, utc cannot be alone 2024-05-16 19:59:49 +03:00
Maxim Prokhorov
44c4124ec3 scheduler: extra days is a positive number 2024-05-16 19:58:33 +03:00
Maxim Prokhorov
111aff8e93 scheduler: build settings dump 2024-05-16 19:24:02 +03:00
Maxim Prokhorov
09fdf521fb scheduler: formatting 2024-05-16 19:15:55 +03:00
Maxim Prokhorov
b21fb542d4 scheduler: missing utc conversion 2024-05-16 19:15:40 +03:00
Maxim Prokhorov
d19a1f10f7 scheduler: formatting, license info 2024-05-16 02:46:52 +03:00
Maxim Prokhorov
5fcfbed0b3 build: regenerate re2c sources 2024-05-16 02:43:49 +03:00
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