From adcb541b4b14d64596c57865660034a953a25b2a Mon Sep 17 00:00:00 2001 From: Jan-Philipp Benecke Date: Tue, 17 Sep 2024 19:45:05 +0200 Subject: [PATCH] Use debug/warning instead of info log level in components [r] (#126140) --- homeassistant/components/rachio/__init__.py | 2 +- homeassistant/components/rachio/device.py | 6 +++--- homeassistant/components/rainmachine/__init__.py | 4 ++-- homeassistant/components/rainmachine/util.py | 2 +- homeassistant/components/recollect_waste/__init__.py | 2 +- homeassistant/components/remember_the_milk/__init__.py | 2 +- homeassistant/components/rflink/__init__.py | 4 ++-- homeassistant/components/rfxtrx/__init__.py | 4 ++-- homeassistant/components/ridwell/__init__.py | 2 +- homeassistant/components/ring/__init__.py | 2 +- homeassistant/components/rmvtransport/sensor.py | 2 +- homeassistant/components/rocketchat/notify.py | 6 ++++-- homeassistant/components/rpi_power/binary_sensor.py | 2 +- tests/components/rpi_power/test_binary_sensor.py | 2 +- 14 files changed, 22 insertions(+), 20 deletions(-) diff --git a/homeassistant/components/rachio/__init__.py b/homeassistant/components/rachio/__init__.py index 6976d3f5ba6..3014b541f7d 100644 --- a/homeassistant/components/rachio/__init__.py +++ b/homeassistant/components/rachio/__init__.py @@ -83,7 +83,7 @@ async def async_setup_entry(hass: HomeAssistant, entry: ConfigEntry) -> bool: if not person.controllers and not person.base_stations: _LOGGER.error("No Rachio devices found in account %s", person.username) return False - _LOGGER.info( + _LOGGER.warning( ( "%d Rachio device(s) found; The url %s must be accessible from the internet" " in order to receive updates" diff --git a/homeassistant/components/rachio/device.py b/homeassistant/components/rachio/device.py index 0bbb862753e..f06910cd505 100644 --- a/homeassistant/components/rachio/device.py +++ b/homeassistant/components/rachio/device.py @@ -164,7 +164,7 @@ class RachioPerson: # rachio hands us back a dict if isinstance(webhooks, dict): if webhooks.get("code") == PERMISSION_ERROR: - _LOGGER.info( + _LOGGER.warning( ( "Not adding controller '%s', only controllers owned by '%s'" " may be added" @@ -195,7 +195,7 @@ class RachioPerson: for base in base_stations ) - _LOGGER.info('Using Rachio API as user "%s"', self.username) + _LOGGER.debug('Using Rachio API as user "%s"', self.username) @property def user_id(self) -> str | None: @@ -334,7 +334,7 @@ class RachioIro: def stop_watering(self) -> None: """Stop watering all zones connected to this controller.""" self.rachio.device.stop_water(self.controller_id) - _LOGGER.info("Stopped watering of all zones on %s", self) + _LOGGER.debug("Stopped watering of all zones on %s", self) def pause_watering(self, duration) -> None: """Pause watering on this controller.""" diff --git a/homeassistant/components/rainmachine/__init__.py b/homeassistant/components/rainmachine/__init__.py index b10d562ac67..f2e97aa7c24 100644 --- a/homeassistant/components/rainmachine/__init__.py +++ b/homeassistant/components/rainmachine/__init__.py @@ -291,7 +291,7 @@ async def async_setup_entry( # noqa: C901 else: data = await controller.zones.all(details=True, include_inactive=True) except UnknownAPICallError: - LOGGER.info( + LOGGER.warning( "Skipping unsupported API call for controller %s: %s", controller.name, api_category, @@ -518,7 +518,7 @@ async def async_migrate_entry( await er.async_migrate_entries(hass, entry.entry_id, migrate_unique_id) - LOGGER.info("Migration to version %s successful", version) + LOGGER.debug("Migration to version %s successful", version) return True diff --git a/homeassistant/components/rainmachine/util.py b/homeassistant/components/rainmachine/util.py index f3823d21164..c784c3c471f 100644 --- a/homeassistant/components/rainmachine/util.py +++ b/homeassistant/components/rainmachine/util.py @@ -63,7 +63,7 @@ def async_finish_entity_domain_replacements( old_entity_id = registry_entry.entity_id if strategy.remove_old_entity: - LOGGER.info('Removing old entity: "%s"', old_entity_id) + LOGGER.debug('Removing old entity: "%s"', old_entity_id) ent_reg.async_remove(old_entity_id) diff --git a/homeassistant/components/recollect_waste/__init__.py b/homeassistant/components/recollect_waste/__init__.py index bd01aed5473..6606f31a42d 100644 --- a/homeassistant/components/recollect_waste/__init__.py +++ b/homeassistant/components/recollect_waste/__init__.py @@ -109,6 +109,6 @@ async def async_migrate_entry(hass: HomeAssistant, entry: ConfigEntry) -> bool: await er.async_migrate_entries(hass, entry.entry_id, migrate_unique_id) - LOGGER.info("Migration to version %s successful", version) + LOGGER.debug("Migration to version %s successful", version) return True diff --git a/homeassistant/components/remember_the_milk/__init__.py b/homeassistant/components/remember_the_milk/__init__.py index 425a12d5c4d..7f91c6e2f13 100644 --- a/homeassistant/components/remember_the_milk/__init__.py +++ b/homeassistant/components/remember_the_milk/__init__.py @@ -58,7 +58,7 @@ def setup(hass: HomeAssistant, config: ConfigType) -> bool: stored_rtm_config = RememberTheMilkConfiguration(hass) for rtm_config in config[DOMAIN]: account_name = rtm_config[CONF_NAME] - _LOGGER.info("Adding Remember the milk account %s", account_name) + _LOGGER.debug("Adding Remember the milk account %s", account_name) api_key = rtm_config[CONF_API_KEY] shared_secret = rtm_config[CONF_SHARED_SECRET] token = stored_rtm_config.get_token(account_name) diff --git a/homeassistant/components/rflink/__init__.py b/homeassistant/components/rflink/__init__.py index e5d5e97fa84..a7525b7caf5 100644 --- a/homeassistant/components/rflink/__init__.py +++ b/homeassistant/components/rflink/__init__.py @@ -264,7 +264,7 @@ async def async_setup(hass: HomeAssistant, config: ConfigType) -> bool: async def connect(): """Set up connection and hook it into HA for reconnect/shutdown.""" - _LOGGER.info("Initiating Rflink connection") + _LOGGER.debug("Initiating Rflink connection") # Rflink create_rflink_connection decides based on the value of host # (string or None) if serial or tcp mode should be used @@ -311,7 +311,7 @@ async def async_setup(hass: HomeAssistant, config: ConfigType) -> bool: EVENT_HOMEASSISTANT_STOP, lambda x: transport.close() ) - _LOGGER.info("Connected to Rflink") + _LOGGER.debug("Connected to Rflink") hass.async_create_task(connect(), eager_start=False) async_dispatcher_connect(hass, SIGNAL_EVENT, event_callback) diff --git a/homeassistant/components/rfxtrx/__init__.py b/homeassistant/components/rfxtrx/__init__.py index f3466aa704d..24a7f5ada51 100644 --- a/homeassistant/components/rfxtrx/__init__.py +++ b/homeassistant/components/rfxtrx/__init__.py @@ -231,7 +231,7 @@ async def async_setup_internal(hass: HomeAssistant, entry: ConfigEntry) -> None: config = {} config[CONF_DEVICE_ID] = device_id - _LOGGER.info( + _LOGGER.debug( "Added device (Device ID: %s Class: %s Sub: %s, Event: %s)", event.device.id_string.lower(), event.device.__class__.__name__, @@ -416,7 +416,7 @@ def find_possible_pt2262_device(device_ids: set[str], device_id: str) -> str | N size = i if size is not None: size = len(dev_id) - size - 1 - _LOGGER.info( + _LOGGER.debug( ( "Found possible device %s for %s " "with the following configuration:\n" diff --git a/homeassistant/components/ridwell/__init__.py b/homeassistant/components/ridwell/__init__.py index cf584207091..71e80086833 100644 --- a/homeassistant/components/ridwell/__init__.py +++ b/homeassistant/components/ridwell/__init__.py @@ -55,6 +55,6 @@ async def async_migrate_entry(hass: HomeAssistant, entry: ConfigEntry) -> bool: await er.async_migrate_entries(hass, entry.entry_id, migrate_unique_id) - LOGGER.info("Migration to version %s successful", version) + LOGGER.debug("Migration to version %s successful", version) return True diff --git a/homeassistant/components/ring/__init__.py b/homeassistant/components/ring/__init__.py index 992544b1e18..c1042a9546d 100644 --- a/homeassistant/components/ring/__init__.py +++ b/homeassistant/components/ring/__init__.py @@ -133,7 +133,7 @@ async def _migrate_old_unique_ids(hass: HomeAssistant, entry_id: str) -> None: existing_entity_id, ) return None - _LOGGER.info("Fixing non string unique id %s", entity_entry.unique_id) + _LOGGER.debug("Fixing non string unique id %s", entity_entry.unique_id) return {"new_unique_id": new_unique_id} return None diff --git a/homeassistant/components/rmvtransport/sensor.py b/homeassistant/components/rmvtransport/sensor.py index e8b976129c5..f9ad4e24631 100644 --- a/homeassistant/components/rmvtransport/sensor.py +++ b/homeassistant/components/rmvtransport/sensor.py @@ -289,6 +289,6 @@ class RMVDepartureData: if not self._error_notification and _deps_not_found: self._error_notification = True - _LOGGER.info("Destination(s) %s not found", ", ".join(_deps_not_found)) + _LOGGER.warning("Destination(s) %s not found", ", ".join(_deps_not_found)) self.departures = _deps diff --git a/homeassistant/components/rocketchat/notify.py b/homeassistant/components/rocketchat/notify.py index e39fb2dc0a1..a06226d22ee 100644 --- a/homeassistant/components/rocketchat/notify.py +++ b/homeassistant/components/rocketchat/notify.py @@ -52,8 +52,10 @@ def get_service( except RocketConnectionException: _LOGGER.warning("Unable to connect to Rocket.Chat server at %s", url) except RocketAuthenticationException: - _LOGGER.warning("Rocket.Chat authentication failed for user %s", username) - _LOGGER.info("Please check your username/password") + _LOGGER.warning( + "Rocket.Chat authentication failed for user %s. Please check your username/password", + username, + ) return None diff --git a/homeassistant/components/rpi_power/binary_sensor.py b/homeassistant/components/rpi_power/binary_sensor.py index a7306899bde..00d7ec0e3f4 100644 --- a/homeassistant/components/rpi_power/binary_sensor.py +++ b/homeassistant/components/rpi_power/binary_sensor.py @@ -55,5 +55,5 @@ class RaspberryChargerBinarySensor(BinarySensorEntity): if value: _LOGGER.warning(DESCRIPTION_UNDER_VOLTAGE) else: - _LOGGER.info(DESCRIPTION_NORMALIZED) + _LOGGER.debug(DESCRIPTION_NORMALIZED) self._attr_is_on = value diff --git a/tests/components/rpi_power/test_binary_sensor.py b/tests/components/rpi_power/test_binary_sensor.py index 865d7c035b8..a5776a22fb0 100644 --- a/tests/components/rpi_power/test_binary_sensor.py +++ b/tests/components/rpi_power/test_binary_sensor.py @@ -68,6 +68,6 @@ async def test_new_detected( assert state.state == STATE_OFF assert ( binary_sensor.__name__, - logging.INFO, + logging.DEBUG, DESCRIPTION_NORMALIZED, ) in caplog.record_tuples