mirror of
https://github.com/home-assistant/core.git
synced 2025-07-19 19:27:45 +00:00
Fix #863 - Added a check for good pull from OWM and return if the object is None
This commit is contained in:
parent
2faafb9c0f
commit
c3a1193ef9
@ -165,6 +165,10 @@ class WeatherData(object):
|
|||||||
def update(self):
|
def update(self):
|
||||||
""" Gets the latest data from OpenWeatherMap. """
|
""" Gets the latest data from OpenWeatherMap. """
|
||||||
obs = self.owm.weather_at_coords(self.latitude, self.longitude)
|
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()
|
self.data = obs.get_weather()
|
||||||
|
|
||||||
if self.forecast == 1:
|
if self.forecast == 1:
|
||||||
|
Loading…
x
Reference in New Issue
Block a user