mirror of https://github.com/espruino/BangleApps
Update app.js
Debugged. Also, it seems that on Bangle 2, the responsible way to do this is with LCDPower, not LCDBrightness.pull/1079/head
parent
186258e398
commit
134935dc46
|
@ -668,10 +668,10 @@ class Clock {
|
||||||
this.options.on('done', () => this.start());
|
this.options.on('done', () => this.start());
|
||||||
|
|
||||||
this.listeners = {
|
this.listeners = {
|
||||||
lcdPower: on => on ? this.active() : this.inactive(),
|
|
||||||
charging: _ => {face.doIcons('charging'); this.active();},
|
charging: _ => {face.doIcons('charging'); this.active();},
|
||||||
lock: _ => {face.doIcons('locked'); this.active();},
|
lock: _ => {face.doIcons('locked'); this.active();},
|
||||||
faceUp: up => {this.conservative = !up; this.active();},
|
faceUp: up => {this.conservative = !up; this.active();},
|
||||||
|
twist: _ => this.options.autolight && Bangle.setLCDPower(true),
|
||||||
drag: e => {
|
drag: e => {
|
||||||
if (this.t0) {
|
if (this.t0) {
|
||||||
if (e.b) {
|
if (e.b) {
|
||||||
|
@ -699,8 +699,6 @@ class Clock {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
this.options.autolight &&
|
|
||||||
(this.listeners.twist = _ => Bangle.setLCDBrightness(1));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
redraw(rate) {
|
redraw(rate) {
|
||||||
|
@ -771,7 +769,7 @@ class Clock {
|
||||||
this.rates.clock = this.timescales[this.options.resolution];
|
this.rates.clock = this.timescales[this.options.resolution];
|
||||||
this.active();
|
this.active();
|
||||||
for (const l in this.listeners) {
|
for (const l in this.listeners) {
|
||||||
Bangle.on(l, this.listeners[l]);
|
this.listeners[l] && Bangle.on(l, this.listeners[l]);
|
||||||
}
|
}
|
||||||
Bangle.setUI('clock');
|
Bangle.setUI('clock');
|
||||||
return this;
|
return this;
|
||||||
|
|
Loading…
Reference in New Issue