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

zwave-js / zwave-js-ui / 22727422046
18%

Build:
DEFAULT BRANCH: master
Ran 05 Mar 2026 04:25PM UTC
Jobs 1
Files 70
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

05 Mar 2026 04:24PM UTC coverage: 18.312% (-0.002%) from 18.314%
22727422046

push

github

web-flow
feat(ui): validate number inputs against allowed values from config (#4566)

## Implementation Plan: Add Support for Configuration Value `allowed`
Field

### Understanding
- Z-Wave JS now supports `allowed` field in ValueMetadataNumeric for
defining specific allowed values (ranges with gaps)
- The `allowed` field is an array of `AllowedValue` objects: `{ value:
number } | { from: number, to: number, step?: number }`

### Changes Required

- [x] Explore codebase and understand current validation implementation
- [x] Add `allowed` field to `ZUIValueId` TypeScript type in backend
(`api/lib/ZwaveClient.ts`)
- [x] Update `_updateValueMetadata()` to pass `allowed` field from
Z-Wave JS metadata to frontend
- [x] Update `ValueId.vue` component to validate against `allowed`
values when present
- [x] Update validation logic to prioritize `allowed` over `min`/`max`
when both exist
- [x] Update error messages to reflect allowed values validation
- [x] Extract helper method to reduce code duplication (code review
feedback)
- [x] Add JSDoc documentation to new methods (code review feedback)
- [x] Fix validation for combobox inputs with `allowManualEntry` (issue
#4561 comment)
- [x] **Coerce value to number in `isValueAllowed()` and
`numberOutOfRange()` to handle string inputs from v-combobox** (PR
review feedback)
- [x] Run linting and tests (all pass)

### Files Modified
1. `api/lib/ZwaveClient.ts` - Added `allowed` field to `ZUIValueId` type
and pass it from metadata
2. `src/components/ValueId.vue` - Updated validation logic with number
coercion to handle string inputs from v-combobox

<!-- START COPILOT ORIGINAL PROMPT -->



<details>

<summary>Original prompt</summary>

> 
> ----
> 
> *This section details on the original issue you should resolve*
> 
> <issue_title>feat(ui): validate number inputs against allowed from
config</issue_title>
> <issue_description>**Is your feature request related to a problem?
Please describe.**
> After zwave-js/zwave-js-ui#4288 w... (continued)

334 of 444 branches covered (75.23%)

Branch coverage included in aggregate %.

0 of 3 new or added lines in 1 file covered. (0.0%)

4054 of 23519 relevant lines covered (17.24%)

1.07 hits per line

New Missed Lines in Diff

Lines Coverage ∆ File
3
0.0
0.0% api/lib/ZwaveClient.ts
Jobs
ID Job ID Ran Files Coverage
1 22727422046.1 05 Mar 2026 04:25PM UTC 70
18.31
GitHub Action Run
Source Files on build 22727422046
  • Tree
  • List 70
  • Changed 1
  • Source Changed 0
  • Coverage Changed 1
Coverage ∆ File Lines Relevant Covered Missed Hits/Line Branch Hits Branch Misses
  • Back to Repo
  • 0c365d7c on github
  • Prev Build on master (#22675447653)
  • Delete
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc