AudioSetup now takes the name of two already created devices and stores a reference to the devices instead of creating and owning the devices directly

This commit is contained in:
2023-08-14 01:51:45 +02:00
parent 76b75b0cfb
commit e38c5eed31
12 changed files with 151 additions and 77 deletions

View File

@@ -62,8 +62,15 @@ async fn app() -> anyhow::Result<()> {
// Create all the devices specified in the config
for (id, device_config) in config.devices {
let device =
device_config.create(&id, &event_channel, &client, &config.presence.mqtt.topic)?;
let device = device_config
.create(
&id,
&event_channel,
&client,
&config.presence.mqtt.topic,
&device_manager,
)
.await?;
device_manager.add(device).await;
}