diff --git a/Cargo.lock b/Cargo.lock index d5d6de6..9ca33f6 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -239,7 +239,7 @@ checksum = "613afe47fcd5fac7ccf1db93babcb082c5994d996f20b8b159f2ad1658eb5724" [[package]] name = "charge-controller-supervisor" -version = "1.9.9-pre-29" +version = "1.9.9-pre-30" dependencies = [ "bitflags 2.7.0", "chrono", @@ -2205,7 +2205,7 @@ dependencies = [ [[package]] name = "tesla-charge-controller" -version = "1.9.9-pre-29" +version = "1.9.9-pre-30" dependencies = [ "chrono", "clap", diff --git a/Cargo.toml b/Cargo.toml index d29ed13..824a68a 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -4,7 +4,7 @@ default-members = ["charge-controller-supervisor"] resolver = "2" [workspace.package] -version = "1.9.9-pre-29" +version = "1.9.9-pre-30" [workspace.lints.clippy] pedantic = "warn" diff --git a/charge-controller-supervisor/src/controller.rs b/charge-controller-supervisor/src/controller.rs index bd28c0c..422dfb2 100644 --- a/charge-controller-supervisor/src/controller.rs +++ b/charge-controller-supervisor/src/controller.rs @@ -101,19 +101,19 @@ impl Controller { let data = self.inner.refresh().await?; if let Some(tx) = self.voltage_tx.as_mut() { - // if crate::config::access_config() - // .await - // .enable_secondary_control - // { - let target = data.common().target_voltage; - log::debug!( - "tristar {}: primary: sending target voltage {}", - self.name, - target - ); + if crate::config::access_config() + .await + .enable_secondary_control + { + let target = data.common().target_voltage; + log::debug!( + "tristar {}: primary: sending target voltage {}", + self.name, + target + ); - tx.send(VoltageCommand::Set(target))?; - // } + tx.send(VoltageCommand::Set(target))?; + } } *self.data.write_state().await = Some(data); diff --git a/charge-controller-supervisor/src/controller/tristar.rs b/charge-controller-supervisor/src/controller/tristar.rs index a0d6ace..f957a50 100644 --- a/charge-controller-supervisor/src/controller/tristar.rs +++ b/charge-controller-supervisor/src/controller/tristar.rs @@ -840,9 +840,9 @@ impl Tristar { pub async fn set_target_voltage(&mut self, target_voltage: f64) -> eyre::Result<()> { let scaled_voltage: u16 = self.scale_voltage(target_voltage); - // self.modbus - // .write_single_register(TristarRamAddress::VbRefSlave as u16, scaled_voltage) - // .await??; + self.modbus + .write_single_register(TristarRamAddress::VbRefSlave as u16, scaled_voltage) + .await??; log::debug!( "tristar {} being set to voltage {target_voltage} (scaled: {scaled_voltage:#X?})",