Skip to content

Commit

Permalink
Merge pull request espruino#1848 from myxor/circlesclock_v0.12
Browse files Browse the repository at this point in the history
Circlesclock v0.12
  • Loading branch information
gfwilliams committed May 25, 2022
2 parents e96db5c + 5358fec commit b46a9ea
Show file tree
Hide file tree
Showing 5 changed files with 22 additions and 10 deletions.
1 change: 1 addition & 0 deletions apps/circlesclock/ChangeLog
Original file line number Diff line number Diff line change
Expand Up @@ -23,3 +23,4 @@
0.11: New color option: foreground color
Improve performance, reduce memory usage
Small optical adjustments
0.12: Allow configuration of update interval
4 changes: 2 additions & 2 deletions apps/circlesclock/app.js
Original file line number Diff line number Diff line change
Expand Up @@ -848,8 +848,8 @@ Bangle.loadWidgets();

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

draw();
3 changes: 2 additions & 1 deletion apps/circlesclock/default.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,5 +21,6 @@
"circle2colorizeIcon": true,
"circle3colorizeIcon": true,
"circle4colorizeIcon": false,
"hrmValidity": 60
"hrmValidity": 60,
"updateInterval": 60
}
2 changes: 1 addition & 1 deletion apps/circlesclock/metadata.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{ "id": "circlesclock",
"name": "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",
"icon": "app.png",
"screenshots": [{"url":"screenshot-dark.png"}, {"url":"screenshot-light.png"}, {"url":"screenshot-dark-4.png"}, {"url":"screenshot-light-4.png"}],
Expand Down
22 changes: 16 additions & 6 deletions apps/circlesclock/settings.js
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,16 @@
min: 0, max: 2,
format: v => weatherData[v],
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);
Expand Down Expand Up @@ -100,7 +110,7 @@
/*LANG*/'valid period': {
value: settings.hrmValidity,
min: 10,
max : 600,
max : 1800,
step: 10,
format: x => {
return x + "s";
Expand All @@ -117,19 +127,19 @@
/*LANG*/'< Back': ()=>showMainMenu(),
/*LANG*/'goal': {
value: settings.stepGoal,
min: 2000,
min: 1000,
max : 50000,
step: 2000,
step: 500,
format: x => {
return x;
},
onchange: x => save('stepGoal', x),
},
/*LANG*/'distance goal': {
value: settings.stepDistanceGoal,
min: 2000,
max : 30000,
step: 1000,
min: 1000,
max : 50000,
step: 500,
format: x => {
return x;
},
Expand Down

0 comments on commit b46a9ea

Please sign in to comment.