Add warning about changing device_class etc for entities (#2019)

This commit is contained in:
Erik Montnemery 2023-12-21 08:13:07 +01:00 committed by GitHub
parent 1bb99f3928
commit 7b109160ce
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -84,6 +84,12 @@ To avoid calculations in a property method, set the corresponding [entity class
| supported_features | <code>int &#124; None</code> | `None` | Flag features supported by the entity. Domains specify their own.
| translation_key | <code>str &#124; None</code> | `None` | A key for looking up translations of the entity's state in [`entity` section of the integration's `strings.json`](/docs/internationalization/core#state-of-entities).
:::warning
It's allowed to change `device_class`, `supported_features` or any property included in a domain's `capability_attributes`. However, since these entity properties often are not expected to change at all and some entity consumers may not be able to update them at a free rate, we recommend only changing them when absolutely required and at a modest interval.
As an example, such changes will cause voice assistant integrations to resynchronize with the supporting cloud service.
:::
:::warning
Entities that generate a significant amount of state changes can quickly increase the size of the database when the `extra_state_attributes` also change frequently. Minimize the number of `extra_state_attributes` for these entities by removing non-critical attributes or creating additional `sensor` entities.
:::