Add LightEffect module for smart light strips (#918)

Implements the `light_strip_lighting_effect` components for
`smart` devices. Uses a new list of effects captured from a L900 which
are similar to the `iot` effects but include some additional properties
and a few extra effects.

Assumes that a device only implements `light_strip_lighting_effect` or
`light_effect` but not both.
This commit is contained in:
Steven B
2024-05-15 06:16:57 +01:00
committed by GitHub
parent 67b5d7de83
commit 133a839f22
8 changed files with 572 additions and 19 deletions

View File

@@ -390,12 +390,8 @@ async def test_light_effect(dev: Device, runner: CliRunner):
assert light_effect.effect == light_effect.LIGHT_EFFECTS_OFF
res = await runner.invoke(effect, obj=dev)
msg = (
"Setting an effect requires a named built-in effect: "
+ f"{light_effect.effect_list}"
)
assert msg in res.output
assert res.exit_code == 2
assert f"Light effect: {light_effect.effect}" in res.output
assert res.exit_code == 0
res = await runner.invoke(effect, [light_effect.effect_list[1]], obj=dev)
assert f"Setting Effect: {light_effect.effect_list[1]}" in res.output