Repository navigation
feat: add independent morning and evening color temperature plateaus - #1642
Open
Charles-HL wants to merge 4 commits into
Open
Charles-HL wants to merge 4 commits into
Charles-HL wants to merge 4 commits into
Conversation
Add `color_temp_plateau_morning` and `color_temp_plateau_evening` (seconds, default 0, max 12h). They keep `max_color_temp` for that long before / after solar noon, and compress the ramp from/to `min_color_temp` at sunrise/sunset so the curve stays continuous and smooth. Each side is independent, only the color temperature is affected (not brightness, sleep mode or the night), and the default (0) is bit-for-bit identical to the previous behavior. Each plateau is clamped to 90% of the half-day so the ramp never collapses.
Contributor
[Medium impact] The PR appears safe to merge; no actionable issues were found. SummaryAdds independent morning and evening periods that hold color temperature at
No actionable issues found. Tests were reviewed but not run.
|
Charles-HL
force-pushed
the
feat/color-temperature-plateau
branch
from
October 18, 2026 21:27
046a4d5 to
919b4c7
Compare
Add the optional color_temp_fixed_plateau_kelvin setting (between min_color_temp and max_color_temp) for the fixed evening schedule. The daytime maximum is kept; after it the color temperature descends along the regular afternoon curve, reaches the target exactly and holds it for the last hour before color_temp_fixed_plateau_end, whatever the season, then eases to min_color_temp as before. The curve is sped up when the regular one would be too late (summer), without any step. Unset keeps the previous behavior. Validated in the options flow, YAML, the stored configuration and the change_switch_settings service, with services, translations and docs.
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Motivation
Today the color temperature follows the sun position, so it only touches
max_color_tempat a single instant (solar noon). For lights where the cool value is the most useful one (for example a kitchen at 4000 K), it is not possible to stay there for a few hours without changing the temperature range or giving up smooth ramps.What this adds
Two independent duration options, in seconds (same unit as
sunrise_offsetandbrightness_mode_time_*), default0:color_temp_plateau_morningmax_color_tempcolor_temp_plateau_eveningmax_color_tempTwo optional local wall-clock options, which must be set together:
color_temp_fixed_plateau_endmax_color_tempcolor_temp_fixed_descent_endmin_color_tempOne optional temperature, which needs the two fixed times:
color_temp_fixed_plateau_kelvinmin_color_tempandmax_color_temp) held for the last hour beforecolor_temp_fixed_plateau_end, instead ofmax_color_tempThe fixed schedule allows, for example, keeping a kitchen at 4000 K until 21:00 and descending to 2700 K by 23:00 throughout the year. It only affects color temperature. The existing solar curve remains the default when the two fields are unset.
All options are available in YAML, the options flow, and
change_switch_settings; service metadata, documentation and English translations are included.Behavior and validation
color_temp_fixed_plateau_kelvinthe daytime maximum is not capped: after it the temperature descends along the regular afternoon curve, reaches the target exactly and holds it for the last hour before the plateau end in every season (the curve is traversed faster when the regular one would be too late, e.g. in summer), then eases down to the minimum. No step anywhere; unset keeps the previous behavior. It is ignored on a day where the plateau end is less than one hour after solar noon. The target must lie betweenmin_color_tempandmax_color_temp(re-checked when they change) and needs both fixed times.Tests
Full component suite: 814 passed. Ruff lint passes for the modified files.