Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -220,10 +220,10 @@ function DeviceConfiguration.match_profile(driver, device)
local generic_profile = function(s) return string.find(updated_profile or "", s, 1, true) end
if generic_profile("light-level") and #device:get_endpoints(clusters.OccupancySensing.ID) > 0 then
updated_profile = "light-level-motion"
elseif generic_profile("plug-binary") or generic_profile("plug-level") then
if switch_utils.check_switch_category_vendor_overrides(device) then
updated_profile = string.gsub(updated_profile, "plug", "switch")
end
elseif switch_utils.check_switch_category_vendor_overrides(device) then
-- check whether the overwrite should be over "plug" or "light" based on the current profile
local overwrite_category = string.find(updated_profile, "plug") and "plug" or "light"
updated_profile = string.gsub(updated_profile, overwrite_category, "switch")
elseif generic_profile("light-level-colorTemperature") or generic_profile("light-color-level") then
-- ignore attempts to dynamically profile light-level-colorTemperature and light-color-level devices for now, since
-- these may lose fingerprinted Kelvin ranges when dynamically profiled.
Expand Down
2 changes: 2 additions & 0 deletions drivers/SmartThings/matter-switch/src/switch_utils/fields.lua
Original file line number Diff line number Diff line change
Expand Up @@ -114,6 +114,8 @@ SwitchFields.switch_category_vendor_overrides = {
{0x007D, 0x0074, 0x0075},
[0x1372] = -- Innovation Matters
{0x0002},
[0x1189] = -- Ledvance
{0x0891, 0x0892},
[0x1021] = -- Legrand
{0x0005},
[0x109B] = -- Leviton
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -265,7 +265,7 @@ local function test_init_parent_child_endpoints_non_sequential()
test.socket.matter:__expect_send({unsup_mock_device.id, clusters.LevelControl.attributes.Options:write(unsup_mock_device, child2_ep_non_sequential, clusters.LevelControl.types.OptionsBitmap.EXECUTE_IF_OFF)})
test.socket.matter:__expect_send({unsup_mock_device.id, clusters.ColorControl.attributes.Options:write(unsup_mock_device, child2_ep_non_sequential, clusters.ColorControl.types.OptionsBitmap.EXECUTE_IF_OFF)})

unsup_mock_device:expect_metadata_update({ profile = "light-binary" })
unsup_mock_device:expect_metadata_update({ profile = "switch-binary" })
unsup_mock_device:expect_metadata_update({ provisioning_state = "PROVISIONED" })

for _, child in pairs(mock_children_non_sequential) do
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -258,7 +258,7 @@ local function test_init_parent_child_endpoints_non_sequential()
test.socket.matter:__expect_send({mock_device_parent_child_endpoints_non_sequential.id, clusters.LevelControl.attributes.Options:write(mock_device_parent_child_endpoints_non_sequential, child1_ep_non_sequential, clusters.LevelControl.types.OptionsBitmap.EXECUTE_IF_OFF)})
test.socket.matter:__expect_send({mock_device_parent_child_endpoints_non_sequential.id, clusters.LevelControl.attributes.Options:write(mock_device_parent_child_endpoints_non_sequential, child2_ep_non_sequential, clusters.LevelControl.types.OptionsBitmap.EXECUTE_IF_OFF)})
test.socket.matter:__expect_send({mock_device_parent_child_endpoints_non_sequential.id, clusters.ColorControl.attributes.Options:write(mock_device_parent_child_endpoints_non_sequential, child2_ep_non_sequential, clusters.ColorControl.types.OptionsBitmap.EXECUTE_IF_OFF)})
mock_device_parent_child_endpoints_non_sequential:expect_metadata_update({ profile = "light-binary" })
mock_device_parent_child_endpoints_non_sequential:expect_metadata_update({ profile = "switch-binary" })
mock_device_parent_child_endpoints_non_sequential:expect_metadata_update({ provisioning_state = "PROVISIONED" })

for _, child in pairs(mock_children_non_sequential) do
Expand Down
Loading