Set lua warning function

This commit is contained in:
Dreaded_X 2024-04-26 21:54:55 +02:00
parent 8762a680a8
commit 57596ae531
Signed by: Dreaded_X
GPG Key ID: 5A0CBFE3C3377FAA

View File

@ -18,7 +18,7 @@ use axum::{Json, Router};
use dotenvy::dotenv;
use google_home::{GoogleHome, Request};
use rumqttc::AsyncClient;
use tracing::{debug, error, info};
use tracing::{debug, error, info, warn};
#[derive(Clone)]
struct AppState {
@ -81,6 +81,12 @@ async fn app() -> anyhow::Result<()> {
// Lua testing
{
let lua = mlua::Lua::new();
lua.set_warning_function(|_lua, text, _cont| {
warn!("{text}");
Ok(())
});
let automation = lua.create_table()?;
automation.set("device_manager", device_manager.clone())?;