From 1c692088860bbd9fc0406e8b8d2db0d32640463b Mon Sep 17 00:00:00 2001 From: Gordon Williams Date: Tue, 1 Jul 2025 09:54:57 +0100 Subject: [PATCH] sleeplog 0.20: Increase default sleep thresholds, tweak settings to allow higher ones to be chosen --- apps/sleeplog/ChangeLog | 1 + apps/sleeplog/boot.js | 4 ++-- apps/sleeplog/metadata.json | 2 +- apps/sleeplog/settings.js | 10 +++++----- 4 files changed, 9 insertions(+), 8 deletions(-) diff --git a/apps/sleeplog/ChangeLog b/apps/sleeplog/ChangeLog index 9c83460ce..6aa757bc4 100644 --- a/apps/sleeplog/ChangeLog +++ b/apps/sleeplog/ChangeLog @@ -15,3 +15,4 @@ 0.17: Minor code improvements 0.18: Add back as a function to prevent translation making it a menu entry 0.19: Write sleep state into health event's .activity field +0.20: Increase default sleep thresholds, tweak settings to allow higher ones to be chosen diff --git a/apps/sleeplog/boot.js b/apps/sleeplog/boot.js index b67907f76..d9f51288c 100644 --- a/apps/sleeplog/boot.js +++ b/apps/sleeplog/boot.js @@ -11,8 +11,8 @@ global.sleeplog = { // threshold settings maxAwake: 36E5, // [ms] maximal awake time to count for consecutive sleep minConsec: 18E5, // [ms] minimal time to count for consecutive sleep - deepTh: 100, // threshold for deep sleep - lightTh: 200, // threshold for light sleep + deepTh: 150, // threshold for deep sleep + lightTh: 300, // threshold for light sleep wearTemp: 19.5, // temperature threshold to count as worn }, require("Storage").readJSON("sleeplog.json", true) || {}) }; diff --git a/apps/sleeplog/metadata.json b/apps/sleeplog/metadata.json index 95d9846ed..13849bc5d 100644 --- a/apps/sleeplog/metadata.json +++ b/apps/sleeplog/metadata.json @@ -2,7 +2,7 @@ "id":"sleeplog", "name":"Sleep Log", "shortName": "SleepLog", - "version": "0.19", + "version": "0.20", "description": "Log and view your sleeping habits. This app uses built in movement calculations. View data from Bangle, or from the web app.", "icon": "app.png", "type": "app", diff --git a/apps/sleeplog/settings.js b/apps/sleeplog/settings.js index 2d9da361f..71d360e84 100644 --- a/apps/sleeplog/settings.js +++ b/apps/sleeplog/settings.js @@ -11,8 +11,8 @@ // threshold settings maxAwake: 36E5, // [ms] maximal awake time to count for consecutive sleep minConsec: 18E5, // [ms] minimal time to count for consecutive sleep - deepTh: 100, // threshold for deep sleep - lightTh: 200, // threshold for light sleep + deepTh: 150, // threshold for deep sleep + lightTh: 300, // threshold for light sleep wearTemp: 19.5, // temperature threshold to count as worn // app settings breakToD: 12, // [h] time of day when to start/end graphs @@ -324,9 +324,9 @@ }, /*LANG*/"Deep Sleep": { value: settings.deepTh, - step: 1, + step: 10, min: 30, - max: 200, + max: 500, wrap: true, noList: true, onchange: v => { @@ -338,7 +338,7 @@ value: settings.lightTh, step: 10, min: 100, - max: 400, + max: 800, wrap: true, noList: true, onchange: v => {