Fix: Ensure UI settings map to environment variables - v1.2.1

This commit is contained in:
Jørgen Ferdinand 2025-03-07 23:29:00 +01:00
parent dda9d6f8c9
commit 87becba6db
2 changed files with 16 additions and 6 deletions

View file

@ -1,5 +1,5 @@
name: "Newt Add-on" name: "Newt Add-on"
version: "1.2.0" version: "1.2.1"
slug: "newt" slug: "newt"
description: "Runs Newt inside Home Assistant OS" description: "Runs Newt inside Home Assistant OS"
arch: arch:
@ -15,13 +15,17 @@ privileged:
- NET_ADMIN - NET_ADMIN
- DAC_READ_SEARCH - DAC_READ_SEARCH
options: options:
PANGOLIN_ENDPOINT: "https://dash.opland.net" PANGOLIN_ENDPOINT: "https://yourendpoint.com"
NEWT_ID: "your_newt_id" NEWT_ID: "your_newt_id"
NEWT_SECRET: "your_newt_secret" NEWT_SECRET: "your_newt_secret"
schema: schema:
PANGOLIN_ENDPOINT: "str" PANGOLIN_ENDPOINT: "str"
NEWT_ID: "str" NEWT_ID: "str"
NEWT_SECRET: "str" NEWT_SECRET: "str"
environment:
PANGOLIN_ENDPOINT: "{options[PANGOLIN_ENDPOINT]}"
NEWT_ID: "{options[NEWT_ID]}"
NEWT_SECRET: "{options[NEWT_SECRET]}"
hassio_api: true hassio_api: true
homeassistant_api: true homeassistant_api: true
auth_api: true auth_api: true

View file

@ -3,10 +3,16 @@ set -e # Stop the script on errors
echo "🔹 Starting Newt inside Home Assistant OS..." echo "🔹 Starting Newt inside Home Assistant OS..."
# Load configuration values # Load configuration from environment variables set by Home Assistant
PANGOLIN_ENDPOINT=${PANGOLIN_ENDPOINT:-"https://dash.opland.net"} PANGOLIN_ENDPOINT=${PANGOLIN_ENDPOINT}
NEWT_ID=${NEWT_ID:-"ru32vsg8ls5lx93"} NEWT_ID=${NEWT_ID}
NEWT_SECRET=${NEWT_SECRET:-"5rbqgpc292989uk9kz52hmypoyz6u9jf7k670fqja8p4un8o"} 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 "✅ Configuration Loaded:"
echo " PANGOLIN_ENDPOINT=$PANGOLIN_ENDPOINT" echo " PANGOLIN_ENDPOINT=$PANGOLIN_ENDPOINT"