mirror of
https://github.com/PiBrewing/craftbeerpi4.git
synced 2024-11-09 17:07:43 +01:00
fixed bug in parameter generation -> source | options order
This commit is contained in:
parent
f990e0e0a3
commit
1d6cd75f8c
8 changed files with 136 additions and 38 deletions
|
@ -1,3 +1,3 @@
|
||||||
__version__ = "4.1.8.a11"
|
__version__ = "4.1.8.a12"
|
||||||
__codename__ = "Groundhog Day"
|
__codename__ = "Groundhog Day"
|
||||||
|
|
||||||
|
|
|
@ -21,7 +21,7 @@ class CBPiBase(metaclass=ABCMeta):
|
||||||
return await self.cbpi.config.remove(name)
|
return await self.cbpi.config.remove(name)
|
||||||
|
|
||||||
async def add_config_value(self, name, value, type: ConfigType, description, source, options=None):
|
async def add_config_value(self, name, value, type: ConfigType, description, source, options=None):
|
||||||
await self.cbpi.config.add(name, value, type, description, source,options=None)
|
await self.cbpi.config.add(name, value, type, description, source, options=None)
|
||||||
|
|
||||||
def get_kettle(self,id):
|
def get_kettle(self,id):
|
||||||
return self.cbpi.kettle.find_by_id(id)
|
return self.cbpi.kettle.find_by_id(id)
|
||||||
|
|
|
@ -204,7 +204,7 @@ class Config:
|
||||||
def __str__(self):
|
def __str__(self):
|
||||||
return "....name={} value={}".format(self.name, self.value)
|
return "....name={} value={}".format(self.name, self.value)
|
||||||
def to_dict(self):
|
def to_dict(self):
|
||||||
return dict(name=self.name, value=self.value, type=self.type.value, description=self.description, options=self.options, source=self.source)
|
return dict(name=self.name, value=self.value, type=self.type.value, description=self.description, source=self.source, options=self.options)
|
||||||
|
|
||||||
@dataclass
|
@dataclass
|
||||||
class NotificationAction:
|
class NotificationAction:
|
||||||
|
|
|
@ -30,7 +30,8 @@ class ConfigController:
|
||||||
with open(self.path) as json_file:
|
with open(self.path) as json_file:
|
||||||
data = json.load(json_file)
|
data = json.load(json_file)
|
||||||
for key, value in data.items():
|
for key, value in data.items():
|
||||||
self.cache[key] = Config(name=value.get("name"), value=value.get("value"), description=value.get("description"), type=ConfigType(value.get("type", "string")), options=value.get("options", None), source=value.get("source", "craftbeerpi") )
|
self.cache[key] = Config(name=value.get("name"), value=value.get("value"), description=value.get("description"), type=ConfigType(value.get("type", "string")), source=value.get("source", "craftbeerpi"), options=value.get("options", None))
|
||||||
|
logging.error(self.cache)
|
||||||
|
|
||||||
def get(self, name, default=None):
|
def get(self, name, default=None):
|
||||||
self.logger.debug("GET CONFIG VALUE %s (default %s)" % (name, default))
|
self.logger.debug("GET CONFIG VALUE %s (default %s)" % (name, default))
|
||||||
|
@ -78,7 +79,7 @@ class ConfigController:
|
||||||
json.dump(data, file, indent=4, sort_keys=True)
|
json.dump(data, file, indent=4, sort_keys=True)
|
||||||
self.cache=self.testcache
|
self.cache=self.testcache
|
||||||
|
|
||||||
async def remove_obsolete(self):
|
async def obsolete(self, remove=False):
|
||||||
result = {}
|
result = {}
|
||||||
for key, value in self.cache.items():
|
for key, value in self.cache.items():
|
||||||
if (value.source not in ('craftbeerpi','steps','hidden')):
|
if (value.source not in ('craftbeerpi','steps','hidden')):
|
||||||
|
@ -86,7 +87,10 @@ class ConfigController:
|
||||||
if test == []:
|
if test == []:
|
||||||
update=self.get(str(value.source)+'_update')
|
update=self.get(str(value.source)+'_update')
|
||||||
if update:
|
if update:
|
||||||
await self.remove(str(value.source)+'_update')
|
logging.warning(update)
|
||||||
await self.remove(key)
|
if remove:
|
||||||
|
await self.remove(str(value.source)+'_update')
|
||||||
|
if remove:
|
||||||
|
await self.remove(key)
|
||||||
result[key] = value.to_dict()
|
result[key] = value.to_dict()
|
||||||
return result
|
return result
|
|
@ -159,7 +159,7 @@ class ConfigUpdate(CBPiExtension):
|
||||||
logger.info("INIT Max Dashboard Numbers for multiple dashboards")
|
logger.info("INIT Max Dashboard Numbers for multiple dashboards")
|
||||||
try:
|
try:
|
||||||
await self.cbpi.config.add("max_dashboard_number", 4, type=ConfigType.SELECT, description="Max Number of Dashboards",
|
await self.cbpi.config.add("max_dashboard_number", 4, type=ConfigType.SELECT, description="Max Number of Dashboards",
|
||||||
|
source="craftbeerpi",
|
||||||
options= [{"label": "1", "value": 1},
|
options= [{"label": "1", "value": 1},
|
||||||
{"label": "2", "value": 2},
|
{"label": "2", "value": 2},
|
||||||
{"label": "3", "value": 3},
|
{"label": "3", "value": 3},
|
||||||
|
@ -169,8 +169,8 @@ class ConfigUpdate(CBPiExtension):
|
||||||
{"label": "7", "value": 7},
|
{"label": "7", "value": 7},
|
||||||
{"label": "8", "value": 8},
|
{"label": "8", "value": 8},
|
||||||
{"label": "9", "value": 9},
|
{"label": "9", "value": 9},
|
||||||
{"label": "10", "value": 10}],
|
{"label": "10", "value": 10}])
|
||||||
source="craftbeerpi")
|
|
||||||
except:
|
except:
|
||||||
logger.warning('Unable to update database')
|
logger.warning('Unable to update database')
|
||||||
|
|
||||||
|
@ -190,17 +190,19 @@ class ConfigUpdate(CBPiExtension):
|
||||||
logger.info("INIT AutoMode")
|
logger.info("INIT AutoMode")
|
||||||
try:
|
try:
|
||||||
await self.cbpi.config.add("AutoMode", "Yes", type=ConfigType.SELECT, description="Use AutoMode in steps",
|
await self.cbpi.config.add("AutoMode", "Yes", type=ConfigType.SELECT, description="Use AutoMode in steps",
|
||||||
|
source="steps",
|
||||||
options=[{"label": "Yes", "value": "Yes"},
|
options=[{"label": "Yes", "value": "Yes"},
|
||||||
{"label": "No", "value": "No"}],
|
{"label": "No", "value": "No"}])
|
||||||
source="steps")
|
|
||||||
except:
|
except:
|
||||||
logger.warning('Unable to update config')
|
logger.warning('Unable to update config')
|
||||||
else:
|
else:
|
||||||
if CONFIG_STATUS is None or CONFIG_STATUS != self.version:
|
if CONFIG_STATUS is None or CONFIG_STATUS != self.version:
|
||||||
await self.cbpi.config.add("AutoMode", AutoMode, type=ConfigType.SELECT, description="Use AutoMode in steps", options=
|
await self.cbpi.config.add("AutoMode", AutoMode, type=ConfigType.SELECT, description="Use AutoMode in steps",
|
||||||
[{"label": "Yes", "value": "Yes"},
|
source="steps",
|
||||||
{"label": "No", "value": "No"}],
|
options=[{"label": "Yes", "value": "Yes"},
|
||||||
source="steps")
|
{"label": "No", "value": "No"}])
|
||||||
|
|
||||||
|
|
||||||
## Check if AddMashInStep for Steps is in config
|
## Check if AddMashInStep for Steps is in config
|
||||||
|
|
||||||
|
@ -208,24 +210,26 @@ class ConfigUpdate(CBPiExtension):
|
||||||
logger.info("INIT AddMashInStep")
|
logger.info("INIT AddMashInStep")
|
||||||
try:
|
try:
|
||||||
await self.cbpi.config.add("AddMashInStep", "Yes", type=ConfigType.SELECT, description= "Add MashIn Step automatically if not defined in recipe",
|
await self.cbpi.config.add("AddMashInStep", "Yes", type=ConfigType.SELECT, description= "Add MashIn Step automatically if not defined in recipe",
|
||||||
|
source="steps",
|
||||||
options = [{"label": "Yes", "value": "Yes"},
|
options = [{"label": "Yes", "value": "Yes"},
|
||||||
{"label": "No", "value": "No"}],
|
{"label": "No", "value": "No"}])
|
||||||
source="steps")
|
|
||||||
except:
|
except:
|
||||||
logger.warning('Unable to update config')
|
logger.warning('Unable to update config')
|
||||||
else:
|
else:
|
||||||
if CONFIG_STATUS is None or CONFIG_STATUS != self.version:
|
if CONFIG_STATUS is None or CONFIG_STATUS != self.version:
|
||||||
await self.cbpi.config.add("AddMashInStep", AddMashIn, type=ConfigType.SELECT, description="Add MashIn Step automatically if not defined in recipe",
|
await self.cbpi.config.add("AddMashInStep", AddMashIn, type=ConfigType.SELECT, description="Add MashIn Step automatically if not defined in recipe",
|
||||||
|
source="steps",
|
||||||
options= [{"label": "Yes", "value": "Yes"},
|
options= [{"label": "Yes", "value": "Yes"},
|
||||||
{"label": "No", "value": "No"}],
|
{"label": "No", "value": "No"}])
|
||||||
source="steps")
|
|
||||||
|
|
||||||
## Check if Brewfather UserID is in config
|
## Check if Brewfather UserID is in config
|
||||||
|
|
||||||
if bfuserid is None:
|
if bfuserid is None:
|
||||||
logger.info("INIT Brewfather User ID")
|
logger.info("INIT Brewfather User ID")
|
||||||
try:
|
try:
|
||||||
await self.cbpi.config.add("brewfather_user_id", "", type=ConfigType.STRING, description="Brewfather User ID")
|
await self.cbpi.config.add("brewfather_user_id", "", type=ConfigType.STRING, description="Brewfather User ID", source="craftbeerpi")
|
||||||
except:
|
except:
|
||||||
logger.warning('Unable to update config')
|
logger.warning('Unable to update config')
|
||||||
|
|
||||||
|
@ -234,7 +238,7 @@ class ConfigUpdate(CBPiExtension):
|
||||||
if bfapikey is None:
|
if bfapikey is None:
|
||||||
logger.info("INIT Brewfather API Key")
|
logger.info("INIT Brewfather API Key")
|
||||||
try:
|
try:
|
||||||
await self.cbpi.config.add("brewfather_api_key", "", type=ConfigType.STRING, description="Brewfather API Key")
|
await self.cbpi.config.add("brewfather_api_key", "", type=ConfigType.STRING, description="Brewfather API Key", source="craftbeerpi")
|
||||||
except:
|
except:
|
||||||
logger.warning('Unable to update config')
|
logger.warning('Unable to update config')
|
||||||
|
|
||||||
|
@ -243,7 +247,7 @@ class ConfigUpdate(CBPiExtension):
|
||||||
if RecipeCreationPath is None:
|
if RecipeCreationPath is None:
|
||||||
logger.info("INIT Recipe Creation Path")
|
logger.info("INIT Recipe Creation Path")
|
||||||
try:
|
try:
|
||||||
await self.cbpi.config.add("RECIPE_CREATION_PATH", "upload", type=ConfigType.STRING, description="API path to creation plugin. Default: upload . CHANGE ONLY IF USING A RECIPE CREATION PLUGIN")
|
await self.cbpi.config.add("RECIPE_CREATION_PATH", "upload", type=ConfigType.STRING, description="API path to creation plugin. Default: upload . CHANGE ONLY IF USING A RECIPE CREATION PLUGIN", source="craftbeerpi")
|
||||||
except:
|
except:
|
||||||
logger.warning('Unable to update config')
|
logger.warning('Unable to update config')
|
||||||
|
|
||||||
|
@ -274,6 +278,7 @@ class ConfigUpdate(CBPiExtension):
|
||||||
logger.info("INIT CSV logfiles")
|
logger.info("INIT CSV logfiles")
|
||||||
try:
|
try:
|
||||||
await self.cbpi.config.add("CSVLOGFILES", "Yes", type=ConfigType.SELECT, description="Write sensor data to csv logfiles",
|
await self.cbpi.config.add("CSVLOGFILES", "Yes", type=ConfigType.SELECT, description="Write sensor data to csv logfiles",
|
||||||
|
source="craftbeerpi",
|
||||||
options= [{"label": "Yes", "value": "Yes"},
|
options= [{"label": "Yes", "value": "Yes"},
|
||||||
{"label": "No", "value": "No"}])
|
{"label": "No", "value": "No"}])
|
||||||
except:
|
except:
|
||||||
|
@ -284,6 +289,7 @@ class ConfigUpdate(CBPiExtension):
|
||||||
logger.info("INIT Influxdb")
|
logger.info("INIT Influxdb")
|
||||||
try:
|
try:
|
||||||
await self.cbpi.config.add("INFLUXDB", "No", type=ConfigType.SELECT, description="Write sensor data to influxdb",
|
await self.cbpi.config.add("INFLUXDB", "No", type=ConfigType.SELECT, description="Write sensor data to influxdb",
|
||||||
|
source="craftbeerpi",
|
||||||
options= [{"label": "Yes", "value": "Yes"},
|
options= [{"label": "Yes", "value": "Yes"},
|
||||||
{"label": "No", "value": "No"}])
|
{"label": "No", "value": "No"}])
|
||||||
except:
|
except:
|
||||||
|
@ -293,7 +299,7 @@ class ConfigUpdate(CBPiExtension):
|
||||||
if influxdbaddr is None:
|
if influxdbaddr is None:
|
||||||
logger.info("INIT Influxdbaddr")
|
logger.info("INIT Influxdbaddr")
|
||||||
try:
|
try:
|
||||||
await self.cbpi.config.add("INFLUXDBADDR", "http://localhost:8086", type=ConfigType.STRING, description="URL Address of your influxdb server (If INFLUXDBCLOUD set to Yes use URL Address of your influxdb cloud server)")
|
await self.cbpi.config.add("INFLUXDBADDR", "http://localhost:8086", type=ConfigType.STRING, description="URL Address of your influxdb server (If INFLUXDBCLOUD set to Yes use URL Address of your influxdb cloud server)", source="craftbeerpi")
|
||||||
except:
|
except:
|
||||||
logger.warning('Unable to update config')
|
logger.warning('Unable to update config')
|
||||||
|
|
||||||
|
@ -301,7 +307,7 @@ class ConfigUpdate(CBPiExtension):
|
||||||
if influxdbname is None:
|
if influxdbname is None:
|
||||||
logger.info("INIT Influxdbname")
|
logger.info("INIT Influxdbname")
|
||||||
try:
|
try:
|
||||||
await self.cbpi.config.add("INFLUXDBNAME", "cbpi4", type=ConfigType.STRING, description="Name of your influxdb database name (If INFLUXDBCLOUD set to Yes use bucket of your influxdb cloud database)")
|
await self.cbpi.config.add("INFLUXDBNAME", "cbpi4", type=ConfigType.STRING, description="Name of your influxdb database name (If INFLUXDBCLOUD set to Yes use bucket of your influxdb cloud database)", source="craftbeerpi")
|
||||||
except:
|
except:
|
||||||
logger.warning('Unable to update config')
|
logger.warning('Unable to update config')
|
||||||
|
|
||||||
|
@ -309,7 +315,7 @@ class ConfigUpdate(CBPiExtension):
|
||||||
if influxdbuser is None:
|
if influxdbuser is None:
|
||||||
logger.info("INIT Influxdbuser")
|
logger.info("INIT Influxdbuser")
|
||||||
try:
|
try:
|
||||||
await self.cbpi.config.add("INFLUXDBUSER", " ", type=ConfigType.STRING, description="User name for your influxdb database (only if required)(If INFLUXDBCLOUD set to Yes use organisation of your influxdb cloud database)")
|
await self.cbpi.config.add("INFLUXDBUSER", " ", type=ConfigType.STRING, description="User name for your influxdb database (only if required)(If INFLUXDBCLOUD set to Yes use organisation of your influxdb cloud database)", source="craftbeerpi")
|
||||||
except:
|
except:
|
||||||
logger.warning('Unable to update config')
|
logger.warning('Unable to update config')
|
||||||
|
|
||||||
|
@ -317,7 +323,7 @@ class ConfigUpdate(CBPiExtension):
|
||||||
if influxdbpwd is None:
|
if influxdbpwd is None:
|
||||||
logger.info("INIT Influxdbpwd")
|
logger.info("INIT Influxdbpwd")
|
||||||
try:
|
try:
|
||||||
await self.cbpi.config.add("INFLUXDBPWD", " ", type=ConfigType.STRING, description="Password for your influxdb database (only if required)(If INFLUXDBCLOUD set to Yes use token of your influxdb cloud database)")
|
await self.cbpi.config.add("INFLUXDBPWD", " ", type=ConfigType.STRING, description="Password for your influxdb database (only if required)(If INFLUXDBCLOUD set to Yes use token of your influxdb cloud database)", source="craftbeerpi")
|
||||||
except:
|
except:
|
||||||
logger.warning('Unable to update config')
|
logger.warning('Unable to update config')
|
||||||
|
|
||||||
|
@ -326,6 +332,7 @@ class ConfigUpdate(CBPiExtension):
|
||||||
logger.info("INIT influxdbcloud")
|
logger.info("INIT influxdbcloud")
|
||||||
try:
|
try:
|
||||||
await self.cbpi.config.add("INFLUXDBCLOUD", "No", type=ConfigType.SELECT, description="Write sensor data to influxdb cloud (INFLUXDB must set to Yes)",
|
await self.cbpi.config.add("INFLUXDBCLOUD", "No", type=ConfigType.SELECT, description="Write sensor data to influxdb cloud (INFLUXDB must set to Yes)",
|
||||||
|
source="craftbeerpi",
|
||||||
options= [{"label": "Yes", "value": "Yes"},
|
options= [{"label": "Yes", "value": "Yes"},
|
||||||
{"label": "No", "value": "No"}])
|
{"label": "No", "value": "No"}])
|
||||||
except:
|
except:
|
||||||
|
@ -335,7 +342,7 @@ class ConfigUpdate(CBPiExtension):
|
||||||
if influxdbmeasurement is None:
|
if influxdbmeasurement is None:
|
||||||
logger.info("INIT Influxdb measurementname")
|
logger.info("INIT Influxdb measurementname")
|
||||||
try:
|
try:
|
||||||
await self.cbpi.config.add("INFLUXDBMEASUREMENT", "measurement", type=ConfigType.STRING, description="Name of the measurement in your INFLUXDB database (default: measurement)")
|
await self.cbpi.config.add("INFLUXDBMEASUREMENT", "measurement", type=ConfigType.STRING, description="Name of the measurement in your INFLUXDB database (default: measurement)", source="craftbeerpi")
|
||||||
except:
|
except:
|
||||||
logger.warning('Unable to update config')
|
logger.warning('Unable to update config')
|
||||||
|
|
||||||
|
@ -343,6 +350,7 @@ class ConfigUpdate(CBPiExtension):
|
||||||
logger.info("INIT MQTT update frequency for Kettles and Fermenters")
|
logger.info("INIT MQTT update frequency for Kettles and Fermenters")
|
||||||
try:
|
try:
|
||||||
await self.cbpi.config.add("MQTTUpdate", 0, type=ConfigType.SELECT, description="Forced MQTT Update frequency in s for Kettle and Fermenter (no changes in payload required). Restart required after change",
|
await self.cbpi.config.add("MQTTUpdate", 0, type=ConfigType.SELECT, description="Forced MQTT Update frequency in s for Kettle and Fermenter (no changes in payload required). Restart required after change",
|
||||||
|
source="craftbeerpi",
|
||||||
options= [{"label": "30", "value": 30},
|
options= [{"label": "30", "value": 30},
|
||||||
{"label": "60", "value": 60},
|
{"label": "60", "value": 60},
|
||||||
{"label": "120", "value": 120},
|
{"label": "120", "value": 120},
|
||||||
|
@ -356,6 +364,7 @@ class ConfigUpdate(CBPiExtension):
|
||||||
logger.info("INIT PRESSURE_UNIT")
|
logger.info("INIT PRESSURE_UNIT")
|
||||||
try:
|
try:
|
||||||
await self.cbpi.config.add("PRESSURE_UNIT", "kPa", type=ConfigType.SELECT, description="Set unit for pressure",
|
await self.cbpi.config.add("PRESSURE_UNIT", "kPa", type=ConfigType.SELECT, description="Set unit for pressure",
|
||||||
|
source="craftbeerpi",
|
||||||
options= [{"label": "kPa", "value": "kPa"},
|
options= [{"label": "kPa", "value": "kPa"},
|
||||||
{"label": "PSI", "value": "PSI"}])
|
{"label": "PSI", "value": "PSI"}])
|
||||||
except:
|
except:
|
||||||
|
@ -365,7 +374,7 @@ class ConfigUpdate(CBPiExtension):
|
||||||
if SENSOR_LOG_BACKUP_COUNT is None:
|
if SENSOR_LOG_BACKUP_COUNT is None:
|
||||||
logger.info("INIT SENSOR_LOG_BACKUP_COUNT")
|
logger.info("INIT SENSOR_LOG_BACKUP_COUNT")
|
||||||
try:
|
try:
|
||||||
await self.cbpi.config.add("SENSOR_LOG_BACKUP_COUNT", 3, type=ConfigType.NUMBER, description="Max. number of backup logs")
|
await self.cbpi.config.add("SENSOR_LOG_BACKUP_COUNT", 3, type=ConfigType.NUMBER, description="Max. number of backup logs", source="craftbeerpi")
|
||||||
except:
|
except:
|
||||||
logger.warning('Unable to update database')
|
logger.warning('Unable to update database')
|
||||||
|
|
||||||
|
@ -373,7 +382,7 @@ class ConfigUpdate(CBPiExtension):
|
||||||
if SENSOR_LOG_MAX_BYTES is None:
|
if SENSOR_LOG_MAX_BYTES is None:
|
||||||
logger.info("Init maximum size of sensor logfiles")
|
logger.info("Init maximum size of sensor logfiles")
|
||||||
try:
|
try:
|
||||||
await self.cbpi.config.add("SENSOR_LOG_MAX_BYTES", 100000, type=ConfigType.NUMBER, description="Max. number of bytes in sensor logs")
|
await self.cbpi.config.add("SENSOR_LOG_MAX_BYTES", 100000, type=ConfigType.NUMBER, description="Max. number of bytes in sensor logs", source="craftbeerpi")
|
||||||
except:
|
except:
|
||||||
logger.warning('Unable to update database')
|
logger.warning('Unable to update database')
|
||||||
|
|
||||||
|
@ -382,6 +391,7 @@ class ConfigUpdate(CBPiExtension):
|
||||||
logger.info("INIT slow_pipe_animation")
|
logger.info("INIT slow_pipe_animation")
|
||||||
try:
|
try:
|
||||||
await self.cbpi.config.add("slow_pipe_animation", "Yes", type=ConfigType.SELECT, description="Slow down dashboard pipe animation taking up close to 100% of the CPU's capacity",
|
await self.cbpi.config.add("slow_pipe_animation", "Yes", type=ConfigType.SELECT, description="Slow down dashboard pipe animation taking up close to 100% of the CPU's capacity",
|
||||||
|
source="craftbeerpi",
|
||||||
options= [{"label": "Yes", "value": "Yes"},
|
options= [{"label": "Yes", "value": "Yes"},
|
||||||
{"label": "No", "value": "No"}])
|
{"label": "No", "value": "No"}])
|
||||||
except:
|
except:
|
||||||
|
@ -392,6 +402,7 @@ class ConfigUpdate(CBPiExtension):
|
||||||
logger.info("INIT NOTIFY_ON_ERROR")
|
logger.info("INIT NOTIFY_ON_ERROR")
|
||||||
try:
|
try:
|
||||||
await self.cbpi.config.add("NOTIFY_ON_ERROR", "No", type=ConfigType.SELECT, description="Send Notification on Logging Error",
|
await self.cbpi.config.add("NOTIFY_ON_ERROR", "No", type=ConfigType.SELECT, description="Send Notification on Logging Error",
|
||||||
|
source="craftbeerpi",
|
||||||
options= [{"label": "Yes", "value": "Yes"},
|
options= [{"label": "Yes", "value": "Yes"},
|
||||||
{"label": "No", "value": "No"}])
|
{"label": "No", "value": "No"}])
|
||||||
except:
|
except:
|
||||||
|
@ -402,6 +413,7 @@ class ConfigUpdate(CBPiExtension):
|
||||||
logger.info("INIT PLAY_BUZZER")
|
logger.info("INIT PLAY_BUZZER")
|
||||||
try:
|
try:
|
||||||
await self.cbpi.config.add("PLAY_BUZZER", "No", type=ConfigType.SELECT, description="Play buzzer sound in Web interface on Notifications",
|
await self.cbpi.config.add("PLAY_BUZZER", "No", type=ConfigType.SELECT, description="Play buzzer sound in Web interface on Notifications",
|
||||||
|
source="craftbeerpi",
|
||||||
options= [{"label": "Yes", "value": "Yes"},
|
options= [{"label": "Yes", "value": "Yes"},
|
||||||
{"label": "No", "value": "No"}])
|
{"label": "No", "value": "No"}])
|
||||||
except:
|
except:
|
||||||
|
@ -412,9 +424,10 @@ class ConfigUpdate(CBPiExtension):
|
||||||
try:
|
try:
|
||||||
await self.cbpi.config.add('BoilAutoTimer', 'No', type=ConfigType.SELECT,
|
await self.cbpi.config.add('BoilAutoTimer', 'No', type=ConfigType.SELECT,
|
||||||
description='Start Boil timer automatically if Temp does not change for 5 Minutes and is above 95C/203F',
|
description='Start Boil timer automatically if Temp does not change for 5 Minutes and is above 95C/203F',
|
||||||
|
source="steps",
|
||||||
options= [{"label": "Yes", "value": "Yes"},
|
options= [{"label": "Yes", "value": "Yes"},
|
||||||
{"label": "No", "value": "No"}],
|
{"label": "No", "value": "No"}])
|
||||||
source="steps")
|
|
||||||
BoilAutoTimer = self.cbpi.config.get("BoilAutoTimer", "No")
|
BoilAutoTimer = self.cbpi.config.get("BoilAutoTimer", "No")
|
||||||
except:
|
except:
|
||||||
logging.warning('Unable to update database')
|
logging.warning('Unable to update database')
|
||||||
|
@ -422,9 +435,10 @@ class ConfigUpdate(CBPiExtension):
|
||||||
if CONFIG_STATUS is None or CONFIG_STATUS != self.version:
|
if CONFIG_STATUS is None or CONFIG_STATUS != self.version:
|
||||||
await self.cbpi.config.add('BoilAutoTimer', BoilAutoTimer, type=ConfigType.SELECT,
|
await self.cbpi.config.add('BoilAutoTimer', BoilAutoTimer, type=ConfigType.SELECT,
|
||||||
description='Start Boil timer automatically if Temp does not change for 5 Minutes and is above 95C/203F',
|
description='Start Boil timer automatically if Temp does not change for 5 Minutes and is above 95C/203F',
|
||||||
|
source="steps",
|
||||||
options=[{"label": "Yes", "value": "Yes"},
|
options=[{"label": "Yes", "value": "Yes"},
|
||||||
{"label": "No", "value": "No"}],
|
{"label": "No", "value": "No"}])
|
||||||
source="steps")
|
|
||||||
|
|
||||||
|
|
||||||
## Check if influxdbname is in config
|
## Check if influxdbname is in config
|
||||||
|
|
|
@ -104,7 +104,20 @@ class ConfigHttpEndpoints:
|
||||||
await self.controller.remove(name=name)
|
await self.controller.remove(name=name)
|
||||||
return web.Response(status=200)
|
return web.Response(status=200)
|
||||||
|
|
||||||
@request_mapping(path="/obsolete", auth_required=False)
|
@request_mapping(path="/getobsolete", auth_required=False)
|
||||||
|
async def http_get_obsolete(self, request) -> web.Response:
|
||||||
|
"""
|
||||||
|
---
|
||||||
|
description: Get obsolete config parameters
|
||||||
|
tags:
|
||||||
|
- Config
|
||||||
|
responses:
|
||||||
|
"List of Obsolete Parameters":
|
||||||
|
description: successful operation
|
||||||
|
"""
|
||||||
|
return web.json_response(await self.controller.obsolete(False), dumps=json_dumps)
|
||||||
|
|
||||||
|
@request_mapping(path="/removeobsolete", auth_required=False)
|
||||||
async def http_remove_obsolete(self, request) -> web.Response:
|
async def http_remove_obsolete(self, request) -> web.Response:
|
||||||
"""
|
"""
|
||||||
---
|
---
|
||||||
|
@ -115,4 +128,5 @@ class ConfigHttpEndpoints:
|
||||||
"200":
|
"200":
|
||||||
description: successful operation
|
description: successful operation
|
||||||
"""
|
"""
|
||||||
return web.json_response(await self.controller.remove_obsolete(), dumps=json_dumps)
|
await self.controller.obsolete(True)
|
||||||
|
return web.Response(status=200)
|
|
@ -3,6 +3,7 @@
|
||||||
"description": "Author",
|
"description": "Author",
|
||||||
"name": "AUTHOR",
|
"name": "AUTHOR",
|
||||||
"options": null,
|
"options": null,
|
||||||
|
"source": "craftbeerpi",
|
||||||
"type": "string",
|
"type": "string",
|
||||||
"value": "John Doe"
|
"value": "John Doe"
|
||||||
},
|
},
|
||||||
|
@ -19,6 +20,7 @@
|
||||||
"value": "No"
|
"value": "No"
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
|
"source": "steps",
|
||||||
"type": "select",
|
"type": "select",
|
||||||
"value": "Yes"
|
"value": "Yes"
|
||||||
},
|
},
|
||||||
|
@ -35,6 +37,7 @@
|
||||||
"value": "No"
|
"value": "No"
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
|
"source": "steps",
|
||||||
"type": "select",
|
"type": "select",
|
||||||
"value": "Yes"
|
"value": "Yes"
|
||||||
},
|
},
|
||||||
|
@ -42,6 +45,7 @@
|
||||||
"description": "Brewery Name",
|
"description": "Brewery Name",
|
||||||
"name": "BREWERY_NAME",
|
"name": "BREWERY_NAME",
|
||||||
"options": null,
|
"options": null,
|
||||||
|
"source": "craftbeerpi",
|
||||||
"type": "string",
|
"type": "string",
|
||||||
"value": "Some New Brewery Name"
|
"value": "Some New Brewery Name"
|
||||||
},
|
},
|
||||||
|
@ -58,6 +62,7 @@
|
||||||
"value": "No"
|
"value": "No"
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
|
"source": "steps",
|
||||||
"type": "select",
|
"type": "select",
|
||||||
"value": "No"
|
"value": "No"
|
||||||
},
|
},
|
||||||
|
@ -65,9 +70,18 @@
|
||||||
"description": "Define Kettle that is used for Boil, Whirlpool and Cooldown. If not selected, MASH_TUN will be used",
|
"description": "Define Kettle that is used for Boil, Whirlpool and Cooldown. If not selected, MASH_TUN will be used",
|
||||||
"name": "BoilKettle",
|
"name": "BoilKettle",
|
||||||
"options": null,
|
"options": null,
|
||||||
|
"source": "steps",
|
||||||
"type": "kettle",
|
"type": "kettle",
|
||||||
"value": ""
|
"value": ""
|
||||||
},
|
},
|
||||||
|
"CONFIG_STATUS": {
|
||||||
|
"description": "Status of the config file. Internal use for maintenance",
|
||||||
|
"name": "CONFIG_STATUS",
|
||||||
|
"options": null,
|
||||||
|
"source": "hidden",
|
||||||
|
"type": "string",
|
||||||
|
"value": "4.1.8.a11"
|
||||||
|
},
|
||||||
"CSVLOGFILES": {
|
"CSVLOGFILES": {
|
||||||
"description": "Write sensor data to csv logfiles",
|
"description": "Write sensor data to csv logfiles",
|
||||||
"name": "CSVLOGFILES",
|
"name": "CSVLOGFILES",
|
||||||
|
@ -81,6 +95,7 @@
|
||||||
"value": "No"
|
"value": "No"
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
|
"source": "craftbeerpi",
|
||||||
"type": "select",
|
"type": "select",
|
||||||
"value": "Yes"
|
"value": "Yes"
|
||||||
},
|
},
|
||||||
|
@ -97,6 +112,7 @@
|
||||||
"value": "No"
|
"value": "No"
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
|
"source": "craftbeerpi",
|
||||||
"type": "select",
|
"type": "select",
|
||||||
"value": "No"
|
"value": "No"
|
||||||
},
|
},
|
||||||
|
@ -104,6 +120,7 @@
|
||||||
"description": "IP Address of your influxdb server (If INFLUXDBCLOUD set to Yes use URL Address of your influxdb cloud server)",
|
"description": "IP Address of your influxdb server (If INFLUXDBCLOUD set to Yes use URL Address of your influxdb cloud server)",
|
||||||
"name": "INFLUXDBADDR",
|
"name": "INFLUXDBADDR",
|
||||||
"options": null,
|
"options": null,
|
||||||
|
"source": "craftbeerpi",
|
||||||
"type": "string",
|
"type": "string",
|
||||||
"value": "localhost"
|
"value": "localhost"
|
||||||
},
|
},
|
||||||
|
@ -120,6 +137,7 @@
|
||||||
"value": "No"
|
"value": "No"
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
|
"source": "craftbeerpi",
|
||||||
"type": "select",
|
"type": "select",
|
||||||
"value": "No"
|
"value": "No"
|
||||||
},
|
},
|
||||||
|
@ -127,6 +145,7 @@
|
||||||
"description": "Name of the measurement in your INFLUXDB database (default: measurement)",
|
"description": "Name of the measurement in your INFLUXDB database (default: measurement)",
|
||||||
"name": "INFLUXDBMEASUREMENT",
|
"name": "INFLUXDBMEASUREMENT",
|
||||||
"options": null,
|
"options": null,
|
||||||
|
"source": "craftbeerpi",
|
||||||
"type": "string",
|
"type": "string",
|
||||||
"value": "measurement"
|
"value": "measurement"
|
||||||
},
|
},
|
||||||
|
@ -134,6 +153,7 @@
|
||||||
"description": "Name of your influxdb database name (If INFLUXDBCLOUD set to Yes use bucket of your influxdb cloud database)",
|
"description": "Name of your influxdb database name (If INFLUXDBCLOUD set to Yes use bucket of your influxdb cloud database)",
|
||||||
"name": "INFLUXDBNAME",
|
"name": "INFLUXDBNAME",
|
||||||
"options": null,
|
"options": null,
|
||||||
|
"source": "craftbeerpi",
|
||||||
"type": "string",
|
"type": "string",
|
||||||
"value": "cbpi4"
|
"value": "cbpi4"
|
||||||
},
|
},
|
||||||
|
@ -141,6 +161,7 @@
|
||||||
"description": "Port of your influxdb server",
|
"description": "Port of your influxdb server",
|
||||||
"name": "INFLUXDBPORT",
|
"name": "INFLUXDBPORT",
|
||||||
"options": null,
|
"options": null,
|
||||||
|
"source": "craftbeerpi",
|
||||||
"type": "string",
|
"type": "string",
|
||||||
"value": "8086"
|
"value": "8086"
|
||||||
},
|
},
|
||||||
|
@ -148,6 +169,7 @@
|
||||||
"description": "Password for your influxdb database (only if required)(If INFLUXDBCLOUD set to Yes use token of your influxdb cloud database)",
|
"description": "Password for your influxdb database (only if required)(If INFLUXDBCLOUD set to Yes use token of your influxdb cloud database)",
|
||||||
"name": "INFLUXDBPWD",
|
"name": "INFLUXDBPWD",
|
||||||
"options": null,
|
"options": null,
|
||||||
|
"source": "craftbeerpi",
|
||||||
"type": "string",
|
"type": "string",
|
||||||
"value": " "
|
"value": " "
|
||||||
},
|
},
|
||||||
|
@ -155,6 +177,7 @@
|
||||||
"description": "User name for your influxdb database (only if required)(If INFLUXDBCLOUD set to Yes use organisation of your influxdb cloud database)",
|
"description": "User name for your influxdb database (only if required)(If INFLUXDBCLOUD set to Yes use organisation of your influxdb cloud database)",
|
||||||
"name": "INFLUXDBUSER",
|
"name": "INFLUXDBUSER",
|
||||||
"options": null,
|
"options": null,
|
||||||
|
"source": "craftbeerpi",
|
||||||
"type": "string",
|
"type": "string",
|
||||||
"value": " "
|
"value": " "
|
||||||
},
|
},
|
||||||
|
@ -162,6 +185,7 @@
|
||||||
"description": "Default Mash Tun",
|
"description": "Default Mash Tun",
|
||||||
"name": "MASH_TUN",
|
"name": "MASH_TUN",
|
||||||
"options": null,
|
"options": null,
|
||||||
|
"source": "steps",
|
||||||
"type": "kettle",
|
"type": "kettle",
|
||||||
"value": ""
|
"value": ""
|
||||||
},
|
},
|
||||||
|
@ -190,6 +214,7 @@
|
||||||
"value": 0
|
"value": 0
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
|
"source": "craftbeerpi",
|
||||||
"type": "select",
|
"type": "select",
|
||||||
"value": 0
|
"value": 0
|
||||||
},
|
},
|
||||||
|
@ -206,6 +231,24 @@
|
||||||
"value": "No"
|
"value": "No"
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
|
"source": "craftbeerpi",
|
||||||
|
"type": "select",
|
||||||
|
"value": "No"
|
||||||
|
},
|
||||||
|
"PLAY_BUZZER": {
|
||||||
|
"description": "Play buzzer sound in Web interface on Notifications",
|
||||||
|
"name": "PLAY_BUZZER",
|
||||||
|
"options": [
|
||||||
|
{
|
||||||
|
"label": "Yes",
|
||||||
|
"value": "Yes"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"label": "No",
|
||||||
|
"value": "No"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"source": "craftbeerpi",
|
||||||
"type": "select",
|
"type": "select",
|
||||||
"value": "No"
|
"value": "No"
|
||||||
},
|
},
|
||||||
|
@ -222,6 +265,7 @@
|
||||||
"value": "PSI"
|
"value": "PSI"
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
|
"source": "craftbeerpi",
|
||||||
"type": "select",
|
"type": "select",
|
||||||
"value": "kPa"
|
"value": "kPa"
|
||||||
},
|
},
|
||||||
|
@ -229,6 +273,7 @@
|
||||||
"description": "API path to creation plugin. Default: upload . CHANGE ONLY IF USING A RECIPE CREATION PLUGIN",
|
"description": "API path to creation plugin. Default: upload . CHANGE ONLY IF USING A RECIPE CREATION PLUGIN",
|
||||||
"name": "RECIPE_CREATION_PATH",
|
"name": "RECIPE_CREATION_PATH",
|
||||||
"options": null,
|
"options": null,
|
||||||
|
"source": "craftbeerpi",
|
||||||
"type": "string",
|
"type": "string",
|
||||||
"value": "upload"
|
"value": "upload"
|
||||||
},
|
},
|
||||||
|
@ -236,6 +281,7 @@
|
||||||
"description": "Max. number of backup logs",
|
"description": "Max. number of backup logs",
|
||||||
"name": "SENSOR_LOG_BACKUP_COUNT",
|
"name": "SENSOR_LOG_BACKUP_COUNT",
|
||||||
"options": null,
|
"options": null,
|
||||||
|
"source": "craftbeerpi",
|
||||||
"type": "number",
|
"type": "number",
|
||||||
"value": 3
|
"value": 3
|
||||||
},
|
},
|
||||||
|
@ -243,6 +289,7 @@
|
||||||
"description": "Max. number of bytes in sensor logs",
|
"description": "Max. number of bytes in sensor logs",
|
||||||
"name": "SENSOR_LOG_MAX_BYTES",
|
"name": "SENSOR_LOG_MAX_BYTES",
|
||||||
"options": null,
|
"options": null,
|
||||||
|
"source": "craftbeerpi",
|
||||||
"type": "number",
|
"type": "number",
|
||||||
"value": 100000
|
"value": 100000
|
||||||
},
|
},
|
||||||
|
@ -259,6 +306,7 @@
|
||||||
"value": "F"
|
"value": "F"
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
|
"source": "craftbeerpi",
|
||||||
"type": "select",
|
"type": "select",
|
||||||
"value": "C"
|
"value": "C"
|
||||||
},
|
},
|
||||||
|
@ -266,6 +314,7 @@
|
||||||
"description": "Brewfather API Key",
|
"description": "Brewfather API Key",
|
||||||
"name": "brewfather_api_key",
|
"name": "brewfather_api_key",
|
||||||
"options": null,
|
"options": null,
|
||||||
|
"source": "craftbeerpi",
|
||||||
"type": "string",
|
"type": "string",
|
||||||
"value": ""
|
"value": ""
|
||||||
},
|
},
|
||||||
|
@ -273,6 +322,7 @@
|
||||||
"description": "Brewfather User ID",
|
"description": "Brewfather User ID",
|
||||||
"name": "brewfather_user_id",
|
"name": "brewfather_user_id",
|
||||||
"options": null,
|
"options": null,
|
||||||
|
"source": "craftbeerpi",
|
||||||
"type": "string",
|
"type": "string",
|
||||||
"value": ""
|
"value": ""
|
||||||
},
|
},
|
||||||
|
@ -280,6 +330,7 @@
|
||||||
"description": "Number of current Dashboard",
|
"description": "Number of current Dashboard",
|
||||||
"name": "current_dashboard_number",
|
"name": "current_dashboard_number",
|
||||||
"options": null,
|
"options": null,
|
||||||
|
"source": "hidden",
|
||||||
"type": "number",
|
"type": "number",
|
||||||
"value": 1
|
"value": 1
|
||||||
},
|
},
|
||||||
|
@ -328,6 +379,7 @@
|
||||||
"value": 10
|
"value": 10
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
|
"source": "craftbeerpi",
|
||||||
"type": "select",
|
"type": "select",
|
||||||
"value": 4
|
"value": 4
|
||||||
},
|
},
|
||||||
|
@ -344,6 +396,7 @@
|
||||||
"value": "No"
|
"value": "No"
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
|
"source": "craftbeerpi",
|
||||||
"type": "select",
|
"type": "select",
|
||||||
"value": "Yes"
|
"value": "Yes"
|
||||||
},
|
},
|
||||||
|
@ -351,6 +404,7 @@
|
||||||
"description": "Boil step type",
|
"description": "Boil step type",
|
||||||
"name": "steps_boil",
|
"name": "steps_boil",
|
||||||
"options": null,
|
"options": null,
|
||||||
|
"source": "steps",
|
||||||
"type": "step",
|
"type": "step",
|
||||||
"value": "BoilStep"
|
"value": "BoilStep"
|
||||||
},
|
},
|
||||||
|
@ -358,6 +412,7 @@
|
||||||
"description": "Default Boil Temperature for Recipe Creation",
|
"description": "Default Boil Temperature for Recipe Creation",
|
||||||
"name": "steps_boil_temp",
|
"name": "steps_boil_temp",
|
||||||
"options": null,
|
"options": null,
|
||||||
|
"source": "steps",
|
||||||
"type": "number",
|
"type": "number",
|
||||||
"value": "99"
|
"value": "99"
|
||||||
},
|
},
|
||||||
|
@ -365,6 +420,7 @@
|
||||||
"description": "Cooldown step type",
|
"description": "Cooldown step type",
|
||||||
"name": "steps_cooldown",
|
"name": "steps_cooldown",
|
||||||
"options": null,
|
"options": null,
|
||||||
|
"source": "steps",
|
||||||
"type": "step",
|
"type": "step",
|
||||||
"value": "CooldownStep"
|
"value": "CooldownStep"
|
||||||
},
|
},
|
||||||
|
@ -372,6 +428,7 @@
|
||||||
"description": "Actor to trigger cooldown water on and off (default: None)",
|
"description": "Actor to trigger cooldown water on and off (default: None)",
|
||||||
"name": "steps_cooldown_actor",
|
"name": "steps_cooldown_actor",
|
||||||
"options": null,
|
"options": null,
|
||||||
|
"source": "steps",
|
||||||
"type": "actor",
|
"type": "actor",
|
||||||
"value": ""
|
"value": ""
|
||||||
},
|
},
|
||||||
|
@ -379,6 +436,7 @@
|
||||||
"description": "Alternative Sensor to monitor temperature durring cooldown (if not selected, Kettle Sensor will be used)",
|
"description": "Alternative Sensor to monitor temperature durring cooldown (if not selected, Kettle Sensor will be used)",
|
||||||
"name": "steps_cooldown_sensor",
|
"name": "steps_cooldown_sensor",
|
||||||
"options": null,
|
"options": null,
|
||||||
|
"source": "steps",
|
||||||
"type": "sensor",
|
"type": "sensor",
|
||||||
"value": ""
|
"value": ""
|
||||||
},
|
},
|
||||||
|
@ -386,6 +444,7 @@
|
||||||
"description": "Cooldown temp will send notification when this temeprature is reached",
|
"description": "Cooldown temp will send notification when this temeprature is reached",
|
||||||
"name": "steps_cooldown_temp",
|
"name": "steps_cooldown_temp",
|
||||||
"options": null,
|
"options": null,
|
||||||
|
"source": "steps",
|
||||||
"type": "number",
|
"type": "number",
|
||||||
"value": 35
|
"value": 35
|
||||||
},
|
},
|
||||||
|
@ -393,6 +452,7 @@
|
||||||
"description": "Mash step type",
|
"description": "Mash step type",
|
||||||
"name": "steps_mash",
|
"name": "steps_mash",
|
||||||
"options": null,
|
"options": null,
|
||||||
|
"source": "steps",
|
||||||
"type": "step",
|
"type": "step",
|
||||||
"value": "MashStep"
|
"value": "MashStep"
|
||||||
},
|
},
|
||||||
|
@ -400,6 +460,7 @@
|
||||||
"description": "MashIn step type",
|
"description": "MashIn step type",
|
||||||
"name": "steps_mashin",
|
"name": "steps_mashin",
|
||||||
"options": null,
|
"options": null,
|
||||||
|
"source": "steps",
|
||||||
"type": "step",
|
"type": "step",
|
||||||
"value": "MashInStep"
|
"value": "MashInStep"
|
||||||
},
|
},
|
||||||
|
@ -407,6 +468,7 @@
|
||||||
"description": "MashOut step type",
|
"description": "MashOut step type",
|
||||||
"name": "steps_mashout",
|
"name": "steps_mashout",
|
||||||
"options": null,
|
"options": null,
|
||||||
|
"source": "steps",
|
||||||
"type": "step",
|
"type": "step",
|
||||||
"value": "NotificationStep"
|
"value": "NotificationStep"
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,3 +1,7 @@
|
||||||
{
|
{
|
||||||
"elements": []
|
"config": {},
|
||||||
|
"dbid": 1,
|
||||||
|
"type": "Test",
|
||||||
|
"x": 0,
|
||||||
|
"y": 0
|
||||||
}
|
}
|
Loading…
Reference in a new issue