1
0
Fork 0

health: include step data for today

master
Erik Andresen 2023-12-11 07:32:58 +01:00
parent b639dd41f9
commit 799c0b4e89
1 changed files with 4 additions and 0 deletions

View File

@ -72,6 +72,10 @@ function stepsPerDay(back, mult) {
current_selection = "stepsPerDay"; current_selection = "stepsPerDay";
var data = new Uint16Array(32); var data = new Uint16Array(32);
require("health").readDailySummaries(new Date(), h=>data[h.day]+=h.steps); require("health").readDailySummaries(new Date(), h=>data[h.day]+=h.steps);
// Include data for today
if (data[(new Date()).getDate()] === 0) {
data[(new Date()).getDate()] = Bangle.getHealthStatus("day").steps;
}
if (mult !== undefined) { if (mult !== undefined) {
// Calculate distance from steps // Calculate distance from steps
data.forEach((d, i) => data[i] = d*mult+0.5); data.forEach((d, i) => data[i] = d*mult+0.5);