Skip to content

Drop the Apollo Substitution No Template Defines - #165

Merged
ptr727 merged 12 commits into
developfrom
aht-variant-doc
Sep 21, 2026
Merged

ptr727 merged 12 commits into
developfrom
aht-variant-doc

Conversation

@ptr727

@ptr727 ptr727 commented Sep 21, 2026 •

Copy link
Copy Markdown
Owner

What

Corrects the Apollo PLT-1B substitution list in OPERATIONS.md, which is the finding Copilot raised against the promotion pull request.

  • aht_variant is documented as one of three exposed per-plant overrides and has never existed in any template, so the published contract named a knob no reader can set.
  • The list now names the four the template actually exposes, with the defaults it sets.
  • The NVS wipe requirement is scoped to the two first-boot values, since the two reboot timeouts are compile-time.
  • Two template comments are corrected: 0s disables the API reboot watchdog rather than keeping a sensor awake, and raising it starts a reboot cycle rather than a single reboot.

Why

Apollo hardcodes variant: AHT20 in its own package and exposes no substitution for it, so the knob cannot be set from a device config. git log -S aht_variant -- templates/ finds no commit that ever added it, and the neighboring "Keep templates minimal" note records that a sensor variant was tried on this device and made no observable difference, which is the decision this removal brings the list into line with.

Verification

  • Every bullet checked against templates/apollo-plt-1b.yaml and the cached upstream package: the four names, the four defaults, Apollo's own reboot_timeout: 0s, the absence of any upstream WiFi reboot timeout, and the 90 second run_duration wake window that bounds the reboot-cycle claim.
  • test/apollo-plt-1b.yaml validates.
  • No reference to aht_variant remains anywhere in the tree.

Notes

A pre-existing error two bullets away is fixed here too, on the maintainer's instruction: the "Keep templates minimal" note reported tuning tried on the PLT-1B and then named an SCD41, a sensor that board does not carry. Its air sensor is the AHT that Apollo pins to variant AHT20, and the only SCD4x in the tree is the CeilSense's. That also settles the singular verb the compound subject carried.

The removed half is unrecorded rather than disproved. The phrase was authored in the commit that added the CeilSense, so the SCD41 likely meant that board, and nothing in this repository records a CeilSense humidity observation to move it to.

🤖 Generated with Claude Code

Summary by CodeRabbit

  • Documentation
    • Updated Apollo PLT-1B configuration notes to document the available plant-level substitutions and their defaults.
    • Clarified that first-boot settings require an NVS wipe, while reboot-timeout settings take effect after flashing.
    • Added guidance on API and Wi-Fi reboot-timeout behavior, including connectivity loss and sleep-related reboot cycles.
    • Clarified that the default API reboot timeout disables the reboot watchdog.
    • Simplified the humidity-tracking note to refer to the AHT sensor.

aht_variant is documented as an exposed per-plant override and has never
existed in any template, so the published contract names a knob a reader
cannot set. Apollo hardcodes variant AHT20 in its own package, and no unit
in the fleet carries an AHT10.

The list now names the four substitutions the template actually exposes,
and the NVS wipe requirement is scoped to the two first-boot values it
applies to rather than to the reboot timeouts, which take effect on a
reflash.
The reboot claim held only for a unit Prevent Sleep keeps awake, since a
sleeping unit resets at the 90 second wake window before a longer timeout
elapses. Apollo also ships a factory reset button, so a USB erase is not
the only way to move a stored first-boot value. The first two bullets now
state their defaults like the other two.
The factory reset reads as a ready alternative to the USB erase, and it is
not one on the deployed sleeping unit the paragraph is about, which has no
wakeup pin. The template comment also still carried the unqualified reboot
claim the section narrowed.
Every accurate form of the factory reset aside needs preconditions this
section is not about, so the paragraph keeps the USB route it always had.
The header comment also said 0s keeps a sensor awake, which Prevent Sleep
does, where 0s only disables the API reboot watchdog.
Apollo ships a factory reset that clears preferences too, so naming the
USB erase as the only route was wrong. The instruction now gives the route
without claiming it is the sole one.
Copilot AI lite review requested due to automatic review settings September 21, 2026 01:36
@ptr727 ptr727 added the comments Permits the comment lines the pull request adds or edits, which the prose gate otherwise refuses label Sep 21, 2026
@coderabbitai

coderabbitai Bot commented Sep 21, 2026 •

Copy link
Copy Markdown

Review Change StackReview Change Stack

Understand this PR’s impact

Explore downstream dependencies and potential security impact with Blast Radius.

View blast radius →

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: ASSERTIVE

Plan: Advanced

Run ID: d9411ce3-aa42-423a-98f4-0b14f2daea89

📥 Commits

Reviewing files that changed from the base of the PR and between d8f823c and d5c79c7.

📒 Files selected for processing (2)
  • OPERATIONS.md
  • templates/apollo-plt-1b.yaml

Included review availability: Your plan provides up to 1 included review per hour; 0 remain after this review.


📝 Walkthrough

Walkthrough

The Apollo PLT-1B documentation now lists two first-boot NVS values and two compile-time reboot timeouts. Template comments describe reboot behavior when Home Assistant is unreachable. The operations guide also removes the SCD41 reference from the AHT guidance.

Changes

Apollo PLT-1B documentation

Layer / File(s) Summary
Document reboot timeout behavior
OPERATIONS.md, templates/apollo-plt-1b.yaml
The substitution list replaces aht_variant with api_reboot_timeout and wifi_reboot_timeout. The documentation distinguishes NVS-wipe values from compile-time values and clarifies reboot-cycle behavior. The AHT guidance no longer names the SCD41.

Priority: ⬇️ Low

Estimated code review effort: 1 (Trivial) | ~5 minutes

Change: Other

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check. Docstring coverage is scoped to functions touched by this diff. Analyzed 0 functions across 0…
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title identifies the main change: removing the Apollo substitution that the template does not define. It is concise and related to the documented substitution-list correction.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Commit to this branch
  • Create a new PR

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Copilot review overview

🟡 Changes recommended

The updated PLT-1B substitution bullets in OPERATIONS.md include upstream-derived constants/claims (“90 second wake window”, “ESPHome’s own default”) that can drift and should be reworded to avoid hard-coding values not defined in-repo.

Get a fresh assessment by requesting another Copilot review.

Review effort: Lite
Findings: 1 Low severity

Open (1)
What changed in this PR

This PR updates the Apollo PLT-1B operational documentation to match what templates/apollo-plt-1b.yaml actually exposes, removing a previously documented substitution that does not exist and clarifying how the remaining substitutions behave.

Changes:

  • Correct the documented substitution set for the Apollo PLT-1B to the four substitutions actually exposed by the template, including defaults.
  • Clarify which substitutions require an NVS wipe to take effect on already-deployed devices vs which are compile-time on the next flash.
  • Fix two template comments describing the meaning/effect of api_reboot_timeout.
File Description
templates/​apollo-plt-1b.yaml Adjusts comments describing api_reboot_timeout behavior.
OPERATIONS.md Updates the PLT-1B substitution contract and NVS/compile-time semantics documentation.

💡 Configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment thread OPERATIONS.md Resolved

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Copilot review overview

🟢 Approval recommended

The documentation and template comment updates are consistent with the template’s actual substitutions and no correctness issues were found.

Review effort: Lite
Findings: None

Resolved since last review (1)

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Copilot review overview

🟢 Approval recommended

The only remaining feedback is a minor grammar/clarity tweak in one updated bullet, with no behavioral risk.

Review effort: Lite
Findings: 1 Low severity

Open (1)

Comment thread OPERATIONS.md Resolved

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Copilot review overview

🟡 Changes recommended

The updated api_reboot_timeout comments in templates/apollo-plt-1b.yaml still overstate reboot-cycle behavior without clearly conditioning it on the device remaining awake long enough for the timeout to elapse.

Get a fresh assessment by requesting another Copilot review.

Review effort: Lite
Findings: 1 Low severity

Open (1)
Resolved since last review (1)

Comment thread templates/apollo-plt-1b.yaml Resolved

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Copilot review overview

🟢 Approval recommended

Only a small documentation-clarity tweak remains (to make the run_duration comparison unambiguous), and the changes are otherwise consistent and low risk.

Review effort: Lite
Findings: None

Resolved since last review (1)
Previously missed (1)

In code that hasn't changed since last review

Low severity Clarify api_reboot_timeout comparison to run_duration

OPERATIONS.md:220

The last sentence of the api_reboot_timeout bullet is ambiguous about what must be "below" run_duration. As written, "A sleeping unit loops only below Apollo's own run_duration" can read like the unit itself is below a duration. Clarify that the comparison is between api_reboot_timeout and Apollo's run_duration so the condition is unambiguous.

@ptr727

ptr727 commented Sep 21, 2026

Copy link
Copy Markdown
Owner Author

Answering the "Previously missed" finding from the round on 04b97bf, which opened no thread to reply in.

Clarify api_reboot_timeout comparison to run_duration is fixed in 249de86. The sentence now reads "A sleeping unit loops only when the timeout is below Apollo's own run_duration, 90 seconds in the cached package", so both compared quantities are named and "the timeout" has one referent in that bullet.

The direction is verified rather than assumed: two timers race on a sleeping unit with Home Assistant unreachable, the API reboot at the configured value and deep sleep at Apollo's 90 second run_duration (Battery.yaml plus the boot-priority-999 set_run_duration(90 * 1000) in PLT-1B.yaml). A value below 90 seconds reboots first into a still-unreachable boot, so it loops. A value above it lets deep sleep win.

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Copilot review overview

🟢 Approval recommended

The change is documentation/comment alignment with the template behavior, with only minor wording nits suggested.

Review effort: Lite
Findings: 1 Low severity

Open (1)
Previously missed (1)

In code that hasn't changed since last review

Low severity Add missing "that" in condition wording

templates/​apollo-plt-1b.yaml:15

Grammar: “a unit Prevent Sleep holds awake” reads like a missing relative pronoun and is hard to parse; insert “that” so the condition is unambiguous.

This issue also appears on line 35 of the same file.

Comment thread OPERATIONS.md Resolved
The bullet reports tuning tried on the Apollo PLT-1B and then names an
SCD41, which that board does not carry. Its air sensor is the AHT that
Apollo pins to variant AHT20, and the only SCD4x in the tree is the
CeilSense's. The sentence now names the one sensor the claim was observed
on, which also settles the singular verb the compound subject carried.

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Copilot review overview

🟢 Approval recommended

The changes are documentation/comment corrections that are consistent with the template’s exposed substitutions and do not introduce behavioral risk.

Review effort: Lite
Findings: None

Resolved since last review (1)

@ptr727
ptr727 merged commit 84611aa into develop Sep 21, 2026
34 checks passed
@ptr727
ptr727 deleted the aht-variant-doc branch September 21, 2026 03:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

comments Permits the comment lines the pull request adds or edits, which the prose gate otherwise refuses

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants