Update tests a-b to use async_get() instead of async_get_registry() (#47651)
This commit is contained in:
parent
3a054c3be7
commit
78b21b1ad1
40 changed files with 110 additions and 86 deletions
|
@ -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"
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue