feat(config)!: Move device_manager out of global automation table into separate module

Moved `automation.device_manager` into a separate module called
`device_manager`
This commit is contained in:
2025-09-04 03:55:01 +02:00
parent 5aebab28ed
commit 22fee0ed77
2 changed files with 45 additions and 43 deletions

View File

@@ -130,9 +130,10 @@ async fn app() -> anyhow::Result<()> {
})?;
automation.set("new_mqtt_client", new_mqtt_client)?;
automation.set("device_manager", device_manager.clone())?;
lua.globals().set("automation", automation)?;
lua.register_module("device_manager", device_manager.clone())?;
let utils = lua.create_table()?;
let get_env = lua.create_function(|_lua, name: String| {
std::env::var(name).map_err(mlua::ExternalError::into_lua_err)