Skip to content

Commit

Permalink
fix: removeAssociation with multi instance devices (#644)
Browse files Browse the repository at this point in the history
  • Loading branch information
robertsLando authored Jul 28, 2020
1 parent ca1f92a commit 0b7c942
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions src/components/ControlPanel.vue
Original file line number Diff line number Diff line change
Expand Up @@ -1290,17 +1290,23 @@ export default {
// wait a moment before refresh to check if the node
// has been added to the group correctly
setTimeout(this.getAssociations, 500)
setTimeout(this.getAssociations, 1000)
}
},
removeAssociation () {
var g = this.group
var target = !isNaN(g.target) ? parseInt(g.target) : g.target.node_id
if (g && g.node && target) {
this.apiRequest('removeAssociation', [g.node.node_id, g.group, target])
var args = [g.node.node_id, g.group, target]
if (g.multiInstance) {
args.push(g.targetInstance || 0)
}
this.apiRequest('removeAssociation', args)
// wait a moment before refresh to check if the node
// has been added to the group correctly
setTimeout(this.getAssociations, 500)
setTimeout(this.getAssociations, 1000)
}
},
updateValue (v) {
Expand Down

0 comments on commit 0b7c942

Please sign in to comment.