Merge pull request #3582 from thyttan/edgeclk

edgeclk: live updates of step count
pull/3588/head
Rob Pilling 2024-09-23 22:10:18 +01:00 committed by GitHub
commit 4eb59fe28b
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
5 changed files with 21 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,9 @@
drawLower();
};
const onStep = function () {
drawSteps();
}
/* Lifecycle Functions
------------------------------------------------------------------------------*/
@ -298,6 +302,9 @@
// Charging event signals when charging status changes:
Bangle.on('charging', onCharging);
// Continously update step count when they happen:
if (settings.redrawOnStep) Bangle.on('step', onStep);
};
const deregisterEvents = function () {
@ -306,6 +313,7 @@
Bangle.removeListener('health', onHealth);
Bangle.removeListener('lock', onLock);
Bangle.removeListener('charging', onCharging);
if (settings.redrawOnStep) 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();
},
},
});
})