Expand room planning management
Some checks failed
quality / test (3.11) (push) Has been cancelled
quality / test (3.13) (push) Has been cancelled

This commit is contained in:
2026-07-26 23:12:49 +02:00
parent 9ff005f089
commit 1788f9d963
7 changed files with 380 additions and 16 deletions

View File

@@ -117,7 +117,7 @@ async def lifespan(app: FastAPI) -> AsyncIterator[None]:
app = FastAPI(
title="SillyHome Next API",
description="Lokales Smart-Home-Intelligenzsystem für Home Assistant.",
version="1.7.4",
version="1.7.7",
lifespan=lifespan,
)
app.state.settings = load_settings()
@@ -167,6 +167,8 @@ async def _periodic_reconciliation(app: FastAPI) -> None:
engine = getattr(app.state, "behavior_engine", None)
if isinstance(engine, BehaviorEngine):
await asyncio.to_thread(engine.train_all)
await asyncio.to_thread(engine.evaluate_all)
await asyncio.to_thread(engine.refresh_planning_insights)
except Exception:
logger.exception("Geplante Reconciliation fehlgeschlagen; nächster Lauf versucht es erneut.")
@@ -221,6 +223,7 @@ async def _startup_reconciliation(app: FastAPI) -> None:
await asyncio.to_thread(service.reconcile_all, "startup")
await asyncio.to_thread(engine.train_all)
await asyncio.to_thread(engine.evaluate_all)
await asyncio.to_thread(engine.refresh_planning_insights)
logger.info("Startup-Reconciliation erfolgreich abgeschlossen.")
return
except Exception as exc: