deCONZ - Fix device automations (#30577)
This commit is contained in:
1 parent
0d48d682dc
commit
84a1afc785
2 files changed
+24
-1
No files matched your search
@@ -91,3 +91,26 @@ async def test_get_triggers(hass):
|
||||
]
|
||||
|
||||
assert_lists_same(triggers, expected_triggers)
|
||||
|
||||
|
||||
async def test_helper_successful(hass):
|
||||
"""Verify trigger helper."""
|
||||
data = deepcopy(DECONZ_WEB_REQUEST)
|
||||
data["sensors"] = deepcopy(SENSORS)
|
||||
gateway = await setup_deconz_integration(hass, get_state_response=data)
|
||||
device_id = gateway.events[0].device_id
|
||||
deconz_event = device_trigger._get_deconz_event_from_device_id(hass, device_id)
|
||||
assert deconz_event == gateway.events[0]
|
||||
|
||||
|
||||
async def test_helper_no_match(hass):
|
||||
"""Verify trigger helper returns None when no event could be matched."""
|
||||
await setup_deconz_integration(hass)
|
||||
deconz_event = device_trigger._get_deconz_event_from_device_id(hass, "mock-id")
|
||||
assert deconz_event is None
|
||||
|
||||
|
||||
async def test_helper_no_gateway_exist(hass):
|
||||
"""Verify trigger helper returns None when no gateway exist."""
|
||||
deconz_event = device_trigger._get_deconz_event_from_device_id(hass, "mock-id")
|
||||
assert deconz_event is None
|
||||
Reference in new issue
Block a user