Skip to content
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

Matter Device Type Features page #1380

Open
paulr34 opened this issue Jul 30, 2024 · 1 comment
Open

Matter Device Type Features page #1380

paulr34 opened this issue Jul 30, 2024 · 1 comment
Assignees
Labels
enhancement New feature or request

Comments

@paulr34
Copy link
Collaborator

paulr34 commented Jul 30, 2024

A New Features Page

Requirements:

Phase 1:

  • Create a new page for displaying features per Device Type.
  • Update Matter XML to include relevant feature data
  • Design the ZAP SQL database accordingly.
  • Translate conformance from the Matter spec to the ZAP SQL database and then to the Vue front end.

Description:

When creating Matter device types in ZAP, we propose adding a new page called "Features." This page will display all the features listed in the Element Requirements section of the Device Type Matter spec. It will also include data from the Element Requirements section, such as Conformance. This data must be extracted from the Matter data model XML, translated, stored in the ZAP SQL database, and retrieved by the front end via a REST API.

Use Case:

As a ZAP user creating a Matter application, I want to select a device type and activate features. By selecting "Features," I should see all possible features supported by the Device Type. This will provide a convenient reference for setting the featureMap attribute bit when finalizing my application.

Requirements:

Phase 2:

  • Implement the ability to toggle optional features on or off.
  • When toggling a feature, update the associated elements, including attributes, commands, features, .etc, and automatically update the feature map attribute according to the configured features.
  • When toggling an element, send a warning if it does not conform
  • Update Matter XML to include conformance of attributes and commands in CHIP repo

Description:

This page should be configurable like Attributes, Commands, and Events. It will list the features supported by each Device Type. Mandatory features should always be enabled in the GUI. Deprecated, disallowed, or provisional features should always be disabled. Optional features should be toggled on or off based on the user's application needs.

Use Case:

As a ZAP user creating a Matter application, I want to choose a device type and activate features. Selecting "Features" should show all possible features for the Device Type and allow me to toggle optional features. The system should automatically set the corresponding bit in the featureMap attribute, and adjust associated Attributes, Commands, Feature, etc. to ensure conformance, eliminating the need for manual configuration.
If a device type feature has complex conformance and doesn't comply after toggling, I should receive a warning instead of auto-updating elements for me. Changes to the same feature within a cluster and endpoint should sync across multiple device types. If I modify an attribute, command, or feature that causes incorrect conformance, I should receive warnings.

Technical Details:

Database Design:
New Tables:

  • Create a table for Features, including fields for Feature ID, name, and description.
  • Create a table to link Device Types to Features, with fields for Device Type ID, Feature ID, and optional flags.

Data Translation:
XML Extraction:

  • Develop a script or utility to parse the Matter data model XML and extract relevant feature data.

Data Transformation:

  • Map the XML data fields to the corresponding fields in the ZAP SQL database tables.
  • Implement data transformation rules to ensure correct representation of features and attributes.

REST API Integration:
API Endpoints:

  • Design REST API endpoints for retrieving feature data from the ZAP SQL database.
  • Implement endpoints for updating feature configurations, including toggling optional features.

Data Retrieval:

  • Ensure that the API returns data in a format compatible with the Vue front end.
  • Implement error handling and validation to ensure data integrity during API transactions.

Front End Integration:
Vue Components:

  • Develop Vue components to display the features page, including tables or lists for mandatory and optional features.
  • Implement toggles and controls for managing optional features, with real-time updates to reflect user choices.

Data Binding:

  • Bind Vue components to the REST API to dynamically fetch and display data.
  • Ensure that feature updates are reflected immediately in the user interface.
  • By following these technical details, developers will ensure a smooth transition of data from the XML source to the database and finally to the front end, providing a seamless experience for users configuring their Matter applications

Matter SDK Version Considerations:

  • Older Matter SDK versions has outdated XML files and lack information about attribute and command conformance, which could cause the feature page non-functional.
  • To address this, we should only display the feature page for newer SDK versions and apply device type features and conformance code exclusively to those versions.
@paulr34 paulr34 added the enhancement New feature or request label Jul 30, 2024
@paulr34 paulr34 self-assigned this Jul 30, 2024
@paulr34 paulr34 assigned ethanzhouyc and unassigned paulr34 Aug 6, 2024
@paulr34 paulr34 changed the title Features page Matter Device Type Features page Sep 5, 2024
@ethanzhouyc
Copy link
Collaborator

Frontend UI of the Device Type Feature Page
phase 2

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants