diff --git a/apps/gbalarms/README.md b/apps/gbalarms/README.md deleted file mode 100644 index 21cbeaab9..000000000 --- a/apps/gbalarms/README.md +++ /dev/null @@ -1,9 +0,0 @@ -# WARNING - -This app uses the [Scheduler library](https://banglejs.com/apps/?id=sched). - -## Usage - -* Default settings for alarms (vibration pattern, repeat on/off, auto snooze on/off) can be accessed through Settings -> Apps -> GB Alarms. To apply these settings to existing Gadgetbridge alarms, have GB re-send the alarms simply by hitting the alarm icon in GB and hitting the back button. -* If a day of the week is not selected in GB, this app will automatically set the alarm to all days of the week. In other words, selecting no days of the week is exactly the same as selecting every day of the week. -* If you wish to modify or delete a GB alarm, please do so from your device and not your watch to avoid possible confusion. diff --git a/apps/gbalarms/app-icon.js b/apps/gbalarms/app-icon.js deleted file mode 100644 index 07a082c00..000000000 --- a/apps/gbalarms/app-icon.js +++ /dev/null @@ -1 +0,0 @@ -atob("MDABAAAAAAAAA///+AAABgwEDAAADAwMBAAACAf8BgAACAAABgAACAAABgAACAAABgAACAAABgAACAAABgAACAAABgAACAAcBgOACAA2BgbACABmP8ZgCADM8PMwCAGZn5mYCADzf+zwCABmwDZgCAANgBsACAALAA0ACAAaMAWACAAeOAeACAAWHwaACAAWD8aACAAWD8aACAAWDwaACAAeAAeACAAaAAWACAALAA0ACAANgBsACAAGwDYACAADf+wACAADn5wACAAC8PQACAAGP8YACAAABgAACAAABgAACAAABgAACAAABgAACAAABgAACAAABgAACAAABgAACAAABgAACAAABgAADAAABAAABgAADAAAA///+AAAAAAAAAAA") diff --git a/apps/gbalarms/app.png b/apps/gbalarms/app.png deleted file mode 100644 index 5914f2971..000000000 Binary files a/apps/gbalarms/app.png and /dev/null differ diff --git a/apps/gbalarms/boot.js b/apps/gbalarms/boot.js deleted file mode 100644 index 4470d8f1e..000000000 --- a/apps/gbalarms/boot.js +++ /dev/null @@ -1,48 +0,0 @@ -(function() { - - var settings = require("Storage").readJSON("gbalarms.json", 1) || {}; - if (settings.rp == undefined) settings.rp = true; - if (settings.as == undefined) settings.as = true; - if (settings.vibrate == undefined) settings.vibrate = ".."; - require('Storage').writeJSON("gbalarms.json", settings); - -//convert GB DOW format to sched DOW format -function convDow(x) { - //if no DOW selected, set alarm to all DOW - if (x == 0) x = 127; - x = x.toString(2); - for (var i = 0; x.length < 7; i++) { - x = "0"+x; - } - x = x.slice(1, 7) + x.slice(0, 1); - return "0b"+x; -} - -global.GB = (event) => { - if (event.t==="alarm") { - settings = require("Storage").readJSON("gbalarms.json", 1) || {}; - - //wipe existing GB alarms - var gbalarms = require("sched").getAlarms().filter(a=>a.appid=="gbalarms"); - for (i = 0; i < gbalarms.length; i++) { - require("sched").setAlarm(gbalarms[i].id, undefined); - } - for (j = 0; j < event.d.length; j++) { - var a = { - id : "gb"+j, - appid : "gbalarms", - on : true, - t : event.d[j].h * 3600000 + event.d[j].m * 60000, - dow : convDow(event.d[j].rep), - last : 0, - rp : settings.rp, - as : settings.as, - vibrate : settings.vibrate - }; - require("sched").setAlarm(a.id, a); - } - } - require("sched").reload(); -}; - -})(); diff --git a/apps/gbalarms/metadata.json b/apps/gbalarms/metadata.json deleted file mode 100644 index ee5ff964b..000000000 --- a/apps/gbalarms/metadata.json +++ /dev/null @@ -1,18 +0,0 @@ -{ - "id": "gbalarms", - "name": "Gadgetbridge Alarms", - "shortName": "GB Alarms", - "version": "0.01", - "description": "Sync sched.json with Gadgetbridge alarms.", - "icon": "app.png", - "type": "alarm", - "tags": "system,gadgetbridge,alarm", - "dependencies": {"scheduler":"type"}, - "supports": ["BANGLEJS","BANGLEJS2"], - "storage": [ - {"name":"gbalarms.settings.js","url":"settings.js"}, - {"name":"gbalarms.img","url":"app-icon.js","evaluate":true}, - {"name":"gbalarms.boot.js","url":"boot.js"} - ], - "data": [{"name":"gbalarms.json"}] -} diff --git a/apps/gbalarms/settings.js b/apps/gbalarms/settings.js deleted file mode 100644 index e47cc0c96..000000000 --- a/apps/gbalarms/settings.js +++ /dev/null @@ -1,21 +0,0 @@ -(function(back) { - var settings = require("Storage").readJSON("gbalarms.json", 1) || {}; - E.showMenu({ - "" : { "title": "GB Alarms" }, - "Vibrate": require("buzz_menu").pattern(settings.vibrate, v => settings.vibrate=v), - "Repeat": { - value: settings.rp, - format: v => v ? "Yes" : "No", - onchange: v => settings.rp = v, - }, - "Auto snooze": { - value: settings.as, - format: v => v ? "Yes" : "No", - onchange: v => settings.as = v, - }, - "< Back": function() { - require('Storage').writeJSON("gbalarms.json", settings); - back(); - } - }); -});