Cleanup deprecated async_get_registry in homekit_controller (#72069)

pull/72087/head
epenet 2022-05-18 14:21:56 +02:00 committed by GitHub
parent 70aa71eeed
commit 4978d5f86e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 3 additions and 6 deletions

View File

@ -14,10 +14,7 @@ from homeassistant import config_entries
from homeassistant.components import zeroconf
from homeassistant.core import callback
from homeassistant.data_entry_flow import AbortFlow, FlowResult
from homeassistant.helpers.device_registry import (
CONNECTION_NETWORK_MAC,
async_get_registry as async_get_device_registry,
)
from homeassistant.helpers import device_registry as dr
from .const import DOMAIN, KNOWN_DEVICES
from .utils import async_get_controller
@ -163,9 +160,9 @@ class HomekitControllerFlowHandler(config_entries.ConfigFlow, domain=DOMAIN):
async def _hkid_is_homekit(self, hkid):
"""Determine if the device is a homekit bridge or accessory."""
dev_reg = await async_get_device_registry(self.hass)
dev_reg = dr.async_get(self.hass)
device = dev_reg.async_get_device(
identifiers=set(), connections={(CONNECTION_NETWORK_MAC, hkid)}
identifiers=set(), connections={(dr.CONNECTION_NETWORK_MAC, hkid)}
)
if device is None: