From 5e67c86a871605971fdbc3f4175ad82ccd866bf4 Mon Sep 17 00:00:00 2001 From: Rob Bierbooms Date: Wed, 31 Jan 2024 20:52:33 +0100 Subject: [PATCH] Add debug logging --- custom_components/nefiteasy/__init__.py | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/custom_components/nefiteasy/__init__.py b/custom_components/nefiteasy/__init__.py index 5ffd582..a4e7069 100644 --- a/custom_components/nefiteasy/__init__.py +++ b/custom_components/nefiteasy/__init__.py @@ -129,6 +129,7 @@ async def connect(self) -> None: """Connect to nefit easy.""" _LOGGER.debug("Start connecting.") if not self.is_connecting: + _LOGGER.debug("Set is connecting to true") self.is_connecting = True await self.nefit.connect() @@ -150,9 +151,14 @@ async def connect(self) -> None: self.nefit.get("/gateway/brandID") except slixmpp.xmlstream.xmlstream.NotConnectedError: self.connected_state == STATE_INIT + _LOGGER.debug("Set is connecting to false") self.is_connecting = False return + try: + _LOGGER.debug( + "Wait for message event" + ) await asyncio.wait_for( self.nefit.xmppclient.message_event.wait(), timeout=29.0 ) @@ -163,6 +169,9 @@ async def connect(self) -> None: except: # noqa: E722 pylint: disable=bare-except _LOGGER.debug("No connection while testing connection.") else: + _LOGGER.debug( + "Message event received" + ) self.nefit.xmppclient.message_event.clear() # No exception and no auth error @@ -172,6 +181,7 @@ async def connect(self) -> None: if self.connected_state != STATE_CONNECTION_VERIFIED: _LOGGER.debug("Successfully verified connection.") + _LOGGER.debug("Set is connecting to false") self.is_connecting = False else: _LOGGER.debug("Connection procedure is already running.")