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

zwave-js / zwave-js-ui / 32738887050
16%

Build:
DEFAULT BRANCH: master
Ran 24 Aug 2026 02:29PM UTC
Jobs 1
Files 50
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

24 Aug 2026 02:28PM UTC coverage: 12.766% (+0.4%) from 12.406%
32738887050

push

github

web-flow
feat(mqtt): discover Window Covering CC as HA cover entities (#4794)

Closes #4782

## Problem

`Window Covering` (CC 0x6A) had no case in the discovery `switch
(cmdClass)` in `api/lib/Gateway.ts`, so it fell through to `default:
return` and no entity was ever published. Devices that implement it
instead of `Multilevel Switch` — e.g. the Fibaro FGR-224 from the issue
— showed up in Home Assistant without any cover.

The values themselves were already published on their normal MQTT
topics; only the discovery config was missing.

## Change

A `case CommandClasses['Window Covering']` next to the Multilevel Switch
branch. For each **positioned** parameter it publishes a
`cover_position` entity:

- `position_topic` → `currentValue` (0-99)
- `command_topic` / `set_position_topic` → `targetValue`
- `object_id` gets the parameter name appended, so a node exposing more
than one parameter (shutter + slats) gets one cover each:
`cover.<node>_position_outbound_bottom`

Even-numbered parameters are skipped. zwave-js creates metadata for them
but never queries a position (`refreshValues` filters to `param % 2 !=
0`) and `setValue` on their `targetValue` throws, so there is nothing to
map onto an HA cover.

### Stop payload

`parsePayload` already intercepted the HA stop payload for covers and
wrote `property: 'Up'`. That property only exists on `Multilevel
Switch`; on Window Covering it would throw `throwUnsupportedProperty`.
It now picks `levelChangeUp` for this CC, which zwave-js turns into
`stopLevelChange(parameter)` when written with `false`.

## Not included

`levelChangeUp` / `levelChangeDown` are not exposed as separate HA
entities — open/close go through `targetValue` (99/0), same as the
FGR-223 behaviour the reporter compared against. Happy to add button
entities for them in a follow-up if wanted.

## Tests

Three cases added to `test/lib/Gateway.test.ts` covering the stop
routing per CC and that position payloads pass through untouched. Full
suite: 208 p... (continued)

519 of 4543 branches covered (11.42%)

Branch coverage included in aggregate %.

1 of 9 new or added lines in 1 file covered. (11.11%)

956 of 7011 relevant lines covered (13.64%)

2.09 hits per line

Uncovered Changes

Lines Coverage ∆ File
8
6.57
2.56% api/lib/Gateway.ts
Jobs
ID Job ID Ran Files Coverage
1 32738887050.1 24 Aug 2026 02:28PM UTC 50
12.77
GitHub Action Run
Source Files on build 32738887050
  • Tree
  • List 50
  • Changed 1
  • Source Changed 0
  • Coverage Changed 1
Coverage ∆ File Lines Relevant Covered Missed Hits/Line Branch Hits Branch Misses
  • Back to Repo
  • bb96594d on github
  • Prev Build on master (#32737562744)
  • Next Build on master (#32739716961)
  • 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