1
0
Fork 0

Merge pull request #3129 from LeonMatthes/calclock

CalClock: No buzz during quiet hours
master
Rob Pilling 2023-12-14 23:12:39 +00:00 committed by GitHub
commit 6c0bb9d9e3
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 6 additions and 3 deletions

View File

@ -5,3 +5,4 @@
0.05: Show calendar colors & improved all day events. 0.05: Show calendar colors & improved all day events.
0.06: Improved multi-line locations & titles 0.06: Improved multi-line locations & titles
0.07: Buzz 30, 15 and 1 minute before an event 0.07: Buzz 30, 15 and 1 minute before an event
0.08: No buzz during quiet hours & tweaked 30-minute buzz

View File

@ -119,10 +119,12 @@ function fullRedraw() {
function buzzForEvents() { function buzzForEvents() {
let nextEvent = next[0]; if (!nextEvent) return; let nextEvent = next[0]; if (!nextEvent) return;
if (nextEvent.allDay) return; // No buzz for all day events or events before 7am
// TODO: make this configurable
if (nextEvent.allDay || (new Date(nextEvent.timestamp * 1000)).getHours() < 7) return;
let minToEvent = Math.round((nextEvent.timestamp - getTime()) / 60.0); let minToEvent = Math.round((nextEvent.timestamp - getTime()) / 60.0);
switch (minToEvent) { switch (minToEvent) {
case 30: require("buzz").pattern(","); break; case 30: require("buzz").pattern(":"); break;
case 15: require("buzz").pattern(", ,"); break; case 15: require("buzz").pattern(", ,"); break;
case 1: require("buzz").pattern(": : :"); break; case 1: require("buzz").pattern(": : :"); break;
} }

View File

@ -2,7 +2,7 @@
"id": "calclock", "id": "calclock",
"name": "Calendar Clock", "name": "Calendar Clock",
"shortName": "CalClock", "shortName": "CalClock",
"version": "0.07", "version": "0.08",
"description": "Show the current and upcoming events synchronized from Gadgetbridge", "description": "Show the current and upcoming events synchronized from Gadgetbridge",
"icon": "calclock.png", "icon": "calclock.png",
"type": "clock", "type": "clock",