From 6f5a7b6df43f2869d42c91362daf671faab37fb3 Mon Sep 17 00:00:00 2001 From: Alex Albu Date: Sat, 15 Apr 2023 19:09:13 +0300 Subject: [PATCH] Start GW heartbeat after getting subdevices status --- custom_components/localtuya/common.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/custom_components/localtuya/common.py b/custom_components/localtuya/common.py index f27617718..9c6cae86c 100644 --- a/custom_components/localtuya/common.py +++ b/custom_components/localtuya/common.py @@ -341,7 +341,6 @@ async def _make_connection(self): is_gateway=True, ) self.debug("Connected to gateway %s successfully", self._config_entry[CONF_HOST]) - self._interface.start_heartbeat() self.debug("Attempting to reconnect %s subdevices", str(len(self._sub_devices.items()))) @@ -376,6 +375,8 @@ async def _make_connection(self): except Exception as e: # pylint: disable=broad-except self.warning("Adding subdevice %s failed with exception\n %s", cid, str(e)) + + self._interface.start_heartbeat() self._retry_sub_conn_interval = async_track_time_interval( self._hass,