mirror of
https://github.com/home-assistant/developers.home-assistant.git
synced 2025-07-09 18:36:29 +00:00
Add EntityFeature enum to Camera (#1266)
This commit is contained in:
parent
695fa2b104
commit
280d357252
@ -11,25 +11,26 @@ A camera entity can display images, and optionally a video stream. Derive a plat
|
|||||||
Properties should always only return information from memory and not do I/O (like network requests). Implement `update()` or `async_update()` to fetch data.
|
Properties should always only return information from memory and not do I/O (like network requests). Implement `update()` or `async_update()` to fetch data.
|
||||||
:::
|
:::
|
||||||
|
|
||||||
| Name | Type | Default | Description
|
| Name | Type | Default | Description |
|
||||||
| ---- | ---- | ------- | -----------
|
| ------------------------ | ----- | ------- | ----------------------------------------------------------------------------------------------------------------------- |
|
||||||
| is_recording | bool | `None` | Indication of whether the camera is recording. Used to determine `state`.
|
| is_recording | bool | `None` | Indication of whether the camera is recording. Used to determine `state`. |
|
||||||
| is_streaming | bool | `None` | Indication of whether the camera is streaming. Used to determine `state`.
|
| is_streaming | bool | `None` | Indication of whether the camera is streaming. Used to determine `state`. |
|
||||||
| motion_detection_enabled | bool | False | Indication of whether the camera has motion detection enabled.
|
| motion_detection_enabled | bool | False | Indication of whether the camera has motion detection enabled. |
|
||||||
| is_on | bool | `None` | Indication camera is on.
|
| is_on | bool | `None` | Indication camera is on. |
|
||||||
| brand | str | `None` | The brand (manufacturer) of the camera.
|
| brand | str | `None` | The brand (manufacturer) of the camera. |
|
||||||
| model | str | `None` | The model of the camera.
|
| model | str | `None` | The model of the camera. |
|
||||||
| frame_interval | float | 0.5 | The interval between frames of the stream.
|
| frame_interval | float | 0.5 | The interval between frames of the stream. |
|
||||||
| frontend_stream_type | str | None | Used with `SUPPORT_STREAM` to tell the frontend which type of stream to use (`STREAM_TYPE_HLS` or `STREAM_TYPE_WEBRTC`)
|
| frontend_stream_type | str | None | Used with `SUPPORT_STREAM` to tell the frontend which type of stream to use (`STREAM_TYPE_HLS` or `STREAM_TYPE_WEBRTC`) |
|
||||||
|
|
||||||
### Supported features
|
## Supported Features
|
||||||
|
|
||||||
Supported features constants are combined using the bitwise or (`|`) operator.
|
Supported features are defined by using values in the `CameraEntityFeature` enum
|
||||||
|
and are combined using the bitwise or (`|`) operator.
|
||||||
|
|
||||||
| Name | Bit value | Description |
|
| Value | Description |
|
||||||
| ---------------------------------- | --- | ------------------------------------------------------------------------------------------- |
|
| -------- | -------------------------------------------- |
|
||||||
| `SUPPORT_ON_OFF` | 1 | The device supports `turn_on` and `turn_off` |
|
| `ON_OFF` | The device supports `turn_on` and `turn_off` |
|
||||||
| `SUPPORT_STREAM` | 2 | The device supports streaming |
|
| `STREAM` | The device supports streaming |
|
||||||
|
|
||||||
## Methods
|
## Methods
|
||||||
|
|
||||||
@ -95,7 +96,6 @@ class MyCamera(Camera):
|
|||||||
|
|
||||||
An integration may provide a WebRTC stream for any RTSP camera using `async_register_rtsp_to_web_rtc_provider`. The current best practice is for an integration to provide the actual stream manipulation with an Add-on or external service.
|
An integration may provide a WebRTC stream for any RTSP camera using `async_register_rtsp_to_web_rtc_provider`. The current best practice is for an integration to provide the actual stream manipulation with an Add-on or external service.
|
||||||
|
|
||||||
|
|
||||||
```python
|
```python
|
||||||
async def handle_offer(stream_source: str, offer_sdp: str) -> str:
|
async def handle_offer(stream_source: str, offer_sdp: str) -> str:
|
||||||
"""Handle the signal path for a WebRTC stream and return an answer."""
|
"""Handle the signal path for a WebRTC stream and return an answer."""
|
||||||
|
Loading…
x
Reference in New Issue
Block a user