mirror of
https://github.com/home-assistant/core.git
synced 2025-07-23 13:17:32 +00:00
Ensure tesla setup is retried on timeout (#50202)
This commit is contained in:
parent
623a9c99fe
commit
89811fcbaa
@ -23,7 +23,7 @@ from homeassistant.const import (
|
|||||||
HTTP_UNAUTHORIZED,
|
HTTP_UNAUTHORIZED,
|
||||||
)
|
)
|
||||||
from homeassistant.core import callback
|
from homeassistant.core import callback
|
||||||
from homeassistant.exceptions import ConfigEntryAuthFailed
|
from homeassistant.exceptions import ConfigEntryAuthFailed, ConfigEntryNotReady
|
||||||
from homeassistant.helpers import config_validation as cv
|
from homeassistant.helpers import config_validation as cv
|
||||||
from homeassistant.helpers.httpx_client import SERVER_SOFTWARE, USER_AGENT
|
from homeassistant.helpers.httpx_client import SERVER_SOFTWARE, USER_AGENT
|
||||||
from homeassistant.helpers.update_coordinator import (
|
from homeassistant.helpers.update_coordinator import (
|
||||||
@ -170,6 +170,9 @@ async def async_setup_entry(hass, config_entry):
|
|||||||
except IncompleteCredentials as ex:
|
except IncompleteCredentials as ex:
|
||||||
await async_client.aclose()
|
await async_client.aclose()
|
||||||
raise ConfigEntryAuthFailed from ex
|
raise ConfigEntryAuthFailed from ex
|
||||||
|
except httpx.ConnectTimeout as ex:
|
||||||
|
await async_client.aclose()
|
||||||
|
raise ConfigEntryNotReady from ex
|
||||||
except TeslaException as ex:
|
except TeslaException as ex:
|
||||||
await async_client.aclose()
|
await async_client.aclose()
|
||||||
if ex.code == HTTP_UNAUTHORIZED:
|
if ex.code == HTTP_UNAUTHORIZED:
|
||||||
|
Loading…
x
Reference in New Issue
Block a user