1
0
Fork 0

Merge pull request #2356 from nxdefiant/sleepphasealarm

sleepphasealarm
master
Gordon Williams 2022-12-06 10:50:53 +00:00 committed by GitHub
commit a3f77de725
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 11 additions and 6 deletions

View File

@ -12,3 +12,4 @@
Add setting to disable scheduler alarm Add setting to disable scheduler alarm
0.10: Fix: Do not wake when falling asleep 0.10: Fix: Do not wake when falling asleep
0.11: Minor tweaks 0.11: Minor tweaks
0.12: Support javascript command to execute as defined in scheduler 'js' configuration

View File

@ -173,12 +173,16 @@ if (nextAlarmDate !== undefined) {
setTimeout(load, 1000); setTimeout(load, 1000);
} else if (measure && now >= minAlarm && swest === false) { } else if (measure && now >= minAlarm && swest === false) {
addLog(now, "alarm"); addLog(now, "alarm");
buzz();
measure = false; measure = false;
if (config.settings.disableAlarm) { if (nextAlarmConfig.js) {
// disable alarm for scheduler eval(nextAlarmConfig.js); // run nextAlarmConfig.js if set
nextAlarmConfig.last = now.getDate(); } else {
require("Storage").writeJSON("sched.json", alarms); buzz();
if (config.settings.disableAlarm) {
// disable alarm for scheduler
nextAlarmConfig.last = now.getDate();
require('Storage').writeJSON('sched.json', alarms);
}
} }
} }
}); });

View File

@ -2,7 +2,7 @@
"id": "sleepphasealarm", "id": "sleepphasealarm",
"name": "SleepPhaseAlarm", "name": "SleepPhaseAlarm",
"shortName": "SleepPhaseAlarm", "shortName": "SleepPhaseAlarm",
"version": "0.11", "version": "0.12",
"description": "Uses the accelerometer to estimate sleep and wake states with the principle of Estimation of Stationary Sleep-segments (ESS, see https://ubicomp.eti.uni-siegen.de/home/datasets/ichi14/index.html.en). This app will read the next alarm from the alarm application and will wake you up to 30 minutes early at the best guessed time when you are almost already awake.", "description": "Uses the accelerometer to estimate sleep and wake states with the principle of Estimation of Stationary Sleep-segments (ESS, see https://ubicomp.eti.uni-siegen.de/home/datasets/ichi14/index.html.en). This app will read the next alarm from the alarm application and will wake you up to 30 minutes early at the best guessed time when you are almost already awake.",
"icon": "app.png", "icon": "app.png",
"tags": "alarm", "tags": "alarm",