Compare commits
3 Commits
8ad19d84e2
...
f98edbb8d6
| Author | SHA1 | Date | |
|---|---|---|---|
| f98edbb8d6 | |||
| 0c175b4a8e | |||
| f9a579529b |
15
pool.js
15
pool.js
@@ -72,17 +72,18 @@ function compute_filtration_time(t) {
|
||||
// [ start1, stop1, start2, stop2, ... ]
|
||||
|
||||
function compute_schedule_filt(d) {
|
||||
let start = 17 - d/2;
|
||||
let stop = 17 + d/2;
|
||||
let t_start = 17 - d/2;
|
||||
let t_stop = 17 + d/2;
|
||||
|
||||
while (stop >= 24)
|
||||
stop = stop - 24;
|
||||
while (t_stop >= 24)
|
||||
t_stop = t_stop - 24;
|
||||
|
||||
let s;
|
||||
if (d < 24) {
|
||||
let s = [ start, stop ];
|
||||
s = [ t_start, t_stop ];
|
||||
}
|
||||
else {
|
||||
let s = [ start ];
|
||||
s = [ t_start ];
|
||||
}
|
||||
|
||||
return s;
|
||||
@@ -183,7 +184,7 @@ function update_pump(temp, max, time) {
|
||||
}
|
||||
|
||||
// compute the current switch state according to the schedule
|
||||
let on = false;
|
||||
on = false;
|
||||
if (schedule.length === 1) {
|
||||
on = true;
|
||||
}
|
||||
|
||||
@@ -2,4 +2,6 @@
|
||||
|
||||
source $(dirname $0)/shelly.conf
|
||||
|
||||
curl -s "$SHELLY_RPC/Script.Stop?id=$SCRIPT_ID" | jq .
|
||||
$ROOT_DIR/put_script $SHELLY_HOST $SCRIPT_ID $ROOT_DIR/$SCRIPT_FILENAME
|
||||
curl -s "$SHELLY_RPC/Script.Start?id=$SCRIPT_ID" | jq .
|
||||
|
||||
Reference in New Issue
Block a user