victron_gx/ess.rs
1use crate::traits::HandleFrame;
2
3#[derive(Debug, Clone, Default)]
4pub struct Ess {
5 /// Setpoint relative to the grid: positive imports, negative exports
6 /// The read setpoint can be different from the one that is set, as the
7 /// multiplus ramps ups the setpoint gradually
8 /// Warning: only supports single-phase (L1) for now
9 pub grid_setpoint: Option<f64>,
10}
11
12impl HandleFrame for Ess {
13 fn handle_frame(&mut self, parts: &[&str], value: Option<f64>) {
14 match parts {
15 ["L1", "AcPowerSetpoint"] => self.grid_setpoint = value,
16 _ => {
17 tracing::warn!("Unhandled Ess parts: {:?}, value: {:?}", parts, value);
18 }
19 }
20 }
21}