weather fixed

This commit is contained in:
Neythen
2021-12-04 15:54:31 +00:00
parent b038a574d0
commit b9a1316a0e
4 changed files with 43 additions and 32 deletions

View File

@@ -414,9 +414,12 @@ def save_trade_settings(input_settings):
api_caller.sendline('f')
def save_weather_settings(input_settings):
print(input_settings)
filename = 'current_weather.json' if input_settings['feature'] == 'Current Weather' else 'daily_weather.json'
print(filename)
current_settings = json.load(open('csv/' + filename, 'r'))
@@ -431,8 +434,10 @@ def save_weather_settings(input_settings):
if input_settings['feature'] == 'Daily Forecast':
current_settings['current_weather'] = input_settings['current_weather']
current_settings = combine_dict(current_settings, input_settings['locations'], 'locations')
locations = {}
for key in input_settings['locations']:
locations[key] = []
current_settings['locations'] = locations
json.dump(current_settings, open('csv/' + filename, 'w+'))