mirror of
https://github.com/home-assistant/core.git
synced 2025-07-23 21:27:38 +00:00
Hold connection lock in Shelly RPC reconnect (#119009)
This commit is contained in:
parent
cfa619b67e
commit
5bb4e4f5d9
@ -584,11 +584,13 @@ class ShellyRpcCoordinator(ShellyCoordinatorBase[RpcDevice]):
|
||||
raise UpdateFailed(
|
||||
f"Sleeping device did not update within {self.sleep_period} seconds interval"
|
||||
)
|
||||
if self.device.connected:
|
||||
return
|
||||
|
||||
if not await self._async_device_connect_task():
|
||||
raise UpdateFailed("Device reconnect error")
|
||||
async with self._connection_lock:
|
||||
if self.device.connected: # Already connected
|
||||
return
|
||||
|
||||
if not await self._async_device_connect_task():
|
||||
raise UpdateFailed("Device reconnect error")
|
||||
|
||||
async def _async_disconnected(self, reconnect: bool) -> None:
|
||||
"""Handle device disconnected."""
|
||||
|
Loading…
x
Reference in New Issue
Block a user