Skip to content

Implement quirks v2 reporting config, optimize discovery #363

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

Merged
merged 4 commits into from
Jan 27, 2025

Conversation

TheJulianJES
Copy link
Contributor

@TheJulianJES TheJulianJES commented Jan 27, 2025

Proposed change

This implements quirks v2 reporting_config in ZHA. The quirks v2 processing for ZCL_INIT_ATTRS is also optimized to not copy ZCL_INIT_ATTRS for every entity metadata object.

A test is also added that actually checks the existing ZCL_INIT_ATTRS code and new code:

  • that it doesn't modify the original ZCL_INIT_ATTRS class variable, affecting other cluster handler instances
  • that ZCL_INIT_ATTRS are correctly set (and doesn't contain attributes also in REPORTING_CONFIG)
  • that REPORT_CONFIG is correctly set
  • that the cluster handler is claimed when reporting_config is set, thus binding it during ZHA device configuration

Additional information

Supersedes:

@TheJulianJES TheJulianJES added the enhancement New feature or request label Jan 27, 2025
Copy link

codecov bot commented Jan 27, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 96.58%. Comparing base (e6a01cf) to head (6838b37).
Report is 6 commits behind head on dev.

Additional details and impacted files
@@            Coverage Diff             @@
##              dev     #363      +/-   ##
==========================================
- Coverage   96.58%   96.58%   -0.01%     
==========================================
  Files          61       61              
  Lines        9499     9512      +13     
==========================================
+ Hits         9175     9187      +12     
- Misses        324      325       +1     

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

@TheJulianJES TheJulianJES force-pushed the tjj/quirks_v2_report_config branch from 316c390 to 2948276 Compare January 27, 2025 00:20
@TheJulianJES TheJulianJES added the quirks Quirks related label Jan 27, 2025
@TheJulianJES
Copy link
Contributor Author

This PR is ready IMO. It's also well-tested to verify that the existing ZCL_INIT_ATTRS ch class variable isn't screwed up.
If there are too many comments, we can remove some. Others are crucial though if you're looking at this for the first time.

@puddly puddly merged commit 79e8f50 into zigpy:dev Jan 27, 2025
9 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request quirks Quirks related
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants