Commit Graph

4122 Commits

Author SHA1 Message Date
Maxim Prokhorov
bd2e52af87 rfb: fix code api passing invalid string length
broken in c45a1ec097 converting from ptr to sv
point to the null char, not the actual buffer storage end

resulting sv length is off-by-one, unless converted to a string obj
2024-12-28 05:09:26 +03:00
Maxim Prokhorov
332d29bdf4 sch: keep sun .last from updating when .next stays the same
update tests & externalize event hanlding implementation
prevent spurious .last == .next when .next never did or cannot happen

ref. 758ff844, in case update routine is called repeatedly
ref. #2629, 'event' should output coherent values
2024-12-07 18:08:44 +03:00
Maxim Prokhorov
758ff844a6 sch: skip next day search w/ valid sunrise or sunset 2024-12-07 16:56:35 +03:00
Maxim Prokhorov
6500f45d59 ota: fix -latest build
enum case only valid for -git, both -latest and base should be excluded
2024-12-07 15:21:10 +03:00
Maxim Prokhorov
930b130e63 ota: condition typo & fix END version check 2024-12-07 14:44:13 +03:00
Maxim Prokhorov
df0c6aaac4 sch: dump internal events by name
also try to simplify .size() branching
2024-12-07 14:34:55 +03:00
Maxim Prokhorov
2fb3e30d70 sch: record last action when restoring 2024-12-07 14:18:07 +03:00
Maxim Prokhorov
bb9fac1e7e ota: arduinoota error strings 2024-12-07 14:05:06 +03:00
Maxim Prokhorov
fa5af86d0e webui: lint eqeqeq 2024-12-07 11:50:26 +03:00
Maxim Prokhorov
8a37e2f259 webui: rebuild blobs 2024-11-29 20:05:30 +03:00
Maxim Prokhorov
66e8867033 sch: capitalized type name 2024-11-29 20:05:30 +03:00
Maxim Prokhorov
c8ebbbd697 web: trying to fix lingering validity message
reset custom validity state when editing the input box
2024-11-29 20:05:30 +03:00
Maxim Prokhorov
442346708d web: dynamic types and fpstr to sv conversions
de-hardcode sch and led enumeration types from .html
publish raw type & pretty-string from .cpp indexed settings

de-fpstr string view references, use the object directly

publish 'faulty' schedule specs indexes, focus & report elems
ref. #2626

should fix faulty enum<->number references in selects
ref. #2628 - schedule types were numeric, while websocket delivered strings
2024-11-29 20:05:30 +03:00
Maxim Prokhorov
017f4999ae sch: validate spec as either calendar or relative
amend d818be690261ffebee7164ba0cc76ded53b95494
verify and use schedule type before parsing

ref. #2626
2024-11-29 20:05:30 +03:00
Maxim Prokhorov
3a95040c61 sch: common output for terminal events 2024-11-29 20:05:30 +03:00
Maxim Prokhorov
c0347666ae sch: validate time strings on reload and on boot
ref. #2626
2024-11-29 20:05:30 +03:00
Maxim Prokhorov
f409248812 sch: init sun event at boot & schedule checks
ref. #2629, relative events are not properly initialized
ref. #2626 schedule check <PART1> <PART2> to manually validate schedules
2024-11-29 20:05:30 +03:00
Maxim Prokhorov
eb5041a810 sch: sun event next<->last swap only when valid 2024-11-29 20:05:30 +03:00
Maxim Prokhorov
e0db9fdbf7 types: delimiter scanner class
move generic code to a shared header (and not as part of terminal)
move core-specific code to the class itself
2024-11-29 20:05:30 +03:00
Maxim Prokhorov
316a608410 types: const vs. non-const type disparity for vectors 2024-11-29 20:05:30 +03:00
Maxim Prokhorov
9f76314dca types: span::slice & helpers 2024-11-29 20:05:30 +03:00
Maxim Prokhorov
2a40e505fc test: clean-up esp8266 repo & version bump 2024-11-29 20:04:09 +03:00
Maxim Prokhorov
79fa00424d sns: unused arg 2024-11-07 18:49:41 +03:00
Maxim Prokhorov
734087c92c sns: helper method for analogRead voltage 2024-11-07 18:49:26 +03:00
Maxim Prokhorov
bf51dbcd69 sns: analog samples ms -> micros
incorrect time delay for emon sensors using ::analogRead(A0)
2024-11-07 18:43:07 +03:00
Maxim Prokhorov
a1ffa9f47c sns: experiment with delayed analog readings
ref. #2625
incorrect average calculation in the loop, sum and divide for the result
spend time in tick() instead of waiting in either pre() or value()
2024-11-07 18:40:39 +03:00
Maxim Prokhorov
0976bdba10 sns: static constexpr inline variables
amend 49cd7fc3f4
feature flag dependency instead of minimal std version

also see #2624
2024-11-05 16:35:00 +03:00
Maxim Prokhorov
dc9ba63295 sns: optional address method
preserve existing ones where it is possible to retrieve some unique id
drop the other ones as it is the only device on the bus already
2024-10-24 20:01:36 +03:00
Maxim Prokhorov
3cdccfad8d test: parse one frame of a02yyu 2024-10-24 11:48:35 +03:00
toniSg
36e00df272 sns: DYP A02YYU ultrasonic sensor (#2622)
* a02yyu: add support for DYP-A02YYU ultrasonic sensor

* a02yyu: add missing defines

* a02yyu: fix type from char to uint8-t

* a02yyu: simplify read() implementation

* a02yyu: cosmetic reordering of sensor defines
2024-10-24 11:14:41 +03:00
Maxim Prokhorov
abccb314e9 webui: package .json version bump
resolve #2621
resolve #2619

specifically, bump jsdom to 25.0.1 to fix tough-cookie dependabot trigger
2024-10-22 10:06:28 +03:00
Maxim Prokhorov
8d115c0063 sns: fixup cse7766 calibration status err 2024-10-22 09:30:57 +03:00
Maxim Prokhorov
766477f512 test: deprecated implementation 2024-10-22 09:29:40 +03:00
Maxim Prokhorov
2611b6294f test: emon sensor parser test
sensor_emon .ipp for energy and kwh & ws objects
system_time .h for clock definitions. delay not implemented (yet)

ignoring energy calc for the current test, since samples are out-of-sync
also ignoring timeout state, as it syncs with the clock time
2024-10-22 09:28:42 +03:00
Maxim Prokhorov
6327fecfd7 test: stream echo class 2024-10-21 07:51:52 +03:00
Maxim Prokhorov
e3ea08b1ee sns: basesensor without app config header dep 2024-10-21 07:01:09 +03:00
Maxim Prokhorov
ac01afc8f0 sch: stall sunrise & sunset calc when continiously failing
- do not completely fail when either sunrise or sunset missing
  keep what is valid, fall through otherwise
- more event:: helpers for internal comparison
  fix missing to_minutes when comparing update time
2024-09-16 02:15:51 +03:00
Maxim Prokhorov
0b18a332a3 sch: prefer time point to seconds as time_t alternative 2024-09-16 00:43:46 +03:00
Maxim Prokhorov
fc998f97a2 sch: datetime context to time point and back 2024-09-16 00:36:35 +03:00
Maxim Prokhorov
3147508a19 sch: display calendar events in terminal 2024-09-16 00:32:24 +03:00
Maxim Prokhorov
d997cb2c20 sch: fix sun incompatible fmod arguments
use stdlib cmath when building on host
bump to unity 2.6.0 to fix isnan conflict with stdlib
2024-09-16 00:31:16 +03:00
Maxim Prokhorov
949611a47e sch: use native type for event time points
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
2024-09-16 00:28:28 +03:00
Maxim Prokhorov
c4f0d0101e telnet: flush timeout
commented, but not implemented
2024-09-15 18:37:07 +03:00
Maxim Prokhorov
6e14dee583 mqtt: config error should disconnect
logic error from the original impl
2024-09-15 18:37:07 +03:00
Maxim Prokhorov
c1090c2e71 sys: polled timer with and without ready-check
- 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
2024-09-15 18:37:07 +03:00
Maxim Prokhorov
737e76a736 mqtt: clean session flag 2024-09-14 01:51:32 +03:00
Maxim Prokhorov
3b6f0a5a67 light: token split as external func 2024-09-14 01:42:43 +03:00
Maxim Prokhorov
412fc58867 mqtt: attempt to reconfigure in the main loop
- flag is not automatically rescheduled, do so manually
- fix mdns _mqtt._tcp polling without timer being rescheduled
2024-09-14 01:42:43 +03:00
Maxim Prokhorov
9427286a9b webui: rebuild blobs 2024-09-10 16:54:30 +03:00
Maxim Prokhorov
9dd1ced846 mqtt: typo in sync client build 2024-09-10 16:41:28 +03:00