Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -54,8 +54,9 @@ def get_weather(city: str) -> str:
|
|
| 54 |
weather_response = requests.get(weather_url)
|
| 55 |
if weather_response.status_code == 200:
|
| 56 |
weather_data = weather_response.json()
|
|
|
|
| 57 |
temperature = weather_data['current_weather']['temperature']
|
| 58 |
-
return f"
|
| 59 |
else:
|
| 60 |
return "Error on fetching weather data."
|
| 61 |
else:
|
|
|
|
| 54 |
weather_response = requests.get(weather_url)
|
| 55 |
if weather_response.status_code == 200:
|
| 56 |
weather_data = weather_response.json()
|
| 57 |
+
unit = weather_data['current_weather_units']['temperature']
|
| 58 |
temperature = weather_data['current_weather']['temperature']
|
| 59 |
+
return f"{temperature}{unit}"
|
| 60 |
else:
|
| 61 |
return "Error on fetching weather data."
|
| 62 |
else:
|