pass on username to nfc socket when opening and closing door
This commit is contained in:
parent
2ccec6fe32
commit
14c783b2c1
|
@ -92,15 +92,15 @@ class DoorHandle:
|
||||||
if self.nfc_sock is not None:
|
if self.nfc_sock is not None:
|
||||||
self.nfc_sock.send(b'rld\n')
|
self.nfc_sock.send(b'rld\n')
|
||||||
|
|
||||||
def open_door(self):
|
def open_door(self, user=b''):
|
||||||
if self.nfc_sock is not None:
|
if self.nfc_sock is not None:
|
||||||
self.nfc_sock.send(b'open\n')
|
self.nfc_sock.send(b'open ' + user + b'\n')
|
||||||
else:
|
else:
|
||||||
raise Exception("No connection to NFC socket. Cannot close door!")
|
raise Exception("No connection to NFC socket. Cannot close door!")
|
||||||
|
|
||||||
def close_door(self):
|
def close_door(self, user=b''):
|
||||||
if self.nfc_sock is not None:
|
if self.nfc_sock is not None:
|
||||||
self.nfc_sock.send(b'close\n')
|
self.nfc_sock.send(b'close ' + user + b'\n')
|
||||||
else:
|
else:
|
||||||
raise Exception("No connection to NFC socket. Cannot close door!")
|
raise Exception("No connection to NFC socket. Cannot close door!")
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user