• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

zwave-js / zwave-js-ui / 39441114164
17%

Build:
DEFAULT BRANCH: master
Ran 20 Oct 2026 02:40PM UTC
Jobs 1
Files 46
Run time 1min
Badge
Embed ▾
README BADGES
x

If you need to use a raster PNG badge, change the '.svg' to '.png' in the link

Markdown

Textile

RDoc

HTML

Rst

20 Oct 2026 02:38PM UTC coverage: 14.953% (+0.1%) from 14.829%
39441114164

push

github

web-flow
fix(driver): don't let external presets wipe sibling driver options (#4830)

## The bug

Driver presets from the external settings file were applied with
`Object.assign(zwaveOptions, preset)`. `Object.assign` is shallow, so a
preset replaced the whole top-level object it touched instead of merging
into it.

Two presets carry a `features` object:

```js
NO_CONTROLLER_RECOVERY: { features: { unresponsiveControllerRecovery: false } },
NO_WATCHDOG:            { features: { watchdog: false } },
```

`ZwaveClient` builds `features` from the settings, including
`features.softReset` from `enableSoftReset`. Applying either preset
dropped `softReset`, and the driver fell back to its default (enabled).
In the Home Assistant add-on that means: with `disable_watchdog` or
`disable_controller_recovery` on, `soft_reset: Disabled` was ignored.
`SAFE_MODE` had the same effect on `timeouts`.

## The fix

`Driver`'s constructor already takes presets as extra arguments and deep
merges them (`constructor(port, ...optionsAndPresets)`). Presets are now
resolved by `getExternalDriverPresets()` and passed to it:

```ts
this._driver = new Driver(this.cfg.port, zwaveOptions, ...getExternalDriverPresets())
```

A preset now overrides only the values it defines. One test passes the
resolved `NO_WATCHDOG` preset to `Driver` and checks that
`features.softReset: false` survives. It covers the preset resolution
and the merge, not the `ZwaveClient` call site.

## Merge with the next zwave-js bump

Passing the shared `driverPresets` objects as-is depends on
zwave-js/zwave-js#9306. Without it, `mergeDeep` stores a preset's nested
objects by reference and writes driver defaults into them. #9306 is
merged but not yet released (it landed after v15.31.1), so this should
go in together with the zwave-js update that includes it.

## Not in this PR

This doesn't fix the case reported in #4829. That reporter has no preset
enabled. Their add-on options were reset to defaults by a Home Assistant
c... (continued)

633 of 4566 branches covered (13.86%)

Branch coverage included in aggregate %.

5 of 7 new or added lines in 2 files covered. (71.43%)

1103 of 7044 relevant lines covered (15.66%)

2.31 hits per line

Uncovered Changes

Lines Coverage ∆ File
1
1.37
0.0% api/lib/ZwaveClient.ts
1
11.61
6.3% api/lib/externalSettings.ts
Jobs
ID Job ID Ran Files Coverage
1 39441114164.1 20 Oct 2026 02:40PM UTC 46
14.95
GitHub Action Run
Source Files on build 39441114164
  • Tree
  • List 46
  • Changed 2
  • Source Changed 2
  • Coverage Changed 2
Coverage ∆ File Lines Relevant Covered Missed Hits/Line Branch Hits Branch Misses
  • Back to Repo
  • Github Actions Build #39441114164
  • 682318c0 on github
  • Prev Build on master (#39438556836)
  • Next Build on master (#39442394548)
  • Delete
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE TRIAL · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc