Home Assistant Unofficial Reference 2024.12.1
homeassistant.components.nest.media_source.NestEventMediaStore Class Reference
Inheritance diagram for homeassistant.components.nest.media_source.NestEventMediaStore:
[legend]
Collaboration diagram for homeassistant.components.nest.media_source.NestEventMediaStore:
[legend]

Public Member Functions

None __init__ (self, HomeAssistant hass, GoogleNestSubscriber subscriber, Store[dict[str, Any]] store, str media_path)
 
dict|None async_load (self)
 
bytes|None async_load_media (self, str media_key)
 
None async_remove_media (self, str media_key)
 
None async_save (self, dict data)
 
None async_save_media (self, str media_key, bytes content)
 
str get_clip_preview_media_key (self, str device_id, ImageEventBase event)
 
str get_clip_preview_thumbnail_media_key (self, str device_id, ImageEventBase event)
 
str get_image_media_key (self, str device_id, ImageEventBase event)
 
str get_media_filename (self, str media_key)
 
str get_media_key (self, str device_id, ImageEventBase event)
 

Private Member Functions

Mapping[str, str] _get_devices (self)
 
str _map_device_id (self, str device_id)
 

Private Attributes

 _data
 
 _devices
 
 _hass
 
 _media_path
 
 _store
 
 _subscriber
 

Detailed Description

Storage hook to locally persist nest media for events.

This interface is meant to provide two storage features:
- media storage of events (jpgs, mp4s)
- metadata about events (e.g. motion, person), filename of the media, etc.

The default implementation in nest is in memory, and this allows the data
to be backed by disk.

The nest event media manager internal to the subscriber manages the lifetime
of individual objects stored here (e.g. purging when going over storage
limits). This store manages the addition/deletion once instructed.

Definition at line 97 of file media_source.py.

Constructor & Destructor Documentation

◆ __init__()

None homeassistant.components.nest.media_source.NestEventMediaStore.__init__ (   self,
HomeAssistant  hass,
GoogleNestSubscriber  subscriber,
Store[dict[str, Any]]  store,
str  media_path 
)
Initialize NestEventMediaStore.

Definition at line 112 of file media_source.py.

Member Function Documentation

◆ _get_devices()

Mapping[str, str] homeassistant.components.nest.media_source.NestEventMediaStore._get_devices (   self)
private
Return a mapping of nest device id to home assistant device id.

Definition at line 240 of file media_source.py.

◆ _map_device_id()

str homeassistant.components.nest.media_source.NestEventMediaStore._map_device_id (   self,
str  device_id 
)
private

Definition at line 154 of file media_source.py.

◆ async_load()

dict | None homeassistant.components.nest.media_source.NestEventMediaStore.async_load (   self)
Load data.

Definition at line 127 of file media_source.py.

◆ async_load_media()

bytes | None homeassistant.components.nest.media_source.NestEventMediaStore.async_load_media (   self,
str  media_key 
)
Load media content.

Definition at line 188 of file media_source.py.

◆ async_remove_media()

None homeassistant.components.nest.media_source.NestEventMediaStore.async_remove_media (   self,
str  media_key 
)
Remove media content.

Definition at line 225 of file media_source.py.

◆ async_save()

None homeassistant.components.nest.media_source.NestEventMediaStore.async_save (   self,
dict  data 
)
Save data.

Definition at line 139 of file media_source.py.

◆ async_save_media()

None homeassistant.components.nest.media_source.NestEventMediaStore.async_save_media (   self,
str  media_key,
bytes  content 
)
Write media content.

Definition at line 205 of file media_source.py.

◆ get_clip_preview_media_key()

str homeassistant.components.nest.media_source.NestEventMediaStore.get_clip_preview_media_key (   self,
str  device_id,
ImageEventBase  event 
)
Return the filename for clip preview media for an event session.

Definition at line 168 of file media_source.py.

◆ get_clip_preview_thumbnail_media_key()

str homeassistant.components.nest.media_source.NestEventMediaStore.get_clip_preview_thumbnail_media_key (   self,
str  device_id,
ImageEventBase   event 
)
Return the filename for clip preview thumbnail media for an event session.

Definition at line 175 of file media_source.py.

◆ get_image_media_key()

str homeassistant.components.nest.media_source.NestEventMediaStore.get_image_media_key (   self,
str  device_id,
ImageEventBase  event 
)
Return the filename for image media for an event.

Definition at line 161 of file media_source.py.

◆ get_media_filename()

str homeassistant.components.nest.media_source.NestEventMediaStore.get_media_filename (   self,
str  media_key 
)
Return the filename in storage for a media key.

Definition at line 184 of file media_source.py.

◆ get_media_key()

str homeassistant.components.nest.media_source.NestEventMediaStore.get_media_key (   self,
str  device_id,
ImageEventBase  event 
)
Return the filename to use for a new event.

Definition at line 148 of file media_source.py.

Member Data Documentation

◆ _data

homeassistant.components.nest.media_source.NestEventMediaStore._data
private

Definition at line 133 of file media_source.py.

◆ _devices

homeassistant.components.nest.media_source.NestEventMediaStore._devices
private

Definition at line 130 of file media_source.py.

◆ _hass

homeassistant.components.nest.media_source.NestEventMediaStore._hass
private

Definition at line 120 of file media_source.py.

◆ _media_path

homeassistant.components.nest.media_source.NestEventMediaStore._media_path
private

Definition at line 123 of file media_source.py.

◆ _store

homeassistant.components.nest.media_source.NestEventMediaStore._store
private

Definition at line 122 of file media_source.py.

◆ _subscriber

homeassistant.components.nest.media_source.NestEventMediaStore._subscriber
private

Definition at line 121 of file media_source.py.


The documentation for this class was generated from the following file: