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
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
-- Copyright 2026 SmartThings, Inc.
-- Licensed under the Apache License, Version 2.0

local data_types = require "st.matter.data_types"
local TLVParser = require "st.matter.TLV.TLVParser"

Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
-- Copyright 2026 SmartThings, Inc.
-- Licensed under the Apache License, Version 2.0

local data_types = require "st.matter.data_types"
local TLVParser = require "st.matter.TLV.TLVParser"

Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
-- Copyright 2026 SmartThings, Inc.
-- Licensed under the Apache License, Version 2.0

local data_types = require "st.matter.data_types"
local TLVParser = require "st.matter.TLV.TLVParser"

Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
-- Copyright 2026 SmartThings, Inc.
-- Licensed under the Apache License, Version 2.0

local data_types = require "st.matter.data_types"
local TLVParser = require "st.matter.TLV.TLVParser"

Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
-- Copyright 2026 SmartThings, Inc.
-- Licensed under the Apache License, Version 2.0

local data_types = require "st.matter.data_types"
local TLVParser = require "st.matter.TLV.TLVParser"

Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
-- Copyright 2026 SmartThings, Inc.
-- Licensed under the Apache License, Version 2.0

local command_mt = {}
command_mt.__command_cache = {}
command_mt.__index = function(self, key)
Expand Down
27 changes: 23 additions & 4 deletions drivers/SmartThings/matter-lock/src/DoorLock/init.lua
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
-- Copyright 2025 SmartThings, Inc.
-- Copyright 2026 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 @@ -69,8 +68,8 @@ function DoorLock:get_attribute_by_id(attr_id)
[0x0087] = "NumberOfAliroCredentialIssuerKeysSupported",
[0x0088] = "NumberOfAliroEndpointKeysSupported",
[0xFFF9] = "AcceptedCommandList",
[0xFFFA] = "EventList",
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Was EventList removed on purpose? I don't think we're currently using it but was also thinking it'd be better to leave it than remove it

[0xFFFB] = "AttributeList",
[0xFFFC] = "FeatureMap",
}
local attr_name = attr_id_map[attr_id]
if attr_name ~= nil then
Expand Down Expand Up @@ -185,10 +184,19 @@ DoorLock.attribute_direction_map = {
["NumberOfAliroCredentialIssuerKeysSupported"] = "server",
["NumberOfAliroEndpointKeysSupported"] = "server",
["AcceptedCommandList"] = "server",
["EventList"] = "server",
["AttributeList"] = "server",
["FeatureMap"] = "server",
}

do
local has_aliases, aliases = pcall(require, "st.matter.clusters.aliases.DoorLock.server.attributes")
if has_aliases then
for alias, _ in pairs(aliases) do
DoorLock.attribute_direction_map[alias] = "server"
end
end
end

DoorLock.command_direction_map = {
["LockDoor"] = "server",
["UnlockDoor"] = "server",
Expand Down Expand Up @@ -219,6 +227,16 @@ DoorLock.command_direction_map = {
["GetCredentialStatusResponse"] = "client",
}

do
local has_aliases, aliases = pcall(require, "st.matter.clusters.aliases.DoorLock.server.commands")
if has_aliases then
for alias, _ in pairs(aliases) do
DoorLock.command_direction_map[alias] = "server"
end
end
end


DoorLock.FeatureMap = DoorLock.types.Feature

function DoorLock.are_features_supported(feature, feature_map)
Expand Down Expand Up @@ -260,3 +278,4 @@ setmetatable(DoorLock.events, event_helper_mt)
setmetatable(DoorLock, {__index = cluster_base})

return DoorLock

Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
-- Copyright 2026 SmartThings, Inc.
-- Licensed under the Apache License, Version 2.0

local cluster_base = require "st.matter.cluster_base"
local data_types = require "st.matter.data_types"
local TLVParser = require "st.matter.TLV.TLVParser"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
-- Copyright 2026 SmartThings, Inc.
-- Licensed under the Apache License, Version 2.0

local cluster_base = require "st.matter.cluster_base"
local data_types = require "st.matter.data_types"
local TLVParser = require "st.matter.TLV.TLVParser"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
-- Copyright 2026 SmartThings, Inc.
-- Licensed under the Apache License, Version 2.0

local cluster_base = require "st.matter.cluster_base"
local data_types = require "st.matter.data_types"
local TLVParser = require "st.matter.TLV.TLVParser"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
-- Copyright 2026 SmartThings, Inc.
-- Licensed under the Apache License, Version 2.0

local cluster_base = require "st.matter.cluster_base"
local data_types = require "st.matter.data_types"
local TLVParser = require "st.matter.TLV.TLVParser"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
-- Copyright 2026 SmartThings, Inc.
-- Licensed under the Apache License, Version 2.0

local cluster_base = require "st.matter.cluster_base"
local data_types = require "st.matter.data_types"
local TLVParser = require "st.matter.TLV.TLVParser"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
-- Copyright 2026 SmartThings, Inc.
-- Licensed under the Apache License, Version 2.0

local cluster_base = require "st.matter.cluster_base"
local data_types = require "st.matter.data_types"
local TLVParser = require "st.matter.TLV.TLVParser"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
-- Copyright 2026 SmartThings, Inc.
-- Licensed under the Apache License, Version 2.0

local cluster_base = require "st.matter.cluster_base"
local data_types = require "st.matter.data_types"
local TLVParser = require "st.matter.TLV.TLVParser"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
-- Copyright 2026 SmartThings, Inc.
-- Licensed under the Apache License, Version 2.0

local cluster_base = require "st.matter.cluster_base"
local data_types = require "st.matter.data_types"
local TLVParser = require "st.matter.TLV.TLVParser"
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,77 @@
-- Copyright 2026 SmartThings, Inc.
-- Licensed under the Apache License, Version 2.0

local cluster_base = require "st.matter.cluster_base"
local data_types = require "st.matter.data_types"
local TLVParser = require "st.matter.TLV.TLVParser"

local AliroSupportedBLEUWBProtocolVersions = {
ID = 0x0085,
NAME = "AliroSupportedBLEUWBProtocolVersions",
base_type = require "st.matter.data_types.Array",
element_type = require "st.matter.data_types.OctetString1",
}

function AliroSupportedBLEUWBProtocolVersions:augment_type(data_type_obj)
for i, v in ipairs(data_type_obj.elements) do
data_type_obj.elements[i] = data_types.validate_or_build_type(v, AliroSupportedBLEUWBProtocolVersions.element_type)
end
end

function AliroSupportedBLEUWBProtocolVersions:new_value(...)
local o = self.base_type(table.unpack({...}))

return o
end

function AliroSupportedBLEUWBProtocolVersions:read(device, endpoint_id)
return cluster_base.read(
device,
endpoint_id,
self._cluster.ID,
self.ID,
nil
)
end

function AliroSupportedBLEUWBProtocolVersions:subscribe(device, endpoint_id)
return cluster_base.subscribe(
device,
endpoint_id,
self._cluster.ID,
self.ID,
nil
)
end

function AliroSupportedBLEUWBProtocolVersions:set_parent_cluster(cluster)
self._cluster = cluster
return self
end

function AliroSupportedBLEUWBProtocolVersions:build_test_report_data(
device,
endpoint_id,
value,
status
)
local data = data_types.validate_or_build_type(value, self.base_type)

return cluster_base.build_test_report_data(
device,
endpoint_id,
self._cluster.ID,
self.ID,
data,
status
)
end

function AliroSupportedBLEUWBProtocolVersions:deserialize(tlv_buf)
local data = TLVParser.decode_tlv(tlv_buf)

return data
end

setmetatable(AliroSupportedBLEUWBProtocolVersions, {__call = AliroSupportedBLEUWBProtocolVersions.new_value, __index = AliroSupportedBLEUWBProtocolVersions.base_type})
return AliroSupportedBLEUWBProtocolVersions
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
-- Copyright 2026 SmartThings, Inc.
-- Licensed under the Apache License, Version 2.0

local cluster_base = require "st.matter.cluster_base"
local data_types = require "st.matter.data_types"
local TLVParser = require "st.matter.TLV.TLVParser"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
-- Copyright 2026 SmartThings, Inc.
-- Licensed under the Apache License, Version 2.0

local cluster_base = require "st.matter.cluster_base"
local data_types = require "st.matter.data_types"
local TLVParser = require "st.matter.TLV.TLVParser"
Expand Down Expand Up @@ -30,7 +33,7 @@ function DoorState:subscribe(device, endpoint_id)
endpoint_id,
self._cluster.ID,
self.ID,
nil --event_id
nil
)
end

Expand Down
Original file line number Diff line number Diff line change
@@ -1,27 +1,23 @@
-- Copyright 2026 SmartThings, Inc.
-- Licensed under the Apache License, Version 2.0

local cluster_base = require "st.matter.cluster_base"
local data_types = require "st.matter.data_types"
local TLVParser = require "st.matter.TLV.TLVParser"

local EventList = {
ID = 0xFFFA,
NAME = "EventList",
base_type = require "st.matter.data_types.Array",
element_type = require "st.matter.data_types.Uint32",
local FeatureMap = {
ID = 0xFFFC,
NAME = "FeatureMap",
base_type = require "DoorLock.types.Feature",
}

function EventList:augment_type(data_type_obj)
for i, v in ipairs(data_type_obj.elements) do
data_type_obj.elements[i] = data_types.validate_or_build_type(v, EventList.element_type)
end
end

function EventList:new_value(...)
function FeatureMap:new_value(...)
local o = self.base_type(table.unpack({...}))

return o
end

function EventList:read(device, endpoint_id)
function FeatureMap:read(device, endpoint_id)
return cluster_base.read(
device,
endpoint_id,
Expand All @@ -31,7 +27,8 @@ function EventList:read(device, endpoint_id)
)
end

function EventList:subscribe(device, endpoint_id)

function FeatureMap:subscribe(device, endpoint_id)
return cluster_base.subscribe(
device,
endpoint_id,
Expand All @@ -41,12 +38,12 @@ function EventList:subscribe(device, endpoint_id)
)
end

function EventList:set_parent_cluster(cluster)
function FeatureMap:set_parent_cluster(cluster)
self._cluster = cluster
return self
end

function EventList:build_test_report_data(
function FeatureMap:build_test_report_data(
device,
endpoint_id,
value,
Expand All @@ -64,11 +61,11 @@ function EventList:build_test_report_data(
)
end

function EventList:deserialize(tlv_buf)
function FeatureMap:deserialize(tlv_buf)
local data = TLVParser.decode_tlv(tlv_buf)

return data
end

setmetatable(EventList, {__call = EventList.new_value, __index = EventList.base_type})
return EventList
setmetatable(FeatureMap, {__call = FeatureMap.new_value, __index = FeatureMap.base_type})
return FeatureMap
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
-- Copyright 2026 SmartThings, Inc.
-- Licensed under the Apache License, Version 2.0

local cluster_base = require "st.matter.cluster_base"
local data_types = require "st.matter.data_types"
local TLVParser = require "st.matter.TLV.TLVParser"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
-- Copyright 2026 SmartThings, Inc.
-- Licensed under the Apache License, Version 2.0

local cluster_base = require "st.matter.cluster_base"
local data_types = require "st.matter.data_types"
local TLVParser = require "st.matter.TLV.TLVParser"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
-- Copyright 2026 SmartThings, Inc.
-- Licensed under the Apache License, Version 2.0

local cluster_base = require "st.matter.cluster_base"
local data_types = require "st.matter.data_types"
local TLVParser = require "st.matter.TLV.TLVParser"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
-- Copyright 2026 SmartThings, Inc.
-- Licensed under the Apache License, Version 2.0

local cluster_base = require "st.matter.cluster_base"
local data_types = require "st.matter.data_types"
local TLVParser = require "st.matter.TLV.TLVParser"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
-- Copyright 2026 SmartThings, Inc.
-- Licensed under the Apache License, Version 2.0

local cluster_base = require "st.matter.cluster_base"
local data_types = require "st.matter.data_types"
local TLVParser = require "st.matter.TLV.TLVParser"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
-- Copyright 2026 SmartThings, Inc.
-- Licensed under the Apache License, Version 2.0

local cluster_base = require "st.matter.cluster_base"
local data_types = require "st.matter.data_types"
local TLVParser = require "st.matter.TLV.TLVParser"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
-- Copyright 2026 SmartThings, Inc.
-- Licensed under the Apache License, Version 2.0

local cluster_base = require "st.matter.cluster_base"
local data_types = require "st.matter.data_types"
local TLVParser = require "st.matter.TLV.TLVParser"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
-- Copyright 2026 SmartThings, Inc.
-- Licensed under the Apache License, Version 2.0

local cluster_base = require "st.matter.cluster_base"
local data_types = require "st.matter.data_types"
local TLVParser = require "st.matter.TLV.TLVParser"
Expand Down
Loading
Loading