File tree 1 file changed +8
-4
lines changed
1 file changed +8
-4
lines changed Original file line number Diff line number Diff line change @@ -26,8 +26,12 @@ def get_devices():
26
26
for i in device_address_list :
27
27
device .set_i2c_address (i )
28
28
response = device .query ("I" )
29
- moduletype = response .split ("," )[1 ]
30
- response = device .query ("name,?" ).split ("," )[1 ]
29
+ try :
30
+ moduletype = response .split ("," )[1 ]
31
+ response = device .query ("name,?" ).split ("," )[1 ]
32
+ except IndexError :
33
+ print (">> WARNING: device at I2C address " + str (i ) + " has not been identified as an EZO device, and will not be queried" )
34
+ continue
31
35
device_list .append (AtlasI2C (address = i , moduletype = moduletype , name = response ))
32
36
return device_list
33
37
@@ -56,12 +60,12 @@ def print_help_text():
56
60
57
61
def main ():
58
62
63
+ print_help_text ()
64
+
59
65
device_list = get_devices ()
60
66
61
67
device = device_list [0 ]
62
68
63
- print_help_text ()
64
-
65
69
print_devices (device_list , device )
66
70
67
71
real_raw_input = vars (__builtins__ ).get ('raw_input' , input )
You can’t perform that action at this time.
0 commit comments