diff --git a/dist/nightskycam-0.1.14-py3-none-any.whl b/dist/nightskycam-0.1.14-py3-none-any.whl new file mode 100644 index 0000000..4f3bef3 Binary files /dev/null and b/dist/nightskycam-0.1.14-py3-none-any.whl differ diff --git a/dist/nightskycam-0.1.14.tar.gz b/dist/nightskycam-0.1.14.tar.gz new file mode 100644 index 0000000..c51ddfe Binary files /dev/null and b/dist/nightskycam-0.1.14.tar.gz differ diff --git a/nightskycam/aperture/runner.py b/nightskycam/aperture/runner.py index 3e40be7..33be633 100644 --- a/nightskycam/aperture/runner.py +++ b/nightskycam/aperture/runner.py @@ -7,10 +7,18 @@ from enum import Enum from typing import Optional, cast -from nightskycam_focus.adapter import (MAX_FOCUS, MIN_FOCUS, Aperture, adapter, - set_aperture, set_focus) -from nightskycam_serialization.status import (ApertureRunnerEntries, - CamRunnerEntries) +from nightskycam_focus.adapter import ( + MAX_FOCUS, + MIN_FOCUS, + Aperture, + adapter, + set_aperture, + set_focus, +) +from nightskycam_serialization.status import ( + ApertureRunnerEntries, + CamRunnerEntries, +) from nightskyrunner.config_getter import ConfigGetter from nightskyrunner.runner import ThreadRunner, status_error from nightskyrunner.status import Level, NoSuchStatusError, Status @@ -117,13 +125,17 @@ def _open_aperture(self, focus: int, reason: str) -> None: or self._focus != focus or self._opening in (Opening.CLOSED, Opening.UNSET) ): - self.log(Level.info, f"opening aperture (focus: {focus}): {reason}") + self.log( + Level.info, f"opening aperture (focus: {focus}): {reason}" + ) try: with adapter(): set_focus(focus) set_aperture(Aperture.MAX) except Exception as e: - raise RuntimeError(f"failed to set focus and open aperture: {e}") + raise RuntimeError( + f"failed to set focus and open aperture: {e}" + ) else: self._opening = Opening.OPENED self._focus = focus @@ -171,8 +183,8 @@ def iterate(self) -> None: ) status_entries["use_zwo_camera"] = use_zwo_camera start = _to_time(str(config["start_time"])) - end = _to_time(str(config["end_time"])) - status_entries["time_window"] = f"{start} - {end}" + stop = _to_time(str(config["stop_time"])) + status_entries["time_window"] = f"{start} - {stop}" try: focus = config["focus"] except KeyError: @@ -200,13 +212,17 @@ def iterate(self) -> None: active: Optional[bool] = self._camera_active() if active is not None: if active: - return self._return(status_entries, focus, True, "camera active") + return self._return( + status_entries, focus, True, "camera active" + ) else: - return self._return(status_entries, focus, False, "camera inactive") + return self._return( + status_entries, focus, False, "camera inactive" + ) # if not using use_zwo_camera, then must be using start/end time time_now = datetime.now().time() - period_closed = _period_closed(start, end, time_now) + period_closed = _period_closed(start, stop, time_now) if period_closed: return self._return(status_entries, focus, False, "day") else: diff --git a/pyproject.toml b/pyproject.toml index f56c6b6..62740e2 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [tool.poetry] name = "nightskycam" -version = "0.1.14" +version = "0.1.15" description = "taking pictures at night" authors = ["Vincent Berenz "] packages = [{ include = "nightskycam" }]