mirror of
https://github.com/home-assistant/core.git
synced 2025-07-13 16:27:08 +00:00
Fix error when API doesn't return a forecast. (#20365)
* add guard * wrong logic
This commit is contained in:
parent
5580bec1d3
commit
074fcd96ed
@ -116,6 +116,9 @@ class IPMAWeather(WeatherEntity):
|
||||
@property
|
||||
def condition(self):
|
||||
"""Return the current condition."""
|
||||
if not self._forecast:
|
||||
return
|
||||
|
||||
return next((k for k, v in CONDITION_CLASSES.items()
|
||||
if self._forecast[0].idWeatherType in v), None)
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user