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

Classes

class  _CameraRtspToWebRTCProvider
 
class  CameraWebRTCLegacyProvider
 
class  CameraWebRTCProvider
 
class  WebRTCAnswer
 
class  WebRTCCandidate
 
class  WebRTCClientConfiguration
 
class  WebRTCError
 
class  WebRTCMessage
 
class  WebRTCSession
 

Functions

None _async_check_conflicting_legacy_provider (HomeAssistant hass)
 
None _async_refresh_providers (HomeAssistant hass)
 
RTCIceCandidateInit _parse_webrtc_candidate_init (Any value)
 
CameraWebRTCLegacyProvider|None async_get_supported_legacy_provider (HomeAssistant hass, Camera camera)
 
CameraWebRTCProvider|None async_get_supported_provider (HomeAssistant hass, Camera camera)
 
Callable[[], None] async_register_ice_servers (HomeAssistant hass, Callable[[], Iterable[RTCIceServer]] get_ice_server_fn)
 
Callable[[], None] async_register_rtsp_to_web_rtc_provider (HomeAssistant hass, str domain, RtspToWebRtcProviderType provider)
 
Callable[[], None] async_register_webrtc_provider (HomeAssistant hass, CameraWebRTCProvider provider)
 
None async_register_ws (HomeAssistant hass)
 
Callable[[WsCommandWithCamera], websocket_api.AsyncWebSocketCommandHandler] require_webrtc_support (str error_code)
 
None ws_candidate (websocket_api.ActiveConnection connection, dict[str, Any] msg, Camera camera)
 
None ws_get_client_config (websocket_api.ActiveConnection connection, dict[str, Any] msg, Camera camera)
 
None ws_webrtc_offer (websocket_api.ActiveConnection connection, dict[str, Any] msg, Camera camera)
 

Variables

 _LOGGER = logging.getLogger(__name__)
 
dictionary _RTSP_PREFIXES = {"rtsp://", "rtsps://", "rtmp://"}
 
string _WEBRTC = "WebRTC"
 
 RtspToWebRtcProviderType
 
 WebRTCSendMessage
 
 WsCommandWithCamera
 

Detailed Description

Helper for WebRTC support.

Function Documentation

◆ _async_check_conflicting_legacy_provider()

None homeassistant.components.camera.webrtc._async_check_conflicting_legacy_provider ( HomeAssistant  hass)
private
Check if a legacy provider is registered together with the builtin provider.

Definition at line 481 of file webrtc.py.

◆ _async_refresh_providers()

None homeassistant.components.camera.webrtc._async_refresh_providers ( HomeAssistant  hass)
private
Check all cameras for any state changes for registered providers.

Definition at line 205 of file webrtc.py.

◆ _parse_webrtc_candidate_init()

RTCIceCandidateInit homeassistant.components.camera.webrtc._parse_webrtc_candidate_init ( Any  value)
private
Validate and parse a WebRTCCandidateInit dict.

Definition at line 333 of file webrtc.py.

◆ async_get_supported_legacy_provider()

CameraWebRTCLegacyProvider | None homeassistant.components.camera.webrtc.async_get_supported_legacy_provider ( HomeAssistant  hass,
Camera   camera 
)
Return the first supported provider for the camera.

Definition at line 383 of file webrtc.py.

◆ async_get_supported_provider()

CameraWebRTCProvider | None homeassistant.components.camera.webrtc.async_get_supported_provider ( HomeAssistant  hass,
Camera   camera 
)
Return the first supported provider for the camera.

Definition at line 368 of file webrtc.py.

◆ async_register_ice_servers()

Callable[[], None] homeassistant.components.camera.webrtc.async_register_ice_servers ( HomeAssistant  hass,
Callable[[], Iterable[RTCIceServer]]  get_ice_server_fn 
)
Register a ICE server.

The registering integration is responsible to implement caching if needed.

Definition at line 399 of file webrtc.py.

◆ async_register_rtsp_to_web_rtc_provider()

Callable[[], None] homeassistant.components.camera.webrtc.async_register_rtsp_to_web_rtc_provider ( HomeAssistant  hass,
str  domain,
RtspToWebRtcProviderType  provider 
)
Register an RTSP to WebRTC provider.

The first provider to satisfy the offer will be used.

Definition at line 450 of file webrtc.py.

◆ async_register_webrtc_provider()

Callable[[], None] homeassistant.components.camera.webrtc.async_register_webrtc_provider ( HomeAssistant  hass,
CameraWebRTCProvider  provider 
)
Register a WebRTC provider.

The first provider to satisfy the offer will be used.

Definition at line 179 of file webrtc.py.

◆ async_register_ws()

None homeassistant.components.camera.webrtc.async_register_ws ( HomeAssistant  hass)
Register camera webrtc ws endpoints.

Definition at line 360 of file webrtc.py.

◆ require_webrtc_support()

Callable[[WsCommandWithCamera], websocket_api.AsyncWebSocketCommandHandler] homeassistant.components.camera.webrtc.require_webrtc_support ( str  error_code)
Validate that the camera supports WebRTC.

Definition at line 221 of file webrtc.py.

◆ ws_candidate()

None homeassistant.components.camera.webrtc.ws_candidate ( websocket_api.ActiveConnection  connection,
dict[str, Any]  msg,
Camera   camera 
)
Handle WebRTC candidate websocket command.

Definition at line 351 of file webrtc.py.

◆ ws_get_client_config()

None homeassistant.components.camera.webrtc.ws_get_client_config ( websocket_api.ActiveConnection  connection,
dict[str, Any]  msg,
Camera   camera 
)
Handle get WebRTC client config websocket command.

Definition at line 322 of file webrtc.py.

◆ ws_webrtc_offer()

None homeassistant.components.camera.webrtc.ws_webrtc_offer ( websocket_api.ActiveConnection  connection,
dict[str, Any]  msg,
Camera   camera 
)
Handle the signal path for a WebRTC stream.

This signal path is used to route the offer created by the client to the
camera device through the integration for negotiation on initial setup.
The ws endpoint returns a subscription id, where ice candidates and the
final answer will be returned.
The actual streaming is handled entirely between the client and camera device.

Async friendly.

Definition at line 269 of file webrtc.py.

Variable Documentation

◆ _LOGGER

homeassistant.components.camera.webrtc._LOGGER = logging.getLogger(__name__)
private

Definition at line 36 of file webrtc.py.

◆ _RTSP_PREFIXES

dictionary homeassistant.components.camera.webrtc._RTSP_PREFIXES = {"rtsp://", "rtsps://", "rtmp://"}
private

Definition at line 419 of file webrtc.py.

◆ _WEBRTC

string homeassistant.components.camera.webrtc._WEBRTC = "WebRTC"
private

Definition at line 50 of file webrtc.py.

◆ RtspToWebRtcProviderType

homeassistant.components.camera.webrtc.RtspToWebRtcProviderType

Definition at line 427 of file webrtc.py.

◆ WebRTCSendMessage

homeassistant.components.camera.webrtc.WebRTCSendMessage

Definition at line 106 of file webrtc.py.

◆ WsCommandWithCamera

homeassistant.components.camera.webrtc.WsCommandWithCamera

Definition at line 215 of file webrtc.py.