From 1426c421f3b9c26eeb001e508ae3c672b4c95477 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ville=20Skytt=C3=A4?= Date: Tue, 14 Jan 2025 09:15:38 -0100 Subject: [PATCH] Use percent formatting in logging per guidelines (#135550) --- homeassistant/components/acmeda/hub.py | 2 +- homeassistant/components/emoncms/__init__.py | 2 +- homeassistant/components/intellifire/__init__.py | 2 +- homeassistant/components/intellifire/config_flow.py | 4 ++-- homeassistant/components/mastodon/notify.py | 2 +- homeassistant/components/monarch_money/config_flow.py | 2 +- homeassistant/components/webmin/config_flow.py | 2 +- 7 files changed, 8 insertions(+), 8 deletions(-) diff --git a/homeassistant/components/acmeda/hub.py b/homeassistant/components/acmeda/hub.py index a5daf27f445..4f2e4f4f63f 100644 --- a/homeassistant/components/acmeda/hub.py +++ b/homeassistant/components/acmeda/hub.py @@ -70,7 +70,7 @@ class PulseHub: async def async_notify_update(self, update_type: aiopulse.UpdateType) -> None: """Evaluate entities when hub reports that update has occurred.""" - LOGGER.debug("Hub {update_type.name} updated") + LOGGER.debug("Hub %s updated", update_type.name) if update_type == aiopulse.UpdateType.rollers: await update_devices(self.hass, self.config_entry, self.api.rollers) diff --git a/homeassistant/components/emoncms/__init__.py b/homeassistant/components/emoncms/__init__.py index 0cd686b5b56..581948bbc6f 100644 --- a/homeassistant/components/emoncms/__init__.py +++ b/homeassistant/components/emoncms/__init__.py @@ -26,7 +26,7 @@ def _migrate_unique_id( for entity in entry_entities: if entity.unique_id.split("-")[0] == entry.entry_id: feed_id = entity.unique_id.split("-")[-1] - LOGGER.debug(f"moving feed {feed_id} to hardware uuid") + LOGGER.debug("moving feed %s to hardware uuid", feed_id) ent_reg.async_update_entity( entity.entity_id, new_unique_id=f"{emoncms_unique_id}-{feed_id}" ) diff --git a/homeassistant/components/intellifire/__init__.py b/homeassistant/components/intellifire/__init__.py index 7609398673b..ce78f1a6fa3 100644 --- a/homeassistant/components/intellifire/__init__.py +++ b/homeassistant/components/intellifire/__init__.py @@ -149,7 +149,7 @@ async def _async_wait_for_initialization( while ( fireplace.data.ipv4_address == "127.0.0.1" and fireplace.data.serial == "unset" ): - LOGGER.debug(f"Waiting for fireplace to initialize [{fireplace.read_mode}]") + LOGGER.debug("Waiting for fireplace to initialize [%s]", fireplace.read_mode) await asyncio.sleep(INIT_WAIT_TIME_SECONDS) diff --git a/homeassistant/components/intellifire/config_flow.py b/homeassistant/components/intellifire/config_flow.py index a6b63f3b3e8..e7c4fbbdd2a 100644 --- a/homeassistant/components/intellifire/config_flow.py +++ b/homeassistant/components/intellifire/config_flow.py @@ -145,13 +145,13 @@ class IntelliFireConfigFlow(ConfigFlow, domain=DOMAIN): """ errors: dict[str, str] = {} LOGGER.debug( - f"STEP: pick_cloud_device: {user_input} - DHCP_MODE[{self._dhcp_mode}" + "STEP: pick_cloud_device: %s - DHCP_MODE[%s]", user_input, self._dhcp_mode ) if self._dhcp_mode or user_input is not None: if self._dhcp_mode: serial = self._dhcp_discovered_serial - LOGGER.debug(f"DHCP Mode detected for serial [{serial}]") + LOGGER.debug("DHCP Mode detected for serial [%s]", serial) if user_input is not None: serial = user_input[CONF_SERIAL] diff --git a/homeassistant/components/mastodon/notify.py b/homeassistant/components/mastodon/notify.py index bdfdbbf6e99..dd76d44a02c 100644 --- a/homeassistant/components/mastodon/notify.py +++ b/homeassistant/components/mastodon/notify.py @@ -115,7 +115,7 @@ class MastodonNotificationService(BaseNotificationService): try: mediadata = self.client.media_post(media_path, mime_type=media_type) except MastodonAPIError: - LOGGER.error(f"Unable to upload image {media_path}") + LOGGER.error("Unable to upload image %s", media_path) return mediadata diff --git a/homeassistant/components/monarch_money/config_flow.py b/homeassistant/components/monarch_money/config_flow.py index 5bfdc02c61e..e6ab84a4e74 100644 --- a/homeassistant/components/monarch_money/config_flow.py +++ b/homeassistant/components/monarch_money/config_flow.py @@ -87,7 +87,7 @@ async def validate_login( except LoginFailedException as err: raise InvalidAuth from err - LOGGER.debug(f"Connection successful - saving session to file {SESSION_FILE}") + LOGGER.debug("Connection successful - saving session to file %s", SESSION_FILE) LOGGER.debug("Obtaining subscription id") subs: MonarchSubscription = await monarch_client.get_subscription_details() assert subs is not None diff --git a/homeassistant/components/webmin/config_flow.py b/homeassistant/components/webmin/config_flow.py index 64f8c684dfa..903d6c50a09 100644 --- a/homeassistant/components/webmin/config_flow.py +++ b/homeassistant/components/webmin/config_flow.py @@ -45,7 +45,7 @@ async def validate_user_input( raise SchemaFlowError("invalid_auth") from err raise SchemaFlowError("cannot_connect") from err except Fault as fault: - LOGGER.exception(f"Fault {fault.faultCode}: {fault.faultString}") + LOGGER.exception("Fault %s: %s", fault.faultCode, fault.faultString) raise SchemaFlowError("unknown") from fault except ClientConnectionError as err: raise SchemaFlowError("cannot_connect") from err