shortcuts: allow empty name for sleep shortcuts with default duration

missed this in f631bfe

Change-Id: Ifdb3ffc04b49133b770850b98399605c04742f6e
This commit is contained in:
Christian Soffke 2024-05-13 21:26:30 +02:00
parent b94e5d77fe
commit 556b466f05

View file

@ -186,7 +186,11 @@ static bool verify_shortcut(struct shortcut* sc)
case SHORTCUT_SETTING: case SHORTCUT_SETTING:
return sc->u.setting != NULL; return sc->u.setting != NULL;
case SHORTCUT_TIME: case SHORTCUT_TIME:
return sc->name[0] != '\0'; #if CONFIG_RTC
if (sc->u.timedata.talktime)
return sc->name[0] != '\0';
#endif
return sc->name[0] != '\0' || sc->u.timedata.sleep_timeout < 0;
case SHORTCUT_DEBUGITEM: case SHORTCUT_DEBUGITEM:
case SHORTCUT_SEPARATOR: case SHORTCUT_SEPARATOR:
case SHORTCUT_SHUTDOWN: case SHORTCUT_SHUTDOWN: