From 016d1cf5cede926ea59e485e1b856fc6487869f6 Mon Sep 17 00:00:00 2001 From: Gilles Grandou Date: Thu, 1 Sep 2022 22:27:02 +0200 Subject: [PATCH] at startup, restore temp_yesterday from KVS --- pool.js | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/pool.js b/pool.js index 6cb7f52..62933f8 100644 --- a/pool.js +++ b/pool.js @@ -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