1
0
mirror of https://github.com/mjg59/python-broadlink.git synced 2024-11-21 22:51:41 +01:00

Sleep before reading the code

This commit is contained in:
Felipe Martins Diel 2020-05-22 15:25:33 -03:00
parent 9cda686d24
commit 753db8e25b

View File

@ -133,10 +133,11 @@ if args.learn or (args.learnfile and not args.rfscanlearn):
print("Learning...")
start = time.time()
while time.time() - start < TIMEOUT:
time.sleep(1)
try:
data = dev.check_data()
except (ReadError, StorageError):
time.sleep(1)
continue
else:
break
else:
@ -220,10 +221,11 @@ if args.rfscanlearn:
start = time.time()
while time.time() - start < TIMEOUT:
time.sleep(1)
try:
data = dev.check_data()
except (ReadError, StorageError):
time.sleep(1)
continue
else:
break
else: