mirror of
https://github.com/home-assistant/core.git
synced 2025-11-09 02:49:40 +00:00
Fix namespace-import pylint warning in components (#119299)
This commit is contained in:
@@ -24,7 +24,7 @@ from homeassistant.components.hassio.const import REQUEST_REFRESH_DELAY
|
||||
from homeassistant.components.hassio.handler import HassioAPIError
|
||||
from homeassistant.components.sensor import DOMAIN as SENSOR_DOMAIN
|
||||
from homeassistant.core import HomeAssistant
|
||||
from homeassistant.helpers.device_registry import async_get
|
||||
from homeassistant.helpers import device_registry as dr
|
||||
from homeassistant.setup import async_setup_component
|
||||
from homeassistant.util import dt as dt_util
|
||||
|
||||
@@ -773,9 +773,10 @@ async def test_migration_off_hassio(hass: HomeAssistant) -> None:
|
||||
assert hass.config_entries.async_entries(DOMAIN) == []
|
||||
|
||||
|
||||
async def test_device_registry_calls(hass: HomeAssistant) -> None:
|
||||
async def test_device_registry_calls(
|
||||
hass: HomeAssistant, device_registry: dr.DeviceRegistry
|
||||
) -> None:
|
||||
"""Test device registry entries for hassio."""
|
||||
dev_reg = async_get(hass)
|
||||
supervisor_mock_data = {
|
||||
"version": "1.0.0",
|
||||
"version_latest": "1.0.0",
|
||||
@@ -829,7 +830,7 @@ async def test_device_registry_calls(hass: HomeAssistant) -> None:
|
||||
config_entry.add_to_hass(hass)
|
||||
assert await hass.config_entries.async_setup(config_entry.entry_id)
|
||||
await hass.async_block_till_done(wait_background_tasks=True)
|
||||
assert len(dev_reg.devices) == 6
|
||||
assert len(device_registry.devices) == 6
|
||||
|
||||
supervisor_mock_data = {
|
||||
"version": "1.0.0",
|
||||
@@ -863,11 +864,11 @@ async def test_device_registry_calls(hass: HomeAssistant) -> None:
|
||||
):
|
||||
async_fire_time_changed(hass, dt_util.now() + timedelta(hours=1))
|
||||
await hass.async_block_till_done(wait_background_tasks=True)
|
||||
assert len(dev_reg.devices) == 5
|
||||
assert len(device_registry.devices) == 5
|
||||
|
||||
async_fire_time_changed(hass, dt_util.now() + timedelta(hours=2))
|
||||
await hass.async_block_till_done(wait_background_tasks=True)
|
||||
assert len(dev_reg.devices) == 5
|
||||
assert len(device_registry.devices) == 5
|
||||
|
||||
supervisor_mock_data = {
|
||||
"version": "1.0.0",
|
||||
@@ -921,7 +922,7 @@ async def test_device_registry_calls(hass: HomeAssistant) -> None:
|
||||
):
|
||||
async_fire_time_changed(hass, dt_util.now() + timedelta(hours=3))
|
||||
await hass.async_block_till_done()
|
||||
assert len(dev_reg.devices) == 5
|
||||
assert len(device_registry.devices) == 5
|
||||
|
||||
|
||||
async def test_coordinator_updates(
|
||||
|
||||
Reference in New Issue
Block a user