update config parameters with version change and bump version

This commit is contained in:
avollkopf 2023-05-17 21:52:53 +02:00
parent e01850f2dc
commit 9558f3eb6e
2 changed files with 20 additions and 2 deletions

View file

@ -1,3 +1,3 @@
__version__ = "4.1.10.a1"
__version__ = "4.1.10.a2"
__codename__ = "Groundhog Day"

View file

@ -284,6 +284,16 @@ class ConfigUpdate(CBPiExtension):
{"label": "No", "value": "No"}])
except:
logger.warning('Unable to update config')
else:
if CONFIG_STATUS is None or CONFIG_STATUS != self.version:
try:
await self.cbpi.config.add("CSVLOGFILES", logfiles, type=ConfigType.SELECT, description="Write sensor data to csv logfiles (enabling requires restart)",
source="craftbeerpi",
options= [{"label": "Yes", "value": "Yes"},
{"label": "No", "value": "No"}])
except:
logger.warning('Unable to update config')
## Check if influxdb is on config
if influxdb is None:
@ -295,7 +305,15 @@ class ConfigUpdate(CBPiExtension):
{"label": "No", "value": "No"}])
except:
logger.warning('Unable to update config')
else:
if CONFIG_STATUS is None or CONFIG_STATUS != self.version:
try:
await self.cbpi.config.add("INFLUXDB", influxdb, type=ConfigType.SELECT, description="Write sensor data to influxdb (enabling requires restart)",
source="craftbeerpi",
options= [{"label": "Yes", "value": "Yes"},
{"label": "No", "value": "No"}])
except:
logger.warning('Unable to update config')
## Check if influxdbport is in config and remove it as it is obsolete
if influxdbport is not None: