Comments (4)
This is a bit of a larger item....
The problem is the following:
currently all the UI for attributes/clusters/commands, etc is mostly hardcoded. The columns are fixed.
We have a feature called SDK extensions, where SDK can add their own data points to the individual fields.
So for example:
SDK can say: we are adding a column called "Color" to each attribute. Default value is "Blue", but users can type their own.
This will then result in ZAP showing a new column for the attribute, based on this data point (which is stored in the DB.)
We have the mechanism to load these into the database, we also have the queries, I think there is also REST API calls for that (and if not, they are easy to add).
But the UI doesn't do this now.
from zap.
See this part of the "SDK customization" doc: https://github.com/project-chip/zap/blob/master/docs/sdk-integration.md#template-key-zcl
This lists the custom "zcl" keys in the gen-templates.json
file, which contribute additional data tokens to the entities.
At the bottom, it lists "configurability".
Configurability has 3 options:
- "hidden": the UI does not need to show or know of this option. It is a hidden pass-through to the generation.
- "visible": the UI should SHOW the column for this option, but NOT allow editing by the user.
- "editable": the UI should SHOW the column AND allow the user to edit it. It should also save into the zap file.
In terms what APIs already exist:
- helper-sdkextension.js has the template helpers. They work and there are jest unit tests for them.
- query-package.js contains the queries. See functions that have "PackageExtension" in their names.
- I do not think we have REST layers for this. Looking around the rest/ directory, I see nothing. We will have to add this.
There are unit tests for this see gen-zigbee.test.js which has this:
let sdkExtension = genResult.content['sdk-extension.out']
expect(sdkExtension).toContain(
"// cluster: 0x0000 Basic, text extension: 'Extension to basic cluster'"
)
expect(sdkExtension).toContain(
"// cluster: 0x0002 Device Temperature Configuration, text extension: 'Extension to temperature config cluster'"
)
expect(sdkExtension).toContain(
"// server cluster: 0x0001 Power Configuration, text extension: 'Extension to power cluster'"
)
.
.
.
This tests that the extensions are properly triggered and generated.
from zap.
For a good example of how these "extensions" are added to the system, see:
test/gen-template/zigbee/gen-templates.json
It has the "zcl" key which defines the extensions:
"zcl": {
"cluster": {
"testClusterExtension": {
"type": "text",
"configurability": "hidden",
"globalDefault": null,
"label": "Test cluster extension",
"defaults": [
{
"clusterCode": "0x0000",
"value": "Extension to basic cluster"
},
{
"clusterCode": "0x0001",
"role": "server",
"value": "Extension to power cluster"
},
{
"clusterCode": "0x0002",
"value": "Extension to temperature config cluster"
}
]
},
.
.
.
This one, for example is "hidden", so it should not show in the UI.
If you change this "configurability" to "visible", it should show in the UI for each cluster.
This file actually drives the unit tests, so feel free to add more extensions in here with different configurability.
I also expect, once you show them in the ui, we might need more data around it, such as "uiType: number" or maybe "uiType: checkbox" and so on. If you run into this, let me know and we can add more metadata around these extensions.
from zap.
@Mehradml : here is my belief of what kind of APIs we have...
1.) query-package.js has these queries:
exports.insertPackageExtension = insertPackageExtension
exports.selectPackageExtension = selectPackageExtension
exports.selectPackageExtensionByPropertyAndEntity = selectPackageExtensionByPropertyAndEntity
exports.deleteSessionPackage = deleteSessionPackage
exports.selectAllUiOptions = selectAllUiOptions
I think as far as queries go, these are all that are needed.
2.) There is a REST API in static-zcl.js
:
/**
* API: /zclExtension/:entity/:extension
*
* @param {*} db
* @returns zcl extension handler
*/
function httpGetZclExtension(db) {
...
I think this is the only one. It can be used to query extensions. Should return some JSON stuff.
from zap.
Related Issues (20)
- Building failed (in venv) with `importlib.metadata.PackageNotFoundError: No package metadata was found for gyp` HOT 1
- [BUG] opening and saving a file in the zap GUI causes OnOff cluster OnOff attribute to be set as non-reportable HOT 3
- Document explaining each of the columns in the ZAP UI under attributes, commands, attribute reporting
- [Feature request] Add a way to tag default setup values for an attribute HOT 17
- need to know how to change the read write access for matter attributes HOT 1
- ZAP on Apple Silicon HOT 2
- TimeSync events unable to be disabled HOT 1
- Using ZAP tool for Matter HOT 5
- Match Studio / UC component integration popup box color with ZAP theme colors HOT 4
- Not able to set SmokeAlarmCO as Primary device type if PowerSource device type exists HOT 1
- Extra clusters incorrectly added to a Matter device configuration HOT 5
- [Feature request] Script to update zap files to match GUI output / policy to run script on zap update
- [BUG] config-data.yaml uses different formats for cluster names HOT 2
- External attributes should not have an editable (or any, really) Default field in the UI
- [Feature Request] PICS XML Export
- [Feature Request] Matter "Strict" Mode
- ZAP UI - Matter HOT 2
- zcl_attributes does not produce the correct data HOT 1
- [Bug / Matter Non Conformance] Missing Binding Clusters for Simple device types HOT 11
- [Feature Request] ensure responses are enabled for any enabled commands
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from zap.