Update oven.py

This commit is contained in:
benkrasnow 2018-06-09 16:22:40 -07:00 committed by GitHub
parent 35eb7d3346
commit 377e27e9da
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -133,6 +133,9 @@ class Oven (threading.Thread):
self.reset()
else:
temperature_count = 0
#Capture the last temperature value. This must be done before set_heat, since there is a sleep in there now.
last_temp = self.temp_sensor.temperature
self.set_heat(pid)
@ -151,8 +154,7 @@ class Oven (threading.Thread):
if self.runtime >= self.totaltime:
self.reset()
#Capture the last temperature value
last_temp = self.temp_sensor.temperature
if pid > 0:
time.sleep(self.time_step * (1 - pid))
else: