From a136f6b4674304f8e3f28e45567170c7452b8493 Mon Sep 17 00:00:00 2001 From: avollkopf <43980694+avollkopf@users.noreply.github.com> Date: Sat, 5 Mar 2022 11:29:33 +0100 Subject: [PATCH] set default for mqtt sensor to 999 and add check to fermentersteps target temp step --- cbpi/__init__.py | 2 +- cbpi/extension/FermentationStep/__init__.py | 4 ++-- cbpi/extension/mqtt_sensor/__init__.py | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/cbpi/__init__.py b/cbpi/__init__.py index 9fcb99b..d66daf9 100644 --- a/cbpi/__init__.py +++ b/cbpi/__init__.py @@ -1 +1 @@ -__version__ = "4.0.2.0.a13" +__version__ = "4.0.2.0.a14" diff --git a/cbpi/extension/FermentationStep/__init__.py b/cbpi/extension/FermentationStep/__init__.py index f63fb9d..442c84b 100644 --- a/cbpi/extension/FermentationStep/__init__.py +++ b/cbpi/extension/FermentationStep/__init__.py @@ -113,7 +113,7 @@ class FermenterTargetTempStep(CBPiFermentationStep): logging.info("warmup") while self.running == True: sensor_value = self.get_sensor_value(self.props.get("Sensor", None)).get("value") - if sensor_value >= self.fermenter.target_temp and self.timer.is_running is not True: + if sensor_value < 900 and sensor_value >= self.fermenter.target_temp and self.timer.is_running is not True: self.timer.start() self.timer.is_running = True await asyncio.sleep(1) @@ -121,7 +121,7 @@ class FermenterTargetTempStep(CBPiFermentationStep): logging.info("Cooldown") while self.running == True: sensor_value = self.get_sensor_value(self.props.get("Sensor", None)).get("value") - if sensor_value <= self.fermenter.target_temp and self.timer.is_running is not True: + if sensor_value < 900 and sensor_value <= self.fermenter.target_temp and self.timer.is_running is not True: self.timer.start() self.timer.is_running = True await asyncio.sleep(1) diff --git a/cbpi/extension/mqtt_sensor/__init__.py b/cbpi/extension/mqtt_sensor/__init__.py index 4564416..abc4fae 100644 --- a/cbpi/extension/mqtt_sensor/__init__.py +++ b/cbpi/extension/mqtt_sensor/__init__.py @@ -18,7 +18,7 @@ class MQTTSensor(CBPiSensor): if self.payload_text != None: self.payload_text = self.payload_text.split('.') self.mqtt_task = self.cbpi.satellite.subcribe(self.Topic, self.on_message) - self.value: int = 0 + self.value: int = 999 async def on_message(self, message): val = json.loads(message)