From c492a1617179fab2eaa7774bced8f7461586ea1a Mon Sep 17 00:00:00 2001 From: Alone Date: Wed, 20 Mar 2024 13:38:23 +0800 Subject: [PATCH] =?UTF-8?q?=F0=9F=92=A1=20fix=20color=20mode=20for=20light?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- custom_components/xiaomi_miot/light.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/custom_components/xiaomi_miot/light.py b/custom_components/xiaomi_miot/light.py index 7eaf31054..55afc5f8a 100644 --- a/custom_components/xiaomi_miot/light.py +++ b/custom_components/xiaomi_miot/light.py @@ -103,7 +103,7 @@ def __init__(self, config: dict, miot_service: MiotService, **kwargs): if prop := self._miot_service.spec.get_property(prop): self._prop_color = prop - self._attr_color_mode = ColorMode.UNKNOWN + self._attr_color_mode = None self._attr_supported_color_modes = set() self._is_percentage_color_temp = None if self._prop_color_temp: @@ -174,7 +174,7 @@ def turn_on(self, **kwargs): ret = self.set_property(self._prop_brightness, bri) else: ret = self.set_property(self._prop_power, True) - self._attr_color_mode = ColorMode.UNKNOWN + self._attr_color_mode = None if self._prop_brightness and ATTR_BRIGHTNESS in kwargs: brightness = kwargs[ATTR_BRIGHTNESS]