From c3a1193ef9b01529e9f92495fb1c3ae58d822c89 Mon Sep 17 00:00:00 2001 From: "zmrowicki@hotmail.com" Date: Wed, 20 Jan 2016 19:36:33 -0800 Subject: [PATCH] Fix #863 - Added a check for good pull from OWM and return if the object is None --- homeassistant/components/sensor/openweathermap.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/homeassistant/components/sensor/openweathermap.py b/homeassistant/components/sensor/openweathermap.py index a5509904264..4caba2dd81e 100644 --- a/homeassistant/components/sensor/openweathermap.py +++ b/homeassistant/components/sensor/openweathermap.py @@ -165,6 +165,10 @@ class WeatherData(object): def update(self): """ Gets the latest data from OpenWeatherMap. """ obs = self.owm.weather_at_coords(self.latitude, self.longitude) + if obs is None: + _LOGGER.warning('Failed to fetch data from OWM') + return + self.data = obs.get_weather() if self.forecast == 1: