kopia lustrzana https://github.com/jbruce12000/kiln-controller
fixing divide by zero bug when thermocouple read fails five times in a
rowpull/20/head^2^2
rodzic
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
|
||||
|
|
Ładowanie…
Reference in New Issue