mirror of
https://github.com/PiBrewing/craftbeerpi4.git
synced 2024-11-10 01:17:42 +01:00
Fix: issuses #57
This commit is contained in:
parent
2a018fb731
commit
12d487bd3a
1 changed files with 5 additions and 4 deletions
|
@ -5,15 +5,12 @@ from cbpi.api.timer import Timer
|
||||||
from cbpi.api import *
|
from cbpi.api import *
|
||||||
import logging
|
import logging
|
||||||
|
|
||||||
|
|
||||||
@parameters([Property.Number(label="Timer", description="Time in Minutes", configurable=True),
|
@parameters([Property.Number(label="Timer", description="Time in Minutes", configurable=True),
|
||||||
Property.Number(label="Temp", configurable=True),
|
Property.Number(label="Temp", configurable=True),
|
||||||
Property.Sensor(label="Sensor"),
|
Property.Sensor(label="Sensor"),
|
||||||
Property.Kettle(label="Kettle")])
|
Property.Kettle(label="Kettle")])
|
||||||
class MashStep(CBPiStep):
|
class MashStep(CBPiStep):
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
async def on_timer_done(self,timer):
|
async def on_timer_done(self,timer):
|
||||||
self.summary = ""
|
self.summary = ""
|
||||||
await self.next()
|
await self.next()
|
||||||
|
@ -25,6 +22,8 @@ class MashStep(CBPiStep):
|
||||||
async def on_start(self):
|
async def on_start(self):
|
||||||
if self.timer is None:
|
if self.timer is None:
|
||||||
self.timer = Timer(int(self.props.Timer) *60 ,on_update=self.on_timer_update, on_done=self.on_timer_done)
|
self.timer = Timer(int(self.props.Timer) *60 ,on_update=self.on_timer_update, on_done=self.on_timer_done)
|
||||||
|
if self.cbpi.kettle is not None:
|
||||||
|
await self.cbpi.kettle.set_target_temp(self.props.Kettle, int(self.props.Temp))
|
||||||
self.summary = "Waiting for Target Temp"
|
self.summary = "Waiting for Target Temp"
|
||||||
await self.push_update()
|
await self.push_update()
|
||||||
|
|
||||||
|
@ -72,6 +71,8 @@ class WaitStep(CBPiStep):
|
||||||
async def on_start(self):
|
async def on_start(self):
|
||||||
if self.timer is None:
|
if self.timer is None:
|
||||||
self.timer = Timer(int(self.props.Timer) * 60,on_update=self.on_timer_update, on_done=self.on_timer_done)
|
self.timer = Timer(int(self.props.Timer) * 60,on_update=self.on_timer_update, on_done=self.on_timer_done)
|
||||||
|
if self.cbpi.kettle is not None:
|
||||||
|
await self.cbpi.kettle.set_target_temp(self.props.Kettle, int(self.props.Temp))
|
||||||
self.timer.start()
|
self.timer.start()
|
||||||
|
|
||||||
async def on_stop(self):
|
async def on_stop(self):
|
||||||
|
|
Loading…
Reference in a new issue