doorlockd: fix logic bug

We don't want to continue if we actually want to close.

Signed-off-by: Ralf Ramsauer <ralf@binary-kitchen.de>
This commit is contained in:
Ralf Ramsauer 2018-09-08 00:58:32 +02:00
parent f7725bba54
commit f226f44190
1 changed files with 1 additions and 2 deletions

View File

@ -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: