Allow configuration of update interval

master
Marco H 2022-05-18 20:13:57 +02:00
parent 437630574d
commit 5358fec9ba
5 changed files with 16 additions and 4 deletions

View File

@ -23,3 +23,4 @@
0.11: New color option: foreground color 0.11: New color option: foreground color
Improve performance, reduce memory usage Improve performance, reduce memory usage
Small optical adjustments Small optical adjustments
0.12: Allow configuration of update interval

View File

@ -848,8 +848,8 @@ Bangle.loadWidgets();
// schedule a draw for the next minute // schedule a draw for the next minute
setTimeout(function() { setTimeout(function() {
// draw every 60 seconds // draw in interval
setInterval(draw,60000); setInterval(draw, settings.updateInterval * 1000);
}, 60000 - (Date.now() % 60000)); }, 60000 - (Date.now() % 60000));
draw(); draw();

View File

@ -21,5 +21,6 @@
"circle2colorizeIcon": true, "circle2colorizeIcon": true,
"circle3colorizeIcon": true, "circle3colorizeIcon": true,
"circle4colorizeIcon": false, "circle4colorizeIcon": false,
"hrmValidity": 60 "hrmValidity": 60,
"updateInterval": 60
} }

View File

@ -1,7 +1,7 @@
{ "id": "circlesclock", { "id": "circlesclock",
"name": "Circles clock", "name": "Circles clock",
"shortName":"Circles clock", "shortName":"Circles clock",
"version":"0.11", "version":"0.12",
"description": "A clock with three or four circles for different data at the bottom in a probably familiar style", "description": "A clock with three or four circles for different data at the bottom in a probably familiar style",
"icon": "app.png", "icon": "app.png",
"screenshots": [{"url":"screenshot-dark.png"}, {"url":"screenshot-light.png"}, {"url":"screenshot-dark-4.png"}, {"url":"screenshot-light-4.png"}], "screenshots": [{"url":"screenshot-dark.png"}, {"url":"screenshot-light.png"}, {"url":"screenshot-dark-4.png"}, {"url":"screenshot-light-4.png"}],

View File

@ -58,6 +58,16 @@
min: 0, max: 2, min: 0, max: 2,
format: v => weatherData[v], format: v => weatherData[v],
onchange: x => save('weatherCircleData', weatherData[x]), onchange: x => save('weatherCircleData', weatherData[x]),
},
/*LANG*/'update interval': {
value: settings.updateInterval,
min: 0,
max : 3600,
step: 30,
format: x => {
return x + 's';
},
onchange: x => save('updateInterval', x),
} }
}; };
E.showMenu(menu); E.showMenu(menu);