Skip to content

Commit 1395f67

Browse files
Fix webrtc capability inclusion requirements (#2568)
In the matter camera subdriver, the webrtc capability should be included if the `WebRTCTransportProvider` clusters is implemented as `SERVER` and if `WebRTCTransportRequestor` is implemented as `CLIENT`; this commit adds a check for the former which is currently missing from the subdriver.
1 parent b828a5a commit 1395f67

File tree

2 files changed

+5
-4
lines changed

2 files changed

+5
-4
lines changed

drivers/SmartThings/matter-switch/src/sub_drivers/camera/camera_utils/device_configuration.lua

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,10 @@ function CameraDeviceConfiguration.match_profile(device, status_light_enabled_pr
5151

5252
local camera_endpoints = switch_utils.get_endpoints_by_device_type(device, fields.DEVICE_TYPE_ID.CAMERA)
5353
if #camera_endpoints > 0 then
54+
if #device:get_endpoints(clusters.WebRTCTransportProvider.ID, {cluster_type = "SERVER"}) > 0 and
55+
#device:get_endpoints(clusters.WebRTCTransportRequestor.ID, {cluster_type = "CLIENT"}) > 0 then
56+
table.insert(main_component_capabilities, capabilities.webrtc.ID)
57+
end
5458
local camera_ep = switch_utils.get_endpoint_info(device, camera_endpoints[1])
5559
for _, ep_cluster in pairs(camera_ep.clusters or {}) do
5660
if ep_cluster.cluster_id == clusters.CameraAvStreamManagement.ID then
@@ -102,9 +106,6 @@ function CameraDeviceConfiguration.match_profile(device, status_light_enabled_pr
102106
table.insert(main_component_capabilities, capabilities.zoneManagement.ID)
103107
elseif ep_cluster.cluster_id == clusters.OccupancySensing.ID then
104108
table.insert(main_component_capabilities, capabilities.motionSensor.ID)
105-
elseif ep_cluster.cluster_id == clusters.WebRTCTransportProvider.ID and
106-
#device:get_endpoints(clusters.WebRTCTransportRequestor.ID, {cluster_type = "CLIENT"}) > 0 then
107-
table.insert(main_component_capabilities, capabilities.webrtc.ID)
108109
end
109110
end
110111
end

drivers/SmartThings/matter-switch/src/test/test_matter_camera.lua

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -156,6 +156,7 @@ local function update_device_profile()
156156
{
157157
"main",
158158
{
159+
"webrtc",
159160
"videoCapture2",
160161
"cameraViewportSettings",
161162
"localMediaStorage",
@@ -167,7 +168,6 @@ local function update_device_profile()
167168
"mechanicalPanTiltZoom",
168169
"videoStreamSettings",
169170
"zoneManagement",
170-
"webrtc",
171171
"motionSensor",
172172
"sounds",
173173
}

0 commit comments

Comments
 (0)