Repository navigation
Ignore encryption: !remove in the raw encryption heuristic - #3019
J. Nick Koston (bdraco) merged 2 commits into
Conversation
A package's api or ota encryption removed with `!remove` was read as declared, so the API-info probe refused the device for lack of a Noise key and its deployed version stayed empty.
There was a problem hiding this comment.
🟢 Approval recommended
No active review issues are recorded for the change to ignore !remove encryption values.
No open issues 🎉
What changed in this PR
Fixes #3018 by preventing the raw YAML encryption heuristic from treating encryption: !remove as declared encryption. This lets affected plaintext API devices reach version probing instead of being rejected for a missing Noise key.
Changes:
- Exclude
!removevalues from the shared API/OTA encryption regex. - Add regression coverage for scan-time API encryption state and OTA encryption detection.
| File | Description |
|---|---|
tests/test_encryption_key_extraction.py |
Adds API and OTA regression cases for removed encryption. |
esphome_device_builder/helpers/device_yaml/_parsing.py |
Updates the nested-key regex to ignore !remove values. |
Review effort: Balanced
Merging this PR will not alter performance1 warning
Comparing Footnotes
|
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #3019 +/- ##
=======================================
Coverage 99.76% 99.76%
=======================================
Files 300 300
Lines 26484 26484
=======================================
Hits 26423 26423
Misses 61 61
Flags with carried forward coverage won't be shown. Click here to find out more.
🚀 New features to boost your workflow:
|
|
Merged main to bring the branch up to date; no conflicts, and the PR's tests pass locally. ESPHome Bot (@esphbot) review |
PR Review — Ignore
|
ESPHome Bot (esphbot)
left a comment
There was a problem hiding this comment.
Tip
No blocking issues found — ready to merge.
What does this implement/fix?
The raw-text encryption heuristic (
_nested_key_re) no longer countsencryption: !removeunderapi:orota:as declared encryption.api_encryptedis the OR of the resolved config, this heuristic and the mDNS signal. The resolved config already ignores a removedencryption:(theRemovemarker isn't a mapping), but the regex matched the line, so the device read as encrypted. The API-info probe then refused it with "no Noise key resolved" after every cooldown. On a dashboard that can't hear the device's mDNS,deployed_versionstayed empty: no update badge, and Update All skipped it. Apollo's AIR-1 package declaresapi: encryption:, so!removeis how users keep it on the plaintext API.The change is a negative lookahead after
{key}:. It adds no alternation, so the backtracking note on the pattern still holds.Tests:
api_encryptedstays False at scan time forapi: encryption: !remove, andyaml_has_ota_encryptiongets aremovedcase. Both fail without the fix.Related: #2982 handles
!removemarkers in the resolvedmqtt:block. It touches different files.Related issue or feature (if applicable):
api: encryption: !removemarks a device as encrypted, so its version probe never runs #3018Types of changes
bugfixnew-featureenhancementbreaking-changerefactordocsmaintenancecidependenciesFrontend coordination
Checklist
ruff,codespell, yaml/json/python checks).tests/where applicable.components.index.json/definitions/components/*.jsonhave not been hand-edited (regenerate viascript/sync_components.pyif a sync is needed).docs/ARCHITECTURE.mdand/ordocs/API.md.🤖 Generated with Claude Code