* Change the API boundary between stream and camera
Shift more of the stream lifecycle management to the camera. The motivation is to support stream urls that expire
giving the camera the ability to change the stream once it is created.
* Document stream lifecycle and simplify stream/camera interaction
* Reorder create_stream function to reduce diffs
* Increase test coverage for camera_sdm.py
* Fix ffmpeg typo.
* Add a stream identifier for each stream, managed by camera
* Remove stream record service
* Update homeassistant/components/stream/__init__.py
Co-authored-by: Paulus Schoutsen <paulus@home-assistant.io>
* Unroll changes to Stream interface back into camera component
* Fix preload stream to actually start the background worker
* Reduce unncessary diffs for readability
* Remove redundant camera stream start code
Co-authored-by: Paulus Schoutsen <paulus@home-assistant.io>
* Clear cached nest event images after expiration
* Don't share removal cleanup with alarm cleanup
Don't share code across these functions since it would require a dummy timestamp values that is unnecessary.
* Increase test coverage on sdm camera remove
* Update homeassistant/components/nest/camera_sdm.py
Co-authored-by: Paulus Schoutsen <paulus@home-assistant.io>
Co-authored-by: Paulus Schoutsen <paulus@home-assistant.io>
* Capture nest still images from events
Use python google-nest-sdm API for fetching images. Update home assistant
to use the google-nest-sdm API for fetching the image contents generated
by the server. This uses the existing websession object for server fetches,
reducing the amount of new code and facilites unit testing using the existing
mechanism.
Simplify tests using the image fetch API rather than a snapshot API
* Simplify nest event handling
Use device specific update callbacks rather than a global callback.
The motivation is to prepare for a follow up change that will store
camera specific event tokens on the camera itself, so that a service
can later fetch event specific image snapshots, which would be difficult
to send across the event bus.
* Increase nest camera test coverage
* Remove unnecessary device updates for nest cameras
* Remove unused imports
* Fix device id check to look at returned entry
* Remove unused imports after rebase
* Partial revert of nest event simplification
* Push more update logic into the nest library
* Revert nest device_info changes
* Revert test changes to restore global update behavior
* Bump nest library version to support new callback interfaces