1
0
mirror of https://github.com/home-assistant/core.git synced 2025-12-27 06:28:31 +00:00

deCONZ - Add support for new switch type (#31362)

This commit is contained in:
Robert Svensson
2020-02-01 17:08:49 +01:00
committed by GitHub
parent dc5ca461a9
commit b373c202c9
4 changed files with 35 additions and 8 deletions

View File

@@ -38,6 +38,13 @@ SWITCHES = {
"state": {"reachable": True},
"uniqueid": "00:00:00:00:00:00:00:03-00",
},
"5": {
"id": "On off relay id",
"name": "On off relay",
"state": {"on": True, "reachable": True},
"type": "On/Off light",
"uniqueid": "00:00:00:00:00:00:00:04-00",
},
}
@@ -68,7 +75,8 @@ async def test_switches(hass):
assert "switch.smart_plug" in gateway.deconz_ids
assert "switch.warning_device" in gateway.deconz_ids
assert "switch.unsupported_switch" not in gateway.deconz_ids
assert len(hass.states.async_all()) == 4
assert "switch.on_off_relay" in gateway.deconz_ids
assert len(hass.states.async_all()) == 5
on_off_switch = hass.states.get("switch.on_off_switch")
assert on_off_switch.state == "on"
@@ -79,6 +87,9 @@ async def test_switches(hass):
warning_device = hass.states.get("switch.warning_device")
assert warning_device.state == "on"
on_off_relay = hass.states.get("switch.on_off_relay")
assert on_off_relay.state == "on"
state_changed_event = {
"t": "event",
"e": "changed",