Skip to content

Conversation

@puddly
Copy link
Contributor

@puddly puddly commented Oct 22, 2025

Older firmwares without frame counter writing support are still being reset by having randomized settings written. This should not error out.

@codecov
Copy link

codecov bot commented Oct 22, 2025

Codecov Report

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

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.
📢 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.

@puddly puddly requested a review from Copilot October 22, 2025 16:37
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

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

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 call form_network(fast=True) instead of form_network()
  • Updated write_network_info() to conditionally skip frame counter errors when resetting or forming new networks
  • Changed exception type from ControllerException to CannotWriteNetworkSettings

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.

@puddly puddly merged commit 048965a into zigpy:dev Oct 22, 2025
14 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.

1 participant