|
| str | _breadcrumb (self, ProtectData data, str base_title, Camera|None camera=None, SimpleEventType|None event_type=None, int|None count=None) |
| |
| BrowseMediaSource | _build_camera (self, ProtectData data, str camera_id, bool build_children=False) |
| |
| list[BrowseMediaSource] | _build_cameras (self, ProtectData data) |
| |
| BrowseMediaSource | _build_console (self, ProtectData data) |
| |
| BrowseMediaSource | _build_days (self, ProtectData data, str camera_id, SimpleEventType event_type, date start, bool is_all=True, bool build_children=False) |
| |
| BrowseMediaSource | _build_event (self, ProtectData data, dict[str, Any]|Event event, bool thumbnail_only=False) |
| |
| list[BrowseMediaSource] | _build_events (self, ProtectData data, datetime start, datetime end, str|None camera_id=None, set[EventType]|None event_types=None, bool reserve=False) |
| |
| BrowseMediaSource | _build_events_type (self, ProtectData data, str camera_id, SimpleEventType event_type, bool build_children=False) |
| |
| BrowseMediaSource | _build_month (self, ProtectData data, str camera_id, SimpleEventType event_type, date start, bool build_children=False) |
| |
| BrowseMediaSource | _build_recent (self, ProtectData data, str camera_id, SimpleEventType event_type, int days, bool build_children=False) |
| |
| BrowseMediaSource | _build_sources (self) |
| |
| str|None | _get_camera_thumbnail_url (self, Camera camera) |
| |
| tuple[date, bool, bool] | _parse_range (self, list[str] parts) |
| |
| BrowseMediaSource | _resolve_event (self, ProtectData data, str event_id, bool thumbnail_only=False) |
| |
Represents all UniFi Protect NVRs.
Definition at line 177 of file media_source.py.
◆ __init__()
Initialize the UniFi Protect media source.
Definition at line 183 of file media_source.py.
◆ _breadcrumb()
◆ _build_camera()
| BrowseMediaSource homeassistant.components.unifiprotect.media_source.ProtectMediaSource._build_camera |
( |
|
self, |
|
|
ProtectData |
data, |
|
|
str |
camera_id, |
|
|
bool |
build_children = False |
|
) |
| |
|
private |
Build media source for selectors for a UniFi Protect camera.
Definition at line 777 of file media_source.py.
◆ _build_cameras()
Build media source for a single UniFi Protect NVR.
Definition at line 840 of file media_source.py.
◆ _build_console()
Build media source for a single UniFi Protect NVR.
Definition at line 852 of file media_source.py.
◆ _build_days()
| BrowseMediaSource homeassistant.components.unifiprotect.media_source.ProtectMediaSource._build_days |
( |
|
self, |
|
|
ProtectData |
data, |
|
|
str |
camera_id, |
|
|
SimpleEventType |
event_type, |
|
|
date |
start, |
|
|
bool |
is_all = True, |
|
|
bool |
build_children = False |
|
) |
| |
|
private |
Build media source for events for a given day or whole month.
Definition at line 620 of file media_source.py.
◆ _build_event()
| BrowseMediaSource homeassistant.components.unifiprotect.media_source.ProtectMediaSource._build_event |
( |
|
self, |
|
|
ProtectData |
data, |
|
|
dict[str, Any] | Event |
event, |
|
|
bool |
thumbnail_only = False |
|
) |
| |
|
private |
Build media source for an individual event.
Definition at line 412 of file media_source.py.
◆ _build_events()
| list[BrowseMediaSource] homeassistant.components.unifiprotect.media_source.ProtectMediaSource._build_events |
( |
|
self, |
|
|
ProtectData |
data, |
|
|
datetime |
start, |
|
|
datetime |
end, |
|
|
str | None |
camera_id = None, |
|
|
set[EventType] | None |
event_types = None, |
|
|
bool |
reserve = False |
|
) |
| |
|
private |
Build media source for a given range of time and event type.
Definition at line 474 of file media_source.py.
◆ _build_events_type()
Build folder media source for a selectors for a given event type.
Definition at line 696 of file media_source.py.
◆ _build_month()
Build media source for selectors for a given month.
Definition at line 564 of file media_source.py.
◆ _build_recent()
Build media source for events in relative days.
Definition at line 510 of file media_source.py.
◆ _build_sources()
| BrowseMediaSource homeassistant.components.unifiprotect.media_source.ProtectMediaSource._build_sources |
( |
|
self | ) |
|
|
private |
Return all media source for all UniFi Protect NVRs.
Definition at line 867 of file media_source.py.
◆ _get_camera_thumbnail_url()
| str | None homeassistant.components.unifiprotect.media_source.ProtectMediaSource._get_camera_thumbnail_url |
( |
|
self, |
|
|
Camera |
camera |
|
) |
| |
|
private |
Get camera thumbnail URL using the first available camera entity.
Definition at line 741 of file media_source.py.
◆ _parse_range()
| tuple[date, bool, bool] homeassistant.components.unifiprotect.media_source.ProtectMediaSource._parse_range |
( |
|
self, |
|
|
list[str] |
parts |
|
) |
| |
|
private |
◆ _resolve_event()
| BrowseMediaSource homeassistant.components.unifiprotect.media_source.ProtectMediaSource._resolve_event |
( |
|
self, |
|
|
ProtectData |
data, |
|
|
str |
event_id, |
|
|
bool |
thumbnail_only = False |
|
) |
| |
|
private |
◆ async_browse_media()
Return a browsable UniFi Protect media source.
Identifier formatters for UniFi Protect media sources are all in IDs from
the UniFi Protect instance since events may not always map 1:1 to a Home
Assistant device or entity. It also drasically speeds up resolution.
The UniFi Protect Media source is timebased for the events recorded by the NVR.
So its structure is a bit different then many other media players. All browsable
media is a video clip. The media source could be greatly cleaned up if/when the
frontend has filtering supporting.
* ... Each NVR Console (hidden if there is only one)
* All Cameras
* ... Camera X
* All Events
* ... Event Type X
* Last 24 Hours -> Events
* Last 7 Days -> Events
* Last 30 Days -> Events
* ... This Month - X
* Whole Month -> Events
* ... Day X -> Events
Accepted identifier formats:
* {nvr_id}:event:{event_id}
Specific Event for NVR
* {nvr_id}:eventthumb:{event_id}
Specific Event Thumbnail for NVR
* {nvr_id}:browse
Root NVR browse source
* {nvr_id}:browse:all|{camera_id}
Root Camera(s) browse source
* {nvr_id}:browse:all|{camera_id}:all|{event_type}
Root Camera(s) Event Type(s) browse source
* {nvr_id}:browse:all|{camera_id}:all|{event_type}:recent:{day_count}
Listing of all events in last {day_count}, sorted in reverse chronological order
* {nvr_id}:browse:all|{camera_id}:all|{event_type}:range:{year}:{month}
List of folders for each day in month + all events for month
* {nvr_id}:browse:all|{camera_id}:all|{event_type}:range:{year}:{month}:all|{day}
Listing of all events for give {day} + {month} + {year} combination in chronological order
Reimplemented from homeassistant.components.media_source.models.MediaSource.
Definition at line 229 of file media_source.py.
◆ async_get_registry()
| er.EntityRegistry homeassistant.components.unifiprotect.media_source.ProtectMediaSource.async_get_registry |
( |
|
self | ) |
|
◆ async_resolve_media()
| PlayMedia homeassistant.components.unifiprotect.media_source.ProtectMediaSource.async_resolve_media |
( |
|
self, |
|
|
MediaSourceItem |
item |
|
) |
| |
◆ _registry
| homeassistant.components.unifiprotect.media_source.ProtectMediaSource._registry |
|
private |
◆ data_sources
| homeassistant.components.unifiprotect.media_source.ProtectMediaSource.data_sources |
◆ hass
| homeassistant.components.unifiprotect.media_source.ProtectMediaSource.hass |
◆ str
| homeassistant.components.unifiprotect.media_source.ProtectMediaSource.str |
|
static |
The documentation for this class was generated from the following file: