Skip to content

Sync V2R1 with upstream V2R1 (#31, #37-#40), keeping fork production features - #34

Merged
flowcool merged 38 commits into
V2R1from
sync/upstream-2026-10-21
Oct 21, 2026
Merged

flowcool merged 38 commits into
V2R1from
sync/upstream-2026-10-21

Conversation

@flowcool

Copy link
Copy Markdown
Owner

Summary

Sync the fork's V2R1 with JGAguado/Smart_Plant V2R1 (37 upstream commits: #31, #37, #38, #39, JGAguado#40). Source only. No package-cache reset, compile, OTA or fleet deployment. Bead: infra-3rr.78.

A plain merge conflicts in 17 files, because the fork core carries production features upstream lacks. The core and the shared tests are therefore upstream's reviewed versions, with the fork features re-applied on top.

What the fork keeps (re-applied on the upstream core)

  • configured_name, name_add_mac_suffix, display_name, secondary_name, device_comment.
  • Function-only entity names (no friendly_name prefix) and their accuracy_decimals.
  • Shared soil calibration soil_v_wet 1.36 V.
  • GF_Latin_Core glyphs and the dynamic plant-name text on the normal page.
  • No fallback access point or captive portal (upstream's default-password AP is not adopted).
  • MQTT credential defaults in the core, discovery_* generators and the auto-derived MQTT topic prefix. Upstream's mqtt_topic_prefix default would change fleet topics, so it is not adopted.
  • Both profiles stay the fork's. The API profile already carries the content of Wait for native API state subscribers before acquisition JGAguado/Smart_Plant#41. The MQTT boot priority stays 600.

What changes

  • Upstream's reviewed core: bounded recovery budget, compile-time low-battery threshold assertion, std::isfinite instead of isnan, render_measurement_page in restart mode.
  • safe_mode.mark_successful is called again before sleep (core and standalone example), as the reviewed upstream recovery does. It is redundant and harmless on ESPHome >= 2026.8.0. infra-3rr.47 had retired it; guidance files updated.
  • The HA-snapshot label tooling moves to *fleet* names (scripts/smartplant_fleet_*.py, label_maker/fleet-gauge-contract.yaml, label_maker/FLEET.md, tests/test_fleet_gauge_contract.py). The generic upstream label generator owns the canonical paths. The 8 generated device packages differ only in one header comment line.
  • Public docs (README.md, programming.rst, generic multi-device guide) are upstream's; fleet sections stay.
  • scripts/validate_public_examples.py accepts flowcool package URLs. The fork examples define the secrets they need and the API example points at the fork packages. CI runs it.
  • tests/test_soil_voltage.py reads the wet/dry calibration from the config instead of hard-coding 1.25. The test harness gains the api.connected condition used by the API profile (same code as Wait for native API state subscribers before acquisition JGAguado/Smart_Plant#41).

Evidence

  • Rendered config, 8 devices, before vs after (esphome config, ESPHome 2026.9.0, local packages, synthetic secrets, compared as normalized YAML): 9 differences, identical on all 8 devices. No substitution, entity name, sensor, MQTT or discovery setting differs. The 9 are: refactored page lambdas (same logic, dynamic name lines intact), isnan -> std::isfinite in 3 scripts, safe_mode.mark_successful in enter_deep_sleep and force_sleep_after_busy_fault, the threshold assertion and restart mode of render_measurement_page.
  • 128 tests pass (fork-only and upstream tests together), esphome config docs/source/files/configuration.yaml passes, scripts/validate_public_examples.py passes for both examples, generate_device_metadata.py --check passes, all 22 tracked YAML files parse.
  • Not claimed: no firmware build, no device, broker, NAS or Device Builder contact. Rendered config proves composition, not runtime behavior.

Merge Danger

Door: two-way. git revert -m 1 <merge> through a PR restores the previous composition. No firmware is deployed by this PR.

Blast Radius: the next compile of any device that fetches packages @V2R1 (after a package-cache reset) gets this code. Behavior differences are the nine listed above. Compile and OTA stay separate operations with their own canary: validate one device and observe two wake/sleep cycles first.

Follow-up: upstream moved the MQTT boot trigger to priority 399.0. The fork keeps 600 (production-proven). Evaluating 399.0 needs a canary and is not part of this PR.

🤖 Generated with Claude Code

https://claude.ai/code/session_017fn1KdJJTY7LedVqZ7SxcA

flowcool and others added 30 commits October 20, 2026 22:23
Expose the running ESPHome version and native configuration hash
Expose median-filtered soil voltage for calibration diagnostics
Keep measured gauge numbers while clamping only needle positions
Recover the missing KiCad symbol library from both schematic caches
Run the unit tests and validate the standalone ESPHome configuration on
every PR. CODEOWNERS keeps hardware, documentation and repository
governance paths under maintainer review.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Protect low batteries with persistent hysteresis and long sleep
Keep recovered KiCad symbol libraries LF on Windows
Make public examples independent of the fork and validate both transports
Bring bounded display recovery and safe rendering to the standalone example
…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 and others added 8 commits October 21, 2026 17:38
Add retained MQTT Maintenance and Storage modes
Generate generic label bands from explicit input scales
docs: refresh project entry points and first-install guides
Sync the fork with JGAguado/Smart_Plant V2R1 after upstream merged #31, #37,
#38, #39 and JGAguado#40. The shared core and tests are upstream's reviewed versions;
fork production features are re-applied on top: configured_name/display_name
identity, function-only entity names, shared soil_v_wet 1.36, GF_Latin_Core
glyphs, dynamic plant-name text, no fallback access point, mqtt credential
defaults in the core. The API and MQTT profiles stay the fork's (the API
profile already carries JGAguado#41; the MQTT boot priority stays 600).

The HA-snapshot label tooling moves to *fleet* names so the generic upstream
label generator can own the canonical paths. validate_public_examples.py also
accepts flowcool package URLs. mark_successful is called again before sleep,
as the reviewed upstream recovery does (infra-3rr.47 had retired it).

Rendered ESPHome config of the 8 generated device overlays differs from the
previous V2R1 only in display lambda refactors, isnan -> std::isfinite,
safe_mode.mark_successful, a compile-time threshold assertion and
render_measurement_page mode restart. No substitution, entity or MQTT change.

Refs: infra-3rr.78

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_017fn1KdJJTY7LedVqZ7SxcA
@flowcool
flowcool merged commit a58a213 into V2R1 Oct 21, 2026
2 checks passed
@flowcool
flowcool deleted the sync/upstream-2026-10-21 branch October 21, 2026 16:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants