From 03fbd4c08abcc6cfa1f9e25c1868af1cb786776f Mon Sep 17 00:00:00 2001 From: Stiralbios Date: Sat, 18 Jun 2022 18:53:42 +0200 Subject: [PATCH] [TerminalClock] Small fix --- apps/terminalclock/app.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/apps/terminalclock/app.js b/apps/terminalclock/app.js index c9be2f543..9b810a10a 100644 --- a/apps/terminalclock/app.js +++ b/apps/terminalclock/app.js @@ -27,18 +27,20 @@ const clock = new ClockFace({ this.showAltitude = false; if (this.HRMinConfidence === undefined) this.HRMinConfidence = 50; if (this.PowerOnInterval === undefined) this.PowerOnInterval = 15; - if (this.powerSaving===undefined) this[k] = true; + if (this.powerSaving===undefined) this.powerSaving = true; ["L2", "L3", "L4", "L5", "L6", "L7", "L8", "L9"].forEach(k => { if (this[k]===undefined) this[k] = "Empty"; else if (this[k]==="HR") this.showHRM = true; else if (this[k]==="Alt") this.showAltitude = true && process.env.HWVERSION == 2; }); + // set the lock and unlock actions Bangle.on("lock", on => { if (on) lock(); else unlock(); }); + // set the services (HRM, pressure sensor, etc....) turnOnServices(); if(this.powerSaving){ setInterval(turnOnServices, this.PowerOnInterval*60000); // every PowerOnInterval min