Skip to content

Commit

Permalink
fix(lua): Add missing switch and countdownStart properties (#2979)
Browse files Browse the repository at this point in the history
Add the switch and countdownStart properties to the getTimer and setTimer Lua functions.
  • Loading branch information
philmoz authored Jan 8, 2023
1 parent e1a8066 commit 1bffd26
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions radio/src/lua/api_model.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down Expand Up @@ -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);
}
Expand Down

0 comments on commit 1bffd26

Please sign in to comment.