From 9470c71d49747502c1cdfbeb12d2833dafd455de Mon Sep 17 00:00:00 2001 From: Diogo Gomes Date: Fri, 15 Sep 2023 06:52:50 +0100 Subject: [PATCH] Fix current condition in IPMA (#100412) always use hourly forecast to retrieve current weather condition. fix #100393 --- homeassistant/components/ipma/weather.py | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/homeassistant/components/ipma/weather.py b/homeassistant/components/ipma/weather.py index a5bb3981575..f9b93cbe954 100644 --- a/homeassistant/components/ipma/weather.py +++ b/homeassistant/components/ipma/weather.py @@ -103,10 +103,7 @@ class IPMAWeather(WeatherEntity, IPMADevice): else: self._daily_forecast = None - if self._period == 1 or self._forecast_listeners["hourly"]: - await self._update_forecast("hourly", 1, True) - else: - self._hourly_forecast = None + await self._update_forecast("hourly", 1, True) _LOGGER.debug( "Updated location %s based on %s, current observation %s", @@ -139,8 +136,8 @@ class IPMAWeather(WeatherEntity, IPMADevice): @property def condition(self): - """Return the current condition.""" - forecast = self._hourly_forecast or self._daily_forecast + """Return the current condition which is only available on the hourly forecast data.""" + forecast = self._hourly_forecast if not forecast: return