@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
|
@@ -5,7 +5,7 @@ var __decorate = (this && this.__decorate) || function (decorators, target, key,
|
|
|
5
5
|
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
6
6
|
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
7
7
|
};
|
|
8
|
-
var AssociationGroupInfoCC_1;
|
|
8
|
+
var AssociationGroupInfoCC_1, AssociationGroupInfoCCNameReport_1, AssociationGroupInfoCCNameGet_1, AssociationGroupInfoCCInfoReport_1, AssociationGroupInfoCCInfoGet_1, AssociationGroupInfoCCCommandListReport_1, AssociationGroupInfoCCCommandListGet_1;
|
|
9
9
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
10
10
|
exports.AssociationGroupInfoCCCommandListGet = exports.AssociationGroupInfoCCCommandListReport = exports.AssociationGroupInfoCCInfoGet = exports.AssociationGroupInfoCCInfoReport = exports.AssociationGroupInfoCCNameGet = exports.AssociationGroupInfoCCNameReport = exports.AssociationGroupInfoCC = exports.AssociationGroupInfoCCAPI = exports.AssociationGroupInfoCCValues = void 0;
|
|
11
11
|
function __assertType(argName, typeName, boundHasError) {
|
|
@@ -40,7 +40,7 @@ const __assertType__optional_boolean = $o => {
|
|
|
40
40
|
}
|
|
41
41
|
return optional__boolean($o);
|
|
42
42
|
};
|
|
43
|
-
const
|
|
43
|
+
const __assertType__AssociationGroupInfoCCInfoReportOptions = $o => {
|
|
44
44
|
function _boolean($o) {
|
|
45
45
|
return typeof $o !== "boolean" ? {} : null;
|
|
46
46
|
}
|
|
@@ -220,12 +220,12 @@ let AssociationGroupInfoCCAPI = class AssociationGroupInfoCCAPI extends API_1.Ph
|
|
|
220
220
|
async getGroupName(groupId) {
|
|
221
221
|
__assertType("groupId", "number", __assertType__number.bind(void 0, groupId));
|
|
222
222
|
this.assertSupportsCommand(_Types_1.AssociationGroupInfoCommand, _Types_1.AssociationGroupInfoCommand.NameGet);
|
|
223
|
-
const cc = new AssociationGroupInfoCCNameGet(
|
|
223
|
+
const cc = new AssociationGroupInfoCCNameGet({
|
|
224
224
|
nodeId: this.endpoint.nodeId,
|
|
225
|
-
|
|
225
|
+
endpointIndex: this.endpoint.index,
|
|
226
226
|
groupId,
|
|
227
227
|
});
|
|
228
|
-
const response = await this.
|
|
228
|
+
const response = await this.host.sendCommand(cc, this.commandOptions);
|
|
229
229
|
if (response)
|
|
230
230
|
return response.name;
|
|
231
231
|
}
|
|
@@ -233,25 +233,25 @@ let AssociationGroupInfoCCAPI = class AssociationGroupInfoCCAPI extends API_1.Ph
|
|
|
233
233
|
__assertType("groupId", "number", __assertType__number.bind(void 0, groupId));
|
|
234
234
|
__assertType("name", "string", __assertType__string.bind(void 0, name));
|
|
235
235
|
this.assertSupportsCommand(_Types_1.AssociationGroupInfoCommand, _Types_1.AssociationGroupInfoCommand.NameReport);
|
|
236
|
-
const cc = new AssociationGroupInfoCCNameReport(
|
|
236
|
+
const cc = new AssociationGroupInfoCCNameReport({
|
|
237
237
|
nodeId: this.endpoint.nodeId,
|
|
238
|
-
|
|
238
|
+
endpointIndex: this.endpoint.index,
|
|
239
239
|
groupId,
|
|
240
240
|
name,
|
|
241
241
|
});
|
|
242
|
-
await this.
|
|
242
|
+
await this.host.sendCommand(cc, this.commandOptions);
|
|
243
243
|
}
|
|
244
244
|
async getGroupInfo(groupId, refreshCache = false) {
|
|
245
245
|
__assertType("groupId", "number", __assertType__number.bind(void 0, groupId));
|
|
246
246
|
__assertType("refreshCache", "(optional) boolean", __assertType__optional_boolean.bind(void 0, refreshCache));
|
|
247
247
|
this.assertSupportsCommand(_Types_1.AssociationGroupInfoCommand, _Types_1.AssociationGroupInfoCommand.InfoGet);
|
|
248
|
-
const cc = new AssociationGroupInfoCCInfoGet(
|
|
248
|
+
const cc = new AssociationGroupInfoCCInfoGet({
|
|
249
249
|
nodeId: this.endpoint.nodeId,
|
|
250
|
-
|
|
250
|
+
endpointIndex: this.endpoint.index,
|
|
251
251
|
groupId,
|
|
252
252
|
refreshCache,
|
|
253
253
|
});
|
|
254
|
-
const response = await this.
|
|
254
|
+
const response = await this.host.sendCommand(cc, this.commandOptions);
|
|
255
255
|
// SDS13782 says: If List Mode is set to 0, the Group Count field MUST be set to 1.
|
|
256
256
|
// But that's not always the case. Apparently some endpoints return 0 groups
|
|
257
257
|
// although they support AGI CC
|
|
@@ -264,26 +264,26 @@ let AssociationGroupInfoCCAPI = class AssociationGroupInfoCCAPI extends API_1.Ph
|
|
|
264
264
|
}
|
|
265
265
|
}
|
|
266
266
|
async reportGroupInfo(options) {
|
|
267
|
-
__assertType("options", "
|
|
267
|
+
__assertType("options", "AssociationGroupInfoCCInfoReportOptions", __assertType__AssociationGroupInfoCCInfoReportOptions.bind(void 0, options));
|
|
268
268
|
this.assertSupportsCommand(_Types_1.AssociationGroupInfoCommand, _Types_1.AssociationGroupInfoCommand.InfoReport);
|
|
269
|
-
const cc = new AssociationGroupInfoCCInfoReport(
|
|
269
|
+
const cc = new AssociationGroupInfoCCInfoReport({
|
|
270
270
|
nodeId: this.endpoint.nodeId,
|
|
271
|
-
|
|
271
|
+
endpointIndex: this.endpoint.index,
|
|
272
272
|
...options,
|
|
273
273
|
});
|
|
274
|
-
await this.
|
|
274
|
+
await this.host.sendCommand(cc, this.commandOptions);
|
|
275
275
|
}
|
|
276
276
|
async getCommands(groupId, allowCache = true) {
|
|
277
277
|
__assertType("groupId", "number", __assertType__number.bind(void 0, groupId));
|
|
278
278
|
__assertType("allowCache", "(optional) boolean", __assertType__optional_boolean.bind(void 0, allowCache));
|
|
279
279
|
this.assertSupportsCommand(_Types_1.AssociationGroupInfoCommand, _Types_1.AssociationGroupInfoCommand.CommandListGet);
|
|
280
|
-
const cc = new AssociationGroupInfoCCCommandListGet(
|
|
280
|
+
const cc = new AssociationGroupInfoCCCommandListGet({
|
|
281
281
|
nodeId: this.endpoint.nodeId,
|
|
282
|
-
|
|
282
|
+
endpointIndex: this.endpoint.index,
|
|
283
283
|
groupId,
|
|
284
284
|
allowCache,
|
|
285
285
|
});
|
|
286
|
-
const response = await this.
|
|
286
|
+
const response = await this.host.sendCommand(cc, this.commandOptions);
|
|
287
287
|
if (response)
|
|
288
288
|
return response.commands;
|
|
289
289
|
}
|
|
@@ -291,13 +291,13 @@ let AssociationGroupInfoCCAPI = class AssociationGroupInfoCCAPI extends API_1.Ph
|
|
|
291
291
|
__assertType("groupId", "number", __assertType__number.bind(void 0, groupId));
|
|
292
292
|
__assertType("commands", undefined, __assertType___0_1_2.bind(void 0, commands));
|
|
293
293
|
this.assertSupportsCommand(_Types_1.AssociationGroupInfoCommand, _Types_1.AssociationGroupInfoCommand.CommandListReport);
|
|
294
|
-
const cc = new AssociationGroupInfoCCCommandListReport(
|
|
294
|
+
const cc = new AssociationGroupInfoCCCommandListReport({
|
|
295
295
|
nodeId: this.endpoint.nodeId,
|
|
296
|
-
|
|
296
|
+
endpointIndex: this.endpoint.index,
|
|
297
297
|
groupId,
|
|
298
298
|
commands,
|
|
299
299
|
});
|
|
300
|
-
await this.
|
|
300
|
+
await this.host.sendCommand(cc, this.commandOptions);
|
|
301
301
|
}
|
|
302
302
|
};
|
|
303
303
|
exports.AssociationGroupInfoCCAPI = AssociationGroupInfoCCAPI;
|
|
@@ -314,28 +314,28 @@ let AssociationGroupInfoCC = AssociationGroupInfoCC_1 = class AssociationGroupIn
|
|
|
314
314
|
];
|
|
315
315
|
}
|
|
316
316
|
/** Returns the name of an association group */
|
|
317
|
-
static getGroupNameCached(
|
|
318
|
-
return
|
|
317
|
+
static getGroupNameCached(ctx, endpoint, groupId) {
|
|
318
|
+
return ctx
|
|
319
319
|
.getValueDB(endpoint.nodeId)
|
|
320
320
|
.getValue(exports.AssociationGroupInfoCCValues.groupName(groupId).endpoint(endpoint.index));
|
|
321
321
|
}
|
|
322
322
|
/** Returns the association profile for an association group */
|
|
323
|
-
static getGroupProfileCached(
|
|
324
|
-
return
|
|
323
|
+
static getGroupProfileCached(ctx, endpoint, groupId) {
|
|
324
|
+
return ctx.getValueDB(endpoint.nodeId).getValue(exports.AssociationGroupInfoCCValues.groupInfo(groupId).endpoint(endpoint.index))
|
|
325
325
|
?.profile;
|
|
326
326
|
}
|
|
327
327
|
/** Returns the dictionary of all commands issued by the given association group */
|
|
328
|
-
static getIssuedCommandsCached(
|
|
329
|
-
return
|
|
328
|
+
static getIssuedCommandsCached(ctx, endpoint, groupId) {
|
|
329
|
+
return ctx
|
|
330
330
|
.getValueDB(endpoint.nodeId)
|
|
331
331
|
.getValue(exports.AssociationGroupInfoCCValues.commands(groupId).endpoint(endpoint.index));
|
|
332
332
|
}
|
|
333
|
-
static findGroupsForIssuedCommand(
|
|
333
|
+
static findGroupsForIssuedCommand(ctx, endpoint, ccId, command) {
|
|
334
334
|
const ret = [];
|
|
335
|
-
const associationGroupCount = this.getAssociationGroupCountCached(
|
|
335
|
+
const associationGroupCount = this.getAssociationGroupCountCached(ctx, endpoint);
|
|
336
336
|
for (let groupId = 1; groupId <= associationGroupCount; groupId++) {
|
|
337
337
|
// Scan the issued commands of all groups if there's a match
|
|
338
|
-
const issuedCommands = this.getIssuedCommandsCached(
|
|
338
|
+
const issuedCommands = this.getIssuedCommandsCached(ctx, endpoint, groupId);
|
|
339
339
|
if (!issuedCommands)
|
|
340
340
|
continue;
|
|
341
341
|
if (issuedCommands.has(ccId)
|
|
@@ -346,33 +346,33 @@ let AssociationGroupInfoCC = AssociationGroupInfoCC_1 = class AssociationGroupIn
|
|
|
346
346
|
}
|
|
347
347
|
return ret;
|
|
348
348
|
}
|
|
349
|
-
static getAssociationGroupCountCached(
|
|
349
|
+
static getAssociationGroupCountCached(ctx, endpoint) {
|
|
350
350
|
// The association group count is either determined by the
|
|
351
351
|
// Association CC or the Multi Channel Association CC
|
|
352
352
|
return (
|
|
353
353
|
// First query the Multi Channel Association CC
|
|
354
|
+
// And fall back to 0
|
|
354
355
|
(endpoint.supportsCC(safe_1.CommandClasses["Multi Channel Association"])
|
|
355
|
-
&& MultiChannelAssociationCC_1.MultiChannelAssociationCC.getGroupCountCached(
|
|
356
|
+
&& MultiChannelAssociationCC_1.MultiChannelAssociationCC.getGroupCountCached(ctx, endpoint))
|
|
356
357
|
// Then the Association CC
|
|
357
358
|
|| (endpoint.supportsCC(safe_1.CommandClasses.Association)
|
|
358
|
-
&& AssociationCC_1.AssociationCC.getGroupCountCached(
|
|
359
|
-
// And fall back to 0
|
|
359
|
+
&& AssociationCC_1.AssociationCC.getGroupCountCached(ctx, endpoint))
|
|
360
360
|
|| 0);
|
|
361
361
|
}
|
|
362
|
-
async interview(
|
|
363
|
-
const node = this.getNode(
|
|
364
|
-
const endpoint = this.getEndpoint(
|
|
365
|
-
const api = API_1.CCAPI.create(safe_1.CommandClasses["Association Group Information"],
|
|
366
|
-
|
|
362
|
+
async interview(ctx) {
|
|
363
|
+
const node = this.getNode(ctx);
|
|
364
|
+
const endpoint = this.getEndpoint(ctx);
|
|
365
|
+
const api = API_1.CCAPI.create(safe_1.CommandClasses["Association Group Information"], ctx, endpoint).withOptions({ priority: safe_1.MessagePriority.NodeQuery });
|
|
366
|
+
ctx.logNode(node.id, {
|
|
367
367
|
endpoint: this.endpointIndex,
|
|
368
368
|
message: `Interviewing ${this.ccName}...`,
|
|
369
369
|
direction: "none",
|
|
370
370
|
});
|
|
371
371
|
const associationGroupCount = AssociationGroupInfoCC_1
|
|
372
|
-
.getAssociationGroupCountCached(
|
|
372
|
+
.getAssociationGroupCountCached(ctx, endpoint);
|
|
373
373
|
for (let groupId = 1; groupId <= associationGroupCount; groupId++) {
|
|
374
374
|
// First get the group's name
|
|
375
|
-
|
|
375
|
+
ctx.logNode(node.id, {
|
|
376
376
|
endpoint: this.endpointIndex,
|
|
377
377
|
message: `Association group #${groupId}: Querying name...`,
|
|
378
378
|
direction: "outbound",
|
|
@@ -380,14 +380,14 @@ let AssociationGroupInfoCC = AssociationGroupInfoCC_1 = class AssociationGroupIn
|
|
|
380
380
|
const name = await api.getGroupName(groupId);
|
|
381
381
|
if (name) {
|
|
382
382
|
const logMessage = `Association group #${groupId} has name "${name}"`;
|
|
383
|
-
|
|
383
|
+
ctx.logNode(node.id, {
|
|
384
384
|
endpoint: this.endpointIndex,
|
|
385
385
|
message: logMessage,
|
|
386
386
|
direction: "inbound",
|
|
387
387
|
});
|
|
388
388
|
}
|
|
389
389
|
// Then the command list
|
|
390
|
-
|
|
390
|
+
ctx.logNode(node.id, {
|
|
391
391
|
endpoint: this.endpointIndex,
|
|
392
392
|
message: `Association group #${groupId}: Querying command list...`,
|
|
393
393
|
direction: "outbound",
|
|
@@ -396,21 +396,21 @@ let AssociationGroupInfoCC = AssociationGroupInfoCC_1 = class AssociationGroupIn
|
|
|
396
396
|
// Not sure how to log this
|
|
397
397
|
}
|
|
398
398
|
// Finally query each group for its information
|
|
399
|
-
await this.refreshValues(
|
|
399
|
+
await this.refreshValues(ctx);
|
|
400
400
|
// Remember that the interview is complete
|
|
401
|
-
this.setInterviewComplete(
|
|
401
|
+
this.setInterviewComplete(ctx, true);
|
|
402
402
|
}
|
|
403
|
-
async refreshValues(
|
|
404
|
-
const node = this.getNode(
|
|
405
|
-
const endpoint = this.getEndpoint(
|
|
406
|
-
const api = API_1.CCAPI.create(safe_1.CommandClasses["Association Group Information"],
|
|
403
|
+
async refreshValues(ctx) {
|
|
404
|
+
const node = this.getNode(ctx);
|
|
405
|
+
const endpoint = this.getEndpoint(ctx);
|
|
406
|
+
const api = API_1.CCAPI.create(safe_1.CommandClasses["Association Group Information"], ctx, endpoint).withOptions({ priority: safe_1.MessagePriority.NodeQuery });
|
|
407
407
|
// Query the information for each group (this is the only thing that could be dynamic)
|
|
408
408
|
const associationGroupCount = AssociationGroupInfoCC_1
|
|
409
|
-
.getAssociationGroupCountCached(
|
|
410
|
-
const hasDynamicInfo = this.getValue(
|
|
409
|
+
.getAssociationGroupCountCached(ctx, endpoint);
|
|
410
|
+
const hasDynamicInfo = this.getValue(ctx, exports.AssociationGroupInfoCCValues.hasDynamicInfo);
|
|
411
411
|
for (let groupId = 1; groupId <= associationGroupCount; groupId++) {
|
|
412
412
|
// Then its information
|
|
413
|
-
|
|
413
|
+
ctx.logNode(node.id, {
|
|
414
414
|
endpoint: this.endpointIndex,
|
|
415
415
|
message: `Association group #${groupId}: Querying info...`,
|
|
416
416
|
direction: "outbound",
|
|
@@ -420,7 +420,7 @@ let AssociationGroupInfoCC = AssociationGroupInfoCC_1 = class AssociationGroupIn
|
|
|
420
420
|
const logMessage = `Received info for association group #${groupId}:
|
|
421
421
|
info is dynamic: ${info.hasDynamicInfo}
|
|
422
422
|
profile: ${(0, safe_2.getEnumMemberName)(_Types_1.AssociationGroupInfoProfile, info.profile)}`;
|
|
423
|
-
|
|
423
|
+
ctx.logNode(node.id, {
|
|
424
424
|
endpoint: this.endpointIndex,
|
|
425
425
|
message: logMessage,
|
|
426
426
|
direction: "inbound",
|
|
@@ -435,42 +435,45 @@ exports.AssociationGroupInfoCC = AssociationGroupInfoCC = AssociationGroupInfoCC
|
|
|
435
435
|
(0, CommandClassDecorators_1.implementedVersion)(3),
|
|
436
436
|
(0, CommandClassDecorators_1.ccValues)(exports.AssociationGroupInfoCCValues)
|
|
437
437
|
], AssociationGroupInfoCC);
|
|
438
|
-
let AssociationGroupInfoCCNameReport = class AssociationGroupInfoCCNameReport extends AssociationGroupInfoCC {
|
|
439
|
-
constructor(
|
|
440
|
-
super(
|
|
441
|
-
|
|
442
|
-
|
|
443
|
-
|
|
444
|
-
|
|
445
|
-
|
|
446
|
-
|
|
447
|
-
|
|
448
|
-
|
|
449
|
-
|
|
450
|
-
|
|
451
|
-
|
|
452
|
-
|
|
453
|
-
|
|
438
|
+
let AssociationGroupInfoCCNameReport = AssociationGroupInfoCCNameReport_1 = class AssociationGroupInfoCCNameReport extends AssociationGroupInfoCC {
|
|
439
|
+
constructor(options) {
|
|
440
|
+
super(options);
|
|
441
|
+
this.groupId = options.groupId;
|
|
442
|
+
this.name = options.name;
|
|
443
|
+
}
|
|
444
|
+
static from(raw, ctx) {
|
|
445
|
+
(0, safe_1.validatePayload)(raw.payload.length >= 2);
|
|
446
|
+
const groupId = raw.payload[0];
|
|
447
|
+
const nameLength = raw.payload[1];
|
|
448
|
+
(0, safe_1.validatePayload)(raw.payload.length >= 2 + nameLength);
|
|
449
|
+
// The specs don't allow 0-terminated string, but some devices use them
|
|
450
|
+
// So we need to cut them off
|
|
451
|
+
const name = (0, safe_2.cpp2js)(raw.payload.subarray(2, 2 + nameLength).toString("utf8"));
|
|
452
|
+
return new AssociationGroupInfoCCNameReport_1({
|
|
453
|
+
nodeId: ctx.sourceNodeId,
|
|
454
|
+
groupId,
|
|
455
|
+
name,
|
|
456
|
+
});
|
|
454
457
|
}
|
|
455
458
|
groupId;
|
|
456
459
|
name;
|
|
457
|
-
persistValues(
|
|
458
|
-
if (!super.persistValues(
|
|
460
|
+
persistValues(ctx) {
|
|
461
|
+
if (!super.persistValues(ctx))
|
|
459
462
|
return false;
|
|
460
|
-
const valueDB = this.getValueDB(
|
|
463
|
+
const valueDB = this.getValueDB(ctx);
|
|
461
464
|
valueDB.setValue(exports.AssociationGroupInfoCCValues.groupName(this.groupId).endpoint(this.endpointIndex), this.name);
|
|
462
465
|
return true;
|
|
463
466
|
}
|
|
464
|
-
serialize() {
|
|
467
|
+
serialize(ctx) {
|
|
465
468
|
this.payload = Buffer.concat([
|
|
466
469
|
Buffer.from([this.groupId, this.name.length]),
|
|
467
470
|
Buffer.from(this.name, "utf8"),
|
|
468
471
|
]);
|
|
469
|
-
return super.serialize();
|
|
472
|
+
return super.serialize(ctx);
|
|
470
473
|
}
|
|
471
|
-
toLogEntry(
|
|
474
|
+
toLogEntry(ctx) {
|
|
472
475
|
return {
|
|
473
|
-
...super.toLogEntry(
|
|
476
|
+
...super.toLogEntry(ctx),
|
|
474
477
|
message: {
|
|
475
478
|
"group id": this.groupId,
|
|
476
479
|
name: this.name,
|
|
@@ -479,75 +482,80 @@ let AssociationGroupInfoCCNameReport = class AssociationGroupInfoCCNameReport ex
|
|
|
479
482
|
}
|
|
480
483
|
};
|
|
481
484
|
exports.AssociationGroupInfoCCNameReport = AssociationGroupInfoCCNameReport;
|
|
482
|
-
exports.AssociationGroupInfoCCNameReport = AssociationGroupInfoCCNameReport = __decorate([
|
|
485
|
+
exports.AssociationGroupInfoCCNameReport = AssociationGroupInfoCCNameReport = AssociationGroupInfoCCNameReport_1 = __decorate([
|
|
483
486
|
(0, CommandClassDecorators_1.CCCommand)(_Types_1.AssociationGroupInfoCommand.NameReport)
|
|
484
487
|
], AssociationGroupInfoCCNameReport);
|
|
485
|
-
let AssociationGroupInfoCCNameGet = class AssociationGroupInfoCCNameGet extends AssociationGroupInfoCC {
|
|
486
|
-
constructor(
|
|
487
|
-
super(
|
|
488
|
-
|
|
489
|
-
|
|
490
|
-
|
|
491
|
-
|
|
492
|
-
|
|
493
|
-
|
|
494
|
-
|
|
488
|
+
let AssociationGroupInfoCCNameGet = AssociationGroupInfoCCNameGet_1 = class AssociationGroupInfoCCNameGet extends AssociationGroupInfoCC {
|
|
489
|
+
constructor(options) {
|
|
490
|
+
super(options);
|
|
491
|
+
this.groupId = options.groupId;
|
|
492
|
+
}
|
|
493
|
+
static from(raw, ctx) {
|
|
494
|
+
(0, safe_1.validatePayload)(raw.payload.length >= 1);
|
|
495
|
+
const groupId = raw.payload[0];
|
|
496
|
+
return new AssociationGroupInfoCCNameGet_1({
|
|
497
|
+
nodeId: ctx.sourceNodeId,
|
|
498
|
+
groupId,
|
|
499
|
+
});
|
|
495
500
|
}
|
|
496
501
|
groupId;
|
|
497
|
-
serialize() {
|
|
502
|
+
serialize(ctx) {
|
|
498
503
|
this.payload = Buffer.from([this.groupId]);
|
|
499
|
-
return super.serialize();
|
|
504
|
+
return super.serialize(ctx);
|
|
500
505
|
}
|
|
501
|
-
toLogEntry(
|
|
506
|
+
toLogEntry(ctx) {
|
|
502
507
|
return {
|
|
503
|
-
...super.toLogEntry(
|
|
508
|
+
...super.toLogEntry(ctx),
|
|
504
509
|
message: { "group id": this.groupId },
|
|
505
510
|
};
|
|
506
511
|
}
|
|
507
512
|
};
|
|
508
513
|
exports.AssociationGroupInfoCCNameGet = AssociationGroupInfoCCNameGet;
|
|
509
|
-
exports.AssociationGroupInfoCCNameGet = AssociationGroupInfoCCNameGet = __decorate([
|
|
514
|
+
exports.AssociationGroupInfoCCNameGet = AssociationGroupInfoCCNameGet = AssociationGroupInfoCCNameGet_1 = __decorate([
|
|
510
515
|
(0, CommandClassDecorators_1.CCCommand)(_Types_1.AssociationGroupInfoCommand.NameGet),
|
|
511
516
|
(0, CommandClassDecorators_1.expectedCCResponse)(AssociationGroupInfoCCNameReport)
|
|
512
517
|
], AssociationGroupInfoCCNameGet);
|
|
513
|
-
let AssociationGroupInfoCCInfoReport = class AssociationGroupInfoCCInfoReport extends AssociationGroupInfoCC {
|
|
514
|
-
constructor(
|
|
515
|
-
super(
|
|
516
|
-
|
|
517
|
-
|
|
518
|
-
|
|
519
|
-
|
|
520
|
-
|
|
521
|
-
|
|
522
|
-
|
|
523
|
-
|
|
524
|
-
|
|
525
|
-
|
|
526
|
-
|
|
527
|
-
|
|
528
|
-
|
|
529
|
-
|
|
530
|
-
|
|
531
|
-
|
|
532
|
-
|
|
533
|
-
|
|
534
|
-
|
|
535
|
-
|
|
536
|
-
|
|
537
|
-
|
|
538
|
-
|
|
539
|
-
|
|
540
|
-
|
|
518
|
+
let AssociationGroupInfoCCInfoReport = AssociationGroupInfoCCInfoReport_1 = class AssociationGroupInfoCCInfoReport extends AssociationGroupInfoCC {
|
|
519
|
+
constructor(options) {
|
|
520
|
+
super(options);
|
|
521
|
+
this.isListMode = options.isListMode;
|
|
522
|
+
this.hasDynamicInfo = options.hasDynamicInfo;
|
|
523
|
+
this.groups = options.groups;
|
|
524
|
+
}
|
|
525
|
+
static from(raw, ctx) {
|
|
526
|
+
(0, safe_1.validatePayload)(raw.payload.length >= 1);
|
|
527
|
+
const isListMode = !!(raw.payload[0] & 0b1000_0000);
|
|
528
|
+
const hasDynamicInfo = !!(raw.payload[0] & 0b0100_0000);
|
|
529
|
+
const groupCount = raw.payload[0] & 0b0011_1111;
|
|
530
|
+
// each group requires 7 bytes of payload
|
|
531
|
+
(0, safe_1.validatePayload)(raw.payload.length >= 1 + groupCount * 7);
|
|
532
|
+
const groups = [];
|
|
533
|
+
for (let i = 0; i < groupCount; i++) {
|
|
534
|
+
const offset = 1 + i * 7;
|
|
535
|
+
// Parse the payload
|
|
536
|
+
const groupBytes = raw.payload.subarray(offset, offset + 7);
|
|
537
|
+
const groupId = groupBytes[0];
|
|
538
|
+
const mode = 0; // groupBytes[1];
|
|
539
|
+
const profile = groupBytes.readUInt16BE(2);
|
|
540
|
+
const eventCode = 0; // groupBytes.readUInt16BE(5);
|
|
541
|
+
groups.push({ groupId, mode, profile, eventCode });
|
|
542
|
+
}
|
|
543
|
+
return new AssociationGroupInfoCCInfoReport_1({
|
|
544
|
+
nodeId: ctx.sourceNodeId,
|
|
545
|
+
isListMode,
|
|
546
|
+
hasDynamicInfo,
|
|
547
|
+
groups,
|
|
548
|
+
});
|
|
541
549
|
}
|
|
542
550
|
isListMode;
|
|
543
551
|
hasDynamicInfo;
|
|
544
552
|
groups;
|
|
545
|
-
persistValues(
|
|
546
|
-
if (!super.persistValues(
|
|
553
|
+
persistValues(ctx) {
|
|
554
|
+
if (!super.persistValues(ctx))
|
|
547
555
|
return false;
|
|
548
556
|
for (const group of this.groups) {
|
|
549
557
|
const { groupId, mode, profile, eventCode } = group;
|
|
550
|
-
this.setValue(
|
|
558
|
+
this.setValue(ctx, exports.AssociationGroupInfoCCValues.groupInfo(groupId), {
|
|
551
559
|
mode,
|
|
552
560
|
profile,
|
|
553
561
|
eventCode,
|
|
@@ -555,7 +563,7 @@ let AssociationGroupInfoCCInfoReport = class AssociationGroupInfoCCInfoReport ex
|
|
|
555
563
|
}
|
|
556
564
|
return true;
|
|
557
565
|
}
|
|
558
|
-
serialize() {
|
|
566
|
+
serialize(ctx) {
|
|
559
567
|
this.payload = Buffer.alloc(1 + this.groups.length * 7, 0);
|
|
560
568
|
this.payload[0] = (this.isListMode ? 0b1000_0000 : 0)
|
|
561
569
|
| (this.hasDynamicInfo ? 0b0100_0000 : 0)
|
|
@@ -566,11 +574,11 @@ let AssociationGroupInfoCCInfoReport = class AssociationGroupInfoCCInfoReport ex
|
|
|
566
574
|
this.payload.writeUint16BE(this.groups[i].profile, offset + 2);
|
|
567
575
|
// The remaining bytes are zero
|
|
568
576
|
}
|
|
569
|
-
return super.serialize();
|
|
577
|
+
return super.serialize(ctx);
|
|
570
578
|
}
|
|
571
|
-
toLogEntry(
|
|
579
|
+
toLogEntry(ctx) {
|
|
572
580
|
return {
|
|
573
|
-
...super.toLogEntry(
|
|
581
|
+
...super.toLogEntry(ctx),
|
|
574
582
|
message: {
|
|
575
583
|
"is list mode": this.isListMode,
|
|
576
584
|
"has dynamic info": this.hasDynamicInfo,
|
|
@@ -589,33 +597,38 @@ exports.AssociationGroupInfoCCInfoReport = AssociationGroupInfoCCInfoReport;
|
|
|
589
597
|
__decorate([
|
|
590
598
|
(0, CommandClassDecorators_1.ccValue)(exports.AssociationGroupInfoCCValues.hasDynamicInfo)
|
|
591
599
|
], AssociationGroupInfoCCInfoReport.prototype, "hasDynamicInfo", void 0);
|
|
592
|
-
exports.AssociationGroupInfoCCInfoReport = AssociationGroupInfoCCInfoReport = __decorate([
|
|
600
|
+
exports.AssociationGroupInfoCCInfoReport = AssociationGroupInfoCCInfoReport = AssociationGroupInfoCCInfoReport_1 = __decorate([
|
|
593
601
|
(0, CommandClassDecorators_1.CCCommand)(_Types_1.AssociationGroupInfoCommand.InfoReport)
|
|
594
602
|
], AssociationGroupInfoCCInfoReport);
|
|
595
|
-
let AssociationGroupInfoCCInfoGet = class AssociationGroupInfoCCInfoGet extends AssociationGroupInfoCC {
|
|
596
|
-
constructor(
|
|
597
|
-
super(
|
|
598
|
-
|
|
599
|
-
|
|
600
|
-
|
|
601
|
-
|
|
602
|
-
this.
|
|
603
|
-
|
|
604
|
-
|
|
605
|
-
|
|
606
|
-
|
|
607
|
-
|
|
608
|
-
|
|
609
|
-
|
|
610
|
-
|
|
611
|
-
|
|
612
|
-
|
|
613
|
-
|
|
603
|
+
let AssociationGroupInfoCCInfoGet = AssociationGroupInfoCCInfoGet_1 = class AssociationGroupInfoCCInfoGet extends AssociationGroupInfoCC {
|
|
604
|
+
constructor(options) {
|
|
605
|
+
super(options);
|
|
606
|
+
this.refreshCache = options.refreshCache;
|
|
607
|
+
if ("listMode" in options)
|
|
608
|
+
this.listMode = options.listMode;
|
|
609
|
+
if ("groupId" in options)
|
|
610
|
+
this.groupId = options.groupId;
|
|
611
|
+
}
|
|
612
|
+
static from(raw, ctx) {
|
|
613
|
+
(0, safe_1.validatePayload)(raw.payload.length >= 2);
|
|
614
|
+
const optionByte = raw.payload[0];
|
|
615
|
+
const refreshCache = !!(optionByte & 0b1000_0000);
|
|
616
|
+
const listMode = !!(optionByte & 0b0100_0000);
|
|
617
|
+
let groupId;
|
|
618
|
+
if (!listMode) {
|
|
619
|
+
groupId = raw.payload[1];
|
|
620
|
+
}
|
|
621
|
+
return new AssociationGroupInfoCCInfoGet_1({
|
|
622
|
+
nodeId: ctx.sourceNodeId,
|
|
623
|
+
refreshCache,
|
|
624
|
+
listMode,
|
|
625
|
+
groupId,
|
|
626
|
+
});
|
|
614
627
|
}
|
|
615
628
|
refreshCache;
|
|
616
629
|
listMode;
|
|
617
630
|
groupId;
|
|
618
|
-
serialize() {
|
|
631
|
+
serialize(ctx) {
|
|
619
632
|
const isListMode = this.listMode === true;
|
|
620
633
|
const optionByte = (this.refreshCache ? 0b1000_0000 : 0)
|
|
621
634
|
| (isListMode ? 0b0100_0000 : 0);
|
|
@@ -623,9 +636,9 @@ let AssociationGroupInfoCCInfoGet = class AssociationGroupInfoCCInfoGet extends
|
|
|
623
636
|
optionByte,
|
|
624
637
|
isListMode ? 0 : this.groupId,
|
|
625
638
|
]);
|
|
626
|
-
return super.serialize();
|
|
639
|
+
return super.serialize(ctx);
|
|
627
640
|
}
|
|
628
|
-
toLogEntry(
|
|
641
|
+
toLogEntry(ctx) {
|
|
629
642
|
const message = {};
|
|
630
643
|
if (this.groupId != undefined) {
|
|
631
644
|
message["group id"] = this.groupId;
|
|
@@ -635,46 +648,48 @@ let AssociationGroupInfoCCInfoGet = class AssociationGroupInfoCCInfoGet extends
|
|
|
635
648
|
}
|
|
636
649
|
message["refresh cache"] = this.refreshCache;
|
|
637
650
|
return {
|
|
638
|
-
...super.toLogEntry(
|
|
651
|
+
...super.toLogEntry(ctx),
|
|
639
652
|
message,
|
|
640
653
|
};
|
|
641
654
|
}
|
|
642
655
|
};
|
|
643
656
|
exports.AssociationGroupInfoCCInfoGet = AssociationGroupInfoCCInfoGet;
|
|
644
|
-
exports.AssociationGroupInfoCCInfoGet = AssociationGroupInfoCCInfoGet = __decorate([
|
|
657
|
+
exports.AssociationGroupInfoCCInfoGet = AssociationGroupInfoCCInfoGet = AssociationGroupInfoCCInfoGet_1 = __decorate([
|
|
645
658
|
(0, CommandClassDecorators_1.CCCommand)(_Types_1.AssociationGroupInfoCommand.InfoGet),
|
|
646
659
|
(0, CommandClassDecorators_1.expectedCCResponse)(AssociationGroupInfoCCInfoReport)
|
|
647
660
|
], AssociationGroupInfoCCInfoGet);
|
|
648
|
-
let AssociationGroupInfoCCCommandListReport = class AssociationGroupInfoCCCommandListReport extends AssociationGroupInfoCC {
|
|
649
|
-
constructor(
|
|
650
|
-
super(
|
|
651
|
-
|
|
652
|
-
|
|
653
|
-
|
|
654
|
-
|
|
655
|
-
|
|
656
|
-
|
|
657
|
-
|
|
658
|
-
|
|
659
|
-
|
|
660
|
-
|
|
661
|
-
|
|
662
|
-
|
|
663
|
-
|
|
664
|
-
|
|
665
|
-
|
|
666
|
-
|
|
667
|
-
|
|
668
|
-
|
|
669
|
-
|
|
670
|
-
|
|
671
|
-
|
|
672
|
-
|
|
673
|
-
|
|
661
|
+
let AssociationGroupInfoCCCommandListReport = AssociationGroupInfoCCCommandListReport_1 = class AssociationGroupInfoCCCommandListReport extends AssociationGroupInfoCC {
|
|
662
|
+
constructor(options) {
|
|
663
|
+
super(options);
|
|
664
|
+
this.groupId = options.groupId;
|
|
665
|
+
this.commands = options.commands;
|
|
666
|
+
}
|
|
667
|
+
static from(raw, ctx) {
|
|
668
|
+
(0, safe_1.validatePayload)(raw.payload.length >= 2);
|
|
669
|
+
const groupId = raw.payload[0];
|
|
670
|
+
const listLength = raw.payload[1];
|
|
671
|
+
(0, safe_1.validatePayload)(raw.payload.length >= 2 + listLength);
|
|
672
|
+
const listBytes = raw.payload.subarray(2, 2 + listLength);
|
|
673
|
+
// Parse all CC ids and commands
|
|
674
|
+
let offset = 0;
|
|
675
|
+
const commands = new Map();
|
|
676
|
+
while (offset < listLength) {
|
|
677
|
+
const { ccId, bytesRead } = (0, safe_1.parseCCId)(listBytes, offset);
|
|
678
|
+
const command = listBytes[offset + bytesRead];
|
|
679
|
+
if (!commands.has(ccId))
|
|
680
|
+
commands.set(ccId, []);
|
|
681
|
+
commands.get(ccId).push(command);
|
|
682
|
+
offset += bytesRead + 1;
|
|
683
|
+
}
|
|
684
|
+
return new AssociationGroupInfoCCCommandListReport_1({
|
|
685
|
+
nodeId: ctx.sourceNodeId,
|
|
686
|
+
groupId,
|
|
687
|
+
commands,
|
|
688
|
+
});
|
|
674
689
|
}
|
|
675
690
|
groupId;
|
|
676
691
|
commands;
|
|
677
|
-
serialize() {
|
|
692
|
+
serialize(ctx) {
|
|
678
693
|
// To make it easier to encode possible extended CCs, we first
|
|
679
694
|
// allocate as much space as we may need, then trim it again
|
|
680
695
|
this.payload = Buffer.allocUnsafe(2 + this.commands.size * 3);
|
|
@@ -688,11 +703,11 @@ let AssociationGroupInfoCCCommandListReport = class AssociationGroupInfoCCComman
|
|
|
688
703
|
}
|
|
689
704
|
}
|
|
690
705
|
this.payload[1] = offset - 2; // list length
|
|
691
|
-
return super.serialize();
|
|
706
|
+
return super.serialize(ctx);
|
|
692
707
|
}
|
|
693
|
-
toLogEntry(
|
|
708
|
+
toLogEntry(ctx) {
|
|
694
709
|
return {
|
|
695
|
-
...super.toLogEntry(
|
|
710
|
+
...super.toLogEntry(ctx),
|
|
696
711
|
message: {
|
|
697
712
|
"group id": this.groupId,
|
|
698
713
|
commands: `${[...this.commands]
|
|
@@ -710,34 +725,37 @@ exports.AssociationGroupInfoCCCommandListReport = AssociationGroupInfoCCCommandL
|
|
|
710
725
|
__decorate([
|
|
711
726
|
(0, CommandClassDecorators_1.ccValue)(exports.AssociationGroupInfoCCValues.commands, (self) => [self.groupId])
|
|
712
727
|
], AssociationGroupInfoCCCommandListReport.prototype, "commands", void 0);
|
|
713
|
-
exports.AssociationGroupInfoCCCommandListReport = AssociationGroupInfoCCCommandListReport = __decorate([
|
|
728
|
+
exports.AssociationGroupInfoCCCommandListReport = AssociationGroupInfoCCCommandListReport = AssociationGroupInfoCCCommandListReport_1 = __decorate([
|
|
714
729
|
(0, CommandClassDecorators_1.CCCommand)(_Types_1.AssociationGroupInfoCommand.CommandListReport)
|
|
715
730
|
], AssociationGroupInfoCCCommandListReport);
|
|
716
|
-
let AssociationGroupInfoCCCommandListGet = class AssociationGroupInfoCCCommandListGet extends AssociationGroupInfoCC {
|
|
717
|
-
constructor(
|
|
718
|
-
super(
|
|
719
|
-
|
|
720
|
-
|
|
721
|
-
|
|
722
|
-
|
|
723
|
-
|
|
724
|
-
|
|
725
|
-
|
|
726
|
-
|
|
727
|
-
|
|
731
|
+
let AssociationGroupInfoCCCommandListGet = AssociationGroupInfoCCCommandListGet_1 = class AssociationGroupInfoCCCommandListGet extends AssociationGroupInfoCC {
|
|
732
|
+
constructor(options) {
|
|
733
|
+
super(options);
|
|
734
|
+
this.allowCache = options.allowCache;
|
|
735
|
+
this.groupId = options.groupId;
|
|
736
|
+
}
|
|
737
|
+
static from(raw, ctx) {
|
|
738
|
+
(0, safe_1.validatePayload)(raw.payload.length >= 2);
|
|
739
|
+
const allowCache = !!(raw.payload[0] & 0b1000_0000);
|
|
740
|
+
const groupId = raw.payload[1];
|
|
741
|
+
return new AssociationGroupInfoCCCommandListGet_1({
|
|
742
|
+
nodeId: ctx.sourceNodeId,
|
|
743
|
+
allowCache,
|
|
744
|
+
groupId,
|
|
745
|
+
});
|
|
728
746
|
}
|
|
729
747
|
allowCache;
|
|
730
748
|
groupId;
|
|
731
|
-
serialize() {
|
|
749
|
+
serialize(ctx) {
|
|
732
750
|
this.payload = Buffer.from([
|
|
733
751
|
this.allowCache ? 0b1000_0000 : 0,
|
|
734
752
|
this.groupId,
|
|
735
753
|
]);
|
|
736
|
-
return super.serialize();
|
|
754
|
+
return super.serialize(ctx);
|
|
737
755
|
}
|
|
738
|
-
toLogEntry(
|
|
756
|
+
toLogEntry(ctx) {
|
|
739
757
|
return {
|
|
740
|
-
...super.toLogEntry(
|
|
758
|
+
...super.toLogEntry(ctx),
|
|
741
759
|
message: {
|
|
742
760
|
"group id": this.groupId,
|
|
743
761
|
"allow cache": this.allowCache,
|
|
@@ -746,7 +764,7 @@ let AssociationGroupInfoCCCommandListGet = class AssociationGroupInfoCCCommandLi
|
|
|
746
764
|
}
|
|
747
765
|
};
|
|
748
766
|
exports.AssociationGroupInfoCCCommandListGet = AssociationGroupInfoCCCommandListGet;
|
|
749
|
-
exports.AssociationGroupInfoCCCommandListGet = AssociationGroupInfoCCCommandListGet = __decorate([
|
|
767
|
+
exports.AssociationGroupInfoCCCommandListGet = AssociationGroupInfoCCCommandListGet = AssociationGroupInfoCCCommandListGet_1 = __decorate([
|
|
750
768
|
(0, CommandClassDecorators_1.CCCommand)(_Types_1.AssociationGroupInfoCommand.CommandListGet),
|
|
751
769
|
(0, CommandClassDecorators_1.expectedCCResponse)(AssociationGroupInfoCCCommandListReport)
|
|
752
770
|
], AssociationGroupInfoCCCommandListGet);
|