[lightswitch] Add setLCDPower for unlocking
parent
04d497ad73
commit
e9d3c1d6b8
|
|
@ -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();
|
||||
|
|
|
|||
Loading…
Reference in New Issue