CTRange: recompute the warm/cool split for the new range - #2231
Merged
openshwprojects merged 1 commit intoSep 16, 2026
Merged
Conversation
openshwprojects
approved these changes
Sep 16, 2026
|
🎉 This PR is included in version 1.18.313 🎉 The release is available on GitHub release Your semantic-release bot 📦🚀 |
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.
I wanted these bulbs to keep their last color temperature and come on at full when the power is physically turned on at the light switch. That means flag 12 plus a startup command of
backlog CTRange 154 370; led_dimmer 100; led_enableAll 1. These are four-PWM style bulbs without dedicated cool LEDs, so flag 24 (LED_EMULATE_COOL_WITH_RGB) synthesises cool white from the color channels. Instead they came back at the wrong temperature with the RGB and warm LEDs both lit, where at 2700 K the warm LED should be carrying it alone, pulling ~14 W instead of ~9 W at the wall.CTRangeupdates min/max but never recomputes the warm/cool split derived from the old range.Before
After
This happens on every boot when
CTRangeis in a startup command, since the saved temperature is restored beforeCTRangeruns.Nothing here is specific to emulated cool white - any device whose range changes after a temperature is set gets the stale split. It is just very noticeable on these four-PWM bulbs, where a wrong cool value lights the color LEDs outright.
bApplyisfalsebecausetruealso forcesLight_Temperature. I tried that first and a bulb showing red jumped straight to warm white on the nextCTRange, so the apply only runs when we are already in temperature mode.