Merge pull request #48 from BrauereiAlt/master

Activate Timer in Boil and Mash Steps
This commit is contained in:
Manuel83 2021-03-11 22:21:20 +01:00 committed by GitHub
commit 7611e1d167
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -41,8 +41,9 @@ 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
@ -157,8 +158,9 @@ class BoilStep(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 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):