Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add colorloop effect for color lights #7479

Merged
merged 3 commits into from
May 5, 2024
Merged

Conversation

slugzero
Copy link
Contributor

@slugzero slugzero commented May 2, 2024

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 command hue_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"}.

src/lib/modernExtend.ts Outdated Show resolved Hide resolved
@Koenkk Koenkk merged commit b251e87 into Koenkk:master May 5, 2024
2 checks passed
@Koenkk
Copy link
Owner

Koenkk commented May 5, 2024

Thanks!

@slugzero slugzero deleted the colorloop branch May 5, 2024 20:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants