Merge pull request #34 from adq/tuning-cleanup
fix tuner heat()/cool() calls
This commit is contained in:
commit
5860aad2bc
@ -46,7 +46,7 @@ def recordprofile(csvfile, targettemp):
|
|||||||
try:
|
try:
|
||||||
stage = 'heating'
|
stage = 'heating'
|
||||||
if not config.simulate:
|
if not config.simulate:
|
||||||
oven.output.heat(1, tuning=True)
|
oven.output.heat(0)
|
||||||
|
|
||||||
while True:
|
while True:
|
||||||
temp = oven.board.temp_sensor.temperature + \
|
temp = oven.board.temp_sensor.temperature + \
|
||||||
@ -58,7 +58,7 @@ def recordprofile(csvfile, targettemp):
|
|||||||
if stage == 'heating':
|
if stage == 'heating':
|
||||||
if temp >= targettemp:
|
if temp >= targettemp:
|
||||||
if not config.simulate:
|
if not config.simulate:
|
||||||
oven.output.heat(0)
|
oven.output.cool(0)
|
||||||
stage = 'cooling'
|
stage = 'cooling'
|
||||||
|
|
||||||
elif stage == 'cooling':
|
elif stage == 'cooling':
|
||||||
@ -73,7 +73,7 @@ def recordprofile(csvfile, targettemp):
|
|||||||
finally:
|
finally:
|
||||||
# ensure we always shut the oven down!
|
# ensure we always shut the oven down!
|
||||||
if not config.simulate:
|
if not config.simulate:
|
||||||
oven.output.heat(0)
|
oven.output.cool(0)
|
||||||
|
|
||||||
|
|
||||||
def line(a, b, x):
|
def line(a, b, x):
|
||||||
|
|||||||
@ -27,10 +27,8 @@ class Output(object):
|
|||||||
log.warning(msg)
|
log.warning(msg)
|
||||||
self.active = False
|
self.active = False
|
||||||
|
|
||||||
def heat(self,sleepfor, tuning=False):
|
def heat(self,sleepfor):
|
||||||
self.GPIO.output(config.gpio_heat, self.GPIO.HIGH)
|
self.GPIO.output(config.gpio_heat, self.GPIO.HIGH)
|
||||||
if tuning:
|
|
||||||
return
|
|
||||||
time.sleep(sleepfor)
|
time.sleep(sleepfor)
|
||||||
|
|
||||||
def cool(self,sleepfor):
|
def cool(self,sleepfor):
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user