From be0decbfd0340c84bae78c5d6dfe8f89f47888df Mon Sep 17 00:00:00 2001 From: Magnus Erler <32124450+MagnusErler@users.noreply.github.com> Date: Wed, 1 May 2024 21:33:10 +0200 Subject: [PATCH] accesses hass.helpers.device_registry --- custom_components/sagemcom_fast/__init__.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/custom_components/sagemcom_fast/__init__.py b/custom_components/sagemcom_fast/__init__.py index 7dbfb84..6264535 100644 --- a/custom_components/sagemcom_fast/__init__.py +++ b/custom_components/sagemcom_fast/__init__.py @@ -16,7 +16,7 @@ ) from homeassistant.core import HomeAssistant from homeassistant.exceptions import ConfigEntryAuthFailed, ConfigEntryNotReady -from homeassistant.helpers import aiohttp_client +from homeassistant.helpers import aiohttp_client, device_registry from homeassistant.helpers.device_registry import CONNECTION_NETWORK_MAC from sagemcom_api.client import SagemcomClient from sagemcom_api.enums import EncryptionMethod @@ -105,9 +105,9 @@ async def async_setup_entry(hass: HomeAssistant, entry: ConfigEntry): ) # Create gateway device in Home Assistant - device_registry = hass.helpers.device_registry.async_get(hass) + dev_registry = device_registry.async_get(hass) - device_registry.async_get_or_create( + dev_registry.async_get_or_create( config_entry_id=entry.entry_id, connections={(CONNECTION_NETWORK_MAC, gateway.mac_address)}, identifiers={(DOMAIN, gateway.serial_number)},