diff --git a/src/thermostat/thermostat.rs b/src/thermostat/thermostat.rs index 322694e..5922991 100644 --- a/src/thermostat/thermostat.rs +++ b/src/thermostat/thermostat.rs @@ -6,6 +6,7 @@ use crate::thermostat::max1968::{MAX1968, AdcReadTarget, PwmPinsEnum}; use crate::thermostat::ad7172; use crate::thermostat::pid_state::{PidState, PidSettings}; use crate::thermostat::steinhart_hart; +use serde::{Deserialize, Serialize}; use idsp::iir::Pid; use log::debug; use uom::si::{ @@ -276,6 +277,7 @@ impl Thermostat{ pub fn get_status_report(&mut self) -> StatusReport { StatusReport { + ts: sys_timer::now(), pid_engaged: self.get_pid_engaged(), temperature: self.pid_ctrl_ch0.get_temperature(), i_set: self.tec_setting.i_set, @@ -337,8 +339,9 @@ impl Thermostat{ } } -#[derive(Tree, Debug)] +#[derive(Deserialize, Serialize, Copy, Clone, Debug, Default, Tree)] pub struct StatusReport { + ts: u32, pid_engaged: bool, temperature: Option, i_set: ElectricCurrent,