forked from moke/spaceapi-tuerpie-nix
Removed expandable close call
This commit is contained in:
parent
5545372ca8
commit
07a1928d7d
12
src/main.rs
12
src/main.rs
|
@ -34,17 +34,19 @@ async fn main() {
|
||||||
|
|
||||||
loop {
|
loop {
|
||||||
log::debug!("Checking door status");
|
log::debug!("Checking door status");
|
||||||
let push_result = match check_door(&pin).await {
|
match check_door(&pin).await {
|
||||||
DoorStatus::Open => {
|
DoorStatus::Open => {
|
||||||
log::debug!("Door is open, sending keep open to server");
|
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 => {
|
DoorStatus::Closed => {
|
||||||
log::debug!("Door is closed, sending explicit close to server");
|
log::debug!("Door is closed, doing nothing");
|
||||||
spaceapi_client.close().await
|
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
let _ = push_result.map_err(|err| format!("Problem while pushing door status: {err}"));
|
|
||||||
|
|
||||||
log::debug!("Waiting {RECHECK_DELAY:?} secs to read the door status");
|
log::debug!("Waiting {RECHECK_DELAY:?} secs to read the door status");
|
||||||
sleep(RECHECK_DELAY).await;
|
sleep(RECHECK_DELAY).await;
|
||||||
|
|
Loading…
Reference in New Issue