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