1 """Constants for Camera component."""
3 from __future__
import annotations
5 from enum
import StrEnum
6 from functools
import partial
7 from typing
import TYPE_CHECKING, Final
10 DeprecatedConstantEnum,
11 all_with_deprecated_constants,
12 check_if_deprecated_constant,
13 dir_with_deprecated_constants,
21 from .prefs
import CameraPreferences
23 DOMAIN: Final =
"camera"
24 DATA_COMPONENT: HassKey[EntityComponent[Camera]] =
HassKey(DOMAIN)
26 DATA_CAMERA_PREFS: HassKey[CameraPreferences] =
HassKey(
"camera_prefs")
28 PREF_PRELOAD_STREAM: Final =
"preload_stream"
29 PREF_ORIENTATION: Final =
"orientation"
31 SERVICE_RECORD: Final =
"record"
33 CONF_LOOKBACK: Final =
"lookback"
34 CONF_DURATION: Final =
"duration"
36 CAMERA_STREAM_SOURCE_TIMEOUT: Final = 10
37 CAMERA_IMAGE_TIMEOUT: Final = 10
41 """Camera entity states."""
43 RECORDING =
"recording"
44 STREAMING =
"streaming"
49 """Camera stream type.
51 A camera that supports CAMERA_SUPPORT_STREAM may have a single stream
52 type which is used to inform the frontend which player to use.
53 Streams with RTSP sources typically use the stream component which uses
54 HLS for display. WebRTC streams use the home assistant core for a signal
55 path to initiate a stream, but the stream itself is between the client and
70 __getattr__ = partial(check_if_deprecated_constant, module_globals=globals())
72 dir_with_deprecated_constants, module_globals_keys=[*globals().keys()]
list[str] all_with_deprecated_constants(dict[str, Any] module_globals)