mirror of https://github.com/espruino/BangleApps
sched: emit alarmReload, widalarm reload on alarmReload
parent
a25ed8f6ff
commit
0dd67533ac
|
@ -24,3 +24,4 @@
|
|||
0.21: Fix crash in clock_info
|
||||
0.22: Dated event repeat option
|
||||
0.23: Allow buzzing forever when an alarm fires
|
||||
0.24: Emit alarmReload when alarms change (used by widalarm)
|
||||
|
|
|
@ -55,10 +55,7 @@ exports.getTimeToAlarm = function(alarm, time) {
|
|||
/// Force a reload of the current alarms and widget
|
||||
exports.reload = function() {
|
||||
eval(require("Storage").read("sched.boot.js"));
|
||||
if (global.WIDGETS && WIDGETS["alarm"]) {
|
||||
WIDGETS["alarm"].reload();
|
||||
Bangle.drawWidgets();
|
||||
}
|
||||
Bangle.emit("alarmReload");
|
||||
};
|
||||
// Factory that creates a new alarm with default values
|
||||
exports.newDefaultAlarm = function () {
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
{
|
||||
"id": "sched",
|
||||
"name": "Scheduler",
|
||||
"version": "0.23",
|
||||
"version": "0.24",
|
||||
"description": "Scheduling library for alarms and timers",
|
||||
"icon": "app.png",
|
||||
"type": "scheduler",
|
||||
|
|
|
@ -1 +1,2 @@
|
|||
0.01: Moved out of 'alarm' app
|
||||
0.02: Decouple reloading of widget when alarms change
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
{
|
||||
"id": "widalarm",
|
||||
"name": "Alarms Widget",
|
||||
"version": "0.01",
|
||||
"version": "0.02",
|
||||
"description": "Displays an alarm icon in the widgets bar if any alarm is active",
|
||||
"icon": "app.png",
|
||||
"type": "widget",
|
||||
|
|
|
@ -6,3 +6,9 @@ WIDGETS["alarm"]={area:"tl",width:0,draw:function() {
|
|||
}
|
||||
};
|
||||
WIDGETS["alarm"].reload();
|
||||
Bangle.on("alarmReload", () => {
|
||||
if (WIDGETS["alarm"]) {
|
||||
WIDGETS["alarm"].reload();
|
||||
Bangle.drawWidgets();
|
||||
}
|
||||
});
|
||||
|
|
Loading…
Reference in New Issue