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. diff --git a/apps/lightswitch/lib.js b/apps/lightswitch/lib.js index 3dd07579c..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(); @@ -38,13 +42,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 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": [ 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); }