diff --git a/apps/sched/ChangeLog b/apps/sched/ChangeLog index d944e7eed..717763e19 100644 --- a/apps/sched/ChangeLog +++ b/apps/sched/ChangeLog @@ -4,4 +4,6 @@ 0.04: Fix `getTimeToAlarm` to check for next dow if alarm.t lower currentTime. 0.05: Export new functions (`newDefaultAlarm/Timer`), add Settings page 0.06: Refactor some methods to library -0.07: Correct `decodeTime(t)` to return a more likely expected time +0.07: Update settings + Correct `decodeTime(t)` to return a more likely expected time + diff --git a/apps/sched/README.md b/apps/sched/README.md index 47507fc14..57acdc0b7 100644 --- a/apps/sched/README.md +++ b/apps/sched/README.md @@ -16,6 +16,7 @@ Global Settings - `Unlock at Buzz` - If `Yes` the alarm/timer will unlock the watch - `Default Auto Snooze` - Default _Auto Snooze_ value for newly created alarms (_Alarms_ only) - `Default Snooze` - Default _Snooze_ value for newly created alarms/timers +- `Default Repeat` - Default _Repeat_ value for newly created alarms (_Alarms_ only) - `Buzz Count` - The number of buzzes before the watch goes silent - `Buzz Interval` - The interval between one buzz and the next - `Default Alarm/Timer Pattern` - Default vibration pattern for newly created alarms/timers @@ -38,7 +39,7 @@ Alarms are stored in an array in `sched.json`, and take the form: // WED = 8 // THU = 16 // FRI = 32 - // SAT = 64 + // SAT = 64 date : "2022-04-04", // OPTIONAL date for the alarm, in YYYY-MM-DD format // eg (new Date()).toISOString().substr(0,10) diff --git a/apps/sched/lib.js b/apps/sched/lib.js index 0eeea68e3..9cda7c147 100644 --- a/apps/sched/lib.js +++ b/apps/sched/lib.js @@ -59,8 +59,8 @@ exports.newDefaultAlarm = function () { let alarm = { t: 12 * 3600000, // Default to 12:00 on: true, - rp: false, // repeat not the default - as: settings.defaultAutoSnooze || false, + rp: settings.defaultRepeat, + as: settings.defaultAutoSnooze, dow: 0b1111111, last: 0, vibrate: settings.defaultAlarmPattern, @@ -95,6 +95,7 @@ exports.getSettings = function () { unlockAtBuzz: false, defaultSnoozeMillis: 600000, // 10 minutes defaultAutoSnooze: false, + defaultRepeat: false, buzzCount: 10, buzzIntervalMillis: 3000, // 3 seconds defaultAlarmPattern: "..", diff --git a/apps/sched/settings.js b/apps/sched/settings.js index 642e43b43..5ddb4dab2 100644 --- a/apps/sched/settings.js +++ b/apps/sched/settings.js @@ -36,6 +36,15 @@ } }, + /*LANG*/"Default Repeat": { + value: settings.defaultRepeat, + format: v => v ? /*LANG*/"Yes" : /*LANG*/"No", + onchange: v => { + settings.defaultRepeat = v; + require("sched").setSettings(settings); + } + }, + /*LANG*/"Buzz Count": { value: settings.buzzCount, min: 5,