Delete apps/gbalarms directory

pull/1677/head
frigis1 2022-04-11 23:04:45 -07:00 committed by GitHub
parent 18b7477a16
commit c6e5cd79d4
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
6 changed files with 0 additions and 131 deletions

View File

@ -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.

View File

@ -1 +0,0 @@
atob("MDABAAAAAAAAA///+AAABgwEDAAADAwMBAAACAf8BgAACAAABgAACAAABgAACAAABgAACAAABgAACAAABgAACAAABgAACAAcBgOACAA2BgbACABmP8ZgCADM8PMwCAGZn5mYCADzf+zwCABmwDZgCAANgBsACAALAA0ACAAaMAWACAAeOAeACAAWHwaACAAWD8aACAAWD8aACAAWDwaACAAeAAeACAAaAAWACAALAA0ACAANgBsACAAGwDYACAADf+wACAADn5wACAAC8PQACAAGP8YACAAABgAACAAABgAACAAABgAACAAABgAACAAABgAACAAABgAACAAABgAACAAABgAACAAABgAADAAABAAABgAADAAAA///+AAAAAAAAAAA")

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.2 KiB

View File

@ -1,61 +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);
function getCurrentTime() {
var time = new Date();
return (
time.getHours() * 3600000 +
time.getMinutes() * 60000 +
time.getSeconds() * 1000
);
}
//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) || {};
var alarms = [];
//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++) {
//prevents all alarms from going off at once??
var last = (event.d[j].h * 3600000 + event.d[j].m * 60000 < getCurrentTime()) ? (new Date()).getDate() : 0;
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 : last,
rp : settings.rp,
as : settings.as,
vibrate : settings.vibrate
};
alarms.push(a);
}
require("sched").setAlarms(alarms);
require("sched").reload();
}
};
})();

View File

@ -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"}]
}

View File

@ -1,42 +0,0 @@
(function(back) {
var settings = require("Storage").readJSON("gbalarms.json", 1) || {};
var pattern = ["Off", ".", "..", "-", "--", "-.-", "---"];
function showMainMenu() {
var mainMenu = {
"" : { "title": "GB Alarms" },
"Vibrate": {
value: settings.vibrate,
onchange: function() { E.showMenu(vibMenu); },
},
"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();
}
};
E.showMenu(mainMenu);
}
var vibMenu = {
"< Back": function() {
showMainMenu();
}
};
pattern.forEach((a, idx) => {
vibMenu[pattern[idx]] = function() {
settings.vibrate = a;
require("buzz").pattern(a);
showMainMenu();
};
});
showMainMenu();
});