Spaces:
Sleeping
Sleeping
Update app.py
Browse filesextracted units for windspeed
app.py
CHANGED
@@ -42,8 +42,9 @@ def get_weather(city:str,lat: float, lng:float)-> str:
|
|
42 |
if response.status_code == 200:
|
43 |
data = response.json()
|
44 |
weather = data["current_weather"]
|
|
|
45 |
description = weather_descriptions[weather['weathercode']]
|
46 |
-
windspeed = weather['windspeed']
|
47 |
return f"The weather in {city} is {weather['temperature']}°C - {description} - {windspeed}."
|
48 |
else:
|
49 |
return "Error fetching weather data."
|
|
|
42 |
if response.status_code == 200:
|
43 |
data = response.json()
|
44 |
weather = data["current_weather"]
|
45 |
+
weather_units = data["current_weather_units"]
|
46 |
description = weather_descriptions[weather['weathercode']]
|
47 |
+
windspeed = weather['windspeed'] + weather_units['windspeed']
|
48 |
return f"The weather in {city} is {weather['temperature']}°C - {description} - {windspeed}."
|
49 |
else:
|
50 |
return "Error fetching weather data."
|