allow higher max charge rate
All checks were successful
Build .deb on release / Build-Deb (push) Successful in 1m59s

This commit is contained in:
Alex Janka 2024-04-08 13:38:32 +10:00
parent 327851afaa
commit 3356974da9
4 changed files with 5 additions and 5 deletions

2
Cargo.lock generated
View file

@ -2538,7 +2538,7 @@ dependencies = [
[[package]] [[package]]
name = "tesla-charge-controller" name = "tesla-charge-controller"
version = "1.2.5" version = "1.2.6"
dependencies = [ dependencies = [
"chrono", "chrono",
"clap 4.4.11", "clap 4.4.11",

View file

@ -1,6 +1,6 @@
[package] [package]
name = "tesla-charge-controller" name = "tesla-charge-controller"
version = "1.2.5" version = "1.2.6"
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

@ -177,7 +177,7 @@ async fn shutoff_status() -> Json<ShutoffStatus> {
#[post("/set-max/<limit>")] #[post("/set-max/<limit>")]
async fn set_max(limit: i64, remote_addr: std::net::IpAddr) { async fn set_max(limit: i64, remote_addr: std::net::IpAddr) {
log::warn!("setting max: {remote_addr:?}"); log::warn!("setting max: {remote_addr:?}");
let limit = limit.clamp(access_config().min_rate, 15); let limit = limit.clamp(access_config().min_rate, 32);
write_to_config().max_rate = limit; write_to_config().max_rate = limit;
} }

View file

@ -23,10 +23,10 @@
<div id="rate-control"> <div id="rate-control">
<h3>Charge rate:</h3> <h3>Charge rate:</h3>
<input type="number" id="max-rate" max="15" min="0" onchange="change_max()" autocomplete="off" /> <input type="number" id="max-rate" max="32" min="0" onchange="change_max()" autocomplete="off" />
<button id="set-maximum" onclick="set_maximum()" disabled>Set maximum</button> <button id="set-maximum" onclick="set_maximum()" disabled>Set maximum</button>
<br><br> <br><br>
<input type="number" id="min-rate" max="15" min="0" onchange="change_min()" autocomplete="off" /> <input type="number" id="min-rate" max="32" min="0" onchange="change_min()" autocomplete="off" />
<button id="set-minimum" onclick="set_minimum()" disabled>Set minimum</button> <button id="set-minimum" onclick="set_minimum()" disabled>Set minimum</button>
</div> </div>
<div id="info"></div> <div id="info"></div>