[pebble] Get steps from built-in step counter instead of pedometer widget

See #1697
pull/1705/head
Alessandro Cocco 2022-04-15 10:14:12 +02:00
parent dd365cf865
commit bf6d37be92
4 changed files with 4 additions and 12 deletions

View File

@ -6,4 +6,5 @@
0.06: Add dependancy on Pedometer Widget
0.07: Fix icon and ong file to 48x48
0.08: Add theme options and optional lock symbol
0.09: Add support for internationalization (LANG placeholders + "locale" module)
0.09 (1): Add support for internationalization (LANG placeholders + "locale" module)
0.09 (2): Get steps from built-in step counter (widpedom no more needed, fix #1697)

View File

@ -5,8 +5,6 @@
* Designed specifically for Bangle 2
* A choice of 6 different background colous through its settings menu. Goto *Settings* → *Apps* → *Pebble*.
* Supports the Light and Dark themes (or set theme independently)
* Uses pedometer widget to get latest step count
* Dependant apps are installed when Pebble installs
* Uses the whole screen, widgets are made invisible but still run in the background
* When battery is less than 30% main screen goes Red
* Optionally show a lock symbol when screen is locked (default off, enable in Settings)

View File

@ -4,7 +4,6 @@
"shortName": "Pebble",
"version": "0.09",
"description": "A pebble style clock to keep the rebellion going",
"dependencies": {"widpedom":"app"},
"readme": "README.md",
"icon": "pebble.png",
"screenshots": [{"url":"pebble_screenshot.png"}],

View File

@ -32,6 +32,7 @@ function draw() {
let dayOfWeek = locale.dow(date, 1).toUpperCase();
let dayOfMonth = date.getDate();
let time = locale.time(date, 1);
let steps = Bangle.getHealthStatus("day").steps;
const t = 6;
if (E.getBattery() < 30) {
@ -55,7 +56,7 @@ function draw() {
g.setFontLECO1976Regular22();
g.setFontAlign(0, -1);
g.drawString(dayOfWeek, w/4, ha);
g.drawString(getSteps(), 3*w/4, ha);
g.drawString(steps, 3*w/4, ha);
// time
// white on red for battery warning
@ -101,13 +102,6 @@ function drawCalendar(x,y,wi,th,str) {
g.drawString(str, x + wi/2, y + wi/2 + th);
}
function getSteps() {
if (WIDGETS.wpedom !== undefined) {
return WIDGETS.wpedom.getSteps();
}
return '????';
}
function loadThemeColors() {
theme = {fg: g.theme.fg, bg: g.theme.bg, day: g.toColor(0,0,0)};
if (settings.theme === "Dark") {