Skip to content

Comments

Use attribute names for send_attributes_report in tests#680

Merged
TheJulianJES merged 1 commit intozigpy:devfrom
TheJulianJES:tjj/send_test_reports_with_attribute_names
Feb 25, 2026
Merged

Use attribute names for send_attributes_report in tests#680
TheJulianJES merged 1 commit intozigpy:devfrom
TheJulianJES:tjj/send_test_reports_with_attribute_names

Conversation

@TheJulianJES
Copy link
Contributor

Proposed change

In preparation for bumping zigpy to 1.0.0 with #679, we need to adapt our tests to send attribute reports with the correct manufacturer code due to zigpy/zigpy#1775. With #637, some tests were already updated to provide the attribute name (instead of ID) to send_attributes_report. This updates the tests that also require this for the new zigpy version.

Additional information

We may want to revisit send_attributes_report, since using None manufacturer code when providing an ID is not fully correct:

zha/tests/common.py

Lines 141 to 143 in c5a3171

if isinstance(attr, int):
# Raw attribute ID for unknown attributes
manufacturer_codes.add(None)

find_attribute could be used and determine the ZCLAttributeDef if there's only matching definition by ID.
We could also simply prevent allowing providing attribute IDs to this. It's better if all tests provided attribute names or ZCLAttributeDef references directly.
... or we just leave it like this and accept that it should basically never be used.

Copy link
Contributor

@puddly puddly left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks!

@codecov
Copy link

codecov bot commented Feb 25, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 97.51%. Comparing base (c5a3171) to head (f005ae4).
⚠️ Report is 1 commits behind head on dev.

Additional details and impacted files
@@           Coverage Diff           @@
##              dev     #680   +/-   ##
=======================================
  Coverage   97.51%   97.51%           
=======================================
  Files          62       62           
  Lines       10941    10941           
=======================================
  Hits        10669    10669           
  Misses        272      272           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@TheJulianJES TheJulianJES merged commit 81efd42 into zigpy:dev Feb 25, 2026
9 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants