diff --git a/components/esp_matter_controller/esp_matter_controller_read_command.h b/components/esp_matter_controller/esp_matter_controller_read_command.h index 7305adf69..e24d162bc 100644 --- a/components/esp_matter_controller/esp_matter_controller_read_command.h +++ b/components/esp_matter_controller/esp_matter_controller_read_command.h @@ -49,13 +49,10 @@ public: , event_data_cb(event_cb) { if (command_type == READ_ATTRIBUTE) { - m_attr_path.mEndpointId = endpoint_id; - m_attr_path.mClusterId = cluster_id; - m_attr_path.mAttributeId = attribute_or_event_id; + m_attr_path = AttributePathParams(endpoint_id, cluster_id, attribute_or_event_id); + } else if (command_type == READ_EVENT) { - m_event_path.mEndpointId = endpoint_id; - m_event_path.mClusterId = cluster_id; - m_event_path.mEventId = attribute_or_event_id; + m_event_path = EventPathParams(endpoint_id, cluster_id, attribute_or_event_id); } }