Skip to content

Commit

Permalink
fix:modify getCategory func for Matter and Zigbee mode
Browse files Browse the repository at this point in the history
  • Loading branch information
tbrkollar committed Jul 11, 2024
1 parent f44fb45 commit 9b5793e
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 11 deletions.
16 changes: 12 additions & 4 deletions src/components/ZclEndpointCard.vue
Original file line number Diff line number Diff line change
Expand Up @@ -182,10 +182,7 @@ limitations under the License.
<strong>{{ parentEndpointIdentifier[endpointReference] }}</strong>
</div>
</q-item>
<q-item
class="row"
v-if="$store.state.zap.isProfileIdShown && enableProfileId"
>
<q-item class="row" v-if="showProfileId">
<div class="col-6">
<strong>Profile ID</strong>
</div>
Expand Down Expand Up @@ -490,6 +487,17 @@ export default {
return this.$store.state.zap.endpointView.profileId
},
},
showProfileId: {
get() {
if (
this.getDeviceCategory(this.deviceType[0]?.packageRef) !== 'matter' &&
this.$store.state.zap.isProfileIdShown &&
this.enableProfileId
) {
return true
} else return false
},
},
deviceId: {
get() {
return this.$store.state.zap.endpointTypeView.deviceIdentifier
Expand Down
18 changes: 11 additions & 7 deletions src/util/common-mixin.js
Original file line number Diff line number Diff line change
Expand Up @@ -318,15 +318,19 @@ export default {
* @returns Returns a string value for category
*/
getDeviceCategory(packageRef) {
let category = ''
let zclProperty =
this.$store.state.zap.selectedZapConfig.zclProperties.find(
(item) => item.id === packageRef && item.category
let zclProperty = ''
if (this.$store.state.zap.isMultiConfig) {
zclProperty =
this.$store.state.zap.selectedZapConfig.zclProperties.find(
(item) => item.id === packageRef && item.category
)
return zclProperty.category
} else {
zclProperty = this.$store.state.zap.packages.find(
(item) => item.pkg.id === packageRef && item.pkg.category
)
if (zclProperty) {
category = zclProperty.category
return zclProperty.pkg?.category
}
return category
},
},
}

0 comments on commit 9b5793e

Please sign in to comment.