Skip to content

Commit

Permalink
fix(ui): groups associations for LR nodes (#3702)
Browse files Browse the repository at this point in the history
  • Loading branch information
robertsLando authored May 7, 2024
1 parent e51cf52 commit 3b9505b
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 3 deletions.
14 changes: 12 additions & 2 deletions src/components/dialogs/DialogAssociation.vue
Original file line number Diff line number Diff line change
Expand Up @@ -118,10 +118,13 @@
</template>

<script>
import { Protocols } from '@zwave-js/core/safe'
import { mapState } from 'pinia'
import useBaseStore from '../../stores/base.js'
export default {
props: {
value: Boolean,
nodes: Array,
associations: Array,
node: Object,
},
Expand All @@ -132,8 +135,15 @@ export default {
},
},
computed: {
...mapState(useBaseStore, ['controllerNode', 'nodes']),
filteredNodes() {
return this.nodes.filter((n) => n.id !== this.node.id)
return this.node.protocol === Protocols.ZWaveLongRange
? [this.controllerNode]
: this.nodes.filter(
(n) =>
n.id !== this.node.id &&
n.protocol !== Protocols.ZWaveLongRange,
)
},
endpoints() {
return this.getEndpointItems(this.node)
Expand Down
1 change: 0 additions & 1 deletion src/components/nodes-table/AssociationGroups.vue
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,6 @@
@add="addAssociation"
@close="dialogAssociation = false"
v-model="dialogAssociation"
:nodes="nodes"
:node="node"
:associations="associations"
/>
Expand Down
5 changes: 5 additions & 0 deletions src/components/nodes-table/ExpandedNode.vue
Original file line number Diff line number Diff line change
Expand Up @@ -355,6 +355,11 @@ export default {
},
computed: {
...mapState(useBaseStore, ['gateway', 'mqtt']),
isLongRange() {
if (!this.node) return false
return this.node.protocol === Protocols.ZWaveLongRange
},
nodeMetadata() {
return this.node.deviceConfig?.metadata
},
Expand Down

0 comments on commit 3b9505b

Please sign in to comment.