use correct broker setting
This commit is contained in:
@@ -38,8 +38,8 @@ def load_config(config_path: Path) -> dict[str, Any]:
|
||||
logger.warning(f"Config file not found: {config_path}, using defaults")
|
||||
return {
|
||||
"mqtt": {
|
||||
"broker": "172.16.2.16",
|
||||
"port": 1883,
|
||||
"broker": os.getenv("MQTT_BROKER", "localhost"),
|
||||
"port": int(os.getenv("MQTT_PORT", "1883")),
|
||||
"client_id": "home-automation-abstraction",
|
||||
"keepalive": 60
|
||||
},
|
||||
@@ -227,8 +227,8 @@ async def mqtt_worker(config: dict[str, Any], redis_client: aioredis.Redis) -> N
|
||||
redis_client: Redis client for UI updates
|
||||
"""
|
||||
mqtt_config = config.get("mqtt", {})
|
||||
broker = mqtt_config.get("broker", "172.16.2.16")
|
||||
port = mqtt_config.get("port", 1883)
|
||||
broker = os.getenv("MQTT_BROKER") or mqtt_config.get("broker", "localhost")
|
||||
port = int(os.getenv("MQTT_PORT", mqtt_config.get("port", 1883)))
|
||||
client_id = mqtt_config.get("client_id", "home-automation-abstraction")
|
||||
# Append a short suffix (ENV override possible) so multiple processes don't collide
|
||||
client_suffix = os.environ.get("MQTT_CLIENT_ID_SUFFIX") or uuid.uuid4().hex[:6]
|
||||
|
||||
Reference in New Issue
Block a user