Compare commits
2 Commits
0.0.25-con
...
0.0.26-con
| Author | SHA1 | Date | |
|---|---|---|---|
|
51df63d9f2
|
|||
|
cdaa5deb58
|
@@ -25,11 +25,11 @@ steps:
|
|||||||
- printf "$KUBE_CONFIG_CONTENT" > /tmp/kubeconfig
|
- printf "$KUBE_CONFIG_CONTENT" > /tmp/kubeconfig
|
||||||
- export KUBECONFIG=/tmp/kubeconfig
|
- export KUBECONFIG=/tmp/kubeconfig
|
||||||
- kubectl create configmap home-automation-config
|
- kubectl create configmap home-automation-config
|
||||||
--from-file=devices=config/devices.yaml
|
--from-file=devices.yaml=config/devices.yaml
|
||||||
--from-file=groups=config/groups.yaml
|
--from-file=groups.yaml=config/groups.yaml
|
||||||
--from-file=layout=config/layout.yaml
|
--from-file=layout.yaml=config/layout.yaml
|
||||||
--from-file=rules=config/rules.yaml
|
--from-file=rules.yaml=config/rules.yaml
|
||||||
--from-file=scenes=config/scenes.yaml
|
--from-file=scenes.yaml=config/scenes.yaml
|
||||||
--namespace=$NAMESPACE
|
--namespace=$NAMESPACE
|
||||||
--dry-run=client -o yaml | kubectl apply -f -
|
--dry-run=client -o yaml | kubectl apply -f -
|
||||||
- kubectl apply -f deployment/configmap.yaml -n $NAMESPACE
|
- kubectl apply -f deployment/configmap.yaml -n $NAMESPACE
|
||||||
|
|||||||
@@ -391,9 +391,19 @@ async def async_main() -> None:
|
|||||||
validate_devices(devices)
|
validate_devices(devices)
|
||||||
logger.info(f"Loaded {len(devices)} device(s) from configuration")
|
logger.info(f"Loaded {len(devices)} device(s) from configuration")
|
||||||
|
|
||||||
# Get Redis URL from config or environment variable or use default
|
# Build Redis URL from environment variables or config or use default
|
||||||
|
redis_host = os.environ.get("REDIS_HOST")
|
||||||
|
redis_port = os.environ.get("REDIS_PORT")
|
||||||
|
redis_db = os.environ.get("REDIS_DB")
|
||||||
|
|
||||||
|
if redis_host and redis_port and redis_db:
|
||||||
|
redis_url = f"redis://{redis_host}:{redis_port}/{redis_db}"
|
||||||
|
logger.info(f"Using Redis from environment variables: {redis_url}")
|
||||||
|
else:
|
||||||
|
# Fallback to config file
|
||||||
redis_config = config.get("redis", {})
|
redis_config = config.get("redis", {})
|
||||||
redis_url = redis_config.get("url") or os.environ.get("REDIS_URL", "redis://localhost:6379/0")
|
redis_url = redis_config.get("url") or "redis://localhost:6379/0"
|
||||||
|
logger.info(f"Using Redis from config file: {redis_url}")
|
||||||
|
|
||||||
# Connect to Redis with retry
|
# Connect to Redis with retry
|
||||||
redis_client = await get_redis_client(redis_url)
|
redis_client = await get_redis_client(redis_url)
|
||||||
|
|||||||
@@ -1,14 +1,4 @@
|
|||||||
version: 1
|
version: 1
|
||||||
mqtt:
|
|
||||||
broker: "172.16.2.16"
|
|
||||||
port: 1883
|
|
||||||
client_id: "home-automation-abstraction"
|
|
||||||
username: null
|
|
||||||
password: null
|
|
||||||
keepalive: 60
|
|
||||||
redis:
|
|
||||||
url: "redis://172.23.1.116:6379/8"
|
|
||||||
channel: "ui:updates"
|
|
||||||
devices:
|
devices:
|
||||||
- device_id: lampe_semeniere_wohnzimmer
|
- device_id: lampe_semeniere_wohnzimmer
|
||||||
name: Semeniere
|
name: Semeniere
|
||||||
|
|||||||
Reference in New Issue
Block a user