Skip to content

Better parsing of the ZHA device profile id#41024

Merged
Adminiuga merged 1 commit intohome-assistant:devfrom
Adminiuga:fixes/zha-device-info
Oct 2, 2020
Merged

Better parsing of the ZHA device profile id#41024
Adminiuga merged 1 commit intohome-assistant:devfrom
Adminiuga:fixes/zha-device-info

Conversation

@Adminiuga
Copy link
Copy Markdown
Contributor

@Adminiuga Adminiuga commented Oct 1, 2020

Breaking change

No

Proposed change

More robust parsing of the ZHA endpoint profile id, as some quirks don't set the profile id as as an Enunm, which was causing errors like:

WARNING (MainThread) [homeassistant.components.zha.core.device] [0xBF7F](lumi.sensor_ht): Failed to identify endpoint name in 'dict_items([(0, <zigpy.zdo.ZDO object at 0x7f6bc1edc0>), (1, <zigpy.quirks.CustomEndpoint object at 0x7f6bba4b80>), (2, <zigpy.quirks.CustomEndpoint object at 0x7f6bba4c10>), (3, <zigpy.quirks.CustomEndpoint object at 0x7f6bba4c40>)])' with exception ''int' object has no attribute 'name''

@Samantha-uk can you please this to make sure it's not affecting anything ?

Type of change

  • Dependency upgrade
  • Bugfix (non-breaking change which fixes an issue)
  • New integration (thank you!)
  • New feature (which adds functionality to an existing integration)
  • Breaking change (fix/feature causing existing functionality to break)
  • Code quality improvements to existing code or addition of tests

Example entry for configuration.yaml:

n/a

Additional information

Checklist

  • The code change is tested and works locally.
  • Local tests pass. Your PR cannot be merged unless tests pass
  • There is no commented out code in this PR.
  • I have followed the development checklist
  • The code has been formatted using Black (black --fast homeassistant tests)
  • Tests have been added to verify that the new code works.

If user exposed functionality or configuration variables are added/changed:

If the code communicates with devices, web services, or third-party tools:

  • The manifest file has all fields filled out correctly.
    Updated and included derived files by running: python3 -m script.hassfest.
  • New or updated dependencies have been added to requirements_all.txt.
    Updated by running python3 -m script.gen_requirements_all.
  • Untested files have been added to .coveragerc.

The integration reached or maintains the following Integration Quality Scale:

  • No score or internal
  • 🥈 Silver
  • 🥇 Gold
  • 🏆 Platinum

To help with the load of incoming pull requests:

@probot-home-assistant
Copy link
Copy Markdown

Hey there @dmulcahey, mind taking a look at this pull request as its been labeled with an integration (zha) you are listed as a codeowner for? Thanks!
(message by CodeOwnersMention)

@Adminiuga
Copy link
Copy Markdown
Contributor Author

@Samantha-uk I think some of the quirks in https://github.com/zigpy/zha-device-handlers are overriding the device type and are not using the profile enum.

@Adminiuga Adminiuga added this to the 0.116.0 milestone Oct 1, 2020
@Adminiuga Adminiuga merged commit f1f23c0 into home-assistant:dev Oct 2, 2020
@Adminiuga Adminiuga deleted the fixes/zha-device-info branch October 2, 2020 01:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[BUG] ZHA: Failed to identify endpoint name

4 participants