[lightswitch] Add setLCDPower for unlocking
parent
04d497ad73
commit
e9d3c1d6b8
|
|
@ -10,13 +10,17 @@ exports = {
|
||||||
unlockSide: "",
|
unlockSide: "",
|
||||||
tapSide: "right",
|
tapSide: "right",
|
||||||
tapOn: "always",
|
tapOn: "always",
|
||||||
|
isOn: true
|
||||||
}, require("Storage").readJSON("lightswitch.json", true) || {});
|
}, require("Storage").readJSON("lightswitch.json", true) || {});
|
||||||
|
|
||||||
// cache lock status
|
// cache lock status
|
||||||
var locked = Bangle.isLocked();
|
var locked = Bangle.isLocked();
|
||||||
|
|
||||||
// check to unlock
|
// 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
|
// check to flash
|
||||||
if (data.dir === w.tapSide && (w.tapOn === "always" || locked === (w.tapOn === "locked"))) require("lightswitch.js").flash();
|
if (data.dir === w.tapSide && (w.tapOn === "always" || locked === (w.tapOn === "locked"))) require("lightswitch.js").flash();
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue