This change ensures that the self-generated entity_id is a valid HA Entity ID, while keeping the name in a human readable format. The validation is done via tests using valid_entity_id() HA core function and is not validated at runtime (there is no reasons to do that live).
Even if the integration was working properly, entities were not respecting the official entity_id format: <domain>.<entity_id>. With this change, domain is included in the Entity ID even though it is remove by HA for unclear reasons. This behavior is described in the official documentation: https://www.home-assistant.io/faq/unique_id/#can-be-changed
Example
Before:
After:
Testing:
Install the integration before the change and after the change. If name is not set with a "friendly name", you should see this change.
Extra Notes (optional):
n/a
Checklist
[x] Related issues and proposed changes are filled
[x] Tests are defining the correct and expected behavior
Related Issues
Proposed Changes:
This change ensures that the self-generated
entity_id
is a valid HA Entity ID, while keeping the name in a human readable format. The validation is done via tests usingvalid_entity_id()
HA core function and is not validated at runtime (there is no reasons to do that live).Even if the integration was working properly, entities were not respecting the official
entity_id
format:<domain>.<entity_id>
. With this change,domain
is included in the Entity ID even though it is remove by HA for unclear reasons. This behavior is described in the official documentation: https://www.home-assistant.io/faq/unique_id/#can-be-changedExample
Before:
After:
Testing:
Install the integration before the change and after the change. If
name
is not set with a "friendly name", you should see this change.Extra Notes (optional):
n/a
Checklist