v1.9.9-pre-30: revert always send voltages
All checks were successful
Build and release .deb / Release (push) Successful in 54s

This commit is contained in:
Alex Janka 2025-01-16 11:30:22 +11:00
parent cec26d8cfb
commit ab3cd28f83
4 changed files with 18 additions and 18 deletions

4
Cargo.lock generated
View file

@ -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",

View file

@ -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"

View file

@ -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);

View file

@ -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?})",