Skip to content

Commit

Permalink
feat(ui): add protocol selection on inclusion
Browse files Browse the repository at this point in the history
  • Loading branch information
robertsLando committed Jan 22, 2024
1 parent 7fa7a4b commit 5e4520b
Showing 1 changed file with 29 additions and 2 deletions.
31 changes: 29 additions & 2 deletions src/components/dialogs/DialogNodesManager.vue
Original file line number Diff line number Diff line change
Expand Up @@ -504,6 +504,10 @@
persistent-hint
></v-checkbox>
<v-checkbox
v-if="
s.values.protocol ===
Protocols.ZWave
"
:disabled="
s.values.s2Unauthenticated ===
undefined
Expand All @@ -514,6 +518,10 @@
persistent-hint
></v-checkbox>
<v-checkbox
v-if="
s.values.protocol ===
Protocols.ZWave
"
:disabled="
s.values.s0Legacy === undefined
"
Expand All @@ -533,6 +541,18 @@
persistent-hint
></v-checkbox>

<v-select
v-if="
s.values.supportedProtocols
.length > 1
"
v-model="s.values.protocol"
:items="protocolsItems"
label="Protocol"
hint="Select the protocol to use for inclusion"
persistent-hint
></v-select>

<v-card-actions>
<v-btn
v-if="!aborted"
Expand Down Expand Up @@ -681,8 +701,7 @@

<script>
import { mapState } from 'pinia'
import { tryParseDSKFromQRCodeString } from '@zwave-js/core/safe'
import { Protocols, tryParseDSKFromQRCodeString } from '@zwave-js/core/safe'
import {
parseSecurityClasses,
securityClassesToArray,
Expand All @@ -692,6 +711,7 @@ import {
import useBaseStore from '../../stores/base.js'
import { InclusionStrategy, SecurityBootstrapFailure } from 'zwave-js/safe'
import InstancesMixin from '../../mixins/InstancesMixin.js'
import { protocolsItems } from '../../lib/items'
export default {
props: {
Expand All @@ -705,6 +725,8 @@ export default {
loading: false,
validNaming: true,
InclusionStrategy,
protocolsItems,
Protocols,
availableSteps: {
action: {
key: 'action',
Expand Down Expand Up @@ -745,6 +767,8 @@ export default {
s2Unauthenticated: undefined,
s0Legacy: undefined,
clientAuth: false,
supportedProtocols: [],
protocol: Protocols.ZWave,
},
},
s2Pin: {
Expand Down Expand Up @@ -1069,6 +1093,8 @@ export default {
...grantStep.values,
...parseSecurityClasses(classes),
clientAuth: requested.clientSideAuth || undefined,
supportedProtocols: requested.supportedProtocols || [],
protocol: Protocols.ZWave,
}
if (this.waitTimeout) {
Expand Down Expand Up @@ -1190,6 +1216,7 @@ export default {
{
securityClasses,
clientSideAuth: !!values.clientAuth,
protocol: values.protocol,
},
])
} else if (s.key === 's2Pin') {
Expand Down

0 comments on commit 5e4520b

Please sign in to comment.