mirror of
https://github.com/home-assistant/core.git
synced 2025-12-25 05:26:47 +00:00
Fix configuration setup (#6853)
When the user exceeds the request limit for google APIs, the response status stays at 200 but the response body is different:
```
{
"error_message" : "You have exceeded your daily request quota for this API. We recommend registering for a key at the Google Developers Console: https://console.developers.google.com/apis/credentials?project=_",
"results" : [],
"status" : "OVER_QUERY_LIMIT"
}
```
This prevents HA from creating the initial configuration
This commit is contained in:
@@ -76,7 +76,7 @@ def elevation(latitude, longitude):
|
||||
|
||||
try:
|
||||
return int(float(req.json()['results'][0]['elevation']))
|
||||
except (ValueError, KeyError):
|
||||
except (ValueError, KeyError, IndexError):
|
||||
return 0
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user