Fix deCONZ groups don't report ctmax/min (#36432)

* Groups don't report ctmax/min
pull/36626/head
Robert Svensson 2020-06-04 10:15:30 +02:00 committed by Paulus Schoutsen
parent 4cd04e3f99
commit 84bd2067e4
1 changed files with 16 additions and 12 deletions

View File

@ -82,7 +82,7 @@ async def async_setup_entry(hass, config_entry, async_add_entities):
async_add_group(gateway.api.groups.values())
class DeconzLight(DeconzDevice, LightEntity):
class DeconzBaseLight(DeconzDevice, LightEntity):
"""Representation of a deCONZ light."""
def __init__(self, device, gateway):
@ -130,16 +130,6 @@ class DeconzLight(DeconzDevice, LightEntity):
return color_util.color_xy_to_hs(*self._device.xy)
return None
@property
def max_mireds(self):
"""Return the warmest color_temp that this light supports."""
return self._device.ctmax or super().max_mireds
@property
def min_mireds(self):
"""Return the coldest color_temp that this light supports."""
return self._device.ctmin or super().min_mireds
@property
def is_on(self):
"""Return true if light is on."""
@ -214,7 +204,21 @@ class DeconzLight(DeconzDevice, LightEntity):
return attributes
class DeconzGroup(DeconzLight):
class DeconzLight(DeconzBaseLight):
"""Representation of a deCONZ light."""
@property
def max_mireds(self):
"""Return the warmest color_temp that this light supports."""
return self._device.ctmax or super().max_mireds
@property
def min_mireds(self):
"""Return the coldest color_temp that this light supports."""
return self._device.ctmin or super().min_mireds
class DeconzGroup(DeconzBaseLight):
"""Representation of a deCONZ group."""
def __init__(self, device, gateway):