diff --git a/homeassistant/components/deconz/light.py b/homeassistant/components/deconz/light.py index a15aeb5a059..95a97959d5b 100644 --- a/homeassistant/components/deconz/light.py +++ b/homeassistant/components/deconz/light.py @@ -39,7 +39,22 @@ from .hub import DeconzHub DECONZ_GROUP = "is_deconz_group" EFFECT_TO_DECONZ = { EFFECT_COLORLOOP: LightEffect.COLOR_LOOP, - "None": LightEffect.NONE, + "none": LightEffect.NONE, + # Specific to Philips Hue + "candle": LightEffect.CANDLE, + "cosmos": LightEffect.COSMOS, + "enchant": LightEffect.ENCHANT, + "fire": LightEffect.FIRE, + "fireplace": LightEffect.FIREPLACE, + "glisten": LightEffect.GLISTEN, + "loop": LightEffect.LOOP, + "opal": LightEffect.OPAL, + "prism": LightEffect.PRISM, + "sparkle": LightEffect.SPARKLE, + "sunbeam": LightEffect.SUNBEAM, + "sunrise": LightEffect.SUNRISE, + "sunset": LightEffect.SUNSET, + "underwater": LightEffect.UNDERWATER, # Specific to Lidl christmas light "carnival": LightEffect.CARNIVAL, "collide": LightEffect.COLLIDE, @@ -208,8 +223,17 @@ class DeconzBaseLight[_LightDeviceT: Group | Light]( if device.effect is not None: self._attr_supported_features |= LightEntityFeature.EFFECT self._attr_effect_list = [EFFECT_COLORLOOP] - if device.model_id in ("HG06467", "TS0601"): - self._attr_effect_list = XMAS_LIGHT_EFFECTS + + # For lights that report supported effects. + if isinstance(device, Light): + if device.supported_effects is not None: + self._attr_effect_list = [ + EFFECT_TO_DECONZ[el] + for el in device.supported_effects + if el in EFFECT_TO_DECONZ + ] + if device.model_id in ("HG06467", "TS0601"): + self._attr_effect_list = XMAS_LIGHT_EFFECTS @property def color_mode(self) -> str | None: diff --git a/tests/components/deconz/snapshots/test_light.ambr b/tests/components/deconz/snapshots/test_light.ambr index b5a9f7b5543..a3ec7caac60 100644 --- a/tests/components/deconz/snapshots/test_light.ambr +++ b/tests/components/deconz/snapshots/test_light.ambr @@ -1400,7 +1400,12 @@ 'area_id': None, 'capabilities': dict({ 'effect_list': list([ - 'colorloop', + , + , + , + , + , + , ]), 'max_color_temp_kelvin': 6535, 'max_mireds': 500, @@ -1448,7 +1453,12 @@ 'color_temp_kelvin': None, 'effect': None, 'effect_list': list([ - 'colorloop', + , + , + , + , + , + , ]), 'friendly_name': 'Gradient light', 'hs_color': tuple( diff --git a/tests/components/deconz/test_light.py b/tests/components/deconz/test_light.py index 441cb01be63..8ce83d87b69 100644 --- a/tests/components/deconz/test_light.py +++ b/tests/components/deconz/test_light.py @@ -413,7 +413,7 @@ async def test_light_state_change( ATTR_ENTITY_ID: "light.hue_go", ATTR_XY_COLOR: (0.411, 0.351), ATTR_FLASH: FLASH_LONG, - ATTR_EFFECT: "None", + ATTR_EFFECT: "none", }, }, {