MQTT-based live CPU/RAM metrics + remove auth from HA control

- Enrich server data with MQTT system topics (cpu_usage_percent,
  ram_usage_percent, temp, model etc.) published by Unraid MQTT Agent
- Works for both Daddelolymp and Adriahub topics
- MQTT overlay runs on every request (even cached) for fresh metrics
- Remove JWT auth from /api/ha/control — local dashboard doesn't need it
- Add cpu brand field to GraphQL query

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
Sam 2026-03-02 22:41:16 +01:00
parent 94727ebe70
commit 5d3d4f4015
3 changed files with 97 additions and 6 deletions

View file

@ -17,7 +17,7 @@ _GRAPHQL_QUERY = """
online
info {
os { hostname uptime }
cpu { model cores threads }
cpu { model cores threads manufacturer brand }
memory { layout { size type } }
}
docker {
@ -72,9 +72,9 @@ def _parse_graphql_response(data: Dict[str, Any], result: Dict[str, Any]) -> Non
cpu_info = info.get("cpu", {})
result["cpu"]["cores"] = cpu_info.get("cores", 0)
# GraphQL API doesn't expose CPU usage % — keep 0
# Store threads for the frontend to show
result["cpu"]["threads"] = cpu_info.get("threads", 0)
result["cpu"]["brand"] = cpu_info.get("brand", "")
# GraphQL API doesn't expose CPU usage % — keep 0
# Memory: sum layout slots for total GB
mem_layout = info.get("memory", {}).get("layout", [])