Skip to content

Commit

Permalink
Update run.sh
Browse files Browse the repository at this point in the history
  • Loading branch information
BIBOLV authored Dec 24, 2024
1 parent a7c6e38 commit 2f783f3
Showing 1 changed file with 9 additions and 4 deletions.
13 changes: 9 additions & 4 deletions wmbusmeters-ha-addon-edge/run.sh
Original file line number Diff line number Diff line change
Expand Up @@ -89,10 +89,15 @@ then
if bashio::jq.exists "${CONFIG_PATH}" ".mqtt.username"; then MQTT_USER=$(bashio::jq "${CONFIG_PATH}" ".mqtt.username"); fi
if bashio::jq.exists "${CONFIG_PATH}" ".mqtt.password"; then MQTT_PASSWORD=$(bashio::jq "${CONFIG_PATH}" ".mqtt.password"); fi
else
MQTT_HOST=$(bashio::services mqtt "host")
MQTT_PORT=$(bashio::services mqtt "port")
MQTT_USER=$(bashio::services mqtt "username")
MQTT_PASSWORD=$(bashio::services mqtt "password")
if ! bashio::services.available "mqtt"; then
bashio::log.error "No internal MQTT service found"
else
bashio::log.info "MQTT service found, fetching credentials ..."
MQTT_HOST=$(bashio::services mqtt "host")
MQTT_PORT=$(bashio::services mqtt "port")
MQTT_USER=$(bashio::services mqtt "username")
MQTT_PASSWORD=$(bashio::services mqtt "password")
fi
fi

bashio::log.info "Broker $MQTT_HOST will be used."
Expand Down

0 comments on commit 2f783f3

Please sign in to comment.