Add colorloop
effect for color lights
#7479
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
When I tried to set up some effects for my color lights, I realized that there is no colorloop in the list of supported effects for most of them. Apparently, I am not the first one who is missing this (cf. Koenkk/zigbee2mqtt#1791). So here's my proposal for the implementation.
The change allows to trigger a continuous color loop with the command
zigbee2mqtt/FRIENDLY_NAME/set
with payload{"effect": colorloop}
. This is in addition to the already-existing commandhue_move
and basically does the same.As proposed in the feature request, it also accepts a
transition
value from 1...255 to set the time for a full loop, where 1 is shortest and 255 ist longest. I tested it with my lights and it roughly matches the seconds for a full loop, but this does not need to be the case for every light.If no value for
transition
is given, a default value of 15 is used.Example: for the slowest-possible color loop, publish to
zigbee2mqtt/FRIENDLY_NAME/set
with payload{"transition": 255, "effect":"colorloop"}
. To turn off the color loop, publish{"effect":"stop_effect"}
.