File tree Expand file tree Collapse file tree 2 files changed +30
-2
lines changed
homeassistant/components/unifiprotect
tests/components/unifiprotect Expand file tree Collapse file tree 2 files changed +30
-2
lines changed Original file line number Diff line number Diff line change @@ -92,7 +92,11 @@ def _get_camera_channels(
9292
9393 # no RTSP enabled use first channel with no stream
9494 if is_default and not camera .is_third_party_camera :
95- _create_rtsp_repair (hass , entry , data , camera )
95+ # Only create repair issue if RTSP is not disabled globally
96+ if not data .disable_stream :
97+ _create_rtsp_repair (hass , entry , data , camera )
98+ else :
99+ ir .async_delete_issue (hass , DOMAIN , f"rtsp_disabled_{ camera .id } " )
96100 yield camera , camera .channels [0 ], True
97101 else :
98102 ir .async_delete_issue (hass , DOMAIN , f"rtsp_disabled_{ camera .id } " )
Original file line number Diff line number Diff line change 77
88from uiprotect .data import Camera , CloudAccount , Version
99
10- from homeassistant .components .unifiprotect .const import DOMAIN
10+ from homeassistant .components .unifiprotect .const import CONF_DISABLE_RTSP , DOMAIN
1111from homeassistant .config_entries import SOURCE_REAUTH
1212from homeassistant .core import HomeAssistant
13+ from homeassistant .helpers import issue_registry as ir
1314
1415from .utils import MockUFPFixture , init_entry
1516
@@ -282,3 +283,26 @@ async def test_rtsp_no_fix_if_third_party(
282283
283284 assert msg ["success" ]
284285 assert not msg ["result" ]["issues" ]
286+
287+
288+ async def test_rtsp_no_fix_if_globally_disabled (
289+ hass : HomeAssistant ,
290+ ufp : MockUFPFixture ,
291+ doorbell : Camera ,
292+ issue_registry : ir .IssueRegistry ,
293+ ) -> None :
294+ """Test no RTSP disabled warning if RTSP is globally disabled on integration."""
295+
296+ for channel in doorbell .channels :
297+ channel .is_rtsp_enabled = False
298+
299+ # Set RTSP globally disabled in config entry options
300+ hass .config_entries .async_update_entry (
301+ ufp .entry ,
302+ options = {** ufp .entry .options , CONF_DISABLE_RTSP : True },
303+ )
304+
305+ await init_entry (hass , ufp , [doorbell ])
306+ await async_process_repairs_platforms (hass )
307+
308+ assert len (issue_registry .issues ) == 0
You can’t perform that action at this time.
0 commit comments