Adjust entity registry access in homekit tests (#88959)

This commit is contained in:
epenet 2023-03-01 16:54:00 +01:00 committed by GitHub
parent 3818e318db
commit ee78864b05
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
7 changed files with 149 additions and 130 deletions

View file

@ -16,6 +16,7 @@ from homeassistant.const import (
EVENT_HOMEASSISTANT_STARTED,
)
from homeassistant.core import HomeAssistant
from homeassistant.helpers import entity_registry as er
from homeassistant.setup import async_setup_component
from .util import PATH_HOMEKIT
@ -71,7 +72,7 @@ async def test_bridge_with_triggers(
hass: HomeAssistant,
hk_driver,
mock_async_zeroconf: None,
entity_reg,
entity_registry: er.EntityRegistry,
caplog: pytest.LogCaptureFixture,
) -> None:
"""Test we can setup a bridge with triggers and we ignore numeric states.
@ -83,7 +84,7 @@ async def test_bridge_with_triggers(
assert await async_setup_component(hass, "demo", {"demo": {}})
await hass.async_block_till_done()
entry = entity_reg.async_get("cover.living_room_window")
entry = entity_registry.async_get("cover.living_room_window")
assert entry is not None
device_id = entry.device_id