Don't require passing identifiers to DeviceRegistry.async_get_device (#96479)
* Require keyword arguments to DeviceRegistry.async_get_device * Update tests * Update tests * Don't enforce keyword arguments
This commit is contained in:
parent
5f46436057
commit
7539cf25be
143 changed files with 654 additions and 494 deletions
|
@ -105,7 +105,9 @@ async def test_triggers(hass: HomeAssistant, mock_devices) -> None:
|
|||
ieee_address = str(zha_device.ieee)
|
||||
|
||||
ha_device_registry = dr.async_get(hass)
|
||||
reg_device = ha_device_registry.async_get_device({("zha", ieee_address)})
|
||||
reg_device = ha_device_registry.async_get_device(
|
||||
identifiers={("zha", ieee_address)}
|
||||
)
|
||||
|
||||
triggers = await async_get_device_automations(
|
||||
hass, DeviceAutomationType.TRIGGER, reg_device.id
|
||||
|
@ -171,7 +173,9 @@ async def test_no_triggers(hass: HomeAssistant, mock_devices) -> None:
|
|||
ieee_address = str(zha_device.ieee)
|
||||
|
||||
ha_device_registry = dr.async_get(hass)
|
||||
reg_device = ha_device_registry.async_get_device({("zha", ieee_address)})
|
||||
reg_device = ha_device_registry.async_get_device(
|
||||
identifiers={("zha", ieee_address)}
|
||||
)
|
||||
|
||||
triggers = await async_get_device_automations(
|
||||
hass, DeviceAutomationType.TRIGGER, reg_device.id
|
||||
|
@ -203,7 +207,9 @@ async def test_if_fires_on_event(hass: HomeAssistant, mock_devices, calls) -> No
|
|||
|
||||
ieee_address = str(zha_device.ieee)
|
||||
ha_device_registry = dr.async_get(hass)
|
||||
reg_device = ha_device_registry.async_get_device({("zha", ieee_address)})
|
||||
reg_device = ha_device_registry.async_get_device(
|
||||
identifiers={("zha", ieee_address)}
|
||||
)
|
||||
|
||||
assert await async_setup_component(
|
||||
hass,
|
||||
|
@ -312,7 +318,9 @@ async def test_exception_no_triggers(
|
|||
|
||||
ieee_address = str(zha_device.ieee)
|
||||
ha_device_registry = dr.async_get(hass)
|
||||
reg_device = ha_device_registry.async_get_device({("zha", ieee_address)})
|
||||
reg_device = ha_device_registry.async_get_device(
|
||||
identifiers={("zha", ieee_address)}
|
||||
)
|
||||
|
||||
await async_setup_component(
|
||||
hass,
|
||||
|
@ -359,7 +367,9 @@ async def test_exception_bad_trigger(
|
|||
|
||||
ieee_address = str(zha_device.ieee)
|
||||
ha_device_registry = dr.async_get(hass)
|
||||
reg_device = ha_device_registry.async_get_device({("zha", ieee_address)})
|
||||
reg_device = ha_device_registry.async_get_device(
|
||||
identifiers={("zha", ieee_address)}
|
||||
)
|
||||
|
||||
await async_setup_component(
|
||||
hass,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue