Always add friendly name attribute to ZHA entities#19141
Always add friendly name attribute to ZHA entities#19141balloob merged 2 commits intohome-assistant:devfrom
Conversation
| endpoint.endpoint_id, | ||
| kwargs.get('entity_suffix', ''), | ||
| ) | ||
| self._device_state_attributes['friendly_name'] = "{}_{}{}".format( |
There was a problem hiding this comment.
This is wrong:
- Define the
nameproperty to set the name - A name should not contain underscores, endpoint IDs etc. That's not a name, that's an identifier.
There was a problem hiding this comment.
Understood. In that case I would skip the friendly name if we do not have model/manufacturer information and use the ieee network address as a name for the device registry. Is that ok?
There was a problem hiding this comment.
What you're changing is not for the device registry, this is for the entity
There was a problem hiding this comment.
Yes, but currently the friendly name attribute is used as a name for the device registry. If there is no friendly name it errs out when adding it to the device registry. That is what I am trying to fix.
There was a problem hiding this comment.
Then that should be fixed inside the device_info method?
There was a problem hiding this comment.
Yes, is it ok to use the ieee network address as a name for the device registry? Or is there any other preferred naming convention?
There was a problem hiding this comment.
I agree with balloob, If we don't have Manufacturer/Model, don't set 'friendly_name' at all and for the device_info['name'] use IEEE or "ZHA + IEEE"?
home-assistant#19141 should be what ultimately corrects this issue.
|
Just adding a note that the already merged device registry changes will cause errors if this isn’t merged before they are released |
* Always add friendly name attribute * Only change device_info name
Description:
Always add a friendly name to entities so that we have a name for the device registry.
fixes #18755
Checklist:
tox. Your PR cannot be merged unless tests pass