touchtimer: FIX countdown buzz to be in last 5 seconds

- The countdown buzz was happening on each minute and not only on the
  last 5 seconds
pull/1636/head
Brendan Hubble 2022-03-29 18:59:05 +11:00
parent e482707e89
commit 599f20aca9
3 changed files with 8 additions and 2 deletions

View File

@ -2,3 +2,4 @@
0.02: Add settings menu
0.03: Add ability to repeat last timer
0.04: Add 5 second count down buzzer
0.05: Fix 5 second count down buzzer to be only in the final 5 seconds

View File

@ -129,7 +129,12 @@ var main = () => {
// Buzz lightly when there are less then 5 seconds left
if (settings.countDownBuzz) {
var remainingSeconds = timerCountDown.getAdjustedTime().seconds;
if (remainingSeconds <= 5 && remainingSeconds > 0) {
var remainingMinutes = timerCountDown.getAdjustedTime().minutes;
var remainingHours = timerCountDown.getAdjustedTime().hours;
if ( remainingSeconds <= 5
&& remainingSeconds > 0
&& remainingMinutes <= 0
&& remainingHours <= 0) {
Bangle.buzz();
}
}

View File

@ -2,7 +2,7 @@
"id": "touchtimer",
"name": "Touch Timer",
"shortName": "Touch Timer",
"version": "0.04",
"version": "0.05",
"description": "Quickly and easily create a timer with touch-only input. The time can be easily set with a number pad.",
"icon": "app.png",
"tags": "tools",