let clockInfoItems = require("clock_info").load();
let clockInfoItemsBangle = clockInfoItems.find(i=>i.name=="Bangle");
if (clockInfoItemsBangle) {
clockInfoItemsBangle.items.push({ name : "MyItem",
get : () => {
},
show : function() {
},
hide : function() {
});
}
... or you could just make your own standalone clockinfo like is shown on https://www.espruino.com/Bangle.js+Clock+Info and then it'd work with any clock you install? That might be more sensible...
However I'm not entirely sure where the distance module is defined for require("distance")? I don't see it used in any other apps.
What kind of distance are you after? The distance from a run that you're currently doing in the Run app, or the distance that I think some clocks display which is based on the step count multiplied by an average step size?
Espruino is a JavaScript interpreter for low-power Microcontrollers. This site is both a support community for Espruino and a place to share what you are working on.
Hi! Yes, this is definitely the right place to ask.
The first port of call is always to make sure you load your app with the Web IDE running and see if any errors appear.
I guess you're adding the clockinfo here? https://github.com/4o4R/Bangle-Meander/blob/main/clean%20meander.app.js#L88-L92
I'm pretty sure you're putting the clockinfo in the wrong place - if you just want to add it to your clock, it's best to start from the code from an app that creates its own clockinfos like: https://github.com/espruino/BangleApps/blob/master/apps/analogquadclk/app.js#L158-L210
It does something like:
... or you could just make your own standalone clockinfo like is shown on https://www.espruino.com/Bangle.js+Clock+Info and then it'd work with any clock you install? That might be more sensible...
However I'm not entirely sure where the
distance
module is defined forrequire("distance")
? I don't see it used in any other apps.What kind of distance are you after? The distance from a run that you're currently doing in the
Run
app, or the distance that I think some clocks display which is based on the step count multiplied by an average step size?