diff --git a/requirements.txt b/requirements.txt index c1ed9b8..1d25deb 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,6 +1,6 @@ psutil==5.9.7 PySide6==6.6.1 PySide6-Addons==6.6.1 -suntime==1.2.5 +suntime>=1.3.1 systemd-python==235 requests~=2.31.0 \ No newline at end of file diff --git a/yin_yang/config.py b/yin_yang/config.py index f62d0d5..b0ca879 100755 --- a/yin_yang/config.py +++ b/yin_yang/config.py @@ -4,6 +4,7 @@ import pathlib from abc import ABC, abstractmethod from datetime import time +from dateutil import tz from functools import cache from typing import Union, Optional @@ -103,9 +104,10 @@ def get_sun_time(latitude, longitude) -> tuple[time, time]: logger.debug(f'Calculating sunset and sunrise at location {latitude}, {longitude}.') sun = Sun(latitude, longitude) + local_tz = tz.gettz() try: - today_sr = sun.get_local_sunrise_time() - today_ss = sun.get_local_sunset_time() + today_sr = sun.get_sunrise_time(time_zone=local_tz) + today_ss = sun.get_sunset_time(time_zone=local_tz) return today_sr.time(), today_ss.time()