work: Добавил команду для перехода в автоматический режим после установления скорости вручную

This commit is contained in:
Fedorov Dmitriy
2026-09-19 16:20:20 +03:00
parent f98cc2d6a3
commit bff8efb85b
3 changed files with 28 additions and 4 deletions
+20 -1
View File
@@ -697,4 +697,23 @@ async def set_light(
ScheduledSettings(
light=enabled,
),
)
)
# ----------------------------------------------------------------------
# Переход в auto
# ----------------------------------------------------------------------
@app.post("/api/schedule/override/clear")
async def clear_schedule_override():
if schedule_service is None:
raise HTTPException(
status_code=503,
detail="Schedule service unavailable",
)
await schedule_service.clear_override()
return {
"ok": True,
"schedule": get_schedule_status(),
"auto": get_auto_status(),
}