mirror of
https://github.com/home-assistant/core.git
synced 2025-07-21 20:27:08 +00:00
Clean up unnecessary branch in SimpliSafe (#66268)
This commit is contained in:
parent
b8253b1b47
commit
e5eba88ecc
@ -495,8 +495,6 @@ class SimpliSafe:
|
|||||||
"""Start a websocket reconnection loop."""
|
"""Start a websocket reconnection loop."""
|
||||||
assert self._api.websocket
|
assert self._api.websocket
|
||||||
|
|
||||||
should_reconnect = True
|
|
||||||
|
|
||||||
try:
|
try:
|
||||||
await self._api.websocket.async_connect()
|
await self._api.websocket.async_connect()
|
||||||
await self._api.websocket.async_listen()
|
await self._api.websocket.async_listen()
|
||||||
@ -508,12 +506,11 @@ class SimpliSafe:
|
|||||||
except Exception as err: # pylint: disable=broad-except
|
except Exception as err: # pylint: disable=broad-except
|
||||||
LOGGER.error("Unknown exception while connecting to websocket: %s", err)
|
LOGGER.error("Unknown exception while connecting to websocket: %s", err)
|
||||||
|
|
||||||
if should_reconnect:
|
LOGGER.info("Reconnecting to websocket")
|
||||||
LOGGER.info("Disconnected from websocket; reconnecting")
|
await self._async_cancel_websocket_loop()
|
||||||
await self._async_cancel_websocket_loop()
|
self._websocket_reconnect_task = self._hass.async_create_task(
|
||||||
self._websocket_reconnect_task = self._hass.async_create_task(
|
self._async_start_websocket_loop()
|
||||||
self._async_start_websocket_loop()
|
)
|
||||||
)
|
|
||||||
|
|
||||||
async def _async_cancel_websocket_loop(self) -> None:
|
async def _async_cancel_websocket_loop(self) -> None:
|
||||||
"""Stop any existing websocket reconnection loop."""
|
"""Stop any existing websocket reconnection loop."""
|
||||||
|
Loading…
x
Reference in New Issue
Block a user