mirror of
https://github.com/home-assistant/core.git
synced 2025-07-23 21:27:38 +00:00
Fix point ConnectionTimeout during startup (#52322)
This commit is contained in:
parent
5baaede85b
commit
3c20f2dd42
@ -2,6 +2,7 @@
|
|||||||
import asyncio
|
import asyncio
|
||||||
import logging
|
import logging
|
||||||
|
|
||||||
|
from httpx import ConnectTimeout
|
||||||
from pypoint import PointSession
|
from pypoint import PointSession
|
||||||
import voluptuous as vol
|
import voluptuous as vol
|
||||||
|
|
||||||
@ -14,6 +15,7 @@ from homeassistant.const import (
|
|||||||
CONF_WEBHOOK_ID,
|
CONF_WEBHOOK_ID,
|
||||||
)
|
)
|
||||||
from homeassistant.core import HomeAssistant
|
from homeassistant.core import HomeAssistant
|
||||||
|
from homeassistant.exceptions import ConfigEntryNotReady
|
||||||
from homeassistant.helpers import config_validation as cv, device_registry
|
from homeassistant.helpers import config_validation as cv, device_registry
|
||||||
from homeassistant.helpers.dispatcher import (
|
from homeassistant.helpers.dispatcher import (
|
||||||
async_dispatcher_connect,
|
async_dispatcher_connect,
|
||||||
@ -92,6 +94,9 @@ async def async_setup_entry(hass: HomeAssistant, entry: ConfigEntry) -> bool:
|
|||||||
)
|
)
|
||||||
try:
|
try:
|
||||||
await session.ensure_active_token()
|
await session.ensure_active_token()
|
||||||
|
except ConnectTimeout as err:
|
||||||
|
_LOGGER.debug("Connection Timeout")
|
||||||
|
raise ConfigEntryNotReady from err
|
||||||
except Exception: # pylint: disable=broad-except
|
except Exception: # pylint: disable=broad-except
|
||||||
_LOGGER.error("Authentication Error")
|
_LOGGER.error("Authentication Error")
|
||||||
return False
|
return False
|
||||||
|
Loading…
x
Reference in New Issue
Block a user