Improve string formatting v5 (#33697)

* Improve string formatting v5

* Address review comments
This commit is contained in:
springstan authored and GitHub committed 2020-04-05 17:48:55 +02:00
1 parent 39336d3ea3
commit fca90a8ddc
46 files changed
+221 -252

No files matched your search

+3 -8
View File
@@ -110,14 +110,9 @@ class YiCamera(Camera):
await ftp.quit()
self._is_on = True
return "ftp://{}:{}@{}:{}{}/{}/{}".format(
self.user,
self.passwd,
self.host,
self.port,
self.path,
latest_dir,
videos[-1],
return (
f"ftp://{self.user}:{self.passwd}@{self.host}:"
f"{self.port}{self.path}/{latest_dir}/{videos[-1]}"
)
except (ConnectionRefusedError, StatusCodeError) as err:
_LOGGER.error("Error while fetching video: %s", err)