mirror of
https://github.com/mjg59/python-broadlink.git
synced 2024-11-13 03:00:11 +01:00
Sleep before reading the code
This commit is contained in:
parent
9cda686d24
commit
753db8e25b
@ -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:
|
||||
|
Loading…
Reference in New Issue
Block a user