From 79b9b69ef8da0e70c99652962d6e2410bf0c851e Mon Sep 17 00:00:00 2001 From: Simon Pirkelmann Date: Mon, 23 Aug 2021 21:10:43 +0200 Subject: [PATCH] encode string --- imaginaerraum_door_admin/door_handle.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/imaginaerraum_door_admin/door_handle.py b/imaginaerraum_door_admin/door_handle.py index af46656..fc1e32a 100644 --- a/imaginaerraum_door_admin/door_handle.py +++ b/imaginaerraum_door_admin/door_handle.py @@ -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!")