Skip to content

Commit 3c036b3

Browse files
Don't run match_profile for child devices
1 parent ea18aff commit 3c036b3

File tree

1 file changed

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

1 file changed

+6
-5
lines changed

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

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -721,9 +721,6 @@ local function device_init(driver, device)
721721
end
722722

723723
local function match_profile(driver, device)
724-
if detect_bridge(device) then
725-
return
726-
end
727724
local main_endpoint = find_default_endpoint(device)
728725
-- initialize the main device card with buttons if applicable, and create child devices as needed for multi-switch devices.
729726
local profile_found = initialize_buttons_and_switches(driver, device, main_endpoint)
@@ -765,11 +762,15 @@ local function match_profile(driver, device)
765762
end
766763

767764
local function do_configure(driver, device)
768-
match_profile(driver, device)
765+
if device.network_type == device_lib.NETWORK_TYPE_MATTER and not detect_bridge(device) then
766+
match_profile(driver, device)
767+
end
769768
end
770769

771770
local function driver_switched(driver, device)
772-
match_profile(driver, device)
771+
if device.network_type == device_lib.NETWORK_TYPE_MATTER and not detect_bridge(device) then
772+
match_profile(driver, device)
773+
end
773774
end
774775

775776
local function device_removed(driver, device)

0 commit comments

Comments
 (0)