@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/DoorLockCC.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 DoorLockCCOperationReport_1, DoorLockCCConfigurationReport_1, DoorLockCCCapabilitiesReport_1;
|
|
8
9
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
9
10
|
exports.DoorLockCCCapabilitiesGet = exports.DoorLockCCCapabilitiesReport = exports.DoorLockCCConfigurationSet = exports.DoorLockCCConfigurationGet = exports.DoorLockCCConfigurationReport = exports.DoorLockCCOperationGet = exports.DoorLockCCOperationReport = exports.DoorLockCCOperationSet = exports.DoorLockCC = exports.DoorLockCCAPI = exports.DoorLockCCValues = void 0;
|
|
10
11
|
function __assertType(argName, typeName, boundHasError) {
|
|
@@ -292,44 +293,44 @@ exports.DoorLockCCValues = Object.freeze({
|
|
|
292
293
|
}),
|
|
293
294
|
}),
|
|
294
295
|
});
|
|
295
|
-
function shouldAutoCreateLatchStatusValue(
|
|
296
|
-
const valueDB =
|
|
296
|
+
function shouldAutoCreateLatchStatusValue(ctx, endpoint) {
|
|
297
|
+
const valueDB = ctx.tryGetValueDB(endpoint.nodeId);
|
|
297
298
|
if (!valueDB)
|
|
298
299
|
return false;
|
|
299
300
|
return !!valueDB.getValue(exports.DoorLockCCValues.latchSupported.endpoint(endpoint.index));
|
|
300
301
|
}
|
|
301
|
-
function shouldAutoCreateBoltStatusValue(
|
|
302
|
-
const valueDB =
|
|
302
|
+
function shouldAutoCreateBoltStatusValue(ctx, endpoint) {
|
|
303
|
+
const valueDB = ctx.tryGetValueDB(endpoint.nodeId);
|
|
303
304
|
if (!valueDB)
|
|
304
305
|
return false;
|
|
305
306
|
return !!valueDB.getValue(exports.DoorLockCCValues.boltSupported.endpoint(endpoint.index));
|
|
306
307
|
}
|
|
307
|
-
function shouldAutoCreateDoorStatusValue(
|
|
308
|
-
const valueDB =
|
|
308
|
+
function shouldAutoCreateDoorStatusValue(ctx, endpoint) {
|
|
309
|
+
const valueDB = ctx.tryGetValueDB(endpoint.nodeId);
|
|
309
310
|
if (!valueDB)
|
|
310
311
|
return false;
|
|
311
312
|
return !!valueDB.getValue(exports.DoorLockCCValues.doorSupported.endpoint(endpoint.index));
|
|
312
313
|
}
|
|
313
|
-
function shouldAutoCreateTwistAssistConfigValue(
|
|
314
|
-
const valueDB =
|
|
314
|
+
function shouldAutoCreateTwistAssistConfigValue(ctx, endpoint) {
|
|
315
|
+
const valueDB = ctx.tryGetValueDB(endpoint.nodeId);
|
|
315
316
|
if (!valueDB)
|
|
316
317
|
return false;
|
|
317
318
|
return !!valueDB.getValue(exports.DoorLockCCValues.twistAssistSupported.endpoint(endpoint.index));
|
|
318
319
|
}
|
|
319
|
-
function shouldAutoCreateBlockToBlockConfigValue(
|
|
320
|
-
const valueDB =
|
|
320
|
+
function shouldAutoCreateBlockToBlockConfigValue(ctx, endpoint) {
|
|
321
|
+
const valueDB = ctx.tryGetValueDB(endpoint.nodeId);
|
|
321
322
|
if (!valueDB)
|
|
322
323
|
return false;
|
|
323
324
|
return !!valueDB.getValue(exports.DoorLockCCValues.blockToBlockSupported.endpoint(endpoint.index));
|
|
324
325
|
}
|
|
325
|
-
function shouldAutoCreateAutoRelockConfigValue(
|
|
326
|
-
const valueDB =
|
|
326
|
+
function shouldAutoCreateAutoRelockConfigValue(ctx, endpoint) {
|
|
327
|
+
const valueDB = ctx.tryGetValueDB(endpoint.nodeId);
|
|
327
328
|
if (!valueDB)
|
|
328
329
|
return false;
|
|
329
330
|
return !!valueDB.getValue(exports.DoorLockCCValues.autoRelockSupported.endpoint(endpoint.index));
|
|
330
331
|
}
|
|
331
|
-
function shouldAutoCreateHoldAndReleaseConfigValue(
|
|
332
|
-
const valueDB =
|
|
332
|
+
function shouldAutoCreateHoldAndReleaseConfigValue(ctx, endpoint) {
|
|
333
|
+
const valueDB = ctx.tryGetValueDB(endpoint.nodeId);
|
|
333
334
|
if (!valueDB)
|
|
334
335
|
return false;
|
|
335
336
|
return !!valueDB.getValue(exports.DoorLockCCValues.holdAndReleaseSupported.endpoint(endpoint.index));
|
|
@@ -439,11 +440,11 @@ let DoorLockCCAPI = class DoorLockCCAPI extends API_1.PhysicalCCAPI {
|
|
|
439
440
|
// eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types
|
|
440
441
|
async getCapabilities() {
|
|
441
442
|
this.assertSupportsCommand(_Types_1.DoorLockCommand, _Types_1.DoorLockCommand.CapabilitiesGet);
|
|
442
|
-
const cc = new DoorLockCCCapabilitiesGet(
|
|
443
|
+
const cc = new DoorLockCCCapabilitiesGet({
|
|
443
444
|
nodeId: this.endpoint.nodeId,
|
|
444
|
-
|
|
445
|
+
endpointIndex: this.endpoint.index,
|
|
445
446
|
});
|
|
446
|
-
const response = await this.
|
|
447
|
+
const response = await this.host.sendCommand(cc, this.commandOptions);
|
|
447
448
|
if (response) {
|
|
448
449
|
return (0, safe_2.pick)(response, [
|
|
449
450
|
"autoRelockSupported",
|
|
@@ -463,11 +464,11 @@ let DoorLockCCAPI = class DoorLockCCAPI extends API_1.PhysicalCCAPI {
|
|
|
463
464
|
// eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types
|
|
464
465
|
async get() {
|
|
465
466
|
this.assertSupportsCommand(_Types_1.DoorLockCommand, _Types_1.DoorLockCommand.OperationGet);
|
|
466
|
-
const cc = new DoorLockCCOperationGet(
|
|
467
|
+
const cc = new DoorLockCCOperationGet({
|
|
467
468
|
nodeId: this.endpoint.nodeId,
|
|
468
|
-
|
|
469
|
+
endpointIndex: this.endpoint.index,
|
|
469
470
|
});
|
|
470
|
-
const response = await this.
|
|
471
|
+
const response = await this.host.sendCommand(cc, this.commandOptions);
|
|
471
472
|
if (response) {
|
|
472
473
|
return (0, safe_2.pick)(response, [
|
|
473
474
|
"currentMode",
|
|
@@ -485,31 +486,31 @@ let DoorLockCCAPI = class DoorLockCCAPI extends API_1.PhysicalCCAPI {
|
|
|
485
486
|
async set(mode) {
|
|
486
487
|
__assertType("mode", "DoorLockMode", __assertType__DoorLockMode.bind(void 0, mode));
|
|
487
488
|
this.assertSupportsCommand(_Types_1.DoorLockCommand, _Types_1.DoorLockCommand.OperationSet);
|
|
488
|
-
const cc = new DoorLockCCOperationSet(
|
|
489
|
+
const cc = new DoorLockCCOperationSet({
|
|
489
490
|
nodeId: this.endpoint.nodeId,
|
|
490
|
-
|
|
491
|
+
endpointIndex: this.endpoint.index,
|
|
491
492
|
mode,
|
|
492
493
|
});
|
|
493
|
-
return this.
|
|
494
|
+
return this.host.sendCommand(cc, this.commandOptions);
|
|
494
495
|
}
|
|
495
496
|
async setConfiguration(configuration) {
|
|
496
497
|
__assertType("configuration", "DoorLockCCConfigurationSetOptions", __assertType__DoorLockCCConfigurationSetOptions.bind(void 0, configuration));
|
|
497
498
|
this.assertSupportsCommand(_Types_1.DoorLockCommand, _Types_1.DoorLockCommand.ConfigurationSet);
|
|
498
|
-
const cc = new DoorLockCCConfigurationSet(
|
|
499
|
+
const cc = new DoorLockCCConfigurationSet({
|
|
499
500
|
nodeId: this.endpoint.nodeId,
|
|
500
|
-
|
|
501
|
+
endpointIndex: this.endpoint.index,
|
|
501
502
|
...configuration,
|
|
502
503
|
});
|
|
503
|
-
return this.
|
|
504
|
+
return this.host.sendCommand(cc, this.commandOptions);
|
|
504
505
|
}
|
|
505
506
|
// eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types
|
|
506
507
|
async getConfiguration() {
|
|
507
508
|
this.assertSupportsCommand(_Types_1.DoorLockCommand, _Types_1.DoorLockCommand.ConfigurationGet);
|
|
508
|
-
const cc = new DoorLockCCConfigurationGet(
|
|
509
|
+
const cc = new DoorLockCCConfigurationGet({
|
|
509
510
|
nodeId: this.endpoint.nodeId,
|
|
510
|
-
|
|
511
|
+
endpointIndex: this.endpoint.index,
|
|
511
512
|
});
|
|
512
|
-
const response = await this.
|
|
513
|
+
const response = await this.host.sendCommand(cc, this.commandOptions);
|
|
513
514
|
if (response) {
|
|
514
515
|
return (0, safe_2.pick)(response, [
|
|
515
516
|
"operationType",
|
|
@@ -529,13 +530,13 @@ exports.DoorLockCCAPI = DoorLockCCAPI = __decorate([
|
|
|
529
530
|
(0, CommandClassDecorators_1.API)(safe_1.CommandClasses["Door Lock"])
|
|
530
531
|
], DoorLockCCAPI);
|
|
531
532
|
let DoorLockCC = class DoorLockCC extends CommandClass_1.CommandClass {
|
|
532
|
-
async interview(
|
|
533
|
-
const node = this.getNode(
|
|
534
|
-
const endpoint = this.getEndpoint(
|
|
535
|
-
const api = API_1.CCAPI.create(safe_1.CommandClasses["Door Lock"],
|
|
533
|
+
async interview(ctx) {
|
|
534
|
+
const node = this.getNode(ctx);
|
|
535
|
+
const endpoint = this.getEndpoint(ctx);
|
|
536
|
+
const api = API_1.CCAPI.create(safe_1.CommandClasses["Door Lock"], ctx, endpoint).withOptions({
|
|
536
537
|
priority: safe_1.MessagePriority.NodeQuery,
|
|
537
538
|
});
|
|
538
|
-
|
|
539
|
+
ctx.logNode(node.id, {
|
|
539
540
|
endpoint: this.endpointIndex,
|
|
540
541
|
message: `Interviewing ${this.ccName}...`,
|
|
541
542
|
direction: "none",
|
|
@@ -547,8 +548,8 @@ let DoorLockCC = class DoorLockCC extends CommandClass_1.CommandClass {
|
|
|
547
548
|
let doorSupported = true;
|
|
548
549
|
let boltSupported = true;
|
|
549
550
|
let latchSupported = true;
|
|
550
|
-
if (
|
|
551
|
-
|
|
551
|
+
if (api.version >= 4) {
|
|
552
|
+
ctx.logNode(node.id, {
|
|
552
553
|
endpoint: this.endpointIndex,
|
|
553
554
|
message: "requesting lock capabilities...",
|
|
554
555
|
direction: "outbound",
|
|
@@ -574,7 +575,7 @@ supports auto-relock: ${resp.autoRelockSupported}
|
|
|
574
575
|
supports hold-and-release: ${resp.holdAndReleaseSupported}
|
|
575
576
|
supports twist assist: ${resp.twistAssistSupported}
|
|
576
577
|
supports block to block: ${resp.blockToBlockSupported}`;
|
|
577
|
-
|
|
578
|
+
ctx.logNode(node.id, {
|
|
578
579
|
endpoint: this.endpointIndex,
|
|
579
580
|
message: logMessage,
|
|
580
581
|
direction: "inbound",
|
|
@@ -584,12 +585,12 @@ supports block to block: ${resp.blockToBlockSupported}`;
|
|
|
584
585
|
latchSupported = resp.latchSupported;
|
|
585
586
|
// Update metadata of settable states
|
|
586
587
|
const targetModeValue = exports.DoorLockCCValues.targetMode;
|
|
587
|
-
this.setMetadata(
|
|
588
|
+
this.setMetadata(ctx, targetModeValue, {
|
|
588
589
|
...targetModeValue.meta,
|
|
589
590
|
states: (0, safe_1.enumValuesToMetadataStates)(_Types_1.DoorLockMode, resp.supportedDoorLockModes),
|
|
590
591
|
});
|
|
591
592
|
const operationTypeValue = exports.DoorLockCCValues.operationType;
|
|
592
|
-
this.setMetadata(
|
|
593
|
+
this.setMetadata(ctx, operationTypeValue, {
|
|
593
594
|
...operationTypeValue.meta,
|
|
594
595
|
states: (0, safe_1.enumValuesToMetadataStates)(_Types_1.DoorLockOperationType, resp.supportedOperationTypes),
|
|
595
596
|
});
|
|
@@ -602,29 +603,29 @@ supports block to block: ${resp.blockToBlockSupported}`;
|
|
|
602
603
|
// Save support information for the status values
|
|
603
604
|
const doorStatusValue = exports.DoorLockCCValues.doorStatus;
|
|
604
605
|
if (doorSupported)
|
|
605
|
-
this.setMetadata(
|
|
606
|
-
this.setValue(
|
|
606
|
+
this.setMetadata(ctx, doorStatusValue);
|
|
607
|
+
this.setValue(ctx, exports.DoorLockCCValues.doorSupported, doorSupported);
|
|
607
608
|
const latchStatusValue = exports.DoorLockCCValues.latchStatus;
|
|
608
609
|
if (latchSupported)
|
|
609
|
-
this.setMetadata(
|
|
610
|
-
this.setValue(
|
|
610
|
+
this.setMetadata(ctx, latchStatusValue);
|
|
611
|
+
this.setValue(ctx, exports.DoorLockCCValues.latchSupported, latchSupported);
|
|
611
612
|
const boltStatusValue = exports.DoorLockCCValues.boltStatus;
|
|
612
613
|
if (boltSupported)
|
|
613
|
-
this.setMetadata(
|
|
614
|
-
this.setValue(
|
|
614
|
+
this.setMetadata(ctx, boltStatusValue);
|
|
615
|
+
this.setValue(ctx, exports.DoorLockCCValues.boltSupported, boltSupported);
|
|
615
616
|
}
|
|
616
|
-
await this.refreshValues(
|
|
617
|
+
await this.refreshValues(ctx);
|
|
617
618
|
// Remember that the interview is complete
|
|
618
619
|
if (!hadCriticalTimeout)
|
|
619
|
-
this.setInterviewComplete(
|
|
620
|
+
this.setInterviewComplete(ctx, true);
|
|
620
621
|
}
|
|
621
|
-
async refreshValues(
|
|
622
|
-
const node = this.getNode(
|
|
623
|
-
const endpoint = this.getEndpoint(
|
|
624
|
-
const api = API_1.CCAPI.create(safe_1.CommandClasses["Door Lock"],
|
|
622
|
+
async refreshValues(ctx) {
|
|
623
|
+
const node = this.getNode(ctx);
|
|
624
|
+
const endpoint = this.getEndpoint(ctx);
|
|
625
|
+
const api = API_1.CCAPI.create(safe_1.CommandClasses["Door Lock"], ctx, endpoint).withOptions({
|
|
625
626
|
priority: safe_1.MessagePriority.NodeQuery,
|
|
626
627
|
});
|
|
627
|
-
|
|
628
|
+
ctx.logNode(node.id, {
|
|
628
629
|
endpoint: this.endpointIndex,
|
|
629
630
|
message: "requesting lock configuration...",
|
|
630
631
|
direction: "outbound",
|
|
@@ -645,20 +646,20 @@ outside handles can open door: ${config.outsideHandlesCanOpenDoorConfiguration
|
|
|
645
646
|
inside handles can open door: ${config.insideHandlesCanOpenDoorConfiguration
|
|
646
647
|
.map(String)
|
|
647
648
|
.join(", ")}`;
|
|
648
|
-
if (
|
|
649
|
+
if (api.version >= 4) {
|
|
649
650
|
logMessage += `
|
|
650
651
|
auto-relock time ${config.autoRelockTime ?? "-"} seconds
|
|
651
652
|
hold-and-release time ${config.holdAndReleaseTime ?? "-"} seconds
|
|
652
653
|
twist assist ${!!config.twistAssist}
|
|
653
654
|
block to block ${!!config.blockToBlock}`;
|
|
654
655
|
}
|
|
655
|
-
|
|
656
|
+
ctx.logNode(node.id, {
|
|
656
657
|
endpoint: this.endpointIndex,
|
|
657
658
|
message: logMessage,
|
|
658
659
|
direction: "inbound",
|
|
659
660
|
});
|
|
660
661
|
}
|
|
661
|
-
|
|
662
|
+
ctx.logNode(node.id, {
|
|
662
663
|
endpoint: this.endpointIndex,
|
|
663
664
|
message: "requesting current lock status...",
|
|
664
665
|
direction: "outbound",
|
|
@@ -688,7 +689,7 @@ bolt status: ${status.boltStatus}`;
|
|
|
688
689
|
logMessage += `
|
|
689
690
|
latch status: ${status.latchStatus}`;
|
|
690
691
|
}
|
|
691
|
-
|
|
692
|
+
ctx.logNode(node.id, {
|
|
692
693
|
endpoint: this.endpointIndex,
|
|
693
694
|
message: logMessage,
|
|
694
695
|
direction: "inbound",
|
|
@@ -703,27 +704,28 @@ exports.DoorLockCC = DoorLockCC = __decorate([
|
|
|
703
704
|
(0, CommandClassDecorators_1.ccValues)(exports.DoorLockCCValues)
|
|
704
705
|
], DoorLockCC);
|
|
705
706
|
let DoorLockCCOperationSet = class DoorLockCCOperationSet extends DoorLockCC {
|
|
706
|
-
constructor(
|
|
707
|
-
super(
|
|
708
|
-
if (
|
|
709
|
-
|
|
710
|
-
throw new safe_1.ZWaveError(`${this.constructor.name}: deserialization not implemented`, safe_1.ZWaveErrorCodes.Deserialization_NotImplemented);
|
|
711
|
-
}
|
|
712
|
-
else {
|
|
713
|
-
if (options.mode === _Types_1.DoorLockMode.Unknown) {
|
|
714
|
-
throw new safe_1.ZWaveError(`Unknown is not a valid door lock target state!`, safe_1.ZWaveErrorCodes.Argument_Invalid);
|
|
715
|
-
}
|
|
716
|
-
this.mode = options.mode;
|
|
707
|
+
constructor(options) {
|
|
708
|
+
super(options);
|
|
709
|
+
if (options.mode === _Types_1.DoorLockMode.Unknown) {
|
|
710
|
+
throw new safe_1.ZWaveError(`Unknown is not a valid door lock target state!`, safe_1.ZWaveErrorCodes.Argument_Invalid);
|
|
717
711
|
}
|
|
712
|
+
this.mode = options.mode;
|
|
713
|
+
}
|
|
714
|
+
static from(_raw, _ctx) {
|
|
715
|
+
// TODO: Deserialize payload
|
|
716
|
+
throw new safe_1.ZWaveError(`${this.name}: deserialization not implemented`, safe_1.ZWaveErrorCodes.Deserialization_NotImplemented);
|
|
717
|
+
// return new DoorLockCCOperationSet({
|
|
718
|
+
// nodeId: ctx.sourceNodeId,
|
|
719
|
+
// });
|
|
718
720
|
}
|
|
719
721
|
mode;
|
|
720
|
-
serialize() {
|
|
722
|
+
serialize(ctx) {
|
|
721
723
|
this.payload = Buffer.from([this.mode]);
|
|
722
|
-
return super.serialize();
|
|
724
|
+
return super.serialize(ctx);
|
|
723
725
|
}
|
|
724
|
-
toLogEntry(
|
|
726
|
+
toLogEntry(ctx) {
|
|
725
727
|
return {
|
|
726
|
-
...super.toLogEntry(
|
|
728
|
+
...super.toLogEntry(ctx),
|
|
727
729
|
message: {
|
|
728
730
|
"target mode": (0, safe_2.getEnumMemberName)(_Types_1.DoorLockMode, this.mode),
|
|
729
731
|
},
|
|
@@ -735,52 +737,83 @@ exports.DoorLockCCOperationSet = DoorLockCCOperationSet = __decorate([
|
|
|
735
737
|
(0, CommandClassDecorators_1.CCCommand)(_Types_1.DoorLockCommand.OperationSet),
|
|
736
738
|
(0, CommandClassDecorators_1.useSupervision)()
|
|
737
739
|
], DoorLockCCOperationSet);
|
|
738
|
-
let DoorLockCCOperationReport = class DoorLockCCOperationReport extends DoorLockCC {
|
|
739
|
-
constructor(
|
|
740
|
-
super(
|
|
741
|
-
|
|
742
|
-
this.currentMode =
|
|
743
|
-
this.outsideHandlesCanOpenDoor =
|
|
744
|
-
|
|
745
|
-
|
|
746
|
-
|
|
747
|
-
|
|
740
|
+
let DoorLockCCOperationReport = DoorLockCCOperationReport_1 = class DoorLockCCOperationReport extends DoorLockCC {
|
|
741
|
+
constructor(options) {
|
|
742
|
+
super(options);
|
|
743
|
+
// TODO: Check implementation:
|
|
744
|
+
this.currentMode = options.currentMode;
|
|
745
|
+
this.outsideHandlesCanOpenDoor = options.outsideHandlesCanOpenDoor;
|
|
746
|
+
this.insideHandlesCanOpenDoor = options.insideHandlesCanOpenDoor;
|
|
747
|
+
this.doorStatus = options.doorStatus;
|
|
748
|
+
this.boltStatus = options.boltStatus;
|
|
749
|
+
this.latchStatus = options.latchStatus;
|
|
750
|
+
this.lockTimeout = options.lockTimeout;
|
|
751
|
+
this.targetMode = options.targetMode;
|
|
752
|
+
this.duration = options.duration;
|
|
753
|
+
}
|
|
754
|
+
static from(raw, ctx) {
|
|
755
|
+
(0, safe_1.validatePayload)(raw.payload.length >= 5);
|
|
756
|
+
const currentMode = raw.payload[0];
|
|
757
|
+
const outsideHandlesCanOpenDoor = [
|
|
758
|
+
!!(raw.payload[1] & 0b0001_0000),
|
|
759
|
+
!!(raw.payload[1] & 0b0010_0000),
|
|
760
|
+
!!(raw.payload[1] & 0b0100_0000),
|
|
761
|
+
!!(raw.payload[1] & 0b1000_0000),
|
|
748
762
|
];
|
|
749
|
-
|
|
750
|
-
!!(
|
|
751
|
-
!!(
|
|
752
|
-
!!(
|
|
753
|
-
!!(
|
|
763
|
+
const insideHandlesCanOpenDoor = [
|
|
764
|
+
!!(raw.payload[1] & 0b0001),
|
|
765
|
+
!!(raw.payload[1] & 0b0010),
|
|
766
|
+
!!(raw.payload[1] & 0b0100),
|
|
767
|
+
!!(raw.payload[1] & 0b1000),
|
|
754
768
|
];
|
|
755
|
-
|
|
756
|
-
|
|
757
|
-
|
|
769
|
+
const doorStatus = !!(raw.payload[2] & 0b1)
|
|
770
|
+
? "closed"
|
|
771
|
+
: "open";
|
|
772
|
+
const boltStatus = !!(raw.payload[2] & 0b10) ? "unlocked" : "locked";
|
|
773
|
+
const latchStatus = !!(raw.payload[2] & 0b100)
|
|
774
|
+
? "closed"
|
|
775
|
+
: "open";
|
|
758
776
|
// Ignore invalid timeout values
|
|
759
|
-
const lockTimeoutMinutes =
|
|
760
|
-
const lockTimeoutSeconds =
|
|
777
|
+
const lockTimeoutMinutes = raw.payload[3];
|
|
778
|
+
const lockTimeoutSeconds = raw.payload[4];
|
|
779
|
+
let lockTimeout;
|
|
761
780
|
if (lockTimeoutMinutes <= 253 && lockTimeoutSeconds <= 59) {
|
|
762
|
-
|
|
781
|
+
lockTimeout = lockTimeoutSeconds + lockTimeoutMinutes * 60;
|
|
763
782
|
}
|
|
764
|
-
|
|
765
|
-
|
|
766
|
-
|
|
783
|
+
let targetMode;
|
|
784
|
+
let duration;
|
|
785
|
+
if (raw.payload.length >= 7) {
|
|
786
|
+
targetMode = raw.payload[5];
|
|
787
|
+
duration = safe_1.Duration.parseReport(raw.payload[6]);
|
|
767
788
|
}
|
|
789
|
+
return new DoorLockCCOperationReport_1({
|
|
790
|
+
nodeId: ctx.sourceNodeId,
|
|
791
|
+
currentMode,
|
|
792
|
+
outsideHandlesCanOpenDoor,
|
|
793
|
+
insideHandlesCanOpenDoor,
|
|
794
|
+
doorStatus,
|
|
795
|
+
boltStatus,
|
|
796
|
+
latchStatus,
|
|
797
|
+
lockTimeout,
|
|
798
|
+
targetMode,
|
|
799
|
+
duration,
|
|
800
|
+
});
|
|
768
801
|
}
|
|
769
|
-
persistValues(
|
|
770
|
-
if (!super.persistValues(
|
|
802
|
+
persistValues(ctx) {
|
|
803
|
+
if (!super.persistValues(ctx))
|
|
771
804
|
return false;
|
|
772
805
|
// Only store the door/bolt/latch status if the lock supports it
|
|
773
|
-
const supportsDoorStatus = !!this.getValue(
|
|
806
|
+
const supportsDoorStatus = !!this.getValue(ctx, exports.DoorLockCCValues.doorSupported);
|
|
774
807
|
if (supportsDoorStatus) {
|
|
775
|
-
this.setValue(
|
|
808
|
+
this.setValue(ctx, exports.DoorLockCCValues.doorStatus, this.doorStatus);
|
|
776
809
|
}
|
|
777
|
-
const supportsBoltStatus = !!this.getValue(
|
|
810
|
+
const supportsBoltStatus = !!this.getValue(ctx, exports.DoorLockCCValues.boltSupported);
|
|
778
811
|
if (supportsBoltStatus) {
|
|
779
|
-
this.setValue(
|
|
812
|
+
this.setValue(ctx, exports.DoorLockCCValues.boltStatus, this.boltStatus);
|
|
780
813
|
}
|
|
781
|
-
const supportsLatchStatus = !!this.getValue(
|
|
814
|
+
const supportsLatchStatus = !!this.getValue(ctx, exports.DoorLockCCValues.latchSupported);
|
|
782
815
|
if (supportsLatchStatus) {
|
|
783
|
-
this.setValue(
|
|
816
|
+
this.setValue(ctx, exports.DoorLockCCValues.latchStatus, this.latchStatus);
|
|
784
817
|
}
|
|
785
818
|
return true;
|
|
786
819
|
}
|
|
@@ -793,7 +826,7 @@ let DoorLockCCOperationReport = class DoorLockCCOperationReport extends DoorLock
|
|
|
793
826
|
boltStatus;
|
|
794
827
|
doorStatus;
|
|
795
828
|
lockTimeout; // in seconds
|
|
796
|
-
toLogEntry(
|
|
829
|
+
toLogEntry(ctx) {
|
|
797
830
|
const message = {
|
|
798
831
|
"current mode": (0, safe_2.getEnumMemberName)(_Types_1.DoorLockMode, this.currentMode),
|
|
799
832
|
"active outside handles": this.outsideHandlesCanOpenDoor.join(", "),
|
|
@@ -818,7 +851,7 @@ let DoorLockCCOperationReport = class DoorLockCCOperationReport extends DoorLock
|
|
|
818
851
|
message["lock timeout"] = `${this.lockTimeout} seconds`;
|
|
819
852
|
}
|
|
820
853
|
return {
|
|
821
|
-
...super.toLogEntry(
|
|
854
|
+
...super.toLogEntry(ctx),
|
|
822
855
|
message,
|
|
823
856
|
};
|
|
824
857
|
}
|
|
@@ -842,7 +875,7 @@ __decorate([
|
|
|
842
875
|
__decorate([
|
|
843
876
|
(0, CommandClassDecorators_1.ccValue)(exports.DoorLockCCValues.lockTimeout)
|
|
844
877
|
], DoorLockCCOperationReport.prototype, "lockTimeout", void 0);
|
|
845
|
-
exports.DoorLockCCOperationReport = DoorLockCCOperationReport = __decorate([
|
|
878
|
+
exports.DoorLockCCOperationReport = DoorLockCCOperationReport = DoorLockCCOperationReport_1 = __decorate([
|
|
846
879
|
(0, CommandClassDecorators_1.CCCommand)(_Types_1.DoorLockCommand.OperationReport)
|
|
847
880
|
], DoorLockCCOperationReport);
|
|
848
881
|
let DoorLockCCOperationGet = class DoorLockCCOperationGet extends DoorLockCC {
|
|
@@ -852,38 +885,67 @@ exports.DoorLockCCOperationGet = DoorLockCCOperationGet = __decorate([
|
|
|
852
885
|
(0, CommandClassDecorators_1.CCCommand)(_Types_1.DoorLockCommand.OperationGet),
|
|
853
886
|
(0, CommandClassDecorators_1.expectedCCResponse)(DoorLockCCOperationReport)
|
|
854
887
|
], DoorLockCCOperationGet);
|
|
855
|
-
let DoorLockCCConfigurationReport = class DoorLockCCConfigurationReport extends DoorLockCC {
|
|
856
|
-
constructor(
|
|
857
|
-
super(
|
|
858
|
-
|
|
859
|
-
this.operationType =
|
|
860
|
-
this.outsideHandlesCanOpenDoorConfiguration =
|
|
861
|
-
|
|
862
|
-
|
|
863
|
-
|
|
864
|
-
|
|
888
|
+
let DoorLockCCConfigurationReport = DoorLockCCConfigurationReport_1 = class DoorLockCCConfigurationReport extends DoorLockCC {
|
|
889
|
+
constructor(options) {
|
|
890
|
+
super(options);
|
|
891
|
+
// TODO: Check implementation:
|
|
892
|
+
this.operationType = options.operationType;
|
|
893
|
+
this.outsideHandlesCanOpenDoorConfiguration =
|
|
894
|
+
options.outsideHandlesCanOpenDoorConfiguration;
|
|
895
|
+
this.insideHandlesCanOpenDoorConfiguration =
|
|
896
|
+
options.insideHandlesCanOpenDoorConfiguration;
|
|
897
|
+
this.lockTimeoutConfiguration = options.lockTimeoutConfiguration;
|
|
898
|
+
this.autoRelockTime = options.autoRelockTime;
|
|
899
|
+
this.holdAndReleaseTime = options.holdAndReleaseTime;
|
|
900
|
+
this.twistAssist = options.twistAssist;
|
|
901
|
+
this.blockToBlock = options.blockToBlock;
|
|
902
|
+
}
|
|
903
|
+
static from(raw, ctx) {
|
|
904
|
+
(0, safe_1.validatePayload)(raw.payload.length >= 4);
|
|
905
|
+
const operationType = raw.payload[0];
|
|
906
|
+
const outsideHandlesCanOpenDoorConfiguration = [
|
|
907
|
+
!!(raw.payload[1] & 0b0001_0000),
|
|
908
|
+
!!(raw.payload[1] & 0b0010_0000),
|
|
909
|
+
!!(raw.payload[1] & 0b0100_0000),
|
|
910
|
+
!!(raw.payload[1] & 0b1000_0000),
|
|
865
911
|
];
|
|
866
|
-
|
|
867
|
-
!!(
|
|
868
|
-
!!(
|
|
869
|
-
!!(
|
|
870
|
-
!!(
|
|
912
|
+
const insideHandlesCanOpenDoorConfiguration = [
|
|
913
|
+
!!(raw.payload[1] & 0b0001),
|
|
914
|
+
!!(raw.payload[1] & 0b0010),
|
|
915
|
+
!!(raw.payload[1] & 0b0100),
|
|
916
|
+
!!(raw.payload[1] & 0b1000),
|
|
871
917
|
];
|
|
872
|
-
|
|
873
|
-
|
|
874
|
-
const
|
|
918
|
+
let lockTimeoutConfiguration;
|
|
919
|
+
if (operationType === _Types_1.DoorLockOperationType.Timed) {
|
|
920
|
+
const lockTimeoutMinutes = raw.payload[2];
|
|
921
|
+
const lockTimeoutSeconds = raw.payload[3];
|
|
875
922
|
if (lockTimeoutMinutes <= 0xfd && lockTimeoutSeconds <= 59) {
|
|
876
|
-
|
|
923
|
+
lockTimeoutConfiguration = lockTimeoutSeconds
|
|
877
924
|
+ lockTimeoutMinutes * 60;
|
|
878
925
|
}
|
|
879
926
|
}
|
|
880
|
-
|
|
881
|
-
|
|
882
|
-
|
|
883
|
-
|
|
884
|
-
|
|
885
|
-
|
|
927
|
+
let autoRelockTime;
|
|
928
|
+
let holdAndReleaseTime;
|
|
929
|
+
let twistAssist;
|
|
930
|
+
let blockToBlock;
|
|
931
|
+
if (raw.payload.length >= 5) {
|
|
932
|
+
autoRelockTime = raw.payload.readUInt16BE(4);
|
|
933
|
+
holdAndReleaseTime = raw.payload.readUInt16BE(6);
|
|
934
|
+
const flags = raw.payload[8];
|
|
935
|
+
twistAssist = !!(flags & 0b1);
|
|
936
|
+
blockToBlock = !!(flags & 0b10);
|
|
886
937
|
}
|
|
938
|
+
return new DoorLockCCConfigurationReport_1({
|
|
939
|
+
nodeId: ctx.sourceNodeId,
|
|
940
|
+
operationType,
|
|
941
|
+
outsideHandlesCanOpenDoorConfiguration,
|
|
942
|
+
insideHandlesCanOpenDoorConfiguration,
|
|
943
|
+
lockTimeoutConfiguration,
|
|
944
|
+
autoRelockTime,
|
|
945
|
+
holdAndReleaseTime,
|
|
946
|
+
twistAssist,
|
|
947
|
+
blockToBlock,
|
|
948
|
+
});
|
|
887
949
|
}
|
|
888
950
|
operationType;
|
|
889
951
|
outsideHandlesCanOpenDoorConfiguration;
|
|
@@ -895,29 +957,29 @@ let DoorLockCCConfigurationReport = class DoorLockCCConfigurationReport extends
|
|
|
895
957
|
holdAndReleaseTime;
|
|
896
958
|
twistAssist;
|
|
897
959
|
blockToBlock;
|
|
898
|
-
persistValues(
|
|
899
|
-
if (!super.persistValues(
|
|
960
|
+
persistValues(ctx) {
|
|
961
|
+
if (!super.persistValues(ctx))
|
|
900
962
|
return false;
|
|
901
963
|
// Only store the autoRelockTime etc. params if the lock supports it
|
|
902
|
-
const supportsAutoRelock = !!this.getValue(
|
|
964
|
+
const supportsAutoRelock = !!this.getValue(ctx, exports.DoorLockCCValues.autoRelockSupported);
|
|
903
965
|
if (supportsAutoRelock) {
|
|
904
|
-
this.setValue(
|
|
966
|
+
this.setValue(ctx, exports.DoorLockCCValues.autoRelockTime, this.autoRelockTime);
|
|
905
967
|
}
|
|
906
|
-
const supportsHoldAndRelease = !!this.getValue(
|
|
968
|
+
const supportsHoldAndRelease = !!this.getValue(ctx, exports.DoorLockCCValues.holdAndReleaseSupported);
|
|
907
969
|
if (supportsHoldAndRelease) {
|
|
908
|
-
this.setValue(
|
|
970
|
+
this.setValue(ctx, exports.DoorLockCCValues.holdAndReleaseTime, this.holdAndReleaseTime);
|
|
909
971
|
}
|
|
910
|
-
const supportsTwistAssist = !!this.getValue(
|
|
972
|
+
const supportsTwistAssist = !!this.getValue(ctx, exports.DoorLockCCValues.twistAssistSupported);
|
|
911
973
|
if (supportsTwistAssist) {
|
|
912
|
-
this.setValue(
|
|
974
|
+
this.setValue(ctx, exports.DoorLockCCValues.twistAssist, this.twistAssist);
|
|
913
975
|
}
|
|
914
|
-
const supportsBlockToBlock = !!this.getValue(
|
|
976
|
+
const supportsBlockToBlock = !!this.getValue(ctx, exports.DoorLockCCValues.blockToBlockSupported);
|
|
915
977
|
if (supportsBlockToBlock) {
|
|
916
|
-
this.setValue(
|
|
978
|
+
this.setValue(ctx, exports.DoorLockCCValues.blockToBlock, this.blockToBlock);
|
|
917
979
|
}
|
|
918
980
|
return true;
|
|
919
981
|
}
|
|
920
|
-
toLogEntry(
|
|
982
|
+
toLogEntry(ctx) {
|
|
921
983
|
const message = {
|
|
922
984
|
"operation type": (0, safe_2.getEnumMemberName)(_Types_1.DoorLockOperationType, this.operationType),
|
|
923
985
|
"outside handle configuration": this
|
|
@@ -941,7 +1003,7 @@ let DoorLockCCConfigurationReport = class DoorLockCCConfigurationReport extends
|
|
|
941
1003
|
message["block-to-block enabled"] = this.blockToBlock;
|
|
942
1004
|
}
|
|
943
1005
|
return {
|
|
944
|
-
...super.toLogEntry(
|
|
1006
|
+
...super.toLogEntry(ctx),
|
|
945
1007
|
message,
|
|
946
1008
|
};
|
|
947
1009
|
}
|
|
@@ -959,7 +1021,7 @@ __decorate([
|
|
|
959
1021
|
__decorate([
|
|
960
1022
|
(0, CommandClassDecorators_1.ccValue)(exports.DoorLockCCValues.lockTimeoutConfiguration)
|
|
961
1023
|
], DoorLockCCConfigurationReport.prototype, "lockTimeoutConfiguration", void 0);
|
|
962
|
-
exports.DoorLockCCConfigurationReport = DoorLockCCConfigurationReport = __decorate([
|
|
1024
|
+
exports.DoorLockCCConfigurationReport = DoorLockCCConfigurationReport = DoorLockCCConfigurationReport_1 = __decorate([
|
|
963
1025
|
(0, CommandClassDecorators_1.CCCommand)(_Types_1.DoorLockCommand.ConfigurationReport)
|
|
964
1026
|
], DoorLockCCConfigurationReport);
|
|
965
1027
|
let DoorLockCCConfigurationGet = class DoorLockCCConfigurationGet extends DoorLockCC {
|
|
@@ -970,24 +1032,25 @@ exports.DoorLockCCConfigurationGet = DoorLockCCConfigurationGet = __decorate([
|
|
|
970
1032
|
(0, CommandClassDecorators_1.expectedCCResponse)(DoorLockCCConfigurationReport)
|
|
971
1033
|
], DoorLockCCConfigurationGet);
|
|
972
1034
|
let DoorLockCCConfigurationSet = class DoorLockCCConfigurationSet extends DoorLockCC {
|
|
973
|
-
constructor(
|
|
974
|
-
super(
|
|
975
|
-
|
|
976
|
-
|
|
977
|
-
|
|
978
|
-
|
|
979
|
-
|
|
980
|
-
|
|
981
|
-
|
|
982
|
-
|
|
983
|
-
|
|
984
|
-
|
|
985
|
-
|
|
986
|
-
|
|
987
|
-
|
|
988
|
-
|
|
989
|
-
|
|
990
|
-
|
|
1035
|
+
constructor(options) {
|
|
1036
|
+
super(options);
|
|
1037
|
+
this.operationType = options.operationType;
|
|
1038
|
+
this.outsideHandlesCanOpenDoorConfiguration =
|
|
1039
|
+
options.outsideHandlesCanOpenDoorConfiguration;
|
|
1040
|
+
this.insideHandlesCanOpenDoorConfiguration =
|
|
1041
|
+
options.insideHandlesCanOpenDoorConfiguration;
|
|
1042
|
+
this.lockTimeoutConfiguration = options.lockTimeoutConfiguration;
|
|
1043
|
+
this.autoRelockTime = options.autoRelockTime;
|
|
1044
|
+
this.holdAndReleaseTime = options.holdAndReleaseTime;
|
|
1045
|
+
this.twistAssist = options.twistAssist;
|
|
1046
|
+
this.blockToBlock = options.blockToBlock;
|
|
1047
|
+
}
|
|
1048
|
+
static from(_raw, _ctx) {
|
|
1049
|
+
// TODO: Deserialize payload
|
|
1050
|
+
throw new safe_1.ZWaveError(`${this.name}: deserialization not implemented`, safe_1.ZWaveErrorCodes.Deserialization_NotImplemented);
|
|
1051
|
+
// return new DoorLockCCConfigurationSet({
|
|
1052
|
+
// nodeId: ctx.sourceNodeId,
|
|
1053
|
+
// });
|
|
991
1054
|
}
|
|
992
1055
|
operationType;
|
|
993
1056
|
outsideHandlesCanOpenDoorConfiguration;
|
|
@@ -997,7 +1060,7 @@ let DoorLockCCConfigurationSet = class DoorLockCCConfigurationSet extends DoorLo
|
|
|
997
1060
|
holdAndReleaseTime;
|
|
998
1061
|
twistAssist;
|
|
999
1062
|
blockToBlock;
|
|
1000
|
-
serialize() {
|
|
1063
|
+
serialize(ctx) {
|
|
1001
1064
|
const insideHandles = (0, typeguards_1.isArray)(this.insideHandlesCanOpenDoorConfiguration)
|
|
1002
1065
|
? this.insideHandlesCanOpenDoorConfiguration
|
|
1003
1066
|
: [];
|
|
@@ -1033,9 +1096,9 @@ let DoorLockCCConfigurationSet = class DoorLockCCConfigurationSet extends DoorLo
|
|
|
1033
1096
|
]);
|
|
1034
1097
|
this.payload.writeUInt16BE((this.autoRelockTime ?? 0) & 0xffff, 4);
|
|
1035
1098
|
this.payload.writeUInt16BE((this.holdAndReleaseTime ?? 0) & 0xffff, 6);
|
|
1036
|
-
return super.serialize();
|
|
1099
|
+
return super.serialize(ctx);
|
|
1037
1100
|
}
|
|
1038
|
-
toLogEntry(
|
|
1101
|
+
toLogEntry(ctx) {
|
|
1039
1102
|
const insideHandles = (0, typeguards_1.isArray)(this.insideHandlesCanOpenDoorConfiguration)
|
|
1040
1103
|
? this.insideHandlesCanOpenDoorConfiguration
|
|
1041
1104
|
: [];
|
|
@@ -1063,7 +1126,7 @@ let DoorLockCCConfigurationSet = class DoorLockCCConfigurationSet extends DoorLo
|
|
|
1063
1126
|
message["enable block-to-block"] = this.blockToBlock;
|
|
1064
1127
|
}
|
|
1065
1128
|
return {
|
|
1066
|
-
...super.toLogEntry(
|
|
1129
|
+
...super.toLogEntry(ctx),
|
|
1067
1130
|
message,
|
|
1068
1131
|
};
|
|
1069
1132
|
}
|
|
@@ -1073,45 +1136,73 @@ exports.DoorLockCCConfigurationSet = DoorLockCCConfigurationSet = __decorate([
|
|
|
1073
1136
|
(0, CommandClassDecorators_1.CCCommand)(_Types_1.DoorLockCommand.ConfigurationSet),
|
|
1074
1137
|
(0, CommandClassDecorators_1.useSupervision)()
|
|
1075
1138
|
], DoorLockCCConfigurationSet);
|
|
1076
|
-
let DoorLockCCCapabilitiesReport = class DoorLockCCCapabilitiesReport extends DoorLockCC {
|
|
1077
|
-
constructor(
|
|
1078
|
-
super(
|
|
1139
|
+
let DoorLockCCCapabilitiesReport = DoorLockCCCapabilitiesReport_1 = class DoorLockCCCapabilitiesReport extends DoorLockCC {
|
|
1140
|
+
constructor(options) {
|
|
1141
|
+
super(options);
|
|
1142
|
+
// TODO: Check implementation:
|
|
1143
|
+
this.supportedOperationTypes = options.supportedOperationTypes;
|
|
1144
|
+
this.supportedDoorLockModes = options.supportedDoorLockModes;
|
|
1145
|
+
this.supportedOutsideHandles = options.supportedOutsideHandles;
|
|
1146
|
+
this.supportedInsideHandles = options.supportedInsideHandles;
|
|
1147
|
+
this.doorSupported = options.doorSupported;
|
|
1148
|
+
this.boltSupported = options.boltSupported;
|
|
1149
|
+
this.latchSupported = options.latchSupported;
|
|
1150
|
+
this.blockToBlockSupported = options.blockToBlockSupported;
|
|
1151
|
+
this.twistAssistSupported = options.twistAssistSupported;
|
|
1152
|
+
this.holdAndReleaseSupported = options.holdAndReleaseSupported;
|
|
1153
|
+
this.autoRelockSupported = options.autoRelockSupported;
|
|
1154
|
+
}
|
|
1155
|
+
static from(raw, ctx) {
|
|
1079
1156
|
// parse variable length operation type bit mask
|
|
1080
|
-
(0, safe_1.validatePayload)(
|
|
1081
|
-
const bitMaskLength =
|
|
1157
|
+
(0, safe_1.validatePayload)(raw.payload.length >= 1);
|
|
1158
|
+
const bitMaskLength = raw.payload[0] & 0b11111;
|
|
1082
1159
|
let offset = 1;
|
|
1083
|
-
(0, safe_1.validatePayload)(
|
|
1084
|
-
|
|
1160
|
+
(0, safe_1.validatePayload)(raw.payload.length >= offset + bitMaskLength + 1);
|
|
1161
|
+
const supportedOperationTypes = (0, safe_1.parseBitMask)(raw.payload.subarray(offset, offset + bitMaskLength),
|
|
1085
1162
|
// bit 0 is reserved, bitmask starts at 1
|
|
1086
1163
|
0);
|
|
1087
1164
|
offset += bitMaskLength;
|
|
1088
1165
|
// parse variable length door lock mode list
|
|
1089
|
-
const listLength =
|
|
1166
|
+
const listLength = raw.payload[offset];
|
|
1090
1167
|
offset += 1;
|
|
1091
|
-
(0, safe_1.validatePayload)(
|
|
1092
|
-
|
|
1093
|
-
...
|
|
1168
|
+
(0, safe_1.validatePayload)(raw.payload.length >= offset + listLength + 3);
|
|
1169
|
+
const supportedDoorLockModes = [
|
|
1170
|
+
...raw.payload.subarray(offset, offset + listLength),
|
|
1094
1171
|
];
|
|
1095
1172
|
offset += listLength;
|
|
1096
|
-
|
|
1097
|
-
!!(
|
|
1098
|
-
!!(
|
|
1099
|
-
!!(
|
|
1100
|
-
!!(
|
|
1173
|
+
const supportedOutsideHandles = [
|
|
1174
|
+
!!(raw.payload[offset] & 0b0001_0000),
|
|
1175
|
+
!!(raw.payload[offset] & 0b0010_0000),
|
|
1176
|
+
!!(raw.payload[offset] & 0b0100_0000),
|
|
1177
|
+
!!(raw.payload[offset] & 0b1000_0000),
|
|
1101
1178
|
];
|
|
1102
|
-
|
|
1103
|
-
!!(
|
|
1104
|
-
!!(
|
|
1105
|
-
!!(
|
|
1106
|
-
!!(
|
|
1179
|
+
const supportedInsideHandles = [
|
|
1180
|
+
!!(raw.payload[offset] & 0b0001),
|
|
1181
|
+
!!(raw.payload[offset] & 0b0010),
|
|
1182
|
+
!!(raw.payload[offset] & 0b0100),
|
|
1183
|
+
!!(raw.payload[offset] & 0b1000),
|
|
1107
1184
|
];
|
|
1108
|
-
|
|
1109
|
-
|
|
1110
|
-
|
|
1111
|
-
|
|
1112
|
-
|
|
1113
|
-
|
|
1114
|
-
|
|
1185
|
+
const doorSupported = !!(raw.payload[offset + 1] & 0b1);
|
|
1186
|
+
const boltSupported = !!(raw.payload[offset + 1] & 0b10);
|
|
1187
|
+
const latchSupported = !!(raw.payload[offset + 1] & 0b100);
|
|
1188
|
+
const blockToBlockSupported = !!(raw.payload[offset + 2] & 0b1);
|
|
1189
|
+
const twistAssistSupported = !!(raw.payload[offset + 2] & 0b10);
|
|
1190
|
+
const holdAndReleaseSupported = !!(raw.payload[offset + 2] & 0b100);
|
|
1191
|
+
const autoRelockSupported = !!(raw.payload[offset + 2] & 0b1000);
|
|
1192
|
+
return new DoorLockCCCapabilitiesReport_1({
|
|
1193
|
+
nodeId: ctx.sourceNodeId,
|
|
1194
|
+
supportedOperationTypes,
|
|
1195
|
+
supportedDoorLockModes,
|
|
1196
|
+
supportedOutsideHandles,
|
|
1197
|
+
supportedInsideHandles,
|
|
1198
|
+
doorSupported,
|
|
1199
|
+
boltSupported,
|
|
1200
|
+
latchSupported,
|
|
1201
|
+
blockToBlockSupported,
|
|
1202
|
+
twistAssistSupported,
|
|
1203
|
+
holdAndReleaseSupported,
|
|
1204
|
+
autoRelockSupported,
|
|
1205
|
+
});
|
|
1115
1206
|
}
|
|
1116
1207
|
supportedOperationTypes;
|
|
1117
1208
|
supportedDoorLockModes;
|
|
@@ -1126,9 +1217,9 @@ let DoorLockCCCapabilitiesReport = class DoorLockCCCapabilitiesReport extends Do
|
|
|
1126
1217
|
holdAndReleaseSupported;
|
|
1127
1218
|
twistAssistSupported;
|
|
1128
1219
|
blockToBlockSupported;
|
|
1129
|
-
toLogEntry(
|
|
1220
|
+
toLogEntry(ctx) {
|
|
1130
1221
|
return {
|
|
1131
|
-
...super.toLogEntry(
|
|
1222
|
+
...super.toLogEntry(ctx),
|
|
1132
1223
|
message: {
|
|
1133
1224
|
door: this.doorSupported,
|
|
1134
1225
|
bolt: this.boltSupported,
|
|
@@ -1168,7 +1259,7 @@ __decorate([
|
|
|
1168
1259
|
__decorate([
|
|
1169
1260
|
(0, CommandClassDecorators_1.ccValue)(exports.DoorLockCCValues.blockToBlockSupported)
|
|
1170
1261
|
], DoorLockCCCapabilitiesReport.prototype, "blockToBlockSupported", void 0);
|
|
1171
|
-
exports.DoorLockCCCapabilitiesReport = DoorLockCCCapabilitiesReport = __decorate([
|
|
1262
|
+
exports.DoorLockCCCapabilitiesReport = DoorLockCCCapabilitiesReport = DoorLockCCCapabilitiesReport_1 = __decorate([
|
|
1172
1263
|
(0, CommandClassDecorators_1.CCCommand)(_Types_1.DoorLockCommand.CapabilitiesReport)
|
|
1173
1264
|
], DoorLockCCCapabilitiesReport);
|
|
1174
1265
|
let DoorLockCCCapabilitiesGet = class DoorLockCCCapabilitiesGet extends DoorLockCC {
|