Skip to content

Allow any reset during startup, not just RESET_SOFTWARE - #694

Merged
puddly merged 9 commits into
zigpy:devfrom
puddly:puddly/allow-any-reset
Oct 27, 2025
Merged

Allow any reset during startup, not just RESET_SOFTWARE#694
puddly merged 9 commits into
zigpy:devfrom
puddly:puddly/allow-any-reset

Conversation

@puddly

@puddly puddly commented Oct 24, 2025

Copy link
Copy Markdown
Contributor
  • After firmware flashing, the reset reason is usually RESET_POWER_ON
  • After crashing due to ACK timeouts, it's RESET_WATCHDOG

Both of these indicate that the firmware has fully reset, we don't actually need to care about why it reset and our current restriction to accepting only RESET_SOFTWARE as a valid reason causes bellows to fail to start up in cases where it can continue without any issues.

@codecov

codecov Bot commented Oct 24, 2025

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 99.54%. Comparing base (07a2e42) to head (c437280).
⚠️ Report is 2 commits behind head on dev.

Additional details and impacted files
@@            Coverage Diff             @@
##              dev     #694      +/-   ##
==========================================
+ Coverage   99.52%   99.54%   +0.02%     
==========================================
  Files          58       58              
  Lines        3971     3975       +4     
==========================================
+ Hits         3952     3957       +5     
+ Misses         19       18       -1     

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

@davet2001

Copy link
Copy Markdown

I've tried this performing 80 upgrades in a loop using a script that previously reproduced the occasional failure (previously 3-10 failures when tried 80times).

With this PR, I got 0 failures on 80 retries.

@puddly
puddly force-pushed the puddly/allow-any-reset branch from 0d0316b to 8b1da34 Compare October 27, 2025 13:51
@puddly
puddly merged commit 4d31bb4 into zigpy:dev Oct 27, 2025
12 checks passed
mineshaftgap pushed a commit to mineshaftgap/bellows that referenced this pull request Jun 11, 2026
* Allow any reset during startup, not just `RESET_SOFTWARE`

* Attempt to reset multiple times

* Reduce reset timeout

* Deal with spurious resets better

* Update unit tests to account for five retries on connect

* Add some tests

* Bump default Python version to 3.11.14

* Drop default Python version

* Drop `PRE_COMMIT_CACHE_PATH`
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.

3 participants