From e24c2ae55c875ea5017391214c63f5cbc01d36df Mon Sep 17 00:00:00 2001 From: "J. Nick Koston" Date: Wed, 21 Jun 2023 15:14:57 +0200 Subject: [PATCH] Avoid fetching both unifiprotect RTSP urls (#94978) --- homeassistant/components/unifiprotect/camera.py | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/homeassistant/components/unifiprotect/camera.py b/homeassistant/components/unifiprotect/camera.py index 00dbbe77e77..a4da77fe50b 100644 --- a/homeassistant/components/unifiprotect/camera.py +++ b/homeassistant/components/unifiprotect/camera.py @@ -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