Adapt bang_olufsen to new device registry API (#176937)

This commit is contained in:
Erik Montnemery
2026-07-21 08:22:01 +02:00
committed by GitHub
parent f98fa2b8e3
commit 7f34edfd4b
2 changed files with 5 additions and 3 deletions
@@ -21,10 +21,12 @@ from .const import (
)
def get_device(hass: HomeAssistant, unique_id: str) -> DeviceEntry:
def get_device(hass: HomeAssistant, unique_id: str, entry_id: str) -> DeviceEntry:
"""Get the device."""
device_registry = dr.async_get(hass)
device = device_registry.async_get_device({(DOMAIN, unique_id)})
device = device_registry.async_get_device_by_identifier(
(DOMAIN, unique_id), entry_id
)
assert device
return device
@@ -50,7 +50,7 @@ class BeoWebsocket(BeoBase):
BeoBase.__init__(self, entry, client)
self.hass = hass
self._device = get_device(hass, self._unique_id)
self._device = get_device(hass, self._unique_id, self.entry.entry_id)
# WebSocket callbacks
self._client.get_notification_notifications(self.on_notification_notification)