mirror of https://github.com/espruino/BangleApps
commit
054232fae8
|
@ -11,4 +11,5 @@
|
|||
0.11: Show the gadgetbridge weather temperature (settings).
|
||||
0.12: Added humidity as an option to display.
|
||||
0.13: Improved battery visualization.
|
||||
0.14: Added altitude as an option to display.
|
||||
0.14: Added altitude as an option to display.
|
||||
0.15: Using wpedom to count steps.
|
|
@ -448,16 +448,17 @@ function draw(){
|
|||
* Step counter via widget
|
||||
*/
|
||||
function getSteps() {
|
||||
var steps = 0;
|
||||
let health;
|
||||
try {
|
||||
health = require("health");
|
||||
try{
|
||||
if (WIDGETS.wpedom !== undefined) {
|
||||
return WIDGETS.wpedom.getSteps();
|
||||
} else if (WIDGETS.activepedom !== undefined) {
|
||||
return WIDGETS.activepedom.getSteps();
|
||||
}
|
||||
} catch(ex) {
|
||||
return steps;
|
||||
// In case we failed, we can only show 0 steps.
|
||||
}
|
||||
|
||||
health.readDay(new Date(), h=>steps+=h.steps);
|
||||
return steps;
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -3,7 +3,7 @@
|
|||
"name": "LCARS Clock",
|
||||
"shortName":"LCARS",
|
||||
"icon": "lcars.png",
|
||||
"version":"0.14",
|
||||
"version":"0.15",
|
||||
"readme": "README.md",
|
||||
"supports": ["BANGLEJS2"],
|
||||
"description": "Library Computer Access Retrieval System (LCARS) clock.",
|
||||
|
|
Loading…
Reference in New Issue