Skip to content

Commit

Permalink
Add disable_overwatcher query parameters to /macros/shutdown
Browse files Browse the repository at this point in the history
  • Loading branch information
albireox committed Nov 4, 2024
1 parent ecc30d9 commit e995573
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 4 deletions.
7 changes: 7 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,12 @@
# Changelog

## Next version

### ✨ Improved

* Add `disable_overwatcher` query parameters to `/macros/shutdown`.


## 0.1.10 - 2024-11-04

### ✨ Improved
Expand Down
9 changes: 7 additions & 2 deletions src/lvmapi/routers/macros.py
Original file line number Diff line number Diff line change
Expand Up @@ -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


Expand Down
4 changes: 2 additions & 2 deletions src/lvmapi/tasks.py
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down

0 comments on commit e995573

Please sign in to comment.