error handling for untimley removal of key
This commit is contained in:
parent
43846ab6db
commit
ee9d3a7a58
22
main.py
22
main.py
@ -72,19 +72,21 @@ while True:
|
||||
# GPIO.output(14, GPIO.LOW)
|
||||
print("Waiting for device...")
|
||||
while True:
|
||||
# GPIO.output(14, GPIO.LOW)
|
||||
dev = next(CtapHidDevice.list_devices(), None)
|
||||
try:
|
||||
# GPIO.output(14, GPIO.LOW)
|
||||
dev = next(CtapHidDevice.list_devices(), None)
|
||||
|
||||
if dev:
|
||||
ctap2 = Ctap2(dev)
|
||||
if dev:
|
||||
ctap2 = Ctap2(dev)
|
||||
|
||||
info = ctap2.get_info()
|
||||
gotAaguid = info.aaguid
|
||||
print(str(gotAaguid))
|
||||
break
|
||||
|
||||
time.sleep(0.1)
|
||||
info = ctap2.get_info()
|
||||
gotAaguid = info.aaguid
|
||||
print(str(gotAaguid))
|
||||
break
|
||||
|
||||
time.sleep(0.1)
|
||||
except Exception as e:
|
||||
print(e)
|
||||
# Handle user interaction
|
||||
|
||||
try:
|
||||
|
Loading…
Reference in New Issue
Block a user