Skip to content

Commit

Permalink
enable featureMap change and show warning
Browse files Browse the repository at this point in the history
  • Loading branch information
ethanzhouyc committed Nov 13, 2024
1 parent c5f45e9 commit cb06253
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 17 deletions.
27 changes: 10 additions & 17 deletions src/components/ZclAttributeManager.vue
Original file line number Diff line number Diff line change
Expand Up @@ -184,13 +184,7 @@ limitations under the License.
? 'grey'
: ''
"
:disable="
isDisabledDefault(
props.row.id,
selectedCluster.id,
props.row.code
)
"
:disable="isDisabledDefault(props.row.id, selectedCluster.id)"
:model-value="
props.row.isNullable &&
defaultValueCheck(props.row.id, selectedCluster.id) === null
Expand Down Expand Up @@ -267,16 +261,15 @@ export default {
})
},
//return true and disable default field if Storage is External AND if attribute is not enabled
// also disable default field for featureMap attribute
isDisabledDefault(id, selectedClusterId, code) {
return code == 0xfffc
? true
: !this.selection.includes(
this.hashAttributeIdClusterId(id, selectedClusterId)
) ||
this.selectionStorageOption[
this.hashAttributeIdClusterId(id, selectedClusterId)
] == 'External'
isDisabledDefault(id, selectedClusterId) {
return (
!this.selection.includes(
this.hashAttributeIdClusterId(id, selectedClusterId)
) ||
this.selectionStorageOption[
this.hashAttributeIdClusterId(id, selectedClusterId)
] == 'External'
)
},
//return true and disable Storage if forced External AND if attribute is not enabled
isDisabledStorage(id, name, selectedClusterId) {
Expand Down
14 changes: 14 additions & 0 deletions src/util/editable-attributes-mixin.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
*/
import Vue from 'vue'
import CommonMixin from '../util/common-mixin'
import { Notify } from 'quasar'

/**
* This module provides common properties used across various vue components related to attribute editting.
Expand Down Expand Up @@ -174,6 +175,9 @@ export default {
}
},
handleAttributeDefaultChange(newValue, listType, attributeData, clusterId) {
if (listType == 'defaultValue' && attributeData.code == 0xfffc) {
this.showWarningOnFeatureMapChange()
}
let editContext = {
action: 'text',
endpointTypeIdList: this.endpointTypeIdList,
Expand Down Expand Up @@ -273,6 +277,16 @@ export default {
editState: false
})
},
showWarningOnFeatureMapChange() {
Notify.create({
message: `Manually changing the value of featureMap
attribute may lead to incorrect device type configurations.`,
type: 'warning',
classes: 'custom-notification notification-warning',
position: 'top',
html: true
})
},

sortByText(x, y, ascendingA, ascendingB, callback = (i, j) => 0) {
return x.toLowerCase() > y.toLowerCase()
Expand Down

0 comments on commit cb06253

Please sign in to comment.