feat(config)!: Improve config module resolution
Some checks are pending
Build and deploy / build (push) Waiting to run
Build and deploy / Deploy container (push) Blocked by required conditions

The new system is slightly less flexible, but the code and lua
definitions is now a lot simpler and easier to understand.
In fact the old lua definition was not actually correct.

It is likely that existing configs require not/minimal tweaks to work
again.
This commit is contained in:
2025-10-22 03:03:38 +02:00
parent a6c19eb9b4
commit e333881844
5 changed files with 145 additions and 67 deletions

View File

@@ -140,10 +140,9 @@ async fn app() -> anyhow::Result<()> {
let mqtt_client = mqtt::start(config.mqtt, &device_manager.event_channel());
if let Some(modules) = config.modules {
for device in modules.setup(&lua, &mqtt_client).await? {
device_manager.add(device).await;
}
let resolved = config.modules.resolve(&lua, &mqtt_client).await?;
for device in resolved.devices {
device_manager.add(device).await;
}
start_scheduler(config.schedule).await?;