@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
package/build/cc/VersionCC.js
CHANGED
|
@@ -5,6 +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 VersionCCReport_1, VersionCCCommandClassReport_1, VersionCCCommandClassGet_1, VersionCCCapabilitiesReport_1, VersionCCZWaveSoftwareReport_1;
|
|
8
9
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
9
10
|
exports.VersionCCZWaveSoftwareGet = exports.VersionCCZWaveSoftwareReport = exports.VersionCCCapabilitiesGet = exports.VersionCCCapabilitiesReport = exports.VersionCCCommandClassGet = exports.VersionCCCommandClassReport = exports.VersionCCGet = exports.VersionCCReport = exports.VersionCC = exports.VersionCCAPI = exports.VersionCCValues = void 0;
|
|
10
11
|
function __assertType(argName, typeName, boundHasError) {
|
|
@@ -188,9 +189,7 @@ let VersionCCAPI = class VersionCCAPI extends API_1.PhysicalCCAPI {
|
|
|
188
189
|
case _Types_1.VersionCommand.CapabilitiesGet:
|
|
189
190
|
case _Types_1.VersionCommand.CapabilitiesReport:
|
|
190
191
|
case _Types_1.VersionCommand.ZWaveSoftwareReport:
|
|
191
|
-
|
|
192
|
-
// so `this.version` may contains a wrong value
|
|
193
|
-
return (this.applHost.getSafeCCVersion(this.ccId, this.endpoint.nodeId, this.endpoint.index) >= 3);
|
|
192
|
+
return this.version >= 3;
|
|
194
193
|
case _Types_1.VersionCommand.ZWaveSoftwareGet: {
|
|
195
194
|
return this.getValueDB().getValue(exports.VersionCCValues.supportsZWaveSoftwareGet.endpoint(this.endpoint.index));
|
|
196
195
|
}
|
|
@@ -200,11 +199,11 @@ let VersionCCAPI = class VersionCCAPI extends API_1.PhysicalCCAPI {
|
|
|
200
199
|
// eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types
|
|
201
200
|
async get() {
|
|
202
201
|
this.assertSupportsCommand(_Types_1.VersionCommand, _Types_1.VersionCommand.Get);
|
|
203
|
-
const cc = new VersionCCGet(
|
|
202
|
+
const cc = new VersionCCGet({
|
|
204
203
|
nodeId: this.endpoint.nodeId,
|
|
205
|
-
|
|
204
|
+
endpointIndex: this.endpoint.index,
|
|
206
205
|
});
|
|
207
|
-
const response = await this.
|
|
206
|
+
const response = await this.host.sendCommand(cc, this.commandOptions);
|
|
208
207
|
if (response) {
|
|
209
208
|
return (0, safe_2.pick)(response, [
|
|
210
209
|
"libraryType",
|
|
@@ -217,22 +216,22 @@ let VersionCCAPI = class VersionCCAPI extends API_1.PhysicalCCAPI {
|
|
|
217
216
|
async sendReport(options) {
|
|
218
217
|
__assertType("options", "VersionCCReportOptions", __assertType__VersionCCReportOptions.bind(void 0, options));
|
|
219
218
|
this.assertSupportsCommand(_Types_1.VersionCommand, _Types_1.VersionCommand.Report);
|
|
220
|
-
const cc = new VersionCCReport(
|
|
219
|
+
const cc = new VersionCCReport({
|
|
221
220
|
nodeId: this.endpoint.nodeId,
|
|
222
|
-
|
|
221
|
+
endpointIndex: this.endpoint.index,
|
|
223
222
|
...options,
|
|
224
223
|
});
|
|
225
|
-
await this.
|
|
224
|
+
await this.host.sendCommand(cc, this.commandOptions);
|
|
226
225
|
}
|
|
227
226
|
async getCCVersion(requestedCC) {
|
|
228
227
|
__assertType("requestedCC", "CommandClasses", __assertType__number.bind(void 0, requestedCC));
|
|
229
228
|
this.assertSupportsCommand(_Types_1.VersionCommand, _Types_1.VersionCommand.CommandClassGet);
|
|
230
|
-
const cc = new VersionCCCommandClassGet(
|
|
229
|
+
const cc = new VersionCCCommandClassGet({
|
|
231
230
|
nodeId: this.endpoint.nodeId,
|
|
232
|
-
|
|
231
|
+
endpointIndex: this.endpoint.index,
|
|
233
232
|
requestedCC,
|
|
234
233
|
});
|
|
235
|
-
const response = await this.
|
|
234
|
+
const response = await this.host.sendCommand(cc, this.commandOptions);
|
|
236
235
|
return response?.ccVersion;
|
|
237
236
|
}
|
|
238
237
|
async reportCCVersion(requestedCC) {
|
|
@@ -256,44 +255,44 @@ let VersionCCAPI = class VersionCCAPI extends API_1.PhysicalCCAPI {
|
|
|
256
255
|
ccVersion = (0, CommandClassDecorators_1.getImplementedVersion)(requestedCC);
|
|
257
256
|
break;
|
|
258
257
|
}
|
|
259
|
-
const cc = new VersionCCCommandClassReport(
|
|
258
|
+
const cc = new VersionCCCommandClassReport({
|
|
260
259
|
nodeId: this.endpoint.nodeId,
|
|
261
|
-
|
|
260
|
+
endpointIndex: this.endpoint.index,
|
|
262
261
|
requestedCC,
|
|
263
262
|
ccVersion,
|
|
264
263
|
});
|
|
265
|
-
await this.
|
|
264
|
+
await this.host.sendCommand(cc, this.commandOptions);
|
|
266
265
|
}
|
|
267
266
|
// eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types
|
|
268
267
|
async getCapabilities() {
|
|
269
268
|
this.assertSupportsCommand(_Types_1.VersionCommand, _Types_1.VersionCommand.CapabilitiesGet);
|
|
270
|
-
const cc = new VersionCCCapabilitiesGet(
|
|
269
|
+
const cc = new VersionCCCapabilitiesGet({
|
|
271
270
|
nodeId: this.endpoint.nodeId,
|
|
272
|
-
|
|
271
|
+
endpointIndex: this.endpoint.index,
|
|
273
272
|
});
|
|
274
|
-
const response = await this.
|
|
273
|
+
const response = await this.host.sendCommand(cc, this.commandOptions);
|
|
275
274
|
if (response) {
|
|
276
275
|
return (0, safe_2.pick)(response, ["supportsZWaveSoftwareGet"]);
|
|
277
276
|
}
|
|
278
277
|
}
|
|
279
278
|
async reportCapabilities() {
|
|
280
279
|
this.assertSupportsCommand(_Types_1.VersionCommand, _Types_1.VersionCommand.CapabilitiesReport);
|
|
281
|
-
const cc = new VersionCCCapabilitiesReport(
|
|
280
|
+
const cc = new VersionCCCapabilitiesReport({
|
|
282
281
|
nodeId: this.endpoint.nodeId,
|
|
283
|
-
|
|
282
|
+
endpointIndex: this.endpoint.index,
|
|
284
283
|
// At this time, we do not support responding to Z-Wave Software Get
|
|
285
284
|
supportsZWaveSoftwareGet: false,
|
|
286
285
|
});
|
|
287
|
-
await this.
|
|
286
|
+
await this.host.sendCommand(cc, this.commandOptions);
|
|
288
287
|
}
|
|
289
288
|
// eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types
|
|
290
289
|
async getZWaveSoftware() {
|
|
291
290
|
this.assertSupportsCommand(_Types_1.VersionCommand, _Types_1.VersionCommand.ZWaveSoftwareGet);
|
|
292
|
-
const cc = new VersionCCZWaveSoftwareGet(
|
|
291
|
+
const cc = new VersionCCZWaveSoftwareGet({
|
|
293
292
|
nodeId: this.endpoint.nodeId,
|
|
294
|
-
|
|
293
|
+
endpointIndex: this.endpoint.index,
|
|
295
294
|
});
|
|
296
|
-
const response = await this.
|
|
295
|
+
const response = await this.host.sendCommand(cc, this.commandOptions);
|
|
297
296
|
if (response) {
|
|
298
297
|
return (0, safe_2.pick)(response, [
|
|
299
298
|
"sdkVersion",
|
|
@@ -318,8 +317,8 @@ let VersionCC = class VersionCC extends CommandClass_1.CommandClass {
|
|
|
318
317
|
// VersionCC must be the 2nd CC after ManufacturerSpecificCC
|
|
319
318
|
return [safe_1.CommandClasses["Manufacturer Specific"]];
|
|
320
319
|
}
|
|
321
|
-
async interview(
|
|
322
|
-
const node = this.getNode(
|
|
320
|
+
async interview(ctx) {
|
|
321
|
+
const node = this.getNode(ctx);
|
|
323
322
|
// SDS13782: In a Multi Channel device, the Version Command Class MUST be supported by the Root Device, while
|
|
324
323
|
// the Version Command Class SHOULD NOT be supported by individual End Points.
|
|
325
324
|
//
|
|
@@ -327,12 +326,12 @@ let VersionCC = class VersionCC extends CommandClass_1.CommandClass {
|
|
|
327
326
|
// Channel device. However, the Root Device MUST respond to Version requests for any Command Class
|
|
328
327
|
// implemented by the Multi Channel device; also in cases where the actual Command Class is only
|
|
329
328
|
// provided by an End Point.
|
|
330
|
-
const endpoint = this.getEndpoint(
|
|
329
|
+
const endpoint = this.getEndpoint(ctx);
|
|
331
330
|
// Use the CC API of the root device for all queries
|
|
332
|
-
const api = API_1.CCAPI.create(safe_1.CommandClasses.Version,
|
|
331
|
+
const api = API_1.CCAPI.create(safe_1.CommandClasses.Version, ctx, node).withOptions({
|
|
333
332
|
priority: safe_1.MessagePriority.NodeQuery,
|
|
334
333
|
});
|
|
335
|
-
|
|
334
|
+
ctx.logNode(node.id, {
|
|
336
335
|
endpoint: this.endpointIndex,
|
|
337
336
|
message: `Interviewing ${this.ccName}...`,
|
|
338
337
|
direction: "none",
|
|
@@ -342,10 +341,10 @@ let VersionCC = class VersionCC extends CommandClass_1.CommandClass {
|
|
|
342
341
|
// but there are Z-Wave certification tests that require us to query all CCs
|
|
343
342
|
const maxImplemented = (0, CommandClassDecorators_1.getImplementedVersion)(cc);
|
|
344
343
|
if (maxImplemented === 0) {
|
|
345
|
-
|
|
344
|
+
ctx.logNode(node.id, ` skipping query for ${safe_1.CommandClasses[cc]} (${(0, safe_2.num2hex)(cc)}) because max implemented version is ${maxImplemented}`);
|
|
346
345
|
return;
|
|
347
346
|
}
|
|
348
|
-
|
|
347
|
+
ctx.logNode(node.id, {
|
|
349
348
|
endpoint: this.endpointIndex,
|
|
350
349
|
message: ` querying the CC version for ${(0, safe_1.getCCName)(cc)}...`,
|
|
351
350
|
direction: "outbound",
|
|
@@ -391,13 +390,13 @@ let VersionCC = class VersionCC extends CommandClass_1.CommandClass {
|
|
|
391
390
|
endpoint.removeCC(cc);
|
|
392
391
|
}
|
|
393
392
|
}
|
|
394
|
-
|
|
393
|
+
ctx.logNode(node.id, {
|
|
395
394
|
endpoint: this.endpointIndex,
|
|
396
395
|
message: logMessage,
|
|
397
396
|
});
|
|
398
397
|
}
|
|
399
398
|
else {
|
|
400
|
-
|
|
399
|
+
ctx.logNode(node.id, {
|
|
401
400
|
endpoint: this.endpointIndex,
|
|
402
401
|
message: `CC version query for ${(0, safe_1.getCCName)(cc)} timed out - assuming the ${this.endpointIndex === 0 ? "node" : "endpoint"} supports version 1...`,
|
|
403
402
|
level: "warn",
|
|
@@ -410,10 +409,8 @@ let VersionCC = class VersionCC extends CommandClass_1.CommandClass {
|
|
|
410
409
|
if (this.endpointIndex === 0) {
|
|
411
410
|
// Step 1: Query Version CC version
|
|
412
411
|
await queryCCVersion(safe_1.CommandClasses.Version);
|
|
413
|
-
// The CC instance was created before the versions were determined, so `this.version` contains a wrong value
|
|
414
|
-
this.version = applHost.getSafeCCVersion(safe_1.CommandClasses.Version, node.id, this.endpointIndex);
|
|
415
412
|
// Step 2: Query node versions
|
|
416
|
-
|
|
413
|
+
ctx.logNode(node.id, {
|
|
417
414
|
endpoint: this.endpointIndex,
|
|
418
415
|
message: "querying node versions...",
|
|
419
416
|
direction: "outbound",
|
|
@@ -428,7 +425,7 @@ let VersionCC = class VersionCC extends CommandClass_1.CommandClass {
|
|
|
428
425
|
logMessage +=
|
|
429
426
|
`\n hardware version: ${versionGetResponse.hardwareVersion}`;
|
|
430
427
|
}
|
|
431
|
-
|
|
428
|
+
ctx.logNode(node.id, {
|
|
432
429
|
endpoint: this.endpointIndex,
|
|
433
430
|
message: logMessage,
|
|
434
431
|
direction: "inbound",
|
|
@@ -436,7 +433,7 @@ let VersionCC = class VersionCC extends CommandClass_1.CommandClass {
|
|
|
436
433
|
}
|
|
437
434
|
}
|
|
438
435
|
// Step 3: Query all other CC versions
|
|
439
|
-
|
|
436
|
+
ctx.logNode(node.id, {
|
|
440
437
|
endpoint: this.endpointIndex,
|
|
441
438
|
message: "querying CC versions...",
|
|
442
439
|
direction: "outbound",
|
|
@@ -462,9 +459,9 @@ let VersionCC = class VersionCC extends CommandClass_1.CommandClass {
|
|
|
462
459
|
await queryCCVersion(cc);
|
|
463
460
|
}
|
|
464
461
|
// Step 4: Query VersionCC capabilities (root device only)
|
|
465
|
-
if (this.endpointIndex === 0 &&
|
|
462
|
+
if (this.endpointIndex === 0 && api.version >= 3) {
|
|
466
463
|
// Step 4a: Support for SoftwareGet
|
|
467
|
-
|
|
464
|
+
ctx.logNode(node.id, {
|
|
468
465
|
endpoint: this.endpointIndex,
|
|
469
466
|
message: "querying if Z-Wave Software Get is supported...",
|
|
470
467
|
direction: "outbound",
|
|
@@ -472,20 +469,20 @@ let VersionCC = class VersionCC extends CommandClass_1.CommandClass {
|
|
|
472
469
|
const capsResponse = await api.getCapabilities();
|
|
473
470
|
if (capsResponse) {
|
|
474
471
|
const { supportsZWaveSoftwareGet } = capsResponse;
|
|
475
|
-
|
|
472
|
+
ctx.logNode(node.id, {
|
|
476
473
|
endpoint: this.endpointIndex,
|
|
477
474
|
message: `Z-Wave Software Get is${supportsZWaveSoftwareGet ? "" : " not"} supported`,
|
|
478
475
|
direction: "inbound",
|
|
479
476
|
});
|
|
480
477
|
if (supportsZWaveSoftwareGet) {
|
|
481
478
|
// Step 4b: Query Z-Wave Software versions
|
|
482
|
-
|
|
479
|
+
ctx.logNode(node.id, {
|
|
483
480
|
endpoint: this.endpointIndex,
|
|
484
481
|
message: "querying Z-Wave software versions...",
|
|
485
482
|
direction: "outbound",
|
|
486
483
|
});
|
|
487
484
|
await api.getZWaveSoftware();
|
|
488
|
-
|
|
485
|
+
ctx.logNode(node.id, {
|
|
489
486
|
endpoint: this.endpointIndex,
|
|
490
487
|
message: "received Z-Wave software versions",
|
|
491
488
|
direction: "inbound",
|
|
@@ -494,7 +491,7 @@ let VersionCC = class VersionCC extends CommandClass_1.CommandClass {
|
|
|
494
491
|
}
|
|
495
492
|
}
|
|
496
493
|
// Remember that the interview is complete
|
|
497
|
-
this.setInterviewComplete(
|
|
494
|
+
this.setInterviewComplete(ctx, true);
|
|
498
495
|
}
|
|
499
496
|
};
|
|
500
497
|
exports.VersionCC = VersionCC;
|
|
@@ -503,41 +500,48 @@ exports.VersionCC = VersionCC = __decorate([
|
|
|
503
500
|
(0, CommandClassDecorators_1.implementedVersion)(3),
|
|
504
501
|
(0, CommandClassDecorators_1.ccValues)(exports.VersionCCValues)
|
|
505
502
|
], VersionCC);
|
|
506
|
-
let VersionCCReport = class VersionCCReport extends VersionCC {
|
|
507
|
-
constructor(
|
|
508
|
-
super(
|
|
509
|
-
if ((
|
|
510
|
-
|
|
511
|
-
|
|
512
|
-
|
|
513
|
-
|
|
514
|
-
|
|
515
|
-
|
|
516
|
-
|
|
517
|
-
|
|
518
|
-
|
|
519
|
-
|
|
520
|
-
|
|
521
|
-
|
|
522
|
-
|
|
523
|
-
|
|
524
|
-
|
|
525
|
-
|
|
526
|
-
|
|
527
|
-
|
|
528
|
-
|
|
503
|
+
let VersionCCReport = VersionCCReport_1 = class VersionCCReport extends VersionCC {
|
|
504
|
+
constructor(options) {
|
|
505
|
+
super(options);
|
|
506
|
+
if (!/^\d+\.\d+(\.\d+)?$/.test(options.protocolVersion)) {
|
|
507
|
+
throw new safe_1.ZWaveError(`protocolVersion must be a string in the format "major.minor" or "major.minor.patch", received "${options.protocolVersion}"`, safe_1.ZWaveErrorCodes.Argument_Invalid);
|
|
508
|
+
}
|
|
509
|
+
else if (!options.firmwareVersions.every((fw) => /^\d+\.\d+(\.\d+)?$/.test(fw))) {
|
|
510
|
+
throw new safe_1.ZWaveError(`firmwareVersions must be an array of strings in the format "major.minor" or "major.minor.patch", received "${JSON.stringify(options.firmwareVersions)}"`, safe_1.ZWaveErrorCodes.Argument_Invalid);
|
|
511
|
+
}
|
|
512
|
+
this.libraryType = options.libraryType;
|
|
513
|
+
this.protocolVersion = options.protocolVersion;
|
|
514
|
+
this.firmwareVersions = options.firmwareVersions;
|
|
515
|
+
this.hardwareVersion = options.hardwareVersion;
|
|
516
|
+
}
|
|
517
|
+
static from(raw, ctx) {
|
|
518
|
+
(0, safe_1.validatePayload)(raw.payload.length >= 5);
|
|
519
|
+
const libraryType = raw.payload[0];
|
|
520
|
+
const protocolVersion = `${raw.payload[1]}.${raw.payload[2]}`;
|
|
521
|
+
const firmwareVersions = [`${raw.payload[3]}.${raw.payload[4]}`];
|
|
522
|
+
let hardwareVersion;
|
|
523
|
+
if (raw.payload.length >= 7) {
|
|
524
|
+
// V2+
|
|
525
|
+
hardwareVersion = raw.payload[5];
|
|
526
|
+
const additionalFirmwares = raw.payload[6];
|
|
527
|
+
(0, safe_1.validatePayload)(raw.payload.length >= 7 + 2 * additionalFirmwares);
|
|
528
|
+
for (let i = 0; i < additionalFirmwares; i++) {
|
|
529
|
+
firmwareVersions.push(`${raw.payload[7 + 2 * i]}.${raw.payload[7 + 2 * i + 1]}`);
|
|
529
530
|
}
|
|
530
|
-
this.libraryType = options.libraryType;
|
|
531
|
-
this.protocolVersion = options.protocolVersion;
|
|
532
|
-
this.firmwareVersions = options.firmwareVersions;
|
|
533
|
-
this.hardwareVersion = options.hardwareVersion;
|
|
534
531
|
}
|
|
532
|
+
return new VersionCCReport_1({
|
|
533
|
+
nodeId: ctx.sourceNodeId,
|
|
534
|
+
libraryType,
|
|
535
|
+
protocolVersion,
|
|
536
|
+
firmwareVersions,
|
|
537
|
+
hardwareVersion,
|
|
538
|
+
});
|
|
535
539
|
}
|
|
536
540
|
libraryType;
|
|
537
541
|
protocolVersion;
|
|
538
542
|
firmwareVersions;
|
|
539
543
|
hardwareVersion;
|
|
540
|
-
serialize() {
|
|
544
|
+
serialize(ctx) {
|
|
541
545
|
this.payload = Buffer.from([
|
|
542
546
|
this.libraryType,
|
|
543
547
|
...this.protocolVersion
|
|
@@ -562,9 +566,9 @@ let VersionCCReport = class VersionCCReport extends VersionCC {
|
|
|
562
566
|
}
|
|
563
567
|
this.payload = Buffer.concat([this.payload, firmwaresBuffer]);
|
|
564
568
|
}
|
|
565
|
-
return super.serialize();
|
|
569
|
+
return super.serialize(ctx);
|
|
566
570
|
}
|
|
567
|
-
toLogEntry(
|
|
571
|
+
toLogEntry(ctx) {
|
|
568
572
|
const message = {
|
|
569
573
|
"library type": (0, safe_2.getEnumMemberName)(safe_1.ZWaveLibraryTypes, this.libraryType),
|
|
570
574
|
"protocol version": this.protocolVersion,
|
|
@@ -574,7 +578,7 @@ let VersionCCReport = class VersionCCReport extends VersionCC {
|
|
|
574
578
|
message["hardware version"] = this.hardwareVersion;
|
|
575
579
|
}
|
|
576
580
|
return {
|
|
577
|
-
...super.toLogEntry(
|
|
581
|
+
...super.toLogEntry(ctx),
|
|
578
582
|
message,
|
|
579
583
|
};
|
|
580
584
|
}
|
|
@@ -592,7 +596,7 @@ __decorate([
|
|
|
592
596
|
__decorate([
|
|
593
597
|
(0, CommandClassDecorators_1.ccValue)(exports.VersionCCValues.hardwareVersion)
|
|
594
598
|
], VersionCCReport.prototype, "hardwareVersion", void 0);
|
|
595
|
-
exports.VersionCCReport = VersionCCReport = __decorate([
|
|
599
|
+
exports.VersionCCReport = VersionCCReport = VersionCCReport_1 = __decorate([
|
|
596
600
|
(0, CommandClassDecorators_1.CCCommand)(_Types_1.VersionCommand.Report)
|
|
597
601
|
], VersionCCReport);
|
|
598
602
|
let VersionCCGet = class VersionCCGet extends VersionCC {
|
|
@@ -602,28 +606,31 @@ exports.VersionCCGet = VersionCCGet = __decorate([
|
|
|
602
606
|
(0, CommandClassDecorators_1.CCCommand)(_Types_1.VersionCommand.Get),
|
|
603
607
|
(0, CommandClassDecorators_1.expectedCCResponse)(VersionCCReport)
|
|
604
608
|
], VersionCCGet);
|
|
605
|
-
let VersionCCCommandClassReport = class VersionCCCommandClassReport extends VersionCC {
|
|
606
|
-
constructor(
|
|
607
|
-
super(
|
|
608
|
-
|
|
609
|
-
|
|
610
|
-
|
|
611
|
-
|
|
612
|
-
|
|
613
|
-
|
|
614
|
-
|
|
615
|
-
|
|
616
|
-
|
|
609
|
+
let VersionCCCommandClassReport = VersionCCCommandClassReport_1 = class VersionCCCommandClassReport extends VersionCC {
|
|
610
|
+
constructor(options) {
|
|
611
|
+
super(options);
|
|
612
|
+
this.requestedCC = options.requestedCC;
|
|
613
|
+
this.ccVersion = options.ccVersion;
|
|
614
|
+
}
|
|
615
|
+
static from(raw, ctx) {
|
|
616
|
+
(0, safe_1.validatePayload)(raw.payload.length >= 2);
|
|
617
|
+
const requestedCC = raw.payload[0];
|
|
618
|
+
const ccVersion = raw.payload[1];
|
|
619
|
+
return new VersionCCCommandClassReport_1({
|
|
620
|
+
nodeId: ctx.sourceNodeId,
|
|
621
|
+
requestedCC,
|
|
622
|
+
ccVersion,
|
|
623
|
+
});
|
|
617
624
|
}
|
|
618
625
|
ccVersion;
|
|
619
626
|
requestedCC;
|
|
620
|
-
serialize() {
|
|
627
|
+
serialize(ctx) {
|
|
621
628
|
this.payload = Buffer.from([this.requestedCC, this.ccVersion]);
|
|
622
|
-
return super.serialize();
|
|
629
|
+
return super.serialize(ctx);
|
|
623
630
|
}
|
|
624
|
-
toLogEntry(
|
|
631
|
+
toLogEntry(ctx) {
|
|
625
632
|
return {
|
|
626
|
-
...super.toLogEntry(
|
|
633
|
+
...super.toLogEntry(ctx),
|
|
627
634
|
message: {
|
|
628
635
|
CC: (0, safe_1.getCCName)(this.requestedCC),
|
|
629
636
|
version: this.ccVersion,
|
|
@@ -632,63 +639,67 @@ let VersionCCCommandClassReport = class VersionCCCommandClassReport extends Vers
|
|
|
632
639
|
}
|
|
633
640
|
};
|
|
634
641
|
exports.VersionCCCommandClassReport = VersionCCCommandClassReport;
|
|
635
|
-
exports.VersionCCCommandClassReport = VersionCCCommandClassReport = __decorate([
|
|
642
|
+
exports.VersionCCCommandClassReport = VersionCCCommandClassReport = VersionCCCommandClassReport_1 = __decorate([
|
|
636
643
|
(0, CommandClassDecorators_1.CCCommand)(_Types_1.VersionCommand.CommandClassReport)
|
|
637
644
|
], VersionCCCommandClassReport);
|
|
638
645
|
function testResponseForVersionCommandClassGet(sent, received) {
|
|
639
646
|
// We expect a Version CommandClass Report that matches the requested CC
|
|
640
647
|
return sent.requestedCC === received.requestedCC;
|
|
641
648
|
}
|
|
642
|
-
let VersionCCCommandClassGet = class VersionCCCommandClassGet extends VersionCC {
|
|
643
|
-
constructor(
|
|
644
|
-
super(
|
|
645
|
-
|
|
646
|
-
|
|
647
|
-
|
|
648
|
-
|
|
649
|
-
|
|
650
|
-
|
|
651
|
-
|
|
649
|
+
let VersionCCCommandClassGet = VersionCCCommandClassGet_1 = class VersionCCCommandClassGet extends VersionCC {
|
|
650
|
+
constructor(options) {
|
|
651
|
+
super(options);
|
|
652
|
+
this.requestedCC = options.requestedCC;
|
|
653
|
+
}
|
|
654
|
+
static from(raw, ctx) {
|
|
655
|
+
(0, safe_1.validatePayload)(raw.payload.length >= 1);
|
|
656
|
+
const requestedCC = raw.payload[0];
|
|
657
|
+
return new VersionCCCommandClassGet_1({
|
|
658
|
+
nodeId: ctx.sourceNodeId,
|
|
659
|
+
requestedCC,
|
|
660
|
+
});
|
|
652
661
|
}
|
|
653
662
|
requestedCC;
|
|
654
|
-
serialize() {
|
|
663
|
+
serialize(ctx) {
|
|
655
664
|
this.payload = Buffer.from([this.requestedCC]);
|
|
656
|
-
return super.serialize();
|
|
665
|
+
return super.serialize(ctx);
|
|
657
666
|
}
|
|
658
|
-
toLogEntry(
|
|
667
|
+
toLogEntry(ctx) {
|
|
659
668
|
return {
|
|
660
|
-
...super.toLogEntry(
|
|
669
|
+
...super.toLogEntry(ctx),
|
|
661
670
|
message: { CC: (0, safe_1.getCCName)(this.requestedCC) },
|
|
662
671
|
};
|
|
663
672
|
}
|
|
664
673
|
};
|
|
665
674
|
exports.VersionCCCommandClassGet = VersionCCCommandClassGet;
|
|
666
|
-
exports.VersionCCCommandClassGet = VersionCCCommandClassGet = __decorate([
|
|
675
|
+
exports.VersionCCCommandClassGet = VersionCCCommandClassGet = VersionCCCommandClassGet_1 = __decorate([
|
|
667
676
|
(0, CommandClassDecorators_1.CCCommand)(_Types_1.VersionCommand.CommandClassGet),
|
|
668
677
|
(0, CommandClassDecorators_1.expectedCCResponse)(VersionCCCommandClassReport, testResponseForVersionCommandClassGet)
|
|
669
678
|
], VersionCCCommandClassGet);
|
|
670
|
-
let VersionCCCapabilitiesReport = class VersionCCCapabilitiesReport extends VersionCC {
|
|
671
|
-
constructor(
|
|
672
|
-
super(
|
|
673
|
-
|
|
674
|
-
|
|
675
|
-
|
|
676
|
-
|
|
677
|
-
|
|
678
|
-
|
|
679
|
-
|
|
680
|
-
|
|
679
|
+
let VersionCCCapabilitiesReport = VersionCCCapabilitiesReport_1 = class VersionCCCapabilitiesReport extends VersionCC {
|
|
680
|
+
constructor(options) {
|
|
681
|
+
super(options);
|
|
682
|
+
this.supportsZWaveSoftwareGet = options.supportsZWaveSoftwareGet;
|
|
683
|
+
}
|
|
684
|
+
static from(raw, ctx) {
|
|
685
|
+
(0, safe_1.validatePayload)(raw.payload.length >= 1);
|
|
686
|
+
const capabilities = raw.payload[0];
|
|
687
|
+
const supportsZWaveSoftwareGet = !!(capabilities & 0b100);
|
|
688
|
+
return new VersionCCCapabilitiesReport_1({
|
|
689
|
+
nodeId: ctx.sourceNodeId,
|
|
690
|
+
supportsZWaveSoftwareGet,
|
|
691
|
+
});
|
|
681
692
|
}
|
|
682
693
|
supportsZWaveSoftwareGet;
|
|
683
|
-
serialize() {
|
|
694
|
+
serialize(ctx) {
|
|
684
695
|
this.payload = Buffer.from([
|
|
685
696
|
(this.supportsZWaveSoftwareGet ? 0b100 : 0) | 0b11,
|
|
686
697
|
]);
|
|
687
|
-
return super.serialize();
|
|
698
|
+
return super.serialize(ctx);
|
|
688
699
|
}
|
|
689
|
-
toLogEntry(
|
|
700
|
+
toLogEntry(ctx) {
|
|
690
701
|
return {
|
|
691
|
-
...super.toLogEntry(
|
|
702
|
+
...super.toLogEntry(ctx),
|
|
692
703
|
message: {
|
|
693
704
|
"supports Z-Wave Software Get command": this.supportsZWaveSoftwareGet,
|
|
694
705
|
},
|
|
@@ -699,7 +710,7 @@ exports.VersionCCCapabilitiesReport = VersionCCCapabilitiesReport;
|
|
|
699
710
|
__decorate([
|
|
700
711
|
(0, CommandClassDecorators_1.ccValue)(exports.VersionCCValues.supportsZWaveSoftwareGet)
|
|
701
712
|
], VersionCCCapabilitiesReport.prototype, "supportsZWaveSoftwareGet", void 0);
|
|
702
|
-
exports.VersionCCCapabilitiesReport = VersionCCCapabilitiesReport = __decorate([
|
|
713
|
+
exports.VersionCCCapabilitiesReport = VersionCCCapabilitiesReport = VersionCCCapabilitiesReport_1 = __decorate([
|
|
703
714
|
(0, CommandClassDecorators_1.CCCommand)(_Types_1.VersionCommand.CapabilitiesReport)
|
|
704
715
|
], VersionCCCapabilitiesReport);
|
|
705
716
|
let VersionCCCapabilitiesGet = class VersionCCCapabilitiesGet extends VersionCC {
|
|
@@ -709,39 +720,69 @@ exports.VersionCCCapabilitiesGet = VersionCCCapabilitiesGet = __decorate([
|
|
|
709
720
|
(0, CommandClassDecorators_1.CCCommand)(_Types_1.VersionCommand.CapabilitiesGet),
|
|
710
721
|
(0, CommandClassDecorators_1.expectedCCResponse)(VersionCCCapabilitiesReport)
|
|
711
722
|
], VersionCCCapabilitiesGet);
|
|
712
|
-
let VersionCCZWaveSoftwareReport = class VersionCCZWaveSoftwareReport extends VersionCC {
|
|
713
|
-
constructor(
|
|
714
|
-
super(
|
|
715
|
-
|
|
716
|
-
this.sdkVersion =
|
|
717
|
-
this.applicationFrameworkAPIVersion =
|
|
718
|
-
|
|
719
|
-
|
|
723
|
+
let VersionCCZWaveSoftwareReport = VersionCCZWaveSoftwareReport_1 = class VersionCCZWaveSoftwareReport extends VersionCC {
|
|
724
|
+
constructor(options) {
|
|
725
|
+
super(options);
|
|
726
|
+
// TODO: Check implementation:
|
|
727
|
+
this.sdkVersion = options.sdkVersion;
|
|
728
|
+
this.applicationFrameworkAPIVersion =
|
|
729
|
+
options.applicationFrameworkAPIVersion;
|
|
730
|
+
this.applicationFrameworkBuildNumber =
|
|
731
|
+
options.applicationFrameworkBuildNumber;
|
|
732
|
+
this.hostInterfaceVersion = options.hostInterfaceVersion;
|
|
733
|
+
this.hostInterfaceBuildNumber = options.hostInterfaceBuildNumber;
|
|
734
|
+
this.zWaveProtocolVersion = options.zWaveProtocolVersion;
|
|
735
|
+
this.zWaveProtocolBuildNumber = options.zWaveProtocolBuildNumber;
|
|
736
|
+
this.applicationVersion = options.applicationVersion;
|
|
737
|
+
this.applicationBuildNumber = options.applicationBuildNumber;
|
|
738
|
+
}
|
|
739
|
+
static from(raw, ctx) {
|
|
740
|
+
(0, safe_1.validatePayload)(raw.payload.length >= 23);
|
|
741
|
+
const sdkVersion = parseVersion(raw.payload);
|
|
742
|
+
const applicationFrameworkAPIVersion = parseVersion(raw.payload.subarray(3));
|
|
743
|
+
let applicationFrameworkBuildNumber;
|
|
744
|
+
if (applicationFrameworkAPIVersion !== "unused") {
|
|
745
|
+
applicationFrameworkBuildNumber = raw.payload.readUInt16BE(6);
|
|
720
746
|
}
|
|
721
747
|
else {
|
|
722
|
-
|
|
748
|
+
applicationFrameworkBuildNumber = 0;
|
|
723
749
|
}
|
|
724
|
-
|
|
725
|
-
|
|
726
|
-
|
|
750
|
+
const hostInterfaceVersion = parseVersion(raw.payload.subarray(8));
|
|
751
|
+
let hostInterfaceBuildNumber;
|
|
752
|
+
if (hostInterfaceVersion !== "unused") {
|
|
753
|
+
hostInterfaceBuildNumber = raw.payload.readUInt16BE(11);
|
|
727
754
|
}
|
|
728
755
|
else {
|
|
729
|
-
|
|
756
|
+
hostInterfaceBuildNumber = 0;
|
|
730
757
|
}
|
|
731
|
-
|
|
732
|
-
|
|
733
|
-
|
|
758
|
+
const zWaveProtocolVersion = parseVersion(raw.payload.subarray(13));
|
|
759
|
+
let zWaveProtocolBuildNumber;
|
|
760
|
+
if (zWaveProtocolVersion !== "unused") {
|
|
761
|
+
zWaveProtocolBuildNumber = raw.payload.readUInt16BE(16);
|
|
734
762
|
}
|
|
735
763
|
else {
|
|
736
|
-
|
|
764
|
+
zWaveProtocolBuildNumber = 0;
|
|
737
765
|
}
|
|
738
|
-
|
|
739
|
-
|
|
740
|
-
|
|
766
|
+
const applicationVersion = parseVersion(raw.payload.subarray(18));
|
|
767
|
+
let applicationBuildNumber;
|
|
768
|
+
if (applicationVersion !== "unused") {
|
|
769
|
+
applicationBuildNumber = raw.payload.readUInt16BE(21);
|
|
741
770
|
}
|
|
742
771
|
else {
|
|
743
|
-
|
|
744
|
-
}
|
|
772
|
+
applicationBuildNumber = 0;
|
|
773
|
+
}
|
|
774
|
+
return new VersionCCZWaveSoftwareReport_1({
|
|
775
|
+
nodeId: ctx.sourceNodeId,
|
|
776
|
+
sdkVersion,
|
|
777
|
+
applicationFrameworkAPIVersion,
|
|
778
|
+
applicationFrameworkBuildNumber,
|
|
779
|
+
hostInterfaceVersion,
|
|
780
|
+
hostInterfaceBuildNumber,
|
|
781
|
+
zWaveProtocolVersion,
|
|
782
|
+
zWaveProtocolBuildNumber,
|
|
783
|
+
applicationVersion,
|
|
784
|
+
applicationBuildNumber,
|
|
785
|
+
});
|
|
745
786
|
}
|
|
746
787
|
sdkVersion;
|
|
747
788
|
applicationFrameworkAPIVersion;
|
|
@@ -752,7 +793,7 @@ let VersionCCZWaveSoftwareReport = class VersionCCZWaveSoftwareReport extends Ve
|
|
|
752
793
|
zWaveProtocolBuildNumber;
|
|
753
794
|
applicationVersion;
|
|
754
795
|
applicationBuildNumber;
|
|
755
|
-
toLogEntry(
|
|
796
|
+
toLogEntry(ctx) {
|
|
756
797
|
const message = {
|
|
757
798
|
"SDK version": this.sdkVersion,
|
|
758
799
|
};
|
|
@@ -777,7 +818,7 @@ let VersionCCZWaveSoftwareReport = class VersionCCZWaveSoftwareReport extends Ve
|
|
|
777
818
|
message["application build number"] = this.applicationBuildNumber;
|
|
778
819
|
}
|
|
779
820
|
return {
|
|
780
|
-
...super.toLogEntry(
|
|
821
|
+
...super.toLogEntry(ctx),
|
|
781
822
|
message,
|
|
782
823
|
};
|
|
783
824
|
}
|
|
@@ -810,7 +851,7 @@ __decorate([
|
|
|
810
851
|
__decorate([
|
|
811
852
|
(0, CommandClassDecorators_1.ccValue)(exports.VersionCCValues.applicationBuildNumber)
|
|
812
853
|
], VersionCCZWaveSoftwareReport.prototype, "applicationBuildNumber", void 0);
|
|
813
|
-
exports.VersionCCZWaveSoftwareReport = VersionCCZWaveSoftwareReport = __decorate([
|
|
854
|
+
exports.VersionCCZWaveSoftwareReport = VersionCCZWaveSoftwareReport = VersionCCZWaveSoftwareReport_1 = __decorate([
|
|
814
855
|
(0, CommandClassDecorators_1.CCCommand)(_Types_1.VersionCommand.ZWaveSoftwareReport)
|
|
815
856
|
], VersionCCZWaveSoftwareReport);
|
|
816
857
|
let VersionCCZWaveSoftwareGet = class VersionCCZWaveSoftwareGet extends VersionCC {
|