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