From 5fc5684e5624781c837fb665e68804b81d43fd89 Mon Sep 17 00:00:00 2001 From: swimIan Date: Sat, 9 Sep 2017 10:51:37 -0700 Subject: [PATCH] update boilstep and reorder steps in beerxml recipe import --- modules/base_plugins/brew_steps/__init__.py | 13 ++++++++++++- modules/recipe_import/beerxml.py | 2 +- 2 files changed, 13 insertions(+), 2 deletions(-) diff --git a/modules/base_plugins/brew_steps/__init__.py b/modules/base_plugins/brew_steps/__init__.py index 8dcd82f..fb7c2b6 100644 --- a/modules/base_plugins/brew_steps/__init__.py +++ b/modules/base_plugins/brew_steps/__init__.py @@ -165,7 +165,9 @@ class BoilStep(StepBase): hop_2 = Property.Number("Hop 2 Addition", configurable=True, description="Second Hop alert") hop_2_added = Property.Number("", default_value=None) hop_3 = Property.Number("Hop 3 Addition", configurable=True) - hop_3_added = Property.Number("", default_value=None, description="Second Hop alert") + hop_3_added = Property.Number("", default_value=None, description="Third Hop alert") + fining = Property.Number("Fining Addition", configurable=True, default_value=15) + fining_added = Property.Number("",default_value=None, description="Fining Agent Alert") def init(self): ''' @@ -203,6 +205,13 @@ class BoilStep(StepBase): self.__setattr__("hop_%s_added" % number, True) self.notify("Hop Alert", "Please add Hop %s" % number, timeout=None) + def check_fining_timer(self, value): + + if self.__getattribute__("fining_added") is not True and (int(value) * 60) == ( + self.timer_end - int(time.time())): + self.__setattr__("fining_added", True) + self.notify("Fining Alert", "Please add fining agent", timeout=None) + def execute(self): ''' This method is execute in an interval @@ -212,11 +221,13 @@ class BoilStep(StepBase): if self.get_kettle_temp(self.kettle) >= float(self.temp): # Check if Timer is Running if self.is_timer_finished() is None: + self.notify("Boil Temp Reached", "Starting the boil timer") self.start_timer(int(self.timer) * 60) else: self.check_hop_timer(1, self.hop_1) self.check_hop_timer(2, self.hop_2) self.check_hop_timer(3, self.hop_3) + self.check_fining_timer(self.fining) # Check if timer finished and go to next step if self.is_timer_finished() == True: self.notify("Boil Step Completed!", "Starting the next step", timeout=None) diff --git a/modules/recipe_import/beerxml.py b/modules/recipe_import/beerxml.py index 91335d4..8883cb3 100644 --- a/modules/recipe_import/beerxml.py +++ b/modules/recipe_import/beerxml.py @@ -70,9 +70,9 @@ class BeerXMLImport(FlaskView): Step.insert(**{"name": "MashIn", "type": mashinstep_type, "config": {"kettle": mash_kettle, "temp": infuse}}) for row in steps: Step.insert(**{"name": row.get("name"), "type": mashstep_type, "config": {"kettle": mash_kettle, "temp": float(row.get("temp")), "timer": row.get("timer")}}) - Step.insert(**{"name": "ChilStep", "type": "ChilStep", "config": {"timer": 15}}) ## Add cooking step Step.insert(**{"name": "Boil", "type": boilstep_type, "config": {"kettle": boil_kettle, "temp": boil_temp, "timer": boil_time}}) + Step.insert(**{"name": "ChilStep", "type": "ChilStep", "config": {"timer": 15}}) ## Add Whirlpool step Step.insert(**{"name": "Whirlpool", "type": "ChilStep", "config": {"timer": 15}}) self.api.emit("UPDATE_ALL_STEPS", Step.get_all())