From ee8701b560e180caa6a446be270c3a493a66c5eb Mon Sep 17 00:00:00 2001 From: Beat Date: Thu, 30 Mar 2017 15:26:11 +0200 Subject: [PATCH] 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 --- homeassistant/util/location.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/homeassistant/util/location.py b/homeassistant/util/location.py index d3c35457dbc..950f2f99fed 100644 --- a/homeassistant/util/location.py +++ b/homeassistant/util/location.py @@ -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