mirror of
https://github.com/home-assistant/core.git
synced 2025-07-13 16:27:08 +00:00
Adjust utility_meter tests which create devices (#98212)
This commit is contained in:
parent
05ac67eba2
commit
c1b47b88f2
@ -277,6 +277,7 @@ async def test_change_device_source(hass: HomeAssistant) -> None:
|
|||||||
|
|
||||||
# Configure source entity 1 (with a linked device)
|
# Configure source entity 1 (with a linked device)
|
||||||
source_config_entry_1 = MockConfigEntry()
|
source_config_entry_1 = MockConfigEntry()
|
||||||
|
source_config_entry_1.add_to_hass(hass)
|
||||||
source_device_entry_1 = device_registry.async_get_or_create(
|
source_device_entry_1 = device_registry.async_get_or_create(
|
||||||
config_entry_id=source_config_entry_1.entry_id,
|
config_entry_id=source_config_entry_1.entry_id,
|
||||||
identifiers={("sensor", "identifier_test1")},
|
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)
|
# Configure source entity 2 (with a linked device)
|
||||||
source_config_entry_2 = MockConfigEntry()
|
source_config_entry_2 = MockConfigEntry()
|
||||||
|
source_config_entry_2.add_to_hass(hass)
|
||||||
source_device_entry_2 = device_registry.async_get_or_create(
|
source_device_entry_2 = device_registry.async_get_or_create(
|
||||||
config_entry_id=source_config_entry_2.entry_id,
|
config_entry_id=source_config_entry_2.entry_id,
|
||||||
identifiers={("sensor", "identifier_test2")},
|
identifiers={("sensor", "identifier_test2")},
|
||||||
|
@ -1466,6 +1466,7 @@ async def test_device_id(hass: HomeAssistant) -> None:
|
|||||||
entity_registry = er.async_get(hass)
|
entity_registry = er.async_get(hass)
|
||||||
|
|
||||||
source_config_entry = MockConfigEntry()
|
source_config_entry = MockConfigEntry()
|
||||||
|
source_config_entry.add_to_hass(hass)
|
||||||
source_device_entry = device_registry.async_get_or_create(
|
source_device_entry = device_registry.async_get_or_create(
|
||||||
config_entry_id=source_config_entry.entry_id,
|
config_entry_id=source_config_entry.entry_id,
|
||||||
identifiers={("sensor", "identifier_test")},
|
identifiers={("sensor", "identifier_test")},
|
||||||
|
Loading…
x
Reference in New Issue
Block a user