From 1bffd260a029aab4d84c85d1699d4a9bf45a2d2a Mon Sep 17 00:00:00 2001 From: philmoz Date: Sun, 8 Jan 2023 12:02:55 +1100 Subject: [PATCH] fix(lua): Add missing switch and countdownStart properties (#2979) Add the switch and countdownStart properties to the getTimer and setTimer Lua functions. --- radio/src/lua/api_model.cpp | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/radio/src/lua/api_model.cpp b/radio/src/lua/api_model.cpp index 842fb8613..8301d686f 100644 --- a/radio/src/lua/api_model.cpp +++ b/radio/src/lua/api_model.cpp @@ -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); }