Skip to content

Commit af9dc34

Browse files
clean up embedded cluster files
1 parent f0304c2 commit af9dc34

File tree

14 files changed

+19
-579
lines changed

14 files changed

+19
-579
lines changed

drivers/SmartThings/matter-window-covering/src/embedded_clusters/ClosureDimension/init.lua

Lines changed: 0 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -1,33 +1,8 @@
1-
-- Copyright 2022 SmartThings
2-
--
3-
-- Licensed under the Apache License, Version 2.0 (the "License");
4-
-- you may not use this file except in compliance with the License.
5-
-- You may obtain a copy of the License at
6-
--
7-
-- http://www.apache.org/licenses/LICENSE-2.0
8-
--
9-
-- Unless required by applicable law or agreed to in writing, software
10-
-- distributed under the License is distributed on an "AS IS" BASIS,
11-
-- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12-
-- See the License for the specific language governing permissions and
13-
-- limitations under the License.
14-
15-
-- DO NOT EDIT: this code is automatically generated by ZCL Advanced Platform generator.
16-
171
local cluster_base = require "st.matter.cluster_base"
182
local ClosureDimensionServerAttributes = require "embedded_clusters.ClosureDimension.server.attributes"
193
local ClosureDimensionServerCommands = require "embedded_clusters.ClosureDimension.server.commands"
204
local ClosureDimensionTypes = require "embedded_clusters.ClosureDimension.types"
215

22-
--- @class st.matter.generated.zap_clusters.ClosureDimension
23-
--- @alias ClosureDimension
24-
---
25-
--- @field public ID number 0x0105 the ID of this cluster
26-
--- @field public NAME string "ClosureDimension" the name of this cluster
27-
--- @field public attributes st.matter.generated.zap_clusters.ClosureDimensionServerAttributes | st.matter.generated.zap_clusters.ClosureDimensionClientAttributes
28-
--- @field public commands st.matter.generated.zap_clusters.ClosureDimensionServerCommands | st.matter.generated.zap_clusters.ClosureDimensionClientCommands
29-
--- @field public types st.matter.generated.zap_clusters.ClosureDimensionTypes
30-
316
local ClosureDimension = {}
327

338
ClosureDimension.ID = 0x0105
@@ -38,9 +13,6 @@ ClosureDimension.server.attributes = ClosureDimensionServerAttributes:set_parent
3813
ClosureDimension.server.commands = ClosureDimensionServerCommands:set_parent_cluster(ClosureDimension)
3914
ClosureDimension.types = ClosureDimensionTypes
4015

41-
--- Find an attribute by id
42-
---
43-
--- @param attr_id number
4416
function ClosureDimension:get_attribute_by_id(attr_id)
4517
local attr_id_map = {
4618
[0x0000] = "CurrentState",
@@ -65,9 +37,6 @@ function ClosureDimension:get_attribute_by_id(attr_id)
6537
return nil
6638
end
6739

68-
--- Find a server command by id
69-
---
70-
--- @param command_id number
7140
function ClosureDimension:get_server_command_by_id(command_id)
7241
local server_id_map = {
7342
[0x0000] = "SetTarget",
@@ -79,8 +48,6 @@ function ClosureDimension:get_server_command_by_id(command_id)
7948
return nil
8049
end
8150

82-
83-
-- Attribute Mapping
8451
ClosureDimension.attribute_direction_map = {
8552
["CurrentState"] = "server",
8653
["TargetState"] = "server",
@@ -98,7 +65,6 @@ ClosureDimension.attribute_direction_map = {
9865
["AttributeList"] = "server",
9966
}
10067

101-
-- Command Mapping
10268
ClosureDimension.command_direction_map = {
10369
["SetTarget"] = "server",
10470
["Step"] = "server",
@@ -113,7 +79,6 @@ function ClosureDimension.are_features_supported(feature, feature_map)
11379
return false
11480
end
11581

116-
-- Cluster Completion
11782
local attribute_helper_mt = {}
11883
attribute_helper_mt.__index = function(self, key)
11984
local direction = ClosureDimension.attribute_direction_map[key]
@@ -139,4 +104,3 @@ setmetatable(ClosureDimension.commands, command_helper_mt)
139104
setmetatable(ClosureDimension, {__index = cluster_base})
140105

141106
return ClosureDimension
142-
Lines changed: 2 additions & 51 deletions
Original file line numberDiff line numberDiff line change
@@ -1,77 +1,36 @@
1-
-- Copyright 2022 SmartThings
2-
--
3-
-- Licensed under the Apache License, Version 2.0 (the "License");
4-
-- you may not use this file except in compliance with the License.
5-
-- You may obtain a copy of the License at
6-
--
7-
-- http://www.apache.org/licenses/LICENSE-2.0
8-
--
9-
-- Unless required by applicable law or agreed to in writing, software
10-
-- distributed under the License is distributed on an "AS IS" BASIS,
11-
-- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12-
-- See the License for the specific language governing permissions and
13-
-- limitations under the License.
14-
15-
-- DO NOT EDIT: this code is automatically generated by ZCL Advanced Platform generator.
16-
171
local cluster_base = require "st.matter.cluster_base"
182
local data_types = require "st.matter.data_types"
193
local TLVParser = require "st.matter.TLV.TLVParser"
204

21-
--- @class st.matter.clusters.ClosureDimension.CurrentState
22-
--- @alias CurrentState
23-
---
24-
--- @field public ID number 0x0000 the ID of this attribute
25-
--- @field public NAME string "CurrentState" the name of this attribute
26-
--- @field public data_type st.matter.generated.zap_clusters.ClosureDimension.types.DimensionStateStruct the data type of this attribute
27-
285
local CurrentState = {
296
ID = 0x0000,
307
NAME = "CurrentState",
318
base_type = require "embedded_clusters.ClosureDimension.types.DimensionStateStruct",
329
}
3310

34-
--- Create a DimensionStateStruct object of this attribute with any additional features provided for the attribute
35-
--- This is also usable with the CurrentState(...) syntax
36-
---
37-
--- @vararg vararg the values needed to construct a DimensionStateStruct
38-
--- @return st.matter.generated.zap_clusters.ClosureDimension.types.DimensionStateStruct
3911
function CurrentState:new_value(...)
4012
local o = self.base_type(table.unpack({...}))
4113
self:augment_type(o)
4214
return o
4315
end
4416

45-
--- Constructs an st.matter.interaction_model.InteractionRequest to read
46-
--- this attribute from a device
47-
--- @param device st.matter.Device
48-
--- @param endpoint_id number|nil
49-
--- @return st.matter.interaction_model.InteractionRequest containing an Interaction Request
5017
function CurrentState:read(device, endpoint_id)
5118
return cluster_base.read(
5219
device,
5320
endpoint_id,
5421
self._cluster.ID,
5522
self.ID,
56-
nil --event_id
23+
nil
5724
)
5825
end
5926

60-
61-
--- Reporting policy: CurrentState => true => mandatory
62-
63-
--- Sets up a Subscribe Interaction
64-
---
65-
--- @param device any
66-
--- @param endpoint_id number|nil
67-
--- @return any
6827
function CurrentState:subscribe(device, endpoint_id)
6928
return cluster_base.subscribe(
7029
device,
7130
endpoint_id,
7231
self._cluster.ID,
7332
self.ID,
74-
nil --event_id
33+
nil
7534
)
7635
end
7736

@@ -80,13 +39,6 @@ function CurrentState:set_parent_cluster(cluster)
8039
return self
8140
end
8241

83-
--- Builds an CurrentState test attribute reponse for the driver integration testing framework
84-
---
85-
--- @param device st.matter.Device the device to build this message for
86-
--- @param endpoint_id number|nil
87-
--- @param value any
88-
--- @param status string Interaction status associated with the path
89-
--- @return st.matter.interaction_model.InteractionResponse of type REPORT_DATA
9042
function CurrentState:build_test_report_data(
9143
device,
9244
endpoint_id,
@@ -113,4 +65,3 @@ end
11365

11466
setmetatable(CurrentState, {__call = CurrentState.new_value, __index = CurrentState.base_type})
11567
return CurrentState
116-
Lines changed: 2 additions & 51 deletions
Original file line numberDiff line numberDiff line change
@@ -1,77 +1,36 @@
1-
-- Copyright 2022 SmartThings
2-
--
3-
-- Licensed under the Apache License, Version 2.0 (the "License");
4-
-- you may not use this file except in compliance with the License.
5-
-- You may obtain a copy of the License at
6-
--
7-
-- http://www.apache.org/licenses/LICENSE-2.0
8-
--
9-
-- Unless required by applicable law or agreed to in writing, software
10-
-- distributed under the License is distributed on an "AS IS" BASIS,
11-
-- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12-
-- See the License for the specific language governing permissions and
13-
-- limitations under the License.
14-
15-
-- DO NOT EDIT: this code is automatically generated by ZCL Advanced Platform generator.
16-
171
local cluster_base = require "st.matter.cluster_base"
182
local data_types = require "st.matter.data_types"
193
local TLVParser = require "st.matter.TLV.TLVParser"
204

21-
--- @class st.matter.clusters.ClosureDimension.LimitRange
22-
--- @alias LimitRange
23-
---
24-
--- @field public ID number 0x0006 the ID of this attribute
25-
--- @field public NAME string "LimitRange" the name of this attribute
26-
--- @field public data_type st.matter.generated.zap_clusters.ClosureDimension.types.RangePercent100thsStruct the data type of this attribute
27-
285
local LimitRange = {
296
ID = 0x0006,
307
NAME = "LimitRange",
318
base_type = require "embedded_clusters.ClosureDimension.types.RangePercent100thsStruct",
329
}
3310

34-
--- Create a RangePercent100thsStruct object of this attribute with any additional features provided for the attribute
35-
--- This is also usable with the LimitRange(...) syntax
36-
---
37-
--- @vararg vararg the values needed to construct a RangePercent100thsStruct
38-
--- @return st.matter.generated.zap_clusters.ClosureDimension.types.RangePercent100thsStruct
3911
function LimitRange:new_value(...)
4012
local o = self.base_type(table.unpack({...}))
4113
self:augment_type(o)
4214
return o
4315
end
4416

45-
--- Constructs an st.matter.interaction_model.InteractionRequest to read
46-
--- this attribute from a device
47-
--- @param device st.matter.Device
48-
--- @param endpoint_id number|nil
49-
--- @return st.matter.interaction_model.InteractionRequest containing an Interaction Request
5017
function LimitRange:read(device, endpoint_id)
5118
return cluster_base.read(
5219
device,
5320
endpoint_id,
5421
self._cluster.ID,
5522
self.ID,
56-
nil --event_id
23+
nil
5724
)
5825
end
5926

60-
61-
--- Reporting policy: LimitRange => true => mandatory
62-
63-
--- Sets up a Subscribe Interaction
64-
---
65-
--- @param device any
66-
--- @param endpoint_id number|nil
67-
--- @return any
6827
function LimitRange:subscribe(device, endpoint_id)
6928
return cluster_base.subscribe(
7029
device,
7130
endpoint_id,
7231
self._cluster.ID,
7332
self.ID,
74-
nil --event_id
33+
nil
7534
)
7635
end
7736

@@ -80,13 +39,6 @@ function LimitRange:set_parent_cluster(cluster)
8039
return self
8140
end
8241

83-
--- Builds an LimitRange test attribute reponse for the driver integration testing framework
84-
---
85-
--- @param device st.matter.Device the device to build this message for
86-
--- @param endpoint_id number|nil
87-
--- @param value any
88-
--- @param status string Interaction status associated with the path
89-
--- @return st.matter.interaction_model.InteractionResponse of type REPORT_DATA
9042
function LimitRange:build_test_report_data(
9143
device,
9244
endpoint_id,
@@ -113,4 +65,3 @@ end
11365

11466
setmetatable(LimitRange, {__call = LimitRange.new_value, __index = LimitRange.base_type})
11567
return LimitRange
116-
Lines changed: 2 additions & 51 deletions
Original file line numberDiff line numberDiff line change
@@ -1,77 +1,36 @@
1-
-- Copyright 2022 SmartThings
2-
--
3-
-- Licensed under the Apache License, Version 2.0 (the "License");
4-
-- you may not use this file except in compliance with the License.
5-
-- You may obtain a copy of the License at
6-
--
7-
-- http://www.apache.org/licenses/LICENSE-2.0
8-
--
9-
-- Unless required by applicable law or agreed to in writing, software
10-
-- distributed under the License is distributed on an "AS IS" BASIS,
11-
-- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12-
-- See the License for the specific language governing permissions and
13-
-- limitations under the License.
14-
15-
-- DO NOT EDIT: this code is automatically generated by ZCL Advanced Platform generator.
16-
171
local cluster_base = require "st.matter.cluster_base"
182
local data_types = require "st.matter.data_types"
193
local TLVParser = require "st.matter.TLV.TLVParser"
204

21-
--- @class st.matter.clusters.ClosureDimension.StepValue
22-
--- @alias StepValue
23-
---
24-
--- @field public ID number 0x0003 the ID of this attribute
25-
--- @field public NAME string "StepValue" the name of this attribute
26-
--- @field public data_type st.matter.data_types.Uint16 the data type of this attribute
27-
285
local StepValue = {
296
ID = 0x0003,
307
NAME = "StepValue",
318
base_type = require "st.matter.data_types.Uint16",
329
}
3310

34-
--- Create a Uint16 object of this attribute with any additional features provided for the attribute
35-
--- This is also usable with the StepValue(...) syntax
36-
---
37-
--- @vararg vararg the values needed to construct a Uint16
38-
--- @return st.matter.data_types.Uint16
3911
function StepValue:new_value(...)
4012
local o = self.base_type(table.unpack({...}))
4113

4214
return o
4315
end
4416

45-
--- Constructs an st.matter.interaction_model.InteractionRequest to read
46-
--- this attribute from a device
47-
--- @param device st.matter.Device
48-
--- @param endpoint_id number|nil
49-
--- @return st.matter.interaction_model.InteractionRequest containing an Interaction Request
5017
function StepValue:read(device, endpoint_id)
5118
return cluster_base.read(
5219
device,
5320
endpoint_id,
5421
self._cluster.ID,
5522
self.ID,
56-
nil --event_id
23+
nil
5724
)
5825
end
5926

60-
61-
--- Reporting policy: StepValue => true => mandatory
62-
63-
--- Sets up a Subscribe Interaction
64-
---
65-
--- @param device any
66-
--- @param endpoint_id number|nil
67-
--- @return any
6827
function StepValue:subscribe(device, endpoint_id)
6928
return cluster_base.subscribe(
7029
device,
7130
endpoint_id,
7231
self._cluster.ID,
7332
self.ID,
74-
nil --event_id
33+
nil
7534
)
7635
end
7736

@@ -80,13 +39,6 @@ function StepValue:set_parent_cluster(cluster)
8039
return self
8140
end
8241

83-
--- Builds an StepValue test attribute reponse for the driver integration testing framework
84-
---
85-
--- @param device st.matter.Device the device to build this message for
86-
--- @param endpoint_id number|nil
87-
--- @param value any
88-
--- @param status string Interaction status associated with the path
89-
--- @return st.matter.interaction_model.InteractionResponse of type REPORT_DATA
9042
function StepValue:build_test_report_data(
9143
device,
9244
endpoint_id,
@@ -113,4 +65,3 @@ end
11365

11466
setmetatable(StepValue, {__call = StepValue.new_value, __index = StepValue.base_type})
11567
return StepValue
116-

0 commit comments

Comments
 (0)