49 lines
996 B
C++
49 lines
996 B
C++
#if !defined(THRAWN_API_H)
|
|
#define THRAWN_API_H
|
|
|
|
extern "C"
|
|
{
|
|
#include <lua.h>
|
|
#include <lualib.h>
|
|
#include <lauxlib.h>
|
|
}
|
|
|
|
#include <vector>
|
|
#include <string>
|
|
#include "Service.h"
|
|
#include <ctime>
|
|
|
|
//Functions for LUA
|
|
int thrawn_log(lua_State* lua);
|
|
|
|
int thrawn_register_service(lua_State* lua);
|
|
|
|
int thrawn_subscribe(lua_State* lua);
|
|
|
|
int thrawn_schedule(lua_State* lua);
|
|
|
|
int thrawn_publish(lua_State* lua);
|
|
|
|
int thrawn_create_topic_state(lua_State* lua);
|
|
|
|
int thrawn_topic_state_str(lua_State* lua);
|
|
|
|
int thrawn_topic_components(lua_State* lua);
|
|
|
|
int thrawn_cached_topic(lua_State* lua);
|
|
|
|
// Function in LUA
|
|
void call_thrawn_on_start(LuaService& service);
|
|
|
|
void call_thrawn_on_update(LuaService& service, TopicState state);
|
|
|
|
void call_thrawn_on_schedule(LuaService& service, std::time_t now, const std::string& callback);
|
|
|
|
//Database logging
|
|
|
|
int thrawn_log_light(lua_State* lua);
|
|
|
|
int thrawn_log_light_dimmable(lua_State* lua);
|
|
|
|
int thrawn_log_light_tw(lua_State* lua);
|
|
#endif // THRAWN_API_H
|