feat(config)!: Device creation function is now named entry
It now has to be called 'setup', this makes it possible to just include the table as a whole in devices and it will automatically call the correct function.
This commit is contained in:
@@ -140,8 +140,8 @@ async fn app() -> anyhow::Result<()> {
|
||||
|
||||
let mqtt_client = mqtt::start(config.mqtt, &device_manager.event_channel());
|
||||
|
||||
if let Some(devices) = config.devices {
|
||||
for device in devices.get(&lua, &mqtt_client).await? {
|
||||
if let Some(modules) = config.modules {
|
||||
for device in modules.setup(&lua, &mqtt_client).await? {
|
||||
device_manager.add(device).await;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user