Adding search by enum/bitmap name and Cluster name#1590
Merged
brdandu merged 1 commit intoMay 2, 2025
Merged
Conversation
Contributor
There was a problem hiding this comment.
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
bzbarsky-apple
approved these changes
May 2, 2025
dhchandw
reviewed
May 2, 2025
|
|
||
| /** | ||
| * Select a bitmap matched by name and cluster name | ||
| * Note: Use selectBitmapByNameAndClusterName but this was needed for backwards compatibility. |
Collaborator
There was a problem hiding this comment.
Do you mean selectBitmapByNameAndClusterId?
tecimovic
approved these changes
May 2, 2025
dhchandw
reviewed
May 2, 2025
|
|
||
| /** | ||
| * Select a enum matched by name and cluster name | ||
| * Note: Use selectEnumByNameAndClusterName but this was needed for backwards compatibility. |
ethanzhouyc
reviewed
May 2, 2025
| const dbCache = require('./db-cache') | ||
| const dbMapping = require('./db-mapping') | ||
| const queryUtil = require('./query-util') | ||
| const dbEnum = require('../../src-shared/db-enum.js') |
Collaborator
There was a problem hiding this comment.
Timotej told me once that we should always do require('../../src-shared/db-enum') without .js
ethanzhouyc
reviewed
May 2, 2025
| const dbCache = require('./db-cache') | ||
| const dbMapping = require('./db-mapping') | ||
| const queryUtil = require('./query-util') | ||
| const dbEnum = require('../../src-shared/db-enum.js') |
Collaborator
There was a problem hiding this comment.
same here. This also aligns with other imports
ethanzhouyc
approved these changes
May 2, 2025
Github: ZAP#1586
73968a2 to
713d2d4
Compare
dhchandw
approved these changes
May 2, 2025
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Github: ZAP#1586