Use literal string interpolation in core (f-strings) (#26166)

This commit is contained in:
Franck Nijhof authored and Paulus Schoutsen committed 2019-08-23 09:53:33 -07:00
1 parent 1efa29d6ff
commit decf13b948
67 files changed
+180 -246

No files matched your search

+3 -3
View File
@@ -80,7 +80,7 @@ class HassIO:
This method return a coroutine.
"""
return self.send_command("/addons/{}/info".format(addon), method="get")
return self.send_command(f"/addons/{addon}/info", method="get")
@_api_data
def get_ingress_panels(self):
@@ -120,7 +120,7 @@ class HassIO:
This method return a coroutine.
"""
return self.send_command("/discovery/{}".format(uuid), method="get")
return self.send_command(f"/discovery/{uuid}", method="get")
@_api_bool
async def update_hass_api(self, http_config, refresh_token):
@@ -156,7 +156,7 @@ class HassIO:
with async_timeout.timeout(timeout):
request = await self.websession.request(
method,
"http://{}{}".format(self._ip, command),
f"http://{self._ip}{command}",
json=payload,
headers={X_HASSIO: os.environ.get("HASSIO_TOKEN", "")},
)