mirror of https://github.com/espruino/BangleApps
Merge pull request #1330 from hughbarney/master
Pastel: remove dependancy on widpedompull/1331/head
commit
ee24887d09
|
@ -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
|
||||
|
|
|
@ -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",
|
||||
|
|
|
@ -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];} },
|
||||
|
|
Loading…
Reference in New Issue