From 8a5cf9ad24713aea6499211c1943023880978e5a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jos=C3=A9=20S=C3=A1nchez-Gallego?= Date: Wed, 2 Oct 2024 22:29:19 +0000 Subject: [PATCH] Add ?now query argument to /overwatcher/disable --- src/lvmapi/routers/overwatcher.py | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/src/lvmapi/routers/overwatcher.py b/src/lvmapi/routers/overwatcher.py index ece5321..842ad69 100644 --- a/src/lvmapi/routers/overwatcher.py +++ b/src/lvmapi/routers/overwatcher.py @@ -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?")