use synchronous call to read system time
This commit is contained in:
parent
4b968ca944
commit
d7c56585b4
15
pool.js
15
pool.js
@ -241,11 +241,7 @@ function update_temp(temp) {
|
||||
|
||||
print("[POOL] update_temp - max:", status.temp_max, "today:", status.temp_today, "yesterday:", status.temp_yesterday);
|
||||
|
||||
Shelly.call (
|
||||
"Sys.GetStatus",
|
||||
{},
|
||||
function (result) {
|
||||
let time = result.time; // "HH:MM"
|
||||
let time = Shelly.getComponentStatus("sys").time; // "HH:MM"
|
||||
print("[POOL] time", time);
|
||||
|
||||
// compute current time in float format (12h45 -> 12.75)
|
||||
@ -263,8 +259,6 @@ function update_temp(temp) {
|
||||
else {
|
||||
print("[POOL] no temp change, skip update_pump");
|
||||
}
|
||||
}
|
||||
);
|
||||
|
||||
status.lock_update = false;
|
||||
}
|
||||
@ -341,15 +335,10 @@ Timer.set(
|
||||
true,
|
||||
function() {
|
||||
status.tick++;
|
||||
Shelly.call (
|
||||
"Sys.GetStatus",
|
||||
{},
|
||||
function (result) {
|
||||
let result = Shelly.getComponentStatus("sys");
|
||||
print("[POOL] tick", result.time);
|
||||
status.time = result.time;
|
||||
status.uptime = result.uptime;
|
||||
}
|
||||
);
|
||||
}
|
||||
);
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user