Add repeat options to tplink sequence effect service (#86040)
Add repeat options to sequence effect service
This commit is contained in:
parent
4d0e236c6a
commit
a703aa1dff
2 changed files with 15 additions and 1 deletions
|
@ -66,6 +66,9 @@ SEQUENCE_EFFECT_DICT: Final = {
|
|||
vol.Length(min=1, max=16),
|
||||
[vol.All(vol.Coerce(tuple), HSV_SEQUENCE)],
|
||||
),
|
||||
vol.Optional("repeat_times", default=0): vol.All(
|
||||
vol.Coerce(int), vol.Range(min=0, max=10)
|
||||
),
|
||||
vol.Optional("spread", default=1): vol.All(
|
||||
vol.Coerce(int), vol.Range(min=1, max=16)
|
||||
),
|
||||
|
@ -397,6 +400,7 @@ class TPLinkSmartLightStrip(TPLinkSmartBulb):
|
|||
transition: int,
|
||||
segments: list[int],
|
||||
sequence: Sequence[tuple[int, int, int]],
|
||||
repeat_times: int,
|
||||
spread: int,
|
||||
direction: int,
|
||||
) -> None:
|
||||
|
@ -405,7 +409,7 @@ class TPLinkSmartLightStrip(TPLinkSmartBulb):
|
|||
**_async_build_base_effect(brightness, duration, transition, segments),
|
||||
"type": "sequence",
|
||||
"sequence": sequence,
|
||||
"repeat_times": 0,
|
||||
"repeat_times": repeat_times,
|
||||
"spread": spread,
|
||||
"direction": direction,
|
||||
}
|
||||
|
|
|
@ -43,6 +43,16 @@ sequence_effect:
|
|||
step: 1
|
||||
max: 5000
|
||||
unit_of_measurement: "ms"
|
||||
repeat_times:
|
||||
description: Repetitions (0 for continuous)
|
||||
example: 0
|
||||
default: 0
|
||||
required: false
|
||||
selector:
|
||||
number:
|
||||
min: 0
|
||||
step: 1
|
||||
max: 10
|
||||
transition:
|
||||
description: Transition
|
||||
example: 2000
|
||||
|
|
Loading…
Add table
Reference in a new issue