Commit Graph

13 Commits (b0d56970a54907a367490d4dfd2506febef68baf)

Author SHA1 Message Date
Allen Porter 26f455223b
Update nest stream URLs expiration (#46311) 2021-02-09 23:53:34 -08:00
Allen Porter 2bcf87b980
Change the API boundary between camera and stream with initial improvement for nest expiring stream urls (#45431)
* 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>
2021-02-08 19:53:28 -08:00
Allen Porter eebd0d333e
Clear cached nest event images after expiration (#44956)
* 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>
2021-01-12 22:08:59 -08:00
Allen Porter 560e3811a3
Generate nest images thumbnails from events (#44638)
* 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
2021-01-06 07:02:04 -08:00
Allen Porter 51b88337ca
Simplify nest event handling (#44367)
* 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
2020-12-27 09:49:22 +01:00
Allen Porter 6d12e764b7
Increase test coverage for nest camera (#44144) 2020-12-12 10:17:43 +01:00
Allen Porter 945a0a9f7e
Add nest device triggers for camera and doorbell events (#43548) 2020-11-30 09:19:42 +01:00
Allen Porter 2d14f07396
Improve nest SDM integration error handling (#43271) 2020-11-19 12:26:49 +01:00
Allen Porter 3e46c42307
Catch the right nest stream refresh exception error (#43189) 2020-11-13 22:37:09 -08:00
Allen Porter 94db07ca8c
Update nest sdm camera to refresh in background (#42865)
Co-authored-by: Paulus Schoutsen <paulus@home-assistant.io>
2020-11-10 23:48:02 +01:00
springstan a7bd521768
Remove temporary variable from supported_features (#42685)
* Remove temporary variable from supported_features

* Revert removing temp variable for supported features hunterdouglas
2020-11-09 13:19:29 +01:00
Allen Porter 89a5c9fcac
Add image support to nest SDM api (#42556) 2020-11-03 09:31:43 +01:00
Allen Porter 8caa177ba1
Add Nest cam support for the SDM API (#42325)
Co-authored-by: Paulus Schoutsen <paulus@home-assistant.io>
2020-10-27 15:20:01 +01:00