Fixed running seek on auto restart bug.
This commit is contained in:
parent
ee70ba1667
commit
b960bb4710
@ -211,7 +211,7 @@ ignore_tc_too_many_errors = False
|
|||||||
# cleaned up (deleted) by the OS on boot.
|
# cleaned up (deleted) by the OS on boot.
|
||||||
# The state file is written to disk every sensor_time_wait seconds (2s by default)
|
# The state file is written to disk every sensor_time_wait seconds (2s by default)
|
||||||
# and is written in the same directory as config.py.
|
# and is written in the same directory as config.py.
|
||||||
automatic_restarts = False
|
automatic_restarts = True
|
||||||
automatic_restart_window = 15 # max minutes since power outage
|
automatic_restart_window = 15 # max minutes since power outage
|
||||||
automatic_restart_state_file = os.path.abspath(os.path.join(os.path.dirname( __file__ ),'state.json'))
|
automatic_restart_state_file = os.path.abspath(os.path.join(os.path.dirname( __file__ ),'state.json'))
|
||||||
|
|
||||||
|
|||||||
13
lib/oven.py
13
lib/oven.py
@ -339,12 +339,13 @@ class Oven(threading.Thread):
|
|||||||
startat = 0
|
startat = 0
|
||||||
return startat
|
return startat
|
||||||
|
|
||||||
def run_profile(self, profile, startat=0):
|
def run_profile(self, profile, startat=0, auto_start=False):
|
||||||
runtime = startat * 60
|
runtime = startat * 60
|
||||||
if self.state == 'IDLE':
|
if not auto_start:
|
||||||
if config.seek_start:
|
if self.state == 'IDLE':
|
||||||
temp = self.board.temp_sensor.temperature() # Defined in a subclass
|
if config.seek_start:
|
||||||
runtime += self.get_start_from_temperature(profile, temp)
|
temp = self.board.temp_sensor.temperature() # Defined in a subclass
|
||||||
|
runtime += self.get_start_from_temperature(profile, temp)
|
||||||
|
|
||||||
self.reset()
|
self.reset()
|
||||||
self.startat = startat * 60
|
self.startat = startat * 60
|
||||||
@ -484,7 +485,7 @@ class Oven(threading.Thread):
|
|||||||
with open(profile_path) as infile:
|
with open(profile_path) as infile:
|
||||||
profile_json = json.dumps(json.load(infile))
|
profile_json = json.dumps(json.load(infile))
|
||||||
profile = Profile(profile_json)
|
profile = Profile(profile_json)
|
||||||
self.run_profile(profile,startat=startat)
|
self.run_profile(profile,startat=startat, auto_start=True)
|
||||||
self.cost = d["cost"]
|
self.cost = d["cost"]
|
||||||
time.sleep(1)
|
time.sleep(1)
|
||||||
self.ovenwatcher.record(profile)
|
self.ovenwatcher.record(profile)
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user