Gadgetbridge: move config to settings menu

gbridge: remove `gbridge.app.js` from `apps.json`

This file no longer exists, so don't mention it anymore.
master
Richard de Boer 2020-04-04 00:47:48 +02:00
parent a96f32a015
commit 27c02f05e4
4 changed files with 25 additions and 21 deletions

View File

@ -92,11 +92,12 @@
{ "id": "gbridge", { "id": "gbridge",
"name": "Gadgetbridge", "name": "Gadgetbridge",
"icon": "app.png", "icon": "app.png",
"version":"0.06", "version":"0.07",
"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",
"storage": [ "storage": [
{"name":"gbridge.app.js","url":"app.js"}, {"name":"gbridge.settings.js","url":"settings.js"},
{"name":"gbridge.img","url":"app-icon.js","evaluate":true}, {"name":"gbridge.img","url":"app-icon.js","evaluate":true},
{"name":"gbridge.wid.js","url":"widget.js"} {"name":"gbridge.wid.js","url":"widget.js"}
] ]

View File

@ -5,3 +5,4 @@
0.05: Show incoming call notification 0.05: Show incoming call notification
Optimize animation, limit title length Optimize animation, limit title length
0.06: Gadgetbridge App 'Connected' state is no longer toggleable 0.06: Gadgetbridge App 'Connected' state is no longer toggleable
0.07: Move configuration to settings menu

View File

@ -1,19 +0,0 @@
function gb(j) {
Bluetooth.println(JSON.stringify(j));
}
var mainmenu = {
"" : { "title" : "Gadgetbridge" },
"Connected" : { value : NRF.getSecurityStatus().connected?"Yes":"No" },
"Find Phone" : function() { E.showMenu(findPhone); },
"Exit" : ()=> {load();},
};
var findPhone = {
"" : { "title" : "-- Find Phone --" },
"On" : _=>gb({t:"findPhone",n:true}),
"Off" : _=>gb({t:"findPhone",n:false}),
"< Back" : function() { E.showMenu(mainmenu); },
};
E.showMenu(mainmenu);

21
apps/gbridge/settings.js Normal file
View File

@ -0,0 +1,21 @@
(function(back) {
function gb(j) {
Bluetooth.println(JSON.stringify(j));
}
var mainmenu = {
"" : { "title" : "Gadgetbridge" },
"Connected" : { value : NRF.getSecurityStatus().connected?"Yes":"No" },
"Find Phone" : function() { E.showMenu(findPhone); },
"< Back" : back,
};
var findPhone = {
"" : { "title" : "-- Find Phone --" },
"On" : _=>gb({t:"findPhone",n:true}),
"Off" : _=>gb({t:"findPhone",n:false}),
"< Back" : function() { E.showMenu(mainmenu); },
};
E.showMenu(mainmenu);
})