Use Bangle.getHealthStatus("day").steps as fallback.

master
David Peer 2022-05-04 22:25:56 +02:00
parent ad038d4c34
commit 2a0b354b05
3 changed files with 10 additions and 7 deletions

View File

@ -1,4 +1,5 @@
0.01: Launch app.
0.02: 12k steps are 360 degrees - improves readability of steps.
0.03: Battery improvements through sleep (no minute updates) and partial updates of drawing.
0.04: Use alarm for timer instead of own alarm implementation.
0.04: Use alarm for timer instead of own alarm implementation.
0.05: Use internal step counter if no widget is available.

View File

@ -3,7 +3,7 @@
"name": "Not Analog",
"shortName":"Not Analog",
"icon": "notanalog.png",
"version":"0.04",
"version":"0.05",
"readme": "README.md",
"supports": ["BANGLEJS2"],
"description": "An analog watch face for people that can not read analog watch faces.",

View File

@ -88,20 +88,22 @@ Graphics.prototype.setNormalFont = function(scale) {
};
function getSteps() {
var steps = 0;
try{
if (WIDGETS.wpedom !== undefined) {
return WIDGETS.wpedom.getSteps();
steps = WIDGETS.wpedom.getSteps();
} else if (WIDGETS.activepedom !== undefined) {
return WIDGETS.activepedom.getSteps();
steps = WIDGETS.activepedom.getSteps();
} else {
steps = Bangle.getHealthStatus("day").steps;
}
} catch(ex) {
// In case we failed, we can only show 0 steps.
}
return 0;
}
return steps;
}
function drawBackground() {