sleepphasealarm: loggin on Bangle 1

Limit logging on Bangle.js 1 to one day due to low memory
pull/2563/head
Erik Andresen 2023-02-04 09:53:05 +01:00
parent 1174faafbf
commit 3ada593477
3 changed files with 5 additions and 2 deletions

View File

@ -15,3 +15,4 @@
0.12: Support javascript command to execute as defined in scheduler 'js' configuration 0.12: Support javascript command to execute as defined in scheduler 'js' configuration
0.13: Fix dated events alarm on wrong date 0.13: Fix dated events alarm on wrong date
0.14: Reduce update interval of current time when seconds are not shown 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

View File

@ -23,6 +23,7 @@ Replacing the watch strap with a more comfortable one (e.g. made of nylon) is re
## Logging ## 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. 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: The logs can be viewed with the download button:
![](screenshot.jpg) ![](screenshot.jpg)

View File

@ -146,8 +146,9 @@ function addLog(time, type) {
var minAlarm = new Date(); var minAlarm = new Date();
var measure = true; var measure = true;
if (nextAlarmDate !== undefined) { if (nextAlarmDate !== undefined) {
config.logs[nextAlarmDate.getDate()] = []; // overwrite log on each day of month const logday = BANGLEJS2 ? nextAlarmDate.getDate() : 0;
logs = config.logs[nextAlarmDate.getDate()]; config.logs[logday] = []; // overwrite log on each day of month
logs = config.logs[logday];
g.clear(); g.clear();
Bangle.loadWidgets(); Bangle.loadWidgets();
Bangle.drawWidgets(); Bangle.drawWidgets();