Update tests p-s to use async_get() instead of async_get_registry() (#47654)

This commit is contained in:
Erik Montnemery 2021-03-09 14:28:32 +01:00 committed by GitHub
parent b3fecb1c95
commit ba2978c693
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
29 changed files with 103 additions and 86 deletions

View file

@ -12,6 +12,7 @@ from homeassistant.const import (
DATA_GIGABYTES,
STATE_UNAVAILABLE,
)
from homeassistant.helpers import entity_registry as er
from homeassistant.helpers.typing import HomeAssistantType
from homeassistant.util import dt as dt_util
@ -27,7 +28,7 @@ async def test_sensors(
) -> None:
"""Test the creation and values of the sensors."""
entry = await setup_integration(hass, aioclient_mock, skip_entry_setup=True)
registry = await hass.helpers.entity_registry.async_get_registry()
registry = er.async_get(hass)
# Pre-create registry entries for disabled by default sensors
sensors = {
@ -107,7 +108,7 @@ async def test_disabled_by_default_sensors(
) -> None:
"""Test the disabled by default sensors."""
await setup_integration(hass, aioclient_mock)
registry = await hass.helpers.entity_registry.async_get_registry()
registry = er.async_get(hass)
print(registry.entities)
state = hass.states.get(entity_id)