1
0
mirror of https://github.com/home-assistant/core.git synced 2025-12-24 12:59:34 +00:00

Update tests c-h to use registry async_get (#47652)

This commit is contained in:
Erik Montnemery
2021-03-09 14:31:17 +01:00
committed by GitHub
parent ba2978c693
commit 87e7cebd36
49 changed files with 165 additions and 138 deletions

View File

@@ -19,6 +19,7 @@ from homeassistant.const import (
VOLUME_CUBIC_METERS,
VOLUME_FLOW_RATE_CUBIC_METERS_PER_HOUR,
)
from homeassistant.helpers import entity_registry as er
from homeassistant.setup import async_setup_component
from tests.common import MockConfigEntry, patch
@@ -107,7 +108,7 @@ async def test_default_setup(hass, dsmr_connection_fixture):
await hass.config_entries.async_setup(mock_entry.entry_id)
await hass.async_block_till_done()
registry = await hass.helpers.entity_registry.async_get_registry()
registry = er.async_get(hass)
entry = registry.async_get("sensor.power_consumption")
assert entry
@@ -167,7 +168,7 @@ async def test_setup_only_energy(hass, dsmr_connection_fixture):
await hass.config_entries.async_setup(mock_entry.entry_id)
await hass.async_block_till_done()
registry = await hass.helpers.entity_registry.async_get_registry()
registry = er.async_get(hass)
entry = registry.async_get("sensor.power_consumption")
assert entry