diff --git a/apps/sleepphasealarm/ChangeLog b/apps/sleepphasealarm/ChangeLog index 5a7be5b20..1d4331042 100644 --- a/apps/sleepphasealarm/ChangeLog +++ b/apps/sleepphasealarm/ChangeLog @@ -15,3 +15,4 @@ 0.12: Support javascript command to execute as defined in scheduler 'js' configuration 0.13: Fix dated events alarm on wrong date 0.14: Reduce update interval of current time when seconds are not shown + Limit logging on Bangle.js 1 to one day due to low memory diff --git a/apps/sleepphasealarm/README.md b/apps/sleepphasealarm/README.md index 574e84e1e..bbf1d84ab 100644 --- a/apps/sleepphasealarm/README.md +++ b/apps/sleepphasealarm/README.md @@ -23,6 +23,7 @@ Replacing the watch strap with a more comfortable one (e.g. made of nylon) is re ## Logging For each day of month (1..31) the ESS states are logged. An entry will be overwritten in the next month, e.g. an entry on the 4th May will overwrite an entry on the 4th April. +On Bangle.js 1 only one day is logged due to low memory. The logs can be viewed with the download button: ![](screenshot.jpg) diff --git a/apps/sleepphasealarm/app.js b/apps/sleepphasealarm/app.js index c74303b76..25ca7e781 100644 --- a/apps/sleepphasealarm/app.js +++ b/apps/sleepphasealarm/app.js @@ -146,8 +146,9 @@ function addLog(time, type) { var minAlarm = new Date(); var measure = true; if (nextAlarmDate !== undefined) { - config.logs[nextAlarmDate.getDate()] = []; // overwrite log on each day of month - logs = config.logs[nextAlarmDate.getDate()]; + const logday = BANGLEJS2 ? nextAlarmDate.getDate() : 0; + config.logs[logday] = []; // overwrite log on each day of month + logs = config.logs[logday]; g.clear(); Bangle.loadWidgets(); Bangle.drawWidgets();