commit
9f5fc95d5b
1 changed files with 7 additions and 4 deletions
|
@ -35,10 +35,13 @@ def get_weather(location):
|
||||||
data['wind']['text'] = 'N'
|
data['wind']['text'] = 'N'
|
||||||
|
|
||||||
# visibility and pressure conversions
|
# visibility and pressure conversions
|
||||||
data['atmosphere']['visibility_km'] = \
|
try:
|
||||||
int(round(float(data['atmosphere']['visibility']) * 1.609344))
|
data['atmosphere']['visibility_km'] = \
|
||||||
data['atmosphere']['visibility_km'] = \
|
int(round(float(data['atmosphere']['visibility']) * 1.609344))
|
||||||
str(round((float(data['atmosphere']['visibility']) * 33.8637526), 2))
|
data['atmosphere']['visibility_km'] = \
|
||||||
|
str(round((float(data['atmosphere']['visibility']) * 33.8637526), 2))
|
||||||
|
except:
|
||||||
|
data['atmosphere']['visibility_km'] = "ERR"
|
||||||
|
|
||||||
# textual value for air pressure
|
# textual value for air pressure
|
||||||
rising = data['atmosphere']['rising']
|
rising = data['atmosphere']['rising']
|
||||||
|
|
Reference in a new issue