mirror of
https://github.com/PiBrewing/craftbeerpi4.git
synced 2024-12-04 04:28:26 +01:00
call bf recipes at startup and add list to state parameters. -> recudtion of bf api calls
This commit is contained in:
parent
3bf8a9ba6b
commit
598f1e9dce
3 changed files with 19 additions and 1 deletions
|
@ -1,3 +1,3 @@
|
||||||
__version__ = "4.4.2.a4"
|
__version__ = "4.4.2.a5"
|
||||||
__codename__ = "Yeast Starter"
|
__codename__ = "Yeast Starter"
|
||||||
|
|
||||||
|
|
|
@ -43,6 +43,7 @@ class SystemHttpEndpoints:
|
||||||
fermentersteps=self.cbpi.fermenter.get_fermenter_steps(),
|
fermentersteps=self.cbpi.fermenter.get_fermenter_steps(),
|
||||||
config=self.cbpi.config.get_state(),
|
config=self.cbpi.config.get_state(),
|
||||||
notifications=self.cbpi.notification.get_state(),
|
notifications=self.cbpi.notification.get_state(),
|
||||||
|
bf_recipes=await self.cbpi.upload.get_brewfather_recipes(0),
|
||||||
version=__version__,
|
version=__version__,
|
||||||
guiversion=version,
|
guiversion=version,
|
||||||
codename=__codename__)
|
codename=__codename__)
|
||||||
|
|
|
@ -159,6 +159,23 @@ class UploadHttpEndpoints():
|
||||||
|
|
||||||
return web.json_response(bf_list)
|
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)
|
@request_mapping(path='/bf', method="POST", auth_required=False)
|
||||||
async def create_bf_recipe(self, request):
|
async def create_bf_recipe(self, request):
|
||||||
"""
|
"""
|
||||||
|
|
Loading…
Reference in a new issue