diff --git a/custom_components/yi_hack/media_source.py b/custom_components/yi_hack/media_source.py index 2210785..f38ace6 100644 --- a/custom_components/yi_hack/media_source.py +++ b/custom_components/yi_hack/media_source.py @@ -26,6 +26,7 @@ CONF_USERNAME ) from homeassistant.core import HomeAssistant, callback +from homeassistant.helpers import device_registry as dr from .const import DEFAULT_BRAND, DOMAIN, HTTP_TIMEOUT @@ -68,7 +69,7 @@ async def async_browse_media(self, item: MediaSourceItem) -> BrowseMediaSource: entry_id, event_dir, event_file = async_parse_identifier(item) if len(self._devices) == 0: - device_registry = self.hass.helpers.device_registry.async_get(self.hass) + device_registry = dr.async_get(self.hass) for device in device_registry.devices.values(): if device.identifiers is not None: try: