default state control enable
This commit is contained in:
parent
560fbf3d7a
commit
79454ff95a
2
Cargo.lock
generated
2
Cargo.lock
generated
|
@ -2256,7 +2256,7 @@ dependencies = [
|
|||
|
||||
[[package]]
|
||||
name = "tesla-charge-controller"
|
||||
version = "1.0.0-beta-1"
|
||||
version = "1.0.0-beta-2"
|
||||
dependencies = [
|
||||
"async-channel",
|
||||
"chrono",
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
[package]
|
||||
name = "tesla-charge-controller"
|
||||
version = "1.0.0-beta-1"
|
||||
version = "1.0.0-beta-2"
|
||||
edition = "2021"
|
||||
license = "MITNFA"
|
||||
description = "Controls Tesla charge rate based on solar charge data"
|
||||
|
|
|
@ -23,11 +23,19 @@ pub enum TcrcRequest {
|
|||
EnableAutomaticControl,
|
||||
}
|
||||
|
||||
#[derive(Default, Clone, Copy, Serialize, Deserialize, Debug)]
|
||||
#[derive(Clone, Copy, Serialize, Deserialize, Debug)]
|
||||
pub struct TcrcState {
|
||||
pub control_enable: bool,
|
||||
}
|
||||
|
||||
impl Default for TcrcState {
|
||||
fn default() -> Self {
|
||||
Self {
|
||||
control_enable: true,
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
impl TeslaChargeRateController {
|
||||
pub fn new(car_state: Arc<RwLock<CarState>>, pl_state: Option<Arc<RwLock<PlState>>>) -> Self {
|
||||
describe_gauge!("tcrc_control_enable", "Enable Tesla charge rate control");
|
||||
|
|
Loading…
Reference in a new issue