Skip to content

Commit

Permalink
Rename --close to --close-dome
Browse files Browse the repository at this point in the history
  • Loading branch information
albireox committed Jan 31, 2025
1 parent d968b33 commit 7d3d450
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 6 deletions.
2 changes: 1 addition & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

* Try-except the final closure of the dome after a calibration.
* Ensure that the observing loop and calibrations are stopped if the dome is closed outside of the Overwatcher.
* Add flag `--close` to `lvm.overwatcher disable` to close the dome after disabling the Overwatcher. Requires using `--now`.
* Add flag `--close-dome` to `lvm.overwatcher disable` to close the dome after disabling the Overwatcher. Requires using `--now`.

### 🏷️ Changed/removed

Expand Down
22 changes: 17 additions & 5 deletions src/gort/overwatcher/actor/commands.py
Original file line number Diff line number Diff line change
Expand Up @@ -63,20 +63,32 @@ async def enable(command: OverwatcherCommand):


@overwatcher_cli.command()
@click.option("--now", is_flag=True, help="Stops observing immediately.")
@click.option("--close", is_flag=True, help="Closes the dome after stopping observing.")
async def disable(command: OverwatcherCommand, now: bool = False, close: bool = False):
@click.option(
"--now",
is_flag=True,
help="Stops observing immediately.",
)
@click.option(
"--close-dome",
is_flag=True,
help="Closes the dome after stopping observing.",
)
async def disable(
command: OverwatcherCommand,
now: bool = False,
close_dome: bool = False,
):
"""Disables the overwatcher."""

overwatcher = command.actor.overwatcher

if close and not now:
if close_dome and not now:
return command.fail("--now is required when using --close.")

if now:
await overwatcher.shutdown(
"user disabled the Overwatcher.",
close_dome=close,
close_dome=close_dome,
disable_overwatcher=True,
)
return
Expand Down

0 comments on commit 7d3d450

Please sign in to comment.