myprofile: Add weight

pull/3192/head
Erik Andresen 2024-02-11 09:32:08 +01:00
parent 49fbc6a252
commit 9271c2e6ca
4 changed files with 16 additions and 1 deletions

2
apps/myprofile/ChangeLog Normal file
View File

@ -0,0 +1,2 @@
0.01: New App!
0.02: Add weight

View File

@ -10,6 +10,7 @@ Configure your personal profile. All settings are optional and are only stored o
| HR max | maximum heart rate | BPM | BPM | 60 | Use maximum value when exercising.<br/> If unsure set to 220-age. |
| HR min | minimum heart rate | BPM | BPM | 200 | Measure your heart rate after waking up |
| Height | Body height | local length unit | meter | 0 (=not set) | - |
| Weight | Body weight | kg | kf | 0 (=not set) | - |
| Stride length | distance traveled with one step | local length unit | meter | 0 (=not set) | Walk 10 steps and divide the travelled distance by 10 |
## Developer notes

View File

@ -3,7 +3,7 @@
"shortName":"My Profile",
"icon": "app.png",
"type": "settings",
"version":"0.01",
"version":"0.02",
"description": "Configure your personal profile. All settings are optional and only stored on the watch.",
"readme": "README.md",
"tags": "tool,utility",

View File

@ -7,6 +7,7 @@
strideLength: 0, // 0 = not set
birthday: '1970-01-01',
height: 0, // 0 = not set
weight: 0, // 0 = not set
}, require('Storage').readJSON(FILE, true) || {});
function writeProfile() {
@ -101,6 +102,17 @@
}
},
/*LANG*/"Weight": {
value: myprofile.weight,
min:0,
step:1,
format: v => v ? v + "kg" : '-',
onchange: v => {
myprofile.weight=v;
writeProfile();
},
},
/*LANG*/'HR max': {
format: v => /*LANG*/`${v} BPM`,
value: myprofile.maxHrm,