Skip to content

Commit

Permalink
feat: show associations of multi-instance devices #637 (#640)
Browse files Browse the repository at this point in the history
  • Loading branch information
robertsLando authored Jul 24, 2020
1 parent 5c15a4f commit 305ff61
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 5 deletions.
4 changes: 2 additions & 2 deletions src/App.vue
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@
</v-tooltip>
</v-app-bar>
<main>
<v-content>
<v-main>
<router-view
@import="importFile"
@export="exportConfiguration"
Expand All @@ -72,7 +72,7 @@
:socketEvents="socketEvents"
:socketActions="socketActions"
/>
</v-content>
</v-main>
</main>

<v-snackbar
Expand Down
11 changes: 8 additions & 3 deletions src/components/ControlPanel.vue
Original file line number Diff line number Diff line change
Expand Up @@ -1272,7 +1272,7 @@ export default {
getAssociations () {
var g = this.group
if (g && g.node) {
this.apiRequest('getAssociations', [g.node.node_id, g.group])
this.apiRequest('getAssociationsInstances', [g.node.node_id, g.group])
}
},
addAssociation () {
Expand Down Expand Up @@ -1436,8 +1436,13 @@ export default {
this.socket.on(this.socketEvents.api, async data => {
if (data.success) {
switch (data.api) {
case 'getAssociations':
data.result = data.result.map(a => self.nodes[a]._name || a)
case 'getAssociationsInstances':
data.result = data.result.map(
a =>
`- Node: ${self.nodes[a.nodeid]._name || a} Instance: ${
a.instance
}`
)
self.$set(self.group, 'associations', data.result.join('\n'))
break
case '_getScenes':
Expand Down

0 comments on commit 305ff61

Please sign in to comment.