Skip to content

Commit

Permalink
Merge pull request #1205 from SmartThingsCommunity/bugfix/handle-mult…
Browse files Browse the repository at this point in the history
…i-on-off-light-switches

Matter Switch: add handling for multi-On/Off Light Switch device types
  • Loading branch information
ctowns authored Feb 13, 2024
2 parents e4e56c5 + b3be835 commit 0f9db39
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions drivers/SmartThings/matter-switch/src/init.lua
Original file line number Diff line number Diff line change
Expand Up @@ -85,14 +85,14 @@ local function initialize_switch(driver, device)
end

device:set_field(SWITCH_INITIALIZED, true)
-- The case where num_server_eps == 1 is a workaround for devices that have the On/Off
-- The case where num_server_eps > 0 is a workaround for devices that have the On/Off
-- Light Switch device type but implement the On Off cluster as server (which is against the spec
-- for this device type). By default, we do not support On/Off Light Switch because by spec these
-- devices need bindings to work correctly (On/Off cluster is client in this case), so this device type
-- does not have a generic fingerprint and will join as a matter-thing. However, we have
-- seen some devices claim to be On/Off Light Switch device type and still implement On/Off server, so this
-- is a workaround for those devices.
if num_server_eps == 1 and detect_matter_thing(device) == true then
if num_server_eps > 0 and detect_matter_thing(device) == true then
device:try_update_metadata({profile = "switch-binary"})
end
end
Expand Down

0 comments on commit 0f9db39

Please sign in to comment.