move observation and forecast outside try-except-else

This commit is contained in:
Flamm, Matthew H
2019-08-10 01:33:43 +01:00
parent 1d39d864fa
commit 53b78b3283

View File

@@ -224,8 +224,8 @@ class NWSWeather(WeatherEntity):
self.nws.station, self.nws.station,
status, status,
) )
else: self.observation = self.nws.observation
self.observation = self.nws.observation
_LOGGER.debug("Updating forecast") _LOGGER.debug("Updating forecast")
try: try:
await self.nws.update_forecast() await self.nws.update_forecast()
@@ -233,8 +233,7 @@ class NWSWeather(WeatherEntity):
_LOGGER.error( _LOGGER.error(
"Error updating forecast from station %s: %s", self.nws.station, status "Error updating forecast from station %s: %s", self.nws.station, status
) )
else: self._forecast = self.nws.forecast
self._forecast = self.nws.forecast
@property @property
def attribution(self): def attribution(self):