mirror of
https://github.com/home-assistant/core.git
synced 2025-07-22 04:37:06 +00:00
Make LIFX color/temperature attributes mutually exclusive (#15234)
This commit is contained in:
parent
0a186650bf
commit
dffe36761d
@ -446,7 +446,9 @@ class LIFXLight(Light):
|
|||||||
@property
|
@property
|
||||||
def color_temp(self):
|
def color_temp(self):
|
||||||
"""Return the color temperature."""
|
"""Return the color temperature."""
|
||||||
kelvin = self.device.color[3]
|
_, sat, _, kelvin = self.device.color
|
||||||
|
if sat:
|
||||||
|
return None
|
||||||
return color_util.color_temperature_kelvin_to_mired(kelvin)
|
return color_util.color_temperature_kelvin_to_mired(kelvin)
|
||||||
|
|
||||||
@property
|
@property
|
||||||
@ -601,7 +603,7 @@ class LIFXColor(LIFXLight):
|
|||||||
hue, sat, _, _ = self.device.color
|
hue, sat, _, _ = self.device.color
|
||||||
hue = hue / 65535 * 360
|
hue = hue / 65535 * 360
|
||||||
sat = sat / 65535 * 100
|
sat = sat / 65535 * 100
|
||||||
return (hue, sat)
|
return (hue, sat) if sat else None
|
||||||
|
|
||||||
|
|
||||||
class LIFXStrip(LIFXColor):
|
class LIFXStrip(LIFXColor):
|
||||||
|
Loading…
x
Reference in New Issue
Block a user