New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[WLED] Fix Nightlight sleep timer to use default time #11389
Conversation
Code looks good. |
What firmware version has it been tested to work on? I suspect it has changed how it operates since I tested with an older firmware as if you look at the API and the replies back from a camera you will see that NL=1 means it is enabled and not that the 1 is a time in minutes. happy for it to be merged but I suspect it will fix a newer firmware whilst breaking anyone on the older firmware so if you can reply with version I can look at abstracting the Api to its own class and then extend the class to be different per version. I think this is going to be needed for this fast moving project. The opensprinkler binding has an example of how the api class can be extended for each firmware version so all versions keep working. |
Sorry, forgot to mention I tested on the latest stable 0.12.0. Looking into Aircookies code i don't think &ND will break older versions but the oldest version I can find on github is 0.10.0 here: https://github.com/Aircoookie/WLED/blob/71886c162b7df2ce027b32c0334b83152e39884c/wled00/set.cpp#L571 |
Firmware 0.11.1 test results: &NL=1 over writes the default value so any change to using &ND still uses 1min and not the default amount. Agree this is bug. Both &ND and &ND&NL=1 work here so either one I'll approve and leave it up to you to choose. I am pretty sure I was triggering the sleep when I went to bed and the Christmas tree would fade over a 2 hour time so perhaps it is in 0.8 or 0.9 when I was doing that.... As mentioned the idea is to abstract it as there are features like the preset cycle that used to be in the firmware that are now removed so the sooner we change to something that can be extended and it will mean people that pull out lights from last Christmas find they still work each year. If we find an issue we can deal with it then, thanks for the bug fix. |
Please also consider correct signing of your PR. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
For a single line change and a new contributor, I believe the DCO is not a requirement ??? EDIT: Sorry only for grammer/typo mistakes.
https://www.openhab.org/docs/developer/contributing.html#sign-your-work
Please do what this post explains.
https://community.openhab.org/t/dco-check-signing-off-with-github-web-editor-explanation/83330
Based on WLED API (https://kno.wled.ge/interfaces/http-api/) current handler uses NL=1 so sleep timer is hard coded to 1 minute. Should be default (ND) to use configured time in WLED. Fixes openhab#11389 Signed-off-by: Sven Jensen <github@s7j.de>
Based on WLED API (https://kno.wled.ge/interfaces/http-api/) current handler uses NL=1 so sleep timer is hard coded to 1 minute. Should be default (ND) to use configured time in WLED. Fixes openhab#11389 Signed-off-by: Sven Jensen <github@s7j.de>
Based on WLED API (https://kno.wled.ge/interfaces/http-api/) current handler uses NL=1 so sleep timer is hard coded to 1 minute. Should be default (ND) to use configured time in WLED. Fixes openhab#11389 Signed-off-by: Sven Jensen <github@s7j.de> Signed-off-by: Sven Jensen <sven@s7j.de>
Sorry for the commit mess - just executed the commands the DCO recommended! Let me know if there is an easy way to fix the rebase. |
The easiest way I would suggest is to remove your branch, recreate it, reapply your change, commit and force a push ;) |
Based on WLED API (https://kno.wled.ge/interfaces/http-api/) current handler uses NL=1 so sleep timer is hard coded to 1 minute. Should be default (ND) to use configured time in WLED. Fixes openhab#11389 Signed-off-by: Sven Jensen <github@s7j.de>
Thanks for the git crash course. Done! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
Code change is very small and the build of the binding is successful on my local machine, so I merge the PR while the remote build system is currently broken. |
Based on WLED API (https://kno.wled.ge/interfaces/http-api/) current handler uses NL=1 so sleep timer is hard coded to 1 minute. Should be default (ND) to use configured time in WLED. Fixes openhab#11389 Signed-off-by: Sven Jensen <github@s7j.de> Co-authored-by: Sven Jensen <github@s7j.de>
Based on WLED API (https://kno.wled.ge/interfaces/http-api/) current handler uses NL=1 so sleep timer is hard coded to 1 minute. Should be default (ND) to use configured time in WLED. Fixes openhab#11389 Signed-off-by: Sven Jensen <github@s7j.de> Co-authored-by: Sven Jensen <github@s7j.de> Signed-off-by: Dave J Schoepel <dave@theschoepels.com>
Based on WLED API (https://kno.wled.ge/interfaces/http-api/) current handler uses NL=1 so sleep timer is hard coded to 1 minute. Should be default (ND) to use configured time in WLED. Fixes openhab#11389 Signed-off-by: Sven Jensen <github@s7j.de> Co-authored-by: Sven Jensen <github@s7j.de> Signed-off-by: Nick Waterton <n.waterton@outlook.com>
Based on WLED API (https://kno.wled.ge/interfaces/http-api/) current handler uses NL=1 so sleep timer is hard coded to 1 minute. Should be default (ND) to use configured time in WLED. Fixes openhab#11389 Signed-off-by: Sven Jensen <github@s7j.de> Co-authored-by: Sven Jensen <github@s7j.de>
Based on WLED API (https://kno.wled.ge/interfaces/http-api/) current handler uses NL=1 so sleep timer is hard coded to 1 minute. Should be default (ND) to use configured time in WLED. Fixes openhab#11389 Signed-off-by: Sven Jensen <github@s7j.de> Co-authored-by: Sven Jensen <github@s7j.de>
Based on WLED API (https://kno.wled.ge/interfaces/http-api/) current handler uses NL=1 so sleep timer is hard coded to 1 minute. Should be default (ND) to use configured time in WLED. Fixes openhab#11389 Signed-off-by: Sven Jensen <github@s7j.de> Co-authored-by: Sven Jensen <github@s7j.de>
[WLED] Fix Nightlight sleep timer to use default time
Based on WLED API (https://kno.wled.ge/interfaces/http-api/) current handler uses NL=1 so sleep timer is hard coded to 1 minute. Should be default (ND) to use configured time in WLED.