feat: add Color Temperature mode for white-only IR lights#2
Open
mzspicoli wants to merge 2 commits into
Open
Conversation
Adds an optional Color Temperature mode for lights that only have warm/natural/cool white buttons and no RGB. When selected during setup, the integration exposes a color_temp slider (2700–6500 K) instead of the HS color wheel, and maps the requested kelvin to the closest configured IR button. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…emp slider Replace the continuous color_temp slider with a named effect dropdown (Warm White / Natural White / Cool White). This gives the user explicit discrete selection matching the 3 physical IR buttons, and avoids the misleading impression of infinite intermediate positions. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
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.
Summary
Closes #1
This PR adds an optional Color Temperature mode for IR-controlled lights that only have warm/natural/cool white buttons and no RGB — exactly the use case described in #1 (Moes UFO-R11 with white-only LED bars).
What changed
config_flow.pylight_modeselector on the first setup step:rgb(default, existing behaviour) orcolor_temperaturecolor_temperatureis selected, the colors step is replaced by a newcolor_tempstep with three optional IR button fields:light.pycolor_temperaturemode the entity advertisesColorMode.COLOR_TEMPwith a 2700–6500 K range, giving the UI a proper colour temperature slider instead of the HS colour wheelcolor_temp_kelvinproperty_async_map_color_temp_to_buttonmethod: finds the closest configured button to the requested kelvin value and presses itHow it works
When the user drags the slider (e.g. to 3200 K), the integration calculates which of the configured buttons (warm 2700 K, natural 4000 K, cool 6500 K) is closest and presses that IR command. Buttons that weren't configured are simply skipped.
Backwards compatibility
Existing
rgbentries are unaffected —light_modedefaults torgbwhen absent, so no migration needed.🤖 Generated with Claude Code