mirror of
https://github.com/home-assistant/core.git
synced 2025-07-22 12:47:08 +00:00
Don't use deprecated ways of retrieving registries in Axis (#58083)
This commit is contained in:
parent
dfd2501c2c
commit
4736bf3c32
@ -23,6 +23,7 @@ from homeassistant.const import (
|
|||||||
)
|
)
|
||||||
from homeassistant.core import HomeAssistant, callback
|
from homeassistant.core import HomeAssistant, callback
|
||||||
from homeassistant.exceptions import ConfigEntryAuthFailed, ConfigEntryNotReady
|
from homeassistant.exceptions import ConfigEntryAuthFailed, ConfigEntryNotReady
|
||||||
|
from homeassistant.helpers import device_registry as dr
|
||||||
from homeassistant.helpers.device_registry import CONNECTION_NETWORK_MAC
|
from homeassistant.helpers.device_registry import CONNECTION_NETWORK_MAC
|
||||||
from homeassistant.helpers.dispatcher import async_dispatcher_send
|
from homeassistant.helpers.dispatcher import async_dispatcher_send
|
||||||
from homeassistant.helpers.httpx_client import get_async_client
|
from homeassistant.helpers.httpx_client import get_async_client
|
||||||
@ -168,7 +169,7 @@ class AxisNetworkDevice:
|
|||||||
|
|
||||||
async def async_update_device_registry(self):
|
async def async_update_device_registry(self):
|
||||||
"""Update device registry."""
|
"""Update device registry."""
|
||||||
device_registry = await self.hass.helpers.device_registry.async_get_registry()
|
device_registry = dr.async_get(self.hass)
|
||||||
device_registry.async_get_or_create(
|
device_registry.async_get_or_create(
|
||||||
config_entry_id=self.config_entry.entry_id,
|
config_entry_id=self.config_entry.entry_id,
|
||||||
connections={(CONNECTION_NETWORK_MAC, self.unique_id)},
|
connections={(CONNECTION_NETWORK_MAC, self.unique_id)},
|
||||||
|
Loading…
x
Reference in New Issue
Block a user