From 9bee9f93a270496dc65d4f2d72383d7923a76b27 Mon Sep 17 00:00:00 2001 From: Alex Janka Date: Mon, 22 Jan 2024 14:20:13 +1100 Subject: [PATCH] very very stupid mistake LMAO --- Cargo.lock | 2 +- Cargo.toml | 2 +- src/tesla_charge_rate.rs | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 7eb0b83..0f0e9a3 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -2573,7 +2573,7 @@ dependencies = [ [[package]] name = "tesla-charge-controller" -version = "1.0.17" +version = "1.0.18" dependencies = [ "async-channel", "chrono", diff --git a/Cargo.toml b/Cargo.toml index af0d477..fa84e5e 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "tesla-charge-controller" -version = "1.0.17" +version = "1.0.18" edition = "2021" license = "MITNFA" description = "Controls Tesla charge rate based on solar charge data" diff --git a/src/tesla_charge_rate.rs b/src/tesla_charge_rate.rs index c86be13..796226a 100644 --- a/src/tesla_charge_rate.rs +++ b/src/tesla_charge_rate.rs @@ -107,7 +107,7 @@ impl PidLoop { charge_state: &ChargeState, delta_time: f64, ) -> Option { - let error = pl_state.target_voltage - pl_state.battery_voltage; + let error = pl_state.battery_voltage - pl_state.target_voltage; let derivative = (error - self.previous_error) / delta_time; let config = access_config(); let extra_offsets = if pl_state.internal_load_current > 1. {