Skip to content

Commit 515ccc8

Browse files
committed
Return validValues in characteristic structure
1 parent 44cb069 commit 515ccc8

3 files changed

Lines changed: 7 additions & 3 deletions

File tree

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ All notable changes to `@homebridge/hap-client` will be documented in this file.
77
### Changed
88

99
- Updated dependencies
10+
- Return `validValues` in characteristic structure
1011

1112
## v2.1.0 (2025-04-22)
1213

src/index.ts

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -264,9 +264,9 @@ export class HapClient extends EventEmitter {
264264
/**
265265
* monitorCharacteristics
266266
* @param services - Optional array of services to monitor
267-
*
267+
*
268268
* Creates connections to all Homebridge instances and monitors all characteristics for changes. Will emit `service-update` events when characteristics change, which can be listened to.
269-
* @returns
269+
* @returns
270270
*/
271271
public async monitorCharacteristics(services?: ServiceType[]) {
272272
// If `services` is not provided, retrieve all services
@@ -276,7 +276,7 @@ export class HapClient extends EventEmitter {
276276
}
277277

278278
/**
279-
*
279+
*
280280
* @returns Array of all services from all Homebridge instances
281281
*/
282282
public async getAllServices() {
@@ -342,6 +342,7 @@ export class HapClient extends EventEmitter {
342342
maxValue: c.maxValue,
343343
minValue: c.minValue,
344344
minStep: c.minStep,
345+
validValues: c['valid-values'],
345346
canRead: c.perms.includes('pr'),
346347
canWrite: c.perms.includes('pw'),
347348
ev: c.perms.includes('ev'),

src/interfaces.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,7 @@ export interface HapAccessoriesRespType {
4040
maxValue?: number;
4141
minValue?: number;
4242
minStep?: number;
43+
validValues?: (number | string | boolean)[];
4344
}>;
4445
}>;
4546
}>;
@@ -93,6 +94,7 @@ export interface CharacteristicType {
9394
maxValue?: number;
9495
minValue?: number;
9596
minStep?: number;
97+
validValues?: (number | string | boolean)[];
9698
canRead: boolean;
9799
canWrite: boolean;
98100
ev: boolean;

0 commit comments

Comments
 (0)