Breina / ha-artnet-led

DMX lighting Integration for Home Assistant. Using the HA Color Mode update and Pyartnet library to control lights in multiple DMX universes over ethernet with the Art-Net protocol.
MIT License
115 stars 10 forks source link

Color temperature in rgbww light not updated on scene change #44

Closed klopyrev closed 1 year ago

klopyrev commented 1 year ago

There was a recent change that made self._vals a list in some of the classes, including RGBWW. That causes an issue where there is code like:

old_values = self._vals

... modify self._vals ...

... compare old_values and self._vals ...

It needs to make a deep copy of self._vals (e.g. old_values = list(self._vals))

klopyrev commented 1 year ago

Some additional notes:

1) Now that I'm actually setting up the lights, I'm finding scenes fairly convenient, and scenes end up just passing in the rgbww value, no matter if you configure with a specific temperature. Thus, there's no way to get the right color temperature. I've been studying the errors a bit and have noticed that actually they aren't really noticeable. Previously, I was pointing to large errors around 5 brightness, which is 2%. Ironically enough, my lights don't even turn on at 2%. In reality, around 5% is the minimum useful brightness and most likely actually even higher. I'm barely able to perceive the color temperature errors around that brightness. The higher the brightness, the less the error. My point is that I'm probably just going to use scenes for convenience. Then, I won't be actually using the recent functionality you added to support color temperature color mode in rgbww light as in input to async_turn_on. I'll just use rgbww and be done with it. Although, it does use the rgbww_to_color_temperature call you added to channel_switch.py.

2) I take back my previous suggestions to have the color mode configurable. I tried using HS_COLOR and COLOR_TEMP color modes just together by themselves, without RGBWW. First, that makes the color selectors hard to work with, so that's inconvenient. Furthermore, scenes don't work at all, since scenes call async_turn_on with just 1 color setting, which has to be either HS_COLOR or COLOR_TEMP, but not both.

Breina commented 1 year ago

Might have been too quick then. >.<

Thanks for the good feedback! I fixed the issue as you suggested. :)