From ca3a14b1bc6929214a4824d29f821598bd89ed6b Mon Sep 17 00:00:00 2001 From: Otto Winter Date: Thu, 21 Oct 2021 19:24:03 +0200 Subject: [PATCH] Fix connect login 2 (#128) --- aioesphomeapi/client.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/aioesphomeapi/client.py b/aioesphomeapi/client.py index 9b5e805..d522520 100644 --- a/aioesphomeapi/client.py +++ b/aioesphomeapi/client.py @@ -172,10 +172,10 @@ class APIClient: try: await self._connection.connect(login=login) except APIConnectionError: - await _on_stop() + self._connection = None raise except Exception as e: - await _on_stop() + self._connection = None raise APIConnectionError( f"Unexpected error while connecting to {self._log_name}: {e}" ) from e