hap-fluent / isFluentCharacteristic
Function: isFluentCharacteristic()
ts
function isFluentCharacteristic(value): value is FluentCharacteristic<CharacteristicValue>;Defined in: packages/hap-fluent/src/type-utils.ts:115
Determine whether value is a FluentCharacteristic instance.
Parameters
| Parameter | Type | Description |
|---|---|---|
value | unknown | Value to test. |
Returns
value is FluentCharacteristic<CharacteristicValue>
true if value has set and get functions (duck-type match).
Remarks
Uses duck-typing to check for set and get methods, matching the FluentCharacteristic public API without requiring an instanceof check.
Example
typescript
if (isFluentCharacteristic(obj)) {
obj.set(true);
}