Release v2.0.0-rc2
Pre-releasev2.0.0-rc2 — Fix WebRTC "Max number of peers reached"
The Problem
When the doorbell rings, the BTicino device sends an RTC offer (SDP) via WebSocket. The camera entity was responding by sending its own offer to the device — creating a second call session. The device rejected it with "Max number of peers reached" because it already had an active outgoing call.
The Fix
The camera now correctly answers the device's existing call instead of initiating a new one:
-
Coordinator (
coordinator.py): When an RTC offer arrives via push WebSocket, callssignaling.set_session_from_push()to prepare the SignalingClient with the session context (session_id, tag_id, etc.) -
Camera (
camera.py):async_handle_async_webrtc_offer()now branches:- Answer mode (doorbell ringing →
active_callwith SDP): converts the browser's SDP offer to answer format (a=setup:actpass→a=setup:active) and sends it to the device viasend_answer() - Offer mode (no active call → on-demand viewing): existing
send_offer()flow preserved
- Answer mode (doorbell ringing →
-
No auto-answer: The camera only responds when the user explicitly opens the camera view in the HA frontend. The doorbell ring fires events and binary sensors, but no WebRTC session is started automatically.
Testing
- 113 tests passing (5 new)
- SDP conversion: actpass→active, multi-section, attribute preservation
- Answer/offer mode branching with mock signaling verification
- Full regression suite green
What to test
- Install v2.0.0-rc2 via HACS (enable beta versions)
- Restart HA
- Ring the doorbell
- Open the Live Video camera entity in the HA dashboard
- Video should now stream (no "Max number of peers reached")
Full Changelog: v2.0.0-rc1...v2.0.0-rc2