瀏覽代碼

Merge d6d023798a into ca9575ac29

pull/85/merge
swimIan GitHub 8 年之前
父節點
當前提交
7731e32ad2
共有 2 個文件被更改,包括 9 次插入2 次删除
  1. +1
    -1
      modules/buzzer/__init__.py
  2. +8
    -1
      modules/recipe_import/beerxml.py

+ 1
- 1
modules/buzzer/__init__.py 查看文件

@@ -9,7 +9,7 @@ except Exception as e:


class Buzzer(object): class Buzzer(object):


sound = ["H", 0.1, "L"]
sound = ["H", 0.1, "L", 0.1, "H", 0.1, "L", 0.1, "H", 0.1, "L"]
def __init__(self, gpio): def __init__(self, gpio):
try: try:
cbpi.app.logger.info("INIT BUZZER NOW GPIO%s" % gpio) cbpi.app.logger.info("INIT BUZZER NOW GPIO%s" % gpio)


+ 8
- 1
modules/recipe_import/beerxml.py 查看文件

@@ -51,6 +51,8 @@ class BeerXMLImport(FlaskView):
name = self.getRecipeName(id) name = self.getRecipeName(id)
self.api.set_config_parameter("brew_name", name) self.api.set_config_parameter("brew_name", name)
boil_time = self.getBoilTime(id) boil_time = self.getBoilTime(id)
mashin_temp = self.getMashinTemp(id)
mashinstep_type = cbpi.get_config_parameter("step_mashin", "MashInStep")
mashstep_type = cbpi.get_config_parameter("step_mash", "MashStep") mashstep_type = cbpi.get_config_parameter("step_mash", "MashStep")
mash_kettle = cbpi.get_config_parameter("step_mash_kettle", None) mash_kettle = cbpi.get_config_parameter("step_mash_kettle", None)


@@ -63,7 +65,8 @@ class BeerXMLImport(FlaskView):
StepView().reset() StepView().reset()


try: try:

## Add Mashin step
Step.insert(**{"name": "MashIn", "type": mashinstep_type, "config": {"kettle": mash_kettle, "temp": mashin_temp}})
for row in steps: 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": 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}}) Step.insert(**{"name": "ChilStep", "type": "ChilStep", "config": {"timer": 15}})
@@ -87,6 +90,10 @@ class BeerXMLImport(FlaskView):
e = xml.etree.ElementTree.parse(self.BEER_XML_FILE).getroot() e = xml.etree.ElementTree.parse(self.BEER_XML_FILE).getroot()
return float(e.find('./RECIPE[%s]/BOIL_TIME' % (str(id))).text) 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()
return float('./RECIPE[%s]/MASH/MASH_STEPS/INFUSE_TEMP' % (str(id))).text)

def getSteps(self, id): def getSteps(self, id):






Loading…
取消
儲存