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

* Groups don't report ctmax/min
This commit is contained in:
Robert Svensson 2020-06-04 10:15:30 +02:00 committed by GitHub
parent 68b077ffaa
commit 40829d9d76
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

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):