From f9345a30d794f7e80ef20f041dbaa381f5fb3771 Mon Sep 17 00:00:00 2001 From: avollkopf <43980694+avollkopf@users.noreply.github.com> Date: Fri, 19 Nov 2021 17:49:51 +0100 Subject: [PATCH 1/2] Minor fix on automode status Automode status was not shown correctly after step finished if steps were in automode --- cbpi/__init__.py | 2 +- cbpi/controller/kettle_controller.py | 12 ++++++++++-- cbpi/extension/mashstep/__init__.py | 6 +++--- 3 files changed, 14 insertions(+), 6 deletions(-) diff --git a/cbpi/__init__.py b/cbpi/__init__.py index 4efd974..8ec8c56 100644 --- a/cbpi/__init__.py +++ b/cbpi/__init__.py @@ -1 +1 @@ -__version__ = "4.0.0.45" +__version__ = "4.0.0.46" diff --git a/cbpi/controller/kettle_controller.py b/cbpi/controller/kettle_controller.py index c00b790..a97d75b 100644 --- a/cbpi/controller/kettle_controller.py +++ b/cbpi/controller/kettle_controller.py @@ -23,7 +23,7 @@ class KettleController(BasicController): await item.instance.stop() await self.push_udpate() except Exception as e: - logging.error("Faild to switch on KettleLogic {} {}".format(id, e)) + logging.error("Failed to switch on KettleLogic {} {}".format(id, e)) async def set_target_temp(self, id, target_temp): try: @@ -31,5 +31,13 @@ class KettleController(BasicController): item.target_temp = target_temp await self.save() except Exception as e: - logging.error("Faild to set Target Temp {} {}".format(id, e)) + logging.error("Failed to set Target Temp {} {}".format(id, e)) + async def stop(self, id): + try: + logging.info("Stop Kettele {}".format(id)) + item = self.find_by_id(id) + await item.instance.stop() + await self.push_udpate() + except Exception as e: + logging.error("Failed to switch off KettleLogic {} {}".format(id, e)) diff --git a/cbpi/extension/mashstep/__init__.py b/cbpi/extension/mashstep/__init__.py index f6cf6cc..2fe8dfd 100644 --- a/cbpi/extension/mashstep/__init__.py +++ b/cbpi/extension/mashstep/__init__.py @@ -119,7 +119,7 @@ class MashInStep(CBPiStep): if (self.kettle.instance is None or self.kettle.instance.state == False) and (auto_state is True): await self.cbpi.kettle.toggle(self.kettle.id) elif (self.kettle.instance.state == True) and (auto_state is False): - await self.kettle.instance.stop() + await self.cbpi.kettle.stop(self.kettle.id) await self.push_update() except Exception as e: @@ -211,7 +211,7 @@ class MashStep(CBPiStep): if (self.kettle.instance is None or self.kettle.instance.state == False) and (auto_state is True): await self.cbpi.kettle.toggle(self.kettle.id) elif (self.kettle.instance.state == True) and (auto_state is False): - await self.kettle.instance.stop() + await self.cbpi.kettle.stop(self.kettle.id) await self.push_update() except Exception as e: @@ -436,7 +436,7 @@ class BoilStep(CBPiStep): if (self.kettle.instance is None or self.kettle.instance.state == False) and (auto_state is True): await self.cbpi.kettle.toggle(self.kettle.id) elif (self.kettle.instance.state == True) and (auto_state is False): - await self.kettle.instance.stop() + await self.cbpi.kettle.stop(self.kettle.id) await self.push_update() except Exception as e: From 949219db0622bd846fad8938d404035555ad5e28 Mon Sep 17 00:00:00 2001 From: avollkopf <43980694+avollkopf@users.noreply.github.com> Date: Sun, 21 Nov 2021 19:19:19 +0100 Subject: [PATCH 2/2] minor fix in kettle controller --- cbpi/__init__.py | 2 +- cbpi/controller/kettle_controller.py | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/cbpi/__init__.py b/cbpi/__init__.py index 8ec8c56..7455d4e 100644 --- a/cbpi/__init__.py +++ b/cbpi/__init__.py @@ -1 +1 @@ -__version__ = "4.0.0.46" +__version__ = "4.0.0.47" diff --git a/cbpi/controller/kettle_controller.py b/cbpi/controller/kettle_controller.py index a97d75b..46a5afe 100644 --- a/cbpi/controller/kettle_controller.py +++ b/cbpi/controller/kettle_controller.py @@ -37,7 +37,8 @@ class KettleController(BasicController): try: logging.info("Stop Kettele {}".format(id)) item = self.find_by_id(id) - await item.instance.stop() + if item.instance: + await item.instance.stop() await self.push_udpate() except Exception as e: logging.error("Failed to switch off KettleLogic {} {}".format(id, e))