Skip to content

Commit

Permalink
Merge branch 'main' into 152-detected-blocking-call-to-open-inside-th…
Browse files Browse the repository at this point in the history
…e-event-loop-ha-20246
  • Loading branch information
golles authored Jun 5, 2024
2 parents 22fae86 + 6fa3091 commit 8b6a842
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
3 changes: 3 additions & 0 deletions custom_components/knmi/weather.py
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,9 @@
"nachtbewolkt": ATTR_CONDITION_CLOUDY,
# TODO: Check with the supplier why this is still in the response while not in the docs.
"wolkennacht": ATTR_CONDITION_CLOUDY,
# Possible unavailable conditions.
"-": None,
"_": None,
}


Expand Down
7 changes: 6 additions & 1 deletion tests/test_weather.py
Original file line number Diff line number Diff line change
Expand Up @@ -63,10 +63,15 @@ async def test_map_conditions(hass: HomeAssistant, mocked_data, caplog):
assert weather.map_condition("nachtmist") == ATTR_CONDITION_FOG
assert weather.map_condition("helderenacht") == ATTR_CONDITION_CLEAR_NIGHT
assert weather.map_condition("nachtbewolkt") == ATTR_CONDITION_CLOUDY
assert weather.map_condition("nachtbewolkt") == ATTR_CONDITION_CLOUDY

# # Undocumented conditions.
# Undocumented conditions.
assert weather.map_condition("wolkennacht") == ATTR_CONDITION_CLOUDY

# Possible unavailable conditions.
assert weather.map_condition("-") == None
assert weather.map_condition("_") == None

# Error cases.
assert weather.map_condition(None) is None
assert (
Expand Down

0 comments on commit 8b6a842

Please sign in to comment.