File tree Expand file tree Collapse file tree 1 file changed +23
-0
lines changed
src-electron/generator/matter/app/zap-templates/templates/app Expand file tree Collapse file tree 1 file changed +23
-0
lines changed Original file line number Diff line number Diff line change @@ -820,6 +820,18 @@ async function _zapTypeToPythonClusterObjectType(type, options) {
820820 if ( type . toLowerCase ( ) . match ( / ^ e n u m \d + $ / g) ) {
821821 return 'uint' ;
822822 }
823+
824+ const enumObj = await zclQuery . selectEnumByName (
825+ this . global . db ,
826+ type ,
827+ pkgId
828+ ) ;
829+
830+ if ( enumObj . enumClusterCount == 0 ) {
831+ // This is a global enum.
832+ return `Globals.Enums.${ type } ` ;
833+ }
834+
823835 return ns + '.Enums.' + type ;
824836 }
825837
@@ -828,6 +840,17 @@ async function _zapTypeToPythonClusterObjectType(type, options) {
828840 }
829841
830842 if ( await typeChecker ( 'isStruct' ) ) {
843+ const structObj = await zclQuery . selectStructByName (
844+ this . global . db ,
845+ type ,
846+ pkgId
847+ ) ;
848+
849+ if ( structObj . structClusterCount == 0 ) {
850+ // This is a global struct.
851+ return `Globals.Structs.${ type } ` ;
852+ }
853+
831854 return ns + '.Structs.' + type ;
832855 }
833856
You can’t perform that action at this time.
0 commit comments