restore temp_today from KVS at startup

This commit is contained in:
Gilles Grandou 2022-09-07 09:08:14 +02:00
parent 4d3fcd8826
commit 3096846e0d
1 changed files with 12 additions and 1 deletions

13
pool.js
View File

@ -278,7 +278,7 @@ function update_temp(temp) {
status.lock_update = false;
}
// Set initial yesterday temp from KVS
// Set initial temps from KVS
Shelly.call (
"KVS.Get",
{ key: "pool.temp_yesterday" },
@ -290,6 +290,17 @@ 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);
}
}
)
// receives update from Pool Sensor
// - trigger all temperature and pump updates