Skip to content

Commit 23049cd

Browse files
authored
Adding exceptions to if_basic_attribute (#975)
Github: ZAP#898
1 parent 0823c3d commit 23049cd

File tree

1 file changed

+7
-1
lines changed
  • src-electron/generator/matter/controller/java/templates

1 file changed

+7
-1
lines changed

src-electron/generator/matter/controller/java/templates/helper.js

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@ const zclUtil = require(zapPath + 'util/zcl-util.js');
2828

2929
const characterStringTypes = ['CHAR_STRING', 'LONG_CHAR_STRING'];
3030
const octetStringTypes = ['OCTET_STRING', 'LONG_OCTET_STRING'];
31+
const basicAttributeExceptionList = ['vendor_id'];
3132

3233
function convertBasicCTypeToJavaType(cType) {
3334
switch (cType) {
@@ -443,7 +444,12 @@ function incrementDepth(depth) {
443444
*/
444445
async function if_basic_attribute(type, clusterId, options) {
445446
let struct = null;
446-
if (this.isNullable || this.isOptional || this.isArray) {
447+
if (
448+
this.isNullable ||
449+
this.isOptional ||
450+
this.isArray ||
451+
basicAttributeExceptionList.includes(type)
452+
) {
447453
return options.inverse(this);
448454
} else {
449455
let packageIds = await templateUtil.ensureZclPackageIds(this);

0 commit comments

Comments
 (0)