Skip to content

Commit

Permalink
check for lines length
Browse files Browse the repository at this point in the history
  • Loading branch information
TrystanLea authored Oct 16, 2022
1 parent 014fab1 commit 91ca68b
Showing 1 changed file with 7 additions and 6 deletions.
13 changes: 7 additions & 6 deletions src/interfacers/EmonHubDS18B20Interfacer.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,12 +39,13 @@ def _read_raw(self, sensor):
def tempC(self, sensor):
lines = self._read_raw(sensor)
# retry = 0
while lines[0].strip()[-3:] != 'YES':
# time.sleep(0.2)
# lines = self._read_raw(sensor)
# retry += 1
# if retry==3: return False
return False
if len(lines[0]):
while lines[0].strip()[-3:] != 'YES':
# time.sleep(0.2)
# lines = self._read_raw(sensor)
# retry += 1
# if retry==3: return False
return False

equals_pos = lines[1].find('t=')
if equals_pos != -1:
Expand Down

0 comments on commit 91ca68b

Please sign in to comment.