mirror of https://github.com/espruino/BangleApps
[sleeplogalarm] Add setting + explanations, icon
parent
69d0890cfa
commit
8c4c514059
|
@ -1 +1,2 @@
|
||||||
0.01: New App!
|
0.01: New App!
|
||||||
|
0.02: Add "from Consec."-setting
|
|
@ -1,27 +1,40 @@
|
||||||
# Sleep Log Alarm
|
# Sleep Log Alarm
|
||||||
|
|
||||||
This widget searches for active alarms and raises the alarm event up to the defined time earlier, if in a light sleep phase.
|
This widget searches for active alarms and raises an own alarm event up to the defined time earlier, if in light sleep or awake phase. Optional the earlier alarm will only be triggered if comming from or in consecutive sleep. The settings of the earlier alarm can be adjusted and it is possible to filter the targeting alarms by time and message. By default the time of the targeting alarm is displayed inside the widget which can be adjusted, too.
|
||||||
|
|
||||||
---
|
---
|
||||||
### App Usage
|
### Settings
|
||||||
---
|
---
|
||||||
|
|
||||||
#### Inside the settings: !!! dummy entries !!!
|
- __earlier__ | duration to trigger alarm earlier
|
||||||
- __Thresholds__ submenu
|
_10min_ / _20min_ / __30min__ / ... / _120min_
|
||||||
Changes take effect from now on, not retrospective!
|
- __from Consec.__ | only trigger if comming from consecutive sleep
|
||||||
- __Max Awake__ | maximal awake duration
|
_on_ / __off__
|
||||||
_10min_ / _20min_ / ... / __60min__ / ... / _120min_
|
- __vib pattern__ | vibration pattern for the earlier alarm
|
||||||
- __Min Consecutive__ | minimal consecutive sleep duration
|
__..__ / ...
|
||||||
_10min_ / _20min_ / ... / __30min__ / ... / _120min_
|
- __msg__ | customized message for the earlier alarm
|
||||||
- __Deep Sleep__ | deep sleep threshold
|
__...__ / ...
|
||||||
_30_ / _31_ / ... / __100__ / ... / _200_
|
- __msg as prefix__ | use the customized message as prefix to the original message or replace it comlpetely if disabled
|
||||||
- __Light Sleep__ | light sleep threshold
|
__on__ / _off_
|
||||||
_100_ / _110_ / ... / __200__ / ... / _400_
|
- __disable alarm__ | if enabled the original alarm will be disabled
|
||||||
- __Reset to Default__ | reset to bold values above
|
_on_ / __off__
|
||||||
- __BreakToD__ | time of day to break view
|
This feature does not work for alarms on the next day!
|
||||||
_0:00_ / _1:00_ / ... / __12:00__ / ... / _23:00_
|
- __auto snooze__ | auto snooze option for the earlier alarm
|
||||||
- __App Timeout__ | app specific lock timeout
|
__on__ / _off_
|
||||||
__0s__ / _10s_ / ... / _120s_
|
- __Filter Alarm__ submenu
|
||||||
|
- __time from__ | exclude alarms before this time
|
||||||
|
_0:00_ / _0:15_ / ... / __3:00__ / ... / _24:00_
|
||||||
|
- __time to__ | exclude alarms after this time
|
||||||
|
_0:00_ / _0:15_ / ... / __12:00__ / ... / _24:00_
|
||||||
|
- __msg includes__ | include only alarms including this string in msg
|
||||||
|
__""__ / ...
|
||||||
|
- __Widget__ submenu
|
||||||
|
- __hide__ | completely hide the widget
|
||||||
|
_on_ / __off__
|
||||||
|
- __show time__ | show the time of the targeting alarm
|
||||||
|
__on__ / _off_
|
||||||
|
- __color__ | color of the widget
|
||||||
|
_red_ / __yellow__ / ... / _white_
|
||||||
- __Enabled__ | completely en-/disables the background service
|
- __Enabled__ | completely en-/disables the background service
|
||||||
__on__ / _off_
|
__on__ / _off_
|
||||||
|
|
||||||
|
|
Binary file not shown.
Before Width: | Height: | Size: 7.9 KiB After Width: | Height: | Size: 8.8 KiB |
|
@ -29,14 +29,15 @@ exports = {
|
||||||
return Object.assign({
|
return Object.assign({
|
||||||
enabled: true,
|
enabled: true,
|
||||||
earlier: 30,
|
earlier: 30,
|
||||||
filter_from: 3,
|
fromConsec: false,
|
||||||
filter_to: 12,
|
|
||||||
filter_msg: "",
|
|
||||||
vibrate: "..",
|
vibrate: "..",
|
||||||
msg: "...\n",
|
msg: "...\n",
|
||||||
msgAsPrefix: true,
|
msgAsPrefix: true,
|
||||||
disableOnAlarm: false, // !!! not available if alarm is at the next day
|
disableOnAlarm: false, // !!! not available if alarm is at the next day
|
||||||
as: true,
|
as: true,
|
||||||
|
filter_from: 3,
|
||||||
|
filter_to: 12,
|
||||||
|
filter_msg: "",
|
||||||
wid_hide: false,
|
wid_hide: false,
|
||||||
wid_time: true,
|
wid_time: true,
|
||||||
wid_color: g.theme.dark ? 65504 : 31, // yellow or blue
|
wid_color: g.theme.dark ? 65504 : 31, // yellow or blue
|
||||||
|
@ -72,7 +73,9 @@ exports = {
|
||||||
to: this.time - 1,
|
to: this.time - 1,
|
||||||
fn: function (data) {
|
fn: function (data) {
|
||||||
// execute trigger function if on light sleep or awake
|
// execute trigger function if on light sleep or awake
|
||||||
if (data.status === 3 || data.status === 2)
|
// and if set if comming from consecutive
|
||||||
|
if ((data.status === 3 || data.status === 2) && !settings.fromConsec ||
|
||||||
|
data.consecutive === 3 || data.prevConsecutive === 3)
|
||||||
require("sleeplogalarm").trigger();
|
require("sleeplogalarm").trigger();
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
|
@ -2,7 +2,7 @@
|
||||||
"id":"sleeplogalarm",
|
"id":"sleeplogalarm",
|
||||||
"name":"Sleep Log Alarm",
|
"name":"Sleep Log Alarm",
|
||||||
"shortName": "SleepLogAlarm",
|
"shortName": "SleepLogAlarm",
|
||||||
"version": "0.01",
|
"version": "0.02",
|
||||||
"description": "Enhance your morning and let your alarms wake you up when you are in light sleep.",
|
"description": "Enhance your morning and let your alarms wake you up when you are in light sleep.",
|
||||||
"icon": "app.png",
|
"icon": "app.png",
|
||||||
"type": "widget",
|
"type": "widget",
|
||||||
|
|
|
@ -30,12 +30,12 @@
|
||||||
"": {
|
"": {
|
||||||
title: "Filter Alarm"
|
title: "Filter Alarm"
|
||||||
},
|
},
|
||||||
/*LANG*/"< Back": () => showMain(2),
|
/*LANG*/"< Back": () => showMain(8),
|
||||||
/*LANG*/"time from": {
|
/*LANG*/"time from": {
|
||||||
value: settings.filter_from,
|
value: settings.filter_from,
|
||||||
step: 0.25,
|
step: 0.25,
|
||||||
min: 0,
|
min: 0,
|
||||||
max: 23,
|
max: 24,
|
||||||
wrap: true,
|
wrap: true,
|
||||||
noList: true,
|
noList: true,
|
||||||
format: v => (0|v) + ":" + ("" + (0|(v%1 * 60))).padStart(2, "0"),
|
format: v => (0|v) + ":" + ("" + (0|(v%1 * 60))).padStart(2, "0"),
|
||||||
|
@ -47,7 +47,7 @@
|
||||||
/*LANG*/"time to": {
|
/*LANG*/"time to": {
|
||||||
value: settings.filter_to,
|
value: settings.filter_to,
|
||||||
step: 0.25,
|
step: 0.25,
|
||||||
min: 1,
|
min: 0,
|
||||||
max: 24,
|
max: 24,
|
||||||
wrap: true,
|
wrap: true,
|
||||||
noList: true,
|
noList: true,
|
||||||
|
@ -78,7 +78,7 @@
|
||||||
"": {
|
"": {
|
||||||
title: "Widget Settings"
|
title: "Widget Settings"
|
||||||
},
|
},
|
||||||
/*LANG*/"< Back": () => showMain(8),
|
/*LANG*/"< Back": () => showMain(9),
|
||||||
/*LANG*/"hide": {
|
/*LANG*/"hide": {
|
||||||
value: settings.wid_hide,
|
value: settings.wid_hide,
|
||||||
onchange: v => {
|
onchange: v => {
|
||||||
|
@ -130,7 +130,13 @@
|
||||||
writeSetting();
|
writeSetting();
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
/*LANG*/"Filter Alarm": () => showFilterMenu(),
|
/*LANG*/"from Consec.": {
|
||||||
|
value: settings.fromConsec,
|
||||||
|
onchange: v => {
|
||||||
|
settings.fromConsec = v;
|
||||||
|
writeSetting();
|
||||||
|
}
|
||||||
|
},
|
||||||
/*LANG*/"vib pattern": require("buzz_menu").pattern(
|
/*LANG*/"vib pattern": require("buzz_menu").pattern(
|
||||||
settings.vibrate,
|
settings.vibrate,
|
||||||
v => {
|
v => {
|
||||||
|
@ -165,6 +171,7 @@
|
||||||
writeSetting();
|
writeSetting();
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
/*LANG*/"Filter Alarm": () => showFilterMenu(),
|
||||||
/*LANG*/"Widget": () => showWidMenu(),
|
/*LANG*/"Widget": () => showWidMenu(),
|
||||||
/*LANG*/"Enabled": {
|
/*LANG*/"Enabled": {
|
||||||
value: settings.enabled,
|
value: settings.enabled,
|
||||||
|
|
Loading…
Reference in New Issue