Skip to content

Commit

Permalink
Fix Matter test codegen to handle atomics that are not all-lowercase.
Browse files Browse the repository at this point in the history
  • Loading branch information
bzbarsky-apple committed Nov 30, 2023
1 parent 3461293 commit f6ac1d0
Showing 1 changed file with 17 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -427,7 +427,7 @@ function asChipCallback(item) {
}

function getAtomic(atomics, type) {
return atomics.find((atomic) => atomic.name == type.toLowerCase());
return atomics.find((atomic) => atomic.name == type);
}

function getBitmap(bitmaps, type) {
Expand Down Expand Up @@ -593,7 +593,8 @@ function enhancedCommands(commands, types) {
// `enhancedItem`, so instead of using the one from ZAP, retrieve the enhanced version.
const clusterName = command.clusterName;
command.response = commands.find(
(command) => command.name == responseName && command.clusterName == clusterName
(command) =>
command.name == responseName && command.clusterName == clusterName
);
// We might have failed to find a response if our configuration is weird
// in some way.
Expand Down Expand Up @@ -789,7 +790,11 @@ Clusters._computeUsedStructureNames = async function (structs) {
* If includeAll is true, all events/commands/attributes will be included, not
* just the ones enabled in the ZAP configuration.
*/
Clusters.init = async function (context, includeAllClusterConstructs, includeAllClusters) {
Clusters.init = async function (
context,
includeAllClusterConstructs,
includeAllClusters
) {
try {
if (this.ready.running) {
return this.ready;
Expand Down Expand Up @@ -823,7 +828,10 @@ Clusters.init = async function (context, includeAllClusterConstructs, includeAll
? loadAllAttributes.call(context, packageIds)
: loadAttributes.call(context),
loadGlobalAttributes.call(context, packageIds),
(includeAllClusterConstructs ? loadAllEvents : loadEvents).call(context, packageIds),
(includeAllClusterConstructs ? loadAllEvents : loadEvents).call(
context,
packageIds
),
];

let [
Expand Down Expand Up @@ -865,7 +873,11 @@ function asBlocks(promise, options) {
);
}

function ensureClusters(context, includeAllClusterConstructs = false, includeAllClusters = false) {
function ensureClusters(
context,
includeAllClusterConstructs = false,
includeAllClusters = false
) {
// Kick off Clusters initialization. This is async, but that's fine: all the
// getters on Clusters wait on that initialziation to complete.
ensureState(context, "Don't have a context");
Expand Down

0 comments on commit f6ac1d0

Please sign in to comment.