From c1013ca691d1a78e90e6ccce04fa1234562f5a20 Mon Sep 17 00:00:00 2001 From: Harry Esses Date: Tue, 19 May 2026 10:49:30 +0000 Subject: [PATCH] commit --- simulator.py | 60 ++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 60 insertions(+) create mode 100644 simulator.py diff --git a/simulator.py b/simulator.py new file mode 100644 index 0000000..f312dc6 --- /dev/null +++ b/simulator.py @@ -0,0 +1,60 @@ +# simulator.py + +import requests + +SERVER = "https://5000--main--orange-crane-13--harry-esses.coder.harryesses.com/scan" + +print("RFID Scan Simulator") +print("Type 'exit' to quit") +print() + +while True: + + uid = input("UID: ").strip() + + if uid.lower() == "exit": + break + + location = input( + "Location ID: " + ).strip() + + action = input( + "Action (blank/bathroom): " + ).strip() + + payload = { + "uid": uid, + "location_id": location, + "action": action + } + + print() + print("Sending Scan:") + print(payload) + + try: + + response = requests.post( + SERVER, + json=payload, + timeout=5 + ) + + print() + print( + f"Status: {response.status_code}" + ) + + try: + print(response.json()) + except: + print(response.text) + + except Exception as e: + print() + print(f"Error: {e}") + + print() + print("-" * 40) + print() \ No newline at end of file