Disable SRTP for unifiprotect RTSPS stream (#129852)

This commit is contained in:
J. Nick Koston 2024-11-04 16:13:52 -06:00 committed by Paulus Schoutsen
parent b830f83a34
commit 3a1502e2bb
2 changed files with 4 additions and 2 deletions

View File

@ -206,7 +206,9 @@ class ProtectCamera(ProtectDeviceEntity, Camera):
def _async_set_stream_source(self) -> None:
channel = self.channel
enable_stream = not self._disable_stream and channel.is_rtsp_enabled
rtsp_url = channel.rtsps_url if self._secure else channel.rtsp_url
# SRTP disabled because go2rtc does not support it
# https://github.com/AlexxIT/go2rtc/#source-rtsp
rtsp_url = channel.rtsps_no_srtp_url if self._secure else channel.rtsp_url
source = rtsp_url if enable_stream else None
self._attr_supported_features = _ENABLE_FEATURE if source else _DISABLE_FEATURE
self._stream_source = source

View File

@ -196,7 +196,7 @@ async def validate_rtsps_camera_state(
"""Validate a camera's state."""
channel = camera_obj.channels[channel_id]
assert await async_get_stream_source(hass, entity_id) == channel.rtsps_url
assert await async_get_stream_source(hass, entity_id) == channel.rtsps_no_srtp_url
validate_common_camera_state(hass, channel, entity_id, features)