components/esp_matter: set full-family composition for dynamic endpoints

emberAfSetDynamicEndpoint does not auto-detect device types to set
the isFlatComposition flag, unlike static endpoints in emberAfInit.
This causes Aggregator and Bridged Node endpoints registered dynamically
to use kTree composition instead of kFullFamily, resulting in PartsList
only listing direct children instead of all descendants.

After registering a dynamic endpoint, check if its device type is
Root Node, Aggregator, or Bridged Node and call
SetFlatCompositionForEndpoint to match the static endpoint behavior.

Closes https://github.com/espressif/esp-matter/issues/1741
This commit is contained in:
Shubham Patil
2026-03-26 18:43:32 +05:30
parent 8a6d0f4643
commit 548a250df6
@@ -534,6 +534,17 @@ esp_err_t enable(endpoint_t *endpoint)
}
ESP_LOGI(TAG, "Dynamic endpoint %" PRIu16 " added", current_endpoint->endpoint_id);
/* Set composition pattern for dynamic endpoints. emberAfSetDynamicEndpoint does not auto-detect
* device types to set the composition, unlike static endpoints. Root node, aggregator, and bridged
* node device types need kFullFamily composition for correct PartsList computation. */
for (uint8_t i = 0; i < current_endpoint->device_type_count; i++) {
if (current_endpoint->device_type_ids[i] == ESP_MATTER_ROOT_NODE_DEVICE_TYPE_ID ||
current_endpoint->device_type_ids[i] == ESP_MATTER_AGGREGATOR_DEVICE_TYPE_ID ||
current_endpoint->device_type_ids[i] == ESP_MATTER_BRIDGED_NODE_DEVICE_TYPE_ID) {
chip::app::SetFlatCompositionForEndpoint(current_endpoint->endpoint_id);
break;
}
}
#ifdef CONFIG_SUPPORT_UNIT_LOCALIZATION_CLUSTER
// set the temperature unit from unit localization cluster