Bump go2rtc-client to 0.0.1b2 ()

pull/129391/head
Robert Resch 2024-10-29 10:45:00 +01:00 committed by GitHub
parent 2de161ce0e
commit 1f03c140f5
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
6 changed files with 33 additions and 31 deletions

View File

@ -163,17 +163,15 @@ class WebRTCProvider(CameraWebRTCProvider):
case WebRTCCandidate():
value = HAWebRTCCandidate(message.candidate)
case WebRTCAnswer():
value = HAWebRTCAnswer(message.answer)
value = HAWebRTCAnswer(message.sdp)
case WsError():
value = WebRTCError("go2rtc_webrtc_offer_failed", message.error)
case _:
_LOGGER.warning("Unknown message %s", message)
return
send_message(value)
ws_client.subscribe(on_messages)
await ws_client.send(WebRTCOffer(offer_sdp))
config = camera.async_get_webrtc_client_configuration()
await ws_client.send(WebRTCOffer(offer_sdp, config.configuration.ice_servers))
async def async_on_webrtc_candidate(self, session_id: str, candidate: str) -> None:
"""Handle the WebRTC candidate."""

View File

@ -7,5 +7,5 @@
"documentation": "https://www.home-assistant.io/integrations/go2rtc",
"integration_type": "system",
"iot_class": "local_polling",
"requirements": ["go2rtc-client==0.0.1b1"]
"requirements": ["go2rtc-client==0.0.1b2"]
}

View File

@ -26,7 +26,7 @@ ciso8601==2.3.1
cryptography==43.0.1
dbus-fast==2.24.3
fnv-hash-fast==1.0.2
go2rtc-client==0.0.1b1
go2rtc-client==0.0.1b2
ha-av==10.1.1
ha-ffmpeg==3.2.1
habluetooth==3.6.0

View File

@ -986,7 +986,7 @@ gitterpy==0.1.7
glances-api==0.8.0
# homeassistant.components.go2rtc
go2rtc-client==0.0.1b1
go2rtc-client==0.0.1b2
# homeassistant.components.goalzero
goalzero==0.2.2

View File

@ -836,7 +836,7 @@ gios==5.0.0
glances-api==0.8.0
# homeassistant.components.go2rtc
go2rtc-client==0.0.1b1
go2rtc-client==0.0.1b2
# homeassistant.components.goalzero
goalzero==0.2.2

View File

@ -196,7 +196,12 @@ async def _test_setup_and_signaling(
await camera.async_handle_async_webrtc_offer(
OFFER_SDP, "session_id", receive_message_callback
)
ws_client.send.assert_called_once_with(WebRTCOffer(OFFER_SDP))
ws_client.send.assert_called_once_with(
WebRTCOffer(
OFFER_SDP,
camera.async_get_webrtc_client_configuration().configuration.ice_servers,
)
)
ws_client.subscribe.assert_called_once()
# Simulate the answer from the go2rtc server
@ -303,11 +308,17 @@ async def message_callbacks(
) -> Callbacks:
"""Prepare and return receive message callback."""
receive_callback = Mock(spec_set=WebRTCSendMessage)
camera = init_test_integration
await init_test_integration.async_handle_async_webrtc_offer(
await camera.async_handle_async_webrtc_offer(
OFFER_SDP, "session_id", receive_callback
)
ws_client.send.assert_called_once_with(WebRTCOffer(OFFER_SDP))
ws_client.send.assert_called_once_with(
WebRTCOffer(
OFFER_SDP,
camera.async_get_webrtc_client_configuration().configuration.ice_servers,
)
)
ws_client.subscribe.assert_called_once()
# Simulate messages from the go2rtc server
@ -346,23 +357,6 @@ async def test_receiving_messages_from_go2rtc_server(
on_message.assert_called_once_with(expected_message)
@pytest.mark.usefixtures("init_integration")
async def test_receiving_unknown_message_from_go2rtc_server(
message_callbacks: Callbacks,
caplog: pytest.LogCaptureFixture,
) -> None:
"""Test receiving unknown message from go2rtc server."""
on_message, send_message = message_callbacks
send_message({"type": "unknown"})
on_message.assert_not_called()
assert (
"homeassistant.components.go2rtc",
logging.WARNING,
"Unknown message {'type': 'unknown'}",
) in caplog.record_tuples
@pytest.mark.usefixtures("init_integration")
async def test_on_candidate(
ws_client: Mock,
@ -386,7 +380,12 @@ async def test_on_candidate(
await init_test_integration.async_handle_async_webrtc_offer(
OFFER_SDP, session_id, Mock()
)
ws_client.send.assert_called_once_with(WebRTCOffer(OFFER_SDP))
ws_client.send.assert_called_once_with(
WebRTCOffer(
OFFER_SDP,
camera.async_get_webrtc_client_configuration().configuration.ice_servers,
)
)
ws_client.reset_mock()
await camera.async_on_webrtc_candidate(session_id, "candidate")
@ -412,7 +411,12 @@ async def test_close_session(
await init_test_integration.async_handle_async_webrtc_offer(
OFFER_SDP, session_id, Mock()
)
ws_client.send.assert_called_once_with(WebRTCOffer(OFFER_SDP))
ws_client.send.assert_called_once_with(
WebRTCOffer(
OFFER_SDP,
camera.async_get_webrtc_client_configuration().configuration.ice_servers,
)
)
# Close session
camera.close_webrtc_session(session_id)