fix daylight

This commit is contained in:
SpudGunMan
2025-08-15 21:42:45 -07:00
parent 835a9e5f89
commit 85a2d90cff
+2 -1
View File
@@ -102,7 +102,8 @@ def get_sun(lat=0, lon=0):
sun_data = "SunRise: " + sun_table['rise_time'] + "\nSet: " + sun_table['set_time']
sun_data += "\nDaylight: " + str((local_sunset - local_sunrise).seconds // 3600) + "h " + str(((local_sunset - local_sunrise).seconds // 60) % 60) + "m"
if local_sunset > datetime.now():
if sun_table['altitude'] > 0:
sun_data += "\nRemaining: " + str((local_sunset - datetime.now()).seconds // 3600) + "h " + str(((local_sunset - datetime.now()).seconds // 60) % 60) + "m"
sun_data += "\nAzimuth: " + str('{0:.2f}'.format(sun_table['azimuth'] * 180 / ephem.pi)) + "°"