controller: report cooling fan RPM in CPU status

The RPi 5 fan connector exposes a tachometer via the pwmfan hwmon
device. Report it as fan_rpm in cpu_stats and show it in both the
Controller fallback UI and the React Status page. Hidden when no fan
is present.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This commit is contained in:
Roland 2026-07-23 19:42:52 -06:00 • committed by lrnselfreliance
parent f635671266
commit 42a017294e
6 changed files with 54 additions and 2 deletions

View file

@ -258,6 +258,7 @@ async def dashboard(request: Request):
"cpu": {
"percent": cpu["percent"],
"temperature_c": cpu["temperature"], # Field renamed
"fan_rpm": cpu.get("fan_rpm"),
},
"memory": {
"percent": round((memory["used"] / memory["total"]) * 100, 1) if memory["total"] > 0 else 0,