From dd4147fbaaa41c23ee4695fdce65fcd8ab2f9a8a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Oliv=C3=A9r=20Falvai?= Date: Sat, 12 Dec 2020 18:44:45 +0100 Subject: [PATCH] Log unique_id of device when ESPHome connection fails (#44152) --- homeassistant/components/esphome/__init__.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/homeassistant/components/esphome/__init__.py b/homeassistant/components/esphome/__init__.py index a12754a87f4..fcfb4cf7ff1 100644 --- a/homeassistant/components/esphome/__init__.py +++ b/homeassistant/components/esphome/__init__.py @@ -257,7 +257,12 @@ async def _setup_auto_reconnect_logic( try: await cli.connect(on_stop=try_connect, login=True) except APIConnectionError as error: - _LOGGER.info("Can't connect to ESPHome API for %s: %s", host, error) + _LOGGER.info( + "Can't connect to ESPHome API for %s (%s): %s", + entry.unique_id, + host, + error, + ) # Schedule re-connect in event loop in order not to delay HA # startup. First connect is scheduled in tracked tasks. data.reconnect_task = hass.loop.create_task(