From 93cd43d0c4088bb2f3acff5c9d385432e0ff77fb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Xose=20P=C3=A9rez?= Date: Wed, 10 Jan 2018 16:44:47 +0100 Subject: [PATCH] Increase zeroconf discovery time. Check if any devices have been found. --- code/ota.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/code/ota.py b/code/ota.py index e66cc7f5..1318be38 100644 --- a/code/ota.py +++ b/code/ota.py @@ -183,9 +183,13 @@ if __name__ == '__main__': # Look for sevices zeroconf = Zeroconf() browser = ServiceBrowser(zeroconf, "_arduino._tcp.local.", handlers=[on_service_state_change]) - sleep(1) + sleep(5) zeroconf.close() + if len(devices) == 0: + print "Nothing found!\n" + sys.exit(0) + # Sort list field = args.sort.lower() if field not in devices[0]: