mirror of
https://github.com/home-assistant/core.git
synced 2025-07-17 10:17:09 +00:00
Support Lidl christmas light effects in deCONZ (#102731)
This commit is contained in:
parent
b37253b206
commit
a691bd26cf
@ -38,7 +38,27 @@ from .deconz_device import DeconzDevice
|
|||||||
from .gateway import DeconzGateway, get_gateway_from_config_entry
|
from .gateway import DeconzGateway, get_gateway_from_config_entry
|
||||||
|
|
||||||
DECONZ_GROUP = "is_deconz_group"
|
DECONZ_GROUP = "is_deconz_group"
|
||||||
EFFECT_TO_DECONZ = {EFFECT_COLORLOOP: LightEffect.COLOR_LOOP, "None": LightEffect.NONE}
|
EFFECT_TO_DECONZ = {
|
||||||
|
EFFECT_COLORLOOP: LightEffect.COLOR_LOOP,
|
||||||
|
"None": LightEffect.NONE,
|
||||||
|
# Specific to Lidl christmas light
|
||||||
|
"carnival": LightEffect.CARNIVAL,
|
||||||
|
"collide": LightEffect.COLLIDE,
|
||||||
|
"fading": LightEffect.FADING,
|
||||||
|
"fireworks": LightEffect.FIREWORKS,
|
||||||
|
"flag": LightEffect.FLAG,
|
||||||
|
"glow": LightEffect.GLOW,
|
||||||
|
"rainbow": LightEffect.RAINBOW,
|
||||||
|
"snake": LightEffect.SNAKE,
|
||||||
|
"snow": LightEffect.SNOW,
|
||||||
|
"sparkles": LightEffect.SPARKLES,
|
||||||
|
"steady": LightEffect.STEADY,
|
||||||
|
"strobe": LightEffect.STROBE,
|
||||||
|
"twinkle": LightEffect.TWINKLE,
|
||||||
|
"updown": LightEffect.UPDOWN,
|
||||||
|
"vintage": LightEffect.VINTAGE,
|
||||||
|
"waves": LightEffect.WAVES,
|
||||||
|
}
|
||||||
FLASH_TO_DECONZ = {FLASH_SHORT: LightAlert.SHORT, FLASH_LONG: LightAlert.LONG}
|
FLASH_TO_DECONZ = {FLASH_SHORT: LightAlert.SHORT, FLASH_LONG: LightAlert.LONG}
|
||||||
|
|
||||||
DECONZ_TO_COLOR_MODE = {
|
DECONZ_TO_COLOR_MODE = {
|
||||||
@ -47,6 +67,25 @@ DECONZ_TO_COLOR_MODE = {
|
|||||||
LightColorMode.XY: ColorMode.XY,
|
LightColorMode.XY: ColorMode.XY,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
TS0601_EFFECTS = [
|
||||||
|
"carnival",
|
||||||
|
"collide",
|
||||||
|
"fading",
|
||||||
|
"fireworks",
|
||||||
|
"flag",
|
||||||
|
"glow",
|
||||||
|
"rainbow",
|
||||||
|
"snake",
|
||||||
|
"snow",
|
||||||
|
"sparkles",
|
||||||
|
"steady",
|
||||||
|
"strobe",
|
||||||
|
"twinkle",
|
||||||
|
"updown",
|
||||||
|
"vintage",
|
||||||
|
"waves",
|
||||||
|
]
|
||||||
|
|
||||||
_LightDeviceT = TypeVar("_LightDeviceT", bound=Group | Light)
|
_LightDeviceT = TypeVar("_LightDeviceT", bound=Group | Light)
|
||||||
|
|
||||||
|
|
||||||
@ -161,6 +200,8 @@ class DeconzBaseLight(DeconzDevice[_LightDeviceT], LightEntity):
|
|||||||
if device.effect is not None:
|
if device.effect is not None:
|
||||||
self._attr_supported_features |= LightEntityFeature.EFFECT
|
self._attr_supported_features |= LightEntityFeature.EFFECT
|
||||||
self._attr_effect_list = [EFFECT_COLORLOOP]
|
self._attr_effect_list = [EFFECT_COLORLOOP]
|
||||||
|
if device.model_id == "TS0601":
|
||||||
|
self._attr_effect_list += TS0601_EFFECTS
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def color_mode(self) -> str | None:
|
def color_mode(self) -> str | None:
|
||||||
|
@ -185,7 +185,25 @@ async def test_no_lights_or_groups(
|
|||||||
"entity_id": "light.lidl_xmas_light",
|
"entity_id": "light.lidl_xmas_light",
|
||||||
"state": STATE_ON,
|
"state": STATE_ON,
|
||||||
"attributes": {
|
"attributes": {
|
||||||
ATTR_EFFECT_LIST: [EFFECT_COLORLOOP],
|
ATTR_EFFECT_LIST: [
|
||||||
|
EFFECT_COLORLOOP,
|
||||||
|
"carnival",
|
||||||
|
"collide",
|
||||||
|
"fading",
|
||||||
|
"fireworks",
|
||||||
|
"flag",
|
||||||
|
"glow",
|
||||||
|
"rainbow",
|
||||||
|
"snake",
|
||||||
|
"snow",
|
||||||
|
"sparkles",
|
||||||
|
"steady",
|
||||||
|
"strobe",
|
||||||
|
"twinkle",
|
||||||
|
"updown",
|
||||||
|
"vintage",
|
||||||
|
"waves",
|
||||||
|
],
|
||||||
ATTR_SUPPORTED_COLOR_MODES: [ColorMode.HS],
|
ATTR_SUPPORTED_COLOR_MODES: [ColorMode.HS],
|
||||||
ATTR_COLOR_MODE: ColorMode.HS,
|
ATTR_COLOR_MODE: ColorMode.HS,
|
||||||
ATTR_BRIGHTNESS: 25,
|
ATTR_BRIGHTNESS: 25,
|
||||||
|
Loading…
x
Reference in New Issue
Block a user