feat: native WireView Pro II monitoring (detection, serial protocol, live tab)

Standalone support for the ThermalGrizzly WireView Pro II without
depending on the external wireview_reporter exporter:

- wireview.py: serial protocol (STX/ETX + 16-bit CRC16-CCITT) with
  vendor-data product identification, config version, UID, build
  string, screen layout, and temperature/power/current sensor reads;
  hwmon fallback with per-channel index resolution; udev-based
  detection (vendor 0x2560 / product 0x0101) with fallback port
  probing; serial read timeout and watchdog reconnect
- server.py: startup detection (root only), 1 Hz poller gated on
  subscribed clients, WS 'wireview' channel, GET /api/wireview,
  rejected-product memoization, stale-read race guard
- frontend: WireView tab (visible when a device is detected) with
  live temperature/power/current cards, sparkline history, and
  device info; nullable temp channels
- tests: 76 tests covering parser, CRC, fault classification,
  hwmon resolution, JSON safety, and the serial transport against
  a pty-based fake device

Verified live: tab appears with the device connected, disappears
when unplugged, reconnects on re-plug, no serial traffic when idle.
This commit is contained in:
ARIA committed 2026-10-03 13:20:56 +02:00
1 parent cc102f26c1
commit 526b71b45f
10 files changed
+1792 -1

No files matched your search

+47
View File
@@ -145,3 +145,50 @@ export interface ProfileData {
fan_curve: FanPoint[] | null;
fan_targets: number[] | null;
}
// ── WireView Pro II (Thermal Grizzly 12 VHPWR connector monitor) ──
export interface WireViewPin {
voltage_v: number;
current_a: number;
power_w: number;
}
export interface WireViewSample {
timestamp: number;
power_total_w: number;
current_total_a: number;
voltage_avg_v: number;
pins: WireViewPin[];
// Temperatures are null when the source has no channel for them
// (e.g. an hwmon module without external-sensor channels).
temp_in_c: number | null;
temp_out_c: number | null;
temp_ext1_c: number | null;
temp_ext2_c: number | null;
fan_duty_pct: number;
fault_status: number;
fault_log: number;
psu_capability_w: number;
}
export interface WireViewInfo {
device_name: string;
hw_rev: string;
firmware_version: string;
uid: string;
build: string;
transport: "serial" | "hwmon";
port: string;
}
export interface WireViewState {
available: boolean;
connected: boolean;
info: WireViewInfo | null;
sample: WireViewSample | null;
}
export type WireViewWsMessage =
| { type: "unavailable" }
| { type: "sample"; info: WireViewInfo; sample: WireViewSample };