Compare commits

..

No commits in common. "13e59a2615e35497f7e2ef1b4289bd0a2d4976bc" and "60a82354e128ea102f0f838127ee5cc05a003df8" have entirely different histories.

4 changed files with 3 additions and 67 deletions

View File

@ -1,13 +0,0 @@
#!/bin/bash
source $(dirname $0)/shelly.conf
if [ $# -ne 1 ]; then
echo "usage: $0 <key> <value>"
exit 1
fi
key=$1
curl -s $SHELLY_RPC/KVS.Delete'?key="'$key'"' | jq .

View File

@ -1,6 +0,0 @@
#!/bin/bash
source $(dirname $0)/shelly.conf
curl -s $SHELLY_RPC/KVS.GetMany'?key="*"' | jq .

14
kvs_set
View File

@ -1,14 +0,0 @@
#!/bin/bash
source $(dirname $0)/shelly.conf
if [ $# -ne 2 ]; then
echo "usage: $0 <key> <value>"
exit 1
fi
key=$1
value=$2
curl -s $SHELLY_RPC/KVS.Set'?key="'$key'"&value='$value'' | jq .

37
pool.js
View File

@ -107,14 +107,7 @@ function update_new_day() {
"KVS.Set",
{ key: "pool.temp_yesterday", value: status.temp_yesterday },
function (result) {
print("[POOL] KVS set temp_yesterday: ", JSON.stringify(result));
}
);
Shelly.call(
"KVS.Set",
{ key: "pool.temp_today", value: null },
function (result) {
print("[POOL] KVS set temp_today: ", JSON.stringify(result));
print("[POOL] KVS set: ", JSON.stringify(result));
}
);
}
@ -227,18 +220,7 @@ function update_temp(temp) {
status.lock_update = true;
status.temp = Math.round(temp * 10) / 10;
if (status.temp > status.temp_today || status.temp_today === null) {
status.temp_today = status.temp;
Shelly.call (
"KVS.Set",
{ key: "pool.temp_today", value: status.temp_today },
function (result) {
print("[POOL] KVS set temp_today: ", JSON.stringify(result));
}
);
}
status.temp_today = Math.max(status.temp_today, status.temp);
status.temp_max = Math.max(status.temp_today, status.temp_yesterday);
print("[POOL] update_temp - max:", status.temp_max, "today:", status.temp_today, "yesterday:", status.temp_yesterday);
@ -278,7 +260,7 @@ function update_temp(temp) {
status.lock_update = false;
}
// Set initial temps from KVS
// Set initial yesterday temp from KVS
Shelly.call (
"KVS.Get",
{ key: "pool.temp_yesterday" },
@ -290,19 +272,6 @@ Shelly.call (
}
)
Shelly.call (
"KVS.Get",
{ key: "pool.temp_today" },
function (result) {
if (result) {
status.temp_today = result.value;
print("[POOL] Restore from KVS: temp_today:", status.temp_today);
if (status.temp_today !== null)
update_temp(status.temp_today);
}
}
)
// receives update from Pool Sensor
// - trigger all temperature and pump updates