diff --git a/apps/pastel/ChangeLog b/apps/pastel/ChangeLog index 00090fcd1..c81d0cacc 100644 --- a/apps/pastel/ChangeLog +++ b/apps/pastel/ChangeLog @@ -9,3 +9,5 @@ 0.09: Added dependancy on Pedometer Widget 0.10: Added Weather line, fixed issues on a Bangle 1, update every minute 0.11: Changed cycle on minute to prevInfo to avoid the 2nd one being the blank line +0.12: Removed dependancy on widpedom, now uses Bangle.getHealthStatus("day").steps + which requires 2.11.27 firmware to reset at midnight diff --git a/apps/pastel/metadata.json b/apps/pastel/metadata.json index ff0d11256..1a311599c 100644 --- a/apps/pastel/metadata.json +++ b/apps/pastel/metadata.json @@ -2,10 +2,10 @@ "id": "pastel", "name": "Pastel Clock", "shortName": "Pastel", - "version": "0.11", - "description": "A Configurable clock with custom fonts, background and weather display. Has a cyclic information line that includes, day, date, battery, sunrise and sunset times", + "version": "0.12", + "description": "A Configurable clock with custom fonts, background and weather display. Has a cyclic information line that includes, day, date, battery, sunrise and sunset times. Requires firmware 2.11.27", "icon": "pastel.png", - "dependencies": {"mylocation":"app", "widpedom":"app","weather":"app"}, + "dependencies": {"mylocation":"app","weather":"app"}, "screenshots": [{"url":"screenshot_pastel.png"}, {"url":"weather_icons.png"}], "type": "clock", "tags": "clock, weather, tool", diff --git a/apps/pastel/pastel.app.js b/apps/pastel/pastel.app.js index 3e64cdd9c..d9dfb0da5 100644 --- a/apps/pastel/pastel.app.js +++ b/apps/pastel/pastel.app.js @@ -64,13 +64,15 @@ function loadFonts() { require("f_lato").add(Graphics); } -function stepsWidget() { - if (WIDGETS.activepedom !== undefined) { - return WIDGETS.activepedom; - } else if (WIDGETS.wpedom !== undefined) { - return WIDGETS.wpedom; +function getSteps() { + try { + return Bangle.getHealthStatus("day").steps; + } catch (e) { + if (WIDGETS.wpedom !== undefined) + return WIDGETS.wpedom.getSteps(); + else + return '???' } - return undefined; } const infoData = { @@ -79,7 +81,7 @@ const infoData = { ID_DAY: { calc: () => {var d = require("locale").dow(new Date).toLowerCase(); return d[0].toUpperCase() + d.substring(1);} }, ID_SR: { calc: () => 'Sunrise: ' + sunRise }, ID_SS: { calc: () => 'Sunset: ' + sunSet }, - ID_STEP: { calc: () => 'Steps: ' + stepsWidget().getSteps() }, + ID_STEP: { calc: () => 'Steps: ' + getSteps() }, ID_BATT: { calc: () => 'Battery: ' + E.getBattery() + '%' }, ID_MEM: { calc: () => {var val = process.memory(); return 'Ram: ' + Math.round(val.usage*100/val.total) + '%';} }, ID_ID: { calc: () => {var val = NRF.getAddress().split(':'); return 'Id: ' + val[4] + val[5];} },