From 719c51b3fc1971573960a044aacbab0a4bc32464 Mon Sep 17 00:00:00 2001 From: cecille Date: Tue, 9 Jul 2024 10:14:42 -0400 Subject: [PATCH 1/2] TC-IDM-10.4: Add PWM as aliased cluster --- src/python_testing/spec_parsing_support.py | 3 +- .../example_pics_xml_basic_info.xml | 8 +++ .../test_testing/test_IDM_10_4.py | 62 +++++++++++-------- 3 files changed, 45 insertions(+), 28 deletions(-) diff --git a/src/python_testing/spec_parsing_support.py b/src/python_testing/spec_parsing_support.py index bc36049de54cd5..c2819960146ed3 100644 --- a/src/python_testing/spec_parsing_support.py +++ b/src/python_testing/spec_parsing_support.py @@ -130,7 +130,8 @@ class CommandType(Enum): 0x042F: 'RNCONC', 0x0071: 'HEPAFREMON', 0x0072: 'ACFREMON', - 0x0405: 'RH'} + 0x0405: 'RH', + 0x001C: 'PWM'} class ClusterParser: diff --git a/src/python_testing/test_testing/example_pics_xml_basic_info.xml b/src/python_testing/test_testing/example_pics_xml_basic_info.xml index 96f1a34f3e9557..44412c8d58bc4e 100644 --- a/src/python_testing/test_testing/example_pics_xml_basic_info.xml +++ b/src/python_testing/test_testing/example_pics_xml_basic_info.xml @@ -22,6 +22,14 @@ Draft O true + + + LVL.S + Does the device implement the Level Cotnr`ol Cluster as a server? + 9.1. Role - index.html[pdf] + O + true + diff --git a/src/python_testing/test_testing/test_IDM_10_4.py b/src/python_testing/test_testing/test_IDM_10_4.py index ccf713450e2348..8634e94129b86a 100644 --- a/src/python_testing/test_testing/test_IDM_10_4.py +++ b/src/python_testing/test_testing/test_IDM_10_4.py @@ -38,40 +38,48 @@ def create_read(include_reachable: bool = False, include_max_paths: bool = False, include_vendor_id: bool = True) -> Attribute.AsyncReadTransaction.ReadResponse: # Attribute read here is set to match the example_pics_xml_basic_info.xml in this directory bi = Clusters.BasicInformation.Attributes - attrs = {bi.DataModelRevision: 1, - bi.VendorName: 'testVendor', - bi.ProductName: 'testProduct', - bi.ProductID: 0x8000, - bi.NodeLabel: 'label', - bi.Location: 'XX', - bi.HardwareVersion: 1, - bi.HardwareVersionString: 'one', - bi.SoftwareVersion: 2, - bi.SoftwareVersionString: 'two', - bi.ManufacturingDate: 'today', - bi.PartNumber: 'three', - bi.ProductURL: 'example.com', - bi.ProductLabel: 'myProduct', - bi.SerialNumber: 'ABCD1234', - bi.LocalConfigDisabled: False, - bi.UniqueID: 'Hashy-McHashface'} + lvl = Clusters.LevelControl.Attributes + attrs_bi = {bi.DataModelRevision: 1, + bi.VendorName: 'testVendor', + bi.ProductName: 'testProduct', + bi.ProductID: 0x8000, + bi.NodeLabel: 'label', + bi.Location: 'XX', + bi.HardwareVersion: 1, + bi.HardwareVersionString: 'one', + bi.SoftwareVersion: 2, + bi.SoftwareVersionString: 'two', + bi.ManufacturingDate: 'today', + bi.PartNumber: 'three', + bi.ProductURL: 'example.com', + bi.ProductLabel: 'myProduct', + bi.SerialNumber: 'ABCD1234', + bi.LocalConfigDisabled: False, + bi.UniqueID: 'Hashy-McHashface'} if include_reachable: - attrs[bi.Reachable] = True + attrs_bi[bi.Reachable] = True if include_max_paths: - attrs[bi.MaxPathsPerInvoke] = 2 + attrs_bi[bi.MaxPathsPerInvoke] = 2 if include_vendor_id: - attrs[bi.VendorID] = 0xFFF1 + attrs_bi[bi.VendorID] = 0xFFF1 - attrs[bi.AttributeList] = [a.attribute_id for a in attrs.keys()] - attrs[bi.AcceptedCommandList] = [] - attrs[bi.GeneratedCommandList] = [] - attrs[bi.FeatureMap] = 0 + attrs_bi[bi.AttributeList] = [a.attribute_id for a in attrs_bi.keys()] + attrs_bi[bi.AcceptedCommandList] = [] + attrs_bi[bi.GeneratedCommandList] = [] + attrs_bi[bi.FeatureMap] = 0 + + attrs_lvl = {} + attrs_lvl[lvl.AttributeList] = [] + attrs_lvl[lvl.AcceptedCommandList] = [] + attrs_lvl[lvl.GeneratedCommandList] = [] + attrs_lvl[lvl.FeatureMap] = 0 resp = Attribute.AsyncReadTransaction.ReadResponse({}, [], {}) - resp.attributes = {0: {Clusters.BasicInformation: attrs}} + resp.attributes = {0: {Clusters.BasicInformation: attrs_bi, Clusters.LevelControl: attrs_lvl}} - tlv_attrs = {a.attribute_id: value for a, value in attrs.items()} - resp.tlvAttributes = {0: {Clusters.BasicInformation.id: tlv_attrs}} + tlv_attrs_bi = {a.attribute_id: value for a, value in attrs_bi.items()} + tlv_attrs_lvl = {a.attribute_id: value for a, value in attrs_lvl.items()} + resp.tlvAttributes = {0: {Clusters.BasicInformation.id: tlv_attrs_bi, Clusters.LevelControl.id: tlv_attrs_lvl}} return resp From 3d6247f0920700d5e7fb2f45ae9aa7f91c2bdffb Mon Sep 17 00:00:00 2001 From: C Freeman Date: Wed, 10 Jul 2024 09:19:10 -0400 Subject: [PATCH 2/2] Update src/python_testing/test_testing/example_pics_xml_basic_info.xml Co-authored-by: Kiel Oleson --- src/python_testing/test_testing/example_pics_xml_basic_info.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/python_testing/test_testing/example_pics_xml_basic_info.xml b/src/python_testing/test_testing/example_pics_xml_basic_info.xml index 44412c8d58bc4e..3d488c3ae90ace 100644 --- a/src/python_testing/test_testing/example_pics_xml_basic_info.xml +++ b/src/python_testing/test_testing/example_pics_xml_basic_info.xml @@ -25,7 +25,7 @@ Draft LVL.S - Does the device implement the Level Cotnr`ol Cluster as a server? + Does the device implement the Level Control Cluster as a server? 9.1. Role - index.html[pdf] O true