@zwave-js/cc 13.10.1 → 14.0.0-beta.0
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 +31 -20
- package/build/cc/AlarmSensorCC.d.ts.map +1 -1
- package/build/cc/AlarmSensorCC.js +106 -87
- package/build/cc/AlarmSensorCC.js.map +1 -1
- package/build/cc/AssociationCC.d.ts +38 -32
- package/build/cc/AssociationCC.d.ts.map +1 -1
- package/build/cc/AssociationCC.js +193 -176
- package/build/cc/AssociationCC.js.map +1 -1
- package/build/cc/AssociationGroupInfoCC.d.ts +42 -36
- package/build/cc/AssociationGroupInfoCC.d.ts.map +1 -1
- package/build/cc/AssociationGroupInfoCC.js +218 -200
- package/build/cc/AssociationGroupInfoCC.js.map +1 -1
- package/build/cc/BarrierOperatorCC.d.ts +41 -24
- package/build/cc/BarrierOperatorCC.d.ts.map +1 -1
- package/build/cc/BarrierOperatorCC.js +143 -109
- package/build/cc/BarrierOperatorCC.js.map +1 -1
- package/build/cc/BasicCC.d.ts +22 -23
- package/build/cc/BasicCC.d.ts.map +1 -1
- package/build/cc/BasicCC.js +83 -77
- package/build/cc/BasicCC.js.map +1 -1
- package/build/cc/BatteryCC.d.ts +22 -14
- package/build/cc/BatteryCC.d.ts.map +1 -1
- package/build/cc/BatteryCC.js +116 -87
- package/build/cc/BatteryCC.js.map +1 -1
- package/build/cc/BinarySensorCC.d.ts +22 -19
- package/build/cc/BinarySensorCC.d.ts.map +1 -1
- package/build/cc/BinarySensorCC.js +103 -93
- package/build/cc/BinarySensorCC.js.map +1 -1
- package/build/cc/BinarySwitchCC.d.ts +20 -20
- package/build/cc/BinarySwitchCC.d.ts.map +1 -1
- package/build/cc/BinarySwitchCC.js +71 -59
- package/build/cc/BinarySwitchCC.js.map +1 -1
- package/build/cc/CRC16CC.d.ts +9 -9
- package/build/cc/CRC16CC.d.ts.map +1 -1
- package/build/cc/CRC16CC.js +36 -36
- package/build/cc/CRC16CC.js.map +1 -1
- package/build/cc/CentralSceneCC.d.ts +34 -16
- package/build/cc/CentralSceneCC.d.ts.map +1 -1
- package/build/cc/CentralSceneCC.js +116 -79
- package/build/cc/CentralSceneCC.js.map +1 -1
- package/build/cc/ClimateControlScheduleCC.d.ts +38 -21
- package/build/cc/ClimateControlScheduleCC.d.ts.map +1 -1
- package/build/cc/ClimateControlScheduleCC.js +113 -81
- package/build/cc/ClimateControlScheduleCC.js.map +1 -1
- package/build/cc/ClockCC.d.ts +18 -11
- package/build/cc/ClockCC.d.ts.map +1 -1
- package/build/cc/ClockCC.js +57 -43
- package/build/cc/ClockCC.js.map +1 -1
- package/build/cc/ColorSwitchCC.d.ts +37 -33
- package/build/cc/ColorSwitchCC.d.ts.map +1 -1
- package/build/cc/ColorSwitchCC.js +216 -189
- package/build/cc/ColorSwitchCC.js.map +1 -1
- package/build/cc/ConfigurationCC.d.ts +89 -74
- package/build/cc/ConfigurationCC.d.ts.map +1 -1
- package/build/cc/ConfigurationCC.js +541 -485
- package/build/cc/ConfigurationCC.js.map +1 -1
- package/build/cc/DeviceResetLocallyCC.d.ts +3 -3
- package/build/cc/DeviceResetLocallyCC.d.ts.map +1 -1
- package/build/cc/DeviceResetLocallyCC.js +14 -14
- package/build/cc/DeviceResetLocallyCC.js.map +1 -1
- package/build/cc/DoorLockCC.d.ts +66 -27
- package/build/cc/DoorLockCC.d.ts.map +1 -1
- package/build/cc/DoorLockCC.js +288 -197
- package/build/cc/DoorLockCC.js.map +1 -1
- package/build/cc/DoorLockLoggingCC.d.ts +23 -13
- package/build/cc/DoorLockLoggingCC.d.ts.map +1 -1
- package/build/cc/DoorLockLoggingCC.js +81 -63
- package/build/cc/DoorLockLoggingCC.js.map +1 -1
- package/build/cc/EnergyProductionCC.d.ts +16 -14
- package/build/cc/EnergyProductionCC.d.ts.map +1 -1
- package/build/cc/EnergyProductionCC.js +58 -52
- package/build/cc/EnergyProductionCC.js.map +1 -1
- package/build/cc/EntryControlCC.d.ts +44 -18
- package/build/cc/EntryControlCC.d.ts.map +1 -1
- package/build/cc/EntryControlCC.js +163 -112
- package/build/cc/EntryControlCC.js.map +1 -1
- package/build/cc/FirmwareUpdateMetaDataCC.d.ts +69 -34
- package/build/cc/FirmwareUpdateMetaDataCC.d.ts.map +1 -1
- package/build/cc/FirmwareUpdateMetaDataCC.js +311 -245
- package/build/cc/FirmwareUpdateMetaDataCC.js.map +1 -1
- package/build/cc/HumidityControlModeCC.d.ts +24 -16
- package/build/cc/HumidityControlModeCC.d.ts.map +1 -1
- package/build/cc/HumidityControlModeCC.js +80 -65
- package/build/cc/HumidityControlModeCC.js.map +1 -1
- package/build/cc/HumidityControlOperatingStateCC.d.ts +11 -7
- package/build/cc/HumidityControlOperatingStateCC.d.ts.map +1 -1
- package/build/cc/HumidityControlOperatingStateCC.js +31 -22
- package/build/cc/HumidityControlOperatingStateCC.js.map +1 -1
- package/build/cc/HumidityControlSetpointCC.d.ts +68 -49
- package/build/cc/HumidityControlSetpointCC.d.ts.map +1 -1
- package/build/cc/HumidityControlSetpointCC.js +203 -181
- package/build/cc/HumidityControlSetpointCC.js.map +1 -1
- package/build/cc/InclusionControllerCC.d.ts +13 -11
- package/build/cc/InclusionControllerCC.d.ts.map +1 -1
- package/build/cc/InclusionControllerCC.js +49 -42
- package/build/cc/InclusionControllerCC.js.map +1 -1
- package/build/cc/IndicatorCC.d.ts +46 -39
- package/build/cc/IndicatorCC.d.ts.map +1 -1
- package/build/cc/IndicatorCC.js +298 -277
- package/build/cc/IndicatorCC.js.map +1 -1
- package/build/cc/IrrigationCC.d.ts +127 -57
- package/build/cc/IrrigationCC.d.ts.map +1 -1
- package/build/cc/IrrigationCC.js +496 -352
- package/build/cc/IrrigationCC.js.map +1 -1
- package/build/cc/LanguageCC.d.ts +17 -11
- package/build/cc/LanguageCC.d.ts.map +1 -1
- package/build/cc/LanguageCC.js +54 -44
- package/build/cc/LanguageCC.js.map +1 -1
- package/build/cc/LockCC.d.ts +16 -11
- package/build/cc/LockCC.d.ts.map +1 -1
- package/build/cc/LockCC.js +48 -38
- package/build/cc/LockCC.js.map +1 -1
- package/build/cc/ManufacturerProprietaryCC.d.ts +12 -11
- package/build/cc/ManufacturerProprietaryCC.d.ts.map +1 -1
- package/build/cc/ManufacturerProprietaryCC.js +45 -50
- package/build/cc/ManufacturerProprietaryCC.js.map +1 -1
- package/build/cc/ManufacturerSpecificCC.d.ts +20 -13
- package/build/cc/ManufacturerSpecificCC.d.ts.map +1 -1
- package/build/cc/ManufacturerSpecificCC.js +79 -63
- package/build/cc/ManufacturerSpecificCC.js.map +1 -1
- package/build/cc/MeterCC.d.ts +30 -26
- package/build/cc/MeterCC.d.ts.map +1 -1
- package/build/cc/MeterCC.js +236 -204
- package/build/cc/MeterCC.js.map +1 -1
- package/build/cc/MultiChannelAssociationCC.d.ts +31 -26
- package/build/cc/MultiChannelAssociationCC.d.ts.map +1 -1
- package/build/cc/MultiChannelAssociationCC.js +177 -168
- package/build/cc/MultiChannelAssociationCC.js.map +1 -1
- package/build/cc/MultiChannelCC.d.ts +70 -49
- package/build/cc/MultiChannelCC.d.ts.map +1 -1
- package/build/cc/MultiChannelCC.js +377 -318
- package/build/cc/MultiChannelCC.js.map +1 -1
- package/build/cc/MultiCommandCC.d.ts +9 -9
- package/build/cc/MultiCommandCC.d.ts.map +1 -1
- package/build/cc/MultiCommandCC.js +35 -36
- package/build/cc/MultiCommandCC.js.map +1 -1
- package/build/cc/MultilevelSensorCC.d.ts +38 -33
- package/build/cc/MultilevelSensorCC.d.ts.map +1 -1
- package/build/cc/MultilevelSensorCC.js +172 -152
- package/build/cc/MultilevelSensorCC.js.map +1 -1
- package/build/cc/MultilevelSwitchCC.d.ts +29 -25
- package/build/cc/MultilevelSwitchCC.d.ts.map +1 -1
- package/build/cc/MultilevelSwitchCC.js +147 -127
- package/build/cc/MultilevelSwitchCC.js.map +1 -1
- package/build/cc/NoOperationCC.d.ts +0 -8
- package/build/cc/NoOperationCC.d.ts.map +1 -1
- package/build/cc/NoOperationCC.js +2 -11
- package/build/cc/NoOperationCC.js.map +1 -1
- package/build/cc/NodeNamingCC.d.ts +27 -17
- package/build/cc/NodeNamingCC.d.ts.map +1 -1
- package/build/cc/NodeNamingCC.js +86 -69
- package/build/cc/NodeNamingCC.js.map +1 -1
- package/build/cc/NotificationCC.d.ts +46 -43
- package/build/cc/NotificationCC.d.ts.map +1 -1
- package/build/cc/NotificationCC.js +317 -303
- package/build/cc/NotificationCC.js.map +1 -1
- package/build/cc/PowerlevelCC.d.ts +22 -18
- package/build/cc/PowerlevelCC.d.ts.map +1 -1
- package/build/cc/PowerlevelCC.js +125 -95
- package/build/cc/PowerlevelCC.js.map +1 -1
- package/build/cc/ProtectionCC.d.ts +49 -26
- package/build/cc/ProtectionCC.d.ts.map +1 -1
- package/build/cc/ProtectionCC.js +172 -126
- package/build/cc/ProtectionCC.js.map +1 -1
- package/build/cc/SceneActivationCC.d.ts +8 -7
- package/build/cc/SceneActivationCC.d.ts.map +1 -1
- package/build/cc/SceneActivationCC.js +28 -23
- package/build/cc/SceneActivationCC.js.map +1 -1
- package/build/cc/SceneActuatorConfigurationCC.d.ts +23 -15
- package/build/cc/SceneActuatorConfigurationCC.d.ts.map +1 -1
- package/build/cc/SceneActuatorConfigurationCC.js +79 -62
- package/build/cc/SceneActuatorConfigurationCC.js.map +1 -1
- package/build/cc/SceneControllerConfigurationCC.d.ts +25 -17
- package/build/cc/SceneControllerConfigurationCC.d.ts.map +1 -1
- package/build/cc/SceneControllerConfigurationCC.js +92 -78
- package/build/cc/SceneControllerConfigurationCC.js.map +1 -1
- package/build/cc/ScheduleEntryLockCC.d.ts +86 -72
- package/build/cc/ScheduleEntryLockCC.d.ts.map +1 -1
- package/build/cc/ScheduleEntryLockCC.js +607 -455
- package/build/cc/ScheduleEntryLockCC.js.map +1 -1
- package/build/cc/Security2CC.d.ts +78 -87
- package/build/cc/Security2CC.d.ts.map +1 -1
- package/build/cc/Security2CC.js +798 -765
- package/build/cc/Security2CC.js.map +1 -1
- package/build/cc/SecurityCC.d.ts +47 -42
- package/build/cc/SecurityCC.d.ts.map +1 -1
- package/build/cc/SecurityCC.js +240 -218
- package/build/cc/SecurityCC.js.map +1 -1
- package/build/cc/SoundSwitchCC.d.ts +36 -29
- package/build/cc/SoundSwitchCC.d.ts.map +1 -1
- package/build/cc/SoundSwitchCC.js +180 -157
- package/build/cc/SoundSwitchCC.js.map +1 -1
- package/build/cc/SupervisionCC.d.ts +17 -14
- package/build/cc/SupervisionCC.d.ts.map +1 -1
- package/build/cc/SupervisionCC.js +86 -66
- package/build/cc/SupervisionCC.js.map +1 -1
- package/build/cc/ThermostatFanModeCC.d.ts +25 -15
- package/build/cc/ThermostatFanModeCC.d.ts.map +1 -1
- package/build/cc/ThermostatFanModeCC.js +79 -60
- package/build/cc/ThermostatFanModeCC.js.map +1 -1
- package/build/cc/ThermostatFanStateCC.d.ts +11 -7
- package/build/cc/ThermostatFanStateCC.d.ts.map +1 -1
- package/build/cc/ThermostatFanStateCC.js +31 -22
- package/build/cc/ThermostatFanStateCC.js.map +1 -1
- package/build/cc/ThermostatModeCC.d.ts +24 -21
- package/build/cc/ThermostatModeCC.d.ts.map +1 -1
- package/build/cc/ThermostatModeCC.js +106 -90
- package/build/cc/ThermostatModeCC.js.map +1 -1
- package/build/cc/ThermostatOperatingStateCC.d.ts +11 -7
- package/build/cc/ThermostatOperatingStateCC.d.ts.map +1 -1
- package/build/cc/ThermostatOperatingStateCC.js +31 -22
- package/build/cc/ThermostatOperatingStateCC.js.map +1 -1
- package/build/cc/ThermostatSetbackCC.d.ts +14 -13
- package/build/cc/ThermostatSetbackCC.d.ts.map +1 -1
- package/build/cc/ThermostatSetbackCC.js +64 -57
- package/build/cc/ThermostatSetbackCC.js.map +1 -1
- package/build/cc/ThermostatSetpointCC.d.ts +38 -57
- package/build/cc/ThermostatSetpointCC.d.ts.map +1 -1
- package/build/cc/ThermostatSetpointCC.js +200 -264
- package/build/cc/ThermostatSetpointCC.js.map +1 -1
- package/build/cc/TimeCC.d.ts +24 -20
- package/build/cc/TimeCC.d.ts.map +1 -1
- package/build/cc/TimeCC.js +119 -108
- package/build/cc/TimeCC.js.map +1 -1
- package/build/cc/TimeParametersCC.d.ts +18 -14
- package/build/cc/TimeParametersCC.d.ts.map +1 -1
- package/build/cc/TimeParametersCC.js +77 -69
- package/build/cc/TimeParametersCC.js.map +1 -1
- package/build/cc/TransportServiceCC.d.ts +29 -32
- package/build/cc/TransportServiceCC.d.ts.map +1 -1
- package/build/cc/TransportServiceCC.js +159 -161
- package/build/cc/TransportServiceCC.js.map +1 -1
- package/build/cc/UserCodeCC.d.ts +83 -66
- package/build/cc/UserCodeCC.d.ts.map +1 -1
- package/build/cc/UserCodeCC.js +449 -402
- package/build/cc/UserCodeCC.js.map +1 -1
- package/build/cc/VersionCC.d.ts +36 -20
- package/build/cc/VersionCC.d.ts.map +1 -1
- package/build/cc/VersionCC.js +190 -149
- package/build/cc/VersionCC.js.map +1 -1
- package/build/cc/WakeUpCC.d.ts +27 -13
- package/build/cc/WakeUpCC.d.ts.map +1 -1
- package/build/cc/WakeUpCC.js +105 -77
- package/build/cc/WakeUpCC.js.map +1 -1
- package/build/cc/WindowCoveringCC.d.ts +39 -27
- package/build/cc/WindowCoveringCC.d.ts.map +1 -1
- package/build/cc/WindowCoveringCC.js +169 -137
- package/build/cc/WindowCoveringCC.js.map +1 -1
- package/build/cc/ZWavePlusCC.d.ts +8 -7
- package/build/cc/ZWavePlusCC.d.ts.map +1 -1
- package/build/cc/ZWavePlusCC.js +44 -37
- package/build/cc/ZWavePlusCC.js.map +1 -1
- package/build/cc/ZWaveProtocolCC.d.ts +111 -84
- package/build/cc/ZWaveProtocolCC.d.ts.map +1 -1
- package/build/cc/ZWaveProtocolCC.js +583 -508
- package/build/cc/ZWaveProtocolCC.js.map +1 -1
- package/build/cc/index.d.ts +37 -34
- package/build/cc/index.d.ts.map +1 -1
- package/build/cc/index.js +6 -7
- package/build/cc/index.js.map +1 -1
- package/build/cc/manufacturerProprietary/FibaroCC.d.ts +29 -24
- package/build/cc/manufacturerProprietary/FibaroCC.d.ts.map +1 -1
- package/build/cc/manufacturerProprietary/FibaroCC.js +109 -112
- package/build/cc/manufacturerProprietary/FibaroCC.js.map +1 -1
- package/build/index.d.ts +0 -1
- package/build/index.d.ts.map +1 -1
- package/build/index.js +0 -1
- package/build/index.js.map +1 -1
- package/build/lib/API.d.ts +21 -18
- package/build/lib/API.d.ts.map +1 -1
- package/build/lib/API.js +25 -49
- package/build/lib/API.js.map +1 -1
- package/build/lib/CommandClass.d.ts +51 -89
- package/build/lib/CommandClass.d.ts.map +1 -1
- package/build/lib/CommandClass.js +177 -249
- package/build/lib/CommandClass.js.map +1 -1
- package/build/lib/EncapsulatingCommandClass.d.ts +1 -15
- package/build/lib/EncapsulatingCommandClass.d.ts.map +1 -1
- package/build/lib/EncapsulatingCommandClass.js.map +1 -1
- package/build/lib/ICommandClassContainer.d.ts +1 -8
- package/build/lib/ICommandClassContainer.d.ts.map +1 -1
- package/build/lib/ICommandClassContainer.js +0 -8
- package/build/lib/ICommandClassContainer.js.map +1 -1
- package/build/lib/Values.d.ts +3 -3
- package/build/lib/Values.d.ts.map +1 -1
- package/build/lib/_Types.d.ts.map +1 -1
- package/build/lib/_Types.js +1 -0
- package/build/lib/_Types.js.map +1 -1
- package/build/lib/utils.d.ts +14 -13
- package/build/lib/utils.d.ts.map +1 -1
- package/build/lib/utils.js +94 -92
- package/build/lib/utils.js.map +1 -1
- package/package.json +4 -5
|
@@ -28,7 +28,7 @@ var __importStar = (this && this.__importStar) || function (mod) {
|
|
|
28
28
|
__setModuleDefault(result, mod);
|
|
29
29
|
return result;
|
|
30
30
|
};
|
|
31
|
-
var AssociationCC_1;
|
|
31
|
+
var AssociationCC_1, AssociationCCSet_1, AssociationCCRemove_1, AssociationCCReport_1, AssociationCCGet_1, AssociationCCSupportedGroupingsReport_1, AssociationCCSpecificGroupReport_1;
|
|
32
32
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
33
33
|
exports.AssociationCCSpecificGroupGet = exports.AssociationCCSpecificGroupReport = exports.AssociationCCSupportedGroupingsGet = exports.AssociationCCSupportedGroupingsReport = exports.AssociationCCGet = exports.AssociationCCReport = exports.AssociationCCRemove = exports.AssociationCCSet = exports.AssociationCC = exports.AssociationCCAPI = exports.AssociationCCValues = void 0;
|
|
34
34
|
function __assertType(argName, typeName, boundHasError) {
|
|
@@ -43,7 +43,7 @@ const __assertType__number = $o => {
|
|
|
43
43
|
}
|
|
44
44
|
return _number($o);
|
|
45
45
|
};
|
|
46
|
-
const
|
|
46
|
+
const __assertType__AssociationCCReportOptions = $o => {
|
|
47
47
|
function _number($o) {
|
|
48
48
|
return typeof $o !== "number" ? {} : null;
|
|
49
49
|
}
|
|
@@ -184,23 +184,23 @@ let AssociationCCAPI = class AssociationCCAPI extends API_1.PhysicalCCAPI {
|
|
|
184
184
|
*/
|
|
185
185
|
async getGroupCount() {
|
|
186
186
|
this.assertSupportsCommand(_Types_1.AssociationCommand, _Types_1.AssociationCommand.SupportedGroupingsGet);
|
|
187
|
-
const cc = new AssociationCCSupportedGroupingsGet(
|
|
187
|
+
const cc = new AssociationCCSupportedGroupingsGet({
|
|
188
188
|
nodeId: this.endpoint.nodeId,
|
|
189
|
-
|
|
189
|
+
endpointIndex: this.endpoint.index,
|
|
190
190
|
});
|
|
191
|
-
const response = await this.
|
|
191
|
+
const response = await this.host.sendCommand(cc, this.commandOptions);
|
|
192
192
|
if (response)
|
|
193
193
|
return response.groupCount;
|
|
194
194
|
}
|
|
195
195
|
async reportGroupCount(groupCount) {
|
|
196
196
|
__assertType("groupCount", "number", __assertType__number.bind(void 0, groupCount));
|
|
197
197
|
this.assertSupportsCommand(_Types_1.AssociationCommand, _Types_1.AssociationCommand.SupportedGroupingsReport);
|
|
198
|
-
const cc = new AssociationCCSupportedGroupingsReport(
|
|
198
|
+
const cc = new AssociationCCSupportedGroupingsReport({
|
|
199
199
|
nodeId: this.endpoint.nodeId,
|
|
200
|
-
|
|
200
|
+
endpointIndex: this.endpoint.index,
|
|
201
201
|
groupCount,
|
|
202
202
|
});
|
|
203
|
-
await this.
|
|
203
|
+
await this.host.sendCommand(cc, this.commandOptions);
|
|
204
204
|
}
|
|
205
205
|
/**
|
|
206
206
|
* Returns information about an association group.
|
|
@@ -208,12 +208,12 @@ let AssociationCCAPI = class AssociationCCAPI extends API_1.PhysicalCCAPI {
|
|
|
208
208
|
async getGroup(groupId) {
|
|
209
209
|
__assertType("groupId", "number", __assertType__number.bind(void 0, groupId));
|
|
210
210
|
this.assertSupportsCommand(_Types_1.AssociationCommand, _Types_1.AssociationCommand.Get);
|
|
211
|
-
const cc = new AssociationCCGet(
|
|
211
|
+
const cc = new AssociationCCGet({
|
|
212
212
|
nodeId: this.endpoint.nodeId,
|
|
213
|
-
|
|
213
|
+
endpointIndex: this.endpoint.index,
|
|
214
214
|
groupId,
|
|
215
215
|
});
|
|
216
|
-
const response = await this.
|
|
216
|
+
const response = await this.host.sendCommand(cc, this.commandOptions);
|
|
217
217
|
if (response) {
|
|
218
218
|
return {
|
|
219
219
|
maxNodes: response.maxNodes,
|
|
@@ -222,14 +222,14 @@ let AssociationCCAPI = class AssociationCCAPI extends API_1.PhysicalCCAPI {
|
|
|
222
222
|
}
|
|
223
223
|
}
|
|
224
224
|
async sendReport(options) {
|
|
225
|
-
__assertType("options", "
|
|
225
|
+
__assertType("options", "AssociationCCReportOptions", __assertType__AssociationCCReportOptions.bind(void 0, options));
|
|
226
226
|
this.assertSupportsCommand(_Types_1.AssociationCommand, _Types_1.AssociationCommand.Report);
|
|
227
|
-
const cc = new AssociationCCReport(
|
|
227
|
+
const cc = new AssociationCCReport({
|
|
228
228
|
nodeId: this.endpoint.nodeId,
|
|
229
|
-
|
|
229
|
+
endpointIndex: this.endpoint.index,
|
|
230
230
|
...options,
|
|
231
231
|
});
|
|
232
|
-
await this.
|
|
232
|
+
await this.host.sendCommand(cc, this.commandOptions);
|
|
233
233
|
}
|
|
234
234
|
/**
|
|
235
235
|
* Adds new nodes to an association group
|
|
@@ -238,13 +238,13 @@ let AssociationCCAPI = class AssociationCCAPI extends API_1.PhysicalCCAPI {
|
|
|
238
238
|
__assertType("groupId", "number", __assertType__number.bind(void 0, groupId));
|
|
239
239
|
__assertType("nodeIds", undefined, __assertType__sa__number_ea_2.bind(void 0, nodeIds));
|
|
240
240
|
this.assertSupportsCommand(_Types_1.AssociationCommand, _Types_1.AssociationCommand.Set);
|
|
241
|
-
const cc = new AssociationCCSet(
|
|
241
|
+
const cc = new AssociationCCSet({
|
|
242
242
|
nodeId: this.endpoint.nodeId,
|
|
243
|
-
|
|
243
|
+
endpointIndex: this.endpoint.index,
|
|
244
244
|
groupId,
|
|
245
245
|
nodeIds,
|
|
246
246
|
});
|
|
247
|
-
return this.
|
|
247
|
+
return this.host.sendCommand(cc, this.commandOptions);
|
|
248
248
|
}
|
|
249
249
|
/**
|
|
250
250
|
* Removes nodes from an association group
|
|
@@ -252,12 +252,21 @@ let AssociationCCAPI = class AssociationCCAPI extends API_1.PhysicalCCAPI {
|
|
|
252
252
|
async removeNodeIds(options) {
|
|
253
253
|
__assertType("options", "AssociationCCRemoveOptions", __assertType__AssociationCCRemoveOptions.bind(void 0, options));
|
|
254
254
|
this.assertSupportsCommand(_Types_1.AssociationCommand, _Types_1.AssociationCommand.Remove);
|
|
255
|
-
|
|
255
|
+
// Validate options
|
|
256
|
+
if (!options.groupId) {
|
|
257
|
+
if (this.version === 1) {
|
|
258
|
+
throw new safe_1.ZWaveError(`Node ${this.endpoint.nodeId} only supports AssociationCC V1 which requires the group Id to be set`, safe_1.ZWaveErrorCodes.Argument_Invalid);
|
|
259
|
+
}
|
|
260
|
+
}
|
|
261
|
+
else if (options.groupId < 0) {
|
|
262
|
+
throw new safe_1.ZWaveError("The group id must be positive!", safe_1.ZWaveErrorCodes.Argument_Invalid);
|
|
263
|
+
}
|
|
264
|
+
const cc = new AssociationCCRemove({
|
|
256
265
|
nodeId: this.endpoint.nodeId,
|
|
257
|
-
|
|
266
|
+
endpointIndex: this.endpoint.index,
|
|
258
267
|
...options,
|
|
259
268
|
});
|
|
260
|
-
return this.
|
|
269
|
+
return this.host.sendCommand(cc, this.commandOptions);
|
|
261
270
|
}
|
|
262
271
|
/**
|
|
263
272
|
* Removes nodes from all association groups
|
|
@@ -283,11 +292,11 @@ let AssociationCCAPI = class AssociationCCAPI extends API_1.PhysicalCCAPI {
|
|
|
283
292
|
*/
|
|
284
293
|
async getSpecificGroup() {
|
|
285
294
|
this.assertSupportsCommand(_Types_1.AssociationCommand, _Types_1.AssociationCommand.SpecificGroupGet);
|
|
286
|
-
const cc = new AssociationCCSpecificGroupGet(
|
|
295
|
+
const cc = new AssociationCCSpecificGroupGet({
|
|
287
296
|
nodeId: this.endpoint.nodeId,
|
|
288
|
-
|
|
297
|
+
endpointIndex: this.endpoint.index,
|
|
289
298
|
});
|
|
290
|
-
const response = await this.
|
|
299
|
+
const response = await this.host.sendCommand(cc, this.commandOptions);
|
|
291
300
|
return response?.group;
|
|
292
301
|
}
|
|
293
302
|
/**
|
|
@@ -296,12 +305,12 @@ let AssociationCCAPI = class AssociationCCAPI extends API_1.PhysicalCCAPI {
|
|
|
296
305
|
async reportSpecificGroup(group) {
|
|
297
306
|
__assertType("group", "number", __assertType__number.bind(void 0, group));
|
|
298
307
|
this.assertSupportsCommand(_Types_1.AssociationCommand, _Types_1.AssociationCommand.SpecificGroupReport);
|
|
299
|
-
const cc = new AssociationCCSpecificGroupReport(
|
|
308
|
+
const cc = new AssociationCCSpecificGroupReport({
|
|
300
309
|
nodeId: this.endpoint.nodeId,
|
|
301
|
-
|
|
310
|
+
endpointIndex: this.endpoint.index,
|
|
302
311
|
group,
|
|
303
312
|
});
|
|
304
|
-
await this.
|
|
313
|
+
await this.host.sendCommand(cc, this.commandOptions);
|
|
305
314
|
}
|
|
306
315
|
};
|
|
307
316
|
exports.AssociationCCAPI = AssociationCCAPI;
|
|
@@ -322,22 +331,22 @@ let AssociationCC = AssociationCC_1 = class AssociationCC extends CommandClass_1
|
|
|
322
331
|
* Returns the number of association groups reported by the node/endpoint.
|
|
323
332
|
* This only works AFTER the interview process
|
|
324
333
|
*/
|
|
325
|
-
static getGroupCountCached(
|
|
326
|
-
return
|
|
334
|
+
static getGroupCountCached(ctx, endpoint) {
|
|
335
|
+
return ctx
|
|
327
336
|
.getValueDB(endpoint.nodeId)
|
|
328
|
-
.getValue(exports.AssociationCCValues.groupCount.endpoint(endpoint.index)) || 0
|
|
337
|
+
.getValue(exports.AssociationCCValues.groupCount.endpoint(endpoint.index)) || 0;
|
|
329
338
|
}
|
|
330
339
|
/**
|
|
331
340
|
* Returns the number of nodes an association group supports.
|
|
332
341
|
* This only works AFTER the interview process
|
|
333
342
|
*/
|
|
334
|
-
static getMaxNodesCached(
|
|
335
|
-
return (
|
|
343
|
+
static getMaxNodesCached(ctx, endpoint, groupId) {
|
|
344
|
+
return (ctx
|
|
336
345
|
.getValueDB(endpoint.nodeId)
|
|
337
346
|
.getValue(exports.AssociationCCValues.maxNodes(groupId).endpoint(endpoint.index))
|
|
338
347
|
// If the information is not available, fall back to the configuration file if possible
|
|
339
348
|
// This can happen on some legacy devices which have "hidden" association groups
|
|
340
|
-
??
|
|
349
|
+
?? ctx
|
|
341
350
|
.getDeviceConfig?.(endpoint.nodeId)
|
|
342
351
|
?.getAssociationConfigForEndpoint(endpoint.index, groupId)
|
|
343
352
|
?.maxNodes
|
|
@@ -347,10 +356,10 @@ let AssociationCC = AssociationCC_1 = class AssociationCC extends CommandClass_1
|
|
|
347
356
|
* Returns all the destinations of all association groups reported by the node/endpoint.
|
|
348
357
|
* This only works AFTER the interview process
|
|
349
358
|
*/
|
|
350
|
-
static getAllDestinationsCached(
|
|
359
|
+
static getAllDestinationsCached(ctx, endpoint) {
|
|
351
360
|
const ret = new Map();
|
|
352
|
-
const groupCount = this.getGroupCountCached(
|
|
353
|
-
const valueDB =
|
|
361
|
+
const groupCount = this.getGroupCountCached(ctx, endpoint);
|
|
362
|
+
const valueDB = ctx.getValueDB(endpoint.nodeId);
|
|
354
363
|
for (let i = 1; i <= groupCount; i++) {
|
|
355
364
|
// Add all root destinations
|
|
356
365
|
const nodes = valueDB.getValue(exports.AssociationCCValues.nodeIds(i).endpoint(endpoint.index)) ?? [];
|
|
@@ -360,13 +369,13 @@ let AssociationCC = AssociationCC_1 = class AssociationCC extends CommandClass_1
|
|
|
360
369
|
}
|
|
361
370
|
return ret;
|
|
362
371
|
}
|
|
363
|
-
async interview(
|
|
364
|
-
const node = this.getNode(
|
|
365
|
-
const endpoint = this.getEndpoint(
|
|
366
|
-
const api = API_1.CCAPI.create(safe_1.CommandClasses.Association,
|
|
372
|
+
async interview(ctx) {
|
|
373
|
+
const node = this.getNode(ctx);
|
|
374
|
+
const endpoint = this.getEndpoint(ctx);
|
|
375
|
+
const api = API_1.CCAPI.create(safe_1.CommandClasses.Association, ctx, endpoint).withOptions({
|
|
367
376
|
priority: safe_1.MessagePriority.NodeQuery,
|
|
368
377
|
});
|
|
369
|
-
|
|
378
|
+
ctx.logNode(node.id, {
|
|
370
379
|
endpoint: this.endpointIndex,
|
|
371
380
|
message: `Interviewing ${this.ccName}...`,
|
|
372
381
|
direction: "none",
|
|
@@ -375,21 +384,21 @@ let AssociationCC = AssociationCC_1 = class AssociationCC extends CommandClass_1
|
|
|
375
384
|
// normal association groups since some devices report more association groups than
|
|
376
385
|
// multi channel association groups
|
|
377
386
|
// Find out how many groups are supported
|
|
378
|
-
|
|
387
|
+
ctx.logNode(node.id, {
|
|
379
388
|
endpoint: this.endpointIndex,
|
|
380
389
|
message: "querying number of association groups...",
|
|
381
390
|
direction: "outbound",
|
|
382
391
|
});
|
|
383
392
|
const groupCount = await api.getGroupCount();
|
|
384
393
|
if (groupCount != undefined) {
|
|
385
|
-
|
|
394
|
+
ctx.logNode(node.id, {
|
|
386
395
|
endpoint: this.endpointIndex,
|
|
387
396
|
message: `supports ${groupCount} association groups`,
|
|
388
397
|
direction: "inbound",
|
|
389
398
|
});
|
|
390
399
|
}
|
|
391
400
|
else {
|
|
392
|
-
|
|
401
|
+
ctx.logNode(node.id, {
|
|
393
402
|
endpoint: this.endpointIndex,
|
|
394
403
|
message: "Querying association groups timed out, skipping interview...",
|
|
395
404
|
level: "warn",
|
|
@@ -397,32 +406,32 @@ let AssociationCC = AssociationCC_1 = class AssociationCC extends CommandClass_1
|
|
|
397
406
|
return;
|
|
398
407
|
}
|
|
399
408
|
// Query each association group for its members
|
|
400
|
-
await this.refreshValues(
|
|
409
|
+
await this.refreshValues(ctx);
|
|
401
410
|
// Skip the remaining Association CC interview in favor of Multi Channel Association if possible
|
|
402
411
|
if (endpoint.supportsCC(safe_1.CommandClasses["Multi Channel Association"])) {
|
|
403
|
-
|
|
412
|
+
ctx.logNode(node.id, {
|
|
404
413
|
endpoint: this.endpointIndex,
|
|
405
414
|
message: `${this.constructor.name}: delaying configuration of lifeline associations until after Multi Channel Association interview...`,
|
|
406
415
|
direction: "none",
|
|
407
416
|
});
|
|
408
|
-
this.setInterviewComplete(
|
|
417
|
+
this.setInterviewComplete(ctx, true);
|
|
409
418
|
return;
|
|
410
419
|
}
|
|
411
420
|
// And set up lifeline associations
|
|
412
|
-
await ccUtils.configureLifelineAssociations(
|
|
421
|
+
await ccUtils.configureLifelineAssociations(ctx, endpoint);
|
|
413
422
|
// Remember that the interview is complete
|
|
414
|
-
this.setInterviewComplete(
|
|
423
|
+
this.setInterviewComplete(ctx, true);
|
|
415
424
|
}
|
|
416
|
-
async refreshValues(
|
|
417
|
-
const node = this.getNode(
|
|
418
|
-
const endpoint = this.getEndpoint(
|
|
419
|
-
const api = API_1.CCAPI.create(safe_1.CommandClasses.Association,
|
|
425
|
+
async refreshValues(ctx) {
|
|
426
|
+
const node = this.getNode(ctx);
|
|
427
|
+
const endpoint = this.getEndpoint(ctx);
|
|
428
|
+
const api = API_1.CCAPI.create(safe_1.CommandClasses.Association, ctx, endpoint).withOptions({
|
|
420
429
|
priority: safe_1.MessagePriority.NodeQuery,
|
|
421
430
|
});
|
|
422
|
-
const groupCount = AssociationCC_1.getGroupCountCached(
|
|
431
|
+
const groupCount = AssociationCC_1.getGroupCountCached(ctx, endpoint);
|
|
423
432
|
// Query each association group
|
|
424
433
|
for (let groupId = 1; groupId <= groupCount; groupId++) {
|
|
425
|
-
|
|
434
|
+
ctx.logNode(node.id, {
|
|
426
435
|
endpoint: this.endpointIndex,
|
|
427
436
|
message: `querying association group #${groupId}...`,
|
|
428
437
|
direction: "outbound",
|
|
@@ -432,7 +441,7 @@ let AssociationCC = AssociationCC_1 = class AssociationCC extends CommandClass_1
|
|
|
432
441
|
const logMessage = `received information for association group #${groupId}:
|
|
433
442
|
maximum # of nodes: ${group.maxNodes}
|
|
434
443
|
currently assigned nodes: ${group.nodeIds.map(String).join(", ")}`;
|
|
435
|
-
|
|
444
|
+
ctx.logNode(node.id, {
|
|
436
445
|
endpoint: this.endpointIndex,
|
|
437
446
|
message: logMessage,
|
|
438
447
|
direction: "inbound",
|
|
@@ -447,32 +456,35 @@ exports.AssociationCC = AssociationCC = AssociationCC_1 = __decorate([
|
|
|
447
456
|
(0, CommandClassDecorators_1.implementedVersion)(4),
|
|
448
457
|
(0, CommandClassDecorators_1.ccValues)(exports.AssociationCCValues)
|
|
449
458
|
], AssociationCC);
|
|
450
|
-
let AssociationCCSet = class AssociationCCSet extends AssociationCC {
|
|
451
|
-
constructor(
|
|
452
|
-
super(
|
|
453
|
-
if (
|
|
454
|
-
(
|
|
455
|
-
this.groupId = this.payload[0];
|
|
456
|
-
this.nodeIds = [...this.payload.subarray(1)];
|
|
459
|
+
let AssociationCCSet = AssociationCCSet_1 = class AssociationCCSet extends AssociationCC {
|
|
460
|
+
constructor(options) {
|
|
461
|
+
super(options);
|
|
462
|
+
if (options.groupId < 1) {
|
|
463
|
+
throw new safe_1.ZWaveError("The group id must be positive!", safe_1.ZWaveErrorCodes.Argument_Invalid);
|
|
457
464
|
}
|
|
458
|
-
|
|
459
|
-
|
|
460
|
-
throw new safe_1.ZWaveError("The group id must be positive!", safe_1.ZWaveErrorCodes.Argument_Invalid);
|
|
461
|
-
}
|
|
462
|
-
if (options.nodeIds.some((n) => n < 1 || n > safe_1.MAX_NODES)) {
|
|
463
|
-
throw new safe_1.ZWaveError(`All node IDs must be between 1 and ${safe_1.MAX_NODES}!`, safe_1.ZWaveErrorCodes.Argument_Invalid);
|
|
464
|
-
}
|
|
465
|
-
this.groupId = options.groupId;
|
|
466
|
-
this.nodeIds = options.nodeIds;
|
|
465
|
+
if (options.nodeIds.some((n) => n < 1 || n > safe_1.MAX_NODES)) {
|
|
466
|
+
throw new safe_1.ZWaveError(`All node IDs must be between 1 and ${safe_1.MAX_NODES}!`, safe_1.ZWaveErrorCodes.Argument_Invalid);
|
|
467
467
|
}
|
|
468
|
+
this.groupId = options.groupId;
|
|
469
|
+
this.nodeIds = options.nodeIds;
|
|
470
|
+
}
|
|
471
|
+
static from(raw, ctx) {
|
|
472
|
+
(0, safe_1.validatePayload)(raw.payload.length >= 2);
|
|
473
|
+
const groupId = raw.payload[0];
|
|
474
|
+
const nodeIds = [...raw.payload.subarray(1)];
|
|
475
|
+
return new AssociationCCSet_1({
|
|
476
|
+
nodeId: ctx.sourceNodeId,
|
|
477
|
+
groupId,
|
|
478
|
+
nodeIds,
|
|
479
|
+
});
|
|
468
480
|
}
|
|
469
481
|
groupId;
|
|
470
482
|
nodeIds;
|
|
471
|
-
serialize() {
|
|
483
|
+
serialize(ctx) {
|
|
472
484
|
this.payload = Buffer.from([this.groupId, ...this.nodeIds]);
|
|
473
|
-
return super.serialize();
|
|
485
|
+
return super.serialize(ctx);
|
|
474
486
|
}
|
|
475
|
-
toLogEntry(
|
|
487
|
+
toLogEntry(ctx) {
|
|
476
488
|
const message = {
|
|
477
489
|
"group id": this.groupId || "all groups",
|
|
478
490
|
"node ids": this.nodeIds.length
|
|
@@ -480,53 +492,47 @@ let AssociationCCSet = class AssociationCCSet extends AssociationCC {
|
|
|
480
492
|
: "all nodes",
|
|
481
493
|
};
|
|
482
494
|
return {
|
|
483
|
-
...super.toLogEntry(
|
|
495
|
+
...super.toLogEntry(ctx),
|
|
484
496
|
message,
|
|
485
497
|
};
|
|
486
498
|
}
|
|
487
499
|
};
|
|
488
500
|
exports.AssociationCCSet = AssociationCCSet;
|
|
489
|
-
exports.AssociationCCSet = AssociationCCSet = __decorate([
|
|
501
|
+
exports.AssociationCCSet = AssociationCCSet = AssociationCCSet_1 = __decorate([
|
|
490
502
|
(0, CommandClassDecorators_1.CCCommand)(_Types_1.AssociationCommand.Set),
|
|
491
503
|
(0, CommandClassDecorators_1.useSupervision)()
|
|
492
504
|
], AssociationCCSet);
|
|
493
|
-
let AssociationCCRemove = class AssociationCCRemove extends AssociationCC {
|
|
494
|
-
constructor(
|
|
495
|
-
super(
|
|
496
|
-
|
|
497
|
-
|
|
498
|
-
|
|
499
|
-
|
|
500
|
-
|
|
501
|
-
|
|
502
|
-
|
|
503
|
-
|
|
504
|
-
|
|
505
|
-
|
|
506
|
-
if (this.version === 1) {
|
|
507
|
-
throw new safe_1.ZWaveError(`Node ${this
|
|
508
|
-
.nodeId} only supports AssociationCC V1 which requires the group Id to be set`, safe_1.ZWaveErrorCodes.Argument_Invalid);
|
|
509
|
-
}
|
|
510
|
-
}
|
|
511
|
-
else if (options.groupId < 0) {
|
|
512
|
-
throw new safe_1.ZWaveError("The group id must be positive!", safe_1.ZWaveErrorCodes.Argument_Invalid);
|
|
513
|
-
}
|
|
514
|
-
// When removing associations, we allow invalid node IDs.
|
|
515
|
-
// See GH#3606 - it is possible that those exist.
|
|
516
|
-
this.groupId = options.groupId;
|
|
517
|
-
this.nodeIds = options.nodeIds;
|
|
505
|
+
let AssociationCCRemove = AssociationCCRemove_1 = class AssociationCCRemove extends AssociationCC {
|
|
506
|
+
constructor(options) {
|
|
507
|
+
super(options);
|
|
508
|
+
// When removing associations, we allow invalid node IDs.
|
|
509
|
+
// See GH#3606 - it is possible that those exist.
|
|
510
|
+
this.groupId = options.groupId;
|
|
511
|
+
this.nodeIds = options.nodeIds;
|
|
512
|
+
}
|
|
513
|
+
static from(raw, ctx) {
|
|
514
|
+
(0, safe_1.validatePayload)(raw.payload.length >= 1);
|
|
515
|
+
let groupId;
|
|
516
|
+
if (raw.payload[0] !== 0) {
|
|
517
|
+
groupId = raw.payload[0];
|
|
518
518
|
}
|
|
519
|
+
const nodeIds = [...raw.payload.subarray(1)];
|
|
520
|
+
return new AssociationCCRemove_1({
|
|
521
|
+
nodeId: ctx.sourceNodeId,
|
|
522
|
+
groupId,
|
|
523
|
+
nodeIds,
|
|
524
|
+
});
|
|
519
525
|
}
|
|
520
526
|
groupId;
|
|
521
527
|
nodeIds;
|
|
522
|
-
serialize() {
|
|
528
|
+
serialize(ctx) {
|
|
523
529
|
this.payload = Buffer.from([
|
|
524
530
|
this.groupId || 0,
|
|
525
531
|
...(this.nodeIds || []),
|
|
526
532
|
]);
|
|
527
|
-
return super.serialize();
|
|
533
|
+
return super.serialize(ctx);
|
|
528
534
|
}
|
|
529
|
-
toLogEntry(
|
|
535
|
+
toLogEntry(ctx) {
|
|
530
536
|
const message = {
|
|
531
537
|
"group id": this.groupId || "all groups",
|
|
532
538
|
"node ids": this.nodeIds && this.nodeIds.length
|
|
@@ -534,32 +540,37 @@ let AssociationCCRemove = class AssociationCCRemove extends AssociationCC {
|
|
|
534
540
|
: "all nodes",
|
|
535
541
|
};
|
|
536
542
|
return {
|
|
537
|
-
...super.toLogEntry(
|
|
543
|
+
...super.toLogEntry(ctx),
|
|
538
544
|
message,
|
|
539
545
|
};
|
|
540
546
|
}
|
|
541
547
|
};
|
|
542
548
|
exports.AssociationCCRemove = AssociationCCRemove;
|
|
543
|
-
exports.AssociationCCRemove = AssociationCCRemove = __decorate([
|
|
549
|
+
exports.AssociationCCRemove = AssociationCCRemove = AssociationCCRemove_1 = __decorate([
|
|
544
550
|
(0, CommandClassDecorators_1.CCCommand)(_Types_1.AssociationCommand.Remove),
|
|
545
551
|
(0, CommandClassDecorators_1.useSupervision)()
|
|
546
552
|
], AssociationCCRemove);
|
|
547
|
-
let AssociationCCReport = class AssociationCCReport extends AssociationCC {
|
|
548
|
-
constructor(
|
|
549
|
-
super(
|
|
550
|
-
|
|
551
|
-
|
|
552
|
-
|
|
553
|
-
|
|
554
|
-
|
|
555
|
-
|
|
556
|
-
|
|
557
|
-
|
|
558
|
-
|
|
559
|
-
|
|
560
|
-
|
|
561
|
-
|
|
562
|
-
|
|
553
|
+
let AssociationCCReport = AssociationCCReport_1 = class AssociationCCReport extends AssociationCC {
|
|
554
|
+
constructor(options) {
|
|
555
|
+
super(options);
|
|
556
|
+
this.groupId = options.groupId;
|
|
557
|
+
this.maxNodes = options.maxNodes;
|
|
558
|
+
this.nodeIds = options.nodeIds;
|
|
559
|
+
this.reportsToFollow = options.reportsToFollow;
|
|
560
|
+
}
|
|
561
|
+
static from(raw, ctx) {
|
|
562
|
+
(0, safe_1.validatePayload)(raw.payload.length >= 3);
|
|
563
|
+
const groupId = raw.payload[0];
|
|
564
|
+
const maxNodes = raw.payload[1];
|
|
565
|
+
const reportsToFollow = raw.payload[2];
|
|
566
|
+
const nodeIds = [...raw.payload.subarray(3)];
|
|
567
|
+
return new AssociationCCReport_1({
|
|
568
|
+
nodeId: ctx.sourceNodeId,
|
|
569
|
+
groupId,
|
|
570
|
+
maxNodes,
|
|
571
|
+
reportsToFollow,
|
|
572
|
+
nodeIds,
|
|
573
|
+
});
|
|
563
574
|
}
|
|
564
575
|
groupId;
|
|
565
576
|
maxNodes;
|
|
@@ -572,24 +583,24 @@ let AssociationCCReport = class AssociationCCReport extends AssociationCC {
|
|
|
572
583
|
expectMoreMessages() {
|
|
573
584
|
return this.reportsToFollow > 0;
|
|
574
585
|
}
|
|
575
|
-
mergePartialCCs(
|
|
586
|
+
mergePartialCCs(partials, _ctx) {
|
|
576
587
|
// Concat the list of nodes
|
|
577
588
|
this.nodeIds = [...partials, this]
|
|
578
589
|
.map((report) => report.nodeIds)
|
|
579
590
|
.reduce((prev, cur) => prev.concat(...cur), []);
|
|
580
591
|
}
|
|
581
|
-
serialize() {
|
|
592
|
+
serialize(ctx) {
|
|
582
593
|
this.payload = Buffer.from([
|
|
583
594
|
this.groupId,
|
|
584
595
|
this.maxNodes,
|
|
585
596
|
this.reportsToFollow,
|
|
586
597
|
...this.nodeIds,
|
|
587
598
|
]);
|
|
588
|
-
return super.serialize();
|
|
599
|
+
return super.serialize(ctx);
|
|
589
600
|
}
|
|
590
|
-
toLogEntry(
|
|
601
|
+
toLogEntry(ctx) {
|
|
591
602
|
return {
|
|
592
|
-
...super.toLogEntry(
|
|
603
|
+
...super.toLogEntry(ctx),
|
|
593
604
|
message: {
|
|
594
605
|
"group id": this.groupId,
|
|
595
606
|
"max # of nodes": this.maxNodes,
|
|
@@ -606,59 +617,63 @@ __decorate([
|
|
|
606
617
|
__decorate([
|
|
607
618
|
(0, CommandClassDecorators_1.ccValue)(exports.AssociationCCValues.nodeIds, (self) => [self.groupId])
|
|
608
619
|
], AssociationCCReport.prototype, "nodeIds", void 0);
|
|
609
|
-
exports.AssociationCCReport = AssociationCCReport = __decorate([
|
|
620
|
+
exports.AssociationCCReport = AssociationCCReport = AssociationCCReport_1 = __decorate([
|
|
610
621
|
(0, CommandClassDecorators_1.CCCommand)(_Types_1.AssociationCommand.Report)
|
|
611
622
|
], AssociationCCReport);
|
|
612
|
-
let AssociationCCGet = class AssociationCCGet extends AssociationCC {
|
|
613
|
-
constructor(
|
|
614
|
-
super(
|
|
615
|
-
if (
|
|
616
|
-
(
|
|
617
|
-
this.groupId = this.payload[0];
|
|
618
|
-
}
|
|
619
|
-
else {
|
|
620
|
-
if (options.groupId < 1) {
|
|
621
|
-
throw new safe_1.ZWaveError("The group id must be positive!", safe_1.ZWaveErrorCodes.Argument_Invalid);
|
|
622
|
-
}
|
|
623
|
-
this.groupId = options.groupId;
|
|
623
|
+
let AssociationCCGet = AssociationCCGet_1 = class AssociationCCGet extends AssociationCC {
|
|
624
|
+
constructor(options) {
|
|
625
|
+
super(options);
|
|
626
|
+
if (options.groupId < 1) {
|
|
627
|
+
throw new safe_1.ZWaveError("The group id must be positive!", safe_1.ZWaveErrorCodes.Argument_Invalid);
|
|
624
628
|
}
|
|
629
|
+
this.groupId = options.groupId;
|
|
630
|
+
}
|
|
631
|
+
static from(raw, ctx) {
|
|
632
|
+
(0, safe_1.validatePayload)(raw.payload.length >= 1);
|
|
633
|
+
const groupId = raw.payload[0];
|
|
634
|
+
return new AssociationCCGet_1({
|
|
635
|
+
nodeId: ctx.sourceNodeId,
|
|
636
|
+
groupId,
|
|
637
|
+
});
|
|
625
638
|
}
|
|
626
639
|
groupId;
|
|
627
|
-
serialize() {
|
|
640
|
+
serialize(ctx) {
|
|
628
641
|
this.payload = Buffer.from([this.groupId]);
|
|
629
|
-
return super.serialize();
|
|
642
|
+
return super.serialize(ctx);
|
|
630
643
|
}
|
|
631
|
-
toLogEntry(
|
|
644
|
+
toLogEntry(ctx) {
|
|
632
645
|
return {
|
|
633
|
-
...super.toLogEntry(
|
|
646
|
+
...super.toLogEntry(ctx),
|
|
634
647
|
message: { "group id": this.groupId },
|
|
635
648
|
};
|
|
636
649
|
}
|
|
637
650
|
};
|
|
638
651
|
exports.AssociationCCGet = AssociationCCGet;
|
|
639
|
-
exports.AssociationCCGet = AssociationCCGet = __decorate([
|
|
652
|
+
exports.AssociationCCGet = AssociationCCGet = AssociationCCGet_1 = __decorate([
|
|
640
653
|
(0, CommandClassDecorators_1.CCCommand)(_Types_1.AssociationCommand.Get),
|
|
641
654
|
(0, CommandClassDecorators_1.expectedCCResponse)(AssociationCCReport)
|
|
642
655
|
], AssociationCCGet);
|
|
643
|
-
let AssociationCCSupportedGroupingsReport = class AssociationCCSupportedGroupingsReport extends AssociationCC {
|
|
644
|
-
constructor(
|
|
645
|
-
super(
|
|
646
|
-
|
|
647
|
-
|
|
648
|
-
|
|
649
|
-
|
|
650
|
-
|
|
651
|
-
|
|
652
|
-
|
|
656
|
+
let AssociationCCSupportedGroupingsReport = AssociationCCSupportedGroupingsReport_1 = class AssociationCCSupportedGroupingsReport extends AssociationCC {
|
|
657
|
+
constructor(options) {
|
|
658
|
+
super(options);
|
|
659
|
+
this.groupCount = options.groupCount;
|
|
660
|
+
}
|
|
661
|
+
static from(raw, ctx) {
|
|
662
|
+
(0, safe_1.validatePayload)(raw.payload.length >= 1);
|
|
663
|
+
const groupCount = raw.payload[0];
|
|
664
|
+
return new AssociationCCSupportedGroupingsReport_1({
|
|
665
|
+
nodeId: ctx.sourceNodeId,
|
|
666
|
+
groupCount,
|
|
667
|
+
});
|
|
653
668
|
}
|
|
654
669
|
groupCount;
|
|
655
|
-
serialize() {
|
|
670
|
+
serialize(ctx) {
|
|
656
671
|
this.payload = Buffer.from([this.groupCount]);
|
|
657
|
-
return super.serialize();
|
|
672
|
+
return super.serialize(ctx);
|
|
658
673
|
}
|
|
659
|
-
toLogEntry(
|
|
674
|
+
toLogEntry(ctx) {
|
|
660
675
|
return {
|
|
661
|
-
...super.toLogEntry(
|
|
676
|
+
...super.toLogEntry(ctx),
|
|
662
677
|
message: { "group count": this.groupCount },
|
|
663
678
|
};
|
|
664
679
|
}
|
|
@@ -667,7 +682,7 @@ exports.AssociationCCSupportedGroupingsReport = AssociationCCSupportedGroupingsR
|
|
|
667
682
|
__decorate([
|
|
668
683
|
(0, CommandClassDecorators_1.ccValue)(exports.AssociationCCValues.groupCount)
|
|
669
684
|
], AssociationCCSupportedGroupingsReport.prototype, "groupCount", void 0);
|
|
670
|
-
exports.AssociationCCSupportedGroupingsReport = AssociationCCSupportedGroupingsReport = __decorate([
|
|
685
|
+
exports.AssociationCCSupportedGroupingsReport = AssociationCCSupportedGroupingsReport = AssociationCCSupportedGroupingsReport_1 = __decorate([
|
|
671
686
|
(0, CommandClassDecorators_1.CCCommand)(_Types_1.AssociationCommand.SupportedGroupingsReport)
|
|
672
687
|
], AssociationCCSupportedGroupingsReport);
|
|
673
688
|
let AssociationCCSupportedGroupingsGet = class AssociationCCSupportedGroupingsGet extends AssociationCC {
|
|
@@ -677,31 +692,33 @@ exports.AssociationCCSupportedGroupingsGet = AssociationCCSupportedGroupingsGet
|
|
|
677
692
|
(0, CommandClassDecorators_1.CCCommand)(_Types_1.AssociationCommand.SupportedGroupingsGet),
|
|
678
693
|
(0, CommandClassDecorators_1.expectedCCResponse)(AssociationCCSupportedGroupingsReport)
|
|
679
694
|
], AssociationCCSupportedGroupingsGet);
|
|
680
|
-
let AssociationCCSpecificGroupReport = class AssociationCCSpecificGroupReport extends AssociationCC {
|
|
681
|
-
constructor(
|
|
682
|
-
super(
|
|
683
|
-
|
|
684
|
-
|
|
685
|
-
|
|
686
|
-
|
|
687
|
-
|
|
688
|
-
|
|
689
|
-
|
|
695
|
+
let AssociationCCSpecificGroupReport = AssociationCCSpecificGroupReport_1 = class AssociationCCSpecificGroupReport extends AssociationCC {
|
|
696
|
+
constructor(options) {
|
|
697
|
+
super(options);
|
|
698
|
+
this.group = options.group;
|
|
699
|
+
}
|
|
700
|
+
static from(raw, ctx) {
|
|
701
|
+
(0, safe_1.validatePayload)(raw.payload.length >= 1);
|
|
702
|
+
const group = raw.payload[0];
|
|
703
|
+
return new AssociationCCSpecificGroupReport_1({
|
|
704
|
+
nodeId: ctx.sourceNodeId,
|
|
705
|
+
group,
|
|
706
|
+
});
|
|
690
707
|
}
|
|
691
708
|
group;
|
|
692
|
-
serialize() {
|
|
709
|
+
serialize(ctx) {
|
|
693
710
|
this.payload = Buffer.from([this.group]);
|
|
694
|
-
return super.serialize();
|
|
711
|
+
return super.serialize(ctx);
|
|
695
712
|
}
|
|
696
|
-
toLogEntry(
|
|
713
|
+
toLogEntry(ctx) {
|
|
697
714
|
return {
|
|
698
|
-
...super.toLogEntry(
|
|
715
|
+
...super.toLogEntry(ctx),
|
|
699
716
|
message: { group: this.group },
|
|
700
717
|
};
|
|
701
718
|
}
|
|
702
719
|
};
|
|
703
720
|
exports.AssociationCCSpecificGroupReport = AssociationCCSpecificGroupReport;
|
|
704
|
-
exports.AssociationCCSpecificGroupReport = AssociationCCSpecificGroupReport = __decorate([
|
|
721
|
+
exports.AssociationCCSpecificGroupReport = AssociationCCSpecificGroupReport = AssociationCCSpecificGroupReport_1 = __decorate([
|
|
705
722
|
(0, CommandClassDecorators_1.CCCommand)(_Types_1.AssociationCommand.SpecificGroupReport)
|
|
706
723
|
], AssociationCCSpecificGroupReport);
|
|
707
724
|
let AssociationCCSpecificGroupGet = class AssociationCCSpecificGroupGet extends AssociationCC {
|