1
0
mirror of https://github.com/home-assistant/core.git synced 2026-05-08 17:49:37 +01:00

Fix account link no internet on startup (#154579)

Co-authored-by: Martin Hjelmare <marhje52@gmail.com>
This commit is contained in:
Will Moss
2025-11-05 06:23:20 -08:00
committed by GitHub
parent 6dc655c3b4
commit 9e3eb20a04
5 changed files with 147 additions and 10 deletions
@@ -5,7 +5,11 @@ from __future__ import annotations
from homeassistant.config_entries import ConfigEntry
from homeassistant.const import Platform
from homeassistant.core import HomeAssistant
from homeassistant.exceptions import ConfigEntryNotReady
from homeassistant.helpers import aiohttp_client, config_entry_oauth2_flow
from homeassistant.helpers.config_entry_oauth2_flow import (
ImplementationUnavailableError,
)
from . import api
@@ -21,11 +25,16 @@ type New_NameConfigEntry = ConfigEntry[api.AsyncConfigEntryAuth]
# # TODO Update entry annotation
async def async_setup_entry(hass: HomeAssistant, entry: New_NameConfigEntry) -> bool:
"""Set up NEW_NAME from a config entry."""
implementation = (
await config_entry_oauth2_flow.async_get_config_entry_implementation(
hass, entry
try:
implementation = (
await config_entry_oauth2_flow.async_get_config_entry_implementation(
hass, entry
)
)
)
except ImplementationUnavailableError as err:
raise ConfigEntryNotReady(
"OAuth2 implementation temporarily unavailable, will retry"
) from err
session = config_entry_oauth2_flow.OAuth2Session(hass, entry, implementation)