daily
This commit is contained in:
@@ -1,8 +1,11 @@
|
||||
import httpx
|
||||
from fastapi import APIRouter
|
||||
from fastapi import APIRouter, Depends
|
||||
|
||||
from app.auth.deps import get_current_user
|
||||
from app.config import get_settings
|
||||
from app.db.models import User
|
||||
from app.homelab.comfyui import _use_anima
|
||||
from app.homelab.openmeteo import build_weather_dashboard
|
||||
|
||||
router = APIRouter(prefix="/homelab", tags=["homelab"])
|
||||
|
||||
@@ -40,3 +43,12 @@ def homelab_status() -> dict:
|
||||
"rp_chat_enabled": settings.rp_chat_enabled,
|
||||
},
|
||||
}
|
||||
|
||||
|
||||
@router.get("/weather")
|
||||
def weather_dashboard(
|
||||
hours_ahead: int = 12,
|
||||
_: User = Depends(get_current_user),
|
||||
) -> dict:
|
||||
hours = max(1, min(int(hours_ahead), 48))
|
||||
return build_weather_dashboard(hours_ahead=hours)
|
||||
|
||||
Reference in New Issue
Block a user