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

Always add friendly name attribute to ZHA entities #19141

Merged
merged 2 commits into from Dec 13, 2018

Conversation

Projects
None yet
5 participants
@damarco
Copy link
Contributor

damarco commented Dec 9, 2018

Description:

Always add a friendly name to entities so that we have a name for the device registry.

fixes #18755

Checklist:

  • The code change is tested and works locally.
  • Local tests pass with tox. Your PR cannot be merged unless tests pass
  • There is no commented out code in this PR.
@@ -43,6 +43,11 @@ def __init__(self, endpoint, in_clusters, out_clusters, manufacturer,
endpoint.endpoint_id,
kwargs.get('entity_suffix', ''),
)
self._device_state_attributes['friendly_name'] = "{}_{}{}".format(

This comment has been minimized.

@balloob

balloob Dec 10, 2018

Member

This is wrong:

  • Define the name property to set the name
  • A name should not contain underscores, endpoint IDs etc. That's not a name, that's an identifier.

This comment has been minimized.

@damarco

damarco Dec 10, 2018

Contributor

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?

This comment has been minimized.

@balloob

balloob Dec 10, 2018

Member

What you're changing is not for the device registry, this is for the entity

This comment has been minimized.

@damarco

damarco Dec 10, 2018

Contributor

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.

This comment has been minimized.

@balloob

balloob Dec 10, 2018

Member

Then that should be fixed inside the device_info method?

This comment has been minimized.

@damarco

damarco Dec 10, 2018

Contributor

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?

This comment has been minimized.

@Adminiuga

Adminiuga Dec 12, 2018

Contributor

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"?

dmulcahey added a commit to dmulcahey/home-assistant that referenced this pull request Dec 10, 2018

Remove fix in favor of home-assistant#19141
home-assistant#19141 should be what ultimately corrects this issue.

@fabaff fabaff changed the title Always add friendly name attribute to zha entities Always add friendly name attribute to ZHA entities Dec 12, 2018

fabaff added a commit that referenced this pull request Dec 12, 2018

Add ZHA device handler library (#19099)
* event foundation

* implement quirks

* lock zha-quirks version

* allow quirks handling to be toggled on and off

* revert event commit

* disable warning

* update requirements_all

* Remove fix in favor of #19141

#19141 should be what ultimately corrects this issue.

* review comment
@dmulcahey

This comment has been minimized.

Copy link
Contributor

dmulcahey commented Dec 12, 2018

Just adding a note that the already merged device registry changes will cause errors if this isn’t merged before they are released

@balloob balloob added this to the 0.84.2 milestone Dec 13, 2018

@balloob balloob merged commit f60f9ba into home-assistant:dev Dec 13, 2018

4 checks passed

Hound No violations found. Woof!
WIP ready for review
Details
cla-bot Everyone involved has signed the CLA
continuous-integration/travis-ci/pr The Travis CI build passed
Details

@wafflebot wafflebot bot removed the in progress label Dec 13, 2018

balloob added a commit that referenced this pull request Dec 14, 2018

Always add friendly name attribute to ZHA entities (#19141)
* Always add friendly name attribute

* Only change device_info name

@balloob balloob referenced this pull request Dec 14, 2018

Merged

0.84.2 #19281

@damarco damarco deleted the damarco:zha-fix-friendly-name branch Dec 16, 2018

dshokouhi added a commit to dshokouhi/home-assistant that referenced this pull request Dec 25, 2018

Always add friendly name attribute to ZHA entities (home-assistant#19141
)

* Always add friendly name attribute

* Only change device_info name
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment