Stop presenting stale data as live, and back off broken devices

- readings.py: PowerReadings.total now sums the known parts (None only when
  nothing is known), with a complete property saying whether it under-counts;
  the snapshot exposes it as partial and the web UI marks it with a tilde.
- display/service.py: telemetry older than 15 s is drawn as -- instead of
  re-rendering frozen readings as if they were current.
- sensors.py: Commander PRO last-known RPMs expire after 10 s instead of
  feeding the power model forever (empty list = unknown); a runtime MSR
  failure backs off 15 s instead of re-opening PawnIO every second; GPU NVML
  reconnects back off 10 s instead of nvmlInit() every second, and the
  sample-buffer timestamp resets on a driver-reset reconnect.
- control.py: CpuTemperature read failures back off 15 s instead of churning
  the MSR handle every poll.
This commit is contained in:
paul committed 2026-12-05 16:54:01 +13:00
1 parent 538a464257
commit 9036c6e734
6 files changed
+46 -7

No files matched your search

+8 -3
View File
@@ -22,6 +22,11 @@ class PowerReadings:
@property
def total(self) -> float | None:
if self.cpu is None or self.gpu is None or self.other is None:
return None
return self.cpu + self.gpu + self.other
"""The known parts summed; None only when nothing is known. While a part is missing
the total under-counts -- `complete` says so."""
known = [v for v in (self.cpu, self.gpu, self.other) if v is not None]
return sum(known) if known else None
@property
def complete(self) -> bool:
return self.cpu is not None and self.gpu is not None and self.other is not None