deCONZ - Add support for max/min mireds (#36355)

* Add support for max/min mireds reported per light from deconz .77

* Bump dependency
This commit is contained in:
Robert Svensson 2020-06-01 23:48:18 +02:00 committed by GitHub
parent 391983a0cf
commit 07469127ce
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
5 changed files with 17 additions and 3 deletions

View File

@ -130,6 +130,16 @@ 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."""

View File

@ -3,7 +3,7 @@
"name": "deCONZ",
"config_flow": true,
"documentation": "https://www.home-assistant.io/integrations/deconz",
"requirements": ["pydeconz==70"],
"requirements": ["pydeconz==71"],
"ssdp": [
{
"manufacturer": "Royal Philips Electronics"

View File

@ -1269,7 +1269,7 @@ pydaikin==2.1.1
pydanfossair==0.1.0
# homeassistant.components.deconz
pydeconz==70
pydeconz==71
# homeassistant.components.delijn
pydelijn==0.6.0

View File

@ -545,7 +545,7 @@ pycoolmasternet==0.0.4
pydaikin==2.1.1
# homeassistant.components.deconz
pydeconz==70
pydeconz==71
# homeassistant.components.zwave
pydispatcher==2.0.5

View File

@ -46,6 +46,8 @@ LIGHTS = {
"uniqueid": "00:00:00:00:00:00:00:00-00",
},
"2": {
"ctmax": 454,
"ctmin": 155,
"id": "Tunable white light id",
"name": "Tunable white light",
"state": {"on": True, "colormode": "ct", "ct": 2500, "reachable": True},
@ -111,6 +113,8 @@ async def test_lights_and_groups(hass):
tunable_white_light = hass.states.get("light.tunable_white_light")
assert tunable_white_light.state == "on"
assert tunable_white_light.attributes["color_temp"] == 2500
assert tunable_white_light.attributes["max_mireds"] == 454
assert tunable_white_light.attributes["min_mireds"] == 155
assert tunable_white_light.attributes["supported_features"] == 2
on_off_light = hass.states.get("light.on_off_light")