72 lines
2.4 KiB
Python
72 lines
2.4 KiB
Python
import os
|
|
from pathlib import Path
|
|
|
|
from dotenv import load_dotenv
|
|
|
|
load_dotenv(Path(__file__).resolve().parent / ".env")
|
|
|
|
|
|
def _cams():
|
|
cams = []
|
|
i = 1
|
|
while True:
|
|
nombre = os.getenv(f"CAM_{i}_NOMBRE")
|
|
rtsp = os.getenv(f"CAM_{i}_RTSP")
|
|
if not nombre or not rtsp:
|
|
break
|
|
cams.append({"nombre": nombre, "rtsp": rtsp})
|
|
i += 1
|
|
return cams
|
|
|
|
|
|
CAMARAS = _cams()
|
|
|
|
TELEGRAM_TOKEN = os.getenv("TELEGRAM_TOKEN")
|
|
TELEGRAM_CHAT_ID = os.getenv("TELEGRAM_CHAT_ID")
|
|
HORA_INICIO = int(os.getenv("HORA_INICIO", 0))
|
|
HORA_FIN = int(os.getenv("HORA_FIN", 23))
|
|
COOLDOWN = int(os.getenv("COOLDOWN", 30))
|
|
WEBHOOK_ALEXA = os.getenv("WEBHOOK_ALEXA", "").strip()
|
|
VOICEMONKEY_TOKEN = os.getenv("VOICEMONKEY_TOKEN", "").strip()
|
|
VOICEMONKEY_DEVICE = os.getenv("VOICEMONKEY_DEVICE", "").strip()
|
|
ALEXA_NODE = os.getenv("ALEXA_NODE", "node")
|
|
ALEXA_NOTIFY_SCRIPT = os.getenv("ALEXA_NOTIFY_SCRIPT", "").strip()
|
|
SNAPSHOT_DIR = os.getenv("SNAPSHOT_DIR", "snapshots")
|
|
ZONAS_AUTORIZADAS = {
|
|
n.strip() for n in os.getenv("ZONAS_AUTORIZADAS", "").split(",") if n.strip()
|
|
}
|
|
RECIPIENTES = [
|
|
x.strip() for x in os.getenv("TELEGRAM_RECIPIENTES", "").split(",") if x.strip()
|
|
]
|
|
DISCORD_TOKEN = os.getenv("DISCORD_TOKEN", "").strip()
|
|
DISCORD_IDS = [
|
|
x.strip() for x in os.getenv("DISCORD_IDS", "").split(",") if x.strip()
|
|
]
|
|
GOOGLE_TV_ACTIVO = os.getenv("GOOGLE_TV_ACTIVO", "1") == "1"
|
|
GOOGLE_TV_NOMBRES = {
|
|
n.strip() for n in os.getenv("GOOGLE_TV_NOMBRES", "").split(",") if n.strip()
|
|
}
|
|
GOOGLE_TV_VOLUMEN = int(os.getenv("GOOGLE_TV_VOLUMEN", "30"))
|
|
GOOGLE_TV_APAGAR = os.getenv("GOOGLE_TV_APAGAR", "1") == "1"
|
|
VOZ_EDGE = os.getenv("VOZ_EDGE", "es-ES-AlvaroNeural")
|
|
VOZ_PITCH = os.getenv("VOZ_PITCH", "-15Hz")
|
|
VOZ_RATE = os.getenv("VOZ_RATE", "-10%")
|
|
GOOGLE_TV_PUERTO = int(os.getenv("GOOGLE_TV_PUERTO", "8500"))
|
|
VOZ_MENSAJE_ALERTA = os.getenv(
|
|
"VOZ_MENSAJE_ALERTA",
|
|
"Por favor, os avisamos de que no podéis cruzar este límite. "
|
|
"Tenéis que ir a vuestro cuarto.",
|
|
)
|
|
VOZ_MENSAJE_CONOCIDO = os.getenv(
|
|
"VOZ_MENSAJE_CONOCIDO",
|
|
"{nombres}, ¿qué estás haciendo? No entres ahí.",
|
|
)
|
|
ALEXA_APAGAR_TV_MONKEY = os.getenv("ALEXA_APAGAR_TV_MONKEY", "").strip()
|
|
ADB_PATH = os.getenv(
|
|
"ADB_PATH",
|
|
os.path.join(os.path.dirname(os.path.abspath(__file__)),
|
|
"adb-tools", "platform-tools", "adb.exe"),
|
|
)
|
|
ADB_TV_IP = os.getenv("ADB_TV_IP", "192.168.50.16:5555")
|
|
GOOGLE_TV_APAGAR_VIA_ADB = os.getenv("GOOGLE_TV_APAGAR_VIA_ADB", "1") == "1"
|