encode string
This commit is contained in:
parent
4307d54505
commit
79b9b69ef8
|
@ -92,15 +92,15 @@ class DoorHandle:
|
|||
if self.nfc_sock is not None:
|
||||
self.nfc_sock.send(b'rld\n')
|
||||
|
||||
def open_door(self, user=b''):
|
||||
def open_door(self, user=''):
|
||||
if self.nfc_sock is not None:
|
||||
self.nfc_sock.send(b'open ' + user + b'\n')
|
||||
self.nfc_sock.send(b'open ' + user.encode() + b'\n')
|
||||
else:
|
||||
raise Exception("No connection to NFC socket. Cannot close door!")
|
||||
|
||||
def close_door(self, user=b''):
|
||||
def close_door(self, user=''):
|
||||
if self.nfc_sock is not None:
|
||||
self.nfc_sock.send(b'close ' + user + b'\n')
|
||||
self.nfc_sock.send(b'close ' + user.encode() + b'\n')
|
||||
else:
|
||||
raise Exception("No connection to NFC socket. Cannot close door!")
|
||||
|
||||
|
|
Loading…
Reference in New Issue
Block a user