diff --git a/cbpi/__init__.py b/cbpi/__init__.py index 2214a03..517bf0f 100644 --- a/cbpi/__init__.py +++ b/cbpi/__init__.py @@ -1,3 +1,3 @@ -__version__ = "4.4.2.a2" +__version__ = "4.4.2.a3" __codename__ = "Yeast Starter" diff --git a/cbpi/extension/ConfigUpdate/__init__.py b/cbpi/extension/ConfigUpdate/__init__.py index eba146a..95f2a6c 100644 --- a/cbpi/extension/ConfigUpdate/__init__.py +++ b/cbpi/extension/ConfigUpdate/__init__.py @@ -61,6 +61,7 @@ class ConfigUpdate(CBPiExtension): AddMashIn = self.cbpi.config.get("AddMashInStep", None) bfuserid = self.cbpi.config.get("brewfather_user_id", None) bfapikey = self.cbpi.config.get("brewfather_api_key", None) + bflistlength = self.cbpi.config.get("brewfather_list_length", None) RecipeCreationPath = self.cbpi.config.get("RECIPE_CREATION_PATH", None) BoilKettle = self.cbpi.config.get("BoilKettle", None) CONFIG_STATUS = self.cbpi.config.get("CONFIG_STATUS", None) @@ -244,6 +245,21 @@ class ConfigUpdate(CBPiExtension): await self.cbpi.config.add("brewfather_api_key", "", type=ConfigType.STRING, description="Brewfather API Key", source="craftbeerpi") except: logger.warning('Unable to update config') + + ## Check if Brewfather API Key is in config + + if bflistlength is None: + logger.info("INIT Brewfather Recipe List Length") + try: + await self.cbpi.config.add("brewfather_list_length", 50, type=ConfigType.SELECT, description="Brewfather Recipe List length", + source="craftbeerpi", + options= [{"label": "5", "value": 5}, + {"label": "10", "value": 10}, + {"label": "25", "value": 25}, + {"label": "50", "value": 50}, + {"label": "100", "value": 100}]) + except: + logger.warning('Unable to update config') ## Check if Brewfather API Key is in config