2222 DOMAIN as PLATFORM_DOMAIN ,
2323 LightEntity ,
2424 LightEntityFeature ,
25- SUPPORT_EFFECT ,
2625)
2726from homeassistant .config_entries import ConfigEntry
2827from homeassistant .const import STATE_ON
@@ -132,7 +131,7 @@ def __init__(self, config, old_style: bool):
132131 self ._attr_supported_color_modes .add (ColorMode .ONOFF )
133132
134133 if config .get (CONF_SUPPORT_EFFECT ):
135- self ._attr_supported_features |= SUPPORT_EFFECT
134+ self ._attr_supported_features |= LightEntityFeature . EFFECT
136135 self ._attr_effect_list = self ._config .get (CONF_INITIAL_EFFECT_LIST )
137136
138137 def _create_state (self , config ):
@@ -151,7 +150,7 @@ def _create_state(self, config):
151150 self ._attr_color_mode = ColorMode .COLOR_TEMP
152151 self ._attr_color_temp_kelvin = config .get (CONF_INITIAL_COLOR_TEMP )
153152 self ._attr_brightness = config .get (CONF_INITIAL_BRIGHTNESS )
154- if self ._attr_supported_features & SUPPORT_EFFECT :
153+ if self ._attr_supported_features & LightEntityFeature . EFFECT :
155154 self ._attr_effect = config .get (CONF_INITIAL_EFFECT )
156155
157156 def _restore_state (self , state , config ):
@@ -168,7 +167,7 @@ def _restore_state(self, state, config):
168167 if self ._attr_color_mode == ColorMode .COLOR_TEMP :
169168 self ._attr_color_temp_kelvin = state .attributes .get (ATTR_COLOR_TEMP_KELVIN , config .get (CONF_INITIAL_COLOR_TEMP ))
170169 self ._attr_brightness = state .attributes .get (ATTR_BRIGHTNESS , config .get (CONF_INITIAL_BRIGHTNESS ))
171- if self ._attr_supported_features & SUPPORT_EFFECT :
170+ if self ._attr_supported_features & LightEntityFeature . EFFECT :
172171 self ._attr_effect = state .attributes .get (ATTR_EFFECT , config .get (CONF_INITIAL_EFFECT ))
173172
174173 def _update_attributes (self ):
@@ -211,7 +210,7 @@ async def async_turn_on(self, **kwargs: Any) -> None:
211210 self ._attr_color_mode = ColorMode .ONOFF
212211
213212 effect = kwargs .get (ATTR_EFFECT , None )
214- if effect is not None and self ._attr_supported_features & SUPPORT_EFFECT :
213+ if effect is not None and self ._attr_supported_features & LightEntityFeature . EFFECT :
215214 self ._attr_effect = effect
216215
217216 self ._attr_is_on = True
0 commit comments