1
0
Fork 0

Added debug statements

This commit is contained in:
Alexander Böhm 2024-01-05 16:08:31 +01:00
parent df2a35f4d3
commit 189528591e
1 changed files with 5 additions and 8 deletions

View File

@ -50,7 +50,7 @@ async fn main() {
log::debug!("Pushing space status: Open = {}", door_status_new);
let _ = push_door_status(&spaceapi_client, door_status_new)
.await
.map_err(|err| format!("Problem while pushing door status: {err}")) ;
.map_err(|err| format!("Problem while pushing door status: {err}"));
log::debug!("Saving space status: {}", door_status_new);
door_status_old = door_status_new;
} else {
@ -67,13 +67,10 @@ fn check_door(pin: &InputPin) -> bool {
async fn push_door_status(spaceapi: &Client, open: bool) -> Result<(), String> {
if open {
spaceapi
.keep_open()
.await
.map(|_| ())
log::debug!("Sending keep open to server");
spaceapi.keep_open().await.map(|_| ())
} else {
spaceapi
.close()
.await
log::debug!("Sending explicit close to server");
spaceapi.close().await
}
}