1
mirror of https://github.com/home-assistant/core synced 2024-08-02 23:40:32 +02:00

Fix rtsp-to-webrtc bug in calling client library (#64502)

This commit is contained in:
Allen Porter 2022-01-20 00:44:04 -08:00 committed by GitHub
parent dc7231492e
commit 09920f5303
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 8 additions and 1 deletions

View File

@ -67,7 +67,7 @@ async def async_setup_entry(hass: HomeAssistant, entry: ConfigEntry) -> bool:
"""
try:
async with async_timeout.timeout(TIMEOUT):
return await client.offer_stream_id(offer_sdp, stream_source, stream_id)
return await client.offer_stream_id(stream_id, offer_sdp, stream_source)
except TimeoutError as err:
raise HomeAssistantError("Timeout talking to RTSPtoWebRTC server") from err
except ClientError as err:

View File

@ -175,6 +175,13 @@ async def test_offer_for_stream_source(
assert response["result"].get("answer") == ANSWER_SDP
assert "error" not in response
# Validate request parameters were sent correctly
assert len(aioclient_mock.mock_calls) == 1
assert aioclient_mock.mock_calls[-1][2] == {
"sdp64": base64.b64encode(OFFER_SDP.encode("utf-8")).decode("utf-8"),
"url": STREAM_SOURCE,
}
async def test_offer_failure(
hass: HomeAssistant,