Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

bug where attribute reporting dissapears #1514

Merged
merged 5 commits into from
Feb 3, 2025
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 5 additions & 3 deletions src/util/editable-attributes-mixin.js
Original file line number Diff line number Diff line change
Expand Up @@ -191,7 +191,7 @@ export default {
}
this.$store.dispatch('zap/updateSelectedAttribute', editContext)
},
toggleAttributeSelection(list, listType, attributeData, clusterId) {
async toggleAttributeSelection(list, listType, attributeData, clusterId) {
// We determine the ID that we need to toggle within the list.
// This ID comes from hashing the base ZCL attribute and cluster data.
let indexOfValue = list.indexOf(
Expand Down Expand Up @@ -221,14 +221,16 @@ export default {
reportMinInterval: attributeData.reportMinInterval,
reportMaxInterval: attributeData.reportMaxInterval
}
this.$store.dispatch('zap/updateSelectedAttribute', editContext)
// Wait for the first dispatch to complete
await this.$store.dispatch('zap/updateSelectedAttribute', editContext)

if (
addedValue &&
listType === 'selectedAttributes' &&
attributeData.isReportable
) {
editContext.listType = 'selectedReporting'
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What does editContext.listType = 'selectedReporting' do?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It identifies the list type

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

if ( addedValue && listType === 'selectedAttributes' && attributeData.isReportable ) { editContext.listType = 'selectedReporting' } this.$store.dispatch('zap/updateSelectedAttribute', editContext)

Will be safer to do this. Getting rid of that line can cause issues if unsure of its removal.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

it breaks because both dispatch collide with each other
I think you're right.

this.$store.dispatch('zap/updateSelectedAttribute', editContext)
await this.$store.dispatch('zap/updateSelectedAttribute', editContext)
}
},

Expand Down