Skip to content

Commit

Permalink
Small fix
Browse files Browse the repository at this point in the history
  • Loading branch information
mdeweerd committed Sep 7, 2023
1 parent 9a6d09e commit 4fa8770
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions addon_meterstoha/run.sh
Original file line number Diff line number Diff line change
Expand Up @@ -18,30 +18,33 @@ TYPE="ha"

keys="veolia_login veolia_password veolia_contract grdf_login grdf_passowrd grdf_pce timeout download_folder"
event_keys="veolia grdf"
event_conf=""

config=""
if bashio::config.has_value "captchaservice"; then
captchaservice=$(bashio::config "captchaservice")
if bashio::config.has_value "token_captchaservice"; then
token_captchaservice=$(bashio::config "token_captchaservice")
token_config="\"$captchaservice\":\"${token_captchaservice//\"/\\\"}\""
config="$config$token_config,\n"
config="$config$token_config,
"
fi
fi

# shellcheck disable=SC2086
for key in $keys ; do
if bashio::config.has_value $key; then
value="$(bashio::config "$key")"
config="$config\"${key//\"/\\\"}\":\"${value/\"/\\\"}\","
config="$config\"${key//\"/\\\"}\":\"${value/\"/\\\"}\",
"
fi
done

# shellcheck disable=SC2086
for key in $event_keys ; do
if bashio::config.has_value $key; then
value="$(bashio::config "$key")"
event_conf="key:$value"
event_conf="$key:$value"
fi
done

Expand Down

0 comments on commit 4fa8770

Please sign in to comment.