Skip to content

Commit 719c51b

Browse files
committed
TC-IDM-10.4: Add PWM as aliased cluster
1 parent fbb44ea commit 719c51b

File tree

3 files changed

+45
-28
lines changed

3 files changed

+45
-28
lines changed

src/python_testing/spec_parsing_support.py

+2-1
Original file line numberDiff line numberDiff line change
@@ -130,7 +130,8 @@ class CommandType(Enum):
130130
0x042F: 'RNCONC',
131131
0x0071: 'HEPAFREMON',
132132
0x0072: 'ACFREMON',
133-
0x0405: 'RH'}
133+
0x0405: 'RH',
134+
0x001C: 'PWM'}
134135

135136

136137
class ClusterParser:

src/python_testing/test_testing/example_pics_xml_basic_info.xml

+8
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,14 @@ Draft
2222
<status>O</status>
2323
<support>true</support>
2424
</picsItem>
25+
<!-- This isn't part of basic info, but I want to check a derived cluster PICS -->
26+
<picsItem>
27+
<itemNumber>LVL.S</itemNumber>
28+
<feature>Does the device implement the Level Cotnr`ol Cluster as a server?</feature>
29+
<reference>9.1. Role - index.html[pdf]</reference>
30+
<status>O</status>
31+
<support>true</support>
32+
</picsItem>
2533
</usage>
2634
<!--PIXIT-->
2735
<pixit>

src/python_testing/test_testing/test_IDM_10_4.py

+35-27
Original file line numberDiff line numberDiff line change
@@ -38,40 +38,48 @@
3838
def create_read(include_reachable: bool = False, include_max_paths: bool = False, include_vendor_id: bool = True) -> Attribute.AsyncReadTransaction.ReadResponse:
3939
# Attribute read here is set to match the example_pics_xml_basic_info.xml in this directory
4040
bi = Clusters.BasicInformation.Attributes
41-
attrs = {bi.DataModelRevision: 1,
42-
bi.VendorName: 'testVendor',
43-
bi.ProductName: 'testProduct',
44-
bi.ProductID: 0x8000,
45-
bi.NodeLabel: 'label',
46-
bi.Location: 'XX',
47-
bi.HardwareVersion: 1,
48-
bi.HardwareVersionString: 'one',
49-
bi.SoftwareVersion: 2,
50-
bi.SoftwareVersionString: 'two',
51-
bi.ManufacturingDate: 'today',
52-
bi.PartNumber: 'three',
53-
bi.ProductURL: 'example.com',
54-
bi.ProductLabel: 'myProduct',
55-
bi.SerialNumber: 'ABCD1234',
56-
bi.LocalConfigDisabled: False,
57-
bi.UniqueID: 'Hashy-McHashface'}
41+
lvl = Clusters.LevelControl.Attributes
42+
attrs_bi = {bi.DataModelRevision: 1,
43+
bi.VendorName: 'testVendor',
44+
bi.ProductName: 'testProduct',
45+
bi.ProductID: 0x8000,
46+
bi.NodeLabel: 'label',
47+
bi.Location: 'XX',
48+
bi.HardwareVersion: 1,
49+
bi.HardwareVersionString: 'one',
50+
bi.SoftwareVersion: 2,
51+
bi.SoftwareVersionString: 'two',
52+
bi.ManufacturingDate: 'today',
53+
bi.PartNumber: 'three',
54+
bi.ProductURL: 'example.com',
55+
bi.ProductLabel: 'myProduct',
56+
bi.SerialNumber: 'ABCD1234',
57+
bi.LocalConfigDisabled: False,
58+
bi.UniqueID: 'Hashy-McHashface'}
5859
if include_reachable:
59-
attrs[bi.Reachable] = True
60+
attrs_bi[bi.Reachable] = True
6061
if include_max_paths:
61-
attrs[bi.MaxPathsPerInvoke] = 2
62+
attrs_bi[bi.MaxPathsPerInvoke] = 2
6263
if include_vendor_id:
63-
attrs[bi.VendorID] = 0xFFF1
64+
attrs_bi[bi.VendorID] = 0xFFF1
6465

65-
attrs[bi.AttributeList] = [a.attribute_id for a in attrs.keys()]
66-
attrs[bi.AcceptedCommandList] = []
67-
attrs[bi.GeneratedCommandList] = []
68-
attrs[bi.FeatureMap] = 0
66+
attrs_bi[bi.AttributeList] = [a.attribute_id for a in attrs_bi.keys()]
67+
attrs_bi[bi.AcceptedCommandList] = []
68+
attrs_bi[bi.GeneratedCommandList] = []
69+
attrs_bi[bi.FeatureMap] = 0
70+
71+
attrs_lvl = {}
72+
attrs_lvl[lvl.AttributeList] = []
73+
attrs_lvl[lvl.AcceptedCommandList] = []
74+
attrs_lvl[lvl.GeneratedCommandList] = []
75+
attrs_lvl[lvl.FeatureMap] = 0
6976

7077
resp = Attribute.AsyncReadTransaction.ReadResponse({}, [], {})
71-
resp.attributes = {0: {Clusters.BasicInformation: attrs}}
78+
resp.attributes = {0: {Clusters.BasicInformation: attrs_bi, Clusters.LevelControl: attrs_lvl}}
7279

73-
tlv_attrs = {a.attribute_id: value for a, value in attrs.items()}
74-
resp.tlvAttributes = {0: {Clusters.BasicInformation.id: tlv_attrs}}
80+
tlv_attrs_bi = {a.attribute_id: value for a, value in attrs_bi.items()}
81+
tlv_attrs_lvl = {a.attribute_id: value for a, value in attrs_lvl.items()}
82+
resp.tlvAttributes = {0: {Clusters.BasicInformation.id: tlv_attrs_bi, Clusters.LevelControl.id: tlv_attrs_lvl}}
7583

7684
return resp
7785

0 commit comments

Comments
 (0)