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]] [[package]]
name = "tesla-charge-controller" name = "tesla-charge-controller"
version = "1.1.2" version = "1.1.3"
dependencies = [ dependencies = [
"chrono", "chrono",
"clap 4.4.11", "clap 4.4.11",

View file

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

View file

@ -54,7 +54,7 @@ pub struct TristarState {
battery_voltage: f64, battery_voltage: f64,
target_voltage: f64, target_voltage: f64,
input_current: f64, input_current: f64,
battery_temp: f64, battery_temp: u16,
charge_state: ChargeState, charge_state: ChargeState,
tristar_input_voltage: f64, tristar_input_voltage: f64,
tristar_charge_current: f64, tristar_charge_current: f64,
@ -71,7 +71,7 @@ impl TristarState {
battery_voltage: scaling.get_voltage(ram[TristarRamAddress::AdcVbFMed]), battery_voltage: scaling.get_voltage(ram[TristarRamAddress::AdcVbFMed]),
target_voltage: scaling.get_voltage(ram[TristarRamAddress::VbRef]), target_voltage: scaling.get_voltage(ram[TristarRamAddress::VbRef]),
input_current: scaling.get_current(ram[TristarRamAddress::AdcIaFShadow]), 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]), charge_state: ChargeState::from(ram[TristarRamAddress::ChargeState]),
tristar_input_voltage: scaling.get_voltage(ram[TristarRamAddress::AdcVaF]), tristar_input_voltage: scaling.get_voltage(ram[TristarRamAddress::AdcVaF]),
tristar_charge_current: scaling.get_current(ram[TristarRamAddress::AdcIbFShadow]), tristar_charge_current: scaling.get_current(ram[TristarRamAddress::AdcIbFShadow]),
@ -267,7 +267,7 @@ impl Tristar {
.set(new_state.input_current); .set(new_state.input_current);
BATTERY_TEMP BATTERY_TEMP
.with_label_values(&[&self.port_name]) .with_label_values(&[&self.port_name])
.set(new_state.battery_temp); .set(new_state.battery_temp.into());
TRISTAR_INPUT_VOLTAGE TRISTAR_INPUT_VOLTAGE
.with_label_values(&[&self.port_name]) .with_label_values(&[&self.port_name])
.set(new_state.tristar_input_voltage); .set(new_state.tristar_input_voltage);