restore temp_today from KVS at startup
This commit is contained in:
parent
4d3fcd8826
commit
3096846e0d
13
pool.js
13
pool.js
@ -278,7 +278,7 @@ function update_temp(temp) {
|
|||||||
status.lock_update = false;
|
status.lock_update = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Set initial yesterday temp from KVS
|
// Set initial temps from KVS
|
||||||
Shelly.call (
|
Shelly.call (
|
||||||
"KVS.Get",
|
"KVS.Get",
|
||||||
{ key: "pool.temp_yesterday" },
|
{ 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
|
// receives update from Pool Sensor
|
||||||
// - trigger all temperature and pump updates
|
// - trigger all temperature and pump updates
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user