mirror of
https://github.com/python-kasa/python-kasa.git
synced 2025-11-15 06:38:42 +00:00
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:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user