From 14c783b2c1d16f1a32a9365121ea1e713d8d5d03 Mon Sep 17 00:00:00 2001 From: Simon Pirkelmann Date: Mon, 23 Aug 2021 21:05:42 +0200 Subject: [PATCH] pass on username to nfc socket when opening and closing door --- 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 34acc3d..af46656 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): + def open_door(self, user=b''): if self.nfc_sock is not None: - self.nfc_sock.send(b'open\n') + self.nfc_sock.send(b'open ' + user + b'\n') else: 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: - self.nfc_sock.send(b'close\n') + self.nfc_sock.send(b'close ' + user + b'\n') else: raise Exception("No connection to NFC socket. Cannot close door!")