From bca0a0ff5fdf054643abc9c45a037de2e5e4d529 Mon Sep 17 00:00:00 2001 From: SpudGunMan Date: Wed, 19 Jun 2024 14:21:30 -0700 Subject: [PATCH] Update solarconditions.py --- solarconditions.py | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/solarconditions.py b/solarconditions.py index 64fc713..4b03b23 100644 --- a/solarconditions.py +++ b/solarconditions.py @@ -55,8 +55,12 @@ def drap_xray_conditions(): xray_flux += "error fetching" return xray_flux -def get_sunrise_sunset(): - sun = Sun(LATITUDE, LONGITUDE) +def get_sunrise_sunset(lat=0, lon=0): + if lat != 0 and lon != 0: + sun = Sun(lat, lon) + else: + sun = Sun(LATITUDE, LONGITUDE) + to_zone = tz.tzlocal() today_sr = sun.get_sunrise_time(datetime.now()) today_ss = sun.get_sunset_time(datetime.now())