Explorar o código

Light: don't change effect if it is the same as current effect.

When scenes are used, the effect always comes with it. In many cases, the
effect is "off", which matches multiple color modes. Avoid changes to the
color mode as a side effect of this HA scene behaviour.

Issue #3086
Jason Rumney hai 10 meses
pai
achega
9ae55460dd
Modificáronse 1 ficheiros con 1 adicións e 1 borrados
  1. 1 1
      custom_components/tuya_local/light.py

+ 1 - 1
custom_components/tuya_local/light.py

@@ -412,7 +412,7 @@ class TuyaLocalLight(TuyaLocalEntity, LightEntity):
                 }
                 }
             elif not self._effect_dps:
             elif not self._effect_dps:
                 effect = params.get(ATTR_EFFECT)
                 effect = params.get(ATTR_EFFECT)
-                if effect:
+                if effect and effect != self.effect:
                     if effect == EFFECT_OFF:
                     if effect == EFFECT_OFF:
                         # Turn off the effect. Ideally this should keep the
                         # Turn off the effect. Ideally this should keep the
                         # previous mode, but since the mode is shared with
                         # previous mode, but since the mode is shared with