-
Notifications
You must be signed in to change notification settings - Fork 530
Expand file tree
/
Copy pathMaxPINCodeLength.lua
More file actions
70 lines (58 loc) · 1.42 KB
/
MaxPINCodeLength.lua
File metadata and controls
70 lines (58 loc) · 1.42 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
-- 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 MaxPINCodeLength = {
ID = 0x0017,
NAME = "MaxPINCodeLength",
base_type = require "st.matter.data_types.Uint8",
}
function MaxPINCodeLength:new_value(...)
local o = self.base_type(table.unpack({...}))
return o
end
function MaxPINCodeLength:read(device, endpoint_id)
return cluster_base.read(
device,
endpoint_id,
self._cluster.ID,
self.ID,
nil
)
end
function MaxPINCodeLength:subscribe(device, endpoint_id)
return cluster_base.subscribe(
device,
endpoint_id,
self._cluster.ID,
self.ID,
nil
)
end
function MaxPINCodeLength:set_parent_cluster(cluster)
self._cluster = cluster
return self
end
function MaxPINCodeLength: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 MaxPINCodeLength:deserialize(tlv_buf)
local data = TLVParser.decode_tlv(tlv_buf)
return data
end
setmetatable(MaxPINCodeLength, {__call = MaxPINCodeLength.new_value, __index = MaxPINCodeLength.base_type})
return MaxPINCodeLength