pull/1661/head
Gordon Williams 2022-04-01 12:50:36 +01:00
parent 9055cd7990
commit 771950f51b
2 changed files with 10 additions and 14 deletions

View File

@ -20,7 +20,15 @@ Alarms are stored in an array in `alarm.json`, and take the form:
{
id : "mytimer", // optional ID for this alarm/timer, so apps can easily find *their* timers
on : true, // is the alarm enabled?
t : 23400000, // Time of day since midnight in ms
t : 23400000, // Time of day since midnight in ms (if a timer, this is set automatically when timer starts)
dow : 0b1111111, // Binary encoding for days of the week to run alarm on
// SUN = 1
// MON = 2
// TUE = 4
// WED = 8
// THU = 16
// FRI = 32
// SAT = 64
msg : "Eat chocolate", // message to display
last : 0, // last day of the month we alarmed on - so we don't alarm twice in one day!
rp : true, // repeat

View File

@ -2,19 +2,7 @@ Bangle.loadWidgets();
Bangle.drawWidgets();
var alarms = require("Storage").readJSON("alarm.json",1)||[];
/*alarms = [
{
id : "mytimer", // optional ID for this alarm/timer, so apps can easily find *their* timers
on : true, // is the alarm enabled?
t : 23400000, // Time of day since midnight in ms
msg : "Eat chocolate", // message to display
last : 0, // last day of the month we alarmed on - so we don't alarm twice in one day!
rp : true, // repeat
as : false, // auto snooze
timer : 5*60*1000, // OPTIONAL - if set, this is a timer and it's the time in ms
js : "load('myapp.js')" // OPTIONAL - a JS command to execute when the alarm activates (*instead* of loading 'alarm.js')
}
];*/
// An array of alarm objects (see README.md)
// time in ms -> { hrs, mins }
function decodeTime(t) {