weather updates

This commit is contained in:
Neythen
2021-06-08 21:16:08 +01:00
parent 7ab6a0a24b
commit 02274e9d0e
22 changed files with 219 additions and 77 deletions

View File

@@ -245,6 +245,8 @@ def updateWeather(location, api_key):
current_weather['wind_direction'] = weather['wind']['deg']
current_weather['visibility'] = weather['visibility']
current_weather['uv'] = r.json()['current']['uvi']
current_weather['rain_chance'] = r.json()['hourly'][0]['pop']
json.dump( current_weather, open( "csv/current_weather.json", 'w+' ))
@@ -259,8 +261,7 @@ def updateWeather(location, api_key):
dct['min_temp'] = day['temp']['min']
dct['max_temp'] = day['temp']['max']
daily_weather.append(dct)
json.dump( daily_weather, open( "csv/daily_weather.json", 'w+' ))
if __name__ == '__main__':