1
mirror of https://github.com/home-assistant/core synced 2024-09-25 00:41:32 +02:00

Improve handling of mireds being far out of spec (#40018)

This commit is contained in:
Robert Svensson 2020-09-13 16:31:39 +02:00 committed by GitHub
parent ff4bb962c4
commit ceeea52915
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 25 additions and 7 deletions

View File

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

View File

@ -1295,7 +1295,7 @@ pydaikin==2.3.1
pydanfossair==0.1.0
# homeassistant.components.deconz
pydeconz==72
pydeconz==73
# homeassistant.components.delijn
pydelijn==0.6.1

View File

@ -625,7 +625,7 @@ pycountry==19.8.18
pydaikin==2.3.1
# homeassistant.components.deconz
pydeconz==72
pydeconz==73
# homeassistant.components.dexcom
pydexcom==0.2.0

View File

@ -67,6 +67,15 @@ LIGHTS = {
"type": "On and Off light",
"uniqueid": "00:00:00:00:00:00:00:03-00",
},
"5": {
"ctmax": 1000,
"ctmin": 0,
"id": "Tunable white light with bad maxmin values id",
"name": "Tunable white light with bad maxmin values",
"state": {"on": True, "colormode": "ct", "ct": 2500, "reachable": True},
"type": "Tunable white light",
"uniqueid": "00:00:00:00:00:00:00:04-00",
},
}
@ -101,7 +110,7 @@ async def test_lights_and_groups(hass):
assert "light.on_off_switch" not in gateway.deconz_ids
assert "light.on_off_light" in gateway.deconz_ids
assert len(hass.states.async_all()) == 5
assert len(hass.states.async_all()) == 6
rgb_light = hass.states.get("light.rgb_light")
assert rgb_light.state == "on"
@ -117,6 +126,15 @@ async def test_lights_and_groups(hass):
assert tunable_white_light.attributes["min_mireds"] == 155
assert tunable_white_light.attributes["supported_features"] == 2
tunable_white_light_bad_maxmin = hass.states.get(
"light.tunable_white_light_with_bad_maxmin_values"
)
assert tunable_white_light_bad_maxmin.state == "on"
assert tunable_white_light_bad_maxmin.attributes["color_temp"] == 2500
assert tunable_white_light_bad_maxmin.attributes["max_mireds"] == 650
assert tunable_white_light_bad_maxmin.attributes["min_mireds"] == 140
assert tunable_white_light_bad_maxmin.attributes["supported_features"] == 2
on_off_light = hass.states.get("light.on_off_light")
assert on_off_light.state == "on"
assert on_off_light.attributes["supported_features"] == 0
@ -256,7 +274,7 @@ async def test_disable_light_groups(hass):
assert "light.empty_group" not in gateway.deconz_ids
assert "light.on_off_switch" not in gateway.deconz_ids
# 3 entities
assert len(hass.states.async_all()) == 4
assert len(hass.states.async_all()) == 5
rgb_light = hass.states.get("light.rgb_light")
assert rgb_light is not None
@ -281,7 +299,7 @@ async def test_disable_light_groups(hass):
assert "light.empty_group" not in gateway.deconz_ids
assert "light.on_off_switch" not in gateway.deconz_ids
# 3 entities
assert len(hass.states.async_all()) == 5
assert len(hass.states.async_all()) == 6
hass.config_entries.async_update_entry(
gateway.config_entry, options={deconz.gateway.CONF_ALLOW_DECONZ_GROUPS: False}
@ -294,4 +312,4 @@ async def test_disable_light_groups(hass):
assert "light.empty_group" not in gateway.deconz_ids
assert "light.on_off_switch" not in gateway.deconz_ids
# 3 entities
assert len(hass.states.async_all()) == 4
assert len(hass.states.async_all()) == 5