-
Notifications
You must be signed in to change notification settings - Fork 87
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
Adding search by enum/bitmap name and Cluster name #1590
Conversation
There was a problem hiding this 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
src-electron/db/query-bitmap.js
Outdated
@@ -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. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do you mean selectBitmapByNameAndClusterId?
src-electron/db/query-enum.js
Outdated
@@ -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. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
same as above
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
looks good
src-electron/db/query-bitmap.js
Outdated
@@ -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') |
There was a problem hiding this comment.
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
src-electron/db/query-enum.js
Outdated
@@ -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') |
There was a problem hiding this comment.
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
Github: ZAP#1586
73968a2
to
713d2d4
Compare
Github: ZAP#1586