Support kelvin light color-temp attributes (HA 2026.3+) - #33
Merged
Conversation
HA 2026.3 removed the mired light attributes (color_temp, min_mireds, max_mireds) and the color_temp turn_on parameter in favour of the kelvin equivalents, so Hemera's color-temp control silently disappeared for lamps on updated servers. Read path (LightEntity): prefer the legacy mired attributes when present, otherwise derive them from color_temp_kelvin / min_/max_color_temp_kelvin (reciprocal conversion; bounds invert). Write path (LightController): send color_temp_kelvin, accepted by HA since 2022.11 so it covers every version Hemera supports. Both old and new servers now work. Co-Authored-By: Claude Opus 4.8 (1M context) <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.
Changes
LightEntity.update(from:): read the kelvin color-temp attributes (color_temp_kelvin,min_color_temp_kelvin,max_color_temp_kelvin) as a fallback, deriving mireds from them when the legacy mired attributes are absent. Legacy mireds are still preferred when present.LightController.setColorTemp: sendcolor_temp_kelvininstead of the removedcolor_temp(mireds) service parameter.LightEntityTestscases covering kelvin-derived (inverted) bounds and legacy-mireds-preferred.Why
HA 2026.3 removed the mired light attributes (
color_temp,min_mireds,max_mireds) and thecolor_templight.turn_onparameter in favour of the kelvin equivalents. Hemera read/wrote only mireds, so the color-temp control silently disappeared for lamps on updated servers. This restores it while keeping older (mireds-only) servers working.Notes
color_temp_kelvinhas been accepted bylight.turn_onsince HA 2022.11, so the single kelvin write path covers every version Hemera supports — no dual write needed.