Expand room planning management
This commit is contained in:
@@ -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:
|
||||
|
||||
Reference in New Issue
Block a user