From 549afbc27ec482ddfdb0166c00ef6efbbe19e393 Mon Sep 17 00:00:00 2001 From: epenet <6771947+epenet@users.noreply.github.com> Date: Mon, 9 Dec 2024 12:55:39 +0100 Subject: [PATCH] Use ATTR_COLOR_TEMP_KELVIN in baf light (#132692) --- homeassistant/components/baf/light.py | 13 ++++--------- 1 file changed, 4 insertions(+), 9 deletions(-) diff --git a/homeassistant/components/baf/light.py b/homeassistant/components/baf/light.py index 2fb36ed874f..10450df1ba2 100644 --- a/homeassistant/components/baf/light.py +++ b/homeassistant/components/baf/light.py @@ -8,16 +8,13 @@ from aiobafi6 import Device, OffOnAuto from homeassistant.components.light import ( ATTR_BRIGHTNESS, - ATTR_COLOR_TEMP, + ATTR_COLOR_TEMP_KELVIN, ColorMode, LightEntity, ) from homeassistant.core import HomeAssistant, callback from homeassistant.helpers.entity_platform import AddEntitiesCallback -from homeassistant.util.color import ( - color_temperature_kelvin_to_mired, - color_temperature_mired_to_kelvin, -) +from homeassistant.util.color import color_temperature_kelvin_to_mired from . import BAFConfigEntry from .entity import BAFEntity @@ -94,8 +91,6 @@ class BAFStandaloneLight(BAFLight): async def async_turn_on(self, **kwargs: Any) -> None: """Turn on the light.""" - if (color_temp := kwargs.get(ATTR_COLOR_TEMP)) is not None: - self._device.light_color_temperature = color_temperature_mired_to_kelvin( - color_temp - ) + if (color_temp := kwargs.get(ATTR_COLOR_TEMP_KELVIN)) is not None: + self._device.light_color_temperature = color_temp await super().async_turn_on(**kwargs)