Skip to content

Release v2.0.0-rc2

Pre-release
Pre-release

Choose a tag to compare

@github-actions github-actions released this 17 Apr 19:58

v2.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:

  1. Coordinator (coordinator.py): When an RTC offer arrives via push WebSocket, calls signaling.set_session_from_push() to prepare the SignalingClient with the session context (session_id, tag_id, etc.)

  2. Camera (camera.py): async_handle_async_webrtc_offer() now branches:

    • Answer mode (doorbell ringing → active_call with SDP): converts the browser's SDP offer to answer format (a=setup:actpassa=setup:active) and sends it to the device via send_answer()
    • Offer mode (no active call → on-demand viewing): existing send_offer() flow preserved
  3. 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

  1. Install v2.0.0-rc2 via HACS (enable beta versions)
  2. Restart HA
  3. Ring the doorbell
  4. Open the Live Video camera entity in the HA dashboard
  5. Video should now stream (no "Max number of peers reached")

Full Changelog: v2.0.0-rc1...v2.0.0-rc2