mirror of
https://github.com/home-assistant/core.git
synced 2025-07-19 11:17:21 +00:00
Bump go2rtc-client to 0.0.1b2 (#129395)
This commit is contained in:
parent
2de161ce0e
commit
1f03c140f5
@ -163,17 +163,15 @@ class WebRTCProvider(CameraWebRTCProvider):
|
|||||||
case WebRTCCandidate():
|
case WebRTCCandidate():
|
||||||
value = HAWebRTCCandidate(message.candidate)
|
value = HAWebRTCCandidate(message.candidate)
|
||||||
case WebRTCAnswer():
|
case WebRTCAnswer():
|
||||||
value = HAWebRTCAnswer(message.answer)
|
value = HAWebRTCAnswer(message.sdp)
|
||||||
case WsError():
|
case WsError():
|
||||||
value = WebRTCError("go2rtc_webrtc_offer_failed", message.error)
|
value = WebRTCError("go2rtc_webrtc_offer_failed", message.error)
|
||||||
case _:
|
|
||||||
_LOGGER.warning("Unknown message %s", message)
|
|
||||||
return
|
|
||||||
|
|
||||||
send_message(value)
|
send_message(value)
|
||||||
|
|
||||||
ws_client.subscribe(on_messages)
|
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:
|
async def async_on_webrtc_candidate(self, session_id: str, candidate: str) -> None:
|
||||||
"""Handle the WebRTC candidate."""
|
"""Handle the WebRTC candidate."""
|
||||||
|
@ -7,5 +7,5 @@
|
|||||||
"documentation": "https://www.home-assistant.io/integrations/go2rtc",
|
"documentation": "https://www.home-assistant.io/integrations/go2rtc",
|
||||||
"integration_type": "system",
|
"integration_type": "system",
|
||||||
"iot_class": "local_polling",
|
"iot_class": "local_polling",
|
||||||
"requirements": ["go2rtc-client==0.0.1b1"]
|
"requirements": ["go2rtc-client==0.0.1b2"]
|
||||||
}
|
}
|
||||||
|
@ -26,7 +26,7 @@ ciso8601==2.3.1
|
|||||||
cryptography==43.0.1
|
cryptography==43.0.1
|
||||||
dbus-fast==2.24.3
|
dbus-fast==2.24.3
|
||||||
fnv-hash-fast==1.0.2
|
fnv-hash-fast==1.0.2
|
||||||
go2rtc-client==0.0.1b1
|
go2rtc-client==0.0.1b2
|
||||||
ha-av==10.1.1
|
ha-av==10.1.1
|
||||||
ha-ffmpeg==3.2.1
|
ha-ffmpeg==3.2.1
|
||||||
habluetooth==3.6.0
|
habluetooth==3.6.0
|
||||||
|
@ -986,7 +986,7 @@ gitterpy==0.1.7
|
|||||||
glances-api==0.8.0
|
glances-api==0.8.0
|
||||||
|
|
||||||
# homeassistant.components.go2rtc
|
# homeassistant.components.go2rtc
|
||||||
go2rtc-client==0.0.1b1
|
go2rtc-client==0.0.1b2
|
||||||
|
|
||||||
# homeassistant.components.goalzero
|
# homeassistant.components.goalzero
|
||||||
goalzero==0.2.2
|
goalzero==0.2.2
|
||||||
|
@ -836,7 +836,7 @@ gios==5.0.0
|
|||||||
glances-api==0.8.0
|
glances-api==0.8.0
|
||||||
|
|
||||||
# homeassistant.components.go2rtc
|
# homeassistant.components.go2rtc
|
||||||
go2rtc-client==0.0.1b1
|
go2rtc-client==0.0.1b2
|
||||||
|
|
||||||
# homeassistant.components.goalzero
|
# homeassistant.components.goalzero
|
||||||
goalzero==0.2.2
|
goalzero==0.2.2
|
||||||
|
@ -196,7 +196,12 @@ async def _test_setup_and_signaling(
|
|||||||
await camera.async_handle_async_webrtc_offer(
|
await camera.async_handle_async_webrtc_offer(
|
||||||
OFFER_SDP, "session_id", receive_message_callback
|
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()
|
ws_client.subscribe.assert_called_once()
|
||||||
|
|
||||||
# Simulate the answer from the go2rtc server
|
# Simulate the answer from the go2rtc server
|
||||||
@ -303,11 +308,17 @@ async def message_callbacks(
|
|||||||
) -> Callbacks:
|
) -> Callbacks:
|
||||||
"""Prepare and return receive message callback."""
|
"""Prepare and return receive message callback."""
|
||||||
receive_callback = Mock(spec_set=WebRTCSendMessage)
|
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
|
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()
|
ws_client.subscribe.assert_called_once()
|
||||||
|
|
||||||
# Simulate messages from the go2rtc server
|
# 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)
|
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")
|
@pytest.mark.usefixtures("init_integration")
|
||||||
async def test_on_candidate(
|
async def test_on_candidate(
|
||||||
ws_client: Mock,
|
ws_client: Mock,
|
||||||
@ -386,7 +380,12 @@ async def test_on_candidate(
|
|||||||
await init_test_integration.async_handle_async_webrtc_offer(
|
await init_test_integration.async_handle_async_webrtc_offer(
|
||||||
OFFER_SDP, session_id, Mock()
|
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()
|
ws_client.reset_mock()
|
||||||
|
|
||||||
await camera.async_on_webrtc_candidate(session_id, "candidate")
|
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(
|
await init_test_integration.async_handle_async_webrtc_offer(
|
||||||
OFFER_SDP, session_id, Mock()
|
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
|
# Close session
|
||||||
camera.close_webrtc_session(session_id)
|
camera.close_webrtc_session(session_id)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user