Ensure network reset and new network formation works on old firmwares#272
Ensure network reset and new network formation works on old firmwares#272
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## dev #272 +/- ##
=======================================
Coverage 98.79% 98.80%
=======================================
Files 7 7
Lines 916 917 +1
=======================================
+ Hits 905 906 +1
Misses 11 11 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
There was a problem hiding this comment.
Pull Request Overview
This PR ensures that network reset and new network formation work on older firmwares that don't support writing frame counters. The key change is that reset_network_info() now calls form_network(fast=True), and the write_network_info() method checks for this "fast" flag (via form_quickly in stack_specific) or a zero tx_counter to skip the unsupported firmware error.
Key changes:
- Modified
reset_network_info()to callform_network(fast=True)instead ofform_network() - Updated
write_network_info()to conditionally skip frame counter errors when resetting or forming new networks - Changed exception type from
ControllerExceptiontoCannotWriteNetworkSettings
Reviewed Changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
| zigpy_deconz/zigbee/application.py | Added logic to skip frame counter unsupported errors when resetting adapter or forming new network; changed exception type |
| tests/test_network_state.py | Expanded test coverage with additional scenarios including tx_counter variations and two new test functions for fast network formation |
| tests/test_application.py | Updated assertion to verify form_network is called with fast=True |
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
Older firmwares without frame counter writing support are still being reset by having randomized settings written. This should not error out.