mirror of
https://github.com/home-assistant/core.git
synced 2025-07-24 05:37:44 +00:00
Set new color before turning LIFX bulbs on (#6402)
A LIFX bulb maintains its previous color even when the light is off. For example, if the previous color is blue and the bulb is turned on and then set to a red color, it will transition through purple colors. After this commit, the target color is set while the bulb is still turned off. This overrides the previous color and brightness that the bulb remembered. The light is then turned on with the requested transition duration. For the example, this gives the expected result of only going through red colors.
This commit is contained in:
parent
7655b6271d
commit
7774f0ae53
@ -230,10 +230,12 @@ class LIFXLight(Light):
|
||||
hue, saturation, brightness, kelvin, fade)
|
||||
|
||||
if self._power == 0:
|
||||
self._liffylights.set_color(self._ip, hue, saturation,
|
||||
brightness, kelvin, 0)
|
||||
self._liffylights.set_power(self._ip, 65535, fade)
|
||||
|
||||
self._liffylights.set_color(self._ip, hue, saturation,
|
||||
brightness, kelvin, fade)
|
||||
else:
|
||||
self._liffylights.set_color(self._ip, hue, saturation,
|
||||
brightness, kelvin, fade)
|
||||
|
||||
def turn_off(self, **kwargs):
|
||||
"""Turn the device off."""
|
||||
|
Loading…
x
Reference in New Issue
Block a user