Skip to content

Commit 2b71747

Browse files
authored
dynamically enabling Matter/Zigbee only components for CMP (#1427)
* fixing so there are dynamic categories based on the device type when in cmp mode
1 parent 309238b commit 2b71747

File tree

4 files changed

+24
-12
lines changed

4 files changed

+24
-12
lines changed

src/components/ZclAttributeManager.vue

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -415,9 +415,7 @@ export default {
415415
sortBy: 'clientServer'
416416
},
417417
columns: [],
418-
forcedExternal: [],
419-
enableSingleton: false,
420-
enableBounded: false
418+
forcedExternal: []
421419
}
422420
},
423421
mounted() {

src/components/ZclCreateModifyEndpoint.vue

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -459,15 +459,11 @@ export default {
459459
// Set / unset multiple device option in mcp
460460
if (this.$store.state.zap.isMultiConfig) {
461461
if (categoryTmp === 'zigbee') {
462-
this.enableMultipleDevice = false
463-
this.enableParentEndpoint = false
464-
this.enablePrimaryDevice = false
465-
this.enableProfileId = true
462+
this.$store.state.zap.cmpEnableZigbeeFeatures = true
463+
this.$store.state.zap.cmpEnableMatterFeatures = false
466464
} else {
467-
this.enableMultipleDevice = true
468-
this.enableParentEndpoint = true
469-
this.enablePrimaryDevice = true
470-
this.enableProfileId = false
465+
this.$store.state.zap.cmpEnableZigbeeFeatures = false
466+
this.$store.state.zap.cmpEnableMatterFeatures = true
471467
}
472468
}
473469
// Create default device version if not exists

src/store/zap/state.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,8 @@ const restApi = require('../../../src-shared/rest-api.js')
2323
export default function () {
2424
return {
2525
selectedZapConfig: null,
26+
cmpEnableZigbeeFeatures: false,
27+
cmpEnableMatterFeatures: false,
2628
isMultiConfig: false,
2729
isProfileIdShown: null,
2830
clusterDataForTutorial: [],

src/util/ui-options.js

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,11 +56,27 @@ export default {
5656
}
5757
},
5858
enableMatterFeatures() {
59+
// Check if cmpEnableMatterFeatures is true
60+
if (this.$store.state.zap.cmpEnableMatterFeatures) {
61+
return true
62+
} else if (this.$store.state.zap.cmpEnableZigbeeFeatures) {
63+
return false
64+
}
65+
66+
// Proceed with the next set of conditions
5967
return this.zclPropertiesNonEmpty
6068
? this.multiDeviceCategories.includes('matter')
6169
: this.multiDeviceCategories == 'matter'
6270
},
6371
enableZigbeeFeatures() {
72+
// Check if cmpEnableZigbeeFeatures is true
73+
if (this.$store.state.zap.cmpEnableZigbeeFeatures) {
74+
return true
75+
} else if (this.$store.state.zap.cmpEnableMatterFeatures) {
76+
return false
77+
}
78+
79+
// Proceed with the next set of conditions
6480
return this.zclPropertiesNonEmpty
6581
? this.multiDeviceCategories.includes('zigbee')
6682
: this.multiDeviceCategories === 'zigbee' || !this.multiDeviceCategories
@@ -90,7 +106,7 @@ export default {
90106
return this.enableMatterFeatures
91107
},
92108
enableServerOnly() {
93-
return this.enableMatterFeatures && !this.enableZigbeeFeatures
109+
return this.enableMatterFeatures
94110
}
95111
}
96112
}

0 commit comments

Comments
 (0)