From ec193a92f81e64877a7f02f302115f8dbf6095c9 Mon Sep 17 00:00:00 2001 From: Wolfgang Hottgenroth Date: Wed, 19 Nov 2025 09:38:03 +0100 Subject: [PATCH] device state fix 2 --- apps/api/main.py | 16 ---------------- 1 file changed, 16 deletions(-) diff --git a/apps/api/main.py b/apps/api/main.py index b0e7dbd..1febc7f 100644 --- a/apps/api/main.py +++ b/apps/api/main.py @@ -255,22 +255,6 @@ async def get_device_layout(device_id: str): } raise HTTPException(status_code=404, detail="Device layout not found") -# --- Minimal-invasive: Einzelgerät-State-Endpunkt --- -@app.get("/devices/{device_id}/state") -async def get_device_state(device_id: str): - """Gibt den aktuellen State für ein einzelnes Gerät zurück.""" - # States werden wie im Bulk-Endpoint geladen - state_path = Path(__file__).parent.parent.parent / "config" / "devices.yaml" - if not state_path.exists(): - raise HTTPException(status_code=500, detail="State file not found") - with open(state_path, "r") as f: - config = yaml.safe_load(f) - states = config.get("states", {}) - state = states.get(device_id) - if state is None: - raise HTTPException(status_code=404, detail="Device state not found") - return state - @app.on_event("startup") async def startup_event(): """Include routers after app is initialized to avoid circular imports."""