Compare commits
2 Commits
02825d7ce8
...
198df3e86d
| Author | SHA1 | Date | |
|---|---|---|---|
| 198df3e86d | |||
| f8afe4ae4c |
@@ -13,7 +13,6 @@ services:
|
||||
MQTT_USERNAME: ${MQTT_USERNAME}
|
||||
MQTT_PASSWORD: ${MQTT_PASSWORD}
|
||||
MQTT_TOPIC: ${MQTT_TOPIC}
|
||||
MQTT_CLIENT_ID: wxconnect-docker
|
||||
|
||||
# Database Configuration
|
||||
DB_TYPE: ${DB_TYPE}
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
"""Configuration management for Weather Connect."""
|
||||
|
||||
import os
|
||||
import uuid
|
||||
from typing import Optional
|
||||
from dataclasses import dataclass
|
||||
from dotenv import load_dotenv
|
||||
@@ -53,7 +54,7 @@ class Config:
|
||||
username=os.getenv("MQTT_USERNAME"),
|
||||
password=os.getenv("MQTT_PASSWORD"),
|
||||
topic=os.getenv("MQTT_TOPIC", "weather/+"),
|
||||
client_id=os.getenv("MQTT_CLIENT_ID", "wxconnect")
|
||||
client_id=os.getenv("MQTT_CLIENT_ID", f"wxconnect-{uuid.uuid4().hex[:8]}")
|
||||
)
|
||||
|
||||
self.database = DatabaseConfig(
|
||||
|
||||
@@ -66,6 +66,7 @@ class WeatherConnectApp:
|
||||
|
||||
logger.info("Configuration loaded successfully",
|
||||
mqtt_host=self.config.mqtt.host,
|
||||
mqtt_client_id=self.config.mqtt.client_id,
|
||||
db_type=self.config.database.db_type)
|
||||
return True
|
||||
|
||||
|
||||
Reference in New Issue
Block a user