fix: Announce timer value as hours and minutes when played from SF (#3293)

This commit is contained in:
philmoz
2023-04-19 21:59:08 +10:00
committed by GitHub
parent 8b40fb771a
commit 62a40f1c47
15 changed files with 338 additions and 353 deletions
+17 -17
View File
@@ -99,27 +99,27 @@ I18N_PLAY_FUNCTION(da, playDuration, int seconds PLAY_DURATION_ATT)
seconds = -seconds;
}
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, 0);
}
int hours, minutes;
hours = seconds / 3600;
seconds = seconds % 3600;
minutes = seconds / 60;
seconds = seconds % 60;
if (IS_PLAY_LONG_TIMER() && seconds >= 30) {
minutes += 1;
}
tmp = seconds / 60;
seconds %= 60;
if (tmp > 0) {
PLAY_NUMBER(tmp, UNIT_MINUTES, 0);
if (seconds > 0) PUSH_NUMBER_PROMPT(DA_PROMPT_AND);
if (hours > 0 || IS_PLAY_TIME()) {
PLAY_NUMBER(hours, UNIT_HOURS, 0);
}
if (seconds > 0) {
if (minutes > 0) {
PLAY_NUMBER(minutes, UNIT_MINUTES, 0);
}
if (!IS_PLAY_LONG_TIMER() && seconds > 0) {
if (minutes)
PUSH_NUMBER_PROMPT(DA_PROMPT_AND);
PLAY_NUMBER(seconds, UNIT_SECONDS, 0);
}
}