1
0
Fork 0

Removed expandable close call

This commit is contained in:
Alexander Böhm 2024-01-05 17:03:29 +01:00
parent 5545372ca8
commit 07a1928d7d
1 changed files with 7 additions and 5 deletions

View File

@ -34,17 +34,19 @@ async fn main() {
loop {
log::debug!("Checking door status");
let push_result = match check_door(&pin).await {
match check_door(&pin).await {
DoorStatus::Open => {
log::debug!("Door is open, sending keep open to server");
spaceapi_client.keep_open().await.map(|_| ())
let _ = spaceapi_client
.keep_open()
.await
.map(|_| ())
.map_err(|err| format!("Problem while pushing door status: {err}"));
}
DoorStatus::Closed => {
log::debug!("Door is closed, sending explicit close to server");
spaceapi_client.close().await
log::debug!("Door is closed, doing nothing");
}
};
let _ = push_result.map_err(|err| format!("Problem while pushing door status: {err}"));
log::debug!("Waiting {RECHECK_DELAY:?} secs to read the door status");
sleep(RECHECK_DELAY).await;