Add heat warning type

This commit is contained in:
Jules 2025-06-18 19:02:50 +02:00
parent 5b5c83401d
commit 5f6ff3ba30
Signed by: jdejaegh
GPG key ID: 99D6D184CA66933A
3 changed files with 1663 additions and 0 deletions

View file

@ -26,6 +26,7 @@ MAP_WARNING_ID_TO_SLUG: Final = {
3: 'thunder', 3: 'thunder',
7: 'fog', 7: 'fog',
9: 'cold', 9: 'cold',
10: 'heat',
12: 'thunder_wind_rain', 12: 'thunder_wind_rain',
13: 'thunderstorm_strong_gusts', 13: 'thunderstorm_strong_gusts',
14: 'thunderstorm_large_rainfall', 14: 'thunderstorm_large_rainfall',

File diff suppressed because it is too large Load diff

View file

@ -22,3 +22,18 @@ async def test_warning_data() -> None:
assert first.get('friendly_name') == 'Fog' assert first.get('friendly_name') == 'Fog'
assert first.get('id') == 7 assert first.get('id') == 7
assert first.get('level') == 1 assert first.get('level') == 1
async def test_warning_heat() -> None:
api = get_api_with_data("antwerp_with_heat_warning.json")
result = api.get_warnings(lang='en')
assert isinstance(result, list)
assert len(result) == 1
first = result[0]
assert first.get('slug') == 'heat'
assert first.get('friendly_name') == 'Heat'
assert first.get('id') == 10
assert first.get('level') == 1