Use Registry fixture in zwave_js tests (#119277)
This commit is contained in:
parent
6733f86c61
commit
94b9ae14c9
6 changed files with 232 additions and 155 deletions
|
@ -20,7 +20,7 @@ from homeassistant.components.zwave_js.triggers.trigger_helpers import (
|
|||
)
|
||||
from homeassistant.const import CONF_PLATFORM, SERVICE_RELOAD
|
||||
from homeassistant.core import HomeAssistant
|
||||
from homeassistant.helpers.device_registry import async_get as async_get_dev_reg
|
||||
from homeassistant.helpers import device_registry as dr
|
||||
from homeassistant.setup import async_setup_component
|
||||
|
||||
from .common import SCHLAGE_BE469_LOCK_ENTITY
|
||||
|
@ -29,13 +29,16 @@ from tests.common import async_capture_events
|
|||
|
||||
|
||||
async def test_zwave_js_value_updated(
|
||||
hass: HomeAssistant, client, lock_schlage_be469, integration
|
||||
hass: HomeAssistant,
|
||||
device_registry: dr.DeviceRegistry,
|
||||
client,
|
||||
lock_schlage_be469,
|
||||
integration,
|
||||
) -> None:
|
||||
"""Test for zwave_js.value_updated automation trigger."""
|
||||
trigger_type = f"{DOMAIN}.value_updated"
|
||||
node: Node = lock_schlage_be469
|
||||
dev_reg = async_get_dev_reg(hass)
|
||||
device = dev_reg.async_get_device(
|
||||
device = device_registry.async_get_device(
|
||||
identifiers={get_device_id(client.driver, lock_schlage_be469)}
|
||||
)
|
||||
assert device
|
||||
|
@ -453,13 +456,16 @@ async def test_zwave_js_value_updated_bypass_dynamic_validation_no_driver(
|
|||
|
||||
|
||||
async def test_zwave_js_event(
|
||||
hass: HomeAssistant, client, lock_schlage_be469, integration
|
||||
hass: HomeAssistant,
|
||||
device_registry: dr.DeviceRegistry,
|
||||
client,
|
||||
lock_schlage_be469,
|
||||
integration,
|
||||
) -> None:
|
||||
"""Test for zwave_js.event automation trigger."""
|
||||
trigger_type = f"{DOMAIN}.event"
|
||||
node: Node = lock_schlage_be469
|
||||
dev_reg = async_get_dev_reg(hass)
|
||||
device = dev_reg.async_get_device(
|
||||
device = device_registry.async_get_device(
|
||||
identifiers={get_device_id(client.driver, lock_schlage_be469)}
|
||||
)
|
||||
assert device
|
||||
|
@ -1009,11 +1015,14 @@ async def test_invalid_trigger_configs(hass: HomeAssistant) -> None:
|
|||
|
||||
|
||||
async def test_zwave_js_trigger_config_entry_unloaded(
|
||||
hass: HomeAssistant, client, lock_schlage_be469, integration
|
||||
hass: HomeAssistant,
|
||||
device_registry: dr.DeviceRegistry,
|
||||
client,
|
||||
lock_schlage_be469,
|
||||
integration,
|
||||
) -> None:
|
||||
"""Test zwave_js triggers bypass dynamic validation when needed."""
|
||||
dev_reg = async_get_dev_reg(hass)
|
||||
device = dev_reg.async_get_device(
|
||||
device = device_registry.async_get_device(
|
||||
identifiers={get_device_id(client.driver, lock_schlage_be469)}
|
||||
)
|
||||
assert device
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue