Skip to content

Commit

Permalink
Combine short strings in components (home-assistant#135265)
Browse files Browse the repository at this point in the history
  • Loading branch information
epenet authored Jan 10, 2025
1 parent 024b9ae commit aa741a9
Show file tree
Hide file tree
Showing 7 changed files with 7 additions and 23 deletions.
3 changes: 1 addition & 2 deletions homeassistant/components/mqtt/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -220,8 +220,7 @@ def async_subscribe_internal(
mqtt_data = hass.data[DATA_MQTT]
except KeyError as exc:
raise HomeAssistantError(
f"Cannot subscribe to topic '{topic}', "
"make sure MQTT is set up correctly",
f"Cannot subscribe to topic '{topic}', make sure MQTT is set up correctly",
translation_key="mqtt_not_setup_cannot_subscribe",
translation_domain=DOMAIN,
translation_placeholders={"topic": topic},
Expand Down
2 changes: 1 addition & 1 deletion homeassistant/components/mqtt/event.py
Original file line number Diff line number Diff line change
Expand Up @@ -151,7 +151,7 @@ def _event_received(self, msg: ReceiveMessage) -> None:
)
except KeyError:
_LOGGER.warning(
("`event_type` missing in JSON event payload, " " '%s' on topic %s"),
"`event_type` missing in JSON event payload, '%s' on topic %s",
payload,
msg.topic,
)
Expand Down
5 changes: 1 addition & 4 deletions homeassistant/components/mqtt/siren.py
Original file line number Diff line number Diff line change
Expand Up @@ -217,10 +217,7 @@ def _state_message_received(self, msg: ReceiveMessage) -> None:
try:
json_payload = json_loads_object(payload)
_LOGGER.debug(
(
"JSON payload detected after processing payload '%s' on"
" topic %s"
),
"JSON payload detected after processing payload '%s' on topic %s",
json_payload,
msg.topic,
)
Expand Down
5 changes: 1 addition & 4 deletions homeassistant/components/mqtt/update.py
Original file line number Diff line number Diff line change
Expand Up @@ -151,10 +151,7 @@ def _handle_state_message_received(self, msg: ReceiveMessage) -> None:
rendered_json_payload = json_loads(payload)
if isinstance(rendered_json_payload, dict):
_LOGGER.debug(
(
"JSON payload detected after processing payload '%s' on"
" topic %s"
),
"JSON payload detected after processing payload '%s' on topic %s",
rendered_json_payload,
msg.topic,
)
Expand Down
5 changes: 1 addition & 4 deletions homeassistant/components/recorder/migration.py
Original file line number Diff line number Diff line change
Expand Up @@ -2073,10 +2073,7 @@ def _wipe_old_string_time_columns(
session.execute(text("UPDATE events set time_fired=NULL LIMIT 100000;"))
session.commit()
session.execute(
text(
"UPDATE states set last_updated=NULL, last_changed=NULL "
" LIMIT 100000;"
)
text("UPDATE states set last_updated=NULL, last_changed=NULL LIMIT 100000;")
)
session.commit()
elif engine.dialect.name == SupportedDialect.POSTGRESQL:
Expand Down
5 changes: 1 addition & 4 deletions homeassistant/components/recorder/util.py
Original file line number Diff line number Diff line change
Expand Up @@ -927,10 +927,7 @@ def _filter_unique_constraint_integrity_error(err: Exception) -> bool:

if ignore:
_LOGGER.warning(
(
"Blocked attempt to insert duplicated %s rows, please report"
" at %s"
),
"Blocked attempt to insert duplicated %s rows, please report at %s",
row_type,
"https://github.com/home-assistant/core/issues?q=is%3Aopen+is%3Aissue+label%3A%22integration%3A+recorder%22",
exc_info=err,
Expand Down
5 changes: 1 addition & 4 deletions homeassistant/components/zwave_js/services.py
Original file line number Diff line number Diff line change
Expand Up @@ -488,10 +488,7 @@ async def async_set_config_parameter(self, service: ServiceCall) -> None:
)
if nodes_without_endpoints and _LOGGER.isEnabledFor(logging.WARNING):
_LOGGER.warning(
(
"The following nodes do not have endpoint %x and will be "
"skipped: %s"
),
"The following nodes do not have endpoint %x and will be skipped: %s",
endpoint,
nodes_without_endpoints,
)
Expand Down

0 comments on commit aa741a9

Please sign in to comment.