Set lua warning function
This commit is contained in:
parent
8377e1d696
commit
68b9676616
|
@ -18,7 +18,7 @@ use axum::{Json, Router};
|
||||||
use dotenvy::dotenv;
|
use dotenvy::dotenv;
|
||||||
use google_home::{GoogleHome, Request};
|
use google_home::{GoogleHome, Request};
|
||||||
use rumqttc::AsyncClient;
|
use rumqttc::AsyncClient;
|
||||||
use tracing::{debug, error, info};
|
use tracing::{debug, error, info, warn};
|
||||||
|
|
||||||
#[derive(Clone)]
|
#[derive(Clone)]
|
||||||
struct AppState {
|
struct AppState {
|
||||||
|
@ -82,6 +82,12 @@ async fn app() -> anyhow::Result<()> {
|
||||||
// Lua testing
|
// Lua testing
|
||||||
{
|
{
|
||||||
let lua = mlua::Lua::new();
|
let lua = mlua::Lua::new();
|
||||||
|
|
||||||
|
lua.set_warning_function(|_lua, text, _cont| {
|
||||||
|
warn!("{text}");
|
||||||
|
Ok(())
|
||||||
|
});
|
||||||
|
|
||||||
let automation = lua.create_table()?;
|
let automation = lua.create_table()?;
|
||||||
|
|
||||||
automation.set("device_manager", device_manager.clone())?;
|
automation.set("device_manager", device_manager.clone())?;
|
||||||
|
|
Loading…
Reference in New Issue
Block a user