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]]
|
[[package]]
|
||||||
name = "tesla-charge-controller"
|
name = "tesla-charge-controller"
|
||||||
version = "1.0.0-beta-1"
|
version = "1.0.0-beta-2"
|
||||||
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.0-beta-1"
|
version = "1.0.0-beta-2"
|
||||||
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"
|
||||||
|
|
|
@ -23,11 +23,19 @@ pub enum TcrcRequest {
|
||||||
EnableAutomaticControl,
|
EnableAutomaticControl,
|
||||||
}
|
}
|
||||||
|
|
||||||
#[derive(Default, Clone, Copy, Serialize, Deserialize, Debug)]
|
#[derive(Clone, Copy, Serialize, Deserialize, Debug)]
|
||||||
pub struct TcrcState {
|
pub struct TcrcState {
|
||||||
pub control_enable: bool,
|
pub control_enable: bool,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
impl Default for TcrcState {
|
||||||
|
fn default() -> Self {
|
||||||
|
Self {
|
||||||
|
control_enable: true,
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
impl TeslaChargeRateController {
|
impl TeslaChargeRateController {
|
||||||
pub fn new(car_state: Arc<RwLock<CarState>>, pl_state: Option<Arc<RwLock<PlState>>>) -> Self {
|
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");
|
describe_gauge!("tcrc_control_enable", "Enable Tesla charge rate control");
|
||||||
|
|
Loading…
Reference in a new issue