fix(lua): Add missing switch and countdownStart properties (#2979)

Add the switch and countdownStart properties to the getTimer and setTimer Lua functions.
This commit is contained in:
philmoz
2023-01-08 11:02:55 +10:00
committed by GitHub
parent e1a8066707
commit 1bffd260a0
+8
View File
@@ -292,6 +292,8 @@ static int luaModelGetTimer(lua_State *L)
lua_pushtableinteger(L, "persistent", timer.persistent);
lua_pushtablenstring(L, "name", timer.name);
lua_pushtableboolean(L, "showElapsed", timer.showElapsed);
lua_pushtableinteger(L, "switch", timer.swtch);
lua_pushtableinteger(L, "countdownStart", timer.countdownStart);
}
else {
lua_pushnil(L);
@@ -348,6 +350,12 @@ 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);
}
}
storageDirty(EE_MODEL);
}