feat(webconfig): let the portal discover board-specific CLI commands

The FEM commands moved out of CommonCLI into Board::handleCommand(), and
the T-Beam 1W fan control was added there too, but the portal never caught
up: `radio.fem.txgain` and the fan commands were missing from the terminal
table entirely, while `radio.fem.rxgain` was offered on every board even
though a board with no hook now answers "??:" rather than "unsupported".

Whether a node answers these is a property of the board, not of the build,
so the page cannot know from the firmware version. Ask the board instead:
probeBoardCommands() runs each candidate getter once on the loop task at
startup and keeps the ones that answer, which needs no per-variant list
because Board::handleCommand() already reports whether it handled a
command. /api/status names the survivors and the page hides everything
else, so adding a command to a variant means one entry in WC_BOARD_CMDS
rather than an edit per board.

The two FEM keys also become Radio-panel toggles, gated the same way;
their `set` reaches the board hook through the existing config batch, so
only the allowlist and /api/config needed to grow.

webconfig_cli_audit.py now scans variants/*/*Board.cpp for the boards that
actually build the portal, checks set-only keys in the reverse direction,
and verifies every gate is a command some board answers; the mock gained
--board-cmds so both shapes of board are testable. `stop ota` joins
NOT_OFFERED: `start ota` cannot run from the portal, so it has nothing to
stop.
This commit is contained in:
agessaman committed 2026-09-19 20:51:25 -07:00
1 parent 8c8199a2ea
commit a1f3e2c3d3
8 files changed
+319 -41

No files matched your search

+21
View File
@@ -322,6 +322,27 @@ Elsewhere it replies `Err - neighbors not enabled in this build`. If a
---
#### View the fan state, or change how it is driven, on supported boards
**Usage:**
- `get fan`
- `set fan <mode>`
- `set fan.lo <celsius>`
- `set fan.hi <celsius>`
**Parameters:**
- `mode`: `on`|`off`|`auto`
- `celsius`: `fan.lo` is 0-100 and must be below `fan.hi`; `fan.hi` is at most 120 and must be above `fan.lo`
**Default:** `auto`, with `fan.lo` 45 and `fan.hi` 60
**Notes:**
- Currently the T-Beam 1W, the only board with a fan under software control.
- `get fan` reports the mode, the measured temperature, whether the fan is running, and the remaining cooldown, e.g. `auto 52.4C fan=on cd=18s`. The temperature reads `n/a` when the NTC value is implausible.
- In `auto` the fan starts at `fan.hi` and stops at `fan.lo`; the gap between them is what keeps it from chattering around one threshold.
- `fan.lo` and `fan.hi` are set-only: `get fan` reports the mode and current state, not the thresholds.
---
### System
#### View or change this node's name