Skip to content

Wave 2 #28: Networking controls (VP2430) via OpenWrt API — Controls tab - #31

Closed
bernardc6 wants to merge 1 commit into
mainfrom
feat/wave2-networking-controls-openwrt
Closed

Wave 2 #28: Networking controls (VP2430) via OpenWrt API — Controls tab#31
bernardc6 wants to merge 1 commit into
mainfrom
feat/wave2-networking-controls-openwrt

Conversation

@bernardc6

Copy link
Copy Markdown
Collaborator

Adds operator-facing Controls tab on the RoamCore Network page:

  • 3 preference buttons (Starlink / LTE / Auto) wired to
    script.rc_openwrt_prefer_{starlink,lte,auto} from
    homeassistant/packages/roamcore_openwrt_api.yaml.
  • The button matching sensor.rc_openwrt_active_wan is rendered disabled
    and styled as the current preference (✓ marker).
  • Restart Network button guarded by a native one-tap
    confirmation ('Restart the network? Connected clients will drop for
    ~30 s.') before firing script.rc_openwrt_restart_network.
  • Restart button rendered disabled unless
    binary_sensor.rc_setup_networking_safe is on.
  • binary_sensor.rc_setup_networking_safe = (sensor.rc_openwrt_internet
    == online) AND (input_boolean.rc_confirm_offline == on) — template
    sensor with proper availability.
  • input_boolean.rc_confirm_offline declared with initial: off, so the
    Restart Network button is locked by default; operator must opt in.
  • scripts/checks/openwrt-controls-smoke.sh — purely static smoke that
    asserts all 4 scripts + their aliases, the safety guard template,
    the Controls tile rendering, the confirmation flow, and
    the disabled-when-guard-off wiring.
  • scripts/check.sh — minimal unified entrypoint with --core-only,
    modelled on the Wave 2 Wave 2 #24: Automations via text/LLM/MCP (OpenClaw API v2) — apply bridge #27 reference. Chains ha-beta-smoke +
    openwrt-controls-smoke; probes the other Wave 2 smokes via
    run_if_present so the chain is portable across stacked branches.
  • docs/feature-checklist.md line 69 flipped to [x].
  • docs/mvp/features-build-status.md — Row Wave 2 #25: Advanced mode (clearly separated + safe recovery) #28 added under 'Shipped
    (repo)'.

Verification (acceptance criteria):

  1. bash scripts/check.sh --core-only exits 0.
  2. scripts/checks/openwrt-controls-smoke.sh runs and passes
    (all 4 scripts aliased, safety guard formula present, Controls tile
    present in RoamcoreNetworkPage._render() with the 4 entity ids, the
    Restart button guarded by a , and the disabled-when-off
    wiring asserted).
  3. input_boolean.rc_confirm_offline defaults to off (verified by smoke).
  4. binary_sensor.rc_setup_networking_safe documented formula matches
    the task spec (online AND opt-in).
  5. Docs landed: feature-checklist.md line 69 ticked; features-build-
    status.md Row Wave 2 #25: Advanced mode (clearly separated + safe recovery) #28 added under 'Shipped (repo)'.
  6. Existing scripts/checks/ha-beta-smoke.sh still passes unchanged.
  7. No unrelated files modified; UI patterns preserved (re-uses _tile,
    _header, _badge, _row, _getState, _isOn; no new layout primitives).

Rollback:

  • gh pr close (or revert after merge); the slice is fully
    additive — removing the new Controls tile + the input_boolean +
    the template sensor + the smoke + the check.sh orchestrator leaves
    the repo in its prior state; no HA-side data needs cleanup.

Out of scope (later slices):

Note on scripts/check.sh: this branch was forked from main 609b85a
before the Wave 2 #23-#27 stack landed upstream; scripts/check.sh
did not exist on main when this branch was cut. We introduce a
minimal version here (modelled on the Wave 2 #27 reference) so
bash scripts/check.sh --core-only runs locally as the task requires.
The chain is intentionally additive: it probes the other Wave 2
smoke scripts via run_if_present so once those PRs land on main the
full chain will work without further edits on this branch.

…ab on Network page

Adds operator-facing Controls tab on the RoamCore Network page:

- 3 preference buttons (Starlink / LTE / Auto) wired to
  script.rc_openwrt_prefer_{starlink,lte,auto} from
  homeassistant/packages/roamcore_openwrt_api.yaml.
- The button matching sensor.rc_openwrt_active_wan is rendered disabled
  and styled as the current preference (✓ marker).
- Restart Network button guarded by a native <dialog> one-tap
  confirmation ('Restart the network? Connected clients will drop for
  ~30 s.') before firing script.rc_openwrt_restart_network.
- Restart button rendered disabled unless
  binary_sensor.rc_setup_networking_safe is on.
- binary_sensor.rc_setup_networking_safe = (sensor.rc_openwrt_internet
  == online) AND (input_boolean.rc_confirm_offline == on) — template
  sensor with proper availability.
- input_boolean.rc_confirm_offline declared with initial: off, so the
  Restart Network button is locked by default; operator must opt in.
- scripts/checks/openwrt-controls-smoke.sh — purely static smoke that
  asserts all 4 scripts + their aliases, the safety guard template,
  the Controls tile rendering, the <dialog> confirmation flow, and
  the disabled-when-guard-off wiring.
- scripts/check.sh — minimal unified entrypoint with --core-only,
  modelled on the Wave 2 #27 reference. Chains ha-beta-smoke +
  openwrt-controls-smoke; probes the other Wave 2 smokes via
  run_if_present so the chain is portable across stacked branches.
- docs/feature-checklist.md line 69 flipped to [x].
- docs/mvp/features-build-status.md — Row #28 added under 'Shipped
  (repo)'.

Verification (acceptance criteria):
1. bash scripts/check.sh --core-only exits 0.
2. scripts/checks/openwrt-controls-smoke.sh runs and passes
   (all 4 scripts aliased, safety guard formula present, Controls tile
   present in RoamcoreNetworkPage._render() with the 4 entity ids, the
   Restart button guarded by a <dialog>, and the disabled-when-off
   wiring asserted).
3. input_boolean.rc_confirm_offline defaults to off (verified by smoke).
4. binary_sensor.rc_setup_networking_safe documented formula matches
   the task spec (online AND opt-in).
5. Docs landed: feature-checklist.md line 69 ticked; features-build-
   status.md Row #28 added under 'Shipped (repo)'.
6. Existing scripts/checks/ha-beta-smoke.sh still passes unchanged.
7. No unrelated files modified; UI patterns preserved (re-uses _tile,
   _header, _badge, _row, _getState, _isOn; no new layout primitives).

Rollback:
- gh pr close <num> (or revert after merge); the slice is fully
  additive — removing the new Controls tile + the input_boolean +
  the template sensor + the smoke + the check.sh orchestrator leaves
  the repo in its prior state; no HA-side data needs cleanup.

Out of scope (later slices):
- Cloud / Tailscale / remote-access surface (Wave 2 #29).
- Active WAN failover policies beyond manual preference selection.
- Persistent audit log of preference + restart actions.

Note on scripts/check.sh: this branch was forked from main 609b85a
before the Wave 2 #23-#27 stack landed upstream; scripts/check.sh
did not exist on main when this branch was cut. We introduce a
minimal version here (modelled on the Wave 2 #27 reference) so
bash scripts/check.sh --core-only runs locally as the task requires.
The chain is intentionally additive: it probes the other Wave 2
smoke scripts via run_if_present so once those PRs land on main the
full chain will work without further edits on this branch.
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.

1 participant