From 7d9bc589c561d3f595410540651dce8df292848e Mon Sep 17 00:00:00 2001 From: Hyperling Date: Sun, 1 Nov 2026 06:08:26 -0700 Subject: [PATCH] Explicitly ask for current day. --- sunset-alarm | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/sunset-alarm b/sunset-alarm index a54356b..68c1562 100755 --- a/sunset-alarm +++ b/sunset-alarm @@ -100,8 +100,11 @@ fetch_sunset_time() { echo "Checking for sunset time of lat:long ${LATLONG}." LAT=$(echo "$LATLONG" | cut -d: -f1) LON=$(echo "$LATLONG" | cut -d: -f2) + TODAY="`date +'%Y-%m-%d'`" - REQUEST="https://api.open-meteo.com/v1/forecast?latitude=${LAT}&longitude=${LON}&timezone=auto&daily=sunset&date=today" + #REQUEST="https://api.open-meteo.com/v1/forecast?latitude=${LAT}&longitude=${LON}&timezone=auto&daily=sunset&date=today" + #REQUEST="https://api.open-meteo.com/v1/forecast?latitude=${LAT}&longitude=${LON}&timezone=auto&daily=sunset&forecast_days=1" + REQUEST="https://api.open-meteo.com/v1/forecast?latitude=${LAT}&longitude=${LON}&timezone=auto&daily=sunset&start_date=${TODAY}&end_date=${TODAY}" RESPONSE=$(curl -s "$REQUEST") if [ -z "$RESPONSE" ]; then