mirror of
https://github.com/home-assistant/core.git
synced 2025-07-19 03:07:37 +00:00
Fix current condition in IPMA (#100412)
always use hourly forecast to retrieve current weather condition. fix #100393
This commit is contained in:
parent
772ac9766b
commit
9470c71d49
@ -103,10 +103,7 @@ class IPMAWeather(WeatherEntity, IPMADevice):
|
|||||||
else:
|
else:
|
||||||
self._daily_forecast = None
|
self._daily_forecast = None
|
||||||
|
|
||||||
if self._period == 1 or self._forecast_listeners["hourly"]:
|
await self._update_forecast("hourly", 1, True)
|
||||||
await self._update_forecast("hourly", 1, True)
|
|
||||||
else:
|
|
||||||
self._hourly_forecast = None
|
|
||||||
|
|
||||||
_LOGGER.debug(
|
_LOGGER.debug(
|
||||||
"Updated location %s based on %s, current observation %s",
|
"Updated location %s based on %s, current observation %s",
|
||||||
@ -139,8 +136,8 @@ class IPMAWeather(WeatherEntity, IPMADevice):
|
|||||||
|
|
||||||
@property
|
@property
|
||||||
def condition(self):
|
def condition(self):
|
||||||
"""Return the current condition."""
|
"""Return the current condition which is only available on the hourly forecast data."""
|
||||||
forecast = self._hourly_forecast or self._daily_forecast
|
forecast = self._hourly_forecast
|
||||||
|
|
||||||
if not forecast:
|
if not forecast:
|
||||||
return
|
return
|
||||||
|
Loading…
x
Reference in New Issue
Block a user