Merge pull request #1406 from peerdavid/master

[LCARS clock] Version 0.15
pull/1411/head
Gordon Williams 2022-02-08 09:03:48 +00:00 committed by GitHub
commit 054232fae8
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 11 additions and 9 deletions

View File

@ -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.

View File

@ -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;
} }

View File

@ -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.",