Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
C
Core
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
mirrored_repos
HomeAssistant
Core
Commits
074fcd96
Commit
074fcd96
authored
6 years ago
by
Diogo Gomes
Committed by
Paulus Schoutsen
6 years ago
Browse files
Options
Downloads
Patches
Plain Diff
Fix error when API doesn't return a forecast. (#20365)
* add guard * wrong logic
parent
5580bec1
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
homeassistant/components/weather/ipma.py
+3
-0
3 additions, 0 deletions
homeassistant/components/weather/ipma.py
with
3 additions
and
0 deletions
homeassistant/components/weather/ipma.py
+
3
−
0
View file @
074fcd96
...
@@ -116,6 +116,9 @@ class IPMAWeather(WeatherEntity):
...
@@ -116,6 +116,9 @@ class IPMAWeather(WeatherEntity):
@property
@property
def
condition
(
self
):
def
condition
(
self
):
"""
Return the current condition.
"""
"""
Return the current condition.
"""
if
not
self
.
_forecast
:
return
return
next
((
k
for
k
,
v
in
CONDITION_CLASSES
.
items
()
return
next
((
k
for
k
,
v
in
CONDITION_CLASSES
.
items
()
if
self
.
_forecast
[
0
].
idWeatherType
in
v
),
None
)
if
self
.
_forecast
[
0
].
idWeatherType
in
v
),
None
)
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment