This returns the number of seconds remaining in the nightlight in the
"rem" field of the nightlight ("nl") state. If there is no nightlight
active, it returns -1.
The previous code only looked for certain keywords in the topic instead of comparing it completely.
For example if mqttDeviceTopic is set to "lights/colorRGB" the MQTT interface is unusable because
the search for "/col" will always return a match and therefore any MQTT command is interpreted as
a color.
The new code checks the full topic.
This controller uses ESP8285 with 2MB built-in flash.
Features:
- LED string is connected to GPIO3,
- On/off button connected to GPIO1,
- Built-in transistors to drive non-addressable R-G-B-Wc-Ww strips
(by default not connected, only pads are present).
Signed-off-by: Lech Perczak <lech.perczak@gmail.com>
- Colorful effect now supports palettes
- Added C9 2 palette (#1291)
- Improved C9 palette brightness by 12%
- Disable onboard LED if LEDs are off (PR #1245)
- Added optional status LED (PR #1264)
- Realtime max. brightness now honors brightness factor (fixes#1271)
- Updated ArduinoJSON to 6.17.0
* Disable onboard LED when LEDs are not in use
* Remove unused variable
* Only disable onboard LED if LEDPIN == LED_BUILTIN
* Change LEDPIN to LED_BUILTIN
* Rawframe edit:
* - TESTED ON WLED VS.0.10.1 - WHERE ONLY PRESET 16 SAVES SEGMENTS - some macros may not be needed if this changes.
* - Code has been modified as my usage changed, as such it has poor use of functions vs if thens, but feel free to change it for me :)
*
* Edited to SWITCH between two lighting scenes/modes : STANDBY and HIGHLIGHT
*
* Usage:
* - Standby is the default mode and Highlight is activated when the PIR detects activity.
* - PIR delay now set to same value as Nightlight feature on boot but otherwise controlled as normal.
* - Standby and Highlight brightness can be set on the fly (default values set on boot via macros calling presets).
* - Macros are used to set Standby and Highlight states (macros can load saved presets etc).
*
* - Macro short button press = Highlight state default (used on boot only and sets default brightness).
* - Macro double button press = Standby state default (used on boot only and sets default brightness).
* - Macro long button press = Highlight state (after boot).
* - Macro 16 = Standby state (after boot).
*
* ! It is advised not to set 'Apply preset at boot' or a boot macro (that activates a preset) as we will call our own macros on boot.
*
* - When the strip is off before PIR activates the strip will return to off for Standby mode, and vice versa.
* - When the strip is turned off while in Highlight mode, it will return to standby mode. (This behaviour could be changed easily if for some reason you wanted the lights to go out when the pir is activated).
* - Macros can be chained so you could do almost anything, such as have standby mode also turn on the nightlight function with a new time delay.
*
* Segment Notes:
* - It's easier to save the segment selections in preset than apply via macro while we a limited to preset 16. (Ie, instead of selecting sections at the point of activating standby/highlight modes).
* - Because only preset 16 saves segments, for now we are having to use additional macros to control segments where they are involved. Macros can be chained so this works but it would be better if macros also accepted json-api commands. (Testing http api segment behaviour of SS with SB left me a little confused).
*
* Future:
* - Maybe a second timer/timetable that turns on/off standby mode also after set inactivity period / date & times. For now this can be achieved others ways so may not be worth eating more processing power.
* A separate socket for UDP api has been added. This uses the same API as HTML. Commands for Loxone were added to the API.
* html files for udp api newly generated
* codm pixel controller board configurations added to platformio.ini file
* Parser for LX/LY commands adapted. Calculation of the values corrected. Segment handling for LX/LY removed.
* Lox parser moved to own file. Lox parser added to the JSON api. Within a segment LX and LY are now supported.
* serial port removed
* F() macro added
Co-authored-by: Marius Groos <marius.groos@codm.de>
* Add touch option to button handler
* Check if touch is pressed in setup
* Add TOUCHPIN build env and override example
Co-authored-by: Aircoookie <dev.aircoookie@gmail.com>
* Allow modem sleep if power off and sleep permitted
* Only add auto modem sleep handling for ESP8266
* Add comment and remove redundant condition
Co-authored-by: Aircoookie <cschwinne@gmail.com>