chore(esphome): parameterize OTA password (preserve current default)#94
chore(esphome): parameterize OTA password (preserve current default)#94Tycorc wants to merge 1 commit into
Conversation
|
Warning Rate limit exceeded
You’ve run out of usage credits. Purchase more in the billing tab. ⌛ How to resolve this issue?After the wait time has elapsed, a review can be triggered using the We recommend that you space out your commits to avoid hitting the rate limit. 🚦 How do rate limits work?CodeRabbit enforces hourly rate limits for each developer per organization. Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout. Please see our FAQ for further information. ℹ️ Review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (3)
✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Promote the hardcoded `password: "apolloautomation"` literal to a
`${ota_password}` substitution in `Core.yaml`, defaulting to the same value
so existing consumers see no behavior change. Consumers who want a
per-device password can override via `substitutions:` in their device YAML
and stop sharing a fleet-wide credential.
Why
----
Every AIR-1 worldwide currently boots with the same OTA password (introduced
in ApolloAutomation#34, "Fix ota password", to make OTA upgrades work after the prior
no-password attempts in ApolloAutomation#20 / ApolloAutomation#27). Consumers who include this file via
`packages:` cannot override from their device YAML because ESPHome packages
extend list-valued keys (a second `ota: - platform: esphome` block produces
a duplicate-platform validation error) and `ota: !remove` cannot be paired
with a top-level redeclaration in the same YAML doc. Newer Apollo product
configs (MSR-2, MTR-1, PWR-1, TEMP-1, PLT-1, BTN-1, RLY-1, H-1, H-2, PUMP-1)
already avoid the literal — this brings AIR-1 in line.
Backwards compat
----------------
100% — devices that don't set `ota_password` get `apolloautomation` exactly
as today. CI / firmware builds unchanged.
Override example (in a consumer device YAML):
substitutions:
ota_password: !secret living_room_air_1_ota_password
packages:
ApolloAutomation.AIR-1: github://ApolloAutomation/AIR-1/Integrations/ESPHome/AIR-1.yaml
971a4e3 to
b964bc5
Compare
Version: 26.3.2.1
What does this implement/fix?
Promotes the hardcoded
password: "apolloautomation"literal inAIR-1.yamlandAIR-1_BLE.yamlto a${ota_password}substitution defined inCore.yaml, with the existing literal kept as the default. No behavior change for anyone who doesn't override.Why
Every Apollo AIR-1 currently boots with the same fleet-wide OTA password (the literal was introduced in #34 to fix OTA upgrade failures from #20 / #27 — that fix is preserved here, just made overridable). Consumers who include this YAML via ESPHome
packages:cannot override the password from their device file because:ota: - platform: esphomeblock in the consumer file produces a duplicate-platform validation error.ota: !removeremoves the package's contribution, but YAML disallows two top-levelota:keys, so the consumer can't redeclare in the same document.The only existing workaround is to fork or vendor a local copy of this file — neither of which keeps the upstream
package_import_urlflow working.The newer Apollo product configs (MSR-2, MTR-1, PWR-1, TEMP-1, PLT-1, BTN-1, RLY-1, H-1, H-2, PUMP-1) all have
ota:blocks but no hardcoded password literal — only AIR-1 and MSR-1 still ship with one. A sibling PR has been opened against MSR-1 with the same change.What changes
Override pattern (consumer device YAML)
Backwards compat
100% — devices that don't set
ota_passwordget the same"apolloautomation"literal as before. Existing consumers, CI builds, and OTA flow unchanged.Types of changes
Checklist / Checklijst:
If user-visible functionality or configuration variables are added/modified: