File tree Expand file tree Collapse file tree 1 file changed +12
-0
lines changed
src-electron/generator/matter/app/zap-templates/templates/app Expand file tree Collapse file tree 1 file changed +12
-0
lines changed Original file line number Diff line number Diff line change @@ -808,6 +808,17 @@ function isWeaklyTypedEnum(label) {
808808 return weakEnumList . includes ( label ) ;
809809}
810810
811+ let legacyStructList = undefined ;
812+ function isLegacyStruct ( label ) {
813+ if ( legacyStructList === undefined ) {
814+ let f = this . global . resource ( 'legacy-struct-list' ) ;
815+ // NOTE: This has to be sync, so we can use this data in if conditions.
816+ let rawData = fs . readFileSync ( f , { encoding : 'utf8' , flag : 'r' } ) ;
817+ legacyStructList = YAML . parse ( rawData ) ;
818+ }
819+ return legacyStructList . includes ( label ) ;
820+ }
821+
811822function incrementDepth ( depth ) {
812823 return depth + 1 ;
813824}
@@ -920,6 +931,7 @@ exports.zapTypeToDecodableClusterObjectType =
920931 zapTypeToDecodableClusterObjectType ;
921932exports . zapTypeToPythonClusterObjectType = zapTypeToPythonClusterObjectType ;
922933exports . isWeaklyTypedEnum = isWeaklyTypedEnum ;
934+ exports . isLegacyStruct = isLegacyStruct ;
923935exports . getPythonFieldDefault = getPythonFieldDefault ;
924936exports . incrementDepth = incrementDepth ;
925937exports . zcl_events_fields_by_event_name = zcl_events_fields_by_event_name ;
You can’t perform that action at this time.
0 commit comments