only show forecast if different than current
This commit is contained in:
parent
d116b12827
commit
cdcac4d51e
1 changed files with 5 additions and 3 deletions
|
@ -86,7 +86,9 @@ if [ -n "$current" ] && [ -n "$forecast" ]; then
|
||||||
forecast_temp=$(echo "$forecast" | $JQ ".list[].main.temp" | $CUT -d "." -f 1)
|
forecast_temp=$(echo "$forecast" | $JQ ".list[].main.temp" | $CUT -d "." -f 1)
|
||||||
forecast_feels=$(echo "$forecast" | $JQ ".list[].main.feels_like" | $CUT -d "." -f 1)
|
forecast_feels=$(echo "$forecast" | $JQ ".list[].main.feels_like" | $CUT -d "." -f 1)
|
||||||
forecast_icon=$(echo "$forecast" | $JQ -r ".list[].weather[0].icon")
|
forecast_icon=$(echo "$forecast" | $JQ -r ".list[].weather[0].icon")
|
||||||
|
if [ "$current_temp" -ne "$forecast_temp" ]; then
|
||||||
echo "$suburb, $city: $current_text $(get_icon "$current_icon") $current_temp($current_feels)$SYMBOL => $(get_icon "$forecast_icon") $forecast_temp($forecast_feels)$SYMBOL"
|
echo "$suburb, $city: $current_text $(get_icon "$current_icon") $current_temp($current_feels)$SYMBOL => $(get_icon "$forecast_icon") $forecast_temp($forecast_feels)$SYMBOL"
|
||||||
|
else
|
||||||
|
echo "$suburb, $city: $current_text $(get_icon "$current_icon") $current_temp($current_feels)$SYMBOL"
|
||||||
|
fi
|
||||||
fi
|
fi
|
||||||
|
|
Loading…
Reference in a new issue