Merge pull request #3066 from bobrippling/sunrise-drawtime

sunrise: redraw the clock exactly when a minute ticks
pull/3070/head
Gordon Williams 2023-11-01 08:43:16 +00:00 committed by GitHub
commit 8d0859f24e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 8 additions and 2 deletions

View File

@ -3,3 +3,4 @@
0.03: Show day/month, add animations, fix !mylocation and text glitch
0.04: Always show the widgets, swifter animations and lighter sea line
0.05: Fixed hours increasing too early, added missing 23 o'clock, simplified code
0.06: Draw the screen exactly on the minute boundary

View File

@ -358,13 +358,18 @@ function initialAnimation () {
initialAnimationFrame();
}
function renderAndQueue() {
setTimeout(renderAndQueue, 60000 - (Date.now() % 60000));
renderScreen();
}
function main () {
sunRiseX = xfromTime(sunrise.getHours() + sunrise.getMinutes() / 60);
sunSetX = xfromTime(sunset.getHours() + sunset.getMinutes() / 60);
g.setBgColor(0, 0, 0);
g.clear();
setInterval(renderScreen, 60 * 1000);
renderAndQueue();
initialAnimation();
}

View File

@ -2,7 +2,7 @@
"id": "sunrise",
"name": "Sunrise",
"shortName": "Sunrise",
"version": "0.05",
"version": "0.06",
"type": "clock",
"description": "Show sunrise and sunset times",
"icon": "app.png",