Add additional connection logging (#539)

This commit is contained in:
J. Nick Koston 2023-09-05 19:21:55 -05:00 committed by GitHub
parent ca254f150c
commit e0c4530dd8
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -146,6 +146,7 @@ class ReconnectLogic(zeroconf.RecordUpdateListener):
if not delay: if not delay:
self._call_connect_once() self._call_connect_once()
return return
_LOGGER.debug("Scheduling new connect attempt in %f seconds", delay)
self._connect_timer = self.loop.call_at( self._connect_timer = self.loop.call_at(
self.loop.time() + delay, self._call_connect_once self.loop.time() + delay, self._call_connect_once
) )
@ -174,7 +175,9 @@ class ReconnectLogic(zeroconf.RecordUpdateListener):
Must only be called from _call_connect_once Must only be called from _call_connect_once
""" """
_LOGGER.debug("Trying to connect to %s", self._log_name)
async with self._connected_lock: async with self._connected_lock:
_LOGGER.debug("Connected lock acquired for %s", self._log_name)
self._stop_zc_listen() self._stop_zc_listen()
if self._connected or self._is_stopped: if self._connected or self._is_stopped:
return return