diff --git a/apps.json b/apps.json index f659fcbc4..322a90d96 100644 --- a/apps.json +++ b/apps.json @@ -4086,7 +4086,7 @@ "name": "Pastel Clock", "shortName": "Pastel", "version": "0.08", - "description": "A Configurable clock with custom fonts and background", + "description": "A Configurable clock with custom fonts and background. Has a cyclic information line that includes, day, date, battery, sunrise and sunset times", "icon": "pastel.png", "dependencies": {"mylocation":"widget"}, "screenshots": [{"url":"screenshot_pastel.png"}], diff --git a/apps/pastel/pastel.app.js b/apps/pastel/pastel.app.js index 8007ac031..aa4f6abf8 100644 --- a/apps/pastel/pastel.app.js +++ b/apps/pastel/pastel.app.js @@ -23,6 +23,7 @@ function extractTime(d){ var sunRise = "00:00"; var sunSet = "00:00"; +var drawCount = 0; function updateSunRiseSunSet(now, lat, lon, line){ // get today's sunlight times for lat/lon @@ -175,6 +176,10 @@ function draw() { g.setFontLatoSmall(); g.setFontAlign(0, -1); g.drawString((infoData[infoMode].calc()), w/2, h - 24 - 24); + + if (drawCount % 3600 == 0) + updateSunRiseSunSet(new Date(), location.lat, location.lon); + drawCount++; } // Only update when display turns on @@ -197,7 +202,6 @@ Bangle.setUI("clockupdown", btn=> { loadSettings(); loadFonts(); loadLocation(); -updateSunRiseSunSet(new Date(), location.lat, location.lon); g.clear(); var secondInterval = setInterval(draw, 1000);