feat(timer): Long timer announces minutes only when gt 10 minutes (#1891)

* Long timer announce minutes only
* fix: Typo and minor formatting
* fix: Handle negative long timer also + minor formatting
This commit is contained in:
eshifri
2022-07-15 12:58:16 +10:00
committed by GitHub
parent 7cff5ef97a
commit 755365abfd
16 changed files with 360 additions and 271 deletions
+19 -12
View File
@@ -211,20 +211,27 @@ I18N_PLAY_FUNCTION(pl, playDuration, int seconds PLAY_DURATION_ATT)
seconds = -seconds;
}
uint8_t tmp = seconds / 3600;
seconds %= 3600;
if (tmp > 0 || IS_PLAY_TIME()) {
PLAY_NUMBER(tmp, UNIT_HOURS, ZENSKI);
}
uint8_t tmp;
if (IS_PLAY_LONG_TIMER()) {
tmp = seconds / 60;
if (seconds % 60 >= 30) tmp += 1;
if (tmp > 0) PLAY_NUMBER(tmp, UNIT_MINUTES, 0);
} else {
tmp = seconds / 3600;
seconds %= 3600;
if (tmp > 0 || IS_PLAY_TIME()) {
PLAY_NUMBER(tmp, UNIT_HOURS, ZENSKI);
}
tmp = seconds / 60;
seconds %= 60;
if (tmp > 0) {
PLAY_NUMBER(tmp, UNIT_MINUTES, ZENSKI);
}
tmp = seconds / 60;
seconds %= 60;
if (tmp > 0) {
PLAY_NUMBER(tmp, UNIT_MINUTES, ZENSKI);
}
if (seconds > 0) {
PLAY_NUMBER(seconds, UNIT_SECONDS, ZENSKI);
if (seconds > 0) {
PLAY_NUMBER(seconds, UNIT_SECONDS, ZENSKI);
}
}
}