mirror of
https://github.com/home-assistant/core.git
synced 2025-07-24 21:57:51 +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,
|
system.serial,
|
||||||
svc_exception,
|
svc_exception,
|
||||||
)
|
)
|
||||||
|
await system.aqualink.close()
|
||||||
else:
|
else:
|
||||||
cur = system.online
|
cur = system.online
|
||||||
if cur and not prev:
|
if cur and not prev:
|
||||||
|
@ -3,6 +3,7 @@ from __future__ import annotations
|
|||||||
|
|
||||||
from collections.abc import Awaitable
|
from collections.abc import Awaitable
|
||||||
|
|
||||||
|
import httpx
|
||||||
from iaqualink.exception import AqualinkServiceException
|
from iaqualink.exception import AqualinkServiceException
|
||||||
|
|
||||||
from homeassistant.exceptions import HomeAssistantError
|
from homeassistant.exceptions import HomeAssistantError
|
||||||
@ -12,5 +13,5 @@ async def await_or_reraise(awaitable: Awaitable) -> None:
|
|||||||
"""Execute API call while catching service exceptions."""
|
"""Execute API call while catching service exceptions."""
|
||||||
try:
|
try:
|
||||||
await awaitable
|
await awaitable
|
||||||
except AqualinkServiceException as svc_exception:
|
except (AqualinkServiceException, httpx.HTTPError) as svc_exception:
|
||||||
raise HomeAssistantError(f"Aqualink error: {svc_exception}") from svc_exception
|
raise HomeAssistantError(f"Aqualink error: {svc_exception}") from svc_exception
|
||||||
|
Loading…
x
Reference in New Issue
Block a user