02-ago: [proyecto] Sistema vigilancia Tapo con deteccion movimiento/persona + notificacion Telegram/Alexa
This commit is contained in:
30
vigilancia/config.py
Normal file
30
vigilancia/config.py
Normal file
@@ -0,0 +1,30 @@
|
||||
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()
|
||||
SNAPSHOT_DIR = os.getenv("SNAPSHOT_DIR", "snapshots")
|
||||
Reference in New Issue
Block a user