Browse Source

Increase zeroconf discovery time. Check if any devices have been found.

i18n
Xose Pérez 6 years ago
parent
commit
93cd43d0c4
1 changed files with 5 additions and 1 deletions
  1. +5
    -1
      code/ota.py

+ 5
- 1
code/ota.py View File

@ -183,9 +183,13 @@ if __name__ == '__main__':
# Look for sevices # Look for sevices
zeroconf = Zeroconf() zeroconf = Zeroconf()
browser = ServiceBrowser(zeroconf, "_arduino._tcp.local.", handlers=[on_service_state_change]) browser = ServiceBrowser(zeroconf, "_arduino._tcp.local.", handlers=[on_service_state_change])
sleep(1)
sleep(5)
zeroconf.close() zeroconf.close()
if len(devices) == 0:
print "Nothing found!\n"
sys.exit(0)
# Sort list # Sort list
field = args.sort.lower() field = args.sort.lower()
if field not in devices[0]: if field not in devices[0]:


Loading…
Cancel
Save