feat: Timer Voice & Haptic option, show elapsed speak time value when countdown (#2711)

* fix "odd" elapsed time announcement

* announce elapsed seconds

* Add support for "Beeps and Haptic" and "Voice and Haptic" for timer countdown.
This commit is contained in:
eshifri
2023-01-23 20:00:12 +10:00
committed by GitHub
parent 0b8e4c6003
commit 8e8e78671a
45 changed files with 243 additions and 136 deletions
+5 -1
View File
@@ -294,6 +294,7 @@ static int luaModelGetTimer(lua_State *L)
lua_pushtableboolean(L, "showElapsed", timer.showElapsed);
lua_pushtableinteger(L, "switch", timer.swtch);
lua_pushtableinteger(L, "countdownStart", timer.countdownStart);
lua_pushtableinteger(L, "extraHaptic", timer.extraHaptic);
}
else {
lua_pushnil(L);
@@ -349,13 +350,16 @@ static int luaModelSetTimer(lua_State *L)
}
else if (!strcmp(key, "showElapsed")) {
timer.showElapsed = lua_toboolean(L, -1);
}
}
else if (!strcmp(key, "switch")) {
timer.swtch = luaL_checkinteger(L, -1);
}
else if (!strcmp(key, "countdownStart")) {
timer.countdownStart = luaL_checkinteger(L, -1);
}
else if (!strcmp(key, "extraHaptic")) {
timer.extraHaptic = lua_tointeger(L, -1);
}
}
storageDirty(EE_MODEL);
}