Skip to content

Commit 612e78b

Browse files
Fix cluster list generation. (#955)
* "clusterSize:" had a stray ':' that was causing generation to produce invalid output. * The old code had things indented sanely, and this is just restoring that. * There was no detection of unknown tokens, which would have quickly caught the "clusterSize" problem.
1 parent b730716 commit 612e78b

File tree

2 files changed

+8
-2
lines changed

2 files changed

+8
-2
lines changed

src-electron/generator/helper-endpointconfig.js

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -312,6 +312,8 @@ function endpoint_attribute_list(options) {
312312
case 'mask':
313313
items.push(mask)
314314
break
315+
default:
316+
throw new Error(`Unknown token '${tok}' in order optional argument`);
315317
}
316318
})
317319

@@ -523,6 +525,8 @@ function endpoint_reporting_config_defaults(options) {
523525
case 'minmax':
524526
items.push(`{{ ${minmax} }}`)
525527
break
528+
default:
529+
throw new Error(`Unknown token '${tok}' in order optional argument`);
526530
}
527531
})
528532

src-electron/generator/matter/app/zap-templates/templates/app/helper.js

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -373,7 +373,7 @@ function chip_endpoint_cluster_list(options) {
373373
case 'attributeCount':
374374
individualItems.push(`.attributeCount = ${c.attributeCount}`);
375375
break;
376-
case 'clusterSize:':
376+
case 'clusterSize':
377377
individualItems.push(`.clusterSize = ${c.attributeSize}`);
378378
break;
379379
case 'mask':
@@ -398,11 +398,13 @@ function chip_endpoint_cluster_list(options) {
398398
case 'eventCount':
399399
individualItems.push(`.eventCount = ${eventCount}`);
400400
break;
401+
default:
402+
throw new Error(`Unknown token '${tok}' in order optional argument`);
401403
}
402404
});
403405
ret = ret.concat(` { \\
404406
/* ${c.comment} */ \\
405-
${individualItems.join(', \\\n')}, \\
407+
${individualItems.join(', \\\n ')}, \\
406408
},\\\n`);
407409

408410
totalCommands = totalCommands + acceptedCommands + generatedCommands;

0 commit comments

Comments
 (0)