Skip to content

Commit 28b8946

Browse files
Remove child device gates
This driver does not support creating child devices, and any child device would be prevented from using this driver due to the logic in is_third_reality_mk1, so the additional gates in other functions can be removed.
1 parent bc937cc commit 28b8946

File tree

1 file changed

+4
-10
lines changed
  • drivers/SmartThings/matter-switch/src/third-reality-mk1

1 file changed

+4
-10
lines changed

drivers/SmartThings/matter-switch/src/third-reality-mk1/init.lua

Lines changed: 4 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -85,10 +85,8 @@ local function build_button_component_map(device)
8585
end
8686

8787
local function device_init(driver, device)
88-
if device.network_type == device_lib.NETWORK_TYPE_MATTER then
89-
device:set_endpoint_to_component_fn(endpoint_to_component)
90-
subscribe(device)
91-
end
88+
device:set_endpoint_to_component_fn(endpoint_to_component)
89+
subscribe(device)
9290
end
9391

9492
local function device_added(driver, device)
@@ -109,15 +107,11 @@ local function match_profile(driver, device)
109107
end
110108

111109
local function do_configure(driver, device)
112-
if device.network_type == device_lib.NETWORK_TYPE_MATTER then
113-
match_profile(driver, device)
114-
end
110+
match_profile(driver, device)
115111
end
116112

117113
local function driver_switched(driver, device)
118-
if device.network_type == device_lib.NETWORK_TYPE_MATTER then
119-
match_profile(driver, device)
120-
end
114+
match_profile(driver, device)
121115
end
122116

123117
local function initial_press_event_handler(driver, device, ib, response)

0 commit comments

Comments
 (0)