From 555dce69a99207d76e672b76f1f185395fef7c0e Mon Sep 17 00:00:00 2001 From: Pascal Vizeli Date: Mon, 1 Nov 2021 03:55:13 +0100 Subject: [PATCH] Fetch config from API (#82) Co-authored-by: Franck Nijhof --- lib/bashio.sh | 1 - lib/config.sh | 3 ++- lib/const.sh | 1 - 3 files changed, 2 insertions(+), 3 deletions(-) diff --git a/lib/bashio.sh b/lib/bashio.sh index f4f638b..c5791de 100644 --- a/lib/bashio.sh +++ b/lib/bashio.sh @@ -28,7 +28,6 @@ source "${__BASHIO_LIB_DIR}/const.sh" # Defaults declare __BASHIO_SUPERVISOR_API=${SUPERVISOR_API:-${__BASHIO_DEFAULT_SUPERVISOR_API}} declare __BASHIO_SUPERVISOR_TOKEN=${SUPERVISOR_TOKEN:-${__BASHIO_DEFAULT_SUPERVISOR_TOKEN}} -declare __BASHIO_ADDON_CONFIG=${ADDON_CONFIG:-${__BASHIO_DEFAULT_ADDON_CONFIG}} declare __BASHIO_LOG_LEVEL=${LOG_LEVEL:-${__BASHIO_DEFAULT_LOG_LEVEL}} declare __BASHIO_LOG_FORMAT=${LOG_FORMAT:-${__BASHIO_DEFAULT_LOG_FORMAT}} declare __BASHIO_LOG_TIMESTAMP=${LOG_TIMESTAMP:-${__BASHIO_DEFAULT_LOG_TIMESTAMP}} diff --git a/lib/config.sh b/lib/config.sh index 0214cee..56997d9 100644 --- a/lib/config.sh +++ b/lib/config.sh @@ -44,7 +44,8 @@ function bashio::config() { end QUERY - result=$(bashio::jq "${__BASHIO_ADDON_CONFIG}" "${query}") + options=$(bashio::addon.options) + result=$(bashio::jq "${options}" "${query}") printf "%s" "${result}" return "${__BASHIO_EXIT_OK}" diff --git a/lib/const.sh b/lib/const.sh index e6c08ac..c0a5890 100644 --- a/lib/const.sh +++ b/lib/const.sh @@ -9,7 +9,6 @@ # ============================================================================== # Defaults -readonly __BASHIO_DEFAULT_ADDON_CONFIG="/data/options.json" readonly __BASHIO_DEFAULT_CACHE_DIR="/tmp/.bashio" readonly __BASHIO_DEFAULT_HIBP_ENDPOINT="https://api.pwnedpasswords.com/range" readonly __BASHIO_DEFAULT_LOG_FORMAT="[{TIMESTAMP}] {LEVEL}: {MESSAGE}"