cleanup
This commit is contained in:
parent
5cdda39451
commit
bb10f9a9d8
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.1"
|
version = "1.0.2-prerelease"
|
||||||
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.1"
|
version = "1.0.2-prerelease"
|
||||||
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"
|
||||||
|
|
|
@ -26,14 +26,12 @@ pub enum TcrcRequest {
|
||||||
#[derive(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,
|
||||||
pub currently_controlling: bool,
|
|
||||||
}
|
}
|
||||||
|
|
||||||
impl Default for TcrcState {
|
impl Default for TcrcState {
|
||||||
fn default() -> Self {
|
fn default() -> Self {
|
||||||
Self {
|
Self {
|
||||||
control_enable: true,
|
control_enable: true,
|
||||||
currently_controlling: false,
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -27,8 +27,7 @@
|
||||||
}
|
}
|
||||||
|
|
||||||
function flash() {
|
function flash() {
|
||||||
fetch(api_url + "/flash", { method: "POST" })
|
fetch(api_url + "/flash", { method: "POST" });
|
||||||
.then((response) => console.log(response));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
function disable_automatic_control() {
|
function disable_automatic_control() {
|
||||||
|
@ -46,7 +45,6 @@
|
||||||
}
|
}
|
||||||
|
|
||||||
function update_control_buttons(data) {
|
function update_control_buttons(data) {
|
||||||
console.log(data);
|
|
||||||
var button_container = document.getElementById("buttons");
|
var button_container = document.getElementById("buttons");
|
||||||
while (button_container.childElementCount > 0) { button_container.removeChild(button_container.firstChild) }
|
while (button_container.childElementCount > 0) { button_container.removeChild(button_container.firstChild) }
|
||||||
if (data.control_enable) {
|
if (data.control_enable) {
|
||||||
|
|
Loading…
Reference in a new issue