From 84f9bbb67f58da1ad2b73cbe4578faeea71ba682 Mon Sep 17 00:00:00 2001 From: avollkopf <43980694+avollkopf@users.noreply.github.com> Date: Mon, 21 Feb 2022 17:54:22 +0100 Subject: [PATCH] update on fermentersteps for automode --- cbpi/__init__.py | 2 +- cbpi/controller/dashboard_controller.py | 2 +- cbpi/controller/fermentation_controller.py | 2 +- cbpi/extension/FermentationStep/__init__.py | 8 ++++---- 4 files changed, 7 insertions(+), 7 deletions(-) diff --git a/cbpi/__init__.py b/cbpi/__init__.py index a3e6a55..f439cc9 100644 --- a/cbpi/__init__.py +++ b/cbpi/__init__.py @@ -1 +1 @@ -__version__ = "4.0.1.18.a5" +__version__ = "4.0.1.18.a6" diff --git a/cbpi/controller/dashboard_controller.py b/cbpi/controller/dashboard_controller.py index 167a762..73bd064 100644 --- a/cbpi/controller/dashboard_controller.py +++ b/cbpi/controller/dashboard_controller.py @@ -50,7 +50,7 @@ class DashboardController: async def get_custom_widgets(self): path = os.path.join(".", 'config', "dashboard", "widgets") - onlyfiles = [os.path.splitext(f)[0] for f in listdir(path) if isfile(join(path, f)) and f.endswith(".svg")] + onlyfiles = [os.path.splitext(f)[0] for f in sorted(listdir(path)) if isfile(join(path, f)) and f.endswith(".svg")] return onlyfiles async def get_dashboard_numbers(self): diff --git a/cbpi/controller/fermentation_controller.py b/cbpi/controller/fermentation_controller.py index 4904f14..90c2173 100644 --- a/cbpi/controller/fermentation_controller.py +++ b/cbpi/controller/fermentation_controller.py @@ -412,7 +412,7 @@ class FermentationController: self.save() except Exception as e: logging.error("Failed to stop fermenterstep - Id: %s" % step.id) - + self.push_update() self.push_update("fermenterstepupdate") except Exception as e: diff --git a/cbpi/extension/FermentationStep/__init__.py b/cbpi/extension/FermentationStep/__init__.py index 67670ed..c782cdb 100644 --- a/cbpi/extension/FermentationStep/__init__.py +++ b/cbpi/extension/FermentationStep/__init__.py @@ -125,9 +125,9 @@ class FermenterTargetTempStep(CBPiFermentationStep): async def setAutoMode(self, auto_state): try: if (self.fermenter.instance is None or self.fermenter.instance.state == False) and (auto_state is True): - await self.fermenter.instance.toggle(self.fermenter.id) + await self.cbpi.fermenter.toggle(self.fermenter.id) elif (self.fermenter.instance.state == True) and (auto_state is False): - await self.fermenter.instance.stop(self.fermenter.id) + await self.fermenter.instance.stop() await self.push_update() except Exception as e: @@ -228,9 +228,9 @@ class FermenterStep(CBPiFermentationStep): async def setAutoMode(self, auto_state): try: if (self.fermenter.instance is None or self.fermenter.instance.state == False) and (auto_state is True): - await self.fermenter.instance.toggle(self.fermenter.id) + await self.cbpi.fermenter.toggle(self.fermenter.id) elif (self.fermenter.instance.state == True) and (auto_state is False): - await self.fermenter.instance.stop(self.fermenter.id) + await self.fermenter.instance.stop() await self.push_update() except Exception as e: