mirror of
https://github.com/home-assistant/developers.home-assistant.git
synced 2025-07-13 04:16:29 +00:00
Change camera state to enum (#2330)
* Change camera state is enum * Not lock * Adjustments * Add blog * Apply suggestions from code review Co-authored-by: Martin Hjelmare <marhje52@gmail.com> * Apply suggestions from code review --------- Co-authored-by: Martin Hjelmare <marhje52@gmail.com>
This commit is contained in:
parent
0b47074ce4
commit
ec469357db
13
blog/2024-09-23-state-constants-camera-deprecation.md
Normal file
13
blog/2024-09-23-state-constants-camera-deprecation.md
Normal file
@ -0,0 +1,13 @@
|
||||
---
|
||||
author: G Johansson
|
||||
authorURL: https://github.com/gjohansson-ST
|
||||
authorImageURL: https://avatars.githubusercontent.com/u/62932417?v=4
|
||||
authorTwitter: GJohansson
|
||||
title: "Deprecating state constants for camera"
|
||||
---
|
||||
|
||||
As of Home Assistant Core 2024.10, the constants used to return state in `Camera` are deprecated and replaced by the `CameraState` enum.
|
||||
|
||||
There is a one-year deprecation period, and the constants will stop working from 2025.10 to ensure all custom integration authors have time to adjust.
|
||||
|
||||
As the `state` property is not meant to be overwritten, in most cases this change will only affect other Entity properties or tests.
|
@ -23,6 +23,17 @@ Properties should always only return information from memory and not do I/O (lik
|
||||
| motion_detection_enabled | `bool` | `False` | Indication of whether the camera has motion detection enabled. |
|
||||
| use_stream_for_stills | `bool` | `False` | Determines whether or not to use the `Stream` integration to generate still images |
|
||||
|
||||
### States
|
||||
|
||||
The state is defined by setting the properties above. The resulting state uses the `CameraState` enum to return one of the below members.
|
||||
|
||||
| Value | Description |
|
||||
|-------------|-----------------------------------------|
|
||||
| `RECORDING` | The camera is currently recording. |
|
||||
| `STREAMING` | The camera is currently streaming. |
|
||||
| `IDLE` | The camera is currently idle. |
|
||||
|
||||
|
||||
## Supported features
|
||||
|
||||
Supported features are defined by using values in the `CameraEntityFeature` enum
|
||||
|
Loading…
x
Reference in New Issue
Block a user