diff --git a/CHANGELOG.md b/CHANGELOG.md index 9b7a33f..ccc9167 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,12 @@ # Changelog +## Next version + +### ✨ Improved + +* Add `disable_overwatcher` query parameters to `/macros/shutdown`. + + ## 0.1.10 - 2024-11-04 ### ✨ Improved diff --git a/src/lvmapi/routers/macros.py b/src/lvmapi/routers/macros.py index 4978df4..afbf35c 100644 --- a/src/lvmapi/routers/macros.py +++ b/src/lvmapi/routers/macros.py @@ -24,10 +24,15 @@ dependencies=[AuthDependency], summary="Runs the shutdown macro", ) -async def route_get_shutdown() -> str: +async def route_get_shutdown( + disable_overwatcher: Annotated[ + bool, + Query(description="Disables the Overwatcher after closing the dome."), + ], +) -> str: """Schedules an emergency shutdown of the enclosure and telescopes.""" - task = await shutdown_task.kiq() + task = await shutdown_task.kiq(disable_overwtcher=disable_overwatcher) return task.task_id diff --git a/src/lvmapi/tasks.py b/src/lvmapi/tasks.py index 4618b7d..ed552b6 100644 --- a/src/lvmapi/tasks.py +++ b/src/lvmapi/tasks.py @@ -35,11 +35,11 @@ async def move_dome_task(direction: Literal["open", "close"], force: bool = Fals @broker.task() -async def shutdown_task(): +async def shutdown_task(disable_overwtcher: bool = False): """Shuts down the system.""" async with get_gort_client() as gort: - await gort.shutdown(park_telescopes=True) + await gort.shutdown(park_telescopes=True, disable_overwtcher=disable_overwtcher) return True