mirror of
https://github.com/home-assistant/core.git
synced 2025-07-11 15:27:08 +00:00
Cleanup deprecated async_get_registry in synology_dsm (#72075)
This commit is contained in:
parent
9c4a046a2b
commit
df13fcd1a5
@ -22,12 +22,7 @@ from homeassistant.config_entries import ConfigEntry
|
|||||||
from homeassistant.const import CONF_MAC, CONF_SCAN_INTERVAL, CONF_VERIFY_SSL
|
from homeassistant.const import CONF_MAC, CONF_SCAN_INTERVAL, CONF_VERIFY_SSL
|
||||||
from homeassistant.core import HomeAssistant
|
from homeassistant.core import HomeAssistant
|
||||||
from homeassistant.exceptions import ConfigEntryAuthFailed, ConfigEntryNotReady
|
from homeassistant.exceptions import ConfigEntryAuthFailed, ConfigEntryNotReady
|
||||||
from homeassistant.helpers import device_registry
|
from homeassistant.helpers import config_validation as cv, device_registry as dr
|
||||||
import homeassistant.helpers.config_validation as cv
|
|
||||||
from homeassistant.helpers.device_registry import (
|
|
||||||
DeviceEntry,
|
|
||||||
async_get_registry as get_dev_reg,
|
|
||||||
)
|
|
||||||
from homeassistant.helpers.update_coordinator import DataUpdateCoordinator, UpdateFailed
|
from homeassistant.helpers.update_coordinator import DataUpdateCoordinator, UpdateFailed
|
||||||
|
|
||||||
from .common import SynoApi
|
from .common import SynoApi
|
||||||
@ -57,8 +52,8 @@ async def async_setup_entry(hass: HomeAssistant, entry: ConfigEntry) -> bool:
|
|||||||
"""Set up Synology DSM sensors."""
|
"""Set up Synology DSM sensors."""
|
||||||
|
|
||||||
# Migrate device indentifiers
|
# Migrate device indentifiers
|
||||||
dev_reg = await get_dev_reg(hass)
|
dev_reg = dr.async_get(hass)
|
||||||
devices: list[DeviceEntry] = device_registry.async_entries_for_config_entry(
|
devices: list[dr.DeviceEntry] = dr.async_entries_for_config_entry(
|
||||||
dev_reg, entry.entry_id
|
dev_reg, entry.entry_id
|
||||||
)
|
)
|
||||||
for device in devices:
|
for device in devices:
|
||||||
|
Loading…
x
Reference in New Issue
Block a user