Round 17 R5/G15. asic-rs had no PSU telemetry. Adds an optional PsuInfo to MinerData (model, version, rated voltage min/max, live output voltage/current), a DataField::Psu, and a default parse_psu backends override (patch 0018). ePIC populates it by merging the summary "Power Supply Stats" with the capabilities "Psu Info". GUI: three new columns -- "PSU version", "PSU Vmin", "PSU Vmax" (Hardware group in the picker) -- and the R2 power tooltip now shows the PSU output voltage (and amperage when the firmware reports a non-zero current; ePIC leaves current 0, so it shows just the voltage). Verified live on ePIC S19j Pro (10.4.1.6/.10): model 117, fw 22, Vmin 11.877 V, Vmax 15.182 V, output ~13.2 V. 8 model tests + 18 ePIC backend tests + SELFTEST pass. Non-ePIC firmware leave the PSU fields blank until they add parse_psu. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Djv3oncM4LxTS5tb61Ako6
31 lines
1.3 KiB
Rust
31 lines
1.3 KiB
Rust
//! Power-supply (PSU) information reported by a miner's firmware.
|
|
//!
|
|
//! A backend fills in only what its firmware actually exposes; every field is
|
|
//! optional. Some firmware reports the PSU's identity and rated voltage envelope
|
|
//! (min/max output voltage), others also report the live output voltage and
|
|
//! current. Voltages are in volts and currents in amps.
|
|
|
|
#[cfg(feature = "python")]
|
|
use pyo3::pyclass;
|
|
use serde::{Deserialize, Serialize};
|
|
use ts_rs::TS;
|
|
|
|
/// Power-supply identity and voltage telemetry for one miner.
|
|
#[cfg_attr(feature = "python", pyclass(from_py_object, module = "asic_rs"))]
|
|
#[cfg_attr(feature = "python", asic_rs_pydantic::py_pydantic_model(getters))]
|
|
#[derive(Debug, Clone, PartialEq, Serialize, Deserialize, Default, TS)]
|
|
pub struct PsuInfo {
|
|
/// PSU model / type identifier, when reported.
|
|
pub model: Option<String>,
|
|
/// PSU firmware/hardware version, when reported.
|
|
pub version: Option<String>,
|
|
/// Minimum rated output voltage in volts, when reported.
|
|
pub voltage_min: Option<f64>,
|
|
/// Maximum rated output voltage in volts, when reported.
|
|
pub voltage_max: Option<f64>,
|
|
/// Live output voltage in volts, when reported.
|
|
pub output_voltage: Option<f64>,
|
|
/// Live output current in amps, when reported.
|
|
pub output_current: Option<f64>,
|
|
}
|