From 18980bf54c76d44de0acf59b7ae6ee419e1758d6 Mon Sep 17 00:00:00 2001 From: Alex Albu Date: Fri, 14 Apr 2023 13:20:43 +0300 Subject: [PATCH] Start GW heartbeat on successful connect --- custom_components/localtuya/common.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/custom_components/localtuya/common.py b/custom_components/localtuya/common.py index ef5858fe2..f27617718 100644 --- a/custom_components/localtuya/common.py +++ b/custom_components/localtuya/common.py @@ -341,7 +341,10 @@ 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()))) + # Re-add and get status of previously added sub-devices # Note this assumes the gateway device has not been tear down for subitem in self._sub_devices.items():