@@ -789,7 +789,7 @@ Clusters._computeUsedStructureNames = async function (structs) {
789789 * If includeAll is true, all events/commands/attributes will be included, not
790790 * just the ones enabled in the ZAP configuration.
791791 */
792- Clusters . init = async function ( context , includeAll ) {
792+ Clusters . init = async function ( context , includeAllClusterConstructs , includeAllClusters ) {
793793 try {
794794 if ( this . ready . running ) {
795795 return this . ready ;
@@ -813,17 +813,17 @@ Clusters.init = async function (context, includeAll) {
813813 const promises = [
814814 Promise . all ( loadTypes ) ,
815815 loadEndpoints . call ( context ) ,
816- // For now just always use loadClusters, because we have a bunch of things
817- // defined in our XML that are not actually part of Matter.
818- loadClusters . call ( context ) ,
819- includeAll
816+ includeAllClusters
817+ ? loadAllClusters . call ( context , packageIds )
818+ : loadClusters . call ( context ) ,
819+ includeAllClusterConstructs
820820 ? loadAllCommands . call ( context , packageIds )
821821 : loadCommands . call ( context , packageIds ) ,
822- includeAll
822+ includeAllClusterConstructs
823823 ? loadAllAttributes . call ( context , packageIds )
824824 : loadAttributes . call ( context ) ,
825825 loadGlobalAttributes . call ( context , packageIds ) ,
826- ( includeAll ? loadAllEvents : loadEvents ) . call ( context , packageIds ) ,
826+ ( includeAllClusterConstructs ? loadAllEvents : loadEvents ) . call ( context , packageIds ) ,
827827 ] ;
828828
829829 let [
@@ -865,12 +865,12 @@ function asBlocks(promise, options) {
865865 ) ;
866866}
867867
868- function ensureClusters ( context , includeAll = false ) {
868+ function ensureClusters ( context , includeAllClusterConstructs = false , includeAllClusters = false ) {
869869 // Kick off Clusters initialization. This is async, but that's fine: all the
870870 // getters on Clusters wait on that initialziation to complete.
871871 ensureState ( context , "Don't have a context" ) ;
872872
873- Clusters . init ( context , includeAll ) ;
873+ Clusters . init ( context , includeAllClusterConstructs , includeAllClusters ) ;
874874 return Clusters ;
875875}
876876
0 commit comments