4365 Commits

Author SHA1 Message Date
DmitryBlinov
0f73df7c36 garland: set animation interval from 7 to 12 sec 2021-02-26 16:52:03 +03:00
DmitryBlinov
3fe6874863 garland: improve anim_assemble 2021-02-26 16:51:57 +03:00
DmitryBlinov
dad8878ccf garland: disable software watchdog
prevent Soft WDT exception with long strips
2021-02-26 16:51:53 +03:00
DmitryBlinov
660ae138d4 garland: fix Stars animation with more than 255 leds 2021-02-26 16:51:20 +03:00
Maxim Prokhorov
7434ea3878 lights: finish up provider settings
get rid of LIGHT_CHANNELS, but keep channel setting for the my92xx
also clean up recent changes, channel command did not actually work
2021-02-10 20:05:13 +03:00
Maxim Prokhorov
00b470bc83 lights: always check for transformation flags
amend bdbd127bfb
2021-02-09 23:50:10 +03:00
Maxim Prokhorov
009021118b lights: fix my92xx build 2021-02-09 22:17:41 +03:00
Maxim Prokhorov
bdbd127bfb lights: handle value transformations in the transition 2021-02-09 22:06:41 +03:00
Maxim Prokhorov
ec5311c850 lights: terminal output specific values 2021-02-09 21:36:01 +03:00
Maxim Prokhorov
f6527e4325 lights: fix channel description, remove tags table from globals 2021-02-09 13:49:34 +03:00
Maxim Prokhorov
489813864e lights: match original rtcmem union layout 2021-02-09 13:48:47 +03:00
Maxim Prokhorov
ecaa5fa457 lights: explain the brightness stub and fix the gcc-4.8.2 build 2021-02-09 12:26:20 +03:00
Maxim Prokhorov
5c620723dd lights: one more try at fixing the boot sequence
Make sure 'custom provider' `lightAdd()` scheduled function locks further channel modifications,
and take care of light sanity checks before the light update is even scheduled.

Reworked rtcmem reader / writer to use default values, instead of accidentaly using
the unitialized mem of the stack. Also, reworked const names used by the lights module
to distinguish them from the build flags.
2021-02-08 21:39:46 +03:00
Maxim Prokhorov
af4477999d lights: allow to trigger an update when brightness is 0 2021-02-06 08:37:09 +03:00
Maxim Prokhorov
012c3818a5 tuya: send channel value directly 2021-02-06 05:53:52 +03:00
Maxim Prokhorov
b35a565126 lights: fix changing channel value while state is the same 2021-02-06 05:53:31 +03:00
Maxim Prokhorov
0f723b0248 settings: handle old keys in the respective modules
fixes #2419
2021-02-06 04:44:26 +03:00
Maxim Prokhorov
12747bf8ce lights: fix inconsistent code generation with gcc-4.8.2
Make sure transition is always pushed into the vector the same way

Only happens with ESPURNA_BUILD_SINGLE_SOURCE=1:

/home/runner/.platformio/packages/toolchain-xtensa/xtensa-lx106-elf/include/c++/4.8.2/bits/vector.tcc:405:31: error: __c causes a section type conflict with __c
    _M_check_len(size_type(1), __EXCSTR("vector::_M_emplace_back_aux"));
                               ^
/home/runner/.platformio/packages/toolchain-xtensa/xtensa-lx106-elf/include/c++/4.8.2/bits/vector.tcc:71:23: note: '__c' was declared here
  __throw_length_error(__EXCSTR(__N("vector::reserve")));
2021-02-06 04:44:25 +03:00
Maxim Prokhorov
b3d9168b4a pio: bump to espressif8266 @ 2.6.3 2021-02-06 04:44:25 +03:00
Maxim Prokhorov
34d63c155d lights: refactor my92xx mapping build flags 2021-02-06 04:44:25 +03:00
Maxim Prokhorov
1fa10cd7cf lights: fix my92xx channel setup 2021-02-06 04:44:25 +03:00
Maxim Prokhorov
c01fbeb8ae mqtt: make sure json topic is unique 2021-02-06 04:44:25 +03:00
Maxim Prokhorov
b4093418f4 lights: no need for a generic function when we only map for pwm 2021-02-06 04:44:25 +03:00
Maxim Prokhorov
2f39d0db8a lights: refactor providers
- make sure we have custom provider before calling the update,
replace old check in the update function
- fix race condition in the provider function, causing complete lock-up of
lights controls (triggered by sending light updates very fast. for example,
using arrow keys with the webui sliders; ref. #2424)
- rework state change functions to work using loop() func instead of a
pair of scheduled functions. we should not go out-of-sync now, and it
also avoids forcibly creating std::func object each invocation
- rework other providers to be more in line with custom callbacks -
introduce state, value and update calls as a common way to handle lights
- correctly handle state change when turning OFF and ON
- update tuya to store the last state, never send channel values when OFF (ref. #2424)
2021-02-06 04:43:35 +03:00
Maxim Prokhorov
aece6a99b1 ws: don't flood the log with actions
also, clean-up PGM_P usage and just use `const char*` instead
2021-02-06 01:20:09 +03:00
Maxim Prokhorov
4486f82f09 lights: terminal commands clean-up
- fix argc checks in state
- use ctx as output for commands
- show state when calling without args
2021-02-06 01:20:09 +03:00
Maxim Prokhorov
3dfa06ead1 webui: fix favicon mime type
inline-source uses 'image/ico' otherwise
supposed to be fixed upstream via the usage of type="image/x-icon" as
link attribute, but there's no npmjs release yet
2021-02-04 12:03:26 +03:00
Maxim Prokhorov
05cc081b7d rfm69: fix warning when building 2021-01-28 21:24:20 +03:00
Maxim Prokhorov
19947c1231 rfb: allow to use <code>,<times> in rfbON# / rfbOFF#
ref. #2423
2021-01-28 18:56:29 +03:00
Maxim Prokhorov
52a244db6e rfb: commands to send the code 2021-01-28 01:32:20 +03:00
Maxim Prokhorov
10519cc276 hw: keep serial disabled with the sonoff rfbridge
ref. #2423
2021-01-27 01:43:59 +03:00
Maxim Prokhorov
92d5e7becb tuya: build defaults based on #2414 discussion 2021-01-26 14:28:12 +03:00
Maxim Prokhorov
1b4e515575 ws: send time_t as string, more in the comment
amend c100696f7b
2021-01-26 02:05:18 +03:00
Maxim Prokhorov
4d157ccd5b ha: discovery refactoring
- retain setting
- generate topic and message in the discovery object instead of
creating them all at once
- re-implement relays, lights and sensors discovery
- rework name normalization, use relative magnitude indexes
- replace original lights code with schema: json, subscribe to a special
topic to handle lights instead of using the common API
(still wip - colors, hs, temperature settings)

resolve #630
resolve #1564
resolve #2403
2021-01-26 01:02:49 +03:00
Maxim Prokhorov
0b43af8ed9 ha: fix build with current String implementation 2021-01-24 03:53:16 +03:00
Maxim Prokhorov
125ca6f9b3 rfm69: cleanup and bump version 2021-01-24 03:38:02 +03:00
Maxim Prokhorov
e50b6fe79a mdns: clean-up 2021-01-24 03:38:02 +03:00
Maxim Prokhorov
7ba1283024 mqtt: clean-up json queueing
- simply use a basic {String, String} struct
- fix MQTT_TOPIC_TIME vs. MQTT_TOPIC_DATETIME
- get rid of unused chaining and indexes
2021-01-24 03:38:02 +03:00
Maxim Prokhorov
f4726d9966 sys: default heartbeat mode to repeat 2021-01-24 03:38:02 +03:00
Maxim Prokhorov
1960df21fb sys: some more header cleanup 2021-01-24 03:38:02 +03:00
Maxim Prokhorov
1685b0350c sys: hide internal details from the header 2021-01-24 03:38:02 +03:00
Maxim Prokhorov
021f0afb86 sys: clean-up system-specific functions
- shrink utils source file, move heartbeat and boot management into system
- improvise with 'heartbeat' functionality. include scheduler implementation that will
manage the per-module heartbeat callbacks with individual 'mode' and
'interval' settings. current ones are mqtt (including relays, lights, thermostat), debug and
influxdb. preserve heartbeat NONE, ONCE and REPEAT, REPEAT_STATUS is effectively a hbReport & status bit.
- mqtt heartbeat is managed through mqttHeartbeat() callbacks
- tweak mqtt callbacks to use lists instead of the vector, slighly reducing the size of the .bin
- update WebUI, include report setting and update hbMode values
- make sure general.h settings include new heartbeat,
move constant definitions outside of the header
- correctly include dependencies through the .cpp, avoid leaking
internal details.
- as a side-effect, base headers are no longer included recursively
2021-01-24 03:38:02 +03:00
Maxim Prokhorov
c4f0ceb1ae sys: refactor custom reset codes 2021-01-23 21:28:01 +03:00
Maxim Prokhorov
660493a1db settings: fixup 4abcec8a2b
- for some reason old key was default-constructible
- fix magnitude key generation
2021-01-21 14:33:36 +03:00
Maxim Prokhorov
14da395724 rpn: update to support 64bit time_t
- specialize ntp functions to split time_t into 32bit ints when time_t is larger than rpn_int
- rework 'tick' variable into an operator that can be triggered once
- make sure operators expect new time_t split via argc of 2
2021-01-21 13:51:11 +03:00
Maxim Prokhorov
d6bd9ed993 ntp: pointless const 2021-01-21 13:51:11 +03:00
Maxim Prokhorov
c179467be2 ntp: do not override existing ntpTZ 2021-01-21 13:51:11 +03:00
Maxim Prokhorov
e8e58b821c ntp: more checks when using DHCP servers
- make sure server is never empty
- disable dhcp option when server *is* empty
- update configure() to detect both tz and server changes
2021-01-21 11:38:44 +03:00
Maxim Prokhorov
c9a951068b settings: fix gcc-4.8.2 builds 2021-01-21 10:00:52 +03:00
Maxim Prokhorov
071131260f pio: specify revision as prerelease 2021-01-20 23:39:28 +03:00