Skip to content

Commit

Permalink
Adding copy of prices.csv for addon
Browse files Browse the repository at this point in the history
  • Loading branch information
vingerha committed May 12, 2024
1 parent 5a4bd18 commit d7a1909
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion addon/entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,8 @@ CONFIGTEMPLATE="/templates/config.yaml"
CONFIGSOURCE="/config/gazpar_2_mqtt/config.yaml"
CONFIGUSERDIR="/homeassistant/gazpar_2_mqtt"
CONFIGUSER="/homeassistant/gazpar_2_mqtt/config.yaml"
PRICESUSER="/homeassistant/gazpar_2_mqtt/prices.csv"
PRICESSOURCE="/data/prices.csv"

mkdir -p /config/gazpar_2_mqtt

Expand All @@ -27,6 +29,12 @@ if [ ! -f "$CONFIGUSER" ]; then
exit 1
fi

if [ -f "$PRICESUSER" ]; then
echo "Copying prices file to $PRICESSOURCE"
cp -rf "$PRICESUSER" "$PRICESSOURCE"
fi

echo "Copying config"
cp -rf "$CONFIGUSER" "$CONFIGSOURCE"

# Export all yaml entries as env variables
Expand Down Expand Up @@ -84,7 +92,7 @@ done <"$CONFIGSOURCE"
#####################

if bashio::config.true 'mqtt_autodiscover'; then
bashio::log.info "mqtt_autodiscover is defined in options, attempting autodiscovery..."
bashio::log.info "... mqtt_autodiscover is defined in options, attempting autodiscovery..."
# Check if available
if ! bashio::services.available "mqtt"; then bashio::exit.nok "No internal MQTT service found. Please install Mosquitto broker"; fi
# Get variables
Expand Down

0 comments on commit d7a1909

Please sign in to comment.