1
0
Fork 0

Merge pull request #246 from rigrig/gbridge

gbridge: don't turn on screen at start of every song
master
Gordon Williams 2020-04-08 07:57:22 +01:00 committed by GitHub
commit c2de397b72
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
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") {