Skip to content

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

Merged
brdandu merged 1 commit into
project-chip:masterfrom
brdandu:task/addSearchByNameAndClusterNameForEnumsAndBitmaps/ZAP#1586
May 2, 2025
Merged

Adding search by enum/bitmap name and Cluster name#1590
brdandu merged 1 commit into
project-chip:masterfrom
brdandu:task/addSearchByNameAndClusterNameForEnumsAndBitmaps/ZAP#1586

Conversation

@brdandu
Copy link
Copy Markdown
Collaborator

@brdandu brdandu commented May 2, 2025

Github: ZAP#1586

Copy link
Copy Markdown
Contributor

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

Comment thread test/gen-matter-3-1.test.js Outdated
Comment thread test/gen-matter-3-1.test.js Outdated
Comment thread src-electron/db/query-bitmap.js Outdated

/**
* Select a bitmap matched by name and cluster name
* Note: Use selectBitmapByNameAndClusterName but this was needed for backwards compatibility.
Copy link
Copy Markdown
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?

Comment thread src-electron/db/query-enum.js Outdated

/**
* Select a enum matched by name and cluster name
* Note: Use selectEnumByNameAndClusterName but this was needed for backwards compatibility.
Copy link
Copy Markdown
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
Copy Markdown
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

Comment thread src-electron/db/query-bitmap.js Outdated
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
Copy Markdown
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

Comment thread src-electron/db/query-enum.js Outdated
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
Copy Markdown
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

7 participants