Improve string formatting v5 (#33697)

* Improve string formatting v5

* Address review comments
This commit is contained in:
springstan 2020-04-05 17:48:55 +02:00 committed by GitHub
parent 39336d3ea3
commit fca90a8ddc
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
46 changed files with 221 additions and 252 deletions

View file

@ -219,15 +219,16 @@ class HassEzvizCamera(Camera):
ffmpeg = ImageFrame(self._ffmpeg.binary, loop=self.hass.loop)
image = await asyncio.shield(
ffmpeg.get_image(self._rtsp_stream, output_format=IMAGE_JPEG,)
ffmpeg.get_image(self._rtsp_stream, output_format=IMAGE_JPEG)
)
return image
async def stream_source(self):
"""Return the stream source."""
if self._local_rtsp_port:
rtsp_stream_source = "rtsp://{}:{}@{}:{}".format(
self._username, self._password, self._local_ip, self._local_rtsp_port
rtsp_stream_source = (
f"rtsp://{self._username}:{self._password}@"
f"{self._local_ip}:{self._local_rtsp_port}"
)
_LOGGER.debug(
"Camera %s source stream: %s", self._serial, rtsp_stream_source