mirror of
https://github.com/home-assistant/core.git
synced 2025-07-28 07:37:34 +00:00
Cleanup deprecated async_get_registry in homekit_controller (#72069)
This commit is contained in:
parent
70aa71eeed
commit
4978d5f86e
@ -14,10 +14,7 @@ from homeassistant import config_entries
|
|||||||
from homeassistant.components import zeroconf
|
from homeassistant.components import zeroconf
|
||||||
from homeassistant.core import callback
|
from homeassistant.core import callback
|
||||||
from homeassistant.data_entry_flow import AbortFlow, FlowResult
|
from homeassistant.data_entry_flow import AbortFlow, FlowResult
|
||||||
from homeassistant.helpers.device_registry import (
|
from homeassistant.helpers import device_registry as dr
|
||||||
CONNECTION_NETWORK_MAC,
|
|
||||||
async_get_registry as async_get_device_registry,
|
|
||||||
)
|
|
||||||
|
|
||||||
from .const import DOMAIN, KNOWN_DEVICES
|
from .const import DOMAIN, KNOWN_DEVICES
|
||||||
from .utils import async_get_controller
|
from .utils import async_get_controller
|
||||||
@ -163,9 +160,9 @@ class HomekitControllerFlowHandler(config_entries.ConfigFlow, domain=DOMAIN):
|
|||||||
|
|
||||||
async def _hkid_is_homekit(self, hkid):
|
async def _hkid_is_homekit(self, hkid):
|
||||||
"""Determine if the device is a homekit bridge or accessory."""
|
"""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(
|
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:
|
if device is None:
|
||||||
|
Loading…
x
Reference in New Issue
Block a user