Преглед изворни кода

Default brightness for rgbw mode to follow white brightness or full.

Defaulting to 0 causes the light to go out when first going into colour mode,
and it is necessary to use the brightness control to recover.
Jason Rumney пре 3 година
родитељ
комит
58fdd0e819
1 измењених фајлова са 3 додато и 1 уклоњено
  1. 3 1
      custom_components/tuya_local/generic/light.py

+ 3 - 1
custom_components/tuya_local/generic/light.py

@@ -221,7 +221,9 @@ class TuyaLocalLight(TuyaLocalEntity, LightEntity):
                     **settings,
                     **settings,
                     **self._color_mode_dps.get_values_to_set(self._device, color_mode),
                     **self._color_mode_dps.get_values_to_set(self._device, color_mode),
                 }
                 }
-            rgbw = params.get(ATTR_RGBW_COLOR, self.rgbw_color or (0, 0, 0, 0))
+            rgbw = params.get(
+                ATTR_RGBW_COLOR, self.rgbw_color or (0, 0, 0, self.brightness or 255)
+            )
             brightness = params.get(ATTR_BRIGHTNESS, rgbw[3])
             brightness = params.get(ATTR_BRIGHTNESS, rgbw[3])
             fmt = self._rgbhsv_dps.format
             fmt = self._rgbhsv_dps.format
             if rgbw and fmt:
             if rgbw and fmt: