gbridge: respect Quiet Mode

master
Richard de Boer 2021-03-20 19:16:54 +01:00
parent 0c36041e18
commit 0b76f7848e
3 changed files with 9 additions and 3 deletions

View File

@ -139,7 +139,7 @@
{ "id": "gbridge",
"name": "Gadgetbridge",
"icon": "app.png",
"version":"0.21",
"version":"0.22",
"description": "The default notification handler for Gadgetbridge notifications from Android",
"tags": "tool,system,android,widget",
"readme": "README.md",

View File

@ -21,3 +21,4 @@
0.19: Support for call incoming/start/end
0.20: Reduce memory usage
0.21: Fix HRM setting
0.22: Respect Quiet Mode

View File

@ -154,7 +154,9 @@
case "notify-":
if (event.t === "notify") {
require("notify").show(prettifyNotificationEvent(event));
if (!(require('Storage').readJSON('setting.json',1)||{}).quiet) {
Bangle.buzz();
}
} else { // notify-
require("notify").hide(event);
}
@ -174,7 +176,9 @@
body: event.number, icon:require("heatshrink").decompress(atob("jEYwIMJj4CCwACJh4CCCIMOAQMGAQMHAQMDAQMBCIMB4PwgHz/EAn4CBj4CBg4CBgACCAAw="))}
if (event.cmd === "incoming") {
require("notify").show(note);
if (!(require('Storage').readJSON('setting.json',1)||{}).quiet) {
Bangle.buzz();
}
} else if (event.cmd === "start") {
require("notify").show(Object.assign(note, {
bgColor : "#008000", titleBgColor : "#00C000",
@ -194,6 +198,7 @@
delete state.find;
}
if (event.n)
// Ignore quiet mode: we always want to find our watch
state.find = setInterval(_=>{
Bangle.buzz();
setTimeout(_=>Bangle.beep(), 1000);