Merge pull request #1743 from alessandrococco/sched-update-settings
[Scheduler] Add "Default Repeat" to settingsmaster
commit
545d84d575
|
|
@ -4,4 +4,6 @@
|
||||||
0.04: Fix `getTimeToAlarm` to check for next dow if alarm.t lower currentTime.
|
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.05: Export new functions (`newDefaultAlarm/Timer`), add Settings page
|
||||||
0.06: Refactor some methods to library
|
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
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -16,6 +16,7 @@ Global Settings
|
||||||
- `Unlock at Buzz` - If `Yes` the alarm/timer will unlock the watch
|
- `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 Auto Snooze` - Default _Auto Snooze_ value for newly created alarms (_Alarms_ only)
|
||||||
- `Default Snooze` - Default _Snooze_ value for newly created alarms/timers
|
- `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 Count` - The number of buzzes before the watch goes silent
|
||||||
- `Buzz Interval` - The interval between one buzz and the next
|
- `Buzz Interval` - The interval between one buzz and the next
|
||||||
- `Default Alarm/Timer Pattern` - Default vibration pattern for newly created alarms/timers
|
- `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
|
// WED = 8
|
||||||
// THU = 16
|
// THU = 16
|
||||||
// FRI = 32
|
// FRI = 32
|
||||||
// SAT = 64
|
// SAT = 64
|
||||||
|
|
||||||
date : "2022-04-04", // OPTIONAL date for the alarm, in YYYY-MM-DD format
|
date : "2022-04-04", // OPTIONAL date for the alarm, in YYYY-MM-DD format
|
||||||
// eg (new Date()).toISOString().substr(0,10)
|
// eg (new Date()).toISOString().substr(0,10)
|
||||||
|
|
|
||||||
|
|
@ -59,8 +59,8 @@ exports.newDefaultAlarm = function () {
|
||||||
let alarm = {
|
let alarm = {
|
||||||
t: 12 * 3600000, // Default to 12:00
|
t: 12 * 3600000, // Default to 12:00
|
||||||
on: true,
|
on: true,
|
||||||
rp: false, // repeat not the default
|
rp: settings.defaultRepeat,
|
||||||
as: settings.defaultAutoSnooze || false,
|
as: settings.defaultAutoSnooze,
|
||||||
dow: 0b1111111,
|
dow: 0b1111111,
|
||||||
last: 0,
|
last: 0,
|
||||||
vibrate: settings.defaultAlarmPattern,
|
vibrate: settings.defaultAlarmPattern,
|
||||||
|
|
@ -95,6 +95,7 @@ exports.getSettings = function () {
|
||||||
unlockAtBuzz: false,
|
unlockAtBuzz: false,
|
||||||
defaultSnoozeMillis: 600000, // 10 minutes
|
defaultSnoozeMillis: 600000, // 10 minutes
|
||||||
defaultAutoSnooze: false,
|
defaultAutoSnooze: false,
|
||||||
|
defaultRepeat: false,
|
||||||
buzzCount: 10,
|
buzzCount: 10,
|
||||||
buzzIntervalMillis: 3000, // 3 seconds
|
buzzIntervalMillis: 3000, // 3 seconds
|
||||||
defaultAlarmPattern: "..",
|
defaultAlarmPattern: "..",
|
||||||
|
|
|
||||||
|
|
@ -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": {
|
/*LANG*/"Buzz Count": {
|
||||||
value: settings.buzzCount,
|
value: settings.buzzCount,
|
||||||
min: 5,
|
min: 5,
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue