Skip to content

Commit

Permalink
call bf recipes at startup and add list to state parameters. -> recud…
Browse files Browse the repository at this point in the history
…tion of bf api calls
  • Loading branch information
avollkopf committed Jun 29, 2024
1 parent 3bf8a9b commit 598f1e9
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 1 deletion.
2 changes: 1 addition & 1 deletion cbpi/__init__.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
__version__ = "4.4.2.a4"
__version__ = "4.4.2.a5"
__codename__ = "Yeast Starter"

1 change: 1 addition & 0 deletions cbpi/http_endpoints/http_system.py
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@ async def state(self, request):
fermentersteps=self.cbpi.fermenter.get_fermenter_steps(),
config=self.cbpi.config.get_state(),
notifications=self.cbpi.notification.get_state(),
bf_recipes=await self.cbpi.upload.get_brewfather_recipes(0),
version=__version__,
guiversion=version,
codename=__codename__)
Expand Down
17 changes: 17 additions & 0 deletions cbpi/http_endpoints/http_upload.py
Original file line number Diff line number Diff line change
Expand Up @@ -159,6 +159,23 @@ async def get_bf_list(self, request):

return web.json_response(bf_list)

@request_mapping(path='/bfupdate/', method="GET", auth_required=False)
async def get_bf_update(self, request):
"""
---
description: Get recipe list update from Brewfather App
tags:
- Upload
responses:
"200":
description: successful operation
"""
#offset = request.match_info['offset']
bf_list = await self.controller.get_brewfather_recipes()
self.cbpi.ws.send(dict(topic="bfupdate", data=bf_list))
return web.Response(status=200)

@request_mapping(path='/bf', method="POST", auth_required=False)
async def create_bf_recipe(self, request):
"""
Expand Down

0 comments on commit 598f1e9

Please sign in to comment.