Changed how timeout is printed

This commit is contained in:
Dreaded_X 2023-01-05 04:30:14 +01:00
parent 9a239a88ec
commit 99713aa4c6
Signed by: Dreaded_X
GPG Key ID: 76BDEC4E165D8AD9

View File

@ -81,7 +81,7 @@ impl OnMqtt for IkeaOutlet {
};
let timeout = match kettle.timeout.clone() {
Some(timeout) => timeout,
Some(timeout) => Duration::from_secs(timeout),
None => {
trace!(id = self.identifier, "Outlet is a kettle without timeout");
return;
@ -96,8 +96,8 @@ impl OnMqtt for IkeaOutlet {
let id = self.identifier.clone();
self.handle = Some(
tokio::spawn(async move {
debug!(id, "Starting timeout ({timeout}s) for kettle...");
tokio::time::sleep(Duration::from_secs(timeout)).await;
debug!(id, "Starting timeout ({timeout:?}) for kettle...");
tokio::time::sleep(timeout).await;
// @TODO We need to call set_on(false) in order to turn the device off
// again, how are we going to do this?
debug!(id, "Turning kettle off!");