Update disabled_by recommendation (#396)

* Update disabled_by suggestion

* Clarify
This commit is contained in:
Paulus Schoutsen 2020-02-04 09:46:40 -08:00 committed by GitHub
parent 4d8bb6ec11
commit b5b4c2d2bc
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -33,11 +33,8 @@ If `disable_new_entities` is set to `True` and `entity_registry_enabled_default`
## Integrations offering options to control disabled_by
Some integrations will want to offer options to the user to control which entities are being added to Home Assistant. For example, the Unifi integration might want to offer to only include wireless clients but exclude wired clients. Another example is that the Hue integration offers an option to make the groups defined inside Hue available in Home Assistant.
Some integrations will want to offer options to the user to control which entities are being added to Home Assistant. For example, the Unifi integration offers options to enable/disable wireless and wired clients.
Integrations can offer options to users either via [configuration.yaml](configuration_yaml_index) or using an [Options Flow](config_entries_options_flow_handler.md).
It is important that if an integration offers an option to change which entities are exposed that:
- The option is only applied to existing integrations the first time it is set. It should not be applied on every reboot. This allows the user to enable individual entities.
- The option should impact the value of the entity property `entity_registry_enabled_default` so that new entities are disabled properly.
If this option is offered by integrations, you should not leverage the disabled_by property in the entity registry. Instead, if entities are disabled via a config options flow, remove them from the device and entity registry.