Represent a segment.
Definition at line 85 of file core.py.
◆ __post_init__()
| None homeassistant.components.stream.core.Segment.__post_init__ |
( |
|
self | ) |
|
Run after init.
Definition at line 106 of file core.py.
◆ _render_hls_template()
| str homeassistant.components.stream.core.Segment._render_hls_template |
( |
|
self, |
|
|
int |
last_stream_id, |
|
|
bool |
render_parts |
|
) |
| |
|
private |
Render the HLS playlist section for the Segment.
The Segment may still be in progress.
This method stores intermediate data in hls_playlist_parts,
hls_num_parts_rendered, and hls_playlist_complete to avoid redoing
work on subsequent calls.
Definition at line 145 of file core.py.
◆ async_add_part()
| None homeassistant.components.stream.core.Segment.async_add_part |
( |
|
self, |
|
|
Part |
part, |
|
|
float |
duration |
|
) |
| |
Add a part to the Segment.
Duration is non zero only for the last part.
Definition at line 127 of file core.py.
◆ complete()
| bool homeassistant.components.stream.core.Segment.complete |
( |
|
self | ) |
|
Return whether the Segment is complete.
Definition at line 112 of file core.py.
◆ data_size()
| int homeassistant.components.stream.core.Segment.data_size |
( |
|
self | ) |
|
Return the size of all part data without init in bytes.
Definition at line 122 of file core.py.
◆ data_size_with_init()
| int homeassistant.components.stream.core.Segment.data_size_with_init |
( |
|
self | ) |
|
Return the size of all part data + init in bytes.
Definition at line 117 of file core.py.
◆ get_data()
| bytes homeassistant.components.stream.core.Segment.get_data |
( |
|
self | ) |
|
Return reconstructed data for all parts as bytes, without init.
Definition at line 141 of file core.py.
◆ render_hls()
| str homeassistant.components.stream.core.Segment.render_hls |
( |
|
self, |
|
|
int |
last_stream_id, |
|
|
bool |
render_parts, |
|
|
bool
|
add_hint |
|
) |
| |
Render the HLS playlist section for the Segment including a hint if requested.
Definition at line 200 of file core.py.
◆ bool
| homeassistant.components.stream.core.Segment.bool |
|
static |
◆ default_factory
| homeassistant.components.stream.core.Segment.default_factory |
|
static |
◆ duration
| homeassistant.components.stream.core.Segment.duration |
◆ float
| homeassistant.components.stream.core.Segment.float |
|
static |
◆ hls_num_parts_rendered
| homeassistant.components.stream.core.Segment.hls_num_parts_rendered |
◆ hls_playlist_complete
| homeassistant.components.stream.core.Segment.hls_playlist_complete |
◆ hls_playlist_parts
| homeassistant.components.stream.core.Segment.hls_playlist_parts |
◆ hls_playlist_template
| homeassistant.components.stream.core.Segment.hls_playlist_template |
◆ int
| homeassistant.components.stream.core.Segment.int |
|
static |
The documentation for this class was generated from the following file:
- core/homeassistant/components/stream/core.py