fixing divide by zero bug when thermocouple read fails five times in a
row
This commit is contained in:
parent
e16aab8e66
commit
775eb0a0f2
@ -128,7 +128,8 @@ class TempSensorReal(TempSensor):
|
||||
except Exception:
|
||||
log.exception("problem reading temp")
|
||||
time.sleep(sleeptime)
|
||||
self.temperature = sum(temps)/len(temps)
|
||||
if len(temps) > 0:
|
||||
self.temperature = sum(temps)/len(temps)
|
||||
|
||||
class Oven(threading.Thread):
|
||||
'''parent oven class. this has all the common code
|
||||
|
||||
Loading…
Reference in New Issue
Block a user