shortcuts: add missing voice for sleep shortcuts without name

Change-Id: I1178be8c82671d64746297306b27ee9ccb50c1a2
This commit is contained in:
Christian Soffke 2025-06-06 18:57:28 +02:00
parent e9d0be5dfd
commit 94cf3403e2
4 changed files with 10 additions and 9 deletions

View file

@ -1555,13 +1555,14 @@ int toggle_sleeptimer(void)
return 0;
}
void talk_sleeptimer(void)
void talk_sleeptimer(int custom_duration)
{
int seconds = get_sleep_timer();
int seconds = custom_duration < 0 ? get_sleep_timer() : custom_duration*60;
long talk_ids[] = {
seconds ? LANG_SLEEP_TIMER_CANCEL_CURRENT
: LANG_SLEEP_TIMER_START_CURRENT,
custom_duration >= 0 ? LANG_SLEEP_TIMER :
(seconds ? LANG_SLEEP_TIMER_CANCEL_CURRENT : LANG_SLEEP_TIMER_START_CURRENT),
VOICE_PAUSE,
custom_duration == 0 ? LANG_OFF :
(seconds ? seconds_to_min(seconds)
: global_settings.sleeptimer_duration) | UNIT_MIN << UNIT_SHIFT,
TALK_FINAL_ID