@@ -1001,6 +1001,8 @@ class HueLight(Light):
1001
1001
manufacturers = {"Philips" , "Signify Netherlands B.V." },
1002
1002
)
1003
1003
class HueEffectLight (HueLight ):
1004
+ """Specialization of a HUE light with effects."""
1005
+
1004
1006
# Supported effects and their ID used in commands
1005
1007
HUE_EFFECTS = {"candle" : 1 , "fireplace" : 2 , "prism" : 3 }
1006
1008
@@ -1020,6 +1022,7 @@ def __init__(
1020
1022
self ._effect_list .extend (self .HUE_EFFECTS .keys ())
1021
1023
1022
1024
async def async_turn_on (self , ** kwargs : Any ) -> None :
1025
+ """Turn the entity on."""
1023
1026
# If only change of brightness is requested, the effect doesn't have to be interupted
1024
1027
if kwargs .get (ATTR_BRIGHTNESS ) is not None and all (
1025
1028
attr == ATTR_BRIGHTNESS or kwargs .get (attr ) is None for attr in kwargs
@@ -1040,8 +1043,8 @@ async def async_turn_on(self, **kwargs: Any) -> None:
1040
1043
)
1041
1044
self ._effect = effect
1042
1045
elif (
1043
- effect is None or effect == EFFECT_OFF and self . _effect in self . HUE_EFFECTS
1044
- ):
1046
+ effect is None or effect == EFFECT_OFF
1047
+ ) and self . _effect in self . HUE_EFFECTS :
1045
1048
# Only stop effect if it was started by us
1046
1049
# Following command will stop the effect while preserving brightness
1047
1050
await self ._hue_cluster .multicolor (data = bytearray ([0x20 , 0x00 , 0x00 , 0x00 ]))
0 commit comments