-
-
Notifications
You must be signed in to change notification settings - Fork 145
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
Add adapt_brightness_until_sleep
and adapt_color_temp_until_sleep
#566
base: main
Are you sure you want to change the base?
Conversation
supports backward-compatibility
…olt/adaptive-lighting into adjust_adapt_until_sleep
…/basnijholt/adaptive-lighting into adjust_adapt_until_sleep" This reverts commit bca9f1b, reversing changes made to 840aab6.
transition_brightness_until_sleep
as the original option only modified cttransition_brightness_until_sleep
and transition_color_temp_until_sleep
@basnijholt Your code to autofill all the docs is absolutely beautiful. |
…olt/adaptive-lighting into adjust_adapt_until_sleep
transition_brightness_until_sleep
and transition_color_temp_until_sleep
adapt_brightness_until_sleep
and adapt_color_temp_until_sleep
adapt_brightness_until_sleep
and adapt_color_temp_until_sleep
adapt_brightness_until_sleep
and adapt_color_temp_until_sleep
@@ -26,7 +26,9 @@ | |||
"initial_transition": "initial_transition: Duration of the first transition when lights turn from `off` to `on` in seconds. ⏲️", | |||
"sleep_transition": "sleep_transition: Duration of transition when \"sleep mode\" is toggled in seconds. 😴", | |||
"transition": "transition: Duration of transition when lights change, in seconds. 🕑", | |||
"transition_until_sleep": "transition_until_sleep: When enabled, Adaptive Lighting will treat sleep settings as the minimum, transitioning to these values after sunset. 🌙", | |||
"transition_until_sleep": "transition_until_sleep: This option ignores the current state of the sleep switch. When enabled, Adaptive Lighting will treat sleep settings as the minimum, transitioning color temperature to these values after sunset. 🌙", |
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.
option ignores the current state of the sleep switch
When looking at the code, this is not obvious to me. Nor is it clear why this is desired behavior.
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.
I do apologize! It's difficult to write concise and clear documentation when the space to do so seems so limiting.
How's this?
Adaptive lighting changes your lights based on where the sun is in the sky. Normally, it stops changing your lights when the sun sets, but now with a new setting called "transition_until_sleep," it will gradually transition your lights to help you get ready for bed. Normally, these sleep settings are only used when you manually turn on sleep mode. With "transition_until_sleep," your lights will gradually dim until midnight, and then get brighter again in the morning.
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.
Typically, adaptive lighting systems cease its adaptation after sunset, resulting in a potentially abrupt transition in lighting conditions. However, when the config option "transition_until_sleep," is true, adaptive lighting can continue to adapt to the user's environment beyond the sunset, gradually decreasing the color temperature of the lighting system to the user's preferred sleep settings. The adaptive lighting sleep settings are normally accessed using the adaptive_lighting.sleep_mode switch, which is typically activated by the user or automation when sleep mode is desired. The configuration option "transition_until_sleep" allows the adaptive lighting system to smoothly transition to the sleep settings, maintain those settings until midnight, and subsequently transition to the standard adaptive lighting values for the sunrise period.
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.
Unfortunately, for the HA UI to display it properly, it needs to be brief. My proposal:
When enabled, Adaptive Lighting will treat sleep settings as the minimum, transitioning to these values after sunset instead of stopping at
min_color_temp
. 🌙
Also does this PR work when using color_temp
during the day and sleep_rgb_color
for the sleep switch?
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.
Actually, I have a better idea. Let's remove transition_until_sleep
and only have the two options you added.
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.
transition_until_sleep
is the combined form of adapt_brightness_until_sleep
and adapt_color_until_sleep
.
So it should be removed if we don't need to support backward compatibility. I've no opinion either way, but the PR in its current form will support backwards compatibility. It has only been a week though so that probably doesn't matter.
Another option is perhaps to soft-remove it? Leave it in the main code but remove it from the documentation?
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.
I think a breaking change here would be fine especially since we only introduced it ≈1-2 weeks ago. We should just make it clear in the release notes.
Added two more config options to support @igiannakas 's PR as that one only modified color temp.
transition_color_temp_until_sleep
will default toTrue
while the other defaults toFalse
to support backward compatibility