浏览代码

Add mashinstep, import mashin temp(infuse_temp) from beerxml, and put boil step ahead of whirlpool and chill steps.

pull/105/head
swimIan 8 年前
父节点
当前提交
3eee952a04
共有 1 个文件被更改,包括 12 次插入0 次删除
  1. +12
    -0
      modules/recipe_import/beerxml.py

+ 12
- 0
modules/recipe_import/beerxml.py 查看文件

@@ -51,6 +51,8 @@ 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)

@@ -64,6 +66,8 @@ 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}})
@@ -87,6 +91,14 @@ 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):




正在加载...
取消
保存