[lightswitch] Add setLCDPower to lib.js

master
storm64 2025-05-07 10:10:24 +02:00 committed by GitHub
parent 77e974a2b9
commit 5a708cd818
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 2 additions and 1 deletions

View File

@ -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