Move all supported features in Update entities to enum (#1263)

This commit is contained in:
Joakim Sørensen 2022-04-01 07:53:28 +02:00 committed by GitHub
parent 7aeb2a00ec
commit df3d9503e3
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -34,13 +34,15 @@ Other properties that are common to all entities such as `device_class`, `entity
## Supported Features ## Supported Features
| Constant | Description | Supported features are defined by using values in the `UpdateEntityFeature` enum.
| Value | Description |
|----------|--------------------------------------| |----------|--------------------------------------|
| 'UpdateEntityFeature.BACKUP' | A backup can be made automatically, before installing an update. | 'BACKUP' | A backup can be made automatically, before installing an update.
| 'UpdateEntityFeature.INSTALL' | The update can be installed from Home Assistant. | 'INSTALL' | The update can be installed from Home Assistant.
| 'UpdateEntityFeature.PROGRESS' | This integration is able to provide progress information. If omitted, Home Assistant will try to provide a progress status; although it is better if the progress can be extracted from the device or service API. | 'PROGRESS' | This integration is able to provide progress information. If omitted, Home Assistant will try to provide a progress status; although it is better if the progress can be extracted from the device or service API.
| 'UpdateEntityFeature.SPECIFIC_VERSION' | A specific version of an update can be installed using the `update.install` service. | 'SPECIFIC_VERSION' | A specific version of an update can be installed using the `update.install` service.
| 'UpdateEntityFeature.RELEASE_NOTES' | The entity provides methods to fetch a complete changelog. | 'RELEASE_NOTES' | The entity provides methods to fetch a complete changelog.
## Methods ## Methods
@ -49,10 +51,10 @@ Other properties that are common to all entities such as `device_class`, `entity
This method can be implemented so users can install an offered update directly This method can be implemented so users can install an offered update directly
from within Home Assistant. from within Home Assistant.
This method requires `SUPPORT_INSTALL` to be set. Additionally, if this This method requires `UpdateEntityFeature.INSTALL` to be set. Additionally, if this
integration supports installing specific version or is capable of backing up integration supports installing specific version or is capable of backing up
before starting the update installation process, `SUPPORT_SPECIFIC_VERSION` and before starting the update installation process, `UpdateEntityFeature.SPECIFIC_VERSION` and
`SUPPORT_BACKUP` can be set respectively. `UpdateEntityFeature.BACKUP` can be set respectively.
```python ```python
class MyUpdate(UpdateEntity): class MyUpdate(UpdateEntity):