Add more temporary logging

This commit is contained in:
Pierre Ståhl
2020-10-11 22:36:16 +02:00
committed by rospogrigio
parent ff3ca99b29
commit 91f788865c
2 changed files with 24 additions and 3 deletions

View File

@@ -112,7 +112,21 @@ class TuyaDevice(pytuya.TuyaListener):
def connect(self):
"""Connet to device if not already connected."""
if not self._is_closing and self._connect_task is None and not self._interface:
_LOGGER.debug(
"Connecting to %s (%s)",
self._config_entry[CONF_HOST],
self._config_entry[CONF_DEVICE_ID],
)
self._connect_task = asyncio.ensure_future(self._make_connection())
else:
_LOGGER.debug(
"Already connecting to %s (%s) - %s, %s, %s",
self._config_entry[CONF_HOST],
self._config_entry[CONF_DEVICE_ID],
self._is_closing,
self._connect_task,
self._interface,
)
async def _make_connection(self):
backoff = min(