Allocate APS sequence numbers directly - #6
Closed
puddly wants to merge 2 commits into
Closed
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## dev #6 +/- ##
=========================================
Coverage 100.00% 100.00%
=========================================
Files 7 7
Lines 1681 1687 +6
=========================================
+ Hits 1681 1687 +6 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
There was a problem hiding this comment.
Pull request overview
This PR decouples APS sequence number allocation from the ZCL transaction sequence number (TSN) previously propagated via packet.tsn, aligning behavior with other radio libraries and addressing zigpy/ziggurat#56.
Changes:
- Introduces an internal APS sequence counter in
ControllerApplicationand uses it for all outgoing unicast/broadcast/groupcast frames. - Allocates APS sequence numbers at send-time (within the concurrency limiter) to better reflect the order frames are sent to the server.
- Updates application and legacy tests to assert the new APS sequence numbering behavior (starting at
1).
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
zigpy_ziggurat/zigbee/application.py |
Adds an internal APS sequence counter and uses it instead of packet.tsn when building outbound send requests. |
tests/test_legacy.py |
Updates legacy-protocol send assertions to match the new internally allocated APS sequence values. |
tests/test_application.py |
Updates packet helpers and send tests to stop relying on tsn for APS sequence and to assert the new counter behavior. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Flagged in zigpy/ziggurat#56.
APS sequence numbers should be decoupled from the ZCL TSN that zigpy is (erroneously) passing through to the radio library. No other radio library actually passes through the APS sequence number so this doesn't really affect production networks.