Increase ESPHome log level on first connection failure (#47547)

pull/47559/head
Anders Melchiorsen 2021-03-07 11:36:28 +01:00 committed by GitHub
parent 0d07dae3bc
commit c8c394ef91
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 3 additions and 2 deletions

View File

@ -264,8 +264,9 @@ async def _setup_auto_reconnect_logic(
try:
await cli.connect(on_stop=try_connect, login=True)
except APIConnectionError as error:
logger = _LOGGER.info if tries == 0 else _LOGGER.debug
logger(
level = logging.WARNING if tries == 0 else logging.DEBUG
_LOGGER.log(
level,
"Can't connect to ESPHome API for %s (%s): %s",
entry.unique_id,
host,