gbridge: don't turn on screen at start of every song

Do draw the notification, so you can still look up what is playing.
pull/246/head
Richard de Boer 2020-04-07 22:08:29 +02:00
parent 3b2558ddd8
commit 1bea7a450e
3 changed files with 7 additions and 4 deletions

View File

@ -92,7 +92,7 @@
{ "id": "gbridge",
"name": "Gadgetbridge",
"icon": "app.png",
"version":"0.07",
"version":"0.08",
"description": "The default notification handler for Gadgetbridge notifications from Android",
"tags": "tool,system,android,widget",
"type":"widget",

View File

@ -6,3 +6,4 @@
Optimize animation, limit title length
0.06: Gadgetbridge App 'Connected' state is no longer toggleable
0.07: Move configuration to settings menu
0.08: Don't turn on LCD at start of every song

View File

@ -16,7 +16,8 @@
Bluetooth.println(JSON.stringify(message));
}
function showNotification(size, render) {
function showNotification(size, render, turnOn) {
if (turnOn === undefined) turnOn = true
var oldMode = Bangle.getLCDMode();
Bangle.setLCDMode("direct");
@ -31,7 +32,7 @@
g.fillRect(238, 240, 239, 319);
g.fillRect(2, 318, 238, 319);
Bangle.setLCDPower(1); // light up
if (turnOn) Bangle.setLCDPower(1); // light up
Bangle.setLCDMode(oldMode); // clears cliprect
function anim() {
@ -97,6 +98,7 @@
}
function handleMusicStateUpdate(event) {
const changed = state.music === event.state
state.music = event.state
if (state.music == "play") {
@ -113,7 +115,7 @@
g.setFont("6x8", 1);
g.setColor("#ffffff");
g.drawString(state.musicInfo.track, x, y + 22);
});
}, changed);
}
if (state.music == "pause") {