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
stephenPspackman 2021-12-13 11:52:10 -08:00 committed by GitHub
parent 186258e398
commit 134935dc46
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 2 additions and 4 deletions

View File

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