Skip to content
Open
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
6 changes: 5 additions & 1 deletion drivers/SmartThings/matter-lock/src/DoorLock/init.lua
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
-- Copyright 2025 SmartThings, Inc.
-- Licensed under the Apache License, Version 2.0


local cluster_base = require "st.matter.cluster_base"
local DoorLockServerAttributes = require "DoorLock.server.attributes"
local DoorLockServerCommands = require "DoorLock.server.commands"
Expand Down Expand Up @@ -255,4 +259,4 @@ setmetatable(DoorLock.events, event_helper_mt)

setmetatable(DoorLock, {__index = cluster_base})

return DoorLock
return DoorLock
5 changes: 4 additions & 1 deletion drivers/SmartThings/matter-lock/src/DoorLock/types/init.lua
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
-- Copyright 2025 SmartThings, Inc.
-- Licensed under the Apache License, Version 2.0

local types_mt = {}
types_mt.__types_cache = {}
types_mt.__index = function(self, key)
Expand All @@ -11,4 +14,4 @@ local DoorLockTypes = {}

setmetatable(DoorLockTypes, types_mt)

return DoorLockTypes
return DoorLockTypes
20 changes: 4 additions & 16 deletions drivers/SmartThings/matter-lock/src/init.lua
Original file line number Diff line number Diff line change
@@ -1,16 +1,6 @@
-- Copyright 2022 SmartThings
--
-- Licensed under the Apache License, Version 2.0 (the "License");
-- you may not use this file except in compliance with the License.
-- You may obtain a copy of the License at
--
-- http://www.apache.org/licenses/LICENSE-2.0
--
-- Unless required by applicable law or agreed to in writing, software
-- distributed under the License is distributed on an "AS IS" BASIS,
-- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-- See the License for the specific language governing permissions and
-- limitations under the License.
-- Copyright 2025 SmartThings, Inc.
-- Licensed under the Apache License, Version 2.0


local MatterDriver = require "st.matter.driver"
local clusters = require "st.matter.clusters"
Expand Down Expand Up @@ -717,9 +707,7 @@ local matter_lock_driver = {
capabilities.battery,
capabilities.batteryLevel,
},
sub_drivers = {
require("new-matter-lock"),
},
sub_drivers = require("sub_drivers"),
lifecycle_handlers = {
init = device_init,
added = device_added,
Expand Down
14 changes: 14 additions & 0 deletions drivers/SmartThings/matter-lock/src/lazy_load_subdriver.lua
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
-- Copyright 2025 SmartThings, Inc.
-- Licensed under the Apache License, Version 2.0

return function(sub_driver_name)
local MatterDriver = require "st.matter.driver"
local version = require "version"
if version.api >= 16 then
return MatterDriver.lazy_load_sub_driver_v2(sub_driver_name)
elseif version.api >= 9 then
return MatterDriver.lazy_load_sub_driver(require(sub_driver_name))
else
return require(sub_driver_name)
end
end
15 changes: 2 additions & 13 deletions drivers/SmartThings/matter-lock/src/lock_utils.lua
Original file line number Diff line number Diff line change
@@ -1,16 +1,5 @@
-- Copyright 2022 SmartThings
--
-- Licensed under the Apache License, Version 2.0 (the "License");
-- you may not use this file except in compliance with the License.
-- You may obtain a copy of the License at
--
-- http://www.apache.org/licenses/LICENSE-2.0
--
-- Unless required by applicable law or agreed to in writing, software
-- distributed under the License is distributed on an "AS IS" BASIS,
-- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-- See the License for the specific language governing permissions and
-- limitations under the License.
-- Copyright 2022 SmartThings, Inc.
-- Licensed under the Apache License, Version 2.0

local lock_utils = {
-- Lock device field names
Expand Down
19 changes: 19 additions & 0 deletions drivers/SmartThings/matter-lock/src/new-matter-lock/can_handle.lua
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
-- Copyright 2025 SmartThings, Inc.
-- Licensed under the Apache License, Version 2.0

local function is_new_matter_lock_products(opts, driver, device)
local device_lib = require "st.device"
if device.network_type ~= device_lib.NETWORK_TYPE_MATTER then
return false
end
local FINGERPRINTS = require("new-matter-lock.fingerprints")
for _, p in ipairs(FINGERPRINTS) do
if device.manufacturer_info.vendor_id == p[1] and
device.manufacturer_info.product_id == p[2] then
return true, require("new-matter-lock")
end
end
return false
end

return is_new_matter_lock_products
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
-- Copyright 2025 SmartThings, Inc.
-- Licensed under the Apache License, Version 2.0

local NEW_MATTER_LOCK_PRODUCTS = {
{0x115f, 0x2802}, -- AQARA, U200
{0x115f, 0x2801}, -- AQARA, U300
{0x115f, 0x2807}, -- AQARA, U200 Lite
{0x147F, 0x0001}, -- U-tec
{0x147F, 0x0008}, -- Ultraloq, Bolt Smart Matter Door Lock
{0x144F, 0x4002}, -- Yale, Linus Smart Lock L2
{0x101D, 0x8110}, -- Yale, New Lock
{0x1533, 0x0001}, -- eufy, E31
{0x1533, 0x0002}, -- eufy, E30
{0x1533, 0x0003}, -- eufy, C34
{0x1533, 0x000F}, -- eufy, FamiLock S3 Max
{0x1533, 0x0010}, -- eufy, FamiLock S3
{0x1533, 0x0011}, -- eufy, FamiLock E34
{0x1533, 0x0012}, -- eufy, FamiLock E35
{0x1533, 0x0016}, -- eufy, FamiLock E32
{0x135D, 0x00B1}, -- Nuki, Smart Lock Pro
{0x135D, 0x00B2}, -- Nuki, Smart Lock
{0x135D, 0x00C1}, -- Nuki, Smart Lock
{0x135D, 0x00A1}, -- Nuki, Smart Lock
{0x135D, 0x00B0}, -- Nuki, Smart Lock
{0x15F2, 0x0001}, -- Viomi, AiSafety Smart Lock E100
{0x158B, 0x0001}, -- Deasino, DS-MT01
{0x10E1, 0x2002}, -- VDA
{0x1421, 0x0042}, -- Kwikset Halo Select Plus
}

return NEW_MATTER_LOCK_PRODUCTS
59 changes: 5 additions & 54 deletions drivers/SmartThings/matter-lock/src/new-matter-lock/init.lua
Original file line number Diff line number Diff line change
@@ -1,18 +1,7 @@
-- Copyright 2024 SmartThings
--
-- Licensed under the Apache License, Version 2.0 (the "License");
-- you may not use this file except in compliance with the License.
-- You may obtain a copy of the License at
--
-- http://www.apache.org/licenses/LICENSE-2.0
--
-- Unless required by applicable law or agreed to in writing, software
-- distributed under the License is distributed on an "AS IS" BASIS,
-- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-- See the License for the specific language governing permissions and
-- limitations under the License.

local device_lib = require "st.device"
-- Copyright 2025 SmartThings, Inc.
-- Licensed under the Apache License, Version 2.0


local capabilities = require "st.capabilities"
local clusters = require "st.matter.clusters"
local im = require "st.matter.interaction_model"
Expand Down Expand Up @@ -60,32 +49,6 @@ local ALIRO_KEY_TYPE_TO_CRED_ENUM_MAP = {
["nonEvictableEndpointKey"] = DoorLock.types.CredentialTypeEnum.ALIRO_NON_EVICTABLE_ENDPOINT_KEY
}

local NEW_MATTER_LOCK_PRODUCTS = {
{0x115f, 0x2802}, -- AQARA, U200
{0x115f, 0x2801}, -- AQARA, U300
{0x115f, 0x2807}, -- AQARA, U200 Lite
{0x147F, 0x0001}, -- U-tec
{0x147F, 0x0008}, -- Ultraloq, Bolt Smart Matter Door Lock
{0x144F, 0x4002}, -- Yale, Linus Smart Lock L2
{0x101D, 0x8110}, -- Yale, New Lock
{0x1533, 0x0001}, -- eufy, E31
{0x1533, 0x0002}, -- eufy, E30
{0x1533, 0x0003}, -- eufy, C34
{0x1533, 0x000F}, -- eufy, FamiLock S3 Max
{0x1533, 0x0010}, -- eufy, FamiLock S3
{0x1533, 0x0011}, -- eufy, FamiLock E34
{0x1533, 0x0012}, -- eufy, FamiLock E35
{0x1533, 0x0016}, -- eufy, FamiLock E32
{0x135D, 0x00B1}, -- Nuki, Smart Lock Pro
{0x135D, 0x00B2}, -- Nuki, Smart Lock
{0x135D, 0x00C1}, -- Nuki, Smart Lock
{0x135D, 0x00A1}, -- Nuki, Smart Lock
{0x135D, 0x00B0}, -- Nuki, Smart Lock
{0x15F2, 0x0001}, -- Viomi, AiSafety Smart Lock E100
{0x158B, 0x0001}, -- Deasino, DS-MT01
{0x10E1, 0x2002}, -- VDA
{0x1421, 0x0042}, -- Kwikset Halo Select Plus
}

local battery_support = {
NO_BATTERY = "NO_BATTERY",
Expand Down Expand Up @@ -148,18 +111,6 @@ local subscribed_events = {
}
}

local function is_new_matter_lock_products(opts, driver, device)
if device.network_type ~= device_lib.NETWORK_TYPE_MATTER then
return false
end
for _, p in ipairs(NEW_MATTER_LOCK_PRODUCTS) do
if device.manufacturer_info.vendor_id == p[1] and
device.manufacturer_info.product_id == p[2] then
return true
end
end
return false
end

local function find_default_endpoint(device, cluster)
local res = device.MATTER_DEFAULT_ENDPOINT
Expand Down Expand Up @@ -2967,7 +2918,7 @@ local new_matter_lock_handler = {
capabilities.battery,
capabilities.batteryLevel
},
can_handle = is_new_matter_lock_products
can_handle = require("new-matter-lock.can_handle"),
}

return new_matter_lock_handler
8 changes: 8 additions & 0 deletions drivers/SmartThings/matter-lock/src/sub_drivers.lua
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
-- Copyright 2025 SmartThings, Inc.
-- Licensed under the Apache License, Version 2.0

local lazy_load_if_possible = require "lazy_load_subdriver"
local sub_drivers = {
lazy_load_if_possible("new-matter-lock"),
}
return sub_drivers
Original file line number Diff line number Diff line change
@@ -1,16 +1,6 @@
-- Copyright 2023 SmartThings
--
-- Licensed under the Apache License, Version 2.0 (the "License");
-- you may not use this file except in compliance with the License.
-- You may obtain a copy of the License at
--
-- http://www.apache.org/licenses/LICENSE-2.0
--
-- Unless required by applicable law or agreed to in writing, software
-- distributed under the License is distributed on an "AS IS" BASIS,
-- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-- See the License for the specific language governing permissions and
-- limitations under the License.
-- Copyright 2023 SmartThings, Inc.
-- Licensed under the Apache License, Version 2.0


local test = require "integration_test"
test.set_rpc_version(0)
Expand Down
Original file line number Diff line number Diff line change
@@ -1,16 +1,6 @@
-- Copyright 2024 SmartThings
--
-- Licensed under the Apache License, Version 2.0 (the "License");
-- you may not use this file except in compliance with the License.
-- You may obtain a copy of the License at
--
-- http://www.apache.org/licenses/LICENSE-2.0
--
-- Unless required by applicable law or agreed to in writing, software
-- distributed under the License is distributed on an "AS IS" BASIS,
-- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-- See the License for the specific language governing permissions and
-- limitations under the License.
-- Copyright 2024 SmartThings, Inc.
-- Licensed under the Apache License, Version 2.0


local test = require "integration_test"
local t_utils = require "integration_test.utils"
Expand Down
16 changes: 3 additions & 13 deletions drivers/SmartThings/matter-lock/src/test/test_matter_lock.lua
Original file line number Diff line number Diff line change
@@ -1,16 +1,6 @@
-- Copyright 2022 SmartThings
--
-- Licensed under the Apache License, Version 2.0 (the "License");
-- you may not use this file except in compliance with the License.
-- You may obtain a copy of the License at
--
-- http://www.apache.org/licenses/LICENSE-2.0
--
-- Unless required by applicable law or agreed to in writing, software
-- distributed under the License is distributed on an "AS IS" BASIS,
-- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-- See the License for the specific language governing permissions and
-- limitations under the License.
-- Copyright 2022 SmartThings, Inc.
-- Licensed under the Apache License, Version 2.0


local test = require "integration_test"
local capabilities = require "st.capabilities"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,16 +1,6 @@
-- Copyright 2024 SmartThings
--
-- Licensed under the Apache License, Version 2.0 (the "License");
-- you may not use this file except in compliance with the License.
-- You may obtain a copy of the License at
--
-- http://www.apache.org/licenses/LICENSE-2.0
--
-- Unless required by applicable law or agreed to in writing, software
-- distributed under the License is distributed on an "AS IS" BASIS,
-- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-- See the License for the specific language governing permissions and
-- limitations under the License.
-- Copyright 2024 SmartThings, Inc.
-- Licensed under the Apache License, Version 2.0


local test = require "integration_test"
local t_utils = require "integration_test.utils"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,16 +1,6 @@
-- Copyright 2024 SmartThings
--
-- Licensed under the Apache License, Version 2.0 (the "License");
-- you may not use this file except in compliance with the License.
-- You may obtain a copy of the License at
--
-- http://www.apache.org/licenses/LICENSE-2.0
--
-- Unless required by applicable law or agreed to in writing, software
-- distributed under the License is distributed on an "AS IS" BASIS,
-- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-- See the License for the specific language governing permissions and
-- limitations under the License.
-- Copyright 2024 SmartThings, Inc.
-- Licensed under the Apache License, Version 2.0


local test = require "integration_test"
local capabilities = require "st.capabilities"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,16 +1,6 @@
-- Copyright 2022 SmartThings
--
-- Licensed under the Apache License, Version 2.0 (the "License");
-- you may not use this file except in compliance with the License.
-- You may obtain a copy of the License at
--
-- http://www.apache.org/licenses/LICENSE-2.0
--
-- Unless required by applicable law or agreed to in writing, software
-- distributed under the License is distributed on an "AS IS" BASIS,
-- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-- See the License for the specific language governing permissions and
-- limitations under the License.
-- Copyright 2022 SmartThings, Inc.
-- Licensed under the Apache License, Version 2.0


local test = require "integration_test"
local capabilities = require "st.capabilities"
Expand Down
16 changes: 3 additions & 13 deletions drivers/SmartThings/matter-lock/src/test/test_matter_lock_cota.lua
Original file line number Diff line number Diff line change
@@ -1,16 +1,6 @@
-- Copyright 2022 SmartThings
--
-- Licensed under the Apache License, Version 2.0 (the "License");
-- you may not use this file except in compliance with the License.
-- You may obtain a copy of the License at
--
-- http://www.apache.org/licenses/LICENSE-2.0
--
-- Unless required by applicable law or agreed to in writing, software
-- distributed under the License is distributed on an "AS IS" BASIS,
-- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-- See the License for the specific language governing permissions and
-- limitations under the License.
-- Copyright 2022 SmartThings, Inc.
-- Licensed under the Apache License, Version 2.0


local test = require "integration_test"
local capabilities = require "st.capabilities"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,16 +1,6 @@
-- Copyright 2025 SmartThings
--
-- Licensed under the Apache License, Version 2.0 (the "License");
-- you may not use this file except in compliance with the License.
-- You may obtain a copy of the License at
--
-- http://www.apache.org/licenses/LICENSE-2.0
--
-- Unless required by applicable law or agreed to in writing, software
-- distributed under the License is distributed on an "AS IS" BASIS,
-- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-- See the License for the specific language governing permissions and
-- limitations under the License.
-- Copyright 2025 SmartThings, Inc.
-- Licensed under the Apache License, Version 2.0


local test = require "integration_test"
local capabilities = require "st.capabilities"
Expand Down
Loading
Loading