2019-03-26 12:31:29 +00:00
|
|
|
"""Constants for Camera component."""
|
2021-05-09 16:04:57 +00:00
|
|
|
from typing import Final
|
2019-03-26 12:31:29 +00:00
|
|
|
|
2022-04-11 23:27:27 +00:00
|
|
|
from homeassistant.backports.enum import StrEnum
|
|
|
|
|
2021-05-09 16:04:57 +00:00
|
|
|
DOMAIN: Final = "camera"
|
2019-03-26 12:31:29 +00:00
|
|
|
|
2021-05-09 16:04:57 +00:00
|
|
|
DATA_CAMERA_PREFS: Final = "camera_prefs"
|
2021-12-31 21:44:33 +00:00
|
|
|
DATA_RTSP_TO_WEB_RTC: Final = "rtsp_to_web_rtc"
|
2021-02-09 03:53:28 +00:00
|
|
|
|
2021-05-09 16:04:57 +00:00
|
|
|
PREF_PRELOAD_STREAM: Final = "preload_stream"
|
2021-02-09 03:53:28 +00:00
|
|
|
|
2021-05-09 16:04:57 +00:00
|
|
|
SERVICE_RECORD: Final = "record"
|
2021-02-09 05:21:14 +00:00
|
|
|
|
2021-05-09 16:04:57 +00:00
|
|
|
CONF_LOOKBACK: Final = "lookback"
|
|
|
|
CONF_DURATION: Final = "duration"
|
|
|
|
|
|
|
|
CAMERA_STREAM_SOURCE_TIMEOUT: Final = 10
|
|
|
|
CAMERA_IMAGE_TIMEOUT: Final = 10
|
2021-10-08 05:13:14 +00:00
|
|
|
|
2022-04-11 23:27:27 +00:00
|
|
|
|
|
|
|
class StreamType(StrEnum):
|
|
|
|
"""Camera stream type.
|
|
|
|
|
|
|
|
A camera that supports CAMERA_SUPPORT_STREAM may have a single stream
|
|
|
|
type which is used to inform the frontend which player to use.
|
|
|
|
Streams with RTSP sources typically use the stream component which uses
|
|
|
|
HLS for display. WebRTC streams use the home assistant core for a signal
|
|
|
|
path to initiate a stream, but the stream itself is between the client and
|
|
|
|
device.
|
|
|
|
"""
|
|
|
|
|
|
|
|
HLS = "hls"
|
|
|
|
WEB_RTC = "web_rtc"
|
|
|
|
|
|
|
|
|
|
|
|
# These constants are deprecated as of Home Assistant 2022.5
|
|
|
|
# Please use the StreamType enum instead.
|
2021-10-08 05:13:14 +00:00
|
|
|
STREAM_TYPE_HLS = "hls"
|
|
|
|
STREAM_TYPE_WEB_RTC = "web_rtc"
|