mirror of
https://github.com/home-assistant/core.git
synced 2025-07-21 20:27:08 +00:00
Adjust conversation tests which create devices (#98185)
This commit is contained in:
parent
5909a1187d
commit
da53944a37
@ -20,7 +20,7 @@ from homeassistant.setup import async_setup_component
|
|||||||
|
|
||||||
from . import expose_entity
|
from . import expose_entity
|
||||||
|
|
||||||
from tests.common import async_mock_service
|
from tests.common import MockConfigEntry, async_mock_service
|
||||||
|
|
||||||
|
|
||||||
@pytest.fixture
|
@pytest.fixture
|
||||||
@ -86,8 +86,12 @@ async def test_exposed_areas(
|
|||||||
area_kitchen = area_registry.async_get_or_create("kitchen")
|
area_kitchen = area_registry.async_get_or_create("kitchen")
|
||||||
area_bedroom = area_registry.async_get_or_create("bedroom")
|
area_bedroom = area_registry.async_get_or_create("bedroom")
|
||||||
|
|
||||||
|
entry = MockConfigEntry()
|
||||||
|
entry.add_to_hass(hass)
|
||||||
kitchen_device = device_registry.async_get_or_create(
|
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)
|
device_registry.async_update_device(kitchen_device.id, area_id=area_kitchen.id)
|
||||||
|
|
||||||
|
@ -1409,6 +1409,7 @@ async def test_turn_on_area(
|
|||||||
) -> None:
|
) -> None:
|
||||||
"""Test turning on an area."""
|
"""Test turning on an area."""
|
||||||
entry = MockConfigEntry(domain="test")
|
entry = MockConfigEntry(domain="test")
|
||||||
|
entry.add_to_hass(hass)
|
||||||
|
|
||||||
device = device_registry.async_get_or_create(
|
device = device_registry.async_get_or_create(
|
||||||
config_entry_id=entry.entry_id,
|
config_entry_id=entry.entry_id,
|
||||||
@ -1480,6 +1481,7 @@ async def test_light_area_same_name(
|
|||||||
) -> None:
|
) -> None:
|
||||||
"""Test turning on a light with the same name as an area."""
|
"""Test turning on a light with the same name as an area."""
|
||||||
entry = MockConfigEntry(domain="test")
|
entry = MockConfigEntry(domain="test")
|
||||||
|
entry.add_to_hass(hass)
|
||||||
|
|
||||||
device = device_registry.async_get_or_create(
|
device = device_registry.async_get_or_create(
|
||||||
config_entry_id=entry.entry_id,
|
config_entry_id=entry.entry_id,
|
||||||
|
Loading…
x
Reference in New Issue
Block a user