From 66296df43304bfd538f7b792cf9edba2ce0b73af Mon Sep 17 00:00:00 2001 From: bton Date: Thu, 22 Feb 2024 00:10:29 +0100 Subject: [PATCH] Reader now beebs when a tag is added or removed --- NFC_Reader.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/NFC_Reader.py b/NFC_Reader.py index a5ae30d..875bb66 100644 --- a/NFC_Reader.py +++ b/NFC_Reader.py @@ -19,7 +19,7 @@ def onTagSense(tag): response = requests.post(f"{url}tag_id", data={"id":id}) print(response.json()) try: - if response.json()["mode"] == "balance": + if response.json()["mode"] == "balance" or response.json()["mode"] == "message": return True except: None @@ -32,6 +32,7 @@ def start_nfc_normal(): while True: clf.connect(rdwr={'on-connect': onTagSense, 'beep-on-connect': True }) time.sleep(0.75) + if __name__ == "__main__": start_nfc_normal()