mirror of https://github.com/espruino/BangleApps
edgeclk: live updates of step count
parent
27cd1580db
commit
7a47e33441
|
@ -1,3 +1,4 @@
|
||||||
0.01: Initial release.
|
0.01: Initial release.
|
||||||
0.02: Fix reset of progress bars on midnight. Fix display of 100k+ steps.
|
0.02: Fix reset of progress bars on midnight. Fix display of 100k+ steps.
|
||||||
0.03: Added option to display weather.
|
0.03: Added option to display weather.
|
||||||
|
0.04: Added option to display live updates of step count.
|
||||||
|
|
|
@ -20,8 +20,9 @@ The appearance is highly configurable. In the settings menu you can:
|
||||||
- Set the daily step goal.
|
- Set the daily step goal.
|
||||||
- En- or disable the individual progress bars.
|
- En- or disable the individual progress bars.
|
||||||
- Set if your week should start with Monday or Sunday (for week progress bar).
|
- 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.
|
The clock implements Fast Loading for faster switching to and fro.
|
||||||
|
|
||||||
|
|
|
@ -14,6 +14,7 @@
|
||||||
weekBar: true,
|
weekBar: true,
|
||||||
mondayFirst: true,
|
mondayFirst: true,
|
||||||
dayBar: true,
|
dayBar: true,
|
||||||
|
liveSteps: false,
|
||||||
}, require('Storage').readJSON('edgeclk.settings.json', true) || {});
|
}, require('Storage').readJSON('edgeclk.settings.json', true) || {});
|
||||||
|
|
||||||
/* Runtime Variables
|
/* Runtime Variables
|
||||||
|
@ -279,6 +280,10 @@
|
||||||
drawLower();
|
drawLower();
|
||||||
};
|
};
|
||||||
|
|
||||||
|
const onStep = function () {
|
||||||
|
if (settings.redrawOnStep) drawSteps();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
/* Lifecycle Functions
|
/* Lifecycle Functions
|
||||||
------------------------------------------------------------------------------*/
|
------------------------------------------------------------------------------*/
|
||||||
|
@ -298,6 +303,9 @@
|
||||||
|
|
||||||
// Charging event signals when charging status changes:
|
// Charging event signals when charging status changes:
|
||||||
Bangle.on('charging', onCharging);
|
Bangle.on('charging', onCharging);
|
||||||
|
|
||||||
|
// Continously update step count when they happen:
|
||||||
|
Bangle.on('step', onStep);
|
||||||
};
|
};
|
||||||
|
|
||||||
const deregisterEvents = function () {
|
const deregisterEvents = function () {
|
||||||
|
@ -306,6 +314,7 @@
|
||||||
Bangle.removeListener('health', onHealth);
|
Bangle.removeListener('health', onHealth);
|
||||||
Bangle.removeListener('lock', onLock);
|
Bangle.removeListener('lock', onLock);
|
||||||
Bangle.removeListener('charging', onCharging);
|
Bangle.removeListener('charging', onCharging);
|
||||||
|
Bangle.removeListener('step', onStep);
|
||||||
};
|
};
|
||||||
|
|
||||||
const startTimers = function () {
|
const startTimers = function () {
|
||||||
|
|
|
@ -2,7 +2,7 @@
|
||||||
"id": "edgeclk",
|
"id": "edgeclk",
|
||||||
"name": "Edge Clock",
|
"name": "Edge Clock",
|
||||||
"shortName": "Edge Clock",
|
"shortName": "Edge Clock",
|
||||||
"version": "0.03",
|
"version": "0.04",
|
||||||
"description": "Crisp clock with perfect readability.",
|
"description": "Crisp clock with perfect readability.",
|
||||||
"readme": "README.md",
|
"readme": "README.md",
|
||||||
"icon": "app.png",
|
"icon": "app.png",
|
||||||
|
|
|
@ -14,6 +14,7 @@
|
||||||
weekBar: true,
|
weekBar: true,
|
||||||
mondayFirst: true,
|
mondayFirst: true,
|
||||||
dayBar: true,
|
dayBar: true,
|
||||||
|
redrawOnStep: false,
|
||||||
};
|
};
|
||||||
|
|
||||||
const saved_settings = storage.readJSON(SETTINGS_FILE, true);
|
const saved_settings = storage.readJSON(SETTINGS_FILE, true);
|
||||||
|
@ -121,5 +122,12 @@
|
||||||
save();
|
save();
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
'Live steps': {
|
||||||
|
value: settings.redrawOnStep,
|
||||||
|
onchange: () => {
|
||||||
|
settings.redrawOnStep = !settings.redrawOnStep;
|
||||||
|
save();
|
||||||
|
},
|
||||||
|
},
|
||||||
});
|
});
|
||||||
})
|
})
|
||||||
|
|
Loading…
Reference in New Issue