1
0
mirror of https://github.com/binary-kitchen/doorlockd synced 2024-12-22 10:24:26 +01:00

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

View File

@ -271,7 +271,7 @@ class DoorHandler:
if self.do_close: if self.do_close:
tx = DoorHandler.CMD_CLOSE tx = DoorHandler.CMD_CLOSE
self.do_close = False self.do_close = False
if self.state == DoorState.Present: elif self.state == DoorState.Present:
tx = DoorHandler.CMD_PRESENT tx = DoorHandler.CMD_PRESENT
elif self.state == DoorState.Open: elif self.state == DoorState.Open:
tx = DoorHandler.CMD_OPEN tx = DoorHandler.CMD_OPEN
@ -280,7 +280,6 @@ class DoorHandler:
self.serial.write(tx) self.serial.write(tx)
self.serial.flush() self.serial.flush()
sleep(0.1)
def open(self): def open(self):
if self.state == DoorState.Open: if self.state == DoorState.Open: