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:
Beat
2017-03-30 15:26:11 +02:00
committed by Pascal Vizeli
parent 714b516176
commit ee8701b560

View File

@@ -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