Reader now beebs when a tag is added or removed
This commit is contained in:
parent
50dbcf504e
commit
66296df433
1 changed files with 2 additions and 1 deletions
|
@ -19,7 +19,7 @@ def onTagSense(tag):
|
||||||
response = requests.post(f"{url}tag_id", data={"id":id})
|
response = requests.post(f"{url}tag_id", data={"id":id})
|
||||||
print(response.json())
|
print(response.json())
|
||||||
try:
|
try:
|
||||||
if response.json()["mode"] == "balance":
|
if response.json()["mode"] == "balance" or response.json()["mode"] == "message":
|
||||||
return True
|
return True
|
||||||
except:
|
except:
|
||||||
None
|
None
|
||||||
|
@ -32,6 +32,7 @@ def start_nfc_normal():
|
||||||
while True:
|
while True:
|
||||||
clf.connect(rdwr={'on-connect': onTagSense, 'beep-on-connect': True })
|
clf.connect(rdwr={'on-connect': onTagSense, 'beep-on-connect': True })
|
||||||
time.sleep(0.75)
|
time.sleep(0.75)
|
||||||
|
|
||||||
if __name__ == "__main__":
|
if __name__ == "__main__":
|
||||||
start_nfc_normal()
|
start_nfc_normal()
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue