mirror of
https://github.com/chubin/wttr.in
synced 2025-01-26 02:34:59 +00:00
Merge pull request #679 from blakadder/patch-1
remove hourly from weather for JSON j2 format
This commit is contained in:
commit
e154aefd08
1 changed files with 3 additions and 2 deletions
|
@ -360,9 +360,10 @@ def format_weather_data(query, parsed_query, data):
|
|||
format_line = PRECONFIGURED_FORMAT[format_line]
|
||||
|
||||
if format_line in ["j1", "j2"]:
|
||||
# j2 is a lightweight j1, without 'weather' (weather forecast)
|
||||
# j2 is a lightweight j1, without 'hourly' in 'weather' (weather forecast)
|
||||
if "weather" in data["data"] and format_line == "j2":
|
||||
del data["data"]["weather"]
|
||||
for i in range(len(data["data"]["weather"])):
|
||||
del data["data"]["weather"][i]["hourly"]
|
||||
return render_json(data['data'])
|
||||
if format_line == "p1":
|
||||
return prometheus.render_prometheus(data['data'])
|
||||
|
|
Loading…
Reference in a new issue