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>
This commit is contained in:
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: if hass.config.webrtc.ice_servers:
return hass.config.webrtc.ice_servers return hass.config.webrtc.ice_servers
return [ return [
RTCIceServer(urls="stun:stun.home-assistant.io:80"), RTCIceServer(
RTCIceServer(urls="stun:stun.home-assistant.io:3478"), urls=[
"stun:stun.home-assistant.io:80",
"stun:stun.home-assistant.io:3478",
]
),
] ]
async_register_ice_servers(hass, get_ice_servers) async_register_ice_servers(hass, get_ice_servers)

View file

@ -296,8 +296,12 @@ async def test_ws_get_client_config(
assert msg["result"] == { assert msg["result"] == {
"configuration": { "configuration": {
"iceServers": [ "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, "getCandidatesUpfront": False,
@ -326,8 +330,12 @@ async def test_ws_get_client_config(
assert msg["result"] == { assert msg["result"] == {
"configuration": { "configuration": {
"iceServers": [ "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"], "urls": ["stun:example2.com", "turn:example2.com"],
"username": "user", "username": "user",