* Mark camera unavailable when keepalive stream fails
Add a listener in stream that notifies camera when the stream state has changed, and
use that to inform the camera `available` property. Update the property to be set
only from the main loop where it is read to reduce thread safety races.
Issue #54659
* Fix pylint import related errors
* Address lint naming errors
* Apply suggestions from code review
Co-authored-by: Paulus Schoutsen <paulus@home-assistant.io>
Co-authored-by: Paulus Schoutsen <paulus@home-assistant.io>
* Return PchkConnectionManager instance from init_integration
* Removed ip and port from LCN host model identifer
* Fix syntax error
* Convert init_integration to a fixture
* Rename device model for host
* Instantiate MockPchkConnectionManager with arguments from tests
* Invert logic for testing devices
* 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>
* Add buttons to opt into/out of the next Ridwell pickup
* Buttons finished
* Coverage
* better name
* Move to switch
* Clean up
* Coverage
* Use correct exception