|
| None | __init__ (self, HomeAssistant hass, str source, dict[str, str] pyav_options, StreamSettings stream_settings, DynamicStreamSettings dynamic_stream_settings, str|None stream_label=None) |
| |
| StreamOutput | add_provider (self, str fmt, int timeout=OUTPUT_IDLE_TIMEOUT) |
| |
| bytes|None | async_get_image (self, int|None width=None, int|None height=None, bool wait_for_next_keyframe=False) |
| |
| None | async_record (self, str video_path, int duration=30, int lookback=5) |
| |
| bool | available (self) |
| |
| None | check_idle (self) |
| |
| str | endpoint_url (self, str fmt) |
| |
| dict[str, Any] | get_diagnostics (self) |
| |
| Mapping[str, StreamOutput] | outputs (self) |
| |
| None | remove_provider (self, StreamOutput provider) |
| |
| None | set_update_callback (self, Callable[[], None] update_callback) |
| |
| None | start (self) |
| |
| None | stop (self) |
| |
| None | update_source (self, str new_source) |
| |
Represents a single stream.
Definition at line 274 of file __init__.py.
◆ __init__()
◆ _async_update_state()
| None homeassistant.components.stream.Stream._async_update_state |
( |
|
self, |
|
|
bool |
available |
|
) |
| |
|
private |
Set state and Run callback to notify state has been updated.
Definition at line 374 of file __init__.py.
◆ _run_worker()
| None homeassistant.components.stream.Stream._run_worker |
( |
|
self | ) |
|
|
private |
Handle consuming streams and restart keepalive streams.
Definition at line 419 of file __init__.py.
◆ _set_state()
| None homeassistant.components.stream.Stream._set_state |
( |
|
self, |
|
|
bool |
available |
|
) |
| |
|
private |
Set the stream state by updating the callback.
Definition at line 412 of file __init__.py.
◆ _stop()
| None homeassistant.components.stream.Stream._stop |
( |
|
self | ) |
|
|
private |
Stop worker thread.
Uses an asyncio.Lock to avoid conflicts with start().
Definition at line 497 of file __init__.py.
◆ add_provider()
| StreamOutput homeassistant.components.stream.Stream.add_provider |
( |
|
self, |
|
|
str |
fmt, |
|
|
int |
timeout = OUTPUT_IDLE_TIMEOUT |
|
) |
| |
Add provider output stream.
Definition at line 326 of file __init__.py.
◆ async_get_image()
| bytes | None homeassistant.components.stream.Stream.async_get_image |
( |
|
self, |
|
|
int | None |
width = None, |
|
|
int | None |
height = None, |
|
|
bool |
wait_for_next_keyframe = False |
|
) |
| |
Fetch an image from the Stream and return it as a jpeg in bytes.
Calls async_get_image from KeyFrameConverter. async_get_image should only be
called directly from the main loop and not from an executor thread as it uses
hass.add_executor_job underneath the hood.
Definition at line 550 of file __init__.py.
◆ async_record()
| None homeassistant.components.stream.Stream.async_record |
( |
|
self, |
|
|
str |
video_path, |
|
|
int |
duration = 30, |
|
|
int |
lookback = 5 |
|
) |
| |
Make a .mp4 recording from a provided stream.
Definition at line 512 of file __init__.py.
◆ available()
| bool homeassistant.components.stream.Stream.available |
( |
|
self | ) |
|
Return False if the stream is started and known to be unavailable.
Definition at line 365 of file __init__.py.
◆ check_idle()
| None homeassistant.components.stream.Stream.check_idle |
( |
|
self | ) |
|
Reset access token if all providers are idle.
Definition at line 359 of file __init__.py.
◆ endpoint_url()
| str homeassistant.components.stream.Stream.endpoint_url |
( |
|
self, |
|
|
str |
fmt |
|
) |
| |
Start the stream and returns a url for the output format.
Definition at line 311 of file __init__.py.
◆ get_diagnostics()
| dict[str, Any] homeassistant.components.stream.Stream.get_diagnostics |
( |
|
self | ) |
|
Return diagnostics information for the stream.
Definition at line 571 of file __init__.py.
◆ outputs()
| Mapping[str, StreamOutput] homeassistant.components.stream.Stream.outputs |
( |
|
self | ) |
|
Return a copy of the stream outputs.
Definition at line 320 of file __init__.py.
◆ remove_provider()
| None homeassistant.components.stream.Stream.remove_provider |
( |
|
self, |
|
|
StreamOutput |
provider |
|
) |
| |
Remove provider output stream.
Definition at line 350 of file __init__.py.
◆ set_update_callback()
| None homeassistant.components.stream.Stream.set_update_callback |
( |
|
self, |
|
|
Callable[[], None] |
update_callback |
|
) |
| |
Set callback to run when state changes.
Definition at line 369 of file __init__.py.
◆ start()
| None homeassistant.components.stream.Stream.start |
( |
|
self | ) |
|
Start a stream.
Uses an asyncio.Lock to avoid conflicts with _stop().
Definition at line 380 of file __init__.py.
◆ stop()
| None homeassistant.components.stream.Stream.stop |
( |
|
self | ) |
|
Remove outputs and access token.
Definition at line 489 of file __init__.py.
◆ update_source()
| None homeassistant.components.stream.Stream.update_source |
( |
|
self, |
|
|
str |
new_source |
|
) |
| |
Restart the stream with a new stream source.
Definition at line 402 of file __init__.py.
◆ _available
| homeassistant.components.stream.Stream._available |
|
private |
◆ _diagnostics
| homeassistant.components.stream.Stream._diagnostics |
|
private |
◆ _fast_restart_once
| homeassistant.components.stream.Stream._fast_restart_once |
|
private |
◆ _keyframe_converter
| homeassistant.components.stream.Stream._keyframe_converter |
|
private |
◆ _logger
| homeassistant.components.stream.Stream._logger |
|
private |
◆ _outputs
| homeassistant.components.stream.Stream._outputs |
|
private |
◆ _start_stop_lock
| homeassistant.components.stream.Stream._start_stop_lock |
|
private |
◆ _stream_label
| homeassistant.components.stream.Stream._stream_label |
|
private |
◆ _stream_settings
| homeassistant.components.stream.Stream._stream_settings |
|
private |
◆ _thread
| homeassistant.components.stream.Stream._thread |
|
private |
◆ _thread_quit
| homeassistant.components.stream.Stream._thread_quit |
|
private |
◆ _update_callback
| homeassistant.components.stream.Stream._update_callback |
|
private |
◆ access_token
| homeassistant.components.stream.Stream.access_token |
◆ dynamic_stream_settings
| homeassistant.components.stream.Stream.dynamic_stream_settings |
◆ hass
| homeassistant.components.stream.Stream.hass |
◆ pyav_options
| homeassistant.components.stream.Stream.pyav_options |
◆ source
| homeassistant.components.stream.Stream.source |
The documentation for this class was generated from the following file: