diff --git a/apps/lcars/ChangeLog b/apps/lcars/ChangeLog index 1abd519ab..8e26ec9d2 100644 --- a/apps/lcars/ChangeLog +++ b/apps/lcars/ChangeLog @@ -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. \ No newline at end of file +0.14: Added altitude as an option to display. +0.15: Using wpedom to count steps. \ No newline at end of file diff --git a/apps/lcars/lcars.app.js b/apps/lcars/lcars.app.js index 81a501481..c020c49e8 100644 --- a/apps/lcars/lcars.app.js +++ b/apps/lcars/lcars.app.js @@ -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; } diff --git a/apps/lcars/metadata.json b/apps/lcars/metadata.json index 2d04ebdf6..9724e98c5 100644 --- a/apps/lcars/metadata.json +++ b/apps/lcars/metadata.json @@ -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.",