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

@@ -911,11 +911,12 @@ async def effect(dev: Device, ctx, effect):
echo("Device does not support effects")
return
if effect is None:
raise click.BadArgumentUsage(
"Setting an effect requires a named built-in effect: "
+ f"{light_effect.effect_list}",
ctx,
echo(
f"Light effect: {light_effect.effect}\n"
+ f"Available Effects: {light_effect.effect_list}"
)
return light_effect.effect
if effect not in light_effect.effect_list:
raise click.BadArgumentUsage(
f"Effect must be one of: {light_effect.effect_list}", ctx