mirror of
https://github.com/home-assistant/core.git
synced 2025-09-12 08:11:38 +02:00
Handle HusqvarnaWSClientError (#150145)
This commit is contained in:
committed by
Franck Nijhof
parent
6f4d405b26
commit
42a3bef34a
@@ -12,6 +12,7 @@ from aioautomower.exceptions import (
|
|||||||
ApiError,
|
ApiError,
|
||||||
AuthError,
|
AuthError,
|
||||||
HusqvarnaTimeoutError,
|
HusqvarnaTimeoutError,
|
||||||
|
HusqvarnaWSClientError,
|
||||||
HusqvarnaWSServerHandshakeError,
|
HusqvarnaWSServerHandshakeError,
|
||||||
)
|
)
|
||||||
from aioautomower.model import MowerDictionary
|
from aioautomower.model import MowerDictionary
|
||||||
@@ -142,7 +143,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