Added support for scheduled services

This commit is contained in:
2020-11-28 09:35:29 +01:00
parent cc70ee5447
commit 8b6f49ea98
4 changed files with 18 additions and 19 deletions

View File

@@ -1,6 +1,5 @@
#if !defined(THRAWN_API_H)
#define THRAWN_API_H
#include <spdlog/spdlog.h>
extern "C"
{
@@ -47,17 +46,4 @@ int thrawn_log_light(lua_State* lua);
int thrawn_log_light_dimmable(lua_State* lua);
int thrawn_log_light_tw(lua_State* lua);
template<typename F>
void thrawn_call(LuaService& service, const std::string& lua_func, F push_params) {
lua_getglobal(service.lua, lua_func.c_str());
int num_arguments = push_params();
if (lua_pcall(service.lua, num_arguments, 0, 0) != 0) {
spdlog::error("[{}] Unable to call '{}'. [Lua: '{}']", lua_func, service.name);
return;
}
}
#endif // THRAWN_API_H