Skip to content

Commit

Permalink
Disable SRTP for unifiprotect RTSPS stream (#129852)
Browse files Browse the repository at this point in the history
  • Loading branch information
bdraco authored Nov 4, 2024
1 parent e5263dc commit e8c3539
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
4 changes: 3 additions & 1 deletion homeassistant/components/unifiprotect/camera.py
Original file line number Diff line number Diff line change
Expand Up @@ -206,7 +206,9 @@ def __init__(
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
Expand Down
2 changes: 1 addition & 1 deletion tests/components/unifiprotect/test_camera.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)


Expand Down

0 comments on commit e8c3539

Please sign in to comment.