Skip to content

Commit 23a2b6d

Browse files
Update compare_components function name
1 parent 88d7861 commit 23a2b6d

File tree

1 file changed

+6
-6
lines changed
  • drivers/SmartThings/matter-switch/src/sub_drivers/camera

1 file changed

+6
-6
lines changed

drivers/SmartThings/matter-switch/src/sub_drivers/camera/init.lua

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -209,22 +209,22 @@ local function compute_fps(max_encoded_pixel_rate, width, height, max_fps)
209209
return math.tointeger(math.floor(fps / fps_step) * fps_step)
210210
end
211211

212-
local function compare_components(synced_components, prev_components)
212+
local function profile_changed(synced_components, prev_components)
213213
if #synced_components ~= #prev_components then
214-
return false
214+
return true
215215
end
216216
for _, component in pairs(synced_components) do
217217
if (prev_components[component.id] == nil) or
218218
(#component.capabilities ~= #prev_components[component.id].capabilities) then
219-
return false
219+
return true
220220
end
221221
for _, capability in pairs(component.capabilities) do
222222
if prev_components[component.id][capability.id] == nil then
223-
return false
223+
return true
224224
end
225225
end
226226
end
227-
return true
227+
return false
228228
end
229229

230230
local function optional_capabilities_list_changed(optional_capabilities, prev_component_list)
@@ -588,7 +588,7 @@ end
588588

589589
local function info_changed(driver, device, event, args)
590590
-- resubscribe and initialize relevant camera capabilities if a modular update has occurred
591-
if not compare_components(device.profile.components, args.old_st_store.profile.components) then
591+
if profile_changed(device.profile.components, args.old_st_store.profile.components) then
592592
initialize_camera_capabilities(device)
593593
add_camera_subscribed_attributes(device)
594594
device:subscribe()

0 commit comments

Comments
 (0)