health: move strideLength to new app myprofile

master
Erik Andresen 2023-12-10 09:18:21 +01:00
parent ef74b85ef9
commit b723512dce
4 changed files with 5 additions and 15 deletions

View File

@ -29,4 +29,4 @@
0.26: Implement API for activity fetching
0.27: Fix typo in daily summary graph code causing graph not to load
Fix daily summaries for 31st of the month
0.28: Calculate distance from steps if new stride length setting is set
0.28: Calculate distance from steps if myprofile is installed and stride length is set

View File

@ -13,7 +13,7 @@ To view data, run the `Health` app from your watch.
Stores:
* Heart rate
* Step count
* Step count (can calculate distance if myprofile is installed and stride length is set)
* Movement
## Settings

View File

@ -1,4 +1,5 @@
let settings;
const myprofile = require("Storage").readJSON("myprofile.json",1)||{};
function menuMain() {
E.showMenu({
@ -18,7 +19,7 @@ function menuStepCount() {
/*LANG*/"per hour": () => stepsPerHour(menuStepCount),
/*LANG*/"per day": () => stepsPerDay(menuStepCount)
};
if (settings.strideLength) {
if (myprofile.strideLength) {
menu[/*LANG*/"distance"] = () => menuDistance();
}
@ -26,7 +27,7 @@ function menuStepCount() {
}
function menuDistance() {
const distMult = 1*require("locale").distance(settings.strideLength, 2); // hackish: this removes the distance suffix, e.g. 'm'
const distMult = 1*require("locale").distance(myprofile.strideLength, 2); // hackish: this removes the distance suffix, e.g. 'm'
E.showMenu({
"": { title:/*LANG*/"Distance" },
/*LANG*/"< Back": () => menuStepCount(),

View File

@ -49,16 +49,5 @@
setSettings();
}
},
/*LANG*/"Stride length": {
value : settings.strideLength || 0.0,
min:0.01,
step:0.01,
format: v => require("locale").distance(v, 2),
onchange : v => {
settings.strideLength=v;
setSettings();
},
},
});
})