@zwave-js/cc 11.14.0 → 12.0.0-beta.1
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.js +19 -7
- package/build/cc/AlarmSensorCC.js.map +1 -1
- package/build/cc/AssociationCC.js +29 -11
- package/build/cc/AssociationCC.js.map +1 -1
- package/build/cc/AssociationGroupInfoCC.js +32 -11
- package/build/cc/AssociationGroupInfoCC.js.map +1 -1
- package/build/cc/BarrierOperatorCC.js +107 -92
- package/build/cc/BarrierOperatorCC.js.map +1 -1
- package/build/cc/BasicCC.js +63 -58
- package/build/cc/BasicCC.js.map +1 -1
- package/build/cc/BatteryCC.js +26 -7
- package/build/cc/BatteryCC.js.map +1 -1
- package/build/cc/BinarySensorCC.js +16 -6
- package/build/cc/BinarySensorCC.js.map +1 -1
- package/build/cc/BinarySwitchCC.js +56 -50
- package/build/cc/BinarySwitchCC.js.map +1 -1
- package/build/cc/CRC16CC.js +9 -5
- package/build/cc/CRC16CC.js.map +1 -1
- package/build/cc/CentralSceneCC.js +27 -10
- package/build/cc/CentralSceneCC.js.map +1 -1
- package/build/cc/ClimateControlScheduleCC.js +31 -11
- package/build/cc/ClimateControlScheduleCC.js.map +1 -1
- package/build/cc/ClockCC.js +16 -5
- package/build/cc/ClockCC.js.map +1 -1
- package/build/cc/ColorSwitchCC.js +33 -10
- package/build/cc/ColorSwitchCC.js.map +1 -1
- package/build/cc/ConfigurationCC.js +84 -24
- package/build/cc/ConfigurationCC.js.map +1 -1
- package/build/cc/DeviceResetLocallyCC.js +6 -3
- package/build/cc/DeviceResetLocallyCC.js.map +1 -1
- package/build/cc/DoorLockCC.js +63 -12
- package/build/cc/DoorLockCC.js.map +1 -1
- package/build/cc/DoorLockLoggingCC.d.ts.map +1 -1
- package/build/cc/DoorLockLoggingCC.js +17 -7
- package/build/cc/DoorLockLoggingCC.js.map +1 -1
- package/build/cc/EnergyProductionCC.d.ts.map +1 -1
- package/build/cc/EnergyProductionCC.js +13 -5
- package/build/cc/EnergyProductionCC.js.map +1 -1
- package/build/cc/EntryControlCC.d.ts.map +1 -1
- package/build/cc/EntryControlCC.js +39 -14
- package/build/cc/EntryControlCC.js.map +1 -1
- package/build/cc/FirmwareUpdateMetaDataCC.js +69 -14
- package/build/cc/FirmwareUpdateMetaDataCC.js.map +1 -1
- package/build/cc/HailCC.js +2 -1
- package/build/cc/HailCC.js.map +1 -1
- package/build/cc/HumidityControlModeCC.js +17 -7
- package/build/cc/HumidityControlModeCC.js.map +1 -1
- package/build/cc/HumidityControlOperatingStateCC.js +9 -4
- package/build/cc/HumidityControlOperatingStateCC.js.map +1 -1
- package/build/cc/HumidityControlSetpointCC.js +41 -14
- package/build/cc/HumidityControlSetpointCC.js.map +1 -1
- package/build/cc/InclusionControllerCC.js +12 -4
- package/build/cc/InclusionControllerCC.js.map +1 -1
- package/build/cc/IndicatorCC.js +32 -11
- package/build/cc/IndicatorCC.js.map +1 -1
- package/build/cc/IrrigationCC.js +112 -27
- package/build/cc/IrrigationCC.js.map +1 -1
- package/build/cc/LanguageCC.js +14 -5
- package/build/cc/LanguageCC.js.map +1 -1
- package/build/cc/LockCC.js +12 -5
- package/build/cc/LockCC.js.map +1 -1
- package/build/cc/ManufacturerProprietaryCC.js +12 -3
- package/build/cc/ManufacturerProprietaryCC.js.map +1 -1
- package/build/cc/ManufacturerSpecificCC.js +19 -7
- package/build/cc/ManufacturerSpecificCC.js.map +1 -1
- package/build/cc/MeterCC.js +31 -10
- package/build/cc/MeterCC.js.map +1 -1
- package/build/cc/MultiChannelAssociationCC.js +30 -9
- package/build/cc/MultiChannelAssociationCC.js.map +1 -1
- package/build/cc/MultiChannelCC.d.ts.map +1 -1
- package/build/cc/MultiChannelCC.js +61 -22
- package/build/cc/MultiChannelCC.js.map +1 -1
- package/build/cc/MultiCommandCC.js +8 -4
- package/build/cc/MultiCommandCC.js.map +1 -1
- package/build/cc/MultilevelSensorCC.d.ts.map +1 -1
- package/build/cc/MultilevelSensorCC.js +27 -9
- package/build/cc/MultilevelSensorCC.js.map +1 -1
- package/build/cc/MultilevelSwitchCC.js +111 -95
- package/build/cc/MultilevelSwitchCC.js.map +1 -1
- package/build/cc/NoOperationCC.js +4 -2
- package/build/cc/NoOperationCC.js.map +1 -1
- package/build/cc/NodeNamingCC.js +22 -10
- package/build/cc/NodeNamingCC.js.map +1 -1
- package/build/cc/NotificationCC.d.ts.map +1 -1
- package/build/cc/NotificationCC.js +43 -13
- package/build/cc/NotificationCC.js.map +1 -1
- package/build/cc/PowerlevelCC.js +26 -8
- package/build/cc/PowerlevelCC.js.map +1 -1
- package/build/cc/ProtectionCC.js +41 -16
- package/build/cc/ProtectionCC.js.map +1 -1
- package/build/cc/SceneActivationCC.js +8 -3
- package/build/cc/SceneActivationCC.js.map +1 -1
- package/build/cc/SceneActuatorConfigurationCC.js +17 -5
- package/build/cc/SceneActuatorConfigurationCC.js.map +1 -1
- package/build/cc/SceneControllerConfigurationCC.js +17 -5
- package/build/cc/SceneControllerConfigurationCC.js.map +1 -1
- package/build/cc/ScheduleEntryLockCC.js +109 -20
- package/build/cc/ScheduleEntryLockCC.js.map +1 -1
- package/build/cc/Security2CC.js +84 -32
- package/build/cc/Security2CC.js.map +1 -1
- package/build/cc/SecurityCC.js +47 -21
- package/build/cc/SecurityCC.js.map +1 -1
- package/build/cc/SoundSwitchCC.d.ts.map +1 -1
- package/build/cc/SoundSwitchCC.js +38 -13
- package/build/cc/SoundSwitchCC.js.map +1 -1
- package/build/cc/SupervisionCC.js +18 -6
- package/build/cc/SupervisionCC.js.map +1 -1
- package/build/cc/ThermostatFanModeCC.js +19 -7
- package/build/cc/ThermostatFanModeCC.js.map +1 -1
- package/build/cc/ThermostatFanStateCC.js +9 -4
- package/build/cc/ThermostatFanStateCC.js.map +1 -1
- package/build/cc/ThermostatModeCC.js +22 -10
- package/build/cc/ThermostatModeCC.js.map +1 -1
- package/build/cc/ThermostatOperatingStateCC.js +9 -4
- package/build/cc/ThermostatOperatingStateCC.js.map +1 -1
- package/build/cc/ThermostatSetbackCC.js +15 -5
- package/build/cc/ThermostatSetbackCC.js.map +1 -1
- package/build/cc/ThermostatSetpointCC.d.ts.map +1 -1
- package/build/cc/ThermostatSetpointCC.js +36 -13
- package/build/cc/ThermostatSetpointCC.js.map +1 -1
- package/build/cc/TimeCC.js +32 -9
- package/build/cc/TimeCC.js.map +1 -1
- package/build/cc/TimeParametersCC.js +13 -5
- package/build/cc/TimeParametersCC.js.map +1 -1
- package/build/cc/TransportServiceCC.js +37 -15
- package/build/cc/TransportServiceCC.js.map +1 -1
- package/build/cc/UserCodeCC.d.ts.map +1 -1
- package/build/cc/UserCodeCC.js +77 -31
- package/build/cc/UserCodeCC.js.map +1 -1
- package/build/cc/VersionCC.js +41 -14
- package/build/cc/VersionCC.js.map +1 -1
- package/build/cc/WakeUpCC.js +27 -9
- package/build/cc/WakeUpCC.js.map +1 -1
- package/build/cc/WindowCoveringCC.js +114 -97
- package/build/cc/WindowCoveringCC.js.map +1 -1
- package/build/cc/ZWavePlusCC.js +13 -4
- package/build/cc/ZWavePlusCC.js.map +1 -1
- package/build/cc/ZWaveProtocolCC.d.ts.map +1 -1
- package/build/cc/ZWaveProtocolCC.js +173 -48
- package/build/cc/ZWaveProtocolCC.js.map +1 -1
- package/build/cc/manufacturerProprietary/FibaroCC.js +19 -7
- package/build/cc/manufacturerProprietary/FibaroCC.js.map +1 -1
- package/build/lib/API.js +10 -3
- package/build/lib/API.js.map +1 -1
- package/build/lib/CommandClass.js +28 -7
- package/build/lib/CommandClass.js.map +1 -1
- package/build/lib/Security2/Extension.js +18 -6
- package/build/lib/Security2/Extension.js.map +1 -1
- package/package.json +33 -31
package/build/cc/UserCodeCC.js
CHANGED
|
@@ -310,7 +310,7 @@ function parseExtendedUserCode(payload) {
|
|
|
310
310
|
const status = payload[2];
|
|
311
311
|
const codeLength = payload[3] & 0b1111;
|
|
312
312
|
(0, safe_1.validatePayload)(payload.length >= 4 + codeLength);
|
|
313
|
-
const code = payload.
|
|
313
|
+
const code = payload.subarray(4, 4 + codeLength).toString("ascii");
|
|
314
314
|
return {
|
|
315
315
|
code: {
|
|
316
316
|
userId,
|
|
@@ -384,7 +384,7 @@ function userCodeToLogString(userCode) {
|
|
|
384
384
|
return "*".repeat(userCode.length);
|
|
385
385
|
}
|
|
386
386
|
exports.userCodeToLogString = userCodeToLogString;
|
|
387
|
-
let UserCodeCCAPI =
|
|
387
|
+
let UserCodeCCAPI = class UserCodeCCAPI extends API_1.PhysicalCCAPI {
|
|
388
388
|
supportsCommand(cmd) {
|
|
389
389
|
switch (cmd) {
|
|
390
390
|
case _Types_1.UserCodeCommand.Get:
|
|
@@ -733,10 +733,11 @@ let UserCodeCCAPI = exports.UserCodeCCAPI = class UserCodeCCAPI extends API_1.Ph
|
|
|
733
733
|
return response?.userCodeChecksum;
|
|
734
734
|
}
|
|
735
735
|
};
|
|
736
|
+
exports.UserCodeCCAPI = UserCodeCCAPI;
|
|
736
737
|
exports.UserCodeCCAPI = UserCodeCCAPI = __decorate([
|
|
737
738
|
(0, CommandClassDecorators_1.API)(safe_1.CommandClasses["User Code"])
|
|
738
739
|
], UserCodeCCAPI);
|
|
739
|
-
let UserCodeCC =
|
|
740
|
+
let UserCodeCC = class UserCodeCC extends CommandClass_1.CommandClass {
|
|
740
741
|
async interview(applHost) {
|
|
741
742
|
const node = this.getNode(applHost);
|
|
742
743
|
const endpoint = this.getEndpoint(applHost);
|
|
@@ -941,12 +942,13 @@ let UserCodeCC = exports.UserCodeCC = class UserCodeCC extends CommandClass_1.Co
|
|
|
941
942
|
.getValue(exports.UserCodeCCValues.userCode(userId).endpoint(endpoint.index));
|
|
942
943
|
}
|
|
943
944
|
};
|
|
945
|
+
exports.UserCodeCC = UserCodeCC;
|
|
944
946
|
exports.UserCodeCC = UserCodeCC = __decorate([
|
|
945
947
|
(0, CommandClassDecorators_1.commandClass)(safe_1.CommandClasses["User Code"]),
|
|
946
948
|
(0, CommandClassDecorators_1.implementedVersion)(2),
|
|
947
949
|
(0, CommandClassDecorators_1.ccValues)(exports.UserCodeCCValues)
|
|
948
950
|
], UserCodeCC);
|
|
949
|
-
let UserCodeCCSet =
|
|
951
|
+
let UserCodeCCSet = class UserCodeCCSet extends UserCodeCC {
|
|
950
952
|
constructor(host, options) {
|
|
951
953
|
super(host, options);
|
|
952
954
|
if ((0, CommandClass_1.gotDeserializationOptions)(options)) {
|
|
@@ -955,7 +957,7 @@ let UserCodeCCSet = exports.UserCodeCCSet = class UserCodeCCSet extends UserCode
|
|
|
955
957
|
this.userIdStatus = this.payload[1];
|
|
956
958
|
if (this.userIdStatus !== _Types_1.UserIDStatus.Available
|
|
957
959
|
&& this.userIdStatus !== _Types_1.UserIDStatus.StatusNotAvailable) {
|
|
958
|
-
this.userCode = this.payload.
|
|
960
|
+
this.userCode = this.payload.subarray(2);
|
|
959
961
|
}
|
|
960
962
|
else {
|
|
961
963
|
this.userCode = Buffer.alloc(4, 0x00);
|
|
@@ -986,6 +988,9 @@ let UserCodeCCSet = exports.UserCodeCCSet = class UserCodeCCSet extends UserCode
|
|
|
986
988
|
}
|
|
987
989
|
}
|
|
988
990
|
}
|
|
991
|
+
userId;
|
|
992
|
+
userIdStatus;
|
|
993
|
+
userCode;
|
|
989
994
|
serialize() {
|
|
990
995
|
this.payload = Buffer.concat([
|
|
991
996
|
Buffer.from([this.userId, this.userIdStatus]),
|
|
@@ -1006,11 +1011,12 @@ let UserCodeCCSet = exports.UserCodeCCSet = class UserCodeCCSet extends UserCode
|
|
|
1006
1011
|
};
|
|
1007
1012
|
}
|
|
1008
1013
|
};
|
|
1014
|
+
exports.UserCodeCCSet = UserCodeCCSet;
|
|
1009
1015
|
exports.UserCodeCCSet = UserCodeCCSet = __decorate([
|
|
1010
1016
|
(0, CommandClassDecorators_1.CCCommand)(_Types_1.UserCodeCommand.Set),
|
|
1011
1017
|
(0, CommandClassDecorators_1.useSupervision)()
|
|
1012
1018
|
], UserCodeCCSet);
|
|
1013
|
-
let UserCodeCCReport =
|
|
1019
|
+
let UserCodeCCReport = class UserCodeCCReport extends UserCodeCC {
|
|
1014
1020
|
constructor(host, options) {
|
|
1015
1021
|
super(host, options);
|
|
1016
1022
|
if ((0, CommandClass_1.gotDeserializationOptions)(options)) {
|
|
@@ -1026,10 +1032,10 @@ let UserCodeCCReport = exports.UserCodeCCReport = class UserCodeCCReport extends
|
|
|
1026
1032
|
else {
|
|
1027
1033
|
// The specs require the user code to be at least 4 digits
|
|
1028
1034
|
(0, safe_1.validatePayload)(this.payload.length >= 6);
|
|
1029
|
-
let userCodeBuffer = this.payload.
|
|
1035
|
+
let userCodeBuffer = this.payload.subarray(2);
|
|
1030
1036
|
// Specs say infer user code from payload length, manufacturers send zero-padded strings
|
|
1031
|
-
while (userCodeBuffer
|
|
1032
|
-
userCodeBuffer = userCodeBuffer.
|
|
1037
|
+
while (userCodeBuffer.at(-1) === 0) {
|
|
1038
|
+
userCodeBuffer = userCodeBuffer.subarray(0, -1);
|
|
1033
1039
|
}
|
|
1034
1040
|
// Specs say ASCII 0-9, manufacturers don't care :)
|
|
1035
1041
|
// Thus we check if the code is printable using ASCII, if not keep it as a Buffer
|
|
@@ -1053,6 +1059,9 @@ let UserCodeCCReport = exports.UserCodeCCReport = class UserCodeCCReport extends
|
|
|
1053
1059
|
this.userCode = options.userCode ?? "";
|
|
1054
1060
|
}
|
|
1055
1061
|
}
|
|
1062
|
+
userId;
|
|
1063
|
+
userIdStatus;
|
|
1064
|
+
userCode;
|
|
1056
1065
|
persistValues(applHost) {
|
|
1057
1066
|
if (!super.persistValues(applHost))
|
|
1058
1067
|
return false;
|
|
@@ -1088,10 +1097,11 @@ let UserCodeCCReport = exports.UserCodeCCReport = class UserCodeCCReport extends
|
|
|
1088
1097
|
return { userId: this.userId };
|
|
1089
1098
|
}
|
|
1090
1099
|
};
|
|
1100
|
+
exports.UserCodeCCReport = UserCodeCCReport;
|
|
1091
1101
|
exports.UserCodeCCReport = UserCodeCCReport = __decorate([
|
|
1092
1102
|
(0, CommandClassDecorators_1.CCCommand)(_Types_1.UserCodeCommand.Report)
|
|
1093
1103
|
], UserCodeCCReport);
|
|
1094
|
-
let UserCodeCCGet =
|
|
1104
|
+
let UserCodeCCGet = class UserCodeCCGet extends UserCodeCC {
|
|
1095
1105
|
constructor(host, options) {
|
|
1096
1106
|
super(host, options);
|
|
1097
1107
|
if ((0, CommandClass_1.gotDeserializationOptions)(options)) {
|
|
@@ -1102,6 +1112,7 @@ let UserCodeCCGet = exports.UserCodeCCGet = class UserCodeCCGet extends UserCode
|
|
|
1102
1112
|
this.userId = options.userId;
|
|
1103
1113
|
}
|
|
1104
1114
|
}
|
|
1115
|
+
userId;
|
|
1105
1116
|
serialize() {
|
|
1106
1117
|
this.payload = Buffer.from([this.userId]);
|
|
1107
1118
|
return super.serialize();
|
|
@@ -1113,11 +1124,12 @@ let UserCodeCCGet = exports.UserCodeCCGet = class UserCodeCCGet extends UserCode
|
|
|
1113
1124
|
};
|
|
1114
1125
|
}
|
|
1115
1126
|
};
|
|
1127
|
+
exports.UserCodeCCGet = UserCodeCCGet;
|
|
1116
1128
|
exports.UserCodeCCGet = UserCodeCCGet = __decorate([
|
|
1117
1129
|
(0, CommandClassDecorators_1.CCCommand)(_Types_1.UserCodeCommand.Get),
|
|
1118
1130
|
(0, CommandClassDecorators_1.expectedCCResponse)(UserCodeCCReport)
|
|
1119
1131
|
], UserCodeCCGet);
|
|
1120
|
-
let UserCodeCCUsersNumberReport =
|
|
1132
|
+
let UserCodeCCUsersNumberReport = class UserCodeCCUsersNumberReport extends UserCodeCC {
|
|
1121
1133
|
constructor(host, options) {
|
|
1122
1134
|
super(host, options);
|
|
1123
1135
|
if ((0, CommandClass_1.gotDeserializationOptions)(options)) {
|
|
@@ -1135,6 +1147,7 @@ let UserCodeCCUsersNumberReport = exports.UserCodeCCUsersNumberReport = class Us
|
|
|
1135
1147
|
this.supportedUsers = options.supportedUsers;
|
|
1136
1148
|
}
|
|
1137
1149
|
}
|
|
1150
|
+
supportedUsers;
|
|
1138
1151
|
serialize() {
|
|
1139
1152
|
this.payload = Buffer.allocUnsafe(3);
|
|
1140
1153
|
// If the node implements more than 255 users, this field MUST be set to 255
|
|
@@ -1149,19 +1162,21 @@ let UserCodeCCUsersNumberReport = exports.UserCodeCCUsersNumberReport = class Us
|
|
|
1149
1162
|
};
|
|
1150
1163
|
}
|
|
1151
1164
|
};
|
|
1165
|
+
exports.UserCodeCCUsersNumberReport = UserCodeCCUsersNumberReport;
|
|
1152
1166
|
__decorate([
|
|
1153
1167
|
(0, CommandClassDecorators_1.ccValue)(exports.UserCodeCCValues.supportedUsers)
|
|
1154
1168
|
], UserCodeCCUsersNumberReport.prototype, "supportedUsers", void 0);
|
|
1155
1169
|
exports.UserCodeCCUsersNumberReport = UserCodeCCUsersNumberReport = __decorate([
|
|
1156
1170
|
(0, CommandClassDecorators_1.CCCommand)(_Types_1.UserCodeCommand.UsersNumberReport)
|
|
1157
1171
|
], UserCodeCCUsersNumberReport);
|
|
1158
|
-
let UserCodeCCUsersNumberGet =
|
|
1172
|
+
let UserCodeCCUsersNumberGet = class UserCodeCCUsersNumberGet extends UserCodeCC {
|
|
1159
1173
|
};
|
|
1174
|
+
exports.UserCodeCCUsersNumberGet = UserCodeCCUsersNumberGet;
|
|
1160
1175
|
exports.UserCodeCCUsersNumberGet = UserCodeCCUsersNumberGet = __decorate([
|
|
1161
1176
|
(0, CommandClassDecorators_1.CCCommand)(_Types_1.UserCodeCommand.UsersNumberGet),
|
|
1162
1177
|
(0, CommandClassDecorators_1.expectedCCResponse)(UserCodeCCUsersNumberReport)
|
|
1163
1178
|
], UserCodeCCUsersNumberGet);
|
|
1164
|
-
let UserCodeCCCapabilitiesReport =
|
|
1179
|
+
let UserCodeCCCapabilitiesReport = class UserCodeCCCapabilitiesReport extends UserCodeCC {
|
|
1165
1180
|
constructor(host, options) {
|
|
1166
1181
|
super(host, options);
|
|
1167
1182
|
if ((0, CommandClass_1.gotDeserializationOptions)(options)) {
|
|
@@ -1172,7 +1187,7 @@ let UserCodeCCCapabilitiesReport = exports.UserCodeCCCapabilitiesReport = class
|
|
|
1172
1187
|
const statusBitMaskLength = this.payload[offset] & 31;
|
|
1173
1188
|
offset += 1;
|
|
1174
1189
|
(0, safe_1.validatePayload)(this.payload.length >= offset + statusBitMaskLength + 1);
|
|
1175
|
-
this.supportedUserIDStatuses = (0, safe_1.parseBitMask)(this.payload.
|
|
1190
|
+
this.supportedUserIDStatuses = (0, safe_1.parseBitMask)(this.payload.subarray(offset, offset + statusBitMaskLength), _Types_1.UserIDStatus.Available);
|
|
1176
1191
|
offset += statusBitMaskLength;
|
|
1177
1192
|
this.supportsUserCodeChecksum = !!(this.payload[offset] & 128);
|
|
1178
1193
|
this.supportsMultipleUserCodeReport = !!(this.payload[offset] & 64);
|
|
@@ -1180,12 +1195,12 @@ let UserCodeCCCapabilitiesReport = exports.UserCodeCCCapabilitiesReport = class
|
|
|
1180
1195
|
const keypadModesBitMaskLength = this.payload[offset] & 31;
|
|
1181
1196
|
offset += 1;
|
|
1182
1197
|
(0, safe_1.validatePayload)(this.payload.length >= offset + keypadModesBitMaskLength + 1);
|
|
1183
|
-
this.supportedKeypadModes = (0, safe_1.parseBitMask)(this.payload.
|
|
1198
|
+
this.supportedKeypadModes = (0, safe_1.parseBitMask)(this.payload.subarray(offset, offset + keypadModesBitMaskLength), _Types_1.KeypadMode.Normal);
|
|
1184
1199
|
offset += keypadModesBitMaskLength;
|
|
1185
1200
|
const keysBitMaskLength = this.payload[offset] & 31;
|
|
1186
1201
|
offset += 1;
|
|
1187
1202
|
(0, safe_1.validatePayload)(this.payload.length >= offset + keysBitMaskLength);
|
|
1188
|
-
this.supportedASCIIChars = Buffer.from((0, safe_1.parseBitMask)(this.payload.
|
|
1203
|
+
this.supportedASCIIChars = Buffer.from((0, safe_1.parseBitMask)(this.payload.subarray(offset, offset + keysBitMaskLength), 0)).toString("ascii");
|
|
1189
1204
|
}
|
|
1190
1205
|
else {
|
|
1191
1206
|
this.supportsMasterCode = options.supportsMasterCode;
|
|
@@ -1201,6 +1216,14 @@ let UserCodeCCCapabilitiesReport = exports.UserCodeCCCapabilitiesReport = class
|
|
|
1201
1216
|
this.supportedASCIIChars = options.supportedASCIIChars;
|
|
1202
1217
|
}
|
|
1203
1218
|
}
|
|
1219
|
+
supportsMasterCode;
|
|
1220
|
+
supportsMasterCodeDeactivation;
|
|
1221
|
+
supportsUserCodeChecksum;
|
|
1222
|
+
supportsMultipleUserCodeReport;
|
|
1223
|
+
supportsMultipleUserCodeSet;
|
|
1224
|
+
supportedUserIDStatuses;
|
|
1225
|
+
supportedKeypadModes;
|
|
1226
|
+
supportedASCIIChars;
|
|
1204
1227
|
serialize() {
|
|
1205
1228
|
const supportedStatusesBitmask = (0, safe_1.encodeBitMask)(this.supportedUserIDStatuses, undefined, _Types_1.UserIDStatus.Available);
|
|
1206
1229
|
const controlByte1 = (this.supportsMasterCode ? 128 : 0)
|
|
@@ -1244,6 +1267,7 @@ let UserCodeCCCapabilitiesReport = exports.UserCodeCCCapabilitiesReport = class
|
|
|
1244
1267
|
};
|
|
1245
1268
|
}
|
|
1246
1269
|
};
|
|
1270
|
+
exports.UserCodeCCCapabilitiesReport = UserCodeCCCapabilitiesReport;
|
|
1247
1271
|
__decorate([
|
|
1248
1272
|
(0, CommandClassDecorators_1.ccValue)(exports.UserCodeCCValues.supportsMasterCode)
|
|
1249
1273
|
], UserCodeCCCapabilitiesReport.prototype, "supportsMasterCode", void 0);
|
|
@@ -1271,13 +1295,14 @@ __decorate([
|
|
|
1271
1295
|
exports.UserCodeCCCapabilitiesReport = UserCodeCCCapabilitiesReport = __decorate([
|
|
1272
1296
|
(0, CommandClassDecorators_1.CCCommand)(_Types_1.UserCodeCommand.CapabilitiesReport)
|
|
1273
1297
|
], UserCodeCCCapabilitiesReport);
|
|
1274
|
-
let UserCodeCCCapabilitiesGet =
|
|
1298
|
+
let UserCodeCCCapabilitiesGet = class UserCodeCCCapabilitiesGet extends UserCodeCC {
|
|
1275
1299
|
};
|
|
1300
|
+
exports.UserCodeCCCapabilitiesGet = UserCodeCCCapabilitiesGet;
|
|
1276
1301
|
exports.UserCodeCCCapabilitiesGet = UserCodeCCCapabilitiesGet = __decorate([
|
|
1277
1302
|
(0, CommandClassDecorators_1.CCCommand)(_Types_1.UserCodeCommand.CapabilitiesGet),
|
|
1278
1303
|
(0, CommandClassDecorators_1.expectedCCResponse)(UserCodeCCCapabilitiesReport)
|
|
1279
1304
|
], UserCodeCCCapabilitiesGet);
|
|
1280
|
-
let UserCodeCCKeypadModeSet =
|
|
1305
|
+
let UserCodeCCKeypadModeSet = class UserCodeCCKeypadModeSet extends UserCodeCC {
|
|
1281
1306
|
constructor(host, options) {
|
|
1282
1307
|
super(host, options);
|
|
1283
1308
|
if ((0, CommandClass_1.gotDeserializationOptions)(options)) {
|
|
@@ -1288,6 +1313,7 @@ let UserCodeCCKeypadModeSet = exports.UserCodeCCKeypadModeSet = class UserCodeCC
|
|
|
1288
1313
|
this.keypadMode = options.keypadMode;
|
|
1289
1314
|
}
|
|
1290
1315
|
}
|
|
1316
|
+
keypadMode;
|
|
1291
1317
|
serialize() {
|
|
1292
1318
|
this.payload = Buffer.from([this.keypadMode]);
|
|
1293
1319
|
return super.serialize();
|
|
@@ -1299,11 +1325,12 @@ let UserCodeCCKeypadModeSet = exports.UserCodeCCKeypadModeSet = class UserCodeCC
|
|
|
1299
1325
|
};
|
|
1300
1326
|
}
|
|
1301
1327
|
};
|
|
1328
|
+
exports.UserCodeCCKeypadModeSet = UserCodeCCKeypadModeSet;
|
|
1302
1329
|
exports.UserCodeCCKeypadModeSet = UserCodeCCKeypadModeSet = __decorate([
|
|
1303
1330
|
(0, CommandClassDecorators_1.CCCommand)(_Types_1.UserCodeCommand.KeypadModeSet),
|
|
1304
1331
|
(0, CommandClassDecorators_1.useSupervision)()
|
|
1305
1332
|
], UserCodeCCKeypadModeSet);
|
|
1306
|
-
let UserCodeCCKeypadModeReport =
|
|
1333
|
+
let UserCodeCCKeypadModeReport = class UserCodeCCKeypadModeReport extends UserCodeCC {
|
|
1307
1334
|
constructor(host, options) {
|
|
1308
1335
|
super(host, options);
|
|
1309
1336
|
if ((0, CommandClass_1.gotDeserializationOptions)(options)) {
|
|
@@ -1326,6 +1353,7 @@ let UserCodeCCKeypadModeReport = exports.UserCodeCCKeypadModeReport = class User
|
|
|
1326
1353
|
});
|
|
1327
1354
|
return true;
|
|
1328
1355
|
}
|
|
1356
|
+
keypadMode;
|
|
1329
1357
|
serialize() {
|
|
1330
1358
|
this.payload = Buffer.from([this.keypadMode]);
|
|
1331
1359
|
return super.serialize();
|
|
@@ -1339,19 +1367,21 @@ let UserCodeCCKeypadModeReport = exports.UserCodeCCKeypadModeReport = class User
|
|
|
1339
1367
|
};
|
|
1340
1368
|
}
|
|
1341
1369
|
};
|
|
1370
|
+
exports.UserCodeCCKeypadModeReport = UserCodeCCKeypadModeReport;
|
|
1342
1371
|
__decorate([
|
|
1343
1372
|
(0, CommandClassDecorators_1.ccValue)(exports.UserCodeCCValues.keypadMode)
|
|
1344
1373
|
], UserCodeCCKeypadModeReport.prototype, "keypadMode", void 0);
|
|
1345
1374
|
exports.UserCodeCCKeypadModeReport = UserCodeCCKeypadModeReport = __decorate([
|
|
1346
1375
|
(0, CommandClassDecorators_1.CCCommand)(_Types_1.UserCodeCommand.KeypadModeReport)
|
|
1347
1376
|
], UserCodeCCKeypadModeReport);
|
|
1348
|
-
let UserCodeCCKeypadModeGet =
|
|
1377
|
+
let UserCodeCCKeypadModeGet = class UserCodeCCKeypadModeGet extends UserCodeCC {
|
|
1349
1378
|
};
|
|
1379
|
+
exports.UserCodeCCKeypadModeGet = UserCodeCCKeypadModeGet;
|
|
1350
1380
|
exports.UserCodeCCKeypadModeGet = UserCodeCCKeypadModeGet = __decorate([
|
|
1351
1381
|
(0, CommandClassDecorators_1.CCCommand)(_Types_1.UserCodeCommand.KeypadModeGet),
|
|
1352
1382
|
(0, CommandClassDecorators_1.expectedCCResponse)(UserCodeCCKeypadModeReport)
|
|
1353
1383
|
], UserCodeCCKeypadModeGet);
|
|
1354
|
-
let UserCodeCCMasterCodeSet =
|
|
1384
|
+
let UserCodeCCMasterCodeSet = class UserCodeCCMasterCodeSet extends UserCodeCC {
|
|
1355
1385
|
constructor(host, options) {
|
|
1356
1386
|
super(host, options);
|
|
1357
1387
|
if ((0, CommandClass_1.gotDeserializationOptions)(options)) {
|
|
@@ -1359,13 +1389,14 @@ let UserCodeCCMasterCodeSet = exports.UserCodeCCMasterCodeSet = class UserCodeCC
|
|
|
1359
1389
|
const codeLength = this.payload[0] & 0b1111;
|
|
1360
1390
|
(0, safe_1.validatePayload)(this.payload.length >= 1 + codeLength);
|
|
1361
1391
|
this.masterCode = this.payload
|
|
1362
|
-
.
|
|
1392
|
+
.subarray(1, 1 + codeLength)
|
|
1363
1393
|
.toString("ascii");
|
|
1364
1394
|
}
|
|
1365
1395
|
else {
|
|
1366
1396
|
this.masterCode = options.masterCode;
|
|
1367
1397
|
}
|
|
1368
1398
|
}
|
|
1399
|
+
masterCode;
|
|
1369
1400
|
serialize() {
|
|
1370
1401
|
this.payload = Buffer.concat([
|
|
1371
1402
|
Buffer.from([this.masterCode.length & 0b1111]),
|
|
@@ -1380,11 +1411,12 @@ let UserCodeCCMasterCodeSet = exports.UserCodeCCMasterCodeSet = class UserCodeCC
|
|
|
1380
1411
|
};
|
|
1381
1412
|
}
|
|
1382
1413
|
};
|
|
1414
|
+
exports.UserCodeCCMasterCodeSet = UserCodeCCMasterCodeSet;
|
|
1383
1415
|
exports.UserCodeCCMasterCodeSet = UserCodeCCMasterCodeSet = __decorate([
|
|
1384
1416
|
(0, CommandClassDecorators_1.CCCommand)(_Types_1.UserCodeCommand.MasterCodeSet),
|
|
1385
1417
|
(0, CommandClassDecorators_1.useSupervision)()
|
|
1386
1418
|
], UserCodeCCMasterCodeSet);
|
|
1387
|
-
let UserCodeCCMasterCodeReport =
|
|
1419
|
+
let UserCodeCCMasterCodeReport = class UserCodeCCMasterCodeReport extends UserCodeCC {
|
|
1388
1420
|
constructor(host, options) {
|
|
1389
1421
|
super(host, options);
|
|
1390
1422
|
if ((0, CommandClass_1.gotDeserializationOptions)(options)) {
|
|
@@ -1392,13 +1424,14 @@ let UserCodeCCMasterCodeReport = exports.UserCodeCCMasterCodeReport = class User
|
|
|
1392
1424
|
const codeLength = this.payload[0] & 0b1111;
|
|
1393
1425
|
(0, safe_1.validatePayload)(this.payload.length >= 1 + codeLength);
|
|
1394
1426
|
this.masterCode = this.payload
|
|
1395
|
-
.
|
|
1427
|
+
.subarray(1, 1 + codeLength)
|
|
1396
1428
|
.toString("ascii");
|
|
1397
1429
|
}
|
|
1398
1430
|
else {
|
|
1399
1431
|
this.masterCode = options.masterCode;
|
|
1400
1432
|
}
|
|
1401
1433
|
}
|
|
1434
|
+
masterCode;
|
|
1402
1435
|
serialize() {
|
|
1403
1436
|
this.payload = Buffer.concat([
|
|
1404
1437
|
Buffer.from([this.masterCode.length & 0b1111]),
|
|
@@ -1413,19 +1446,21 @@ let UserCodeCCMasterCodeReport = exports.UserCodeCCMasterCodeReport = class User
|
|
|
1413
1446
|
};
|
|
1414
1447
|
}
|
|
1415
1448
|
};
|
|
1449
|
+
exports.UserCodeCCMasterCodeReport = UserCodeCCMasterCodeReport;
|
|
1416
1450
|
__decorate([
|
|
1417
1451
|
(0, CommandClassDecorators_1.ccValue)(exports.UserCodeCCValues.masterCode)
|
|
1418
1452
|
], UserCodeCCMasterCodeReport.prototype, "masterCode", void 0);
|
|
1419
1453
|
exports.UserCodeCCMasterCodeReport = UserCodeCCMasterCodeReport = __decorate([
|
|
1420
1454
|
(0, CommandClassDecorators_1.CCCommand)(_Types_1.UserCodeCommand.MasterCodeReport)
|
|
1421
1455
|
], UserCodeCCMasterCodeReport);
|
|
1422
|
-
let UserCodeCCMasterCodeGet =
|
|
1456
|
+
let UserCodeCCMasterCodeGet = class UserCodeCCMasterCodeGet extends UserCodeCC {
|
|
1423
1457
|
};
|
|
1458
|
+
exports.UserCodeCCMasterCodeGet = UserCodeCCMasterCodeGet;
|
|
1424
1459
|
exports.UserCodeCCMasterCodeGet = UserCodeCCMasterCodeGet = __decorate([
|
|
1425
1460
|
(0, CommandClassDecorators_1.CCCommand)(_Types_1.UserCodeCommand.MasterCodeGet),
|
|
1426
1461
|
(0, CommandClassDecorators_1.expectedCCResponse)(UserCodeCCMasterCodeReport)
|
|
1427
1462
|
], UserCodeCCMasterCodeGet);
|
|
1428
|
-
let UserCodeCCUserCodeChecksumReport =
|
|
1463
|
+
let UserCodeCCUserCodeChecksumReport = class UserCodeCCUserCodeChecksumReport extends UserCodeCC {
|
|
1429
1464
|
constructor(host, options) {
|
|
1430
1465
|
super(host, options);
|
|
1431
1466
|
if ((0, CommandClass_1.gotDeserializationOptions)(options)) {
|
|
@@ -1436,6 +1471,7 @@ let UserCodeCCUserCodeChecksumReport = exports.UserCodeCCUserCodeChecksumReport
|
|
|
1436
1471
|
this.userCodeChecksum = options.userCodeChecksum;
|
|
1437
1472
|
}
|
|
1438
1473
|
}
|
|
1474
|
+
userCodeChecksum;
|
|
1439
1475
|
serialize() {
|
|
1440
1476
|
this.payload = Buffer.allocUnsafe(2);
|
|
1441
1477
|
this.payload.writeUInt16BE(this.userCodeChecksum, 0);
|
|
@@ -1448,19 +1484,21 @@ let UserCodeCCUserCodeChecksumReport = exports.UserCodeCCUserCodeChecksumReport
|
|
|
1448
1484
|
};
|
|
1449
1485
|
}
|
|
1450
1486
|
};
|
|
1487
|
+
exports.UserCodeCCUserCodeChecksumReport = UserCodeCCUserCodeChecksumReport;
|
|
1451
1488
|
__decorate([
|
|
1452
1489
|
(0, CommandClassDecorators_1.ccValue)(exports.UserCodeCCValues.userCodeChecksum)
|
|
1453
1490
|
], UserCodeCCUserCodeChecksumReport.prototype, "userCodeChecksum", void 0);
|
|
1454
1491
|
exports.UserCodeCCUserCodeChecksumReport = UserCodeCCUserCodeChecksumReport = __decorate([
|
|
1455
1492
|
(0, CommandClassDecorators_1.CCCommand)(_Types_1.UserCodeCommand.UserCodeChecksumReport)
|
|
1456
1493
|
], UserCodeCCUserCodeChecksumReport);
|
|
1457
|
-
let UserCodeCCUserCodeChecksumGet =
|
|
1494
|
+
let UserCodeCCUserCodeChecksumGet = class UserCodeCCUserCodeChecksumGet extends UserCodeCC {
|
|
1458
1495
|
};
|
|
1496
|
+
exports.UserCodeCCUserCodeChecksumGet = UserCodeCCUserCodeChecksumGet;
|
|
1459
1497
|
exports.UserCodeCCUserCodeChecksumGet = UserCodeCCUserCodeChecksumGet = __decorate([
|
|
1460
1498
|
(0, CommandClassDecorators_1.CCCommand)(_Types_1.UserCodeCommand.UserCodeChecksumGet),
|
|
1461
1499
|
(0, CommandClassDecorators_1.expectedCCResponse)(UserCodeCCUserCodeChecksumReport)
|
|
1462
1500
|
], UserCodeCCUserCodeChecksumGet);
|
|
1463
|
-
let UserCodeCCExtendedUserCodeSet =
|
|
1501
|
+
let UserCodeCCExtendedUserCodeSet = class UserCodeCCExtendedUserCodeSet extends UserCodeCC {
|
|
1464
1502
|
constructor(host, options) {
|
|
1465
1503
|
super(host, options);
|
|
1466
1504
|
if ((0, CommandClass_1.gotDeserializationOptions)(options)) {
|
|
@@ -1471,6 +1509,7 @@ let UserCodeCCExtendedUserCodeSet = exports.UserCodeCCExtendedUserCodeSet = clas
|
|
|
1471
1509
|
this.userCodes = options.userCodes;
|
|
1472
1510
|
}
|
|
1473
1511
|
}
|
|
1512
|
+
userCodes;
|
|
1474
1513
|
serialize() {
|
|
1475
1514
|
const userCodeBuffers = this.userCodes.map((code) => {
|
|
1476
1515
|
const ret = Buffer.concat([
|
|
@@ -1504,11 +1543,12 @@ let UserCodeCCExtendedUserCodeSet = exports.UserCodeCCExtendedUserCodeSet = clas
|
|
|
1504
1543
|
};
|
|
1505
1544
|
}
|
|
1506
1545
|
};
|
|
1546
|
+
exports.UserCodeCCExtendedUserCodeSet = UserCodeCCExtendedUserCodeSet;
|
|
1507
1547
|
exports.UserCodeCCExtendedUserCodeSet = UserCodeCCExtendedUserCodeSet = __decorate([
|
|
1508
1548
|
(0, CommandClassDecorators_1.CCCommand)(_Types_1.UserCodeCommand.ExtendedUserCodeSet),
|
|
1509
1549
|
(0, CommandClassDecorators_1.useSupervision)()
|
|
1510
1550
|
], UserCodeCCExtendedUserCodeSet);
|
|
1511
|
-
let UserCodeCCExtendedUserCodeReport =
|
|
1551
|
+
let UserCodeCCExtendedUserCodeReport = class UserCodeCCExtendedUserCodeReport extends UserCodeCC {
|
|
1512
1552
|
constructor(host, options) {
|
|
1513
1553
|
super(host, options);
|
|
1514
1554
|
(0, safe_1.validatePayload)(this.payload.length >= 1);
|
|
@@ -1517,7 +1557,7 @@ let UserCodeCCExtendedUserCodeReport = exports.UserCodeCCExtendedUserCodeReport
|
|
|
1517
1557
|
const userCodes = [];
|
|
1518
1558
|
// parse each user code
|
|
1519
1559
|
for (let i = 0; i < numCodes; i++) {
|
|
1520
|
-
const { code, bytesRead } = parseExtendedUserCode(this.payload.
|
|
1560
|
+
const { code, bytesRead } = parseExtendedUserCode(this.payload.subarray(offset));
|
|
1521
1561
|
userCodes.push(code);
|
|
1522
1562
|
offset += bytesRead;
|
|
1523
1563
|
}
|
|
@@ -1533,6 +1573,8 @@ let UserCodeCCExtendedUserCodeReport = exports.UserCodeCCExtendedUserCodeReport
|
|
|
1533
1573
|
}
|
|
1534
1574
|
return true;
|
|
1535
1575
|
}
|
|
1576
|
+
userCodes;
|
|
1577
|
+
nextUserId;
|
|
1536
1578
|
toLogEntry(applHost) {
|
|
1537
1579
|
const message = {};
|
|
1538
1580
|
for (const { userId, userIdStatus, userCode } of this.userCodes) {
|
|
@@ -1545,10 +1587,11 @@ let UserCodeCCExtendedUserCodeReport = exports.UserCodeCCExtendedUserCodeReport
|
|
|
1545
1587
|
};
|
|
1546
1588
|
}
|
|
1547
1589
|
};
|
|
1590
|
+
exports.UserCodeCCExtendedUserCodeReport = UserCodeCCExtendedUserCodeReport;
|
|
1548
1591
|
exports.UserCodeCCExtendedUserCodeReport = UserCodeCCExtendedUserCodeReport = __decorate([
|
|
1549
1592
|
(0, CommandClassDecorators_1.CCCommand)(_Types_1.UserCodeCommand.ExtendedUserCodeReport)
|
|
1550
1593
|
], UserCodeCCExtendedUserCodeReport);
|
|
1551
|
-
let UserCodeCCExtendedUserCodeGet =
|
|
1594
|
+
let UserCodeCCExtendedUserCodeGet = class UserCodeCCExtendedUserCodeGet extends UserCodeCC {
|
|
1552
1595
|
constructor(host, options) {
|
|
1553
1596
|
super(host, options);
|
|
1554
1597
|
if ((0, CommandClass_1.gotDeserializationOptions)(options)) {
|
|
@@ -1560,6 +1603,8 @@ let UserCodeCCExtendedUserCodeGet = exports.UserCodeCCExtendedUserCodeGet = clas
|
|
|
1560
1603
|
this.reportMore = !!options.reportMore;
|
|
1561
1604
|
}
|
|
1562
1605
|
}
|
|
1606
|
+
userId;
|
|
1607
|
+
reportMore;
|
|
1563
1608
|
serialize() {
|
|
1564
1609
|
this.payload = Buffer.from([0, 0, this.reportMore ? 1 : 0]);
|
|
1565
1610
|
this.payload.writeUInt16BE(this.userId, 0);
|
|
@@ -1575,6 +1620,7 @@ let UserCodeCCExtendedUserCodeGet = exports.UserCodeCCExtendedUserCodeGet = clas
|
|
|
1575
1620
|
};
|
|
1576
1621
|
}
|
|
1577
1622
|
};
|
|
1623
|
+
exports.UserCodeCCExtendedUserCodeGet = UserCodeCCExtendedUserCodeGet;
|
|
1578
1624
|
exports.UserCodeCCExtendedUserCodeGet = UserCodeCCExtendedUserCodeGet = __decorate([
|
|
1579
1625
|
(0, CommandClassDecorators_1.CCCommand)(_Types_1.UserCodeCommand.ExtendedUserCodeGet),
|
|
1580
1626
|
(0, CommandClassDecorators_1.expectedCCResponse)(UserCodeCCExtendedUserCodeReport)
|