diff --git a/database_caller.py b/database_caller.py index bc0362f..794cca2 100755 --- a/database_caller.py +++ b/database_caller.py @@ -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]