More refactoring

This commit is contained in:
2023-08-18 03:07:16 +02:00
parent 3134891751
commit 044c38ba86
20 changed files with 209 additions and 105 deletions

View File

@@ -178,7 +178,7 @@ impl OnMqtt for ContactSensor {
if trigger.timeout.is_zero() && let Some(light) = As::<dyn OnOff>::cast_mut(light.as_mut()) {
light.set_on(false).await.ok();
} else if let Some(light) = As::<dyn Timeout>::cast_mut(light.as_mut()) {
light.start_timeout(trigger.timeout).await;
light.start_timeout(trigger.timeout).await.unwrap();
}
// TODO: Put a warning/error on creation if either of this has to option to fail
}