Skip to content

Commit

Permalink
deCONZ - Add support for max/min mireds (home-assistant#36355)
Browse files Browse the repository at this point in the history
* Add support for max/min mireds reported per light from deconz .77

* Bump dependency
  • Loading branch information
Kane610 authored Jun 1, 2020
1 parent 391983a commit 0746912
Show file tree
Hide file tree
Showing 5 changed files with 17 additions and 3 deletions.
10 changes: 10 additions & 0 deletions homeassistant/components/deconz/light.py
Original file line number Diff line number Diff line change
Expand Up @@ -130,6 +130,16 @@ def hs_color(self):
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."""
Expand Down
2 changes: 1 addition & 1 deletion homeassistant/components/deconz/manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
2 changes: 1 addition & 1 deletion requirements_all.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion requirements_test_all.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 4 additions & 0 deletions tests/components/deconz/test_light.py
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,8 @@
"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},
Expand Down Expand Up @@ -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")
Expand Down

0 comments on commit 0746912

Please sign in to comment.