Started actually using the google home trait macro

This commit is contained in:
2024-07-06 00:34:15 +02:00
parent d84ff8ec8e
commit 9aa16e3ef8
18 changed files with 94 additions and 229 deletions

View File

@@ -155,7 +155,7 @@ impl OnMqtt for ContactSensor {
for (light, previous) in &mut trigger.devices {
let mut light = light.write().await;
if let Some(light) = light.as_mut().cast_mut() as Option<&mut dyn OnOff> {
*previous = light.is_on().await.unwrap();
*previous = light.on().await.unwrap();
light.set_on(true).await.ok();
}
}