Add camera websocket endpoint for ICE servers#157489
Conversation
|
Hey there @home-assistant/core, mind taking a look at this pull request as it has been labeled with an integration ( Code owner commandsCode owners of
|
There was a problem hiding this comment.
Pull request overview
This PR adds a new WebSocket command camera/webrtc/ice_servers that returns all registered ICE servers for WebRTC connections. This endpoint is simpler than the existing camera/webrtc/get_client_config command as it doesn't require a specific camera entity and returns only ICE servers without the full WebRTC client configuration.
Key changes:
- New WebSocket endpoint for retrieving ICE servers without requiring a camera entity
- Comprehensive test coverage for the new endpoint including multiple ICE server scenarios
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
homeassistant/components/camera/webrtc.py |
Adds ws_ice_servers WebSocket command handler that retrieves and returns all registered ICE servers from hass.data, and registers it in async_register_ws |
tests/components/camera/test_webrtc.py |
Adds comprehensive test coverage for the new ICE servers endpoint, testing both default servers and dynamically registered servers |
|
I'm missing some background to this PR and how it fits in to the bigger picture. Maybe an actual use case example could help? What other services are we talking about and why do they need a simpler endpoint? |
|
Current driver is Music Assistant to push the music data directly to Home Assistant users. |
|
If it's not cameras that will be involved anymore, maybe this websocket command and endpoint should not belong to the camera integration? |
Breaking change
Proposed change
Add a new
camera/webrtc/ice_serversWebSocket command that returns all registered ICE servers. This endpoint is simpler than the existingcamera/webrtc/get_client_configas it doesn't require a specific camera entity and returns only the ICE servers without the full WebRTC client configuration.This endpoint can be used by other services that want to offer WebRTC like Music Assistant.
Type of change
Additional information
Checklist
ruff format homeassistant tests)If user exposed functionality or configuration variables are added/changed:
If the code communicates with devices, web services, or third-party tools:
Updated and included derived files by running:
python3 -m script.hassfest.requirements_all.txt.Updated by running
python3 -m script.gen_requirements_all.To help with the load of incoming pull requests: