8000 Adding search by enum/bitmap name and Cluster name by brdandu · Pull Request #1590 · project-chip/zap · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

Adding search by enum/bitmap name and Cluster name #1590

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Conversation

brdandu
Copy link
Collaborator
@brdandu brdandu commented May 2, 2025

Github: ZAP#1586

Copy link
@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR introduces support for searching enums and bitmaps by name and cluster name. Key changes include:

  • Adding new query functions (selectEnumByNameAndClusterName and selectBitmapByNameAndClusterName) in the DB query modules.
  • Extending test cases to verify that enums and bitmaps are correctly differentiated based on cluster context.
  • Updating documentation to include the new API endpoints for both enums and bitmaps.

Reviewed Changes

Copilot reviewed 5 out of 7 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
test/gen-matter-3-1.test.js Adds test cases for search by enum/bitmap name and cluster name.
src-electron/db/query-zcl.js Exports the new query functions from the underlying enum and bitmap files.
src-electron/db/query-enum.js Implements selectEnumByNameAndClusterName for enum lookups.
src-electron/db/query-bitmap.js Implements selectBitmapByNameAndClusterName for bitmap lookups.
docs/api.md Updates API documentation to include the new endpoints.
Files not reviewed (2)
  • zcl-builtin/matter/data-model/chip/descriptor-cluster.xml: Language not supported
  • zcl-builtin/matter/data-model/chip/mode-select-cluster.xml: Language not supported

@@ -112,6 +113,48 @@ async function selectBitmapByNameAndClusterId(db, name, clusterId, packageIds) {
}
}

/**
* Select a bitmap matched by name and cluster name
* Note: Use selectBitmapByNameAndClusterName but this was needed for backwards compatibility.
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do you mean selectBitmapByNameAndClusterId?

@@ -248,6 +249,48 @@ async function selectEnumByNameAndClusterId(db, name, clusterId, packageIds) {
}
}

/**
* Select a enum matched by name and cluster name
* Note: Use selectEnumByNameAndClusterName but this was needed for backwards compatibility.
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

same as above

Copy link
Collaborator
@paulr34 paulr34 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

looks good

@@ -25,6 +25,7 @@ const dbApi = require('./db-api')
const dbCache = require('./db-cache')
const dbMapping = require('./db-mapping')
const queryUtil = require('./query-util')
const dbEnum = require('../../src-shared/db-enum.js')
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Timotej told me once that we should always do require('../../src-shared/db-enum') without .js

@@ -25,6 +25,7 @@ const dbApi = require('./db-api')
const dbCache = require('./db-cache')
const dbMapping = require('./db-mapping')
const queryUtil = require('./query-util')
const dbEnum = require('../../src-shared/db-enum.js')
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

same here. This also aligns with other imports

@brdandu brdandu force-pushed the task/addSearchByNameAndClusterNameForEnumsAndBitmaps/ZAP#1586 branch from 73968a2 to 713d2d4 Compare May 2, 2025 16:46
@dhchandw dhchandw self-requested a review May 2, 2025 16:47
@brdandu brdandu merged commit 5d1df1c into project-chip:master May 2, 2025
13 checks passed
@brdandu brdandu deleted the task/addSearchByNameAndClusterNameForEnumsAndBitmaps/ZAP#1586 branch May 2, 2025 17:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Need selectEnumByNameAndClusterName and selectBitmapByNameAndClusterName
6 participants
0