Skip to content

Commit

Permalink
added aperture runner status entries and report
Browse files Browse the repository at this point in the history
* added aperture status entries and report

* added focus to aperture's entries

* version 0.1.1

---------

Co-authored-by: Vincent Berenz <[email protected]>
  • Loading branch information
vincentberenz and Vincent Berenz authored Dec 18, 2024
1 parent 050ab5d commit b862c08
Show file tree
Hide file tree
Showing 2 changed files with 30 additions and 2 deletions.
30 changes: 29 additions & 1 deletion nightskycam_serialization/status.py
Original file line number Diff line number Diff line change
Expand Up @@ -151,7 +151,6 @@ class AsiCamRunnerEntries(RunnerStatusDict, total=False):
camera_info: Dict[str, str]
pause: bool


class USBCamRunnerEntries(RunnerStatusDict, total=False):
"""
For serializing the status of nightskycam USBCamRunner
Expand Down Expand Up @@ -209,6 +208,35 @@ def get_USBCamRunner_report(sc: USBCamRunnerEntries) -> Dict[str, str]:
return get_CamRunner_report(sc, "USB camera")


class ApertureRunnerEntries(RunnerStatusDict, total=False):
"""
For serializing the status of nightskycam ApertureRunner
"""
use: bool
focus: int
status: str
reason: str
use_zwo_camera: bool
time_window: str


def get_ApertureRunner_report(
sc: ApertureRunnerEntries
)->Dict[str,str]:
"""
Returns a summary of selected information
"""
if not sc["use"]:
return {"used":"no"}
r: Dict[str,str] = {}
r["status"] = f"{sc['status']} ({sc['reason']})"
r["using camera activity"]="yes" if sc["use_zwo_camera"] else "no"
if not r["use_zwo_camera"]:
r["time window"] = sc["time_window"]
r["focus"]=str(sc["focus"])
return r


class CommandRunnerEntries(RunnerStatusDict, total=False):
"""
For serializing the status of nightskycam CommandRunner
Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[tool.poetry]
name = "nightskycam-serialization"
version = "0.1.0"
version = "0.1.1"
description = "communication between nightskycam and nightskycam-server"
authors = ["Vincent Berenz <[email protected]>"]
packages = [{ include = "nightskycam_serialization" }]
Expand Down

0 comments on commit b862c08

Please sign in to comment.