Update tests a-b to use async_get() instead of async_get_registry() (#47651)

This commit is contained in:
Erik Montnemery 2021-03-09 14:24:34 +01:00 committed by GitHub
parent 3a054c3be7
commit 78b21b1ad1
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
40 changed files with 110 additions and 86 deletions

View file

@ -1,5 +1,4 @@
"""Blebox sensors tests."""
import logging
from unittest.mock import AsyncMock, PropertyMock
@ -13,6 +12,7 @@ from homeassistant.const import (
STATE_UNKNOWN,
TEMP_CELSIUS,
)
from homeassistant.helpers import device_registry as dr
from .conftest import async_setup_entity, mock_feature
@ -49,7 +49,7 @@ async def test_init(tempsensor, hass, config):
assert state.attributes[ATTR_UNIT_OF_MEASUREMENT] == TEMP_CELSIUS
assert state.state == STATE_UNKNOWN
device_registry = await hass.helpers.device_registry.async_get_registry()
device_registry = dr.async_get(hass)
device = device_registry.async_get(entry.device_id)
assert device.name == "My temperature sensor"