Merge pull request #1839 from storm64/master

sleeplog: Fix LOW_MEMORY,MEMORY error #1835
pull/1842/head
Gordon Williams 2022-05-17 13:33:53 +01:00 committed by GitHub
commit 215204daa3
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 7 additions and 2 deletions

View File

@ -2,3 +2,4 @@
0.02: Fix crash on start #1423
0.03: Added power saving mode, move all read/write log actions into lib/module
0.04: Fix #1445, display loading info, add icons to display service states
0.05: Fix LOW_MEMORY,MEMORY error on to big log size

View File

@ -21,7 +21,8 @@ also provides a power saving mode using the built in movement calculation. The i
* __Logging__
To minimize the log size only a changed state is logged. The logged timestamp is matching the beginning of its measurement period.
When not on power saving mode a movement is detected nearly instantaneous and the detection of a no movement period is delayed by the minimal no movement duration. To match the beginning of the measurement period a cached timestamp (_sleeplog.firstnomodate_) is logged.
On power saving mode the measurement period is fixed to 10 minutes and all logged timestamps are also set back 10 minutes.
On power saving mode the measurement period is fixed to 10 minutes and all logged timestamps are also set back 10 minutes.
To prevent a LOW_MEMORY,MEMORY error the log size is limited to 1500 entries, older entries will be overwritten.
---
### Control

View File

@ -98,6 +98,9 @@ exports = {
input = log;
}
// check and if neccessary reduce logsize to prevent low mem
if (input.length > 1500) input = input.slice(-1500);
// simple check for log plausibility
if (input[0].length > 1 && input[0][0] * 1 > 9E11) {
// write log to storage

View File

@ -2,7 +2,7 @@
"id":"sleeplog",
"name":"Sleep Log",
"shortName": "SleepLog",
"version": "0.04",
"version": "0.05",
"description": "Log and view your sleeping habits. This app derived from SleepPhaseAlarm and uses also the principe of Estimation of Stationary Sleep-segments (ESS). It also provides a power saving mode using the built in movement calculation.",
"icon": "app.png",
"type": "app",