File tree Expand file tree Collapse file tree 1 file changed +6
-3
lines changed
Expand file tree Collapse file tree 1 file changed +6
-3
lines changed Original file line number Diff line number Diff line change @@ -255,9 +255,12 @@ def record(device, file):
255255 ir_packet = None
256256 attempt = 0
257257 while ir_packet is None and attempt < 6 :
258- time .sleep (5 )
259- ir_packet = device .check_data ()
260258 attempt = attempt + 1
259+ time .sleep (5 )
260+ try :
261+ ir_packet = device .check_data ()
262+ except (broadlink .exceptions .ReadError , broadlink .exceptions .StorageError ):
263+ continue
261264 if ir_packet is not None :
262265 # write to file
263266 directory = os .path .dirname (file )
@@ -267,7 +270,7 @@ def record(device, file):
267270 f .write (binascii .hexlify (ir_packet ))
268271 logging .debug ("Done" )
269272 else :
270- logging .warn ("No command received" )
273+ logging .warning ("No command received" )
271274
272275
273276def record_rf (device , file ):
You can’t perform that action at this time.
0 commit comments