tesla-charge-controller/src/charge_controllers/mod.rs
2024-01-15 09:31:56 +11:00

19 lines
661 B
Rust

use metrics::{describe_gauge, Unit};
mod gauge_names;
pub mod pl;
pub fn register_metrics() {
describe_gauge!(gauge_names::BATTERY_VOLTAGE, "Battery voltage");
describe_gauge!(gauge_names::TARGET_VOLTAGE, "Target voltage");
describe_gauge!(gauge_names::INPUT_CURRENT, "Internal charge current");
describe_gauge!(gauge_names::CHARGE_STATE, "Regulator state");
describe_gauge!(gauge_names::BATTERY_TEMP, "Battery temperature");
register_pl_metrics();
}
fn register_pl_metrics() {
describe_gauge!(gauge_names::PL_DUTY_CYCLE, Unit::Percent, "Duty cycle");
describe_gauge!(gauge_names::PL_LOAD_CURRENT, "Internal load current");
}