Avoid fetching both unifiprotect RTSP urls (#94978)

This commit is contained in:
J. Nick Koston 2023-06-21 15:14:57 +02:00 committed by GitHub
parent f9366e5cc7
commit e24c2ae55c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -167,9 +167,8 @@ class ProtectCamera(ProtectDeviceEntity, Camera):
if not self.channel.is_rtsp_enabled:
disable_stream = False
rtsp_url = self.channel.rtsp_url
if self._secure:
rtsp_url = self.channel.rtsps_url
channel = self.channel
rtsp_url = channel.rtsps_url if self._secure else channel.rtsp_url
# _async_set_stream_source called by __init__
self._stream_source = ( # pylint: disable=attribute-defined-outside-init