Home Assistant Unofficial Reference 2024.12.1
homeassistant.components.camera Namespace Reference

Namespaces

 const
 
 diagnostics
 
 helper
 
 img_util
 
 media_source
 
 prefs
 
 significant_change
 
 webrtc
 

Classes

class  _TemplateCameraEntity
 
class  Camera
 
class  CameraCapabilities
 
class  CameraEntityDescription
 
class  CameraEntityFeature
 
class  CameraImageView
 
class  CameraMjpegStream
 
class  CameraView
 
class  Image
 

Functions

Image _async_get_image (Camera camera, int timeout=10, int|None width=None, int|None height=None)
 
bytes|None _async_get_stream_image (Camera camera, int|None width=None, int|None height=None, bool wait_for_next_keyframe=False)
 
str _async_stream_endpoint_url (HomeAssistant hass, Camera camera, str fmt)
 
Image async_get_image (HomeAssistant hass, str entity_id, int timeout=10, int|None width=None, int|None height=None)
 
web.StreamResponse|None async_get_mjpeg_stream (HomeAssistant hass, web.Request request, str entity_id)
 
web.StreamResponse async_get_still_stream (web.Request request, Callable[[], Awaitable[bytes|None]] image_cb, str content_type, float interval)
 
str|None async_get_stream_source (HomeAssistant hass, str entity_id)
 
None async_handle_play_stream_service (Camera camera, ServiceCall service_call)
 
None async_handle_record_service (Camera camera, ServiceCall service_call)
 
None async_handle_snapshot_service (Camera camera, ServiceCall service_call)
 
str async_request_stream (HomeAssistant hass, str entity_id, str fmt)
 
bool async_setup (HomeAssistant hass, ConfigType config)
 
bool async_setup_entry (HomeAssistant hass, ConfigEntry entry)
 
bool async_unload_entry (HomeAssistant hass, ConfigEntry entry)
 
None websocket_get_prefs (HomeAssistant hass, ActiveConnection connection, dict[str, Any] msg)
 
None websocket_update_prefs (HomeAssistant hass, ActiveConnection connection, dict[str, Any] msg)
 
None ws_camera_capabilities (HomeAssistant hass, ActiveConnection connection, dict[str, Any] msg)
 
None ws_camera_stream (HomeAssistant hass, ActiveConnection connection, dict[str, Any] msg)
 

Variables

 __all__
 
 __dir__
 
 __getattr__
 
 _DEPRECATED_STATE_IDLE
 
 _DEPRECATED_STATE_RECORDING
 
 _DEPRECATED_STATE_STREAMING
 
 _LOGGER
 
 CACHED_PROPERTIES_WITH_ATTR_
 
 check_if_deprecated_constant
 
 dir_with_deprecated_constants
 
 Final
 
 module_globals
 
 module_globals_keys
 
 PLATFORM_SCHEMA
 
 PLATFORM_SCHEMA_BASE
 
 seconds
 

Detailed Description

Component to interface with cameras.

Function Documentation

◆ _async_get_image()

Image homeassistant.components.camera._async_get_image ( Camera  camera,
int   timeout = 10,
int | None   width = None,
int | None   height = None 
)
private
Fetch a snapshot image from a camera.

If width and height are passed, an attempt to scale
the image will be made on a best effort basis.
Not all cameras can scale images or return jpegs
that we can scale, however the majority of cases
are handled.

Definition at line 196 of file __init__.py.

◆ _async_get_stream_image()

bytes | None homeassistant.components.camera._async_get_stream_image ( Camera  camera,
int | None   width = None,
int | None   height = None,
bool   wait_for_next_keyframe = False 
)
private

Definition at line 254 of file __init__.py.

◆ _async_stream_endpoint_url()

str homeassistant.components.camera._async_stream_endpoint_url ( HomeAssistant  hass,
Camera  camera,
str   fmt 
)
private

Definition at line 1234 of file __init__.py.

◆ async_get_image()

Image homeassistant.components.camera.async_get_image ( HomeAssistant  hass,
str  entity_id,
int   timeout = 10,
int | None   width = None,
int | None   height = None 
)
Fetch an image from a camera entity.

width and height will be passed to the underlying camera.

Definition at line 239 of file __init__.py.

◆ async_get_mjpeg_stream()

web.StreamResponse | None homeassistant.components.camera.async_get_mjpeg_stream ( HomeAssistant  hass,
web.Request  request,
str   entity_id 
)
Fetch an mjpeg stream from a camera entity.

Definition at line 277 of file __init__.py.

◆ async_get_still_stream()

web.StreamResponse homeassistant.components.camera.async_get_still_stream ( web.Request  request,
Callable[[], Awaitable[bytes | None]]  image_cb,
str  content_type,
float  interval 
)
Generate an HTTP MJPEG stream from camera images.

This method must be run in the event loop.

Definition at line 291 of file __init__.py.

◆ async_get_stream_source()

str | None homeassistant.components.camera.async_get_stream_source ( HomeAssistant  hass,
str  entity_id 
)
Fetch the stream source for a camera entity.

Definition at line 270 of file __init__.py.

◆ async_handle_play_stream_service()

None homeassistant.components.camera.async_handle_play_stream_service ( Camera  camera,
ServiceCall   service_call 
)
Handle play stream services calls.

Definition at line 1212 of file __init__.py.

◆ async_handle_record_service()

None homeassistant.components.camera.async_handle_record_service ( Camera  camera,
ServiceCall   service_call 
)
Handle stream recording service calls.

Definition at line 1248 of file __init__.py.

◆ async_handle_snapshot_service()

None homeassistant.components.camera.async_handle_snapshot_service ( Camera  camera,
ServiceCall   service_call 
)
Handle snapshot services calls.

Definition at line 1173 of file __init__.py.

◆ async_request_stream()

str homeassistant.components.camera.async_request_stream ( HomeAssistant  hass,
str  entity_id,
str  fmt 
)
Request a stream for a camera entity.

Definition at line 190 of file __init__.py.

◆ async_setup()

bool homeassistant.components.camera.async_setup ( HomeAssistant  hass,
ConfigType  config 
)
Set up the camera component.

Definition at line 348 of file __init__.py.

◆ async_setup_entry()

bool homeassistant.components.camera.async_setup_entry ( HomeAssistant  hass,
ConfigEntry  entry 
)
Set up a config entry.

Definition at line 438 of file __init__.py.

◆ async_unload_entry()

bool homeassistant.components.camera.async_unload_entry ( HomeAssistant  hass,
ConfigEntry  entry 
)
Unload a config entry.

Definition at line 443 of file __init__.py.

◆ websocket_get_prefs()

None homeassistant.components.camera.websocket_get_prefs ( HomeAssistant  hass,
ActiveConnection  connection,
dict[str, Any]   msg 
)
Handle request for account info.

Definition at line 1095 of file __init__.py.

◆ websocket_update_prefs()

None homeassistant.components.camera.websocket_update_prefs ( HomeAssistant  hass,
ActiveConnection  connection,
dict[str, Any]   msg 
)
Handle request for account info.

Definition at line 1114 of file __init__.py.

◆ ws_camera_capabilities()

None homeassistant.components.camera.ws_camera_capabilities ( HomeAssistant  hass,
ActiveConnection  connection,
dict[str, Any]   msg 
)
Handle get camera capabilities websocket command.

Async friendly.

Definition at line 1050 of file __init__.py.

◆ ws_camera_stream()

None homeassistant.components.camera.ws_camera_stream ( HomeAssistant  hass,
ActiveConnection  connection,
dict[str, Any]   msg 
)
Handle get camera stream websocket command.

Async friendly.

Definition at line 1069 of file __init__.py.

Variable Documentation

◆ __all__

homeassistant.components.camera.__all__
private

Definition at line 1274 of file __init__.py.

◆ __dir__

homeassistant.components.camera.__dir__
private

Definition at line 1271 of file __init__.py.

◆ __getattr__

homeassistant.components.camera.__getattr__
private

Definition at line 1270 of file __init__.py.

◆ _DEPRECATED_STATE_IDLE

homeassistant.components.camera._DEPRECATED_STATE_IDLE
private

Definition at line 128 of file __init__.py.

◆ _DEPRECATED_STATE_RECORDING

homeassistant.components.camera._DEPRECATED_STATE_RECORDING
private

Definition at line 126 of file __init__.py.

◆ _DEPRECATED_STATE_STREAMING

homeassistant.components.camera._DEPRECATED_STATE_STREAMING
private

Definition at line 127 of file __init__.py.

◆ _LOGGER

homeassistant.components.camera._LOGGER
private

Definition at line 107 of file __init__.py.

◆ CACHED_PROPERTIES_WITH_ATTR_

homeassistant.components.camera.CACHED_PROPERTIES_WITH_ATTR_

Definition at line 448 of file __init__.py.

◆ check_if_deprecated_constant

homeassistant.components.camera.check_if_deprecated_constant

Definition at line 1270 of file __init__.py.

◆ dir_with_deprecated_constants

homeassistant.components.camera.dir_with_deprecated_constants

Definition at line 1272 of file __init__.py.

◆ Final

homeassistant.components.camera.Final

Definition at line 110 of file __init__.py.

◆ module_globals

homeassistant.components.camera.module_globals

Definition at line 1270 of file __init__.py.

◆ module_globals_keys

homeassistant.components.camera.module_globals_keys

Definition at line 1272 of file __init__.py.

◆ PLATFORM_SCHEMA

homeassistant.components.camera.PLATFORM_SCHEMA

Definition at line 111 of file __init__.py.

◆ PLATFORM_SCHEMA_BASE

homeassistant.components.camera.PLATFORM_SCHEMA_BASE

Definition at line 112 of file __init__.py.

◆ seconds

homeassistant.components.camera.seconds

Definition at line 113 of file __init__.py.