mirror of
https://github.com/PiBrewing/craftbeerpi4.git
synced 2024-11-10 01:17:42 +01:00
Add files via upload
This commit is contained in:
parent
03a30e70ce
commit
07024d7fc3
1 changed files with 11 additions and 16 deletions
|
@ -11,17 +11,8 @@ import logging
|
||||||
Property.Kettle(label="Kettle")])
|
Property.Kettle(label="Kettle")])
|
||||||
class MashStep(CBPiStep):
|
class MashStep(CBPiStep):
|
||||||
|
|
||||||
@action(key="Custom RESET", parameters=[])
|
|
||||||
async def custom_reset(self, **kwargs):
|
|
||||||
self.summary = ""
|
|
||||||
await self.push_update()
|
|
||||||
|
|
||||||
|
|
||||||
@action(key="Custom Action", parameters=[Property.Number(label="Value", configurable=True)])
|
|
||||||
async def custom_action(self, Value, **kwargs):
|
|
||||||
self.summary = "VALUE FROM ACTION {}".format(Value)
|
|
||||||
await self.push_update()
|
|
||||||
self.cbpi.notify("ACTION 2 CALLED".format(Value))
|
|
||||||
|
|
||||||
async def on_timer_done(self,timer):
|
async def on_timer_done(self,timer):
|
||||||
self.summary = ""
|
self.summary = ""
|
||||||
|
@ -50,22 +41,25 @@ class MashStep(CBPiStep):
|
||||||
while True:
|
while True:
|
||||||
await asyncio.sleep(1)
|
await asyncio.sleep(1)
|
||||||
sensor_value = self.get_sensor_value(self.props.Sensor)
|
sensor_value = self.get_sensor_value(self.props.Sensor)
|
||||||
if sensor_value.get("value") >= int(self.props.Temp) and self.timer == None:
|
if sensor_value.get("value") >= int(self.props.Temp) and self.timer.is_running is not True:
|
||||||
self.timer.start()
|
self.timer.start()
|
||||||
|
self.timer.is_running = True
|
||||||
return StepResult.DONE
|
return StepResult.DONE
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@parameters([Property.Number(label="Timer", description="Time in Minutes", configurable=True)])
|
@parameters([Property.Number(label="Timer", description="Time in Minutes", configurable=True)])
|
||||||
class WaitStep(CBPiStep):
|
class WaitStep(CBPiStep):
|
||||||
|
|
||||||
@action(key="Custom Step Action", parameters=[])
|
@action(key="Custom Step Action", parameters=[])
|
||||||
async def hello(self, **kwargs):
|
async def hello(self, **kwargs):
|
||||||
print("ACTION")
|
print("ACTION")
|
||||||
self.cbpi.notify("ACTION 1 CALLED")
|
|
||||||
|
|
||||||
@action(key="Custom Step Action 2", parameters=[])
|
@action(key="Custom Step Action 2", parameters=[])
|
||||||
async def hello2(self, **kwargs):
|
async def hello2(self, **kwargs):
|
||||||
print("ACTION2")
|
print("ACTION2")
|
||||||
self.cbpi.notify("ACTION 2 CALLED")
|
|
||||||
|
|
||||||
async def on_timer_done(self,timer):
|
async def on_timer_done(self,timer):
|
||||||
self.summary = ""
|
self.summary = ""
|
||||||
|
@ -157,15 +151,16 @@ class BoilStep(CBPiStep):
|
||||||
|
|
||||||
@action("Start Timer", [])
|
@action("Start Timer", [])
|
||||||
async def star_timer(self):
|
async def star_timer(self):
|
||||||
self.cbpi.notify("Timer started")
|
|
||||||
self.timer.start()
|
self.timer.start()
|
||||||
|
|
||||||
async def run(self):
|
async def run(self):
|
||||||
while True:
|
while True:
|
||||||
await asyncio.sleep(1)
|
await asyncio.sleep(1)
|
||||||
sensor_value = self.get_sensor_value(self.props.Sensor)
|
sensor_value = self.get_sensor_value(self.props.Sensor)
|
||||||
if sensor_value is not None and sensor_value.get("value") >= int(self.props.Temp) and self.timer == None:
|
if sensor_value.get("value") >= int(self.props.Temp) and self.timer.is_running is not True:
|
||||||
self.timer.start()
|
self.timer.start()
|
||||||
|
self.timer.is_running = True
|
||||||
return StepResult.DONE
|
return StepResult.DONE
|
||||||
|
|
||||||
def setup(cbpi):
|
def setup(cbpi):
|
||||||
|
|
Loading…
Reference in a new issue