added global settings parameter for buzzer sound in UI

This commit is contained in:
avollkopf 2023-03-18 16:05:13 +01:00
parent 7aecdac6a7
commit f975eb7a47
2 changed files with 12 additions and 1 deletions

View file

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

View file

@ -52,6 +52,7 @@ class ConfigUpdate(CBPiExtension):
SENSOR_LOG_MAX_BYTES = self.cbpi.config.get("SENSOR_LOG_MAX_BYTES", None)
slow_pipe_animation = self.cbpi.config.get("slow_pipe_animation", None)
NOTIFY_ON_ERROR = self.cbpi.config.get("NOTIFY_ON_ERROR", None)
PLAY_BUZZER = self.cbpi.config.get("PLAY_BUZZER", None)
BoilAutoTimer = self.cbpi.config.get("BoilAutoTimer", None)
@ -336,6 +337,16 @@ class ConfigUpdate(CBPiExtension):
except:
logger.warning('Unable to update config')
## Check if PLAY_BUZZER is in config
if PLAY_BUZZER is None:
logger.info("INIT PLAY_BUZZER")
try:
await self.cbpi.config.add("PLAY_BUZZER", "No", ConfigType.SELECT, "Play buzzer sound in Web interface on Notifications",
[{"label": "Yes", "value": "Yes"},
{"label": "No", "value": "No"}])
except:
logger.warning('Unable to update config')
if BoilAutoTimer is None:
logging.info("INIT BoilAutoTimer")
try: