Commit Graph

3838 Commits

Author SHA1 Message Date
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
Maxim Prokhorov
6c382d7259 dallas: per-device sensor instance
ref. #2543
search the bus preemptively and create sensor instances based on that
more clean-up for error handling, allow specific device to fail independently

most of the sensor was re-written
- general one-wire operations are part of the system driver now
- split class definitions for digital and temperature sensors
- system timer instead of polling, enforce ordering by forcing specific
  instance to handle conversion request, while notifying every other ones
- synchronize readings and conversion requests with the sensor reading
  interval, instead of relying on internal polling. now, it happens
  right after begin() and pre() instead of previosly (almost) random tick() calls
- auto-detect conversion time based on device resolution / resolution setting

initialization also adds runtime settings (read on boot)
- `dallasPin` to set current one-wire pin
- `dallasParasite` to change from non-powered mode (default is still on)
- `dallasResolution` to force sensor to be operated using 9...12bit res
  (0 to keep default one)
2024-03-19 19:51:53 +03:00
Maxim Prokhorov
f7e2977c45 sns: external driver for onewire devices 2024-03-19 19:51:53 +03:00
Maxim Prokhorov
89fd41d6c8 sns: notify hook
either timed or instant callbacks, intended to be called from within the
sensor itself or by any other module needing to 'ping' sensor instance
2024-03-19 19:51:53 +03:00
Maxim Prokhorov
569da85713 types: helper class for contiguous ranges of T 2024-03-19 19:51:53 +03:00
Maxim Prokhorov
573caf014d sys: json data corruption when using sv 2024-03-19 19:51:53 +03:00
Maxim Prokhorov
84a4640567 light: typo 2024-03-19 19:51:53 +03:00
Maxim Prokhorov
8e1554556a ha: fix weird scoping error w/ gcc4.8 2024-03-19 19:51:53 +03:00
Maxim Prokhorov
452cd78c41 ha: handle homeassistant/status
birth message should trigger discovery, enabled by default
ref. #1637

clean-up discovery code to properly re-init when something goes wrong
also restore manual discovery trigger from WebUI
2024-03-19 19:51:35 +03:00
Maxim Prokhorov
e9ab0a8240 bmx280: separate funcs for readings
instead of one giant read func, use magnitude-specific ones
ref. datasheet, adc read failure should have a different constant,
and does not warrant re-init
2024-03-17 22:42:25 +03:00
Maxim Prokhorov
37d2837937 dallas: fix device struct initialization 2024-02-08 22:27:41 +03:00
Maxim Prokhorov
2ea47de36e dallas: do not wait until value() to report errors
sensor loop assumes value(index) value is ok
ref. #2543

move all checks to pre(), value() returns pre-read value
- tick() and pre() are allowed to fail specific device
- pre() would fail the sensor if any of devices fail
- value(index) is never reached unless tick() and pre() succeed
2024-02-08 22:17:38 +03:00
Maxim Prokhorov
7152cc67a8 sns: BaseFilter::status()
no real reason to expose internal state, just report filter readiness
2024-02-08 22:17:38 +03:00
Maxim Prokhorov
a33c71b62b sns: special cases for median-average filter 2024-02-08 22:17:38 +03:00
Maxim Prokhorov
97921403d0 sns: filter resize should reset internal state 2024-02-08 22:17:38 +03:00
Maxim Prokhorov
872f9b6534 sns: always reset readings on cfg reload 2024-02-08 22:17:38 +03:00
Maxim Prokhorov
aa74de8843 sns: moving average should be an average
ref. #2543
2024-02-08 22:17:38 +03:00
Maxim Prokhorov
b44c293fca test: expected sensor filter values 2024-02-08 22:17:38 +03:00
Maxim Prokhorov
0d4cf9a7c1 sns: simple filters with capacity of 1 2024-02-08 22:17:38 +03:00
Maxim Prokhorov
0f5fc5acc3 test: allow double comparison in tests 2024-02-08 22:17:38 +03:00
Maxim Prokhorov
686728a329 rfb: ,<REPEATS> parser fix 2024-02-08 22:17:38 +03:00
Maxim Prokhorov
70e8f91205 debug: fix webui headers included without WEB_SUPPORT=1 2024-02-08 22:17:38 +03:00
Maxim Prokhorov
f13df63f38 compat: fix -std=gnu++20 2024-02-08 22:17:38 +03:00
Dmitry
238dc130af garland: fixes and updates (#2600)
* garland: fix issue with division by zero in first scene setup

* garland: update setters code

* garland: fix web UI

* garland: update scene default settings

* garland: update palettes, add random run animation

* garland: enable and update anim_glow

* garland: update anim_spread

* garland: add anim_crossing

* garland: get rid of redundant variables in main class

* garland: provide anims with all palettes

* garland: unify anim_waves and anim_run to use ColorWave class

* garland: update format for color_wave.h and garland.cpp

* graland: update anim code with clear rands and auto counters

* garland: implement pixel caching for color waves to reduce redundant calculations

* garland: fix anim dolphins out of range issue

* garland: tune anim comets

* garland: combine all wave-based anims; add wave comet anim

* garland: fixes for PR notes
2024-01-20 22:23:05 +03:00
Dmitry
1e765d7e68 thermostat: clean-up and build fixes (#2601)
- update library esp8266-oled-ssd1306 to the latest version
- fix thermostat build issues
- simplify and clarify thermostat control logic
- add logs to thermostat control logic
2023-12-20 19:39:45 +03:00
Maxim Prokhorov
f3c3efca4a dcz: typo in relay settings key
resolve #2596
2023-11-05 00:37:45 +03:00
Maxim Prokhorov
be74757710 scripts: no need for pytz to generate tz list 2023-10-17 03:43:30 +03:00
Maxim Prokhorov
5531b93269 terminal: fix linkage, printing cmd-not-found and add tests 2023-10-17 01:57:40 +03:00
Maxim Prokhorov
00973160a2 uart: typo 2023-10-17 01:32:03 +03:00