Cleanup deprecated async_get_registry in synology_dsm (#72075)

pull/72087/head
epenet 2022-05-18 14:09:04 +02:00 committed by GitHub
parent 9c4a046a2b
commit df13fcd1a5
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 3 additions and 8 deletions

View File

@ -22,12 +22,7 @@ from homeassistant.config_entries import ConfigEntry
from homeassistant.const import CONF_MAC, CONF_SCAN_INTERVAL, CONF_VERIFY_SSL
from homeassistant.core import HomeAssistant
from homeassistant.exceptions import ConfigEntryAuthFailed, ConfigEntryNotReady
from homeassistant.helpers import device_registry
import homeassistant.helpers.config_validation as cv
from homeassistant.helpers.device_registry import (
DeviceEntry,
async_get_registry as get_dev_reg,
)
from homeassistant.helpers import config_validation as cv, device_registry as dr
from homeassistant.helpers.update_coordinator import DataUpdateCoordinator, UpdateFailed
from .common import SynoApi
@ -57,8 +52,8 @@ async def async_setup_entry(hass: HomeAssistant, entry: ConfigEntry) -> bool:
"""Set up Synology DSM sensors."""
# Migrate device indentifiers
dev_reg = await get_dev_reg(hass)
devices: list[DeviceEntry] = device_registry.async_entries_for_config_entry(
dev_reg = dr.async_get(hass)
devices: list[dr.DeviceEntry] = dr.async_entries_for_config_entry(
dev_reg, entry.entry_id
)
for device in devices: