Merge both stun server into one as it's the same server only on a different port (#130019)

Co-authored-by: epenet <6771947+epenet@users.noreply.github.com>
pull/127409/head
Robert Resch 2024-11-08 08:22:47 +01:00 committed by GitHub
parent 2b7d593ebe
commit d1dab83f10
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 18 additions and 6 deletions

View File

@ -421,8 +421,12 @@ async def async_setup(hass: HomeAssistant, config: ConfigType) -> bool:
if hass.config.webrtc.ice_servers:
return hass.config.webrtc.ice_servers
return [
RTCIceServer(urls="stun:stun.home-assistant.io:80"),
RTCIceServer(urls="stun:stun.home-assistant.io:3478"),
RTCIceServer(
urls=[
"stun:stun.home-assistant.io:80",
"stun:stun.home-assistant.io:3478",
]
),
]
async_register_ice_servers(hass, get_ice_servers)

View File

@ -296,8 +296,12 @@ async def test_ws_get_client_config(
assert msg["result"] == {
"configuration": {
"iceServers": [
{"urls": "stun:stun.home-assistant.io:80"},
{"urls": "stun:stun.home-assistant.io:3478"},
{
"urls": [
"stun:stun.home-assistant.io:80",
"stun:stun.home-assistant.io:3478",
]
},
],
},
"getCandidatesUpfront": False,
@ -326,8 +330,12 @@ async def test_ws_get_client_config(
assert msg["result"] == {
"configuration": {
"iceServers": [
{"urls": "stun:stun.home-assistant.io:80"},
{"urls": "stun:stun.home-assistant.io:3478"},
{
"urls": [
"stun:stun.home-assistant.io:80",
"stun:stun.home-assistant.io:3478",
]
},
{
"urls": ["stun:example2.com", "turn:example2.com"],
"username": "user",