Files
Remote-Terminal-for-MeshCore/app/routers/statistics.py
2026-03-30 14:23:01 -07:00

15 lines
502 B
Python

from fastapi import APIRouter
from app.models import StatisticsResponse
from app.repository import StatisticsRepository
from app.services.radio_noise_floor import get_noise_floor_history
router = APIRouter(prefix="/statistics", tags=["statistics"])
@router.get("", response_model=StatisticsResponse)
async def get_statistics() -> StatisticsResponse:
data = await StatisticsRepository.get_all()
data["noise_floor_24h"] = await get_noise_floor_history()
return StatisticsResponse(**data)