feat: add /api/home_assistant route
This commit is contained in:
@@ -0,0 +1,16 @@
|
|||||||
|
from __future__ import annotations
|
||||||
|
|
||||||
|
from fastapi import APIRouter, Depends
|
||||||
|
|
||||||
|
from app.models.sources import HomeAssistantSnapshot
|
||||||
|
from app.services.aggregator import AggregatorService, get_aggregator_service
|
||||||
|
|
||||||
|
|
||||||
|
router = APIRouter(prefix="/api", tags=["home_assistant"])
|
||||||
|
|
||||||
|
|
||||||
|
@router.get("/home_assistant", response_model=HomeAssistantSnapshot)
|
||||||
|
async def get_home_assistant(
|
||||||
|
aggregator: AggregatorService = Depends(get_aggregator_service),
|
||||||
|
) -> HomeAssistantSnapshot:
|
||||||
|
return await aggregator.get_home_assistant()
|
||||||
Reference in New Issue
Block a user