edgeclk: live updates of step count

pull/3582/head
thyttan 2024-09-21 23:18:04 +02:00
parent 27cd1580db
commit 7a47e33441
5 changed files with 22 additions and 3 deletions

View File

@ -1,3 +1,4 @@
0.01: Initial release.
0.02: Fix reset of progress bars on midnight. Fix display of 100k+ steps.
0.03: Added option to display weather.
0.04: Added option to display live updates of step count.

View File

@ -20,12 +20,13 @@ The appearance is highly configurable. In the settings menu you can:
- Set the daily step goal.
- En- or disable the individual progress bars.
- Set if your week should start with Monday or Sunday (for week progress bar).
- Toggle live step count updates.*
*) Hiding seconds should further reduce power consumption as the draw interval is prolonged as well.
*) Hiding seconds and leaving live steps off should further reduce power consumption as the draw interval is prolonged as well.
The clock implements Fast Loading for faster switching to and fro.
## Contributors
- [tinxx](https://github.com/tinxx)
- [peerdavid](https://github.com/peerdavid)

View File

@ -14,6 +14,7 @@
weekBar: true,
mondayFirst: true,
dayBar: true,
liveSteps: false,
}, require('Storage').readJSON('edgeclk.settings.json', true) || {});
/* Runtime Variables
@ -279,6 +280,10 @@
drawLower();
};
const onStep = function () {
if (settings.redrawOnStep) drawSteps();
}
/* Lifecycle Functions
------------------------------------------------------------------------------*/
@ -298,6 +303,9 @@
// Charging event signals when charging status changes:
Bangle.on('charging', onCharging);
// Continously update step count when they happen:
Bangle.on('step', onStep);
};
const deregisterEvents = function () {
@ -306,6 +314,7 @@
Bangle.removeListener('health', onHealth);
Bangle.removeListener('lock', onLock);
Bangle.removeListener('charging', onCharging);
Bangle.removeListener('step', onStep);
};
const startTimers = function () {

View File

@ -2,7 +2,7 @@
"id": "edgeclk",
"name": "Edge Clock",
"shortName": "Edge Clock",
"version": "0.03",
"version": "0.04",
"description": "Crisp clock with perfect readability.",
"readme": "README.md",
"icon": "app.png",

View File

@ -14,6 +14,7 @@
weekBar: true,
mondayFirst: true,
dayBar: true,
redrawOnStep: false,
};
const saved_settings = storage.readJSON(SETTINGS_FILE, true);
@ -121,5 +122,12 @@
save();
},
},
'Live steps': {
value: settings.redrawOnStep,
onchange: () => {
settings.redrawOnStep = !settings.redrawOnStep;
save();
},
},
});
})