From af81c42f4e8ec835de704c6a76922c43e6cf9dbd Mon Sep 17 00:00:00 2001 From: Mathieu Date: Mon, 13 Sep 2021 22:09:43 +0200 Subject: [PATCH] Moved !secret from config.json to only secrets.json --- jarvis/config/config.json | 5 ++--- jarvis/utils/config_utils.py | 5 +++-- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/jarvis/config/config.json b/jarvis/config/config.json index 33e98b6..f48fc90 100644 --- a/jarvis/config/config.json +++ b/jarvis/config/config.json @@ -2,7 +2,6 @@ "PORT": 5000, "12HOURS-FORMAT": false, "LANGUAGE": "fr-fr", - "SPOTIFY_CLIENT_ID": "!secret SPOTIFY_CLIENT_ID", - "SPOTIFY_CLIENT_SECRET": "!secret SPOTIFY_CLIENT_SECRET", - "TTS_VOICE": "marytts:upmc-pierre-hsmm" + "TTS_VOICE": "marytts:upmc-pierre-hsmm", + "PAUSE_MUSIC_AFTER_HOTWORD": true } diff --git a/jarvis/utils/config_utils.py b/jarvis/utils/config_utils.py index 4dd57ea..ebd3104 100644 --- a/jarvis/utils/config_utils.py +++ b/jarvis/utils/config_utils.py @@ -11,13 +11,14 @@ def get_in_config(name): if name in config_json: if isinstance(config_json.get(name), str): if "!secret" in config_json.get(name): - # secret_name = config_json.get(name).removeprefix('!secret ') secret_name = config_json.get(name).replace('!secret ', '') return get_in_secret(secret_name) else: return config_json.get(name) else: return config_json.get(name) + else: + return get_in_secret(name) def get_in_secret(secret_name): @@ -26,4 +27,4 @@ def get_in_secret(secret_name): if secret_name in secrets_json: return secrets_json.get(secret_name) else: - return "Not found!" + return None