gadgetbridge: Added 'find' event handling
parent
d04c418419
commit
77de51dac4
|
|
@ -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",
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -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);
|
||||
};
|
||||
|
|
|
|||
Loading…
Reference in New Issue