feat!: Improve device type registration
All checks were successful
Build and deploy / build (push) Successful in 10m37s
Build and deploy / Deploy container (push) Successful in 38s

Instead of one function that contains all the device types available in
`automation_devices` a global registry is used were each device can
register itself.
This commit is contained in:
2025-09-10 02:59:32 +02:00
parent f0e4c9dd21
commit 4e28ad0f85
16 changed files with 58 additions and 36 deletions

View File

@@ -37,9 +37,8 @@ impl Module {
}
pub fn load_modules(lua: &mlua::Lua) -> mlua::Result<()> {
debug!("Loading modules...");
for module in inventory::iter::<Module> {
debug!(name = module.get_name(), "Registering");
debug!(name = module.get_name(), "Loading module");
let table = module.register(lua)?;
lua.register_module(module.get_name(), table)?;
}