Remove logging of retrying config entry warning (#101483)

This commit is contained in:
Franck Nijhof 2023-10-05 22:12:01 +02:00 committed by GitHub
parent fe316f2233
commit 6853d54050
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 15 additions and 26 deletions

View file

@ -437,27 +437,16 @@ class ConfigEntry:
self._tries += 1
message = str(ex)
ready_message = f"ready yet: {message}" if message else "ready yet"
if self._tries == 1:
_LOGGER.warning(
(
"Config entry '%s' for %s integration not %s; Retrying in"
" background"
),
self.title,
self.domain,
ready_message,
)
else:
_LOGGER.debug(
(
"Config entry '%s' for %s integration not %s; Retrying in %d"
" seconds"
),
self.title,
self.domain,
ready_message,
wait_time,
)
_LOGGER.debug(
(
"Config entry '%s' for %s integration not %s; Retrying in %d"
" seconds"
),
self.title,
self.domain,
ready_message,
wait_time,
)
if hass.state == CoreState.running:
self._async_cancel_retry_setup = async_call_later(

View file

@ -107,11 +107,11 @@ async def test_setup_configuration_failure(
@pytest.mark.parametrize("subscriber_side_effect", [SubscriberException()])
async def test_setup_susbcriber_failure(
hass: HomeAssistant, warning_caplog, failing_subscriber, setup_base_platform
hass: HomeAssistant, caplog, failing_subscriber, setup_base_platform
) -> None:
"""Test configuration error."""
await setup_base_platform()
assert "Subscriber error:" in warning_caplog.text
assert "Subscriber error:" in caplog.text
entries = hass.config_entries.async_entries(DOMAIN)
assert len(entries) == 1
@ -119,7 +119,7 @@ async def test_setup_susbcriber_failure(
async def test_setup_device_manager_failure(
hass: HomeAssistant, warning_caplog, setup_base_platform
hass: HomeAssistant, caplog, setup_base_platform
) -> None:
"""Test device manager api failure."""
with patch(
@ -130,7 +130,7 @@ async def test_setup_device_manager_failure(
):
await setup_base_platform()
assert "Device manager error:" in warning_caplog.text
assert "Device manager error:" in caplog.text
entries = hass.config_entries.async_entries(DOMAIN)
assert len(entries) == 1

View file

@ -641,5 +641,5 @@ async def test_async_setup_retries_with_wrong_device(
assert config_entry.state is ConfigEntryState.SETUP_RETRY
assert (
"Unexpected device found at 192.168.1.239; expected 0x0000000000999999, "
"found 0x000000000015243f; Retrying in background"
"found 0x000000000015243f; Retrying in"
) in caplog.text