Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat!: binary sensors and control panels generates a valid Entity ID with a human readable name #54

Merged
merged 3 commits into from
Sep 28, 2023

Conversation

palazzem
Copy link
Owner

@palazzem palazzem commented Sep 27, 2023

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 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:
image

After:
image

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

  • Related issues and proposed changes are filled
  • Tests are defining the correct and expected behavior
  • Code is well-documented via docstrings

@palazzem palazzem added this to the 1.1.0 milestone Sep 27, 2023
@palazzem palazzem self-assigned this Sep 27, 2023
@palazzem palazzem merged commit 1dc86a7 into main Sep 28, 2023
@palazzem palazzem deleted the palazzem/task-53 branch September 28, 2023 09:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

Entity names are now the same as the Entity ID
1 participant