diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 691a6aa..39d9296 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -66,7 +66,7 @@ jobs: BUILD_CACHE_IMAGE_NAME=${LATEST_IMAGE} TAGS="${LATEST_IMAGE},${{ env.image-name }}:v${VERSION}" PUBLISH_IMAGE=true - elif [[ $GITHUB_REF_NAME == development ]] || [[ $GITHUB_REF_NAME == development_fermentersteps ]]; then + elif [[ $GITHUB_REF_NAME == development ]]; then PUBLISH_IMAGE=true fi diff --git a/cbpi/__init__.py b/cbpi/__init__.py index d66daf9..733b151 100644 --- a/cbpi/__init__.py +++ b/cbpi/__init__.py @@ -1 +1 @@ -__version__ = "4.0.2.0.a14" +__version__ = "4.0.2.0.a15" diff --git a/cbpi/controller/fermentation_controller.py b/cbpi/controller/fermentation_controller.py index 528a1c6..3a89dea 100644 --- a/cbpi/controller/fermentation_controller.py +++ b/cbpi/controller/fermentation_controller.py @@ -540,7 +540,7 @@ class FermentationController: with open(path, "w") as file: yaml.dump(data, file) - async def load_recipe(self, data, fermenterid): + async def load_recipe(self, data, fermenterid, name): try: await self.shutdown(None, fermenterid) except: @@ -553,7 +553,10 @@ class FermentationController: item["props"]["Sensor"] = fermenter.sensor list(map(lambda item: add_runtime_data(item), data.get("steps"))) fermenter.description = data['basic']['desc'] - fermenter.brewname = data['basic']['name'] + if name is not None: + fermenter.brewname = name + else: + fermenter.brewname = data['basic']['name'] fermenter.steps=[] await self.update(fermenter) for item in data.get("steps"): diff --git a/cbpi/controller/fermenter_recipe_controller.py b/cbpi/controller/fermenter_recipe_controller.py index e0065c3..d0de8b5 100644 --- a/cbpi/controller/fermenter_recipe_controller.py +++ b/cbpi/controller/fermenter_recipe_controller.py @@ -69,13 +69,13 @@ class FermenterRecipeController: os.remove(path) - async def brew(self, name, fermenterid): + async def brew(self, recipeid, fermenterid, name): - recipe_path = os.path.join(".", 'config', "fermenterrecipes", "%s.yaml" % name) + recipe_path = os.path.join(".", 'config', "fermenterrecipes", "%s.yaml" % recipeid) logging.info(recipe_path) with open(recipe_path) as file: data = yaml.load(file, Loader=yaml.FullLoader) - await self.cbpi.fermenter.load_recipe(data, fermenterid) + await self.cbpi.fermenter.load_recipe(data, fermenterid, name) async def clone(self, id, new_name): recipe_path = os.path.join(".", 'config', "fermenterrecipes", "%s.yaml" % id) diff --git a/cbpi/http_endpoints/http_fermenterrecipe.py b/cbpi/http_endpoints/http_fermenterrecipe.py index 76dddd9..e974e3e 100644 --- a/cbpi/http_endpoints/http_fermenterrecipe.py +++ b/cbpi/http_endpoints/http_fermenterrecipe.py @@ -117,7 +117,7 @@ class FermenterRecipeHttpEndpoints(): await self.controller.remove(name) return web.Response(status=204) - @request_mapping(path="/{name}/{fermenterid}/brew", method="POST", auth_required=False) + @request_mapping(path="/{recipeid}/{fermenterid}/{name}/brew", method="POST", auth_required=False) async def http_brew(self, request): """ @@ -137,9 +137,10 @@ class FermenterRecipeHttpEndpoints(): "200": description: successful operation """ + recipeid = request.match_info['recipeid'] name = request.match_info['name'] fermenterid = request.match_info['fermenterid'] - await self.controller.brew(name,fermenterid) + await self.controller.brew(recipeid,fermenterid,name) return web.Response(status=204) @request_mapping(path="/{id}/clone", method="POST", auth_required=False)