Skip to content

Commit d5563eb

Browse files
Move init code to helper function
1 parent 7da9947 commit d5563eb

File tree

1 file changed

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

1 file changed

+6
-2
lines changed

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

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -720,7 +720,7 @@ local function device_init(driver, device)
720720
device:subscribe()
721721
end
722722

723-
local function do_configure(driver, device)
723+
local function match_profile(driver, device)
724724
if detect_bridge(device) then
725725
return
726726
end
@@ -764,8 +764,12 @@ local function do_configure(driver, device)
764764
end
765765
end
766766

767+
local function do_configure(driver, device)
768+
match_profile(driver, device)
769+
end
770+
767771
local function driver_switched(driver, device)
768-
do_configure(driver, device)
772+
match_profile(driver, device)
769773
end
770774

771775
local function device_removed(driver, device)

0 commit comments

Comments
 (0)