Repository navigation
Add retained MQTT Maintenance and Storage modes - #39
Merged
Merged
Conversation
JGAguado
approved these changes
Oct 21, 2026
JGAguado
left a comment
Owner
There was a problem hiding this comment.
Good design: battery-gated admission, an acknowledgement only after an observed panel refresh, a bounded watchdog, and the latest request wins. This restores a practical OTA path that the single-cycle sleep removed. Approving.
Note: it overlaps with #31 in smart_plant_core.yaml and tests/display_automation.py, so please merge #31 first and rebase this one onto it. Native-API users still have no Maintenance window, so a short line in the programming guide pointing OTA users to the MQTT profile would help.
…very Drop the globals duplicated by the #31 merge. Let the parity test accept the multi-device extensions (fault hook, counter, logs, MQTT status) and the per-profile sleep_after_display. Bound the flow tests by each profile's on_display_fault delay. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_017fn1KdJJTY7LedVqZ7SxcA
flowcool
force-pushed
the
publish/73-maintenance-storage
branch
from
October 21, 2026 15:36
3704929 to
086faa3
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Add retained MQTT controls so a sleeping device can enter an acknowledged OTA window or seasonal Storage mode.
Maintenance acknowledges
ONonly after a finite battery reading at or above the configurable threshold and an observed panel refresh. Storage persists across boots, samples battery daily, and returns to fresh plant acquisition on exit. Duplicate retained commands do not restart completed work. The API profile clears a restored MQTT Storage latch and remains broker-free.The common recovery path keeps one total BUSY budget and cancels stale work before a new refresh. Normal and emergency sleep preserve low-battery priority and explicit OTA confirmation. This includes the shared-core recovery mechanism also under review in #31; that PR separately updates the standalone example. Merge order can require refreshing the overlapping core and test helper.
Evidence
After: 52 tests pass, with no skips, on refreshed upstream V2R1. They execute actual package actions and native C++ lambdas for admission, arbitration, watchdog, OTA cleanup, retained echoes, fresh acquisition, profile changes, BUSY oscillation, cancellation and sleep-duration priority.
soil_voltageacquisition source and retain the existing median/cadence/calibration. The native library helper includes the Windows DLL cleanup and UTF-8 handling requested in Bring bounded display recovery and safe rendering to the standalone example #31. A native Windows run is not claimed.0xc8eb5eec, MQTT0x152aa56c. Inputs use synthetic credentials, local replacement fonts and a public sample background; no live service, device, NAS or build server is contacted.Merge Danger
Door: two-way. Revert this contribution through a PR before reverting prerequisites. A source revert does not deploy firmware.
Blast Radius: firmware. Affects users who later adopt these packages. No deployment is included. Keep core and transport from the same revision and wait for the accepted Maintenance status before OTA.
AI assistance: Codex prepared and validated this isolated contribution. Upstream review is requested; local tests do not constitute maintainer approval.