Revert "Updates the boilstep and beerxml recipe import"

This commit is contained in:
Manuel83
2017-10-15 14:48:24 +02:00
committed by GitHub
parent b279dcf347
commit a1740074ac
2 changed files with 10 additions and 34 deletions
+1 -13
View File
@@ -51,8 +51,6 @@ class BeerXMLImport(FlaskView):
name = self.getRecipeName(id)
self.api.set_config_parameter("brew_name", name)
boil_time = self.getBoilTime(id)
infuse = self.getMashinTemp(id)
mashinstep_type = cbpi.get_config_parameter("step_mashin", "MashInStep")
mashstep_type = cbpi.get_config_parameter("step_mash", "MashStep")
mash_kettle = cbpi.get_config_parameter("step_mash_kettle", None)
@@ -66,13 +64,11 @@ class BeerXMLImport(FlaskView):
try:
## Add Mashin step
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())
@@ -91,14 +87,6 @@ class BeerXMLImport(FlaskView):
e = xml.etree.ElementTree.parse(self.BEER_XML_FILE).getroot()
return float(e.find('./RECIPE[%s]/BOIL_TIME' % (str(id))).text)
def getMashinTemp(self, id):
e = xml.etree.ElementTree.parse(self.BEER_XML_FILE).getroot()
tempstr = e.find('./RECIPE[%s]/MASH/MASH_STEPS/MASH_STEP/INFUSE_TEMP' % (str(id))).text
val = tempstr[:-1]
infuse = float(val.rstrip())
return infuse
def getSteps(self, id):