@zwave-js/cc 9.3.1-0-pr-4662-79458fb
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/build/cc/AlarmSensorCC.d.ts +54 -0
- package/build/cc/AlarmSensorCC.d.ts.map +1 -0
- package/build/cc/AlarmSensorCC.js +378 -0
- package/build/cc/AlarmSensorCC.js.map +1 -0
- package/build/cc/AssociationCC.d.ts +123 -0
- package/build/cc/AssociationCC.d.ts.map +1 -0
- package/build/cc/AssociationCC.js +615 -0
- package/build/cc/AssociationCC.js.map +1 -0
- package/build/cc/AssociationGroupInfoCC.d.ts +97 -0
- package/build/cc/AssociationGroupInfoCC.d.ts.map +1 -0
- package/build/cc/AssociationGroupInfoCC.js +530 -0
- package/build/cc/AssociationGroupInfoCC.js.map +1 -0
- package/build/cc/BarrierOperatorCC.d.ts +75 -0
- package/build/cc/BarrierOperatorCC.d.ts.map +1 -0
- package/build/cc/BarrierOperatorCC.js +492 -0
- package/build/cc/BarrierOperatorCC.js.map +1 -0
- package/build/cc/BasicCC.d.ts +51 -0
- package/build/cc/BasicCC.d.ts.map +1 -0
- package/build/cc/BasicCC.js +344 -0
- package/build/cc/BasicCC.js.map +1 -0
- package/build/cc/BatteryCC.d.ts +56 -0
- package/build/cc/BatteryCC.d.ts.map +1 -0
- package/build/cc/BatteryCC.js +417 -0
- package/build/cc/BatteryCC.js.map +1 -0
- package/build/cc/BinarySensorCC.d.ts +52 -0
- package/build/cc/BinarySensorCC.d.ts.map +1 -0
- package/build/cc/BinarySensorCC.js +321 -0
- package/build/cc/BinarySensorCC.js.map +1 -0
- package/build/cc/BinarySwitchCC.d.ts +55 -0
- package/build/cc/BinarySwitchCC.d.ts.map +1 -0
- package/build/cc/BinarySwitchCC.js +327 -0
- package/build/cc/BinarySwitchCC.js.map +1 -0
- package/build/cc/CRC16CC.d.ts +28 -0
- package/build/cc/CRC16CC.d.ts.map +1 -0
- package/build/cc/CRC16CC.js +109 -0
- package/build/cc/CRC16CC.js.map +1 -0
- package/build/cc/CentralSceneCC.d.ts +69 -0
- package/build/cc/CentralSceneCC.d.ts.map +1 -0
- package/build/cc/CentralSceneCC.js +443 -0
- package/build/cc/CentralSceneCC.js.map +1 -0
- package/build/cc/ClimateControlScheduleCC.d.ts +78 -0
- package/build/cc/ClimateControlScheduleCC.d.ts.map +1 -0
- package/build/cc/ClimateControlScheduleCC.js +417 -0
- package/build/cc/ClimateControlScheduleCC.js.map +1 -0
- package/build/cc/ClockCC.d.ts +40 -0
- package/build/cc/ClockCC.d.ts.map +1 -0
- package/build/cc/ClockCC.js +185 -0
- package/build/cc/ClockCC.js.map +1 -0
- package/build/cc/ColorSwitchCC.d.ts +98 -0
- package/build/cc/ColorSwitchCC.d.ts.map +1 -0
- package/build/cc/ColorSwitchCC.js +1045 -0
- package/build/cc/ColorSwitchCC.js.map +1 -0
- package/build/cc/ConfigurationCC.d.ts +315 -0
- package/build/cc/ConfigurationCC.d.ts.map +1 -0
- package/build/cc/ConfigurationCC.js +2257 -0
- package/build/cc/ConfigurationCC.js.map +1 -0
- package/build/cc/DeviceResetLocallyCC.d.ts +9 -0
- package/build/cc/DeviceResetLocallyCC.d.ts.map +1 -0
- package/build/cc/DeviceResetLocallyCC.js +28 -0
- package/build/cc/DeviceResetLocallyCC.js.map +1 -0
- package/build/cc/DoorLockCC.d.ts +116 -0
- package/build/cc/DoorLockCC.d.ts.map +1 -0
- package/build/cc/DoorLockCC.js +1112 -0
- package/build/cc/DoorLockCC.js.map +1 -0
- package/build/cc/DoorLockLoggingCC.d.ts +41 -0
- package/build/cc/DoorLockLoggingCC.d.ts.map +1 -0
- package/build/cc/DoorLockLoggingCC.js +288 -0
- package/build/cc/DoorLockLoggingCC.js.map +1 -0
- package/build/cc/EntryControlCC.d.ts +71 -0
- package/build/cc/EntryControlCC.d.ts.map +1 -0
- package/build/cc/EntryControlCC.js +492 -0
- package/build/cc/EntryControlCC.js.map +1 -0
- package/build/cc/FirmwareUpdateMetaDataCC.d.ts +148 -0
- package/build/cc/FirmwareUpdateMetaDataCC.d.ts.map +1 -0
- package/build/cc/FirmwareUpdateMetaDataCC.js +727 -0
- package/build/cc/FirmwareUpdateMetaDataCC.js.map +1 -0
- package/build/cc/HailCC.d.ts +6 -0
- package/build/cc/HailCC.d.ts.map +1 -0
- package/build/cc/HailCC.js +23 -0
- package/build/cc/HailCC.js.map +1 -0
- package/build/cc/HumidityControlModeCC.d.ts +47 -0
- package/build/cc/HumidityControlModeCC.d.ts.map +1 -0
- package/build/cc/HumidityControlModeCC.js +288 -0
- package/build/cc/HumidityControlModeCC.js.map +1 -0
- package/build/cc/HumidityControlOperatingStateCC.d.ts +24 -0
- package/build/cc/HumidityControlOperatingStateCC.d.ts.map +1 -0
- package/build/cc/HumidityControlOperatingStateCC.js +129 -0
- package/build/cc/HumidityControlOperatingStateCC.js.map +1 -0
- package/build/cc/HumidityControlSetpointCC.d.ts +103 -0
- package/build/cc/HumidityControlSetpointCC.d.ts.map +1 -0
- package/build/cc/HumidityControlSetpointCC.js +626 -0
- package/build/cc/HumidityControlSetpointCC.js.map +1 -0
- package/build/cc/IndicatorCC.d.ts +88 -0
- package/build/cc/IndicatorCC.d.ts.map +1 -0
- package/build/cc/IndicatorCC.js +758 -0
- package/build/cc/IndicatorCC.js.map +1 -0
- package/build/cc/IrrigationCC.d.ts +278 -0
- package/build/cc/IrrigationCC.d.ts.map +1 -0
- package/build/cc/IrrigationCC.js +2062 -0
- package/build/cc/IrrigationCC.js.map +1 -0
- package/build/cc/LanguageCC.d.ts +41 -0
- package/build/cc/LanguageCC.d.ts.map +1 -0
- package/build/cc/LanguageCC.js +220 -0
- package/build/cc/LanguageCC.js.map +1 -0
- package/build/cc/LockCC.d.ts +41 -0
- package/build/cc/LockCC.d.ts.map +1 -0
- package/build/cc/LockCC.js +185 -0
- package/build/cc/LockCC.js.map +1 -0
- package/build/cc/ManufacturerProprietaryCC.d.ts +31 -0
- package/build/cc/ManufacturerProprietaryCC.d.ts.map +1 -0
- package/build/cc/ManufacturerProprietaryCC.js +275 -0
- package/build/cc/ManufacturerProprietaryCC.js.map +1 -0
- package/build/cc/ManufacturerSpecificCC.d.ts +59 -0
- package/build/cc/ManufacturerSpecificCC.d.ts.map +1 -0
- package/build/cc/ManufacturerSpecificCC.js +285 -0
- package/build/cc/ManufacturerSpecificCC.js.map +1 -0
- package/build/cc/MeterCC.d.ts +100 -0
- package/build/cc/MeterCC.d.ts.map +1 -0
- package/build/cc/MeterCC.js +820 -0
- package/build/cc/MeterCC.js.map +1 -0
- package/build/cc/MultiChannelAssociationCC.d.ts +127 -0
- package/build/cc/MultiChannelAssociationCC.d.ts.map +1 -0
- package/build/cc/MultiChannelAssociationCC.js +883 -0
- package/build/cc/MultiChannelAssociationCC.js.map +1 -0
- package/build/cc/MultiChannelCC.d.ts +164 -0
- package/build/cc/MultiChannelCC.d.ts.map +1 -0
- package/build/cc/MultiChannelCC.js +1004 -0
- package/build/cc/MultiChannelCC.js.map +1 -0
- package/build/cc/MultiCommandCC.d.ts +28 -0
- package/build/cc/MultiCommandCC.d.ts.map +1 -0
- package/build/cc/MultiCommandCC.js +137 -0
- package/build/cc/MultiCommandCC.js.map +1 -0
- package/build/cc/MultilevelSensorCC.d.ts +83 -0
- package/build/cc/MultilevelSensorCC.d.ts.map +1 -0
- package/build/cc/MultilevelSensorCC.js +633 -0
- package/build/cc/MultilevelSensorCC.js.map +1 -0
- package/build/cc/MultilevelSwitchCC.d.ts +86 -0
- package/build/cc/MultilevelSwitchCC.d.ts.map +1 -0
- package/build/cc/MultilevelSwitchCC.js +774 -0
- package/build/cc/MultilevelSwitchCC.js.map +1 -0
- package/build/cc/NoOperationCC.d.ts +17 -0
- package/build/cc/NoOperationCC.d.ts.map +1 -0
- package/build/cc/NoOperationCC.js +50 -0
- package/build/cc/NoOperationCC.js.map +1 -0
- package/build/cc/NodeNamingCC.d.ts +57 -0
- package/build/cc/NodeNamingCC.d.ts.map +1 -0
- package/build/cc/NodeNamingCC.js +313 -0
- package/build/cc/NodeNamingCC.js.map +1 -0
- package/build/cc/NotificationCC.d.ts +127 -0
- package/build/cc/NotificationCC.d.ts.map +1 -0
- package/build/cc/NotificationCC.js +1193 -0
- package/build/cc/NotificationCC.js.map +1 -0
- package/build/cc/PowerlevelCC.d.ts +63 -0
- package/build/cc/PowerlevelCC.d.ts.map +1 -0
- package/build/cc/PowerlevelCC.js +262 -0
- package/build/cc/PowerlevelCC.js.map +1 -0
- package/build/cc/ProtectionCC.d.ts +94 -0
- package/build/cc/ProtectionCC.d.ts.map +1 -0
- package/build/cc/ProtectionCC.js +630 -0
- package/build/cc/ProtectionCC.js.map +1 -0
- package/build/cc/SceneActivationCC.d.ts +34 -0
- package/build/cc/SceneActivationCC.d.ts.map +1 -0
- package/build/cc/SceneActivationCC.js +170 -0
- package/build/cc/SceneActivationCC.js.map +1 -0
- package/build/cc/SceneActuatorConfigurationCC.d.ts +52 -0
- package/build/cc/SceneActuatorConfigurationCC.d.ts.map +1 -0
- package/build/cc/SceneActuatorConfigurationCC.js +368 -0
- package/build/cc/SceneActuatorConfigurationCC.js.map +1 -0
- package/build/cc/SceneControllerConfigurationCC.d.ts +61 -0
- package/build/cc/SceneControllerConfigurationCC.d.ts.map +1 -0
- package/build/cc/SceneControllerConfigurationCC.js +444 -0
- package/build/cc/SceneControllerConfigurationCC.js.map +1 -0
- package/build/cc/Security2CC.d.ts +213 -0
- package/build/cc/Security2CC.d.ts.map +1 -0
- package/build/cc/Security2CC.js +1124 -0
- package/build/cc/Security2CC.js.map +1 -0
- package/build/cc/SecurityCC.d.ts +109 -0
- package/build/cc/SecurityCC.d.ts.map +1 -0
- package/build/cc/SecurityCC.js +609 -0
- package/build/cc/SecurityCC.js.map +1 -0
- package/build/cc/SoundSwitchCC.d.ts +87 -0
- package/build/cc/SoundSwitchCC.d.ts.map +1 -0
- package/build/cc/SoundSwitchCC.js +548 -0
- package/build/cc/SoundSwitchCC.js.map +1 -0
- package/build/cc/SupervisionCC.d.ts +63 -0
- package/build/cc/SupervisionCC.d.ts.map +1 -0
- package/build/cc/SupervisionCC.js +239 -0
- package/build/cc/SupervisionCC.js.map +1 -0
- package/build/cc/ThermostatFanModeCC.d.ts +53 -0
- package/build/cc/ThermostatFanModeCC.d.ts.map +1 -0
- package/build/cc/ThermostatFanModeCC.js +359 -0
- package/build/cc/ThermostatFanModeCC.js.map +1 -0
- package/build/cc/ThermostatFanStateCC.d.ts +24 -0
- package/build/cc/ThermostatFanStateCC.d.ts.map +1 -0
- package/build/cc/ThermostatFanStateCC.js +131 -0
- package/build/cc/ThermostatFanStateCC.js.map +1 -0
- package/build/cc/ThermostatModeCC.d.ts +58 -0
- package/build/cc/ThermostatModeCC.d.ts.map +1 -0
- package/build/cc/ThermostatModeCC.js +370 -0
- package/build/cc/ThermostatModeCC.js.map +1 -0
- package/build/cc/ThermostatOperatingStateCC.d.ts +24 -0
- package/build/cc/ThermostatOperatingStateCC.d.ts.map +1 -0
- package/build/cc/ThermostatOperatingStateCC.js +127 -0
- package/build/cc/ThermostatOperatingStateCC.js.map +1 -0
- package/build/cc/ThermostatSetbackCC.d.ts +42 -0
- package/build/cc/ThermostatSetbackCC.d.ts.map +1 -0
- package/build/cc/ThermostatSetbackCC.js +237 -0
- package/build/cc/ThermostatSetbackCC.js.map +1 -0
- package/build/cc/ThermostatSetpointCC.d.ts +98 -0
- package/build/cc/ThermostatSetpointCC.d.ts.map +1 -0
- package/build/cc/ThermostatSetpointCC.js +707 -0
- package/build/cc/ThermostatSetpointCC.js.map +1 -0
- package/build/cc/TimeCC.d.ts +78 -0
- package/build/cc/TimeCC.d.ts.map +1 -0
- package/build/cc/TimeCC.js +373 -0
- package/build/cc/TimeCC.js.map +1 -0
- package/build/cc/TimeParametersCC.d.ts +40 -0
- package/build/cc/TimeParametersCC.d.ts.map +1 -0
- package/build/cc/TimeParametersCC.js +275 -0
- package/build/cc/TimeParametersCC.js.map +1 -0
- package/build/cc/TransportServiceCC.d.ts +101 -0
- package/build/cc/TransportServiceCC.d.ts.map +1 -0
- package/build/cc/TransportServiceCC.js +404 -0
- package/build/cc/TransportServiceCC.js.map +1 -0
- package/build/cc/UserCodeCC.d.ts +219 -0
- package/build/cc/UserCodeCC.d.ts.map +1 -0
- package/build/cc/UserCodeCC.js +1526 -0
- package/build/cc/UserCodeCC.js.map +1 -0
- package/build/cc/VersionCC.d.ts +91 -0
- package/build/cc/VersionCC.d.ts.map +1 -0
- package/build/cc/VersionCC.js +654 -0
- package/build/cc/VersionCC.js.map +1 -0
- package/build/cc/WakeUpCC.d.ts +67 -0
- package/build/cc/WakeUpCC.d.ts.map +1 -0
- package/build/cc/WakeUpCC.js +425 -0
- package/build/cc/WakeUpCC.js.map +1 -0
- package/build/cc/ZWavePlusCC.d.ts +40 -0
- package/build/cc/ZWavePlusCC.d.ts.map +1 -0
- package/build/cc/ZWavePlusCC.js +269 -0
- package/build/cc/ZWavePlusCC.js.map +1 -0
- package/build/cc/index.d.ts +64 -0
- package/build/cc/index.d.ts.map +1 -0
- package/build/cc/index.js +496 -0
- package/build/cc/index.js.map +1 -0
- package/build/cc/manufacturerProprietary/FibaroCC.d.ts +62 -0
- package/build/cc/manufacturerProprietary/FibaroCC.d.ts.map +1 -0
- package/build/cc/manufacturerProprietary/FibaroCC.js +247 -0
- package/build/cc/manufacturerProprietary/FibaroCC.js.map +1 -0
- package/build/index.d.ts +11 -0
- package/build/index.d.ts.map +1 -0
- package/build/index.js +48 -0
- package/build/index.js.map +1 -0
- package/build/index_safe.d.ts +4 -0
- package/build/index_safe.d.ts.map +1 -0
- package/build/index_safe.js +30 -0
- package/build/index_safe.js.map +1 -0
- package/build/lib/API.d.ts +176 -0
- package/build/lib/API.d.ts.map +1 -0
- package/build/lib/API.js +325 -0
- package/build/lib/API.js.map +1 -0
- package/build/lib/CommandClass.d.ts +341 -0
- package/build/lib/CommandClass.d.ts.map +1 -0
- package/build/lib/CommandClass.js +1088 -0
- package/build/lib/CommandClass.js.map +1 -0
- package/build/lib/EncapsulatingCommandClass.d.ts +35 -0
- package/build/lib/EncapsulatingCommandClass.d.ts.map +1 -0
- package/build/lib/EncapsulatingCommandClass.js +53 -0
- package/build/lib/EncapsulatingCommandClass.js.map +1 -0
- package/build/lib/ICommandClassContainer.d.ts +9 -0
- package/build/lib/ICommandClassContainer.d.ts.map +1 -0
- package/build/lib/ICommandClassContainer.js +12 -0
- package/build/lib/ICommandClassContainer.js.map +1 -0
- package/build/lib/NotificationEventPayload.d.ts +11 -0
- package/build/lib/NotificationEventPayload.d.ts.map +1 -0
- package/build/lib/NotificationEventPayload.js +11 -0
- package/build/lib/NotificationEventPayload.js.map +1 -0
- package/build/lib/Security2/Extension.d.ts +87 -0
- package/build/lib/Security2/Extension.d.ts.map +1 -0
- package/build/lib/Security2/Extension.js +235 -0
- package/build/lib/Security2/Extension.js.map +1 -0
- package/build/lib/Security2/shared.d.ts +31 -0
- package/build/lib/Security2/shared.d.ts.map +1 -0
- package/build/lib/Security2/shared.js +37 -0
- package/build/lib/Security2/shared.js.map +1 -0
- package/build/lib/_Types.d.ts +1446 -0
- package/build/lib/_Types.d.ts.map +1 -0
- package/build/lib/_Types.js +1334 -0
- package/build/lib/_Types.js.map +1 -0
- package/build/lib/serializers.d.ts +24 -0
- package/build/lib/serializers.d.ts.map +1 -0
- package/build/lib/serializers.js +66 -0
- package/build/lib/serializers.js.map +1 -0
- package/build/lib/utils.d.ts +13 -0
- package/build/lib/utils.d.ts.map +1 -0
- package/build/lib/utils.js +675 -0
- package/build/lib/utils.js.map +1 -0
- package/package.json +77 -0
|
@@ -0,0 +1,176 @@
|
|
|
1
|
+
import { CommandClasses, Duration, IVirtualEndpoint, IZWaveEndpoint, IZWaveNode, Maybe, NODE_ID_BROADCAST, SendCommandOptions, TXReport, ValueChangeOptions, ValueDB, ValueID } from "@zwave-js/core";
|
|
2
|
+
import type { ZWaveApplicationHost } from "@zwave-js/host";
|
|
3
|
+
import { OnlyMethods } from "@zwave-js/shared";
|
|
4
|
+
export declare type ValueIDProperties = Pick<ValueID, "property" | "propertyKey">;
|
|
5
|
+
/** Used to identify the method on the CC API class that handles setting values on nodes directly */
|
|
6
|
+
export declare const SET_VALUE: unique symbol;
|
|
7
|
+
export declare type SetValueImplementation = (property: ValueIDProperties, value: unknown, options?: SetValueAPIOptions) => Promise<void>;
|
|
8
|
+
/**
|
|
9
|
+
* A generic options bag for the `setValue` API.
|
|
10
|
+
* Each implementation will choose the options that are relevant for it, so you can use the same options everywhere.
|
|
11
|
+
* @publicAPI
|
|
12
|
+
*/
|
|
13
|
+
export declare type SetValueAPIOptions = Partial<ValueChangeOptions>;
|
|
14
|
+
/** Used to identify the method on the CC API class that handles polling values from nodes */
|
|
15
|
+
export declare const POLL_VALUE: unique symbol;
|
|
16
|
+
export declare type PollValueImplementation<T = unknown> = (property: ValueIDProperties) => Promise<T | undefined>;
|
|
17
|
+
export declare function throwUnsupportedProperty(cc: CommandClasses, property: string | number): never;
|
|
18
|
+
export declare function throwUnsupportedPropertyKey(cc: CommandClasses, property: string | number, propertyKey: string | number): never;
|
|
19
|
+
export declare function throwMissingPropertyKey(cc: CommandClasses, property: string | number): never;
|
|
20
|
+
export declare function throwWrongValueType(cc: CommandClasses, property: string | number, expectedType: string, receivedType: string): never;
|
|
21
|
+
export interface SchedulePollOptions {
|
|
22
|
+
duration?: Duration;
|
|
23
|
+
transition?: "fast" | "slow";
|
|
24
|
+
}
|
|
25
|
+
/**
|
|
26
|
+
* The base class for all CC APIs exposed via `Node.commandClasses.<CCName>`
|
|
27
|
+
* @publicAPI
|
|
28
|
+
*/
|
|
29
|
+
export declare class CCAPI {
|
|
30
|
+
protected readonly applHost: ZWaveApplicationHost;
|
|
31
|
+
protected readonly endpoint: IZWaveEndpoint | IVirtualEndpoint;
|
|
32
|
+
constructor(applHost: ZWaveApplicationHost, endpoint: IZWaveEndpoint | IVirtualEndpoint);
|
|
33
|
+
static create<T extends CommandClasses>(ccId: T, applHost: ZWaveApplicationHost, endpoint: IZWaveEndpoint | IVirtualEndpoint, requireSupport?: boolean): CommandClasses extends T ? CCAPI : CCToAPI<T>;
|
|
34
|
+
/**
|
|
35
|
+
* The identifier of the Command Class this API is for
|
|
36
|
+
*/
|
|
37
|
+
readonly ccId: CommandClasses;
|
|
38
|
+
protected [SET_VALUE]: SetValueImplementation | undefined;
|
|
39
|
+
/**
|
|
40
|
+
* Can be used on supported CC APIs to set a CC value by property name (and optionally the property key)
|
|
41
|
+
*/
|
|
42
|
+
get setValue(): SetValueImplementation | undefined;
|
|
43
|
+
/** Whether a successful setValue call should imply that the value was successfully updated */
|
|
44
|
+
isSetValueOptimistic(valueId: ValueID): boolean;
|
|
45
|
+
protected [POLL_VALUE]: PollValueImplementation | undefined;
|
|
46
|
+
/**
|
|
47
|
+
* Can be used on supported CC APIs to poll a CC value by property name (and optionally the property key)
|
|
48
|
+
*/
|
|
49
|
+
get pollValue(): PollValueImplementation | undefined;
|
|
50
|
+
/**
|
|
51
|
+
* Schedules a value to be polled after a given time. Schedules are deduplicated on a per-property basis.
|
|
52
|
+
* @returns `true` if the poll was scheduled, `false` otherwise
|
|
53
|
+
*/
|
|
54
|
+
protected schedulePoll(property: ValueIDProperties, expectedValue: unknown, { duration, transition }?: SchedulePollOptions): boolean;
|
|
55
|
+
/**
|
|
56
|
+
* Retrieves the version of the given CommandClass this endpoint implements
|
|
57
|
+
*/
|
|
58
|
+
get version(): number;
|
|
59
|
+
/** Determines if this simplified API instance may be used. */
|
|
60
|
+
isSupported(): boolean;
|
|
61
|
+
/**
|
|
62
|
+
* Determine whether the linked node supports a specific command of this command class.
|
|
63
|
+
* "unknown" means that the information has not been received yet
|
|
64
|
+
*/
|
|
65
|
+
supportsCommand(command: number): Maybe<boolean>;
|
|
66
|
+
protected assertSupportsCommand(commandEnum: unknown, command: number): void;
|
|
67
|
+
protected assertPhysicalEndpoint(endpoint: IZWaveEndpoint | IVirtualEndpoint): asserts endpoint is IZWaveEndpoint;
|
|
68
|
+
/** Returns the command options to use for sendCommand calls */
|
|
69
|
+
protected get commandOptions(): SendCommandOptions;
|
|
70
|
+
/** Creates an instance of this API, scoped to use the given options */
|
|
71
|
+
withOptions(options: SendCommandOptions): this;
|
|
72
|
+
/** Creates an instance of this API which (if supported) will return TX reports along with the result. */
|
|
73
|
+
withTXReport<T extends this>(): WithTXReport<T>;
|
|
74
|
+
protected isSinglecast(): this is this & {
|
|
75
|
+
endpoint: IZWaveEndpoint;
|
|
76
|
+
};
|
|
77
|
+
protected isMulticast(): this is this & {
|
|
78
|
+
endpoint: IVirtualEndpoint & {
|
|
79
|
+
nodeId: number[];
|
|
80
|
+
};
|
|
81
|
+
};
|
|
82
|
+
protected isBroadcast(): this is this & {
|
|
83
|
+
endpoint: IVirtualEndpoint & {
|
|
84
|
+
nodeId: typeof NODE_ID_BROADCAST;
|
|
85
|
+
};
|
|
86
|
+
};
|
|
87
|
+
/**
|
|
88
|
+
* Returns the node this CC API is linked to. Throws if the controller is not yet ready.
|
|
89
|
+
*/
|
|
90
|
+
getNode(): IZWaveNode | undefined;
|
|
91
|
+
/** Returns the value DB for this CC API's node (if it can be safely accessed) */
|
|
92
|
+
protected tryGetValueDB(): ValueDB | undefined;
|
|
93
|
+
/** Returns the value DB for this CC's node (or throws if it cannot be accessed) */
|
|
94
|
+
protected getValueDB(): ValueDB;
|
|
95
|
+
}
|
|
96
|
+
/** A CC API that is only available for physical endpoints */
|
|
97
|
+
export declare class PhysicalCCAPI extends CCAPI {
|
|
98
|
+
constructor(applHost: ZWaveApplicationHost, endpoint: IZWaveEndpoint | IVirtualEndpoint);
|
|
99
|
+
protected readonly endpoint: IZWaveEndpoint;
|
|
100
|
+
}
|
|
101
|
+
export declare type CCToName<CC extends CommandClasses> = [CC] extends [
|
|
102
|
+
typeof CommandClasses["Alarm Sensor"]
|
|
103
|
+
] ? "Alarm Sensor" : [CC] extends [typeof CommandClasses["Association"]] ? "Association" : [CC] extends [typeof CommandClasses["Association Group Information"]] ? "Association Group Information" : [CC] extends [typeof CommandClasses["Barrier Operator"]] ? "Barrier Operator" : [CC] extends [typeof CommandClasses["Basic"]] ? "Basic" : [CC] extends [typeof CommandClasses["Battery"]] ? "Battery" : [CC] extends [typeof CommandClasses["Binary Sensor"]] ? "Binary Sensor" : [CC] extends [typeof CommandClasses["Binary Switch"]] ? "Binary Switch" : [CC] extends [typeof CommandClasses["CRC-16 Encapsulation"]] ? "CRC-16 Encapsulation" : [CC] extends [typeof CommandClasses["Central Scene"]] ? "Central Scene" : [CC] extends [typeof CommandClasses["Climate Control Schedule"]] ? "Climate Control Schedule" : [CC] extends [typeof CommandClasses["Clock"]] ? "Clock" : [CC] extends [typeof CommandClasses["Color Switch"]] ? "Color Switch" : [CC] extends [typeof CommandClasses["Configuration"]] ? "Configuration" : [CC] extends [typeof CommandClasses["Door Lock"]] ? "Door Lock" : [CC] extends [typeof CommandClasses["Door Lock Logging"]] ? "Door Lock Logging" : [CC] extends [typeof CommandClasses["Entry Control"]] ? "Entry Control" : [CC] extends [typeof CommandClasses["Firmware Update Meta Data"]] ? "Firmware Update Meta Data" : [CC] extends [typeof CommandClasses["Humidity Control Mode"]] ? "Humidity Control Mode" : [CC] extends [typeof CommandClasses["Humidity Control Operating State"]] ? "Humidity Control Operating State" : [CC] extends [typeof CommandClasses["Humidity Control Setpoint"]] ? "Humidity Control Setpoint" : [CC] extends [typeof CommandClasses["Indicator"]] ? "Indicator" : [CC] extends [typeof CommandClasses["Irrigation"]] ? "Irrigation" : [CC] extends [typeof CommandClasses["Language"]] ? "Language" : [CC] extends [typeof CommandClasses["Lock"]] ? "Lock" : [CC] extends [typeof CommandClasses["Manufacturer Proprietary"]] ? "Manufacturer Proprietary" : [CC] extends [typeof CommandClasses["Manufacturer Specific"]] ? "Manufacturer Specific" : [CC] extends [typeof CommandClasses["Meter"]] ? "Meter" : [CC] extends [typeof CommandClasses["Multi Channel Association"]] ? "Multi Channel Association" : [CC] extends [typeof CommandClasses["Multi Channel"]] ? "Multi Channel" : [CC] extends [typeof CommandClasses["Multi Command"]] ? "Multi Command" : [CC] extends [typeof CommandClasses["Multilevel Sensor"]] ? "Multilevel Sensor" : [CC] extends [typeof CommandClasses["Multilevel Switch"]] ? "Multilevel Switch" : [CC] extends [typeof CommandClasses["No Operation"]] ? "No Operation" : [CC] extends [typeof CommandClasses["Node Naming and Location"]] ? "Node Naming and Location" : [CC] extends [typeof CommandClasses["Notification"]] ? "Notification" : [CC] extends [typeof CommandClasses["Powerlevel"]] ? "Powerlevel" : [CC] extends [typeof CommandClasses["Protection"]] ? "Protection" : [CC] extends [typeof CommandClasses["Scene Activation"]] ? "Scene Activation" : [CC] extends [typeof CommandClasses["Scene Actuator Configuration"]] ? "Scene Actuator Configuration" : [CC] extends [typeof CommandClasses["Scene Controller Configuration"]] ? "Scene Controller Configuration" : [CC] extends [typeof CommandClasses["Security 2"]] ? "Security 2" : [CC] extends [typeof CommandClasses["Security"]] ? "Security" : [CC] extends [typeof CommandClasses["Sound Switch"]] ? "Sound Switch" : [CC] extends [typeof CommandClasses["Supervision"]] ? "Supervision" : [CC] extends [typeof CommandClasses["Thermostat Fan Mode"]] ? "Thermostat Fan Mode" : [CC] extends [typeof CommandClasses["Thermostat Fan State"]] ? "Thermostat Fan State" : [CC] extends [typeof CommandClasses["Thermostat Mode"]] ? "Thermostat Mode" : [CC] extends [typeof CommandClasses["Thermostat Operating State"]] ? "Thermostat Operating State" : [CC] extends [typeof CommandClasses["Thermostat Setback"]] ? "Thermostat Setback" : [CC] extends [typeof CommandClasses["Thermostat Setpoint"]] ? "Thermostat Setpoint" : [CC] extends [typeof CommandClasses["Time"]] ? "Time" : [CC] extends [typeof CommandClasses["Time Parameters"]] ? "Time Parameters" : [CC] extends [typeof CommandClasses["User Code"]] ? "User Code" : [CC] extends [typeof CommandClasses["Version"]] ? "Version" : [CC] extends [typeof CommandClasses["Wake Up"]] ? "Wake Up" : [CC] extends [typeof CommandClasses["Z-Wave Plus Info"]] ? "Z-Wave Plus Info" : never;
|
|
104
|
+
export declare type CCToAPI<CC extends CommandClasses> = CCToName<CC> extends keyof CCAPIs ? CCAPIs[CCToName<CC>] : never;
|
|
105
|
+
export declare type APIMethodsOf<CC extends CommandClasses> = Omit<OnlyMethods<CCToAPI<CC>>, "isSetValueOptimistic" | "isSupported" | "supportsCommand" | "withOptions" | "withTXReport">;
|
|
106
|
+
export declare type OwnMethodsOf<API extends CCAPI> = Omit<OnlyMethods<API>, keyof OnlyMethods<CCAPI>>;
|
|
107
|
+
export declare type WrapWithTXReport<T> = [T] extends [Promise<infer U>] ? Promise<WrapWithTXReport<U>> : [T] extends [void] ? {
|
|
108
|
+
txReport: TXReport | undefined;
|
|
109
|
+
} : {
|
|
110
|
+
result: T;
|
|
111
|
+
txReport: TXReport | undefined;
|
|
112
|
+
};
|
|
113
|
+
export declare type WithTXReport<API extends CCAPI> = Omit<API, keyof OwnMethodsOf<API> | "withOptions" | "withTXReport"> & {
|
|
114
|
+
[K in keyof OwnMethodsOf<API>]: API[K] extends (...args: any[]) => any ? (...args: Parameters<API[K]>) => WrapWithTXReport<ReturnType<API[K]>> : never;
|
|
115
|
+
};
|
|
116
|
+
export interface CCAPIs {
|
|
117
|
+
[Symbol.iterator](): Iterator<CCAPI>;
|
|
118
|
+
"Alarm Sensor": import("../cc/AlarmSensorCC").AlarmSensorCCAPI;
|
|
119
|
+
Association: import("../cc/AssociationCC").AssociationCCAPI;
|
|
120
|
+
"Association Group Information": import("../cc/AssociationGroupInfoCC").AssociationGroupInfoCCAPI;
|
|
121
|
+
"Barrier Operator": import("../cc/BarrierOperatorCC").BarrierOperatorCCAPI;
|
|
122
|
+
Basic: import("../cc/BasicCC").BasicCCAPI;
|
|
123
|
+
Battery: import("../cc/BatteryCC").BatteryCCAPI;
|
|
124
|
+
"Binary Sensor": import("../cc/BinarySensorCC").BinarySensorCCAPI;
|
|
125
|
+
"Binary Switch": import("../cc/BinarySwitchCC").BinarySwitchCCAPI;
|
|
126
|
+
"CRC-16 Encapsulation": import("../cc/CRC16CC").CRC16CCAPI;
|
|
127
|
+
"Central Scene": import("../cc/CentralSceneCC").CentralSceneCCAPI;
|
|
128
|
+
"Climate Control Schedule": import("../cc/ClimateControlScheduleCC").ClimateControlScheduleCCAPI;
|
|
129
|
+
Clock: import("../cc/ClockCC").ClockCCAPI;
|
|
130
|
+
"Color Switch": import("../cc/ColorSwitchCC").ColorSwitchCCAPI;
|
|
131
|
+
Configuration: import("../cc/ConfigurationCC").ConfigurationCCAPI;
|
|
132
|
+
"Door Lock": import("../cc/DoorLockCC").DoorLockCCAPI;
|
|
133
|
+
"Door Lock Logging": import("../cc/DoorLockLoggingCC").DoorLockLoggingCCAPI;
|
|
134
|
+
"Entry Control": import("../cc/EntryControlCC").EntryControlCCAPI;
|
|
135
|
+
"Firmware Update Meta Data": import("../cc/FirmwareUpdateMetaDataCC").FirmwareUpdateMetaDataCCAPI;
|
|
136
|
+
"Humidity Control Mode": import("../cc/HumidityControlModeCC").HumidityControlModeCCAPI;
|
|
137
|
+
"Humidity Control Operating State": import("../cc/HumidityControlOperatingStateCC").HumidityControlOperatingStateCCAPI;
|
|
138
|
+
"Humidity Control Setpoint": import("../cc/HumidityControlSetpointCC").HumidityControlSetpointCCAPI;
|
|
139
|
+
Indicator: import("../cc/IndicatorCC").IndicatorCCAPI;
|
|
140
|
+
Irrigation: import("../cc/IrrigationCC").IrrigationCCAPI;
|
|
141
|
+
Language: import("../cc/LanguageCC").LanguageCCAPI;
|
|
142
|
+
Lock: import("../cc/LockCC").LockCCAPI;
|
|
143
|
+
"Manufacturer Proprietary": import("../cc/ManufacturerProprietaryCC").ManufacturerProprietaryCCAPI;
|
|
144
|
+
"Manufacturer Specific": import("../cc/ManufacturerSpecificCC").ManufacturerSpecificCCAPI;
|
|
145
|
+
Meter: import("../cc/MeterCC").MeterCCAPI;
|
|
146
|
+
"Multi Channel Association": import("../cc/MultiChannelAssociationCC").MultiChannelAssociationCCAPI;
|
|
147
|
+
"Multi Channel": import("../cc/MultiChannelCC").MultiChannelCCAPI;
|
|
148
|
+
"Multi Command": import("../cc/MultiCommandCC").MultiCommandCCAPI;
|
|
149
|
+
"Multilevel Sensor": import("../cc/MultilevelSensorCC").MultilevelSensorCCAPI;
|
|
150
|
+
"Multilevel Switch": import("../cc/MultilevelSwitchCC").MultilevelSwitchCCAPI;
|
|
151
|
+
"No Operation": import("../cc/NoOperationCC").NoOperationCCAPI;
|
|
152
|
+
"Node Naming and Location": import("../cc/NodeNamingCC").NodeNamingAndLocationCCAPI;
|
|
153
|
+
Notification: import("../cc/NotificationCC").NotificationCCAPI;
|
|
154
|
+
Powerlevel: import("../cc/PowerlevelCC").PowerlevelCCAPI;
|
|
155
|
+
Protection: import("../cc/ProtectionCC").ProtectionCCAPI;
|
|
156
|
+
"Scene Activation": import("../cc/SceneActivationCC").SceneActivationCCAPI;
|
|
157
|
+
"Scene Actuator Configuration": import("../cc/SceneActuatorConfigurationCC").SceneActuatorConfigurationCCAPI;
|
|
158
|
+
"Scene Controller Configuration": import("../cc/SceneControllerConfigurationCC").SceneControllerConfigurationCCAPI;
|
|
159
|
+
"Security 2": import("../cc/Security2CC").Security2CCAPI;
|
|
160
|
+
Security: import("../cc/SecurityCC").SecurityCCAPI;
|
|
161
|
+
"Sound Switch": import("../cc/SoundSwitchCC").SoundSwitchCCAPI;
|
|
162
|
+
Supervision: import("../cc/SupervisionCC").SupervisionCCAPI;
|
|
163
|
+
"Thermostat Fan Mode": import("../cc/ThermostatFanModeCC").ThermostatFanModeCCAPI;
|
|
164
|
+
"Thermostat Fan State": import("../cc/ThermostatFanStateCC").ThermostatFanStateCCAPI;
|
|
165
|
+
"Thermostat Mode": import("../cc/ThermostatModeCC").ThermostatModeCCAPI;
|
|
166
|
+
"Thermostat Operating State": import("../cc/ThermostatOperatingStateCC").ThermostatOperatingStateCCAPI;
|
|
167
|
+
"Thermostat Setback": import("../cc/ThermostatSetbackCC").ThermostatSetbackCCAPI;
|
|
168
|
+
"Thermostat Setpoint": import("../cc/ThermostatSetpointCC").ThermostatSetpointCCAPI;
|
|
169
|
+
Time: import("../cc/TimeCC").TimeCCAPI;
|
|
170
|
+
"Time Parameters": import("../cc/TimeParametersCC").TimeParametersCCAPI;
|
|
171
|
+
"User Code": import("../cc/UserCodeCC").UserCodeCCAPI;
|
|
172
|
+
Version: import("../cc/VersionCC").VersionCCAPI;
|
|
173
|
+
"Wake Up": import("../cc/WakeUpCC").WakeUpCCAPI;
|
|
174
|
+
"Z-Wave Plus Info": import("../cc/ZWavePlusCC").ZWavePlusCCAPI;
|
|
175
|
+
}
|
|
176
|
+
//# sourceMappingURL=API.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"API.d.ts","sourceRoot":"","sources":["../../src/lib/API.ts"],"names":[],"mappings":"AAAA,OAAO,EACN,cAAc,EACd,QAAQ,EAER,gBAAgB,EAChB,cAAc,EACd,UAAU,EACV,KAAK,EACL,iBAAiB,EACjB,kBAAkB,EAElB,QAAQ,EAER,kBAAkB,EAClB,OAAO,EACP,OAAO,EAGP,MAAM,gBAAgB,CAAC;AACxB,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,gBAAgB,CAAC;AAC3D,OAAO,EAA8B,WAAW,EAAE,MAAM,kBAAkB,CAAC;AAI3E,oBAAY,iBAAiB,GAAG,IAAI,CAAC,OAAO,EAAE,UAAU,GAAG,aAAa,CAAC,CAAC;AAE1E,oGAAoG;AACpG,eAAO,MAAM,SAAS,EAAE,OAAO,MAAsC,CAAC;AACtE,oBAAY,sBAAsB,GAAG,CACpC,QAAQ,EAAE,iBAAiB,EAC3B,KAAK,EAAE,OAAO,EACd,OAAO,CAAC,EAAE,kBAAkB,KACxB,OAAO,CAAC,IAAI,CAAC,CAAC;AAEnB;;;;GAIG;AACH,oBAAY,kBAAkB,GAAG,OAAO,CAAC,kBAAkB,CAAC,CAAC;AAE7D,6FAA6F;AAC7F,eAAO,MAAM,UAAU,EAAE,OAAO,MAAuC,CAAC;AACxE,oBAAY,uBAAuB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WAAW,CAAC;IAChD,kBAAkB,EAAE,OAAO,mBAAmB,EAAE,cAAc,CAAC;CAC/D"}
|
package/build/lib/API.js
ADDED
|
@@ -0,0 +1,325 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.PhysicalCCAPI = exports.CCAPI = exports.throwWrongValueType = exports.throwMissingPropertyKey = exports.throwUnsupportedPropertyKey = exports.throwUnsupportedProperty = exports.POLL_VALUE = exports.SET_VALUE = void 0;
|
|
4
|
+
const core_1 = require("@zwave-js/core");
|
|
5
|
+
const shared_1 = require("@zwave-js/shared");
|
|
6
|
+
const typeguards_1 = require("alcalzone-shared/typeguards");
|
|
7
|
+
const CommandClass_1 = require("./CommandClass");
|
|
8
|
+
/** Used to identify the method on the CC API class that handles setting values on nodes directly */
|
|
9
|
+
exports.SET_VALUE = Symbol.for("CCAPI_SET_VALUE");
|
|
10
|
+
/** Used to identify the method on the CC API class that handles polling values from nodes */
|
|
11
|
+
exports.POLL_VALUE = Symbol.for("CCAPI_POLL_VALUE");
|
|
12
|
+
// Since the setValue API is called from a point with very generic parameters,
|
|
13
|
+
// we must do narrowing inside the API calls. These three methods are for convenience
|
|
14
|
+
function throwUnsupportedProperty(cc, property) {
|
|
15
|
+
throw new core_1.ZWaveError(`${core_1.CommandClasses[cc]}: "${property}" is not a supported property`, core_1.ZWaveErrorCodes.Argument_Invalid);
|
|
16
|
+
}
|
|
17
|
+
exports.throwUnsupportedProperty = throwUnsupportedProperty;
|
|
18
|
+
function throwUnsupportedPropertyKey(cc, property, propertyKey) {
|
|
19
|
+
throw new core_1.ZWaveError(`${core_1.CommandClasses[cc]}: "${propertyKey}" is not a supported property key for property "${property}"`, core_1.ZWaveErrorCodes.Argument_Invalid);
|
|
20
|
+
}
|
|
21
|
+
exports.throwUnsupportedPropertyKey = throwUnsupportedPropertyKey;
|
|
22
|
+
function throwMissingPropertyKey(cc, property) {
|
|
23
|
+
throw new core_1.ZWaveError(`${core_1.CommandClasses[cc]}: property "${property}" requires a property key, but none was given`, core_1.ZWaveErrorCodes.Argument_Invalid);
|
|
24
|
+
}
|
|
25
|
+
exports.throwMissingPropertyKey = throwMissingPropertyKey;
|
|
26
|
+
function throwWrongValueType(cc, property, expectedType, receivedType) {
|
|
27
|
+
throw new core_1.ZWaveError(`${core_1.CommandClasses[cc]}: "${property}" must be of type "${expectedType}", received "${receivedType}"`, core_1.ZWaveErrorCodes.Argument_Invalid);
|
|
28
|
+
}
|
|
29
|
+
exports.throwWrongValueType = throwWrongValueType;
|
|
30
|
+
/**
|
|
31
|
+
* The base class for all CC APIs exposed via `Node.commandClasses.<CCName>`
|
|
32
|
+
* @publicAPI
|
|
33
|
+
*/
|
|
34
|
+
class CCAPI {
|
|
35
|
+
constructor(applHost, endpoint) {
|
|
36
|
+
this.applHost = applHost;
|
|
37
|
+
this.endpoint = endpoint;
|
|
38
|
+
this.ccId = (0, CommandClass_1.getCommandClass)(this);
|
|
39
|
+
}
|
|
40
|
+
static create(ccId, applHost, endpoint, requireSupport) {
|
|
41
|
+
const APIConstructor = (0, CommandClass_1.getAPI)(ccId);
|
|
42
|
+
const ccName = core_1.CommandClasses[ccId];
|
|
43
|
+
if (APIConstructor == undefined) {
|
|
44
|
+
throw new core_1.ZWaveError(`Command Class ${ccName} (${(0, shared_1.num2hex)(ccId)}) has no associated API!`, core_1.ZWaveErrorCodes.CC_NoAPI);
|
|
45
|
+
}
|
|
46
|
+
const apiInstance = new APIConstructor(applHost, endpoint);
|
|
47
|
+
// Only require support for physical endpoints by default
|
|
48
|
+
requireSupport !== null && requireSupport !== void 0 ? requireSupport : (requireSupport = !endpoint.virtual);
|
|
49
|
+
if (requireSupport) {
|
|
50
|
+
// @ts-expect-error TS doesn't like assigning to conditional types
|
|
51
|
+
return new Proxy(apiInstance, {
|
|
52
|
+
get: (target, property) => {
|
|
53
|
+
// Forbid access to the API if it is not supported by the node
|
|
54
|
+
if (property !== "ccId" &&
|
|
55
|
+
property !== "endpoint" &&
|
|
56
|
+
property !== "isSupported" &&
|
|
57
|
+
property !== "withOptions" &&
|
|
58
|
+
property !== "commandOptions" &&
|
|
59
|
+
!target.isSupported()) {
|
|
60
|
+
let messageStart;
|
|
61
|
+
if (endpoint.virtual) {
|
|
62
|
+
const hasNodeId = typeof endpoint.nodeId === "number";
|
|
63
|
+
messageStart = `${hasNodeId ? "The" : "This"} virtual node${hasNodeId ? ` ${endpoint.nodeId}` : ""}`;
|
|
64
|
+
}
|
|
65
|
+
else {
|
|
66
|
+
messageStart = `Node ${endpoint.nodeId}`;
|
|
67
|
+
}
|
|
68
|
+
throw new core_1.ZWaveError(`${messageStart}${endpoint.index === 0
|
|
69
|
+
? ""
|
|
70
|
+
: ` (endpoint ${endpoint.index})`} does not support the Command Class ${ccName}!`, core_1.ZWaveErrorCodes.CC_NotSupported);
|
|
71
|
+
}
|
|
72
|
+
return target[property];
|
|
73
|
+
},
|
|
74
|
+
});
|
|
75
|
+
}
|
|
76
|
+
else {
|
|
77
|
+
// @ts-expect-error TS doesn't like assigning to conditional types
|
|
78
|
+
return apiInstance;
|
|
79
|
+
}
|
|
80
|
+
}
|
|
81
|
+
/**
|
|
82
|
+
* Can be used on supported CC APIs to set a CC value by property name (and optionally the property key)
|
|
83
|
+
*/
|
|
84
|
+
get setValue() {
|
|
85
|
+
return this[exports.SET_VALUE];
|
|
86
|
+
}
|
|
87
|
+
/** Whether a successful setValue call should imply that the value was successfully updated */
|
|
88
|
+
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
89
|
+
isSetValueOptimistic(valueId) {
|
|
90
|
+
return true;
|
|
91
|
+
}
|
|
92
|
+
/**
|
|
93
|
+
* Can be used on supported CC APIs to poll a CC value by property name (and optionally the property key)
|
|
94
|
+
*/
|
|
95
|
+
get pollValue() {
|
|
96
|
+
var _a;
|
|
97
|
+
return (_a = this[exports.POLL_VALUE]) === null || _a === void 0 ? void 0 : _a.bind(this);
|
|
98
|
+
}
|
|
99
|
+
/**
|
|
100
|
+
* Schedules a value to be polled after a given time. Schedules are deduplicated on a per-property basis.
|
|
101
|
+
* @returns `true` if the poll was scheduled, `false` otherwise
|
|
102
|
+
*/
|
|
103
|
+
schedulePoll(property, expectedValue, { duration, transition = "slow" } = {}) {
|
|
104
|
+
var _a;
|
|
105
|
+
// Figure out the delay. If a non-zero duration was given or this is a "fast" transition,
|
|
106
|
+
// use/add the short delay. Otherwise, default to the long delay.
|
|
107
|
+
const durationMs = (_a = duration === null || duration === void 0 ? void 0 : duration.toMilliseconds()) !== null && _a !== void 0 ? _a : 0;
|
|
108
|
+
const additionalDelay = !!durationMs || transition === "fast"
|
|
109
|
+
? this.applHost.options.timeouts.refreshValueAfterTransition
|
|
110
|
+
: this.applHost.options.timeouts.refreshValue;
|
|
111
|
+
const timeoutMs = durationMs + additionalDelay;
|
|
112
|
+
if (this.isSinglecast()) {
|
|
113
|
+
const node = this.endpoint.getNodeUnsafe();
|
|
114
|
+
if (!node)
|
|
115
|
+
return false;
|
|
116
|
+
return this.applHost.schedulePoll(node.id, {
|
|
117
|
+
commandClass: this.ccId,
|
|
118
|
+
endpoint: this.endpoint.index,
|
|
119
|
+
...property,
|
|
120
|
+
}, { timeoutMs, expectedValue });
|
|
121
|
+
}
|
|
122
|
+
else if (this.isMulticast()) {
|
|
123
|
+
// Only poll supporting nodes in multicast
|
|
124
|
+
const supportingNodes = this.endpoint.node.physicalNodes.filter((node) => {
|
|
125
|
+
var _a;
|
|
126
|
+
return (_a = node
|
|
127
|
+
.getEndpoint(this.endpoint.index)) === null || _a === void 0 ? void 0 : _a.supportsCC(this.ccId);
|
|
128
|
+
});
|
|
129
|
+
let ret = false;
|
|
130
|
+
for (const node of supportingNodes) {
|
|
131
|
+
ret || (ret = this.applHost.schedulePoll(node.id, {
|
|
132
|
+
commandClass: this.ccId,
|
|
133
|
+
endpoint: this.endpoint.index,
|
|
134
|
+
...property,
|
|
135
|
+
}, { timeoutMs, expectedValue }));
|
|
136
|
+
}
|
|
137
|
+
return ret;
|
|
138
|
+
}
|
|
139
|
+
else {
|
|
140
|
+
// Don't poll the broadcast node
|
|
141
|
+
return false;
|
|
142
|
+
}
|
|
143
|
+
}
|
|
144
|
+
/**
|
|
145
|
+
* Retrieves the version of the given CommandClass this endpoint implements
|
|
146
|
+
*/
|
|
147
|
+
get version() {
|
|
148
|
+
return this.endpoint.getCCVersion(this.ccId);
|
|
149
|
+
}
|
|
150
|
+
/** Determines if this simplified API instance may be used. */
|
|
151
|
+
isSupported() {
|
|
152
|
+
return (
|
|
153
|
+
// NoOperation is always supported
|
|
154
|
+
this.ccId === core_1.CommandClasses["No Operation"] ||
|
|
155
|
+
// Basic should always be supported. Since we are trying to hide it from library consumers
|
|
156
|
+
// we cannot trust supportsCC to test it
|
|
157
|
+
this.ccId === core_1.CommandClasses.Basic ||
|
|
158
|
+
this.endpoint.supportsCC(this.ccId));
|
|
159
|
+
}
|
|
160
|
+
/**
|
|
161
|
+
* Determine whether the linked node supports a specific command of this command class.
|
|
162
|
+
* "unknown" means that the information has not been received yet
|
|
163
|
+
*/
|
|
164
|
+
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
165
|
+
supportsCommand(command) {
|
|
166
|
+
// This needs to be overwritten per command class. In the default implementation, we don't know anything!
|
|
167
|
+
return core_1.unknownBoolean;
|
|
168
|
+
}
|
|
169
|
+
assertSupportsCommand(commandEnum, command) {
|
|
170
|
+
if (this.supportsCommand(command) !== true) {
|
|
171
|
+
const hasNodeId = typeof this.endpoint.nodeId === "number";
|
|
172
|
+
throw new core_1.ZWaveError(`${hasNodeId
|
|
173
|
+
? `Node #${this.endpoint.nodeId}`
|
|
174
|
+
: "This virtual node"}${this.endpoint.index > 0
|
|
175
|
+
? ` (Endpoint ${this.endpoint.index})`
|
|
176
|
+
: ""} does not support the command ${(0, shared_1.getEnumMemberName)(commandEnum, command)}!`, core_1.ZWaveErrorCodes.CC_NotSupported);
|
|
177
|
+
}
|
|
178
|
+
}
|
|
179
|
+
assertPhysicalEndpoint(endpoint) {
|
|
180
|
+
if (endpoint.virtual) {
|
|
181
|
+
throw new core_1.ZWaveError(`This method is not supported for virtual nodes!`, core_1.ZWaveErrorCodes.CC_NotSupported);
|
|
182
|
+
}
|
|
183
|
+
}
|
|
184
|
+
/** Returns the command options to use for sendCommand calls */
|
|
185
|
+
get commandOptions() {
|
|
186
|
+
// No default options
|
|
187
|
+
return {};
|
|
188
|
+
}
|
|
189
|
+
/** Creates an instance of this API, scoped to use the given options */
|
|
190
|
+
withOptions(options) {
|
|
191
|
+
const mergedOptions = {
|
|
192
|
+
...this.commandOptions,
|
|
193
|
+
...options,
|
|
194
|
+
};
|
|
195
|
+
return new Proxy(this, {
|
|
196
|
+
get: (target, property) => {
|
|
197
|
+
if (property === "commandOptions") {
|
|
198
|
+
return mergedOptions;
|
|
199
|
+
}
|
|
200
|
+
else {
|
|
201
|
+
return target[property];
|
|
202
|
+
}
|
|
203
|
+
},
|
|
204
|
+
});
|
|
205
|
+
}
|
|
206
|
+
/** Creates an instance of this API which (if supported) will return TX reports along with the result. */
|
|
207
|
+
withTXReport() {
|
|
208
|
+
if (this.constructor === CCAPI) {
|
|
209
|
+
throw new core_1.ZWaveError("The withTXReport method may only be called on specific CC API implementations.", core_1.ZWaveErrorCodes.Driver_NotSupported);
|
|
210
|
+
}
|
|
211
|
+
// Remember which properties need to be proxied
|
|
212
|
+
const ownProps = new Set(Object.getOwnPropertyNames(this.constructor.prototype));
|
|
213
|
+
ownProps.delete("constructor");
|
|
214
|
+
function wrapResult(result, txReport) {
|
|
215
|
+
// Both the result and the TX report may be undefined (no response, no support)
|
|
216
|
+
return (0, core_1.stripUndefined)({
|
|
217
|
+
result,
|
|
218
|
+
txReport,
|
|
219
|
+
});
|
|
220
|
+
}
|
|
221
|
+
return new Proxy(this, {
|
|
222
|
+
get: (target, prop) => {
|
|
223
|
+
if (prop === "withTXReport")
|
|
224
|
+
return undefined;
|
|
225
|
+
let original = target[prop];
|
|
226
|
+
if (ownProps.has(prop) &&
|
|
227
|
+
typeof original === "function") {
|
|
228
|
+
// This is a method that only exists in the specific implementation
|
|
229
|
+
// Wrap each call with its own API proxy, so we don't mix up TX reports
|
|
230
|
+
let txReport;
|
|
231
|
+
const api = target.withOptions({
|
|
232
|
+
onTXReport: (report) => {
|
|
233
|
+
// Remember the last status report
|
|
234
|
+
txReport = report;
|
|
235
|
+
},
|
|
236
|
+
});
|
|
237
|
+
original = api[prop].bind(api);
|
|
238
|
+
// Return a wrapper function that will add the status report after the call is complete
|
|
239
|
+
return (...args) => {
|
|
240
|
+
let result = original(...args);
|
|
241
|
+
if (result instanceof Promise) {
|
|
242
|
+
result = result.then((res) => wrapResult(res, txReport));
|
|
243
|
+
}
|
|
244
|
+
else {
|
|
245
|
+
result = wrapResult(result, txReport);
|
|
246
|
+
}
|
|
247
|
+
return result;
|
|
248
|
+
};
|
|
249
|
+
}
|
|
250
|
+
else {
|
|
251
|
+
return original;
|
|
252
|
+
}
|
|
253
|
+
},
|
|
254
|
+
});
|
|
255
|
+
}
|
|
256
|
+
isSinglecast() {
|
|
257
|
+
return (!this.endpoint.virtual &&
|
|
258
|
+
typeof this.endpoint.nodeId === "number" &&
|
|
259
|
+
this.endpoint.nodeId !== core_1.NODE_ID_BROADCAST);
|
|
260
|
+
}
|
|
261
|
+
isMulticast() {
|
|
262
|
+
return this.endpoint.virtual && (0, typeguards_1.isArray)(this.endpoint.nodeId);
|
|
263
|
+
}
|
|
264
|
+
isBroadcast() {
|
|
265
|
+
return (this.endpoint.virtual && this.endpoint.nodeId === core_1.NODE_ID_BROADCAST);
|
|
266
|
+
}
|
|
267
|
+
/**
|
|
268
|
+
* Returns the node this CC API is linked to. Throws if the controller is not yet ready.
|
|
269
|
+
*/
|
|
270
|
+
getNode() {
|
|
271
|
+
if (this.isSinglecast()) {
|
|
272
|
+
return this.applHost.nodes.get(this.endpoint.nodeId);
|
|
273
|
+
}
|
|
274
|
+
}
|
|
275
|
+
/**
|
|
276
|
+
* @internal
|
|
277
|
+
* Returns the node this CC API is linked to (or undefined if the node doesn't exist)
|
|
278
|
+
*/
|
|
279
|
+
getNodeUnsafe() {
|
|
280
|
+
try {
|
|
281
|
+
return this.getNode();
|
|
282
|
+
}
|
|
283
|
+
catch (e) {
|
|
284
|
+
// This was expected
|
|
285
|
+
if ((0, core_1.isZWaveError)(e) && e.code === core_1.ZWaveErrorCodes.Driver_NotReady) {
|
|
286
|
+
return undefined;
|
|
287
|
+
}
|
|
288
|
+
// Something else happened
|
|
289
|
+
throw e;
|
|
290
|
+
}
|
|
291
|
+
}
|
|
292
|
+
/** Returns the value DB for this CC API's node (if it can be safely accessed) */
|
|
293
|
+
tryGetValueDB() {
|
|
294
|
+
if (!this.isSinglecast())
|
|
295
|
+
return;
|
|
296
|
+
try {
|
|
297
|
+
return this.applHost.getValueDB(this.endpoint.nodeId);
|
|
298
|
+
}
|
|
299
|
+
catch {
|
|
300
|
+
return;
|
|
301
|
+
}
|
|
302
|
+
}
|
|
303
|
+
/** Returns the value DB for this CC's node (or throws if it cannot be accessed) */
|
|
304
|
+
getValueDB() {
|
|
305
|
+
if (this.isSinglecast()) {
|
|
306
|
+
try {
|
|
307
|
+
return this.applHost.getValueDB(this.endpoint.nodeId);
|
|
308
|
+
}
|
|
309
|
+
catch {
|
|
310
|
+
throw new core_1.ZWaveError("The node for this CC does not exist or the driver is not ready yet", core_1.ZWaveErrorCodes.Driver_NotReady);
|
|
311
|
+
}
|
|
312
|
+
}
|
|
313
|
+
throw new core_1.ZWaveError("Cannot retrieve the value DB for non-singlecast CCs", core_1.ZWaveErrorCodes.CC_NoNodeID);
|
|
314
|
+
}
|
|
315
|
+
}
|
|
316
|
+
exports.CCAPI = CCAPI;
|
|
317
|
+
/** A CC API that is only available for physical endpoints */
|
|
318
|
+
class PhysicalCCAPI extends CCAPI {
|
|
319
|
+
constructor(applHost, endpoint) {
|
|
320
|
+
super(applHost, endpoint);
|
|
321
|
+
this.assertPhysicalEndpoint(endpoint);
|
|
322
|
+
}
|
|
323
|
+
}
|
|
324
|
+
exports.PhysicalCCAPI = PhysicalCCAPI;
|
|
325
|
+
//# sourceMappingURL=API.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"API.js","sourceRoot":"","sources":["../../src/lib/API.ts"],"names":[],"mappings":";;;AAAA,yCAkBwB;AAExB,6CAA2E;AAC3E,4DAAsD;AACtD,iDAAyD;AAIzD,oGAAoG;AACvF,QAAA,SAAS,GAAkB,MAAM,CAAC,GAAG,CAAC,iBAAiB,CAAC,CAAC;AActE,6FAA6F;AAChF,QAAA,UAAU,GAAkB,MAAM,CAAC,GAAG,CAAC,kBAAkB,CAAC,CAAC;AAKxE,8EAA8E;AAC9E,qFAAqF;AACrF,SAAgB,wBAAwB,CACvC,EAAkB,EAClB,QAAyB;IAEzB,MAAM,IAAI,iBAAU,CACnB,GAAG,qBAAc,CAAC,EAAE,CAAC,MAAM,QAAQ,+BAA+B,EAClE,sBAAe,CAAC,gBAAgB,CAChC,CAAC;AACH,CAAC;AARD,4DAQC;AAED,SAAgB,2BAA2B,CAC1C,EAAkB,EAClB,QAAyB,EACzB,WAA4B;IAE5B,MAAM,IAAI,iBAAU,CACnB,GAAG,qBAAc,CAAC,EAAE,CAAC,MAAM,WAAW,mDAAmD,QAAQ,GAAG,EACpG,sBAAe,CAAC,gBAAgB,CAChC,CAAC;AACH,CAAC;AATD,kEASC;AAED,SAAgB,uBAAuB,CACtC,EAAkB,EAClB,QAAyB;IAEzB,MAAM,IAAI,iBAAU,CACnB,GAAG,qBAAc,CAAC,EAAE,CAAC,eAAe,QAAQ,+CAA+C,EAC3F,sBAAe,CAAC,gBAAgB,CAChC,CAAC;AACH,CAAC;AARD,0DAQC;AAED,SAAgB,mBAAmB,CAClC,EAAkB,EAClB,QAAyB,EACzB,YAAoB,EACpB,YAAoB;IAEpB,MAAM,IAAI,iBAAU,CACnB,GAAG,qBAAc,CAAC,EAAE,CAAC,MAAM,QAAQ,sBAAs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