From da0454e24ef24b1dd42850af04e5b9b8f57a9b95 Mon Sep 17 00:00:00 2001 From: epenet <6771947+epenet@users.noreply.github.com> Date: Mon, 9 Dec 2024 22:40:16 +0100 Subject: [PATCH] Migrate limitlessled lights to use Kelvin (#132689) --- homeassistant/components/limitlessled/light.py | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/homeassistant/components/limitlessled/light.py b/homeassistant/components/limitlessled/light.py index c6b3301081d..5f771a53e86 100644 --- a/homeassistant/components/limitlessled/light.py +++ b/homeassistant/components/limitlessled/light.py @@ -19,7 +19,7 @@ import voluptuous as vol from homeassistant.components.light import ( ATTR_BRIGHTNESS, - ATTR_COLOR_TEMP, + ATTR_COLOR_TEMP_KELVIN, ATTR_EFFECT, ATTR_FLASH, ATTR_HS_COLOR, @@ -38,7 +38,11 @@ import homeassistant.helpers.config_validation as cv from homeassistant.helpers.entity_platform import AddEntitiesCallback from homeassistant.helpers.restore_state import RestoreEntity from homeassistant.helpers.typing import ConfigType, DiscoveryInfoType -from homeassistant.util.color import color_hs_to_RGB, color_temperature_mired_to_kelvin +from homeassistant.util.color import ( + color_hs_to_RGB, + color_temperature_kelvin_to_mired, + color_temperature_mired_to_kelvin, +) _LOGGER = logging.getLogger(__name__) @@ -325,12 +329,14 @@ class LimitlessLEDGroup(LightEntity, RestoreEntity): else: args["color"] = self.limitlessled_color() - if ATTR_COLOR_TEMP in kwargs: + if ATTR_COLOR_TEMP_KELVIN in kwargs: assert self.supported_color_modes if ColorMode.HS in self.supported_color_modes: pipeline.white() self._attr_hs_color = WHITE - self._attr_color_temp = kwargs[ATTR_COLOR_TEMP] + self._attr_color_temp = color_temperature_kelvin_to_mired( + kwargs[ATTR_COLOR_TEMP_KELVIN] + ) args["temperature"] = self.limitlessled_temperature() if args: