From c93c1339bf470a28f076c098178e491e74f44614 Mon Sep 17 00:00:00 2001 From: Bander <46300268+xZetsubou@users.noreply.github.com> Date: Sat, 10 Feb 2024 10:40:41 +0300 Subject: [PATCH] Handle brightness value if mode is not white. xZetsubou/hass-localtuya#114 --- custom_components/localtuya/light.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/custom_components/localtuya/light.py b/custom_components/localtuya/light.py index 72d282b7f..1961c7b14 100644 --- a/custom_components/localtuya/light.py +++ b/custom_components/localtuya/light.py @@ -337,7 +337,7 @@ async def async_turn_on(self, **kwargs): self._lower_brightness, self._upper_brightness, ) - if self.is_white_mode: + if self.is_white_mode or self.dp_value(CONF_COLOR) is None: states[self._config.get(CONF_BRIGHTNESS)] = brightness else: if self.__is_color_rgb_encoded():