Address PR cleanup for nest device triggers (#43961)

This commit is contained in:
Allen Porter 2020-12-05 01:55:19 -08:00 committed by GitHub
parent c4426a73b3
commit 0670124e8d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 6 additions and 6 deletions

View File

@ -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)

View File

@ -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):