[safe_mode] Detect bootloader rollback support at runtime - #13230
Conversation
|
👋 Hi there! This PR modifies 2 file(s) with codeowners. @jsuanet, @kbx81, @paulmonigatti - As codeowner(s) of the affected files, your review would be appreciated! 🙏 Note: Automatic review request may have failed, but you're still welcome to review. |
|
To use the changes from this PR as an external component, add the following to your ESPHome configuration YAML file: external_components:
- source: github://pr#13230
components: [safe_mode]
refresh: 1h(Added by the PR bot) |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## dev #13230 +/- ##
==========================================
+ Coverage 73.76% 73.79% +0.02%
==========================================
Files 53 53
Lines 11329 11329
Branches 1538 1538
==========================================
+ Hits 8357 8360 +3
+ Misses 2572 2570 -2
+ Partials 400 399 -1 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
Memory Impact AnalysisComponents:
This analysis runs automatically when components change. Memory usage is measured from a representative test configuration. |
6b1fc4f to
90d345d
Compare
|
👋 Hi there! This PR modifies 4 file(s) with codeowners. @esphome/core - As codeowner(s) of the affected files, your review would be appreciated! 🙏 Note: Automatic review request may have failed, but you're still welcome to review. |
Check the OTA partition state at boot to detect if the bootloader supports rollback: - NEW: bootloader didn't transition to PENDING_VERIFY (not supported) - PENDING_VERIFY: bootloader is tracking state (supported) - Other: support unknown Display the result in dump_config. Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
8a49471 to
8342399
Compare
|
Thanks |
Co-authored-by: Claude Opus 4.5 <noreply@anthropic.com>
What does this implement/fix?
Detect at boot if the bootloader supports OTA rollback by checking the partition state:
ESP_OTA_IMG_NEW: Bootloader didn't transition to PENDING_VERIFY → not supportedESP_OTA_IMG_PENDING_VERIFY: Bootloader is tracking state → supportedNote: Detection only works on the first boot after an OTA update. After safe_mode marks the partition as valid, subsequent boots will show "support unknown".
Note: Detection requires the device to have been OTA'd from a build with rollback enabled. If upgrading from an older build without rollback support, a second OTA may be needed before "supported" is shown.
This helps users identify when their bootloader doesn't support the rollback feature.
Types of changes
Related issue or feature (if applicable):
Pull request in esphome-docs with documentation (if applicable):
Test Environment
Example entry for
config.yaml:Example output in logs:
Checklist:
tests/folder).If user exposed functionality or configuration variables are added/changed:
🤖 Generated with Claude Code