set default for mqtt sensor to 999 and add check to fermentersteps target temp step

This commit is contained in:
avollkopf 2022-03-05 11:29:33 +01:00
parent bce0a0025b
commit a136f6b467
3 changed files with 4 additions and 4 deletions

View file

@ -1 +1 @@
__version__ = "4.0.2.0.a13"
__version__ = "4.0.2.0.a14"

View file

@ -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)

View file

@ -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)