1
0
mirror of https://github.com/home-assistant/core.git synced 2025-12-24 21:06:19 +00:00

Use literal string interpolation in integrations X-Z (f-strings) (#26395)

This commit is contained in:
Franck Nijhof
2019-09-03 21:15:31 +02:00
committed by Pascal Vizeli
parent 445c741b30
commit dae6895a95
36 changed files with 115 additions and 137 deletions

View File

@@ -87,12 +87,12 @@ class XmppNotificationService(BaseNotificationService):
async def async_send_message(self, message="", **kwargs):
"""Send a message to a user."""
title = kwargs.get(ATTR_TITLE, ATTR_TITLE_DEFAULT)
text = "{}: {}".format(title, message) if title else message
text = f"{title}: {message}" if title else message
data = kwargs.get(ATTR_DATA)
timeout = data.get(ATTR_TIMEOUT, XEP_0363_TIMEOUT) if data else None
await async_send_message(
"{}/{}".format(self._sender, self._resource),
f"{self._sender}/{self._resource}",
self._password,
self._recipient,
self._tls,