From 5a708cd818c894f175ec26f63948e77de755c8de Mon Sep 17 00:00:00 2001 From: storm64 Date: Wed, 7 May 2025 10:10:24 +0200 Subject: [PATCH 1/5] [lightswitch] Add setLCDPower to lib.js --- apps/lightswitch/lib.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/apps/lightswitch/lib.js b/apps/lightswitch/lib.js index 3dd07579c..024da737d 100644 --- a/apps/lightswitch/lib.js +++ b/apps/lightswitch/lib.js @@ -38,13 +38,14 @@ exports = { isOn: true }, require("Storage").readJSON("lightswitch.json", true) || {}); - // chack if locked, backlight off or actual value lower then minimal flash value + // check if locked, backlight off or actual value lower then minimal flash value if (Bangle.isLocked() || !w.isOn || w.value < w.minFlash) { // set inner bulb and brightness var setBrightness = function(w, value) { if (w.drawInnerBulb) w.drawInnerBulb(value); Bangle.setLCDBrightness(value); + Bangle.setLCDPower(true); }; // override timeout if defined From 426ed847e6635f74ae6e3635272bf7b50c5dcfbf Mon Sep 17 00:00:00 2001 From: storm64 Date: Wed, 7 May 2025 10:11:39 +0200 Subject: [PATCH 2/5] [lightswitch] Add setLCDPower to widget.js --- apps/lightswitch/widget.js | 1 + 1 file changed, 1 insertion(+) diff --git a/apps/lightswitch/widget.js b/apps/lightswitch/widget.js index 6b573355b..601849414 100644 --- a/apps/lightswitch/widget.js +++ b/apps/lightswitch/widget.js @@ -121,6 +121,7 @@ } else { // activate backlight this.isOn = true; + Bangle.setLCDPower(true); // redraw complete widget icon this.drawIcon(false); } From 2796ce82c4a5171cf1b4828a7b927d3f47cd086e Mon Sep 17 00:00:00 2001 From: storm64 Date: Wed, 7 May 2025 11:57:19 +0200 Subject: [PATCH 3/5] [lightswitch] Update ChangeLog --- apps/lightswitch/ChangeLog | 1 + 1 file changed, 1 insertion(+) diff --git a/apps/lightswitch/ChangeLog b/apps/lightswitch/ChangeLog index 8c4ddb60c..ba0663f6d 100644 --- a/apps/lightswitch/ChangeLog +++ b/apps/lightswitch/ChangeLog @@ -8,3 +8,4 @@ 0.08: Ensure boot code doesn't allocate and leave a gloval variable named 'settings' 0.09: Handle lightswitch logic running before its widget has loaded 0.10: Minor code improvements +0.11: Fix issue where backlight is not turned on. From 04d497ad73751a7649b59cb667ea00c127447c14 Mon Sep 17 00:00:00 2001 From: storm64 Date: Wed, 7 May 2025 11:59:26 +0200 Subject: [PATCH 4/5] [lightswitch] Update metadata.json --- apps/lightswitch/metadata.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/apps/lightswitch/metadata.json b/apps/lightswitch/metadata.json index c0472131d..1ac06d61d 100644 --- a/apps/lightswitch/metadata.json +++ b/apps/lightswitch/metadata.json @@ -2,7 +2,7 @@ "id": "lightswitch", "name": "Light Switch Widget", "shortName": "Light Switch", - "version": "0.10", + "version": "0.11", "description": "A fast way to switch LCD backlight on/off, change the brightness and show the lock status. All in one widget.", "icon": "images/app.png", "screenshots": [ From e9d3c1d6b8068f668debadbcf89e5e4c4e7a9f08 Mon Sep 17 00:00:00 2001 From: storm64 Date: Wed, 7 May 2025 12:13:01 +0200 Subject: [PATCH 5/5] [lightswitch] Add setLCDPower for unlocking --- apps/lightswitch/lib.js | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/apps/lightswitch/lib.js b/apps/lightswitch/lib.js index 024da737d..446291f1e 100644 --- a/apps/lightswitch/lib.js +++ b/apps/lightswitch/lib.js @@ -10,13 +10,17 @@ exports = { unlockSide: "", tapSide: "right", tapOn: "always", + isOn: true }, require("Storage").readJSON("lightswitch.json", true) || {}); // cache lock status var locked = Bangle.isLocked(); // check to unlock - if (locked && data.dir === w.unlockSide) Bangle.setLocked(); + if (locked && data.dir === w.unlockSide) { + Bangle.setLocked(); + if (w.isOn) Bangle.setLCDPower(true); + } // check to flash if (data.dir === w.tapSide && (w.tapOn === "always" || locked === (w.tapOn === "locked"))) require("lightswitch.js").flash();