mirror of
https://github.com/home-assistant/core.git
synced 2025-07-17 18:27:09 +00:00
Fix Meteo France blocked config entry when weather alert API fails (#94911)
* Fix: do not block config entry when weather alert API fails * PR review
This commit is contained in:
parent
c503becd9a
commit
ede84d74c7
@ -133,9 +133,7 @@ async def async_setup_entry(hass: HomeAssistant, entry: ConfigEntry) -> bool:
|
|||||||
|
|
||||||
await coordinator_alert.async_refresh()
|
await coordinator_alert.async_refresh()
|
||||||
|
|
||||||
if not coordinator_alert.last_update_success:
|
if coordinator_alert.last_update_success:
|
||||||
raise ConfigEntryNotReady
|
|
||||||
|
|
||||||
hass.data[DOMAIN][department] = True
|
hass.data[DOMAIN][department] = True
|
||||||
else:
|
else:
|
||||||
_LOGGER.warning(
|
_LOGGER.warning(
|
||||||
@ -158,11 +156,12 @@ async def async_setup_entry(hass: HomeAssistant, entry: ConfigEntry) -> bool:
|
|||||||
undo_listener = entry.add_update_listener(_async_update_listener)
|
undo_listener = entry.add_update_listener(_async_update_listener)
|
||||||
|
|
||||||
hass.data[DOMAIN][entry.entry_id] = {
|
hass.data[DOMAIN][entry.entry_id] = {
|
||||||
|
UNDO_UPDATE_LISTENER: undo_listener,
|
||||||
COORDINATOR_FORECAST: coordinator_forecast,
|
COORDINATOR_FORECAST: coordinator_forecast,
|
||||||
COORDINATOR_RAIN: coordinator_rain,
|
COORDINATOR_RAIN: coordinator_rain,
|
||||||
COORDINATOR_ALERT: coordinator_alert,
|
|
||||||
UNDO_UPDATE_LISTENER: undo_listener,
|
|
||||||
}
|
}
|
||||||
|
if coordinator_alert and coordinator_alert.last_update_success:
|
||||||
|
hass.data[DOMAIN][entry.entry_id][COORDINATOR_ALERT] = coordinator_alert
|
||||||
|
|
||||||
await hass.config_entries.async_forward_entry_setups(entry, PLATFORMS)
|
await hass.config_entries.async_forward_entry_setups(entry, PLATFORMS)
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user