From d57932e8e40c687e10e51b533f685d7760302c2d Mon Sep 17 00:00:00 2001 From: dim145 Date: Sat, 4 Jan 2025 04:13:47 +0100 Subject: [PATCH] fix: do not use deprecated attr in light entity --- custom_components/localtuya/light.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/custom_components/localtuya/light.py b/custom_components/localtuya/light.py index bc70594..bad9d72 100644 --- a/custom_components/localtuya/light.py +++ b/custom_components/localtuya/light.py @@ -9,12 +9,12 @@ import voluptuous as vol from homeassistant.components.ecobee.humidifier import MODE_MANUAL from homeassistant.components.light import ( ATTR_BRIGHTNESS, - ATTR_COLOR_TEMP, ATTR_EFFECT, ATTR_HS_COLOR, DOMAIN, LightEntity, - LightEntityFeature, ColorMode, + LightEntityFeature, + ColorMode, ) from homeassistant.const import CONF_BRIGHTNESS, CONF_COLOR_TEMP, CONF_SCENE @@ -408,10 +408,10 @@ class LocaltuyaLight(LocalTuyaEntity, LightEntity): states[self._config.get(CONF_COLOR)] = color states[self._config.get(CONF_COLOR_MODE)] = MODE_COLOR - if ATTR_COLOR_TEMP in kwargs and (features & ColorMode.RGB): + if ColorMode.COLOR_TEMP in kwargs and ColorMode.COLOR_TEMP in self.supported_color_modes: if brightness is None: brightness = self._brightness - mired = int(kwargs[ATTR_COLOR_TEMP]) + mired = int(kwargs[ColorMode.COLOR_TEMP]) if self._color_temp_reverse: mired = self._max_mired - (mired - self._min_mired) if mired < self._min_mired: