Return None if no color temp option

This commit is contained in:
Pierre Ståhl
2020-10-16 11:54:08 +02:00
parent baad2cfab0
commit 98fee92c83

View File

@@ -89,6 +89,7 @@ class LocaltuyaLight(LocalTuyaEntity, LightEntity):
"""Return the color_temp of the light.""" """Return the color_temp of the light."""
if self.has_config(CONF_COLOR_TEMP): if self.has_config(CONF_COLOR_TEMP):
return int(MAX_MIRED - (((MAX_MIRED - MIN_MIRED) / 255) * self._color_temp)) return int(MAX_MIRED - (((MAX_MIRED - MIN_MIRED) / 255) * self._color_temp))
return None
@property @property
def min_mireds(self): def min_mireds(self):