Add reset command, require login on open/close commands
This commit is contained in:
parent
ac3af2b567
commit
6f7e8eab79
|
@ -418,14 +418,24 @@ class DoorControl:
|
|||
self.logger.debug(f"Faking token {args[0]}")
|
||||
send("Handling token\n")
|
||||
self.handle_nfc_token(args[0])
|
||||
elif cmd == 'reset':
|
||||
self.logger.info("Resetting")
|
||||
send("Resetting MCU")
|
||||
self._send_door_cmd(b'S')
|
||||
elif cmd == 'open':
|
||||
self.logger.debug("Control socket opening door")
|
||||
send("Opening door")
|
||||
self.open_door()
|
||||
if len(args) > 0:
|
||||
self.logger.info(f"Control socket opening door for {args[0]}")
|
||||
send("Opening door")
|
||||
self.open_door()
|
||||
else:
|
||||
send("Missing login")
|
||||
elif cmd == 'close':
|
||||
self.logger.debug("Control socket closing door")
|
||||
send("Closing door")
|
||||
self.close_door()
|
||||
if len(args) > 0:
|
||||
self.logger.info(f"Control socket closing door for {args[0]}")
|
||||
send("Closing door")
|
||||
self.close_door()
|
||||
else:
|
||||
send("Missing login")
|
||||
elif cmd == 'rld':
|
||||
self.logger.debug("Reloading tokens")
|
||||
send("Reloading tokens")
|
||||
|
|
Loading…
Reference in New Issue
Block a user