at startup, restore temp_yesterday from KVS

This commit is contained in:
Gilles Grandou 2022-09-01 22:27:02 +02:00
parent 3da8b1c4d5
commit 016d1cf5ce
1 changed files with 12 additions and 0 deletions

12
pool.js
View File

@ -250,6 +250,18 @@ function update_temp(temp) {
status.lock_update = false;
}
// Set initial yesterday temp from KVS
Shelly.call (
"KVS.Get",
{ key: "pool.temp_yesterday" },
function (result) {
if (result) {
status.temp_yesterday = result.value;
print("[POOL] Restore from KVS: temp_yesterday:", status.temp_yesterday);
}
}
)
// receives update from Pool Sensor
// - trigger all temperature and pump updates