Deprecate async_register_rtsp_to_web_rtc_provider (#131462)
parent
43e467a309
commit
1c2e86d824
|
@ -23,6 +23,7 @@ from homeassistant.components import websocket_api
|
|||
from homeassistant.core import HomeAssistant, callback
|
||||
from homeassistant.exceptions import HomeAssistantError
|
||||
from homeassistant.helpers import config_validation as cv, issue_registry as ir
|
||||
from homeassistant.helpers.deprecation import deprecated_function
|
||||
from homeassistant.util.hass_dict import HassKey
|
||||
from homeassistant.util.ulid import ulid
|
||||
|
||||
|
@ -445,6 +446,7 @@ class _CameraRtspToWebRTCProvider(CameraWebRTCLegacyProvider):
|
|||
return await self._fn(stream_source, offer_sdp, camera.entity_id)
|
||||
|
||||
|
||||
@deprecated_function("async_register_webrtc_provider", breaks_in_ha_version="2025.6")
|
||||
def async_register_rtsp_to_web_rtc_provider(
|
||||
hass: HomeAssistant,
|
||||
domain: str,
|
||||
|
|
|
@ -428,10 +428,16 @@ async def provide_webrtc_answer(stream_source: str, offer: str, stream_id: str)
|
|||
|
||||
|
||||
@pytest.fixture(name="mock_rtsp_to_webrtc")
|
||||
def mock_rtsp_to_webrtc_fixture(hass: HomeAssistant) -> Generator[Mock]:
|
||||
def mock_rtsp_to_webrtc_fixture(
|
||||
hass: HomeAssistant, caplog: pytest.LogCaptureFixture
|
||||
) -> Generator[Mock]:
|
||||
"""Fixture that registers a mock rtsp to webrtc provider."""
|
||||
mock_provider = Mock(side_effect=provide_webrtc_answer)
|
||||
unsub = async_register_rtsp_to_web_rtc_provider(hass, "mock_domain", mock_provider)
|
||||
assert (
|
||||
"async_register_rtsp_to_web_rtc_provider is a deprecated function which will"
|
||||
" be removed in HA Core 2025.6. Use async_register_webrtc_provider instead"
|
||||
) in caplog.text
|
||||
yield mock_provider
|
||||
unsub()
|
||||
|
||||
|
|
Loading…
Reference in New Issue