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

Setting multizone light brightness correctly? #141

Open
LinqLover opened this issue Feb 8, 2020 · 1 comment
Open

Setting multizone light brightness correctly? #141

LinqLover opened this issue Feb 8, 2020 · 1 comment

Comments

@LinqLover
Copy link

Using the LIFX app, I can change the brightness of my light strip so that each color zone is set to the target brightness. However, if I call set_brightness(32768) on a MultiZoneLight, this will reset all color zones to the same color.

Did someone already face or investigate the issue?

Does the LAN protocol provide a solution for this or does the client manually need to implement this? I am new to this project, but could you maybe use SetWaveformOptional, or is this only for animations?

Provided that the firmer is the case and we need to implement this manually, I would propose to override set_brightness (and maybe also set_{hue,saturation,colortemp}?) in MultiZoneLight to do this for all zones separately. Pseudo:

# brightness in range [0 - 65535]
def set_brightness(self, brightness, duration=0, rapid=False):
    """ brightness to set
        duration in ms"""
    current_colors = self.get_color_zones()
    next_colors = [(hue, sat, brightness, kelvin) for (hue, sat, _, kelvin) in current_colors]
    return self.set_zone_colors(next_colors, duration=duration, rapid=rapid)

If you are interested, I'd be happy to send you a PR!

@mclarkk
Copy link
Owner

mclarkk commented Mar 19, 2021

Great find -- yes, I've love a PR!

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

No branches or pull requests

2 participants