Tweaking, including reducing sig figs in weather
This commit is contained in:
@@ -70,7 +70,7 @@ def get_google_weather():
|
||||
humidity = current_data.get("relativeHumidity")
|
||||
|
||||
theweather["current"] = (f"{condition}") + (f", {temp.get('degrees')}°F")\
|
||||
+ (f", {humidity}%") + (f" hum., Feels like: {feels_like.get('degrees')}°F")
|
||||
+ (f", {humidity}%") + (f" hum., Feels like: {int(feels_like.get('degrees'))}°F")
|
||||
else: # current_data not returned
|
||||
theweather["current"] = "Problem retrieving current weather"
|
||||
|
||||
@@ -81,12 +81,12 @@ def get_google_weather():
|
||||
max_temp = day.get("maxTemperature", {}).get("degrees")
|
||||
min_temp = day.get("minTemperature", {}).get("degrees")
|
||||
condition = day.get("daytimeForecast", {}).get("weatherCondition", {}).get("description", {}).get("text")
|
||||
theweather["forecast_today"] = (f"{condition}") + (f", {min_temp}°F-{max_temp}°F")
|
||||
theweather["forecast_today"] = (f"{condition}") + (f", {int(min_temp)}°F-{int(max_temp)}°F")
|
||||
day = forecast_data.get("forecastDays", [])[1]
|
||||
max_temp = day.get("maxTemperature", {}).get("degrees")
|
||||
min_temp = day.get("minTemperature", {}).get("degrees")
|
||||
condition = day.get("daytimeForecast", {}).get("weatherCondition", {}).get("description", {}).get("text")
|
||||
theweather["forecast_tomorrow"] = (f"{condition}") + (f", {min_temp}°F-{max_temp}°F")
|
||||
theweather["forecast_tomorrow"] = (f"{condition}") + (f", {int(min_temp)}°F-{int(max_temp)}°F")
|
||||
else:
|
||||
theweather["forecast_tomorrow"] = "Problem retrieving weather forecast"
|
||||
|
||||
|
||||
Reference in New Issue
Block a user