mirror of
https://github.com/home-assistant/core.git
synced 2025-07-19 11:17:21 +00:00
parent
56c66a19f0
commit
1c2224cc5c
@ -161,16 +161,18 @@ class TradfriLight(Light):
|
|||||||
@property
|
@property
|
||||||
def min_mireds(self):
|
def min_mireds(self):
|
||||||
"""Return the coldest color_temp that this light supports."""
|
"""Return the coldest color_temp that this light supports."""
|
||||||
return color_util.color_temperature_kelvin_to_mired(
|
if self._light_control.max_kelvin is not None:
|
||||||
self._light_control.max_kelvin
|
return color_util.color_temperature_kelvin_to_mired(
|
||||||
)
|
self._light_control.max_kelvin
|
||||||
|
)
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def max_mireds(self):
|
def max_mireds(self):
|
||||||
"""Return the warmest color_temp that this light supports."""
|
"""Return the warmest color_temp that this light supports."""
|
||||||
return color_util.color_temperature_kelvin_to_mired(
|
if self._light_control.min_kelvin is not None:
|
||||||
self._light_control.min_kelvin
|
return color_util.color_temperature_kelvin_to_mired(
|
||||||
)
|
self._light_control.min_kelvin
|
||||||
|
)
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def device_state_attributes(self):
|
def device_state_attributes(self):
|
||||||
@ -219,9 +221,11 @@ class TradfriLight(Light):
|
|||||||
@property
|
@property
|
||||||
def color_temp(self):
|
def color_temp(self):
|
||||||
"""Return the CT color value in mireds."""
|
"""Return the CT color value in mireds."""
|
||||||
return color_util.color_temperature_kelvin_to_mired(
|
kelvin_color = self._light_data.kelvin_color_inferred
|
||||||
self._light_data.kelvin_color_inferred
|
if kelvin_color is not None:
|
||||||
)
|
return color_util.color_temperature_kelvin_to_mired(
|
||||||
|
kelvin_color
|
||||||
|
)
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def rgb_color(self):
|
def rgb_color(self):
|
||||||
|
Loading…
x
Reference in New Issue
Block a user