Commit Graph

20 Commits (bf15df75dd46307b558b33c4b261b0e7771a71d3)

Author SHA1 Message Date
Allen Porter 7a5fa8eb58
Update more nest tests to use common fixtures (#73303)
Update nest tests to use fixtures
2022-06-10 07:14:43 +02:00
Erik Montnemery 47d0cc9b09
Update integrations to pass target player when resolving media (#72597) 2022-05-27 09:05:06 -07:00
Allen Porter bab9f4ba76
Fix nest error handling and bug in tests for media fetches (#70596) 2022-04-24 10:17:59 -10:00
Allen Porter 2678d8120a
Update nest media source to make device play most recent event (#67557) 2022-03-03 08:16:03 -08:00
Paulus Schoutsen 2a8dc38d2d
Move media_source to after_deps (#67195) 2022-02-24 14:54:46 -08:00
Allen Porter a5fb60fd3a
Update nest media player device thumbnails (#64738) 2022-01-22 23:46:00 -08:00
Allen Porter cdf7742c3e
Refactor nest test_init_sdm tests to use fixtures with varied config types (#64736) 2022-01-22 20:56:03 -08:00
Allen Porter 849abaca8b
Bump google-nest-sdm to 1.5.0 and add nest mp4 clip transcoding to animated gif (#64155) 2022-01-15 12:31:02 -08:00
Allen Porter 64c5f69c3d
Add thumbnails to nest media player (#62532) 2022-01-13 22:31:33 -08:00
Marc Mueller d057850971
Update typing - collections.abc (3) (#63947) 2022-01-12 08:04:17 +01:00
Allen Porter 789c0a24dd
Improve nest media player clip/image and event handling for multiple events in a short time range (#63149) 2022-01-11 20:54:49 -08:00
Allen Porter 4203e1b064
Delete nest event image fetching and use same APIs as media player (#62789) 2022-01-07 16:37:54 +01:00
Allen Porter 368e16f189
Simplify nest test patch using new keyword (#62336) 2021-12-19 11:45:04 -08:00
Allen Porter a63fa53275
Persist nest media events to disk backed storage (#61641)
* Persist nest media events to disk backed storage

Persist nest events in the media player to disk, targeting about ~500mb
per camera device as a cap. Events are stored in config/nest/event_media/.

Add a NestEventMediaStore is used for persistence. It has three main jobs:
- Read/write the key/value data that holds event data (event type, time, device, etc)
- Read/write media contents to disk
- Pick the filename for the media event based on device and event deatils

The nest event media manager library handles cache management and eviction, and by
default uses an in memory cache. Home Assistant nest integration now provides the
disk backed implementation, which is invoked by the nest library.

The store reads the event metadata key/value dict on startup, and then writes it
back with a short delay of 5 seconds to avoid unnecessary writes.

Future work planned includes:
- Possibly a small memory buffer for media objects themselves. This could make sense
  when adding thumbnails to the media player grid to avoid unnecessary fetches
- Transcoding mp4 clips to animated image previews

* Address style errors

* Cleanup from CI test/pylint/etc.

* Put media for each device into its own directory

* Update comments for media store

* Decrease # of events to lower disk requirements

Target more like 1k events, to reduce disk needs.

* Address PR feedback

* Update homeassistant/components/nest/media_source.py

Co-authored-by: Paulus Schoutsen <paulus@home-assistant.io>

* Ignore incorrect mypy in nest library

* Fix pylint errors

Co-authored-by: Paulus Schoutsen <paulus@home-assistant.io>
2021-12-18 23:53:40 -08:00
Allen Porter efbec55818
Suppress errors for legacy nest api when using media source (#61629) 2021-12-13 17:41:45 +01:00
Allen Porter c3e72bec0a
Update logic for nest media source `can_play` for events (#61537) 2021-12-12 14:10:20 -08:00
Allen Porter bbe4a67a98
Coalesce nest media source preview clips by session and bump google-nest-sdm (#61081) 2021-12-05 23:59:24 -08:00
Allen Porter 5bd1139867
Fix regression in nest event media player with multiple devices (#61064) 2021-12-05 13:02:37 -08:00
Allen Porter 08003c5287
Improve nest media source event timestamp display (#61027)
Drop subsecond text from the nest media source event timestamp display, using a common date/time
template string.
2021-12-05 00:39:18 -08:00
Allen Porter ba99dc3af9
Add Nest Battery Cam event clip support with a Nest MediaSource (#60073) 2021-12-03 10:53:05 -08:00