This commit is contained in:
Alex Janka 2024-01-17 09:18:49 +11:00
parent 5cdda39451
commit bb10f9a9d8
4 changed files with 3 additions and 7 deletions

2
Cargo.lock generated
View file

@ -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",

View file

@ -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"

View file

@ -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,
} }
} }
} }

View file

@ -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) {