mirror of
https://github.com/home-assistant/core.git
synced 2025-07-22 12:47:08 +00:00
Fix Plugwise recovering from aiohttp client error (#71642)
This commit is contained in:
parent
26177bd080
commit
ef16e6c129
@ -4,6 +4,7 @@ from __future__ import annotations
|
||||
import asyncio
|
||||
from typing import Any
|
||||
|
||||
from aiohttp import ClientConnectionError
|
||||
from plugwise.exceptions import InvalidAuthentication, PlugwiseException
|
||||
from plugwise.smile import Smile
|
||||
|
||||
@ -44,7 +45,7 @@ async def async_setup_entry_gw(hass: HomeAssistant, entry: ConfigEntry) -> bool:
|
||||
except InvalidAuthentication:
|
||||
LOGGER.error("Invalid username or Smile ID")
|
||||
return False
|
||||
except PlugwiseException as err:
|
||||
except (ClientConnectionError, PlugwiseException) as err:
|
||||
raise ConfigEntryNotReady(
|
||||
f"Error while communicating to device {api.smile_name}"
|
||||
) from err
|
||||
|
@ -2,6 +2,7 @@
|
||||
import asyncio
|
||||
from unittest.mock import MagicMock
|
||||
|
||||
import aiohttp
|
||||
from plugwise.exceptions import (
|
||||
ConnectionFailedError,
|
||||
PlugwiseException,
|
||||
@ -49,6 +50,7 @@ async def test_load_unload_config_entry(
|
||||
(PlugwiseException),
|
||||
(XMLDataMissingError),
|
||||
(asyncio.TimeoutError),
|
||||
(aiohttp.ClientConnectionError),
|
||||
],
|
||||
)
|
||||
async def test_config_entry_not_ready(
|
||||
|
Loading…
x
Reference in New Issue
Block a user