Add per-enclosure temperature metrics + Home Assistant MQTT publisher

- enclosure: fetch SES element descriptor page (0x07) and label temp/fan/
  psu/voltage elements with human-readable names
- temps service + /api/temps: per-enclosure hotspot (max across SES sensors
  and housed drive temps) plus named SES sensor list
- mqtt_publisher: paho-mqtt with HA discovery (device per enclosure, hotspot
  + per-sensor entities), LWT availability, opt-in via MQTT_HOST
- secrets: OpenBao KV v2 reader; MQTT creds sourced from secret/home_assistant
  with env fallback
- compose/requirements/README updated
This commit is contained in:
2026-06-16 04:45:32 +00:00
parent 50dd2a631e
commit d41e3838d5
11 changed files with 591 additions and 10 deletions

12
routers/temps.py Normal file
View File

@@ -0,0 +1,12 @@
from fastapi import APIRouter
from models.schemas import TempSnapshot
from services.temps import build_temp_snapshot
router = APIRouter(prefix="/api/temps", tags=["temps"])
@router.get("", response_model=TempSnapshot)
async def get_temps():
"""Per-enclosure temperature snapshot: named SES sensors + hotspot."""
return await build_temp_snapshot()