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