Skip to content

Commit

Permalink
fix(ui): only show controller as target in LR nodes associations
Browse files Browse the repository at this point in the history
  • Loading branch information
robertsLando committed May 7, 2024
1 parent b885f1e commit 0db468a
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 7 deletions.
16 changes: 10 additions & 6 deletions src/components/dialogs/DialogAssociation.vue
Original file line number Diff line number Diff line change
Expand Up @@ -119,11 +119,12 @@

<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 @@ -134,12 +135,15 @@ export default {
},
},
computed: {
...mapState(useBaseStore, ['controllerNode', 'nodes']),
filteredNodes() {
return this.nodes.filter(
(n) =>
n.id !== this.node.id &&
n.protocol !== Protocols.ZWaveLongRange,
)
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

0 comments on commit 0db468a

Please sign in to comment.