Wave 2 #28 (replay): Networking controls (VP2430) via OpenWrt API — Controls tab + Restart safety guard - #98
Open
bernardc6 wants to merge 1 commit into
Open
Conversation
…ab + Restart safety guard Context ======= PR #31 was opened on 2026-07-29 with this exact slice but branched off an old main (609b85a) that pre-dated the Wave 2 #23-#27 stack. The branch fell 76 commits behind main and became unmergeable in its original form. This commit replays the same slice as a single additive commit onto current main (d3d596b) so PR #31 can be replaced and the slice can finally ship. Operators land on the Network page, see a Controls tile, and can switch the WAN preference or restart the network — guarded by a native <dialog> confirmation that only unlocks when the OpenWrt API reports internet online AND the operator has opted in via input_boolean.rc_confirm_offline. Changes (5 files, +323/-1) ========================== 1. homeassistant/packages/roamcore_openwrt_api.yaml (+50) - input_boolean.rc_confirm_offline (initial: off) - template.binary_sensor.rc_setup_networking_safe = (sensor.rc_openwrt_internet == 'online') AND (input_boolean.rc_confirm_offline == 'on') with proper availability guard. 2. homeassistant/www/roamcore/roamcore-pages.js (+110) - RoamcoreNetworkPage._render() gains a Controls tile: * 3 preference buttons (Starlink / LTE / Auto) wired to script.rc_openwrt_prefer_{starlink,lte,auto}; the button matching sensor.rc_openwrt_active_wan is rendered disabled and styled as the current preference. * Restart Network button — rendered disabled unless binary_sensor.rc_setup_networking_safe is on. * Native <dialog> one-tap confirmation before firing script.rc_openwrt_restart_network ("Restart the network? Connected clients will drop for ~30 s."). - Event handlers bound with addEventListener (CSP-friendly). 3. scripts/checks/openwrt-controls-smoke.sh (+162, new) - Purely static smoke. Asserts: * all 4 scripts declared with their documented alias * input_boolean.rc_confirm_offline defaults off * template.binary_sensor.rc_setup_networking_safe present with documented formula * Controls tile references all 4 script entity ids * Restart confirmation uses <dialog> element * Restart button disabled when guard is off - Wired into scripts/check.sh via run_if_present at line 67. 4. docs/feature-checklist.md (+1/-1) - Line 69: [ ] Networking controls (VP2430) via OpenWrt API → [x] ... (slice #28, with a back-link to the slice). 5. docs/mvp/features-build-status.md (+8) - Row #28 added under "Shipped (repo)": HA package + 4 scripts + safety guard + UI tile + smoke + branch. Verification ============ 1. bash scripts/checks/openwrt-controls-smoke.sh → All 10 assertions PASS. 2. bash scripts/check.sh --core-only → exit 0 (all 21+ connection manifests + ha-beta-smoke + openwrt-controls-smoke + imagebuilder-smoke + docs-link-integrity pass). 3. JS pattern preserved: re-uses _tile(), _header(), _badge(), _row(), _getState(), _isOn(); no new layout primitives; no new inline onclick handlers (CSP-friendly addEventListener binding). 4. Tier discipline: HA package additions are tier-a native (RoamCore owns the script + template + UI wiring); user-facing doc updated without exposing internal protocol details. 5. Plain-English errors: the <dialog> copy says "Connected clients will drop for ~30 s" not "OpenWrt ubus call netifd restart failed". 6. Idempotent: re-applying the slice produces the same end state — no migrations, no state files, no coordination required. Rollback ======== - gh pr close 31 (or revert after merge); the slice is fully additive — removing the Controls tile + the input_boolean + the template sensor + the smoke leaves the repo in its prior state; no HA-side data needs cleanup. Out of scope (separate slices) ============================== - Persistent audit log of preference + restart actions (Gate D). - Active WAN failover policies beyond manual preference selection. - Wave 2 #29 cloud/Tailscale/remote-access surface. Supersedes ========== PR #31 (ebc87d8) — that PR branched off stale main; the slice itself is preserved verbatim here on current main. The push of this branch will close PR #31 and open PR #<new>.
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.
Wave 2 #28: Networking controls (VP2430) via OpenWrt API — Controls tab + Restart safety guard
Adds an operator-facing Controls tile to the RoamCore Network page. The slice ships the same intent as the original PR #31 (ebc87d8, opened 2026-07-29) but rebased cleanly onto current main so it's actually mergeable.
Why a new branch instead of fixing PR #31: the original branch was forked from an old main (609b85a, pre-Wave 2 #23-#27 stack) and is now 76 commits behind. The slice itself is fully additive (no cross-cutting rewrites) so the cleanest fix is one fresh commit on current main. This PR supersedes #31.
What's in it
homeassistant/packages/roamcore_openwrt_api.yamlinput_boolean.rc_confirm_offline(defaults OFF) +template.binary_sensor.rc_setup_networking_safe(online AND opt-in)homeassistant/www/roamcore/roamcore-pages.jsscript.rc_openwrt_prefer_{starlink,lte,auto}; Restart Network button disabled by default; native<dialog>one-tap confirmationscripts/checks/openwrt-controls-smoke.shscripts/check.shviarun_if_presentat line 67docs/feature-checklist.mddocs/mvp/features-build-status.mdTotal: 5 files / +331 / -1.
Acceptance criteria
rc_confirm_offline=off); operator must opt in to unlock it.<dialog>("Restart the network? Connected clients will drop for ~30 s.") before invokingscript.rc_openwrt_restart_network— no surprise reboots.bash scripts/checks/openwrt-controls-smoke.sh→ 10/10 PASS.bash scripts/check.sh --core-only→ exit 0 (no regressions across 21+ connection manifests + ha-beta-smoke + imagebuilder-smoke + docs-link-integrity).<dialog>body says "Connected clients will drop for ~30 s" — not "ubus netifd restart failure".addEventListenerwiring (no inlineonclick)._tile(),_header(),_badge(),_row(),_getState(),_isOn(); no new layout primitives.Out of scope (separate slices)
Rollback
gh pr close <num>(or revert after merge). The slice is fully additive — removing the Controls tile + theinput_boolean+ the template sensor + the smoke leaves the repo in its prior state; no HA-side data needs cleanup.