Adjust utility_meter tests which create devices (#98212)

This commit is contained in:
Erik Montnemery 2023-08-10 18:24:47 +02:00 committed by GitHub
parent 05ac67eba2
commit c1b47b88f2
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 3 additions and 0 deletions

View file

@ -277,6 +277,7 @@ async def test_change_device_source(hass: HomeAssistant) -> None:
# Configure source entity 1 (with a linked device)
source_config_entry_1 = MockConfigEntry()
source_config_entry_1.add_to_hass(hass)
source_device_entry_1 = device_registry.async_get_or_create(
config_entry_id=source_config_entry_1.entry_id,
identifiers={("sensor", "identifier_test1")},
@ -292,6 +293,7 @@ async def test_change_device_source(hass: HomeAssistant) -> None:
# Configure source entity 2 (with a linked device)
source_config_entry_2 = MockConfigEntry()
source_config_entry_2.add_to_hass(hass)
source_device_entry_2 = device_registry.async_get_or_create(
config_entry_id=source_config_entry_2.entry_id,
identifiers={("sensor", "identifier_test2")},

View file

@ -1466,6 +1466,7 @@ async def test_device_id(hass: HomeAssistant) -> None:
entity_registry = er.async_get(hass)
source_config_entry = MockConfigEntry()
source_config_entry.add_to_hass(hass)
source_device_entry = device_registry.async_get_or_create(
config_entry_id=source_config_entry.entry_id,
identifiers={("sensor", "identifier_test")},