palazzem / ha-econnect-alarm

Home Assistant integration that provides a full-fledged Alarm Panel to control your Elmo/IESS alarm systems.
BSD 3-Clause "New" or "Revised" License
10 stars 5 forks source link

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

Closed palazzem closed 9 months ago

palazzem commented 9 months ago

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