move observation and forecast outside try-except-else
This commit is contained in:
parent
1d39d864fa
commit
53b78b3283
1 changed files with 3 additions and 4 deletions
|
@ -224,8 +224,8 @@ class NWSWeather(WeatherEntity):
|
|||
self.nws.station,
|
||||
status,
|
||||
)
|
||||
else:
|
||||
self.observation = self.nws.observation
|
||||
self.observation = self.nws.observation
|
||||
|
||||
_LOGGER.debug("Updating forecast")
|
||||
try:
|
||||
await self.nws.update_forecast()
|
||||
|
@ -233,8 +233,7 @@ class NWSWeather(WeatherEntity):
|
|||
_LOGGER.error(
|
||||
"Error updating forecast from station %s: %s", self.nws.station, status
|
||||
)
|
||||
else:
|
||||
self._forecast = self.nws.forecast
|
||||
self._forecast = self.nws.forecast
|
||||
|
||||
@property
|
||||
def attribution(self):
|
||||
|
|
Loading…
Add table
Reference in a new issue