mirror of
https://github.com/mjg59/python-broadlink.git
synced 2024-11-10 18:00:12 +01:00
Ensure discover() returns devices and not None
There's a small race condition in the discover() method. If recv() returns before the socket timeout is reached, but we hit the top of the loop after the timeout is reached, we'll return None rather than the set of devices.
This commit is contained in:
parent
877a7b7460
commit
b30fc0d1c1
@ -126,6 +126,7 @@ def discover(timeout=None, local_ip_address=None):
|
||||
mac = responsepacket[0x3a:0x40]
|
||||
dev = gendevice(devtype, host, mac)
|
||||
devices.append(dev)
|
||||
return devices
|
||||
|
||||
|
||||
class device:
|
||||
|
Loading…
Reference in New Issue
Block a user