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

components/esp-matter: added features support to power source device … (CON-1498) #1230

Draft
wants to merge 2 commits into
base: main
Choose a base branch
from
Draft
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion components/esp_matter/esp_matter_endpoint.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -212,7 +212,7 @@ esp_err_t add(endpoint_t *endpoint, config_t *config)
return err;
}

cluster_t *cluster = power_source::create(endpoint, &(config->power_source), CLUSTER_FLAG_SERVER, ESP_MATTER_NONE_FEATURE_ID);
cluster_t *cluster = power_source::create(endpoint, &(config->power_source), CLUSTER_FLAG_SERVER, config->descriptor.features);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It should have been the feature flags of the Power Source cluster and not of the Descriptor cluster.

Ideally, power_source::config_t should have the features member variable, and that should be set when creating the device type, then that value has to be used in here instead of the descriptor cluster's.

We are in the process of adding the feature_flags member variable to every cluster's config_t and will be available soon, and then that can be populated when creating the device type.

I'd suggest please wait till then.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hey thank you for your feedback.
I understand. So i will wait until features member is added and update my pr.

if (!cluster) {
return ESP_ERR_INVALID_STATE;
}
Expand Down