Commit Graph

3895 Commits

Author SHA1 Message Date
Maxim Prokhorov
9e1b25f585 settings: mark user modified values 2024-06-15 20:56:52 +03:00
Maxim Prokhorov
30c6b90bc7 ci: py312 deprecation warnings 2024-06-15 20:46:49 +03:00
Maxim Prokhorov
fa7c187579 telnet: best-effort skip of command data
usually a good idea for clients like PuTTY, since these are sent by default
in the very first packet even before user types anything else
also restore iac+eof handling, which call close() on the stream

resolve #2563
resolve #2606
2024-06-15 16:57:31 +03:00
Maxim Prokhorov
11489d21e0 dcz: static json buffer overflow
revert to pre b23137f cstrings
fix #2605
2024-06-13 21:49:31 +03:00
Maxim Prokhorov
bc711dda4e webui: bump gulp to 5.0.0 2024-05-29 07:50:19 +03:00
Maxim Prokhorov
4a8a8e1913 webui: bump eslint to 9.3.0 2024-05-29 07:36:03 +03:00
Maxim Prokhorov
9a8466f622 webui: pending stylelint 2024-05-29 07:27:20 +03:00
Maxim Prokhorov
cf9ec76d2f webui: bump to inline-source-8.0.3
remove yet another deprecated gulp plugin, just calling it w/ through2
2024-05-29 05:08:46 +03:00
Maxim Prokhorov
d6f807d68c scheduler: midnight as default HH:MM
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
2024-05-27 19:10:25 +03:00
Maxim Prokhorov
17a599f91b test: leftover printf 2024-05-27 03:34:50 +03:00
Maxim Prokhorov
c3a26a6241 relay: terminal formatting crash 2024-05-23 02:38:06 +03:00
Maxim Prokhorov
adf018084c scheduler: naming 2024-05-23 02:10:20 +03:00
Maxim Prokhorov
f8ff6f8e9a scheduler: build flags 2024-05-23 02:09:30 +03:00
Maxim Prokhorov
c8c9150b37 scheduler: test handle_today with a future date
github actions just happen to be in pacific time / utc-7 today
2024-05-23 01:40:30 +03:00
Maxim Prokhorov
331c44ad7c scheduler: actually loop through pending schedules 2024-05-23 01:30:13 +03:00
Maxim Prokhorov
414705dff5 sns: remove digital sensor debug flags
amends d9a7743d04
2024-05-23 01:20:15 +03:00
Maxim Prokhorov
271b4638a1 scheduler: formatting 2024-05-23 01:05:16 +03:00
Maxim Prokhorov
02a9ffad9b scheduler: extra state info 2024-05-23 01:01:46 +03:00
Maxim Prokhorov
f3f797f93b scheduler: refactor restore, proper sun state
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
2024-05-23 00:58:36 +03:00
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