Commit Graph

3751 Commits

Author SHA1 Message Date
Maxim Prokhorov
3a1e041f51 gpio: notify about failed locks 2023-03-16 14:45:04 +03:00
Maxim Prokhorov
175c04acc1 system: task'ify every pending dns request
allow more than one request, until lwip api rejects the call
2023-03-15 20:04:01 +03:00
Maxim Prokhorov
8804de2130 utils: redundant implementation 2023-03-15 17:06:13 +03:00
Maxim Prokhorov
8f1c44fe69 sns: decimals aka precision as a setting
see #2550
2023-03-15 17:06:13 +03:00
Maxim Prokhorov
457e47edd9 wifi: dns is not required for static config
see #2582
2023-03-15 17:06:13 +03:00
Maxim Prokhorov
fd7f97eb24 settings: test conversions properly
separate convesions from the main source to allow test builds
extra unit to verify that both duration plain input and
spec work as intended

also fix wdt triggered when unknown symbols are encountered at the end
of duration string (e.g. 10000y)
2023-03-15 17:06:13 +03:00
Maxim Prokhorov
0e8611588b system: generic duration parser and sleep commands
updated duration parser with a fixed type instead of just millis
separate decimal and floating point converter as well, try to avoid
possible precision loss with microseconds use
2023-03-15 17:06:13 +03:00
Maxim Prokhorov
6441a68355 rpn: separate sleep operators 2023-03-15 17:06:13 +03:00
Maxim Prokhorov
83c9df9805 bmx280: suspend and resume
separate branches for i2c search and init
replace optimistic waits with a status check
2023-03-15 17:06:13 +03:00
Maxim Prokhorov
4f72c60b59 system: before and after sleep callbacks 2023-03-15 17:06:13 +03:00
Maxim Prokhorov
6e3baf3061 gpio: short source file paths
leave only the filename itself
2023-03-15 17:06:13 +03:00
Maxim Prokhorov
2f6d7ce3d3 system: light and deep sleep api
see #2578

* deep sleep api without ESP class dependency
* rf + cpu light sleep for cases when deep sleep cannot be used
* generic time-based light sleep; nonos does not halt cpu,
  unlike the wakeup variant. timers also keep going, so
  this has to be used with extra care

pending some 'deferred' variant and before and after sleep actions
2023-03-15 17:06:02 +03:00
Maxim Prokhorov
28f3b7da84 wifi: turned off on boot 2023-03-10 01:00:20 +03:00
Maxim Prokhorov
0ab8c855e2 wifi: revert to no fpm settings 2023-03-10 00:59:19 +03:00
Maxim Prokhorov
be9de1de14 gpio: pin mode getter 2023-03-10 00:55:53 +03:00
Maxim Prokhorov
7bf886541b mhz219: fix response checks and implement range setting
if data size and crc are ok, make sure to notify the caller
rework parameter injection and make sure endianess is right

auto-calibration and range are both a setting and a build flag
2023-03-05 01:55:55 +03:00
Maxim Prokhorov
670b5d68d5 wifi: both light and modem sleep modes are used 2023-02-05 00:49:35 +03:00
Maxim Prokhorov
9789bba923 wifi: shorter keys for forced sleep 2023-02-05 00:44:04 +03:00
Maxim Prokhorov
bb4e74d03f wifi: experiment with forced light sleep
see #2578

make TurnOff action select sleep mode from available settings
wifi.off and wifi.on commands in addition to existing AP & STA

overriding buttons is... problematic?
e.g. selecting LO trigger and existing hw pushbutton GPIO,
we are most likely to trigger long-click event
2023-02-04 21:57:44 +03:00
HamedTa
0db47f5ec9 ina219: fix shift value (#2577)
According to the datasheet, ADC gain bits are [11...12]
2023-01-28 22:45:27 +03:00
Maxim Prokhorov
f21ddba6f0 relay: mqtt handlers are constexpr 2023-01-18 06:14:57 +03:00
Maxim Prokhorov
78c9e6a218 relay: lock and unlock in api 2023-01-18 06:14:56 +03:00
Maxim Prokhorov
d3c113b73d relay: preserve locks when syncing
instead of unlocking everything, remember current locks
also, allow to manually change locks in terminal
2023-01-18 06:14:34 +03:00
Maxim Prokhorov
9211dcd785 system: lock reent object in ctor 2023-01-18 06:14:34 +03:00
Maxim Prokhorov
30f3123cae relay: sync should not unlock already locked relay
instead of flagging sync-in-progress, remember existing locks and
restore after it is done with processing
2023-01-18 06:14:31 +03:00
Maxim Prokhorov
11c897898d relay: properly handle zero interlock time
schedule when >0, execute immediately otherwise
2023-01-17 06:25:53 +03:00
Maxim Prokhorov
e2c8dd7be1 pio: fix dependencies generator
`-mD` is not an option...

`-M -MF $file` can be used together with `-E` to generate a small
makefile-like generator (does not include any compiler flags!) for the
target file so we know which files it would use during compilation
2023-01-17 06:25:53 +03:00
Max Prokhorov
d141a3e5b3 pio: conditional for preprocess target 2023-01-13 06:28:22 +03:00
Maxim Prokhorov
579a5b239b pio: helper to build single-source .E 2023-01-13 02:42:34 +03:00
Maxim Prokhorov
fbd4a9c1be hw: disable uart for maxcio_wde004 2023-01-13 00:22:08 +03:00
Maxim Prokhorov
909949b5cc light: hide extra toggle in webui
amend b5a03dac72
2023-01-12 03:16:07 +03:00
Maxim Prokhorov
faeedee57f hw: missing light-state relays
amend b5a03dac72
2023-01-12 02:49:42 +03:00
Maxim Prokhorov
3513d0468e btn: no newlines in description 2023-01-12 02:35:54 +03:00
Maxim Prokhorov
dca13574d9 lightfox: button provider experiments
another pin provider, similar to analogpin
instead of generating events, use last serial reading (with a timeout)
2023-01-12 02:32:01 +03:00
Maxim Prokhorov
f373e13719 btn: dummy provider and clean-up
events and actions are exportable, internals are not
some internal classes that do not need init through ctor
2023-01-12 01:24:07 +03:00
Maxim Prokhorov
d798052dae ha: fix uninitialized sensor info
and double-check that we really have magnitudes available
fix #2572
2023-01-12 01:09:56 +03:00
Maxim Prokhorov
94fff47d4a relay: missing provider strings 2023-01-11 06:44:37 +03:00
Maxim Prokhorov
fb21386de5 test: warning fixes 2023-01-11 06:08:53 +03:00
Maxim Prokhorov
f387b864da relay: scheduling from system timer does not work
also queue fallback check instead of resolving it in the timer
resolve #2571
2023-01-11 05:47:17 +03:00
Maxim Prokhorov
f55b8f39f3 relay: fix dependencies when disabled 2023-01-11 05:47:17 +03:00
Maxim Prokhorov
ef086ac0fc tuya: (best effort) relay provider 2023-01-11 05:47:17 +03:00
Maxim Prokhorov
9b28d640f7 lightfox: relay provider experiments 2023-01-11 05:47:17 +03:00
Maxim Prokhorov
7362068717 fan: experiment with relay provider
early init plus simple state switch w/ api
2023-01-11 05:47:17 +03:00
Maxim Prokhorov
b5a03dac72 light: experiment with relay state provider
* dynamic relays should not overlap with configuration
* prefer explicit relay configuration vs. dynamic addition

resolve #2568
2023-01-11 05:46:38 +03:00
Maxim Prokhorov
efaf15add3 sch: also fix flash strings 2023-01-10 00:47:35 +03:00
Maxim Prokhorov
7514dee5b0 relay: publish names to mqtt 2023-01-10 00:47:35 +03:00
m-kozlowski
657de76671 dcz: fix flash strings (#2569) 2023-01-02 23:15:16 +03:00
davebuk
68310b6d46 light: value adjustment only works with integers (#2566) 2022-12-19 20:55:56 +03:00
Maxim Prokhorov
312c3ef2ba test: bump esp8266 version used for unit tests 2022-12-12 15:13:25 +03:00
Maxim Prokhorov
24c3ff8954 test: arduinojson header 2022-12-12 14:29:22 +03:00