mirror of
https://github.com/jkingsman/Remote-Terminal-for-MeshCore.git
synced 2026-05-01 11:02:56 +02:00
15 lines
502 B
Python
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)
|