Skip to content

Commit

Permalink
feat: add setting to disable controller recovery feature (#3423)
Browse files Browse the repository at this point in the history
  • Loading branch information
robertsLando authored Nov 14, 2023
1 parent 8378946 commit f956deb
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 1 deletion.
9 changes: 8 additions & 1 deletion lib/ZwaveClient.ts
Original file line number Diff line number Diff line change
Expand Up @@ -582,6 +582,7 @@ export type ZwaveConfig = {
serverServiceDiscoveryDisabled?: boolean
maxNodeEventsQueueSize?: number
higherReportsTimeout?: boolean
disableControllerRecovery?: boolean
rf?: {
region?: RFRegion
txPower?: {
Expand Down Expand Up @@ -2122,6 +2123,12 @@ class ZwaveClient extends TypedEventEmitter<ZwaveClientEventCallbacks> {
sendToSleep: this.cfg.sendToSleepTimeout,
response: this.cfg.responseTimeout,
},
features: {
unresponsiveControllerRecovery: this.cfg
.disableControllerRecovery
? false
: true,
},
userAgent: {
[pkgjson.name]: pkgjson.version,
},
Expand Down Expand Up @@ -2151,7 +2158,7 @@ class ZwaveClient extends TypedEventEmitter<ZwaveClientEventCallbacks> {

// when not set let zwavejs handle this based on the environment
if (typeof this.cfg.enableSoftReset === 'boolean') {
zwaveOptions.enableSoftReset = this.cfg.enableSoftReset
zwaveOptions.features.softReset = this.cfg.enableSoftReset
}

if (this.cfg.scales) {
Expand Down
1 change: 1 addition & 0 deletions src/stores/base.js
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@ const useBaseStore = defineStore('base', {
serverHost: undefined,
maxNodeEventsQueueSize: 100,
higherReportsTimeout: false,
disableControllerRecovery: false,
},
backup: {
storeBackup: false,
Expand Down
10 changes: 10 additions & 0 deletions src/views/Settings.vue
Original file line number Diff line number Diff line change
Expand Up @@ -858,6 +858,16 @@
"
></v-checkbox>
</v-col>
<v-col cols="12" sm="6">
<v-checkbox
hint="When disabled, commands will simply fail when the controller is unresponsive and nodes may get randomly marked as dead until the controller recovers on its own."
persistent-hint
label="Disable controller recovery"
v-model="
newZwave.disableControllerRecovery
"
></v-checkbox>
</v-col>
<input
type="hidden"
:value="newZwave.options"
Expand Down

0 comments on commit f956deb

Please sign in to comment.