limit max viisiblity to 10km

This commit is contained in:
Justin 2023-05-23 16:53:14 +08:00 committed by GitHub
parent 46339771da
commit 011479fa51
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -710,7 +710,10 @@ def updateWeather(api_key, logf):
current_weather['feels_like'] = r['hourly']['apparent_temperature'][index_pos]
current_weather['humidity'] = r['hourly']['relativehumidity_2m'][index_pos]
current_weather['clouds'] = r['hourly']['cloudcover'][index_pos]
current_weather['visibility'] = r['hourly']['visibility'][index_pos]
if r['hourly']['visibility'][index_pos] > 10000:
current_weather['visibility'] = 10000
else:
current_weather['visibility'] = r['hourly']['visibility'][index_pos]
current_weather['uv'] = r['hourly']['uv_index'][index_pos]
current_weather['rain_chance'] = r['hourly']['precipitation_probability'][index_pos]
current_weather['wind_speed'] = r['hourly']['windspeed_10m'][index_pos]