Fixed running seek on auto restart bug.
This commit is contained in:
+7
-6
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user