feat: Stats. Closes #6

This commit is contained in:
Artem Kokos
2026-03-28 23:06:40 +07:00
parent c793b73fa2
commit 732313a61c
5 changed files with 303 additions and 12 deletions

View File

@@ -10,7 +10,7 @@ from app.core.scheduler import start_scheduler
from app.core.state import state_manager, discovery_service
from sqlalchemy import select
from app.models.device import GroupModel
from app.api.routes import devices, control, schedules, api_keys
from app.api.routes import devices, control, schedules, api_keys, stats
from app.api.deps import verify_token
LOG_LEVEL = os.getenv("LOG_LEVEL", "INFO").upper()
@@ -50,6 +50,7 @@ app.include_router(devices.router, prefix="/devices", tags=["Devices & Groups"])
app.include_router(control.router, prefix="/control", tags=["Control"])
app.include_router(schedules.router, prefix="/schedules", tags=["Schedules"])
app.include_router(api_keys.router, prefix="/api-keys", tags=["API Keys"])
app.include_router(stats.router, prefix="/stats", tags=["Stats"])
# Статика
# Мы убираем html=True из корня, чтобы 404-е ошибки API не превращались в загрузку index.html