Fixed history endpoint

This commit is contained in:
Maximilian Giller 2023-10-25 17:45:45 +02:00
parent 0db7049fdb
commit 74e094e0cf

View file

@ -2,6 +2,7 @@ import os
from fastapi import FastAPI, HTTPException from fastapi import FastAPI, HTTPException
from datetime import datetime from datetime import datetime
import requests import requests
from history import get_recent_entries
from matrix import MatrixDisplay from matrix import MatrixDisplay
from fastapi.middleware.cors import CORSMiddleware from fastapi.middleware.cors import CORSMiddleware
import asyncio import asyncio
@ -131,7 +132,7 @@ async def humidity():
@app.post("/history") @app.post("/history")
async def history(): async def history():
day_entry_count = 24 * 60 day_entry_count = 24 * 60
return get_recent_entries("history.csv", day_entry_count) return get_recent_entries(climate_log_file, day_entry_count)
@app.post("/flash") @app.post("/flash")