mirror of
https://github.com/home-assistant/core.git
synced 2025-07-23 05:07:41 +00:00
Recreate iaqualink httpx client upon service exception (#89341)
This commit is contained in:
parent
863f8b727d
commit
29b5ef31c1
@ -153,6 +153,7 @@ async def async_setup_entry( # noqa: C901
|
||||
system.serial,
|
||||
svc_exception,
|
||||
)
|
||||
await system.aqualink.close()
|
||||
else:
|
||||
cur = system.online
|
||||
if cur and not prev:
|
||||
|
@ -3,6 +3,7 @@ from __future__ import annotations
|
||||
|
||||
from collections.abc import Awaitable
|
||||
|
||||
import httpx
|
||||
from iaqualink.exception import AqualinkServiceException
|
||||
|
||||
from homeassistant.exceptions import HomeAssistantError
|
||||
@ -12,5 +13,5 @@ async def await_or_reraise(awaitable: Awaitable) -> None:
|
||||
"""Execute API call while catching service exceptions."""
|
||||
try:
|
||||
await awaitable
|
||||
except AqualinkServiceException as svc_exception:
|
||||
except (AqualinkServiceException, httpx.HTTPError) as svc_exception:
|
||||
raise HomeAssistantError(f"Aqualink error: {svc_exception}") from svc_exception
|
||||
|
Loading…
x
Reference in New Issue
Block a user