You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
f"Could not initialize Google Maps API. Setup the Google Geolocation API service: https://developers.google.com/maps/documentation/geolocation/overview. {value_error}"
40
+
)
34
41
35
42
# Make sure all required weather variables are listed here
36
43
# The order of variables in hourly or daily is important to assign them correctly below
@@ -44,6 +51,12 @@
44
51
# pylint: disable=too-many-locals
45
52
defget_current_weather(location, unit="METRIC"):
46
53
"""Get the current weather in a given location as a 24-hour forecast"""
54
+
ifgmapsisNone:
55
+
retval= {
56
+
"error": "Google Maps Geolocation service is not initialized. Setup the Google Geolocation API service: https://developers.google.com/maps/documentation/geolocation/overview, and add your GOOGLE_MAPS_API_KEY to .env"
57
+
}
58
+
returnjson.dumps(retval)
59
+
47
60
unit=unitor"METRIC"
48
61
location=locationor"Cambridge, MA, near Kendall Square"
0 commit comments