From 009d4b68cb18a7f5ee39b16d6b59b54db75c17e4 Mon Sep 17 00:00:00 2001 From: Pino Date: Wed, 10 Jun 2026 20:41:12 +0200 Subject: [PATCH] =?UTF-8?q?feature/ha-api-integration:=20API-Code=20aus=20?= =?UTF-8?q?feature/api-core=20=C3=BCbernehmen?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/api/v1/entities.py | 19 +++++++++++++++++++ tests/api/test_entities.py | 10 ++++++++++ 2 files changed, 29 insertions(+) create mode 100644 app/api/v1/entities.py create mode 100644 tests/api/test_entities.py diff --git a/app/api/v1/entities.py b/app/api/v1/entities.py new file mode 100644 index 0000000..8b6f293 --- /dev/null +++ b/app/api/v1/entities.py @@ -0,0 +1,19 @@ +from __future__ import annotations + +from typing import List, Sequence + +from fastapi import APIRouter + +from app.ha.models import HaEntitySummary + +router = APIRouter(prefix="/v1", tags=["entities"]) + + +@router.get( + "/entities", + summary="Home-Assistant-Entities auflisten", + description="Gibt eine kompakte Zusammenfassung aller erreichbaren HA-Entitäten zurück.", + response_model=List[HaEntitySummary], +) +def list_entities() -> Sequence[HaEntitySummary]: + raise NotImplementedError("Integration mit dem HA-Client folgt in separatem Issue.") diff --git a/tests/api/test_entities.py b/tests/api/test_entities.py new file mode 100644 index 0000000..c98d5c3 --- /dev/null +++ b/tests/api/test_entities.py @@ -0,0 +1,10 @@ +from fastapi.testclient import TestClient +from app.main import app + +client = TestClient(app) + + +def test_openapi_docs_are_available() -> None: + response = client.get("/docs") + assert response.status_code == 200 + assert "SillyHome Next API" in response.text