Skip to content
代码片段 群组 项目
未验证 提交 0aed1255 编辑于 作者: Boris Zbarsky's avatar Boris Zbarsky 提交者: GitHub
浏览文件

Fix Matter test codegen to handle atomics that are not all-lowercase. (#1223)

上级 5f1f3a62
No related branches found
No related tags found
无相关合并请求
......@@ -427,7 +427,9 @@ function asChipCallback(item) {
}
function getAtomic(atomics, type) {
return atomics.find((atomic) => atomic.name == type.toLowerCase());
return atomics.find(
(atomic) => atomic.name.toLowerCase() == type.toLowerCase()
);
}
function getBitmap(bitmaps, type) {
......@@ -593,7 +595,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.
......@@ -789,7 +792,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;
......@@ -823,7 +830,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 [
......@@ -865,7 +875,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");
......
0% 加载中 .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册