temp bro
All checks were successful
Build .deb on release / Build-Deb (push) Successful in 1m53s

This commit is contained in:
Alex Janka 2024-01-28 12:03:14 +11:00
parent 0f69702474
commit 45f3ac1b47
3 changed files with 5 additions and 5 deletions

2
Cargo.lock generated
View file

@ -2554,7 +2554,7 @@ dependencies = [
[[package]]
name = "tesla-charge-controller"
version = "1.1.2"
version = "1.1.3"
dependencies = [
"chrono",
"clap 4.4.11",

View file

@ -1,6 +1,6 @@
[package]
name = "tesla-charge-controller"
version = "1.1.2"
version = "1.1.3"
edition = "2021"
license = "MITNFA"
description = "Controls Tesla charge rate based on solar charge data"

View file

@ -54,7 +54,7 @@ pub struct TristarState {
battery_voltage: f64,
target_voltage: f64,
input_current: f64,
battery_temp: f64,
battery_temp: u16,
charge_state: ChargeState,
tristar_input_voltage: f64,
tristar_charge_current: f64,
@ -71,7 +71,7 @@ impl TristarState {
battery_voltage: scaling.get_voltage(ram[TristarRamAddress::AdcVbFMed]),
target_voltage: scaling.get_voltage(ram[TristarRamAddress::VbRef]),
input_current: scaling.get_current(ram[TristarRamAddress::AdcIaFShadow]),
battery_temp: half::f16::from_bits(ram[TristarRamAddress::Tbatt]).to_f64() * 512.,
battery_temp: ram[TristarRamAddress::Tbatt],
charge_state: ChargeState::from(ram[TristarRamAddress::ChargeState]),
tristar_input_voltage: scaling.get_voltage(ram[TristarRamAddress::AdcVaF]),
tristar_charge_current: scaling.get_current(ram[TristarRamAddress::AdcIbFShadow]),
@ -267,7 +267,7 @@ impl Tristar {
.set(new_state.input_current);
BATTERY_TEMP
.with_label_values(&[&self.port_name])
.set(new_state.battery_temp);
.set(new_state.battery_temp.into());
TRISTAR_INPUT_VOLTAGE
.with_label_values(&[&self.port_name])
.set(new_state.tristar_input_voltage);