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