From da53944a37792960d0b0932f73697da9161620d9 Mon Sep 17 00:00:00 2001 From: Erik Montnemery Date: Thu, 10 Aug 2023 18:22:17 +0200 Subject: [PATCH] Adjust conversation tests which create devices (#98185) --- tests/components/conversation/test_default_agent.py | 8 ++++++-- tests/components/conversation/test_init.py | 2 ++ 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/tests/components/conversation/test_default_agent.py b/tests/components/conversation/test_default_agent.py index c3c2e621260..1677b254ff6 100644 --- a/tests/components/conversation/test_default_agent.py +++ b/tests/components/conversation/test_default_agent.py @@ -20,7 +20,7 @@ from homeassistant.setup import async_setup_component from . import expose_entity -from tests.common import async_mock_service +from tests.common import MockConfigEntry, async_mock_service @pytest.fixture @@ -86,8 +86,12 @@ async def test_exposed_areas( area_kitchen = area_registry.async_get_or_create("kitchen") area_bedroom = area_registry.async_get_or_create("bedroom") + entry = MockConfigEntry() + entry.add_to_hass(hass) kitchen_device = device_registry.async_get_or_create( - config_entry_id="1234", connections=set(), identifiers={("demo", "id-1234")} + config_entry_id=entry.entry_id, + connections=set(), + identifiers={("demo", "id-1234")}, ) device_registry.async_update_device(kitchen_device.id, area_id=area_kitchen.id) diff --git a/tests/components/conversation/test_init.py b/tests/components/conversation/test_init.py index f89af1dc201..37c8f9401bc 100644 --- a/tests/components/conversation/test_init.py +++ b/tests/components/conversation/test_init.py @@ -1409,6 +1409,7 @@ async def test_turn_on_area( ) -> None: """Test turning on an area.""" entry = MockConfigEntry(domain="test") + entry.add_to_hass(hass) device = device_registry.async_get_or_create( config_entry_id=entry.entry_id, @@ -1480,6 +1481,7 @@ async def test_light_area_same_name( ) -> None: """Test turning on a light with the same name as an area.""" entry = MockConfigEntry(domain="test") + entry.add_to_hass(hass) device = device_registry.async_get_or_create( config_entry_id=entry.entry_id,