Use DeviceAutomationType in tests/components/[m-r]* (#62443)
This commit is contained in:
parent
5926961ed5
commit
f913961d63
14 changed files with 121 additions and 40 deletions
|
@ -4,6 +4,7 @@ from datetime import timedelta
|
|||
import pytest
|
||||
|
||||
import homeassistant.components.automation as automation
|
||||
from homeassistant.components.device_automation import DeviceAutomationType
|
||||
from homeassistant.components.remote import DOMAIN
|
||||
from homeassistant.const import CONF_PLATFORM, STATE_OFF, STATE_ON
|
||||
from homeassistant.helpers import device_registry
|
||||
|
@ -65,7 +66,9 @@ async def test_get_triggers(hass, device_reg, entity_reg):
|
|||
"entity_id": f"{DOMAIN}.test_5678",
|
||||
},
|
||||
]
|
||||
triggers = await async_get_device_automations(hass, "trigger", device_entry.id)
|
||||
triggers = await async_get_device_automations(
|
||||
hass, DeviceAutomationType.TRIGGER, device_entry.id
|
||||
)
|
||||
assert triggers == expected_triggers
|
||||
|
||||
|
||||
|
@ -83,10 +86,12 @@ async def test_get_trigger_capabilities(hass, device_reg, entity_reg):
|
|||
{"name": "for", "optional": True, "type": "positive_time_period_dict"}
|
||||
]
|
||||
}
|
||||
triggers = await async_get_device_automations(hass, "trigger", device_entry.id)
|
||||
triggers = await async_get_device_automations(
|
||||
hass, DeviceAutomationType.TRIGGER, device_entry.id
|
||||
)
|
||||
for trigger in triggers:
|
||||
capabilities = await async_get_device_automation_capabilities(
|
||||
hass, "trigger", trigger
|
||||
hass, DeviceAutomationType.TRIGGER, trigger
|
||||
)
|
||||
assert capabilities == expected_capabilities
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue