From 2fa6370dc0ad7a46a2bc6f8a4f7baa1e2592ba26 Mon Sep 17 00:00:00 2001 From: Jan-Philipp Benecke Date: Sat, 14 Sep 2024 15:24:55 +0200 Subject: [PATCH] Use debug instead of info log level in components [a] (#125944) * Use debug instead of info log level in components [a] * Process code review comments --- homeassistant/components/actiontec/device_tracker.py | 5 ++--- homeassistant/components/adax/config_flow.py | 2 +- homeassistant/components/androidtv/config_flow.py | 2 +- homeassistant/components/androidtv/entity.py | 2 +- homeassistant/components/androidtv/media_player.py | 2 +- homeassistant/components/apple_tv/__init__.py | 4 ++-- homeassistant/components/apple_tv/remote.py | 2 +- homeassistant/components/aprs/device_tracker.py | 4 ++-- homeassistant/components/asuswrt/router.py | 2 +- homeassistant/components/aurora_abb_powerone/config_flow.py | 2 +- homeassistant/components/aurora_abb_powerone/coordinator.py | 4 ++-- homeassistant/components/axis/__init__.py | 2 +- 12 files changed, 16 insertions(+), 17 deletions(-) diff --git a/homeassistant/components/actiontec/device_tracker.py b/homeassistant/components/actiontec/device_tracker.py index 801ddd00a5a..b1b9c81c674 100644 --- a/homeassistant/components/actiontec/device_tracker.py +++ b/homeassistant/components/actiontec/device_tracker.py @@ -51,7 +51,6 @@ class ActiontecDeviceScanner(DeviceScanner): self.last_results: list[Device] = [] data = self.get_actiontec_data() self.success_init = data is not None - _LOGGER.info("Scanner initialized") def scan_devices(self) -> list[str]: """Scan for new devices and return a list with found device IDs.""" @@ -70,7 +69,7 @@ class ActiontecDeviceScanner(DeviceScanner): Return boolean if scanning successful. """ - _LOGGER.info("Scanning") + _LOGGER.debug("Scanning") if not self.success_init: return False @@ -79,7 +78,7 @@ class ActiontecDeviceScanner(DeviceScanner): self.last_results = [ device for device in actiontec_data if device.timevalid > -60 ] - _LOGGER.info("Scan successful") + _LOGGER.debug("Scan successful") return True def get_actiontec_data(self) -> list[Device] | None: diff --git a/homeassistant/components/adax/config_flow.py b/homeassistant/components/adax/config_flow.py index 3e8ca646cad..0a995fc6b85 100644 --- a/homeassistant/components/adax/config_flow.py +++ b/homeassistant/components/adax/config_flow.py @@ -130,7 +130,7 @@ class AdaxConfigFlow(ConfigFlow, domain=DOMAIN): async_get_clientsession(self.hass), account_id, password ) if token is None: - _LOGGER.info("Adax: Failed to login to retrieve token") + _LOGGER.debug("Adax: Failed to login to retrieve token") errors["base"] = "cannot_connect" return self.async_show_form( step_id="cloud", diff --git a/homeassistant/components/androidtv/config_flow.py b/homeassistant/components/androidtv/config_flow.py index 1ed4b0f6782..e8350acc9cb 100644 --- a/homeassistant/components/androidtv/config_flow.py +++ b/homeassistant/components/androidtv/config_flow.py @@ -131,7 +131,7 @@ class AndroidTVFlowHandler(ConfigFlow, domain=DOMAIN): return RESULT_CONN_ERROR, None dev_prop = aftv.device_properties - _LOGGER.info( + _LOGGER.debug( "Android device at %s: %s = %r, %s = %r", user_input[CONF_HOST], PROP_ETHMAC, diff --git a/homeassistant/components/androidtv/entity.py b/homeassistant/components/androidtv/entity.py index 470a4950ebc..626dd0f7794 100644 --- a/homeassistant/components/androidtv/entity.py +++ b/homeassistant/components/androidtv/entity.py @@ -67,7 +67,7 @@ def adb_decorator[_ADBDeviceT: AndroidTVEntity, **_P, _R]( return await func(self, *args, **kwargs) except LockNotAcquiredException: # If the ADB lock could not be acquired, skip this command - _LOGGER.info( + _LOGGER.debug( ( "ADB command %s not executed because the connection is" " currently in use" diff --git a/homeassistant/components/androidtv/media_player.py b/homeassistant/components/androidtv/media_player.py index 75cf6ead6c3..6e338529ad4 100644 --- a/homeassistant/components/androidtv/media_player.py +++ b/homeassistant/components/androidtv/media_player.py @@ -306,7 +306,7 @@ class ADBDevice(AndroidTVEntity, MediaPlayerEntity): msg, title="Android Debug Bridge", ) - _LOGGER.info("%s", msg) + _LOGGER.debug("%s", msg) @adb_decorator() async def service_download(self, device_path: str, local_path: str) -> None: diff --git a/homeassistant/components/apple_tv/__init__.py b/homeassistant/components/apple_tv/__init__.py index 08372aa79ae..d0e414c4e9e 100644 --- a/homeassistant/components/apple_tv/__init__.py +++ b/homeassistant/components/apple_tv/__init__.py @@ -375,7 +375,7 @@ class AppleTVManager(DeviceListener): f"Protocol(s) {missing_protocols_str} not yet found for {name}," " waiting for discovery." ) - _LOGGER.info( + _LOGGER.debug( "Protocol(s) %s not yet found for %s, trying later", missing_protocols_str, name, @@ -394,7 +394,7 @@ class AppleTVManager(DeviceListener): self._connection_attempts = 0 if self._connection_was_lost: - _LOGGER.info( + _LOGGER.warning( 'Connection was re-established to device "%s"', self.config_entry.data[CONF_NAME], ) diff --git a/homeassistant/components/apple_tv/remote.py b/homeassistant/components/apple_tv/remote.py index 8950a46388d..a93a89cad3e 100644 --- a/homeassistant/components/apple_tv/remote.py +++ b/homeassistant/components/apple_tv/remote.py @@ -85,7 +85,7 @@ class AppleTVRemote(AppleTVEntity, RemoteEntity): if not attr_value: raise ValueError("Command not found. Exiting sequence") - _LOGGER.info("Sending command %s", single_command) + _LOGGER.debug("Sending command %s", single_command) if hold_secs >= 1: await attr_value(action=InputAction.Hold) diff --git a/homeassistant/components/aprs/device_tracker.py b/homeassistant/components/aprs/device_tracker.py index 67d0736e526..fc23fc5e436 100644 --- a/homeassistant/components/aprs/device_tracker.py +++ b/homeassistant/components/aprs/device_tracker.py @@ -159,7 +159,7 @@ class AprsListenerThread(threading.Thread): self.ais.set_filter(self.server_filter) try: - _LOGGER.info( + _LOGGER.debug( "Opening connection to %s with callsign %s", self.host, self.callsign ) self.ais.connect() @@ -170,7 +170,7 @@ class AprsListenerThread(threading.Thread): except (AprsConnectionError, LoginError) as err: self.start_complete(False, str(err)) except OSError: - _LOGGER.info( + _LOGGER.debug( "Closing connection to %s with callsign %s", self.host, self.callsign ) diff --git a/homeassistant/components/asuswrt/router.py b/homeassistant/components/asuswrt/router.py index 1244db34ed5..330c4bcfb67 100644 --- a/homeassistant/components/asuswrt/router.py +++ b/homeassistant/components/asuswrt/router.py @@ -290,7 +290,7 @@ class AsusWrtRouter: if self._connect_error: self._connect_error = False - _LOGGER.info("Reconnected to ASUS router %s", self.host) + _LOGGER.warning("Reconnected to ASUS router %s", self.host) self._connected_devices = len(wrt_devices) consider_home: int = self._options.get( diff --git a/homeassistant/components/aurora_abb_powerone/config_flow.py b/homeassistant/components/aurora_abb_powerone/config_flow.py index 47c349ab48a..0b6e41257fc 100644 --- a/homeassistant/components/aurora_abb_powerone/config_flow.py +++ b/homeassistant/components/aurora_abb_powerone/config_flow.py @@ -45,7 +45,7 @@ def validate_and_connect( ret[ATTR_SERIAL_NUMBER] = client.serial_number() ret[ATTR_MODEL] = f"{client.version()} ({client.pn()})" ret[ATTR_FIRMWARE] = client.firmware(1) - _LOGGER.info("Returning device info=%s", ret) + _LOGGER.debug("Returning device info=%s", ret) except AuroraError: _LOGGER.warning("Could not connect to device=%s", comport) raise diff --git a/homeassistant/components/aurora_abb_powerone/coordinator.py b/homeassistant/components/aurora_abb_powerone/coordinator.py index 6a84869b2e5..0dd87e75766 100644 --- a/homeassistant/components/aurora_abb_powerone/coordinator.py +++ b/homeassistant/components/aurora_abb_powerone/coordinator.py @@ -78,9 +78,9 @@ class AuroraAbbDataUpdateCoordinator(DataUpdateCoordinator[dict[str, float]]): finally: if self.available != self.available_prev: if self.available: - _LOGGER.info("Communication with %s back online", self.name) + _LOGGER.warning("Communication with %s back online", self.name) else: - _LOGGER.info( + _LOGGER.warning( "Communication with %s lost", self.name, ) diff --git a/homeassistant/components/axis/__init__.py b/homeassistant/components/axis/__init__.py index f1d8d1d4b63..e6c6fab47a1 100644 --- a/homeassistant/components/axis/__init__.py +++ b/homeassistant/components/axis/__init__.py @@ -52,6 +52,6 @@ async def async_migrate_entry(hass: HomeAssistant, config_entry: ConfigEntry) -> # Home Assistant 2023.2 hass.config_entries.async_update_entry(config_entry, version=3) - _LOGGER.info("Migration to version %s successful", config_entry.version) + _LOGGER.debug("Migration to version %s successful", config_entry.version) return True