gadgetbridge: Added 'find' event handling

master
Gordon Williams 2020-06-05 11:21:52 +01:00
parent d04c418419
commit 77de51dac4
3 changed files with 17 additions and 1 deletions

View File

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

View File

@ -12,3 +12,4 @@
0.11: Report battery status on connect and at regular intervals
0.12: Setting to show/hide icon
0.13: Modified to use the 'notify' library
0.14: Added 'find' event handling

View File

@ -58,6 +58,18 @@
}
}
function handleFindEvent(event) {
if (state.find) {
clearInterval(state.find);
delete state.find;
}
if (event.n)
state.find = setInterval(_=>{
Bangle.buzz();
setTimeout(_=>Bangle.beep(), 1000);
},2000);
}
var _GB = global.GB;
global.GB = (event) => {
switch (event.t) {
@ -73,6 +85,9 @@
case "call":
handleCallEvent(event);
break;
case "find":
handleFindEvent(event);
break;
}
if(_GB)setTimeout(_GB,0,event);
};