Update README and documentation; refactor frontend components for improved structure and resilience
This commit is contained in:
1
services/service-adapters/services/__init__.py
Normal file
1
services/service-adapters/services/__init__.py
Normal file
@@ -0,0 +1 @@
|
||||
# Services package
|
||||
29
services/service-adapters/services/config.py
Normal file
29
services/service-adapters/services/config.py
Normal file
@@ -0,0 +1,29 @@
|
||||
import os
|
||||
from dotenv import load_dotenv
|
||||
|
||||
# Load environment variables
|
||||
load_dotenv()
|
||||
|
||||
# Service configurations
|
||||
SERVICES = {
|
||||
"home_assistant": {
|
||||
"url": os.getenv("HOME_ASSISTANT_URL", "https://homeassistant.local:8123"),
|
||||
"token": os.getenv("HOME_ASSISTANT_TOKEN", ""),
|
||||
"enabled": bool(os.getenv("HOME_ASSISTANT_TOKEN"))
|
||||
},
|
||||
"frigate": {
|
||||
"url": os.getenv("FRIGATE_URL", "http://frigate.local:5000"),
|
||||
"token": os.getenv("FRIGATE_TOKEN", ""),
|
||||
"enabled": bool(os.getenv("FRIGATE_TOKEN"))
|
||||
},
|
||||
"immich": {
|
||||
"url": os.getenv("IMMICH_URL", "http://immich.local:2283"),
|
||||
"api_key": os.getenv("IMMICH_API_KEY", ""),
|
||||
"enabled": bool(os.getenv("IMMICH_API_KEY"))
|
||||
},
|
||||
"n8n": {
|
||||
"url": os.getenv("N8N_URL", "http://n8n.local:5678"),
|
||||
"webhook_url": os.getenv("N8N_WEBHOOK_URL", ""),
|
||||
"enabled": bool(os.getenv("N8N_WEBHOOK_URL"))
|
||||
}
|
||||
}
|
||||
9
services/service-adapters/services/redis_client.py
Normal file
9
services/service-adapters/services/redis_client.py
Normal file
@@ -0,0 +1,9 @@
|
||||
import redis
|
||||
import os
|
||||
|
||||
# Redis connection
|
||||
redis_client = redis.Redis(
|
||||
host=os.getenv("REDIS_HOST", "localhost"),
|
||||
port=int(os.getenv("REDIS_PORT", 6379)),
|
||||
decode_responses=True
|
||||
)
|
||||
Reference in New Issue
Block a user