Bump nest to version 0.4.2 (#61036)

pull/61045/head
Allen Porter 2021-12-05 01:50:47 -08:00 committed by GitHub
parent 08003c5287
commit e34d982bdb
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 9 additions and 8 deletions

View File

@ -4,7 +4,7 @@
"config_flow": true, "config_flow": true,
"dependencies": ["ffmpeg", "http", "media_source"], "dependencies": ["ffmpeg", "http", "media_source"],
"documentation": "https://www.home-assistant.io/integrations/nest", "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"], "codeowners": ["@allenporter"],
"quality_scale": "platinum", "quality_scale": "platinum",
"dhcp": [ "dhcp": [

View File

@ -137,7 +137,7 @@ class NestMediaSource(MediaSource):
raise Unresolvable( raise Unresolvable(
"Unable to find device with identifier: %s" % item.identifier "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: if media_id.event_id not in events:
raise Unresolvable( raise Unresolvable(
"Unable to find event with identifier: %s" % item.identifier "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 a specific device and return child events
browse_device = _browse_device(media_id, device) browse_device = _browse_device(media_id, device)
browse_device.children = [] browse_device.children = []
events = _get_events(device) events = await _get_events(device)
for child_event in events.values(): for child_event in events.values():
event_id = MediaId(media_id.device_id, child_event.event_id) event_id = MediaId(media_id.device_id, child_event.event_id)
browse_device.children.append( browse_device.children.append(
@ -189,7 +189,7 @@ class NestMediaSource(MediaSource):
return browse_device return browse_device
# Browse a specific event # Browse a specific event
events = _get_events(device) events = await _get_events(device)
if not (event := events.get(media_id.event_id)): if not (event := events.get(media_id.event_id)):
raise BrowseError( raise BrowseError(
"Unable to find event with identiifer: %s" % item.identifier "Unable to find event with identiifer: %s" % item.identifier
@ -201,9 +201,10 @@ class NestMediaSource(MediaSource):
return await get_media_source_devices(self.hass) 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 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: def _browse_root() -> BrowseMediaSource:

View File

@ -738,7 +738,7 @@ google-cloud-pubsub==2.1.0
google-cloud-texttospeech==0.4.0 google-cloud-texttospeech==0.4.0
# homeassistant.components.nest # homeassistant.components.nest
google-nest-sdm==0.4.0 google-nest-sdm==0.4.2
# homeassistant.components.google_travel_time # homeassistant.components.google_travel_time
googlemaps==2.5.1 googlemaps==2.5.1

View File

@ -461,7 +461,7 @@ google-api-python-client==1.6.4
google-cloud-pubsub==2.1.0 google-cloud-pubsub==2.1.0
# homeassistant.components.nest # homeassistant.components.nest
google-nest-sdm==0.4.0 google-nest-sdm==0.4.2
# homeassistant.components.google_travel_time # homeassistant.components.google_travel_time
googlemaps==2.5.1 googlemaps==2.5.1