Skip to content

Commit

Permalink
#22
Browse files Browse the repository at this point in the history
  • Loading branch information
wubbl0rz committed Dec 3, 2022
1 parent f604471 commit 068e268
Show file tree
Hide file tree
Showing 2 changed files with 33 additions and 29 deletions.
2 changes: 1 addition & 1 deletion FiatChampAddon/config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ url: "https://github.com/wubbl0rz/FiatChamp"
description: "Connect your FIAT (uconnect) car to Home Assistant. 🚗"
services:
- "mqtt:want"
version: "3.0.3"
version: "3.0.4"
homeassistant_api: true
image: "ghcr.io/wubbl0rz/image-{arch}-fiat-champ"
slug: "fiat_champ"
Expand Down
60 changes: 32 additions & 28 deletions FiatChampAddon/run.sh
Original file line number Diff line number Diff line change
@@ -1,33 +1,37 @@
#!/usr/bin/with-contenv bashio

export FiatChamp_MqttUser=$(bashio::config 'OverrideMqttUser')
export FiatChamp_MqttPw=$(bashio::config 'OverrideMqttPw')
export FiatChamp_MqttServer=$(bashio::config 'OverrideMqttServer')
export FiatChamp_MqttPort=$(bashio::config 'OverrideMqttPort')

test "$FiatChamp_MqttUser" = "null" && export FiatChamp_MqttUser=$(bashio::services "mqtt" "username")
test "$FiatChamp_MqttPw" = "null" && export FiatChamp_MqttPw=$(bashio::services "mqtt" "password")
test "$FiatChamp_MqttServer" = "null" && export FiatChamp_MqttServer=$(bashio::services "mqtt" "host")
test "$FiatChamp_MqttPort" = "null" && export FiatChamp_MqttPort=$(bashio::services "mqtt" "port")

export FiatChamp_CarUnknownLocation=$(bashio::config 'CarUnknownLocation')
export FiatChamp_Brand=$(bashio::config 'Brand')
export FiatChamp_Region=$(bashio::config 'Region')
export FiatChamp_StartDelaySeconds=$(bashio::config 'StartDelaySeconds')

export FiatChamp_SupervisorToken=$SUPERVISOR_TOKEN

export FiatChamp_FiatUser=$(bashio::config 'FiatUser')
export FiatChamp_FiatPw=$(bashio::config 'FiatPw')
export FiatChamp_FiatPin=$(bashio::config 'FiatPin')

export FiatChamp_ConvertKmToMiles=$(bashio::config 'ConvertKmToMiles')

export FiatChamp_AutoRefreshLocation=$(bashio::config 'AutoRefreshLocation')
export FiatChamp_AutoRefreshBattery=$(bashio::config 'AutoRefreshBattery')
export FiatChamp_EnableDangerousCommands=$(bashio::config 'EnableDangerousCommands')

export FiatChamp_Debug=$(bashio::config 'Debug')
if [ -z ${STANDALONE+x} ]; then
echo "RUNNING IN STANDALONE MODE"
else
export FiatChamp_MqttUser=$(bashio::config 'OverrideMqttUser')
export FiatChamp_MqttPw=$(bashio::config 'OverrideMqttPw')
export FiatChamp_MqttServer=$(bashio::config 'OverrideMqttServer')
export FiatChamp_MqttPort=$(bashio::config 'OverrideMqttPort')

test "$FiatChamp_MqttUser" = "null" && export FiatChamp_MqttUser=$(bashio::services "mqtt" "username")
test "$FiatChamp_MqttPw" = "null" && export FiatChamp_MqttPw=$(bashio::services "mqtt" "password")
test "$FiatChamp_MqttServer" = "null" && export FiatChamp_MqttServer=$(bashio::services "mqtt" "host")
test "$FiatChamp_MqttPort" = "null" && export FiatChamp_MqttPort=$(bashio::services "mqtt" "port")

export FiatChamp_CarUnknownLocation=$(bashio::config 'CarUnknownLocation')
export FiatChamp_Brand=$(bashio::config 'Brand')
export FiatChamp_Region=$(bashio::config 'Region')
export FiatChamp_StartDelaySeconds=$(bashio::config 'StartDelaySeconds')

export FiatChamp_SupervisorToken=$SUPERVISOR_TOKEN

export FiatChamp_FiatUser=$(bashio::config 'FiatUser')
export FiatChamp_FiatPw=$(bashio::config 'FiatPw')
export FiatChamp_FiatPin=$(bashio::config 'FiatPin')

export FiatChamp_ConvertKmToMiles=$(bashio::config 'ConvertKmToMiles')

export FiatChamp_AutoRefreshLocation=$(bashio::config 'AutoRefreshLocation')
export FiatChamp_AutoRefreshBattery=$(bashio::config 'AutoRefreshBattery')
export FiatChamp_EnableDangerousCommands=$(bashio::config 'EnableDangerousCommands')

export FiatChamp_Debug=$(bashio::config 'Debug')
fi

cd /build/
./FiatChamp

0 comments on commit 068e268

Please sign in to comment.