check if a light supports brightness (#26055)

Fix black

Fix black
This commit is contained in:
croghostrider authored and Paulus Schoutsen committed 2019-08-21 08:42:26 -07:00
1 parent cf505c65b4
commit 08d797edba
2 files changed
+33 -9

No files matched your search

@@ -128,6 +128,9 @@ def hass_hue(loop, hass):
kitchen_light_entity.entity_id, kitchen_light_entity.state, attributes=attrs
)
# create a lamp without brightness support
hass.states.async_set("light.no_brightness", "on", {})
# Ceiling Fan is explicitly excluded from being exposed
ceiling_fan_entity = hass.states.get("fan.ceiling_fan")
attrs = dict(ceiling_fan_entity.attributes)
@@ -218,6 +221,17 @@ def test_discover_lights(hue_client):
assert "climate.ecobee" not in devices
@asyncio.coroutine
def test_light_without_brightness_supported(hass_hue, hue_client):
"""Test that light without brightness is supported."""
light_without_brightness_json = yield from perform_get_light_state(
hue_client, "light.no_brightness", 200
)
assert light_without_brightness_json["state"][HUE_API_STATE_ON] is True
assert light_without_brightness_json["type"] == "On/off light"
@asyncio.coroutine
def test_get_light_state(hass_hue, hue_client):
"""Test the getting of light state."""