mirror of
https://github.com/home-assistant/core.git
synced 2025-09-11 15:51:47 +02:00
Handle HusqvarnaWSClientError (#150145)
This commit is contained in:
@@ -12,6 +12,7 @@ from aioautomower.exceptions import (
|
|||||||
ApiError,
|
ApiError,
|
||||||
AuthError,
|
AuthError,
|
||||||
HusqvarnaTimeoutError,
|
HusqvarnaTimeoutError,
|
||||||
|
HusqvarnaWSClientError,
|
||||||
HusqvarnaWSServerHandshakeError,
|
HusqvarnaWSServerHandshakeError,
|
||||||
)
|
)
|
||||||
from aioautomower.model import MowerDictionary, MowerStates
|
from aioautomower.model import MowerDictionary, MowerStates
|
||||||
@@ -172,7 +173,7 @@ class AutomowerDataUpdateCoordinator(DataUpdateCoordinator[MowerDictionary]):
|
|||||||
# Reset reconnect time after successful connection
|
# Reset reconnect time after successful connection
|
||||||
self.reconnect_time = DEFAULT_RECONNECT_TIME
|
self.reconnect_time = DEFAULT_RECONNECT_TIME
|
||||||
await automower_client.start_listening()
|
await automower_client.start_listening()
|
||||||
except HusqvarnaWSServerHandshakeError as err:
|
except (HusqvarnaWSServerHandshakeError, HusqvarnaWSClientError) as err:
|
||||||
_LOGGER.debug(
|
_LOGGER.debug(
|
||||||
"Failed to connect to websocket. Trying to reconnect: %s",
|
"Failed to connect to websocket. Trying to reconnect: %s",
|
||||||
err,
|
err,
|
||||||
|
Reference in New Issue
Block a user