mirror of
https://github.com/home-assistant/core.git
synced 2025-04-23 08:47:57 +00:00
Address PR cleanup for nest device triggers (#43961)
This commit is contained in:
parent
c4426a73b3
commit
0670124e8d
@ -54,7 +54,7 @@ async def async_get_device_trigger_types(
|
||||
|
||||
# Determine the set of event types based on the supported device traits
|
||||
trigger_types = []
|
||||
for trait in nest_device.traits.keys():
|
||||
for trait in nest_device.traits:
|
||||
trigger_type = DEVICE_TRAIT_TRIGGER_MAP.get(trait)
|
||||
if trigger_type:
|
||||
trigger_types.append(trigger_type)
|
||||
|
@ -148,21 +148,21 @@ async def test_multiple_devices(hass):
|
||||
|
||||
triggers = await async_get_device_automations(hass, "trigger", entry1.device_id)
|
||||
assert len(triggers) == 1
|
||||
assert {
|
||||
assert triggers[0] == {
|
||||
"platform": "device",
|
||||
"domain": DOMAIN,
|
||||
"type": "camera_sound",
|
||||
"device_id": entry1.device_id,
|
||||
} == triggers[0]
|
||||
}
|
||||
|
||||
triggers = await async_get_device_automations(hass, "trigger", entry2.device_id)
|
||||
assert len(triggers) == 1
|
||||
assert {
|
||||
assert triggers[0] == {
|
||||
"platform": "device",
|
||||
"domain": DOMAIN,
|
||||
"type": "doorbell_chime",
|
||||
"device_id": entry2.device_id,
|
||||
} == triggers[0]
|
||||
}
|
||||
|
||||
|
||||
async def test_triggers_for_invalid_device_id(hass):
|
||||
@ -205,7 +205,7 @@ async def test_no_triggers(hass):
|
||||
assert entry.unique_id == "some-device-id-camera"
|
||||
|
||||
triggers = await async_get_device_automations(hass, "trigger", entry.device_id)
|
||||
assert [] == triggers
|
||||
assert triggers == []
|
||||
|
||||
|
||||
async def test_fires_on_camera_motion(hass, calls):
|
||||
|
Loading…
x
Reference in New Issue
Block a user