diff --git a/newt/config.yaml b/newt/config.yaml index aece5b0..8b51086 100644 --- a/newt/config.yaml +++ b/newt/config.yaml @@ -1,5 +1,5 @@ name: "Newt Add-on" -version: "1.2.0" +version: "1.2.1" slug: "newt" description: "Runs Newt inside Home Assistant OS" arch: @@ -15,13 +15,17 @@ privileged: - NET_ADMIN - DAC_READ_SEARCH options: - PANGOLIN_ENDPOINT: "https://dash.opland.net" + PANGOLIN_ENDPOINT: "https://yourendpoint.com" NEWT_ID: "your_newt_id" NEWT_SECRET: "your_newt_secret" schema: PANGOLIN_ENDPOINT: "str" NEWT_ID: "str" NEWT_SECRET: "str" +environment: + PANGOLIN_ENDPOINT: "{options[PANGOLIN_ENDPOINT]}" + NEWT_ID: "{options[NEWT_ID]}" + NEWT_SECRET: "{options[NEWT_SECRET]}" hassio_api: true homeassistant_api: true auth_api: true diff --git a/newt/run.sh b/newt/run.sh index d59c05c..43bf123 100644 --- a/newt/run.sh +++ b/newt/run.sh @@ -3,10 +3,16 @@ set -e # Stop the script on errors echo "🔹 Starting Newt inside Home Assistant OS..." -# Load configuration values -PANGOLIN_ENDPOINT=${PANGOLIN_ENDPOINT:-"https://dash.opland.net"} -NEWT_ID=${NEWT_ID:-"ru32vsg8ls5lx93"} -NEWT_SECRET=${NEWT_SECRET:-"5rbqgpc292989uk9kz52hmypoyz6u9jf7k670fqja8p4un8o"} +# Load configuration from environment variables set by Home Assistant +PANGOLIN_ENDPOINT=${PANGOLIN_ENDPOINT} +NEWT_ID=${NEWT_ID} +NEWT_SECRET=${NEWT_SECRET} + +# Validate if configuration values are provided +if [[ -z "$PANGOLIN_ENDPOINT" || -z "$NEWT_ID" || -z "$NEWT_SECRET" ]]; then + echo "❌ ERROR: Missing required configuration values!" + exit 1 +fi echo "✅ Configuration Loaded:" echo " PANGOLIN_ENDPOINT=$PANGOLIN_ENDPOINT"