From 088434b84828fac7c7efda66938ed19e35b44100 Mon Sep 17 00:00:00 2001 From: "Philipp A." Date: Sat, 9 Mar 2024 16:04:49 +0100 Subject: [PATCH 1/2] Fix compatibility with suntime 1.3 --- requirements.txt | 2 +- yin_yang/config.py | 6 ++++-- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/requirements.txt b/requirements.txt index c1ed9b8..daf2ced 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.2.5 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() From eb5d16cff93fb95e7d91c21def7419c13544f155 Mon Sep 17 00:00:00 2001 From: Philipp A Date: Mon, 11 Mar 2024 13:15:00 +0100 Subject: [PATCH 2/2] Update requirements.txt --- requirements.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/requirements.txt b/requirements.txt index daf2ced..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