Skip to content

Commit

Permalink
accesses hass.helpers.device_registry
Browse files Browse the repository at this point in the history
  • Loading branch information
MagnusErler authored May 1, 2024
1 parent 8128727 commit be0decb
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions custom_components/sagemcom_fast/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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)},
Expand Down

0 comments on commit be0decb

Please sign in to comment.