fixing divide by zero bug when thermocouple read fails five times in a

row
This commit is contained in:
Jason Bruce 2021-04-29 15:08:53 -04:00
parent e16aab8e66
commit 775eb0a0f2

View File

@ -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