mirror of
https://github.com/home-assistant/core.git
synced 2025-07-19 11:17:21 +00:00
Fix error in meteo_france for overseas France cities (#38895)
This commit is contained in:
parent
af5cb948a0
commit
1544b8cea7
@ -4,6 +4,7 @@ from datetime import timedelta
|
|||||||
import logging
|
import logging
|
||||||
|
|
||||||
from meteofrance.client import MeteoFranceClient
|
from meteofrance.client import MeteoFranceClient
|
||||||
|
from meteofrance.helpers import is_valid_warning_department
|
||||||
import voluptuous as vol
|
import voluptuous as vol
|
||||||
|
|
||||||
from homeassistant.config_entries import SOURCE_IMPORT, ConfigEntry
|
from homeassistant.config_entries import SOURCE_IMPORT, ConfigEntry
|
||||||
@ -131,7 +132,7 @@ async def async_setup_entry(hass: HomeAssistantType, entry: ConfigEntry) -> bool
|
|||||||
_LOGGER.debug(
|
_LOGGER.debug(
|
||||||
"Department corresponding to %s is %s", entry.title, department,
|
"Department corresponding to %s is %s", entry.title, department,
|
||||||
)
|
)
|
||||||
if department:
|
if is_valid_warning_department(department):
|
||||||
if not hass.data[DOMAIN].get(department):
|
if not hass.data[DOMAIN].get(department):
|
||||||
coordinator_alert = DataUpdateCoordinator(
|
coordinator_alert = DataUpdateCoordinator(
|
||||||
hass,
|
hass,
|
||||||
@ -155,7 +156,7 @@ async def async_setup_entry(hass: HomeAssistantType, entry: ConfigEntry) -> bool
|
|||||||
)
|
)
|
||||||
else:
|
else:
|
||||||
_LOGGER.warning(
|
_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,
|
entry.title,
|
||||||
)
|
)
|
||||||
|
|
||||||
|
@ -3,6 +3,12 @@
|
|||||||
"name": "Météo-France",
|
"name": "Météo-France",
|
||||||
"config_flow": true,
|
"config_flow": true,
|
||||||
"documentation": "https://www.home-assistant.io/integrations/meteo_france",
|
"documentation": "https://www.home-assistant.io/integrations/meteo_france",
|
||||||
"requirements": ["meteofrance-api==0.1.0"],
|
"requirements": [
|
||||||
"codeowners": ["@hacf-fr", "@oncleben31", "@Quentame"]
|
"meteofrance-api==0.1.1"
|
||||||
|
],
|
||||||
|
"codeowners": [
|
||||||
|
"@hacf-fr",
|
||||||
|
"@oncleben31",
|
||||||
|
"@Quentame"
|
||||||
|
]
|
||||||
}
|
}
|
@ -911,7 +911,7 @@ messagebird==1.2.0
|
|||||||
meteoalertapi==0.1.6
|
meteoalertapi==0.1.6
|
||||||
|
|
||||||
# homeassistant.components.meteo_france
|
# homeassistant.components.meteo_france
|
||||||
meteofrance-api==0.1.0
|
meteofrance-api==0.1.1
|
||||||
|
|
||||||
# homeassistant.components.mfi
|
# homeassistant.components.mfi
|
||||||
mficlient==0.3.0
|
mficlient==0.3.0
|
||||||
|
@ -430,7 +430,7 @@ mbddns==0.1.2
|
|||||||
mcstatus==2.3.0
|
mcstatus==2.3.0
|
||||||
|
|
||||||
# homeassistant.components.meteo_france
|
# homeassistant.components.meteo_france
|
||||||
meteofrance-api==0.1.0
|
meteofrance-api==0.1.1
|
||||||
|
|
||||||
# homeassistant.components.mfi
|
# homeassistant.components.mfi
|
||||||
mficlient==0.3.0
|
mficlient==0.3.0
|
||||||
|
Loading…
x
Reference in New Issue
Block a user