Skip to content

Add APIs for attaching command reply callbacks - #1870

Draft
puddly wants to merge 5 commits into
zigpy:devfrom
puddly:puddly/duplicate-default-response-fix
Draft

puddly wants to merge 5 commits into
zigpy:devfrom
puddly:puddly/duplicate-default-response-fix

Conversation

@puddly

@puddly puddly commented Aug 1, 2026

Copy link
Copy Markdown
Collaborator

This PR adds Cluster.respond_to_command and Cluster.on_command, providing dedicated APIs for both replying to and reacting to commands. The dual API is a little strange but the purpose of having both is to allow zigpy to internally use respond_to_command for a ZCL default response implementation that is overridden by concrete subclasses.

The purpose of this change is to fix a bug flagged in zigpy/ziggurat#56: zigpy currently responds to poll control checkins with an extra default response due to our lack of a proper API to do this.

@codecov

codecov Bot commented Aug 1, 2026 •

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 99.50%. Comparing base (8f3a91e) to head (e90e4c5).
⚠️ Report is 4 commits behind head on dev.

Additional details and impacted files
@@            Coverage Diff             @@
##              dev    #1870      +/-   ##
==========================================
+ Coverage   99.48%   99.50%   +0.01%     
==========================================
  Files          59       59              
  Lines       12280    12494     +214     
==========================================
+ Hits        12217    12432     +215     
+ Misses         63       62       -1     

☔ View full report in Codecov by Harness.
📢 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.

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.

1 participant