From 753db8e25baa9258f6f9fb49b29937b302473391 Mon Sep 17 00:00:00 2001 From: Felipe Martins Diel Date: Fri, 22 May 2020 15:25:33 -0300 Subject: [PATCH] Sleep before reading the code --- cli/broadlink_cli | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/cli/broadlink_cli b/cli/broadlink_cli index ead3a60..a2e1883 100755 --- a/cli/broadlink_cli +++ b/cli/broadlink_cli @@ -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: