Skip to content

Commit

Permalink
Add status command
Browse files Browse the repository at this point in the history
  • Loading branch information
albireox committed Jul 14, 2023
1 parent 88982ff commit 2c63ba5
Show file tree
Hide file tree
Showing 2 changed files with 35 additions and 0 deletions.
1 change: 1 addition & 0 deletions src/lvmguider/actor/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,4 +18,5 @@
from .commands.focus import focus
from .commands.guide import guide
from .commands.set_pixel import set_pixel
from .commands.status import status
from .commands.stop import stop
34 changes: 34 additions & 0 deletions src/lvmguider/actor/commands/status.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
#!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# @Author: José Sánchez-Gallego ([email protected])
# @Date: 2023-07-14
# @Filename: status.py
# @License: BSD 3-clause (http://www.opensource.org/licenses/BSD-3-Clause)

from __future__ import annotations

from typing import TYPE_CHECKING

from lvmguider.actor import lvmguider_parser


if TYPE_CHECKING:
from lvmguider.actor import GuiderCommand


__all__ = ["status"]


@lvmguider_parser.command()
async def status(command: GuiderCommand):
"""Outputs the status of the guider."""

status = command.actor.status

return command.finish(
message={
"status": f"0x{status.value:x}",
"status_labels": ",".join(status.get_names()),
}
)

0 comments on commit 2c63ba5

Please sign in to comment.