Make connection retries every minute (#288)
* Make connection retries every minute This mimics the re-connect loop previosuly present, but in a simpler form. Every 60 seconds, a new connection attempt is made as well as initially when a device is set up. * Fix device look up in reconnect loop
This commit is contained in:
@@ -127,7 +127,7 @@ class TuyaDevice(pytuya.TuyaListener, pytuya.ContextualLogger):
|
||||
"""Return if connected to device."""
|
||||
return self._interface is not None
|
||||
|
||||
def connect(self):
|
||||
def async_connect(self):
|
||||
"""Connect to device if not already connected."""
|
||||
if not self._is_closing and self._connect_task is None and not self._interface:
|
||||
self._connect_task = asyncio.create_task(self._make_connection())
|
||||
|
Reference in New Issue
Block a user