Fixed running seek on auto restart bug.

This commit is contained in:
James Kirikland Garner
2022-12-24 13:56:07 -08:00
parent ee70ba1667
commit b960bb4710
2 changed files with 8 additions and 7 deletions
+7 -6
View File
@@ -339,12 +339,13 @@ class Oven(threading.Thread):
startat = 0
return startat
def run_profile(self, profile, startat=0):
def run_profile(self, profile, startat=0, auto_start=False):
runtime = startat * 60
if self.state == 'IDLE':
if config.seek_start:
temp = self.board.temp_sensor.temperature() # Defined in a subclass
runtime += self.get_start_from_temperature(profile, temp)
if not auto_start:
if self.state == 'IDLE':
if config.seek_start:
temp = self.board.temp_sensor.temperature() # Defined in a subclass
runtime += self.get_start_from_temperature(profile, temp)
self.reset()
self.startat = startat * 60
@@ -484,7 +485,7 @@ class Oven(threading.Thread):
with open(profile_path) as infile:
profile_json = json.dumps(json.load(infile))
profile = Profile(profile_json)
self.run_profile(profile,startat=startat)
self.run_profile(profile,startat=startat, auto_start=True)
self.cost = d["cost"]
time.sleep(1)
self.ovenwatcher.record(profile)