Skip to content

feat: add Color Temperature mode for white-only IR lights#2

Open
mzspicoli wants to merge 2 commits into
Infinitte:mainfrom
mzspicoli:feature/color-temperature-mode
Open

feat: add Color Temperature mode for white-only IR lights#2
mzspicoli wants to merge 2 commits into
Infinitte:mainfrom
mzspicoli:feature/color-temperature-mode

Conversation

@mzspicoli
Copy link
Copy Markdown

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.py

  • New light_mode selector on the first setup step: rgb (default, existing behaviour) or color_temperature
  • When color_temperature is selected, the colors step is replaced by a new color_temp step with three optional IR button fields:
    • Warm White (~2700 K)
    • Natural White (~4000 K)
    • Cool White (~6500 K)
  • Options flow mirrors the same logic so existing entries can be reconfigured

light.py

  • In color_temperature mode the entity advertises ColorMode.COLOR_TEMP with a 2700–6500 K range, giving the UI a proper colour temperature slider instead of the HS colour wheel
  • Exposes the color_temp_kelvin property
  • New _async_map_color_temp_to_button method: finds the closest configured button to the requested kelvin value and presses it
  • RGB/HS path is untouched — no breaking changes for existing setups

How 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 rgb entries are unaffected — light_mode defaults to rgb when absent, so no migration needed.

🤖 Generated with Claude Code

Matheus and others added 2 commits May 12, 2026 18:59
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>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Feature Request: White Color Temperature Support (Warm / Natural / Cool White)

1 participant