|
@@ -60,12 +60,20 @@ class TuyaLocalLight(TuyaLocalEntity, LightEntity):
|
|
|
|
|
|
|
|
# Set min and max color temp
|
|
# Set min and max color temp
|
|
|
if self._color_temp_dps:
|
|
if self._color_temp_dps:
|
|
|
|
|
+ range_set = False
|
|
|
m = self._color_temp_dps._find_map_for_dps(0, self._device)
|
|
m = self._color_temp_dps._find_map_for_dps(0, self._device)
|
|
|
if m:
|
|
if m:
|
|
|
tr = m.get("target_range")
|
|
tr = m.get("target_range")
|
|
|
if tr:
|
|
if tr:
|
|
|
self._attr_min_color_temp_kelvin = tr.get("min")
|
|
self._attr_min_color_temp_kelvin = tr.get("min")
|
|
|
self._attr_max_color_temp_kelvin = tr.get("max")
|
|
self._attr_max_color_temp_kelvin = tr.get("max")
|
|
|
|
|
+ range_set = True
|
|
|
|
|
+ if not range_set:
|
|
|
|
|
+ range = self._color_temp_dps.range(self._device)
|
|
|
|
|
+ if range:
|
|
|
|
|
+ # For lights that use K natively, use range
|
|
|
|
|
+ self._attr_min_color_temp_kelvin = range[0]
|
|
|
|
|
+ self._attr_max_color_temp_kelvin = range[1]
|
|
|
|
|
|
|
|
@property
|
|
@property
|
|
|
def supported_color_modes(self):
|
|
def supported_color_modes(self):
|