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

@ -13,6 +13,7 @@ from homeassistant.components.switch import (
DOMAIN as SWITCH_DOMAIN,
)
from homeassistant.const import STATE_UNAVAILABLE
from homeassistant.helpers import device_registry as dr, entity_registry as er
from homeassistant.helpers.dispatcher import async_dispatcher_send
from .conftest import setup_platform
@ -22,8 +23,8 @@ async def test_entity_and_device_attributes(hass, device_factory):
"""Test the attributes of the entity are correct."""
# Arrange
device = device_factory("Switch_1", [Capability.switch], {Attribute.switch: "on"})
entity_registry = await hass.helpers.entity_registry.async_get_registry()
device_registry = await hass.helpers.device_registry.async_get_registry()
entity_registry = er.async_get(hass)
device_registry = dr.async_get(hass)
# Act
await setup_platform(hass, SWITCH_DOMAIN, devices=[device])
# Assert