mirror of
https://github.com/PiBrewing/craftbeerpi4.git
synced 2024-11-22 06:58:17 +01:00
timer fix for manual stop and restart of fermentationstep
This commit is contained in:
parent
a503995d98
commit
2573e39bd8
3 changed files with 6 additions and 10 deletions
|
@ -1 +1 @@
|
||||||
__version__ = "4.0.2.0.a6"
|
__version__ = "4.0.2.0.a7"
|
||||||
|
|
|
@ -173,11 +173,8 @@ class FermenterStep(CBPiFermentationStep):
|
||||||
|
|
||||||
async def on_timer_done(self,timer):
|
async def on_timer_done(self,timer):
|
||||||
self.summary = ""
|
self.summary = ""
|
||||||
#self.fermenter.target_temp = 0
|
|
||||||
if self.AutoMode == True:
|
if self.AutoMode == True:
|
||||||
await self.setAutoMode(False)
|
await self.setAutoMode(False)
|
||||||
#self.endtime = 0
|
|
||||||
#await self.update_endtime()
|
|
||||||
self.cbpi.notify(self.name, 'Step finished', NotificationType.SUCCESS)
|
self.cbpi.notify(self.name, 'Step finished', NotificationType.SUCCESS)
|
||||||
await self.next(self.fermenter.id)
|
await self.next(self.fermenter.id)
|
||||||
return StepResult.DONE
|
return StepResult.DONE
|
||||||
|
@ -189,7 +186,6 @@ class FermenterStep(CBPiFermentationStep):
|
||||||
|
|
||||||
async def on_start(self):
|
async def on_start(self):
|
||||||
if self.endtime == 0:
|
if self.endtime == 0:
|
||||||
|
|
||||||
timeD=int(self.props.get("TimerD", 0))
|
timeD=int(self.props.get("TimerD", 0))
|
||||||
timeH=int(self.props.get("TimerH", 0))
|
timeH=int(self.props.get("TimerH", 0))
|
||||||
timeM=int(self.props.get("TimerM", 0))
|
timeM=int(self.props.get("TimerM", 0))
|
||||||
|
@ -197,8 +193,6 @@ class FermenterStep(CBPiFermentationStep):
|
||||||
else:
|
else:
|
||||||
self.fermentationtime = self.endtime - time.time()
|
self.fermentationtime = self.endtime - time.time()
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
self.AutoMode = True if self.props.get("AutoMode", "No") == "Yes" else False
|
self.AutoMode = True if self.props.get("AutoMode", "No") == "Yes" else False
|
||||||
self.starttemp= self.get_sensor_value(self.props.get("Sensor", None)).get("value")
|
self.starttemp= self.get_sensor_value(self.props.get("Sensor", None)).get("value")
|
||||||
if self.fermenter is not None:
|
if self.fermenter is not None:
|
||||||
|
@ -210,6 +204,7 @@ class FermenterStep(CBPiFermentationStep):
|
||||||
if self.fermenter is not None and self.timer is None:
|
if self.fermenter is not None and self.timer is None:
|
||||||
logging.info("Set Timer")
|
logging.info("Set Timer")
|
||||||
self.timer = Timer(self.fermentationtime ,on_update=self.on_timer_update, on_done=self.on_timer_done)
|
self.timer = Timer(self.fermentationtime ,on_update=self.on_timer_update, on_done=self.on_timer_done)
|
||||||
|
self.timer.is_running = False
|
||||||
elif self.fermenter is not None:
|
elif self.fermenter is not None:
|
||||||
try:
|
try:
|
||||||
if self.timer.is_running == True:
|
if self.timer.is_running == True:
|
||||||
|
@ -218,7 +213,8 @@ class FermenterStep(CBPiFermentationStep):
|
||||||
await self.update_endtime()
|
await self.update_endtime()
|
||||||
except:
|
except:
|
||||||
pass
|
pass
|
||||||
if self.endtime != 0 and self.timer is not None:
|
|
||||||
|
if self.endtime != 0 and self.timer is not None and self.timer.is_running == False:
|
||||||
self.timer.start()
|
self.timer.start()
|
||||||
self.timer.is_running = True
|
self.timer.is_running = True
|
||||||
|
|
||||||
|
|
|
@ -33,7 +33,7 @@ class FermenterAutostart(CBPiExtension):
|
||||||
try:
|
try:
|
||||||
if (self.fermenter.instance is None or self.fermenter.instance.state == False):
|
if (self.fermenter.instance is None or self.fermenter.instance.state == False):
|
||||||
await self.cbpi.fermenter.start(self.fermenter.id)
|
await self.cbpi.fermenter.start(self.fermenter.id)
|
||||||
logging.info("Successfully switched on Ferenterlogic for Fermenter {}".format(self.fermenter.id))
|
logging.info("Successfully switched on Fermenterlogic for Fermenter {}".format(self.fermenter.id))
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
logging.error("Failed to switch on FermenterLogic {} {}".format(self.fermenter.id, e))
|
logging.error("Failed to switch on FermenterLogic {} {}".format(self.fermenter.id, e))
|
||||||
except:
|
except:
|
||||||
|
|
Loading…
Reference in a new issue