From c3032feaf7e3e974cb9cc743f559ebba170a807c Mon Sep 17 00:00:00 2001 From: Alexander Malysh Date: Thu, 14 Nov 2024 10:25:14 +0000 Subject: [PATCH] * allow json in env variables --- freqtrade/configuration/environment_vars.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/freqtrade/configuration/environment_vars.py b/freqtrade/configuration/environment_vars.py index 37445538d..5baa2bfc3 100644 --- a/freqtrade/configuration/environment_vars.py +++ b/freqtrade/configuration/environment_vars.py @@ -1,3 +1,4 @@ +import json import logging import os from typing import Any @@ -20,6 +21,11 @@ def _get_var_typed(val): return True elif val.lower() in ("f", "false"): return False + # try to convert from json + try: + return json.loads(val) + except json.decoder.JSONDecodeError: + pass # keep as string return val