Skip to content

Commit

Permalink
feat: [email protected] and nodeFilter setting support (#728)
Browse files Browse the repository at this point in the history
  • Loading branch information
robertsLando authored Feb 24, 2021
1 parent 2fb0fc6 commit 3f12c2a
Show file tree
Hide file tree
Showing 4 changed files with 55 additions and 25 deletions.
6 changes: 5 additions & 1 deletion lib/ZwaveClient.js
Original file line number Diff line number Diff line change
Expand Up @@ -1674,7 +1674,11 @@ ZwaveClient.prototype.connect = async function () {
level: loglevels[this.cfg.logLevel],
logToFile: this.cfg.logToFile,
filename: ZWAVEJS_LOG_FILE,
forceConsole: true
forceConsole: true,
nodeFilter:
this.cfg.nodeFilter && this.cfg.nodeFilter.length > 0
? this.cfg.nodeFilter.map(n => parseInt(n))
: undefined
}
},
this.cfg.options
Expand Down
52 changes: 29 additions & 23 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -166,7 +166,7 @@
"vuetify": "^2.4.5",
"vuex": "^3.6.2",
"winston": "^3.3.3",
"zwave-js": "^6.4.0"
"zwave-js": "^6.5.0"
},
"devDependencies": {
"@babel/cli": "^7.13.0",
Expand Down
20 changes: 20 additions & 0 deletions src/components/Settings.vue
Original file line number Diff line number Diff line change
Expand Up @@ -172,6 +172,19 @@
v-model="newZwave.logToFile"
></v-switch>
</v-col>
<v-col v-if="newZwave.logEnabled" cols="12" sm="6">
<v-combobox
hint="Choose which nodes to log. Leave this empty to log all nodes"
persistent-hint
label="Log nodes"
:items="newZwave.nodeFilter || []"
multiple
:rules="[rules.validNodeLog]"
chips
deletable-chips
v-model="newZwave.nodeFilter"
></v-combobox>
</v-col>
<v-col cols="6">
<v-text-field
v-model.number="newZwave.commandsTimeout"
Expand Down Expand Up @@ -685,6 +698,13 @@ export default {
return valid || 'This field is required.'
},
validNodeLog: values => {
return (
!values ||
values.every(v => v > 0 && v < 233) ||
'Nodes must be between 1-232'
)
},
validName: value => {
return (
!/[!@#$%^&*)(+=:,;"'\\|?{}£°§<>[\]/.\s]/g.test(value) ||
Expand Down

0 comments on commit 3f12c2a

Please sign in to comment.