Delete apps/gbalarms directory
parent
9b1b3c436c
commit
24facde6ef
|
|
@ -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.
|
||||
|
|
@ -1 +0,0 @@
|
|||
atob("MDABAAAAAAAAA///+AAABgwEDAAADAwMBAAACAf8BgAACAAABgAACAAABgAACAAABgAACAAABgAACAAABgAACAAABgAACAAcBgOACAA2BgbACABmP8ZgCADM8PMwCAGZn5mYCADzf+zwCABmwDZgCAANgBsACAALAA0ACAAaMAWACAAeOAeACAAWHwaACAAWD8aACAAWD8aACAAWDwaACAAeAAeACAAaAAWACAALAA0ACAANgBsACAAGwDYACAADf+wACAADn5wACAAC8PQACAAGP8YACAAABgAACAAABgAACAAABgAACAAABgAACAAABgAACAAABgAACAAABgAACAAABgAACAAABgAADAAABAAABgAADAAAA///+AAAAAAAAAAA")
|
||||
Binary file not shown.
|
Before Width: | Height: | Size: 1.2 KiB |
|
|
@ -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();
|
||||
};
|
||||
|
||||
})();
|
||||
|
|
@ -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"}]
|
||||
}
|
||||
|
|
@ -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();
|
||||
}
|
||||
});
|
||||
});
|
||||
Loading…
Reference in New Issue