From f226f441909c6d7c479df70b8570e0183ae70a5d Mon Sep 17 00:00:00 2001 From: Ralf Ramsauer Date: Sat, 8 Sep 2018 00:58:32 +0200 Subject: [PATCH] doorlockd: fix logic bug We don't want to continue if we actually want to close. Signed-off-by: Ralf Ramsauer --- doorlockd | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/doorlockd b/doorlockd index 5b1bd4d..c2b695f 100755 --- a/doorlockd +++ b/doorlockd @@ -271,7 +271,7 @@ class DoorHandler: if self.do_close: tx = DoorHandler.CMD_CLOSE self.do_close = False - if self.state == DoorState.Present: + elif self.state == DoorState.Present: tx = DoorHandler.CMD_PRESENT elif self.state == DoorState.Open: tx = DoorHandler.CMD_OPEN @@ -280,7 +280,6 @@ class DoorHandler: self.serial.write(tx) self.serial.flush() - sleep(0.1) def open(self): if self.state == DoorState.Open: