version bump + more climate data
This commit is contained in:
parent
826918d67a
commit
e7cacafa52
2
Cargo.lock
generated
2
Cargo.lock
generated
|
@ -2567,7 +2567,7 @@ dependencies = [
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "tesla-charge-controller"
|
name = "tesla-charge-controller"
|
||||||
version = "1.0.7-prerelease"
|
version = "1.0.7"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"async-channel",
|
"async-channel",
|
||||||
"chrono",
|
"chrono",
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
[package]
|
[package]
|
||||||
name = "tesla-charge-controller"
|
name = "tesla-charge-controller"
|
||||||
version = "1.0.7-prerelease"
|
version = "1.0.7"
|
||||||
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"
|
||||||
|
|
|
@ -29,6 +29,9 @@ struct Metrics {
|
||||||
climate_on: Gauge,
|
climate_on: Gauge,
|
||||||
preconditioning: Gauge,
|
preconditioning: Gauge,
|
||||||
remote_heater_control_enabled: Gauge,
|
remote_heater_control_enabled: Gauge,
|
||||||
|
is_auto_conditioning_on: Gauge,
|
||||||
|
driver_temp_setting: Gauge,
|
||||||
|
passenger_temp_setting: Gauge,
|
||||||
tesla_online: Gauge,
|
tesla_online: Gauge,
|
||||||
charging_state: ChargingStateGauges,
|
charging_state: ChargingStateGauges,
|
||||||
}
|
}
|
||||||
|
@ -60,6 +63,12 @@ impl Metrics {
|
||||||
"Remote heater control enabled"
|
"Remote heater control enabled"
|
||||||
);
|
);
|
||||||
let remote_heater_control_enabled = gauge!("tesla_remote_heater_control_enabled");
|
let remote_heater_control_enabled = gauge!("tesla_remote_heater_control_enabled");
|
||||||
|
describe_gauge!("tesla_is_auto_conditioning_on", "Auto conditioning on");
|
||||||
|
let is_auto_conditioning_on = gauge!("tesla_is_auto_conditioning_on");
|
||||||
|
describe_gauge!("tesla_driver_temp_setting", "Driver temp");
|
||||||
|
let driver_temp_setting = gauge!("tesla_driver_temp_setting");
|
||||||
|
describe_gauge!("tesla_passenger_temp_setting", "Passenger temp");
|
||||||
|
let passenger_temp_setting = gauge!("tesla_passenger_temp_setting");
|
||||||
describe_gauge!("tesla_online", "Tesla online");
|
describe_gauge!("tesla_online", "Tesla online");
|
||||||
let tesla_online = gauge!("tesla_online");
|
let tesla_online = gauge!("tesla_online");
|
||||||
describe_gauge!("tesla_charging_state", "Tesla charging state");
|
describe_gauge!("tesla_charging_state", "Tesla charging state");
|
||||||
|
@ -77,6 +86,9 @@ impl Metrics {
|
||||||
climate_on,
|
climate_on,
|
||||||
preconditioning,
|
preconditioning,
|
||||||
remote_heater_control_enabled,
|
remote_heater_control_enabled,
|
||||||
|
is_auto_conditioning_on,
|
||||||
|
driver_temp_setting,
|
||||||
|
passenger_temp_setting,
|
||||||
tesla_online,
|
tesla_online,
|
||||||
charging_state,
|
charging_state,
|
||||||
}
|
}
|
||||||
|
@ -301,6 +313,15 @@ impl TeslaInterface {
|
||||||
self.metrics
|
self.metrics
|
||||||
.remote_heater_control_enabled
|
.remote_heater_control_enabled
|
||||||
.set(bf(new_climate_state.remote_heater_control_enabled));
|
.set(bf(new_climate_state.remote_heater_control_enabled));
|
||||||
|
self.metrics
|
||||||
|
.is_auto_conditioning_on
|
||||||
|
.set(bf(new_climate_state.is_auto_conditioning_on));
|
||||||
|
self.metrics
|
||||||
|
.driver_temp_setting
|
||||||
|
.set(new_climate_state.driver_temp_setting);
|
||||||
|
self.metrics
|
||||||
|
.passenger_temp_setting
|
||||||
|
.set(new_climate_state.passenger_temp_setting);
|
||||||
|
|
||||||
state.climate_state = Some(new_climate_state);
|
state.climate_state = Some(new_climate_state);
|
||||||
}
|
}
|
||||||
|
|
|
@ -27,6 +27,9 @@ pub struct ClimateState {
|
||||||
pub climate_on: bool,
|
pub climate_on: bool,
|
||||||
pub preconditioning: bool,
|
pub preconditioning: bool,
|
||||||
pub remote_heater_control_enabled: bool,
|
pub remote_heater_control_enabled: bool,
|
||||||
|
pub is_auto_conditioning_on: bool,
|
||||||
|
pub driver_temp_setting: f64,
|
||||||
|
pub passenger_temp_setting: f64,
|
||||||
}
|
}
|
||||||
|
|
||||||
impl TryFrom<teslatte::vehicles::ClimateState> for ClimateState {
|
impl TryFrom<teslatte::vehicles::ClimateState> for ClimateState {
|
||||||
|
@ -40,6 +43,9 @@ impl TryFrom<teslatte::vehicles::ClimateState> for ClimateState {
|
||||||
climate_on: value.is_climate_on,
|
climate_on: value.is_climate_on,
|
||||||
preconditioning: value.is_preconditioning,
|
preconditioning: value.is_preconditioning,
|
||||||
remote_heater_control_enabled: value.remote_heater_control_enabled,
|
remote_heater_control_enabled: value.remote_heater_control_enabled,
|
||||||
|
is_auto_conditioning_on: value.is_auto_conditioning_on.unwrap_or(false),
|
||||||
|
driver_temp_setting: value.driver_temp_setting,
|
||||||
|
passenger_temp_setting: value.passenger_temp_setting,
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue