From 23049cd88ee8d180296a01d2c9fd54fd6c84e5ca Mon Sep 17 00:00:00 2001
From: Bharat Raju <brdandu@silabs.com>
Date: Wed, 22 Mar 2023 11:59:52 -0400
Subject: [PATCH] Adding exceptions to if_basic_attribute (#975)

Github: ZAP#898
---
 .../generator/matter/controller/java/templates/helper.js  | 8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)

diff --git a/src-electron/generator/matter/controller/java/templates/helper.js b/src-electron/generator/matter/controller/java/templates/helper.js
index 66c2fed7..586c3e42 100644
--- a/src-electron/generator/matter/controller/java/templates/helper.js
+++ b/src-electron/generator/matter/controller/java/templates/helper.js
@@ -28,6 +28,7 @@ const zclUtil = require(zapPath + 'util/zcl-util.js');
 
 const characterStringTypes = ['CHAR_STRING', 'LONG_CHAR_STRING'];
 const octetStringTypes = ['OCTET_STRING', 'LONG_OCTET_STRING'];
+const basicAttributeExceptionList = ['vendor_id'];
 
 function convertBasicCTypeToJavaType(cType) {
   switch (cType) {
@@ -443,7 +444,12 @@ function incrementDepth(depth) {
  */
 async function if_basic_attribute(type, clusterId, options) {
   let struct = null;
-  if (this.isNullable || this.isOptional || this.isArray) {
+  if (
+    this.isNullable ||
+    this.isOptional ||
+    this.isArray ||
+    basicAttributeExceptionList.includes(type)
+  ) {
     return options.inverse(this);
   } else {
     let packageIds = await templateUtil.ensureZclPackageIds(this);
-- 
GitLab