From f4bea57723c755783ebe4802b204637cb5152f07 Mon Sep 17 00:00:00 2001 From: Alex Janka Date: Wed, 10 Jan 2024 15:48:59 +1100 Subject: [PATCH] cooked it lol --- Cargo.lock | 2 +- Cargo.toml | 2 +- src/pl_interface.rs | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 4e2a305..98c83b5 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -2262,7 +2262,7 @@ dependencies = [ [[package]] name = "tesla-charge-controller" -version = "0.1.10-prerelease" +version = "0.1.10" dependencies = [ "anyhow", "async-channel", diff --git a/Cargo.toml b/Cargo.toml index 6a4e459..7d1f506 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "tesla-charge-controller" -version = "0.1.10-prerelease" +version = "0.1.10" edition = "2021" license = "MITNFA" description = "Controls Tesla charge rate based on solar charge data" diff --git a/src/pl_interface.rs b/src/pl_interface.rs index 2a3f8a6..4a1321f 100644 --- a/src/pl_interface.rs +++ b/src/pl_interface.rs @@ -30,7 +30,7 @@ impl Pli { pub fn refresh(&mut self) { if let Ok(batv) = self.read_ram(50) { - self.voltage_gauge.set(((batv * 4) as f64) / 10.); + self.voltage_gauge.set((batv as f64) * (4. / 10.)); } if let Ok(duty_cycle) = self.read_ram(39) { self.duty_cycle.set((duty_cycle as f64) / 255.);