Skip to content

Commit

Permalink
Add ?now query argument to /overwatcher/disable
Browse files Browse the repository at this point in the history
  • Loading branch information
albireox committed Oct 2, 2024
1 parent 424578d commit 8a5cf9a
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion src/lvmapi/routers/overwatcher.py
Original file line number Diff line number Diff line change
Expand Up @@ -159,11 +159,19 @@ async def put_overwatcher_enabled(
Literal["enable", "disable"],
Path(description="Whether to enable or disable the overwatcher"),
],
now: Annotated[
bool,
Query(description="Whether to stop observing immediately"),
] = False,
):
"""Enables or disables the overwatcher."""

async with CluClient() as clu:
await clu.send_command("lvm.overwatcher", enable_or_disable)
await clu.send_command(
"lvm.overwatcher",
enable_or_disable,
"--now" if enable_or_disable == "disable" and now else "",
)


@router.get("/status/allow_dome_calibrations", summary="Allow dome calibrations?")
Expand Down

0 comments on commit 8a5cf9a

Please sign in to comment.