diff --git a/homeassistant/components/nest/manifest.json b/homeassistant/components/nest/manifest.json index 94b2c338528..3a4f64877d2 100644 --- a/homeassistant/components/nest/manifest.json +++ b/homeassistant/components/nest/manifest.json @@ -4,7 +4,7 @@ "config_flow": true, "dependencies": ["ffmpeg", "http", "media_source"], "documentation": "https://www.home-assistant.io/integrations/nest", - "requirements": ["python-nest==4.1.0", "google-nest-sdm==0.4.0"], + "requirements": ["python-nest==4.1.0", "google-nest-sdm==0.4.2"], "codeowners": ["@allenporter"], "quality_scale": "platinum", "dhcp": [ diff --git a/homeassistant/components/nest/media_source.py b/homeassistant/components/nest/media_source.py index af51c296e43..140489bd63a 100644 --- a/homeassistant/components/nest/media_source.py +++ b/homeassistant/components/nest/media_source.py @@ -137,7 +137,7 @@ class NestMediaSource(MediaSource): raise Unresolvable( "Unable to find device with identifier: %s" % item.identifier ) - events = _get_events(device) + events = await _get_events(device) if media_id.event_id not in events: raise Unresolvable( "Unable to find event with identifier: %s" % item.identifier @@ -180,7 +180,7 @@ class NestMediaSource(MediaSource): # Browse a specific device and return child events browse_device = _browse_device(media_id, device) browse_device.children = [] - events = _get_events(device) + events = await _get_events(device) for child_event in events.values(): event_id = MediaId(media_id.device_id, child_event.event_id) browse_device.children.append( @@ -189,7 +189,7 @@ class NestMediaSource(MediaSource): return browse_device # Browse a specific event - events = _get_events(device) + events = await _get_events(device) if not (event := events.get(media_id.event_id)): raise BrowseError( "Unable to find event with identiifer: %s" % item.identifier @@ -201,9 +201,10 @@ class NestMediaSource(MediaSource): return await get_media_source_devices(self.hass) -def _get_events(device: Device) -> Mapping[str, ImageEventBase]: +async def _get_events(device: Device) -> Mapping[str, ImageEventBase]: """Return relevant events for the specified device.""" - return OrderedDict({e.event_id: e for e in device.event_media_manager.events}) + events = await device.event_media_manager.async_events() + return OrderedDict({e.event_id: e for e in events}) def _browse_root() -> BrowseMediaSource: diff --git a/requirements_all.txt b/requirements_all.txt index 765b67088f2..0644f704fd4 100644 --- a/requirements_all.txt +++ b/requirements_all.txt @@ -738,7 +738,7 @@ google-cloud-pubsub==2.1.0 google-cloud-texttospeech==0.4.0 # homeassistant.components.nest -google-nest-sdm==0.4.0 +google-nest-sdm==0.4.2 # homeassistant.components.google_travel_time googlemaps==2.5.1 diff --git a/requirements_test_all.txt b/requirements_test_all.txt index e8b2c62eeb4..09e78d41032 100644 --- a/requirements_test_all.txt +++ b/requirements_test_all.txt @@ -461,7 +461,7 @@ google-api-python-client==1.6.4 google-cloud-pubsub==2.1.0 # homeassistant.components.nest -google-nest-sdm==0.4.0 +google-nest-sdm==0.4.2 # homeassistant.components.google_travel_time googlemaps==2.5.1