1
0
mirror of https://github.com/home-assistant/core.git synced 2025-12-24 12:59:34 +00:00

Fix faulty color temp crashing google (#16758)

* Fix faulty color temp crashing google

* Rename

* Print warning for incorrect color temp
This commit is contained in:
Paulus Schoutsen
2018-09-21 10:51:46 +02:00
committed by GitHub
parent c475a876ce
commit df67093441
2 changed files with 25 additions and 1 deletions

View File

@@ -457,6 +457,22 @@ async def test_color_temperature_light(hass):
}
async def test_color_temperature_light_bad_temp(hass):
"""Test ColorTemperature trait support for light domain."""
assert not trait.ColorTemperatureTrait.supported(light.DOMAIN, 0)
assert trait.ColorTemperatureTrait.supported(light.DOMAIN,
light.SUPPORT_COLOR_TEMP)
trt = trait.ColorTemperatureTrait(hass, State('light.bla', STATE_ON, {
light.ATTR_MIN_MIREDS: 200,
light.ATTR_COLOR_TEMP: 0,
light.ATTR_MAX_MIREDS: 500,
}))
assert trt.query_attributes() == {
}
async def test_scene_scene(hass):
"""Test Scene trait support for scene domain."""
assert trait.SceneTrait.supported(scene.DOMAIN, 0)