From 0b22880f227a31f946e75eedcb4c0f2fa17cec2b Mon Sep 17 00:00:00 2001 From: Diogo Gomes Date: Sun, 23 Dec 2018 12:29:02 +0000 Subject: [PATCH] increase robustness, when something upstream fails (#19493) --- homeassistant/components/weather/ipma.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/homeassistant/components/weather/ipma.py b/homeassistant/components/weather/ipma.py index 55a1527db8c..a2f5058ac1e 100644 --- a/homeassistant/components/weather/ipma.py +++ b/homeassistant/components/weather/ipma.py @@ -92,7 +92,12 @@ class IPMAWeather(WeatherEntity): async def async_update(self): """Update Condition and Forecast.""" with async_timeout.timeout(10, loop=self.hass.loop): - self._condition = await self._station.observation() + _new_condition = await self._station.observation() + if _new_condition is None: + _LOGGER.warning("Could not update weather conditions") + return + self._condition = _new_condition + _LOGGER.debug("Updating station %s, condition %s", self._station.local, self._condition) self._forecast = await self._station.forecast()