mirror of
https://github.com/home-assistant/core.git
synced 2025-07-17 10:17:09 +00:00
Ensure powerview setup is retried on 502 error (#59847)
This commit is contained in:
parent
a211b8ca8f
commit
cc3f179796
@ -89,12 +89,11 @@ async def async_setup_entry(hass: HomeAssistant, entry: ConfigEntry) -> bool:
|
||||
(await shades.get_resources())[SHADE_DATA]
|
||||
)
|
||||
except HUB_EXCEPTIONS as err:
|
||||
_LOGGER.error("Connection error to PowerView hub: %s", hub_address)
|
||||
raise ConfigEntryNotReady from err
|
||||
|
||||
raise ConfigEntryNotReady(
|
||||
f"Connection error to PowerView hub: {hub_address}: {err}"
|
||||
) from err
|
||||
if not device_info:
|
||||
_LOGGER.error("Unable to initialize PowerView hub: %s", hub_address)
|
||||
raise ConfigEntryNotReady
|
||||
raise ConfigEntryNotReady(f"Unable to initialize PowerView hub: {hub_address}")
|
||||
|
||||
async def async_update_data():
|
||||
"""Fetch data from shade endpoint."""
|
||||
|
@ -3,7 +3,7 @@
|
||||
import asyncio
|
||||
|
||||
from aiohttp.client_exceptions import ServerDisconnectedError
|
||||
from aiopvapi.helpers.aiorequest import PvApiConnectionError
|
||||
from aiopvapi.helpers.aiorequest import PvApiConnectionError, PvApiResponseStatusError
|
||||
|
||||
DOMAIN = "hunterdouglas_powerview"
|
||||
|
||||
@ -62,7 +62,12 @@ PV_SHADE_DATA = "pv_shade_data"
|
||||
PV_ROOM_DATA = "pv_room_data"
|
||||
COORDINATOR = "coordinator"
|
||||
|
||||
HUB_EXCEPTIONS = (ServerDisconnectedError, asyncio.TimeoutError, PvApiConnectionError)
|
||||
HUB_EXCEPTIONS = (
|
||||
ServerDisconnectedError,
|
||||
asyncio.TimeoutError,
|
||||
PvApiConnectionError,
|
||||
PvApiResponseStatusError,
|
||||
)
|
||||
|
||||
LEGACY_DEVICE_SUB_REVISION = 1
|
||||
LEGACY_DEVICE_REVISION = 0
|
||||
|
Loading…
x
Reference in New Issue
Block a user