diff --git a/mycroft/configuration/mycroft.conf b/mycroft/configuration/mycroft.conf index 3759a232aa..537ed9f288 100644 --- a/mycroft/configuration/mycroft.conf +++ b/mycroft/configuration/mycroft.conf @@ -6,15 +6,15 @@ "location": { "city": { "code": "Lawrence", + "name": "Lawrence", "state": { "code": "KS", + "name": "Kansas", "country": { "code": "US", "name": "United States" - }, - "name": "Kansas" - }, - "name": "Lawrence" + } + } }, "coordinate": { "latitude": 38.971669, @@ -32,7 +32,7 @@ "stop_threshold": 2.0 }, "server": { - "url": "https://api.mycroft.ai", + "url": "https://api-test.mycroft.ai", "version": "v1", "update": true, "metrics": false diff --git a/mycroft/skills/weather/__init__.py b/mycroft/skills/weather/__init__.py index d8b88143e1..c4f0a09d33 100644 --- a/mycroft/skills/weather/__init__.py +++ b/mycroft/skills/weather/__init__.py @@ -47,8 +47,9 @@ class OWMApi(Api): return params.get("query") def build_location(self, location): - return location["city"]["name"] + ", " + location["city"]["state"]["name"] + ", " + \ - location["city"]["state"]["country"]["name"] + city = location.get("city", {}) + return city.get("name", "Lawrence") + ", " + city.get("state", {}).get("name", "Kansas") + ", " + \ + city.get("state", {}).get("country", {}).get("name", "United States") def get_data(self, response): return response.text @@ -193,7 +194,7 @@ class WeatherSkill(MycroftSkill): self, location, weather, temp='temp', temp_min='temp_min', temp_max='temp_max'): data = { - 'location': location["city"]["name"], + 'location': location.get("city", {}).get("name", "Lawrence"), 'scale': self.temperature, 'condition': weather.get_detailed_status(), 'temp_current': self.__get_temperature(weather, temp),