gadgetbridge: Added 'find' event handling
parent
d04c418419
commit
77de51dac4
|
|
@ -121,7 +121,7 @@
|
||||||
{ "id": "gbridge",
|
{ "id": "gbridge",
|
||||||
"name": "Gadgetbridge",
|
"name": "Gadgetbridge",
|
||||||
"icon": "app.png",
|
"icon": "app.png",
|
||||||
"version":"0.13",
|
"version":"0.14",
|
||||||
"description": "The default notification handler for Gadgetbridge notifications from Android",
|
"description": "The default notification handler for Gadgetbridge notifications from Android",
|
||||||
"tags": "tool,system,android,widget",
|
"tags": "tool,system,android,widget",
|
||||||
"type":"widget",
|
"type":"widget",
|
||||||
|
|
|
||||||
|
|
@ -12,3 +12,4 @@
|
||||||
0.11: Report battery status on connect and at regular intervals
|
0.11: Report battery status on connect and at regular intervals
|
||||||
0.12: Setting to show/hide icon
|
0.12: Setting to show/hide icon
|
||||||
0.13: Modified to use the 'notify' library
|
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;
|
var _GB = global.GB;
|
||||||
global.GB = (event) => {
|
global.GB = (event) => {
|
||||||
switch (event.t) {
|
switch (event.t) {
|
||||||
|
|
@ -73,6 +85,9 @@
|
||||||
case "call":
|
case "call":
|
||||||
handleCallEvent(event);
|
handleCallEvent(event);
|
||||||
break;
|
break;
|
||||||
|
case "find":
|
||||||
|
handleFindEvent(event);
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
if(_GB)setTimeout(_GB,0,event);
|
if(_GB)setTimeout(_GB,0,event);
|
||||||
};
|
};
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue