Mercurial > templog
comparison py/sensor_ds18b20.py @ 178:77c2a9caca3d
a few fixes
author | Matt Johnston <matt@ucc.asn.au> |
---|---|
date | Thu, 30 Jan 2014 22:55:27 +0800 |
parents | 33ed66a7ea0b |
children | 16a83e2c97a0 |
comparison
equal
deleted
inserted
replaced
177:a0ea542256ba | 178:77c2a9caca3d |
---|---|
75 | 75 |
76 | 76 |
77 def sensor_names(self): | 77 def sensor_names(self): |
78 """ Returns a sequence of sensorname """ | 78 """ Returns a sequence of sensorname """ |
79 slaves_path = os.path.join(self.master_dir, "w1_master_slaves") | 79 slaves_path = os.path.join(self.master_dir, "w1_master_slaves") |
80 names = open(slaves_path, 'r').read().split() | 80 contents = open(slaves_path, 'r').read() |
81 if 'not found' in contents: | |
82 E("No W1 sensors found") | |
83 return [] | |
84 names = contents.split() | |
81 return names | 85 return names |
82 | 86 |
83 def wort_name(self): | 87 def wort_name(self): |
84 return config.WORT_NAME | 88 return config.WORT_NAME |
85 | 89 |