Commit Graph

4423 Commits

Author SHA1 Message Date
Maxim Prokhorov
a518080a99 ci: missing file github240830 2024-08-30 13:03:39 +03:00
Maxim Prokhorov
845d9892f2 ci: fixup release builds 2024-08-30 12:59:40 +03:00
Maxim Prokhorov
11358fd591 build: web support string without the embedded html 2024-08-30 12:54:38 +03:00
Maxim Prokhorov
58b3992108 ci: webui blobs as artifacts 2024-08-30 12:46:13 +03:00
Maxim Prokhorov
4809038217 sch: search same & next hour only w/ local schedules 2024-08-30 12:03:11 +03:00
Maxim Prokhorov
96ac2b8060 ci: silly warnings 2024-08-29 17:30:10 +03:00
Maxim Prokhorov
0ee5deb043 docs: changelog 2024-08-29 17:27:48 +03:00
Maxim Prokhorov
a8f4faf903 sch: common cleanup for events 2024-08-29 17:26:56 +03:00
Maxim Prokhorov
30ae346a19 sch: events in mqtt & api
also changes internal timestamp to minutes instead of seconds
no mqtt publish, though, w/ retain defaults and no settings back-up
2024-08-29 17:26:56 +03:00
Maxim Prokhorov
eea56d7a0c sch: inconsistent DST <-> SDT transition when searching
- 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
2024-08-29 17:18:31 +03:00
Maxim Prokhorov
8aba3b8730 sch: event funcs must be implemented
leftover from original impl attempt
2024-08-24 23:42:58 +03:00
Maxim Prokhorov
cf4c656019 sch: parse already validated datetime inline
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
2024-08-24 23:42:43 +03:00
Maxim Prokhorov
cfb83300d0 test: node does not like when gc closes files
> (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
2024-08-24 01:57:41 +03:00
Maxim Prokhorov
812ff5a800 pio: pin script replacement to framework version instead of platform
don't replace w/ git version
2024-08-24 01:06:01 +03:00
Maxim Prokhorov
b3bc053e52 pio: workaround py3.12+ syntax warnings
core 2.7.4 elf2bin patches w/ subprocess.run
temporary workaround for -latest, pending 3.2.0 release
2024-08-24 00:50:06 +03:00
Maxim Prokhorov
dd525f1770 sch: offset list elements 2024-08-23 23:32:43 +03:00
Maxim Prokhorov
b4f77038aa docs: changelog 2024-08-23 23:05:26 +03:00
Maxim Prokhorov
90827850be relay: timer & pulse instead of toggle param
- 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
2024-08-23 23:01:01 +03:00
Maxim Prokhorov
81d561ef11 docs: changelog 2024-08-23 21:42:22 +03:00
Maxim Prokhorov
37596eb436 sch: missing tests for zero offset 2024-08-23 21:30:20 +03:00
Maxim Prokhorov
dfc9fe693e sch: formatting 2024-08-23 21:24:27 +03:00
Maxim Prokhorov
76916e8eaf docs: changelog 2024-08-23 00:11:59 +03:00
Maxim Prokhorov
7b83a48aa0 core: bump version 2024-08-22 23:41:31 +03:00
Maxim Prokhorov
b09f6543db webui: rebuild blobs 2024-08-22 23:40:38 +03:00
Maxim Prokhorov
2f255c042f webui: same-ey fields for host & ip addresses, fix message alignment 2024-08-22 23:40:32 +03:00
Maxim Prokhorov
8edb7b6333 sch: relative time spec for events
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)
2024-08-22 23:40:31 +03:00
Maxim Prokhorov
a8033568fd dt: tm <-> datetime conversion 2024-08-22 23:40:31 +03:00
Maxim Prokhorov
24ebcb8430 sch: fix schedule discarded early w/ sun support 2024-08-22 23:40:31 +03:00
Maxim Prokhorov
868d4886ed sys: durations & parsing in the same namespace
not part of settings directly, move them some place else
types compilation unit grows, though...
2024-08-22 23:40:31 +03:00
Maxim Prokhorov
a439e023ef dt: export offset getter 2024-08-21 03:49:05 +03:00
Maxim Prokhorov
f82cd2211e sch: restore offset for closest, not earliest match in a day
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
2024-08-15 14:49:17 +03:00
Maxim Prokhorov
71493cc9cb webui: heartbeat select[multiple] with everything in view
explicit size aka number of rows
2024-08-14 13:42:09 +03:00
Maxim Prokhorov
4c005fa9a5 webui: fix password reveal pushed to the next line
narrow screens style rule makes input & span `display: block`
revert to `inline-block`, assume parent node properly separates stuff
2024-08-13 20:59:11 +03:00
Maxim Prokhorov
5334739469 webui: key->value element setters with node root
allow to init limited set of elements, not whole document
update tests for 08f521dc35
2024-08-13 17:53:26 +03:00
Maxim Prokhorov
08f521dc35 webui: ignore group inputs when using generic setters
input[name=foo] means input[name=foo#] in groups, never name as-is
resolve #2615
2024-08-11 13:58:10 +03:00
Maxim Prokhorov
6bfed33469 webui: some margin between checkboxes and info messages 2024-08-10 11:40:20 +03:00
Maxim Prokhorov
0c52a808cc sns: safeguard against size zero
probably would not happen b/c of config restrains, but...
2024-08-10 00:28:24 +03:00
Maxim Prokhorov
5f500ffb1c webui: apply pure-menu-selected style after menu item click
- distinguish heading and selected menu item, apply menu item
  background color after panel item is selected
  for now, both heading and :first-child use a different color
- add x3 transition time to stall animation from hover & focus
  otherwise, background colors may linger between clicks
2024-08-09 22:03:00 +03:00
Maxim Prokhorov
bd1f734494 sch: unused code 2024-08-09 15:03:59 +03:00
Maxim Prokhorov
47221ecd49 webui: rebuild blobs 2024-08-09 14:54:19 +03:00
Maxim Prokhorov
1041bcb26e webui: correctly send NaN and compress numeric strings
convert NaN into "nan" string for remote, since JSON does not have NaN type
always -2bytes from quotes surrounding the numeric value
2024-08-09 14:53:24 +03:00
Maxim Prokhorov
29787143bf webui: expected emon app keys leaking into settings
disable on-change listener for webui-only inputs
also assuming input[readonly]s never needs to be commited
2024-08-09 14:25:19 +03:00
Maxim Prokhorov
c4c31fc5f0 sns: numeric settings are using fixed ids
Fixing inconsistent handling of group and non-group settings after rewrite.
Assuming most of the time template would be for group, manually reset
dataset field controlling automatic key${id} generation
2024-08-09 13:46:04 +03:00
Maxim Prokhorov
018db60fbc sns: zero threshold check does not trigger report 2024-08-09 13:45:02 +03:00
Maxim Prokhorov
fc8ef5a298 sns: min & max threshold, revert zero threshold changes
- same as min & max delta, check the value itself before reporting
- refactor more of the report func, revert zero threshold to force the
  value to be zero. move condition check to the top, causing every other
  filter to check against zero.
- force zero threshold to be >= 0 in ui
2024-08-09 12:47:31 +03:00
Maxim Prokhorov
404a0ea17d webui: rebuild blobs 2024-08-09 12:47:31 +03:00
Maxim Prokhorov
68892a0066 all: remove extra whitespace 2024-08-09 12:47:31 +03:00
Maxim Prokhorov
658286f7b7 sns: no brackets for read and report values info 2024-08-09 12:46:10 +03:00
Maxim Prokhorov
66842bd3e7 sns: fix struct init
gcc4.8 is uncertain whether it is a double or a struct
2024-08-09 12:46:10 +03:00
Maxim Prokhorov
2d3bba9e01 utils: more duration types and shorter uptime string 2024-08-09 12:46:10 +03:00