Fix error in meteo_france for overseas France cities (#38895)

This commit is contained in:
Oncleben31 2020-08-15 11:54:42 +02:00 committed by GitHub
parent af5cb948a0
commit 1544b8cea7
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 14 additions and 7 deletions

View File

@ -4,6 +4,7 @@ from datetime import timedelta
import logging
from meteofrance.client import MeteoFranceClient
from meteofrance.helpers import is_valid_warning_department
import voluptuous as vol
from homeassistant.config_entries import SOURCE_IMPORT, ConfigEntry
@ -131,7 +132,7 @@ async def async_setup_entry(hass: HomeAssistantType, entry: ConfigEntry) -> bool
_LOGGER.debug(
"Department corresponding to %s is %s", entry.title, department,
)
if department:
if is_valid_warning_department(department):
if not hass.data[DOMAIN].get(department):
coordinator_alert = DataUpdateCoordinator(
hass,
@ -155,7 +156,7 @@ async def async_setup_entry(hass: HomeAssistantType, entry: ConfigEntry) -> bool
)
else:
_LOGGER.warning(
"Weather alert not available: The city %s is not in France or Andorre.",
"Weather alert not available: The city %s is not in metropolitan France or Andorre.",
entry.title,
)

View File

@ -3,6 +3,12 @@
"name": "Météo-France",
"config_flow": true,
"documentation": "https://www.home-assistant.io/integrations/meteo_france",
"requirements": ["meteofrance-api==0.1.0"],
"codeowners": ["@hacf-fr", "@oncleben31", "@Quentame"]
"requirements": [
"meteofrance-api==0.1.1"
],
"codeowners": [
"@hacf-fr",
"@oncleben31",
"@Quentame"
]
}

View File

@ -911,7 +911,7 @@ messagebird==1.2.0
meteoalertapi==0.1.6
# homeassistant.components.meteo_france
meteofrance-api==0.1.0
meteofrance-api==0.1.1
# homeassistant.components.mfi
mficlient==0.3.0

View File

@ -430,7 +430,7 @@ mbddns==0.1.2
mcstatus==2.3.0
# homeassistant.components.meteo_france
meteofrance-api==0.1.0
meteofrance-api==0.1.1
# homeassistant.components.mfi
mficlient==0.3.0