Skip to content

Commit e1e8285

Browse files
Fix response determination in ClustersHelper. (#901)
It would get things wrong if two different clusters had a response command with the same name.
1 parent 395f7e7 commit e1e8285

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src-electron/generator/matter/app/zap-templates/common/ClustersHelper.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -591,8 +591,9 @@ function enhancedCommands(commands, types) {
591591
// The 'response' property contains the response returned by the `selectCommandById`
592592
// helper. But this one does not contains all the metadata informations added by
593593
// `enhancedItem`, so instead of using the one from ZAP, retrieve the enhanced version.
594+
const clusterName = command.clusterName;
594595
command.response = commands.find(
595-
(command) => command.name == responseName
596+
(command) => command.name == responseName && command.clusterName == clusterName
596597
);
597598
// We might have failed to find a response if our configuration is weird
598599
// in some way.

0 commit comments

Comments
 (0)