mirror of
https://github.com/home-assistant/core.git
synced 2025-07-23 05:07:41 +00:00
parent
bf01b5a466
commit
8c41d0d3d7
@ -193,10 +193,15 @@ async def async_setup_entry(hass: HomeAssistant, entry: ConfigEntry) -> bool:
|
|||||||
try:
|
try:
|
||||||
await connection.async_setup()
|
await connection.async_setup()
|
||||||
except socket.gaierror as ex:
|
except socket.gaierror as ex:
|
||||||
|
connection.async_stop()
|
||||||
raise ConfigEntryNotReady(f"Could not resolve {host}: {ex}") from ex
|
raise ConfigEntryNotReady(f"Could not resolve {host}: {ex}") from ex
|
||||||
coordinator = LIFXUpdateCoordinator(hass, connection, entry.title)
|
coordinator = LIFXUpdateCoordinator(hass, connection, entry.title)
|
||||||
coordinator.async_setup()
|
coordinator.async_setup()
|
||||||
|
try:
|
||||||
await coordinator.async_config_entry_first_refresh()
|
await coordinator.async_config_entry_first_refresh()
|
||||||
|
except ConfigEntryNotReady:
|
||||||
|
connection.async_stop()
|
||||||
|
raise
|
||||||
|
|
||||||
domain_data[entry.entry_id] = coordinator
|
domain_data[entry.entry_id] = coordinator
|
||||||
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