Limit log spam by ConfigEntryNotReady (#47201)

This commit is contained in:
Simone Chemelli
2021-03-02 21:50:28 +01:00
committed by GitHub
parent 198ecb0945
commit 17444e2f2f

View File

@@ -257,12 +257,19 @@ class ConfigEntry:
self.state = ENTRY_STATE_SETUP_RETRY
wait_time = 2 ** min(tries, 4) * 5
tries += 1
_LOGGER.warning(
"Config entry '%s' for %s integration not ready yet. Retrying in %d seconds",
self.title,
self.domain,
wait_time,
)
if tries == 1:
_LOGGER.warning(
"Config entry '%s' for %s integration not ready yet. Retrying in background",
self.title,
self.domain,
)
else:
_LOGGER.debug(
"Config entry '%s' for %s integration not ready yet. Retrying in %d seconds",
self.title,
self.domain,
wait_time,
)
async def setup_again(now: Any) -> None:
"""Run setup again."""