From 1de003487e6df7bcccc5231d92cc217f0f2927b8 Mon Sep 17 00:00:00 2001 From: Raman Gupta <7243222+raman325@users.noreply.github.com> Date: Fri, 24 Jan 2020 01:39:28 -0500 Subject: [PATCH] Fix connection failure log message in async_setup_entry for Vizio component (#31097) * remove connection check during setup since it is already done during config flow * revert change and fix log message * demote connection setup to warning --- homeassistant/components/vizio/media_player.py | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/homeassistant/components/vizio/media_player.py b/homeassistant/components/vizio/media_player.py index 000d1baec2d..b2f529bce10 100644 --- a/homeassistant/components/vizio/media_player.py +++ b/homeassistant/components/vizio/media_player.py @@ -76,17 +76,19 @@ async def async_setup_entry( if not await device.can_connect(): fail_auth_msg = "" if token: - fail_auth_msg = "and auth token '{token}' are correct." + fail_auth_msg = f"and auth token '{token}' are correct." else: fail_auth_msg = "is correct." - _LOGGER.error( - "Failed to connect to Vizio device, please check if host '{host}'" - "is valid and available. Also check if device class '{device_class}' %s", + _LOGGER.warning( + "Failed to connect to Vizio device, please check if host '%s' " + "is valid and available. Also check if device class '%s' %s", + host, + device_class, fail_auth_msg, ) raise PlatformNotReady - entity = VizioDevice(config_entry, device, name, volume_step, device_class,) + entity = VizioDevice(config_entry, device, name, volume_step, device_class) async_add_entities([entity], update_before_add=True)