Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add Nest Battery Cam event clip support with a Nest MediaSource #60073

Merged
merged 5 commits into from Dec 3, 2021

Conversation

allenporter
Copy link
Contributor

Proposed change

Add Nest Battery Cam event clip support with a Nest MediaSource

This adds an API for rendering media related to events, which includes
images as well as mp4 clip previews for Nest battery cameras. The media
source contains:

  • A toplevel folder for Nest recent events
  • A folder for every device that supports event media (images or video)
  • Entries for recent events, such as "Person detected"

Future versions will include options for adjusting the of number of
events preserved, or media pre-fetching, as right now its just the
most recent event for each device, and fetched on demand.

Test coverage is 99% for the media_source and init.

Type of change

  • Dependency upgrade
  • Bugfix (non-breaking change which fixes an issue)
  • New integration (thank you!)
  • New feature (which adds functionality to an existing integration)
  • Breaking change (fix/feature causing existing functionality to break)
  • Code quality improvements to existing code or addition of tests

Additional information

Checklist

  • The code change is tested and works locally.
  • Local tests pass. Your PR cannot be merged unless tests pass
  • There is no commented out code in this PR.
  • I have followed the development checklist
  • The code has been formatted using Black (black --fast homeassistant tests)
  • Tests have been added to verify that the new code works.

If user exposed functionality or configuration variables are added/changed:

If the code communicates with devices, web services, or third-party tools:

  • The manifest file has all fields filled out correctly.
    Updated and included derived files by running: python3 -m script.hassfest.
  • New or updated dependencies have been added to requirements_all.txt.
    Updated by running python3 -m script.gen_requirements_all.
  • For the updated dependencies - a link to the changelog, or at minimum a diff between library versions is added to the PR description.
  • Untested files have been added to .coveragerc.

The integration reached or maintains the following Integration Quality Scale:

  • No score or internal
  • 馃 Silver
  • 馃 Gold
  • 馃弳 Platinum

To help with the load of incoming pull requests:

self, request: web.Request, device_id: str, event_id: str
) -> web.StreamResponse:
"""Start a GET request."""
devices = await get_media_source_devices(self.hass)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let's verify the user can access the device.

user = request[KEY_HASS_USER]
entity_id = ...  # Resolve device ID to camera entity ID.
user.permissions.check_entity(entity_id, POLICY_READ)

(we don't have a UI for this, but if we ever do, it is good to have these checks in place)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should the media source do this also?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yeah

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I did a quick look and this may require an architecture issue given the interface to the media player doesn't appear to provide this information. There was an arch discussion about a media source entity which could also be relevant. The way the check is currently implemented is the user needs access to all entities associated with a device, to be conservative even though.in practice there is only one nest camera today) but that could lend itself well to a media player entity permission. I'm sure though if this feature.is implemented the entire code base needs to be audited anyway, so we're just being slightly proactive here.

f"No event found for event_id '{event_id}'", HTTPStatus.NOT_FOUND
)
media = event_media.media
return web.Response(
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If this endpoint is only used for playing media, it would be great if we could use a 301 redirect to the actual content.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We chatted about this, and the context here is that there are two steps:

  • Convert an image to a URL which must be done within ~30 seconds of the event
  • Fetch the bytes from the URL which also must be done within ~30 seconds
  • We may also will transform the bytes in the case of media clips since they are 10 frame mp4s and we want to slow them down a bit

Right now this has a cache of a couple items. However, we also effectively need to always fetch these images directly when the event happens and persist them to really meet the user expectation of how this should work. So we'll consider a 1gb disk cache or something like this, and I think it may have a similar interface as what is already here.

This adds an API for rendering media related to events, which includes
images as well as mp4 clip previews for Nest battery cameras. The media
source contains:
- A toplevel folder for Nest recent events
- A folder for every device that supports event media (images or video)
- Entries for recent events, such as "Person detected"

Future versions will include options for adjusting the of number of
events preserved, or media pre-fetching, as right now its just the
most recent event for each device, and fetched on demand.

Test coverage is 99% for the media_source and init.
Dev automation moved this from By Code Owner to Reviewer approved Dec 3, 2021
@balloob balloob merged commit ba99dc3 into home-assistant:dev Dec 3, 2021
Dev automation moved this from Reviewer approved to Done Dec 3, 2021
cmroche added a commit to cmroche/core that referenced this pull request Dec 4, 2021
commit e36f9f6
Author: Charles Garwood <cgarwood@gmail.com>
Date:   Sat Dec 4 09:13:05 2021 -0500

    Revert "Use language independent variable to read MPC-HC state" (home-assistant#60993)

commit c44eaca
Author: infeeeee <gyetpet@mailbox.org>
Date:   Sat Dec 4 14:47:49 2021 +0100

    Use state variable from mpchc (home-assistant#59341)

commit b79b35a
Author: Marc Mueller <30130371+cdce8p@users.noreply.github.com>
Date:   Sat Dec 4 14:10:01 2021 +0100

    Use platform enum (7) [T-Z] (home-assistant#60948)

    Co-authored-by: Joakim S酶rensen <hi@ludeeus.dev>
    Co-authored-by: Franck Nijhof <frenck@frenck.nl>

commit 73c880b
Author: Franck Nijhof <git@frenck.dev>
Date:   Sat Dec 4 13:52:42 2021 +0100

    Fix typo in state_characteristic warning (home-assistant#60990)

commit 66c7387
Author: Franck Nijhof <git@frenck.dev>
Date:   Sat Dec 4 13:46:42 2021 +0100

    Fix str for device registry entry_type warnings caused by core (home-assistant#60989)

commit f719340
Author: Marc Mueller <30130371+cdce8p@users.noreply.github.com>
Date:   Sat Dec 4 13:43:48 2021 +0100

    Use platform enum (6) [S] (home-assistant#60944)

commit ffb4b4d
Author: Franck Nijhof <git@frenck.dev>
Date:   Sat Dec 4 13:37:42 2021 +0100

    Only report deprecated device_state_attributes once (home-assistant#60980)

commit 216ecf3
Author: Franck Nijhof <git@frenck.dev>
Date:   Sat Dec 4 13:31:34 2021 +0100

    Fix DSMR Reader providing strings as timestamps (home-assistant#60988)

commit cd1b923
Author: Marc Mueller <30130371+cdce8p@users.noreply.github.com>
Date:   Sat Dec 4 13:26:40 2021 +0100

    Use platform enum (2) [E-G] (home-assistant#60933)

commit 79cd281
Author: Marc Mueller <30130371+cdce8p@users.noreply.github.com>
Date:   Sat Dec 4 13:19:49 2021 +0100

    Use platform enum (5) [P-R] (home-assistant#60943)

commit ed6352a
Author: Franck Nijhof <git@frenck.dev>
Date:   Sat Dec 4 12:33:34 2021 +0100

    Fix Xiaomi Miio providing strings as timestamps (home-assistant#60979)

commit c9bb688
Author: Martin Hjelmare <marhje52@gmail.com>
Date:   Sat Dec 4 10:29:48 2021 +0100

    Revert metoffice weather daytime (home-assistant#60978)

commit 8bb1a3f
Author: Chen-IL <18098431+Chen-IL@users.noreply.github.com>
Date:   Sat Dec 4 11:29:26 2021 +0200

    Improve asuswrt code readability (home-assistant#60975)

commit 267896c
Author: Raman Gupta <7243222+raman325@users.noreply.github.com>
Date:   Sat Dec 4 04:17:17 2021 -0500

    Address late review of eight_sleep (home-assistant#60951)

commit 6d6e0dd
Author: Thomas Dietrich <Thomas@Nurzen.de>
Date:   Sat Dec 4 09:50:47 2021 +0100

    Add unique_id to the statistics component (home-assistant#59205)

    * Implement optional manually defined uniqueid

    * Fix test case via mocked environment

commit a553054
Author: J. Nick Koston <nick@koston.org>
Date:   Fri Dec 3 22:44:16 2021 -1000

    Fix flood lights not turning on/off with flux_led (home-assistant#60973)

commit ad63149
Author: J. Nick Koston <nick@koston.org>
Date:   Fri Dec 3 22:20:56 2021 -1000

    Fix dimmable effects for flux_led model 0x33 v9+ (home-assistant#60972)

commit a59ec9c
Author: Paulus Schoutsen <balloob@gmail.com>
Date:   Sat Dec 4 00:20:12 2021 -0800

    Handle invalid device registry entry type (home-assistant#60966)

    Co-authored-by: Franck Nijhof <git@frenck.dev>

commit 2fe4870
Author: Paulus Schoutsen <balloob@gmail.com>
Date:   Sat Dec 4 00:17:13 2021 -0800

    Fix statistics registering at start callback (home-assistant#60963)

commit b2ee62b
Author: Franck Nijhof <git@frenck.dev>
Date:   Sat Dec 4 09:16:00 2021 +0100

    Upgrade luftdaten to 0.7.1 (home-assistant#60970)

commit 1485020
Author: Franck Nijhof <git@frenck.dev>
Date:   Sat Dec 4 09:15:26 2021 +0100

    Upgrade netdata to 1.0.1 (home-assistant#60971)

commit 156435d
Author: Marc Mueller <30130371+cdce8p@users.noreply.github.com>
Date:   Sat Dec 4 08:57:24 2021 +0100

    Update integrations to use `async_setup_platforms` (home-assistant#60956)

    * Replace forward_entry_setup with setup_platforms

    * Apply suggestions from code review

    Co-authored-by: Marvin Wichmann <marvin@fam-wichmann.de>

    Co-authored-by: Marvin Wichmann <marvin@fam-wichmann.de>

commit 10e669e
Author: J. Nick Koston <nick@koston.org>
Date:   Fri Dec 3 21:41:58 2021 -1000

    Fix yeelight name changing to ip address if discovery fails (home-assistant#60967)

commit b8071c6
Author: Paulus Schoutsen <balloob@gmail.com>
Date:   Fri Dec 3 23:24:22 2021 -0800

    Correctly type the SSDP callback function (home-assistant#60964)

commit 7fbe1db
Author: J. Nick Koston <nick@koston.org>
Date:   Fri Dec 3 19:57:46 2021 -1000

    Remove legacy fan compatibility shim (home-assistant#59781)

commit 566716d
Author: Aaron Bach <bachya1208@gmail.com>
Date:   Fri Dec 3 21:05:01 2021 -0700

    Ensure that inactive RainMachine switch that is toggled on is toggled back off (home-assistant#60959)

commit 68ca0a0
Author: GitHub Action <github-action@users.noreply.github.com>
Date:   Sat Dec 4 00:13:16 2021 +0000

    [ci skip] Translation update

commit dcf3bae
Author: Penny Wood <Swamp-Ig@users.noreply.github.com>
Date:   Sat Dec 4 07:28:23 2021 +0800

    Updated code as per comment in home-assistant#60676 (home-assistant#60682)

    * Minor code refactor

commit 8c30141
Author: Raman Gupta <7243222+raman325@users.noreply.github.com>
Date:   Fri Dec 3 18:01:48 2021 -0500

    Fix nzbget datetime return value (home-assistant#60953)

commit 3471a44
Author: Franck Nijhof <git@frenck.dev>
Date:   Fri Dec 3 21:06:14 2021 +0100

    2022! Happy New Year! (home-assistant#60936)

commit ac26c23
Author: Chen-IL <18098431+Chen-IL@users.noreply.github.com>
Date:   Fri Dec 3 21:27:17 2021 +0200

    Add temperature sensors for Asuswrt (home-assistant#58303)

    Co-authored-by: Paulus Schoutsen <balloob@gmail.com>

commit 0dfc869
Author: J. Nick Koston <nick@koston.org>
Date:   Fri Dec 3 09:26:15 2021 -1000

    Reduce flux_led dhcp matching complexity (home-assistant#60934)

commit d6c2780
Author: Clifford Roche <clifford.roche@gmail.com>
Date:   Fri Dec 3 14:18:53 2021 -0500

    Gree update device ips when changed (home-assistant#57876)

commit 788a9bd
Author: Raman Gupta <7243222+raman325@users.noreply.github.com>
Date:   Fri Dec 3 14:17:00 2021 -0500

    Clean up eight_sleep code (home-assistant#58508)

commit b60b38c
Author: Marc Mueller <30130371+cdce8p@users.noreply.github.com>
Date:   Fri Dec 3 20:14:21 2021 +0100

    Fix amcrest pylint issue (home-assistant#60932)

commit c915aa1
Author: Jonathan Keslin <decompil3d@users.noreply.github.com>
Date:   Fri Dec 3 11:07:03 2021 -0800

    Update volvooncall, add hybrid plug status (home-assistant#58919)

commit 88b9354
Author: Jan Bouwhuis <jbouwh@users.noreply.github.com>
Date:   Fri Dec 3 20:04:05 2021 +0100

    Re-add-tests with new filters removed with home-assistant#60854 (home-assistant#60895)

commit 171b57b
Author: jjlawren <jjlawren@users.noreply.github.com>
Date:   Fri Dec 3 12:57:19 2021 -0600

    Use _attrs where possible in Sonos (home-assistant#60931)

commit ba99dc3
Author: Allen Porter <allen@thebends.org>
Date:   Fri Dec 3 10:53:05 2021 -0800

    Add Nest Battery Cam event clip support with a Nest MediaSource (home-assistant#60073)

commit 40f1b0d
Author: Matthias Alphart <farmio@alphart.net>
Date:   Fri Dec 3 19:43:01 2021 +0100

    Add quality scale for Fronius (home-assistant#60531)

commit fdb1372
Author: dougiteixeira <31328123+dougiteixeira@users.noreply.github.com>
Date:   Fri Dec 3 15:38:32 2021 -0300

    Add more Tuya Vacuum sensors and select entities (home-assistant#60927)

    Co-authored-by: Franck Nijhof <frenck@frenck.nl>

commit b65b25c
Author: epenet <6771947+epenet@users.noreply.github.com>
Date:   Fri Dec 3 19:34:48 2021 +0100

    Move MqttServiceInfo to init.py (home-assistant#60905)

    Co-authored-by: epenet <epenet@users.noreply.github.com>
    Co-authored-by: Paulus Schoutsen <balloob@gmail.com>

commit 74d1c34
Author: Franck Nijhof <git@frenck.dev>
Date:   Fri Dec 3 19:30:12 2021 +0100

    Allow use of relative_time as a filter (home-assistant#60923)

commit 02b5449
Author: David F. Mulcahey <david.mulcahey@me.com>
Date:   Fri Dec 3 13:23:57 2021 -0500

    Add support for siren entities in ZHA (home-assistant#60920)

commit df36b3d
Author: Bram Kragten <mail@bramkragten.nl>
Date:   Fri Dec 3 19:20:09 2021 +0100

    Update frontend to 20211203.0 (home-assistant#60925)

commit e50a476
Author: Erik Montnemery <erik@montnemery.com>
Date:   Fri Dec 3 19:08:23 2021 +0100

    Enable basic type checking for climacell (home-assistant#55334)

commit cbf2bf2
Author: jjlawren <jjlawren@users.noreply.github.com>
Date:   Fri Dec 3 12:06:56 2021 -0600

    Add audio input format sensor to Sonos HT devices (home-assistant#60884)

commit b61dede
Author: Marius <33354141+Mariusthvdb@users.noreply.github.com>
Date:   Fri Dec 3 19:06:32 2021 +0100

    Add command_line icon_template (home-assistant#58877)

    Co-authored-by: epenet <6771947+epenet@users.noreply.github.com>

commit e056238
Author: Pedro Rodriguez Tavarez <pedro@pjrt.co>
Date:   Fri Dec 3 13:00:39 2021 -0500

    Implement privacy_mode for amcrest integration (home-assistant#57210)

commit 943c12e
Author: Franck Nijhof <git@frenck.dev>
Date:   Fri Dec 3 18:56:07 2021 +0100

    Revert "Temporarily disable CI concurrency" (home-assistant#60928)

commit cf7a614
Author: Tobias Sauerwein <cgtobi@users.noreply.github.com>
Date:   Fri Dec 3 18:33:24 2021 +0100

    Add battery sensor for Netatmo climate devices (home-assistant#60911)

commit a80447f
Author: yanuino <36410910+yanuino@users.noreply.github.com>
Date:   Fri Dec 3 18:32:04 2021 +0100

    Use state class enum for DHT (home-assistant#60916)

commit 3baa7b6
Author: Marvin Wichmann <marvin@fam-wichmann.de>
Date:   Fri Dec 3 18:29:38 2021 +0100

    Use new Platform enum in KNX (home-assistant#60902)

commit 77cd751
Author: Matthias Alphart <farmio@alphart.net>
Date:   Fri Dec 3 18:29:15 2021 +0100

    DHCP discovery for Fronius integration (home-assistant#60806)

    Co-authored-by: J. Nick Koston <nick@koston.org>

commit 75ec937
Author: epenet <6771947+epenet@users.noreply.github.com>
Date:   Fri Dec 3 18:28:04 2021 +0100

    Use new Platform enum in Renault (home-assistant#60903)

    * Use Platform enum in Renault

    * Use Platform enum in Renault tests

    Co-authored-by: epenet <epenet@users.noreply.github.com>

commit 231d434
Author: epenet <6771947+epenet@users.noreply.github.com>
Date:   Fri Dec 3 18:25:22 2021 +0100

    Use new Platform enum in Onewire (home-assistant#60904)

    * Use new Platform enum in Onewire

    * Use Platform in tests

    Co-authored-by: epenet <epenet@users.noreply.github.com>

commit a6cd3e2
Author: epenet <6771947+epenet@users.noreply.github.com>
Date:   Fri Dec 3 18:20:58 2021 +0100

    Use dataclass properties in yeelight (home-assistant#60912)

    Co-authored-by: epenet <epenet@users.noreply.github.com>

commit adf2fa5
Author: epenet <6771947+epenet@users.noreply.github.com>
Date:   Fri Dec 3 18:20:00 2021 +0100

    Use EntityCategory enum in Onewire (home-assistant#60907)

    * Use EntityCategory enum in Onewire

    * Add checks for the entity_category

    * Fix typo

    Co-authored-by: epenet <epenet@users.noreply.github.com>

commit 0a2ca1f
Author: Franck Nijhof <git@frenck.dev>
Date:   Fri Dec 3 18:16:18 2021 +0100

    Temporarily disable CI concurrency (home-assistant#60926)

commit 17dc609
Author: Erik Montnemery <erik@montnemery.com>
Date:   Fri Dec 3 18:08:28 2021 +0100

    Correct validation of conditions in scripts and automations (home-assistant#60890)

    * Correct validation of conditions in scripts and automations

    * Fix test

commit f57d42a
Author: Marc Mueller <30130371+cdce8p@users.noreply.github.com>
Date:   Fri Dec 3 17:51:30 2021 +0100

    Use platform enum (1) [A-D] (home-assistant#60908)

    * Use platform enum (1) [A-D]

    * Fix imports

    * Fix tests

    * Use Platform even in tests

commit ef458b2
Author: Bram Kragten <mail@bramkragten.nl>
Date:   Fri Dec 3 16:34:26 2021 +0100

    Return if user is local only (home-assistant#60917)

commit b883014
Author: jjlawren <jjlawren@users.noreply.github.com>
Date:   Fri Dec 3 09:05:40 2021 -0600

    Add Sonos subwoofer and surround on/off controls (home-assistant#60918)

commit 7d8b3e9
Author: jjlawren <jjlawren@users.noreply.github.com>
Date:   Fri Dec 3 08:34:18 2021 -0600

    Bump soco to 0.25.0 (home-assistant#60915)

commit deae8dd
Author: Martin Hjelmare <marhje52@gmail.com>
Date:   Fri Dec 3 15:30:09 2021 +0100

    Bump pytradfri to 7.2.1 (home-assistant#60910)

commit e64f901
Author: epenet <6771947+epenet@users.noreply.github.com>
Date:   Fri Dec 3 14:47:56 2021 +0100

    Use dataclass properties in zwave_js (home-assistant#60913)

    Co-authored-by: epenet <epenet@users.noreply.github.com>

commit 358922d
Author: epenet <6771947+epenet@users.noreply.github.com>
Date:   Fri Dec 3 14:05:56 2021 +0100

    Use dataclass for HassioServiceInfo (home-assistant#60824)

    Co-authored-by: epenet <epenet@users.noreply.github.com>

commit e8b4b70
Author: Franck Nijhof <git@frenck.dev>
Date:   Fri Dec 3 11:22:28 2021 +0100

    Mark config schema as removed in Verisure (home-assistant#60896)

commit d784c8d
Author: Joakim S酶rensen <joasoe@gmail.com>
Date:   Fri Dec 3 10:35:57 2021 +0100

    Remove Supervisor panel title and icon (home-assistant#60894)

commit 85293d8
Author: Tuen Lee <leeyuentuen@gmail.com>
Date:   Fri Dec 3 10:23:15 2021 +0100

    Update tuya cover, fix Up/down position (home-assistant#59858)

commit 67f9118
Author: Maciej Bieniek <bieniu@users.noreply.github.com>
Date:   Fri Dec 3 09:58:27 2021 +0100

    Use native datetime value in Brother uptime sensor (home-assistant#60363)

commit 707fe67
Author: Marvin Wichmann <marvin@fam-wichmann.de>
Date:   Fri Dec 3 09:31:17 2021 +0100

    Move StrEnum to homeassistant.backports and move Platform to homeassistant.const (home-assistant#60880)

    Co-authored-by: Franck Nijhof <frenck@frenck.nl>
    Co-authored-by: Paulus Schoutsen <paulus@home-assistant.io>

commit 3188a36
Author: Jan Bouwhuis <jbouwh@users.noreply.github.com>
Date:   Fri Dec 3 08:58:15 2021 +0100

    Add template filters pack and unpack (home-assistant#60836)

    * add pack and unpack template filters

    * Add unpack test with offset

    * use unpack_from

    * Simplify unpack_from statement

commit c04bfcc
Author: epenet <6771947+epenet@users.noreply.github.com>
Date:   Fri Dec 3 08:51:42 2021 +0100

    Use dataclass properties in devolo_home_network tests (home-assistant#60889)

    Co-authored-by: epenet <epenet@users.noreply.github.com>

commit b70d243
Author: epenet <6771947+epenet@users.noreply.github.com>
Date:   Fri Dec 3 08:51:13 2021 +0100

    Use dataclass properties in homekit_controller tests (home-assistant#60891)

    Co-authored-by: epenet <epenet@users.noreply.github.com>

commit 2da9a51
Author: epenet <6771947+epenet@users.noreply.github.com>
Date:   Fri Dec 3 08:50:52 2021 +0100

    Use dataclass properties in keenetic_ndms2 tests (home-assistant#60892)

    Co-authored-by: epenet <epenet@users.noreply.github.com>

commit 9f4a99f
Author: Erik Montnemery <erik@montnemery.com>
Date:   Fri Dec 3 08:50:29 2021 +0100

    Revert "Add bytes support for bitwise template operations" (home-assistant#60854)

commit a64ff2a
Author: epenet <6771947+epenet@users.noreply.github.com>
Date:   Fri Dec 3 08:49:35 2021 +0100

    Use dataclass properties in system_bridge tests (home-assistant#60888)

    Co-authored-by: epenet <epenet@users.noreply.github.com>

commit c33e3e4
Author: ollo69 <60491700+ollo69@users.noreply.github.com>
Date:   Fri Dec 3 08:37:51 2021 +0100

    Use entity category enums in AsusWrt (home-assistant#60882)

commit 8eb0563
Author: ollo69 <60491700+ollo69@users.noreply.github.com>
Date:   Fri Dec 3 08:37:19 2021 +0100

    Use entity category enums in Nut (home-assistant#60883)

commit 4207d5a
Author: epenet <6771947+epenet@users.noreply.github.com>
Date:   Fri Dec 3 08:32:42 2021 +0100

    Use dataclass properties in upnp (home-assistant#60893)

    Co-authored-by: epenet <epenet@users.noreply.github.com>

commit e1b4e40
Author: Kevin Worrel <37058192+dieselrabbit@users.noreply.github.com>
Date:   Thu Dec 2 22:43:15 2021 -0800

    Limit parallel updates for screenlogic number ents (home-assistant#60886)

commit 9d1985a
Author: Kevin Worrel <37058192+dieselrabbit@users.noreply.github.com>
Date:   Thu Dec 2 18:36:31 2021 -0800

    Move screenlogic SCG levels to number platform (home-assistant#60872)

    Co-authored-by: J. Nick Koston <nick@koston.org>

commit 4758a4f
Author: puddly <32534428+puddly@users.noreply.github.com>
Date:   Thu Dec 2 20:27:35 2021 -0500

    Bump ZHA dependency zigpy-znp from 0.6.1 to 0.6.3 (home-assistant#60871)

commit 42fff98
Author: GitHub Action <github-action@users.noreply.github.com>
Date:   Fri Dec 3 00:13:00 2021 +0000

    [ci skip] Translation update
@github-actions github-actions bot locked and limited conversation to collaborators Dec 4, 2021
@allenporter allenporter deleted the nest-media-source branch December 4, 2021 23:47

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})
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is it important to return an OrderedDict and not just a dict, which is ordered by default?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I did not know dict is ordered by default. I just need the events to be iterable in order, not that an OrderedDict itself is used. Thanks, I'll send a follow up.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah! This is "new"in python 3.7 (or .6) thanks.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

馃憤

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
Dev
  
Done
Development

Successfully merging this pull request may close these issues.

None yet

4 participants