@zwave-js/cc 10.20.0 → 11.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/BarrierOperatorCC.d.ts +2 -1
- package/build/cc/BarrierOperatorCC.d.ts.map +1 -1
- package/build/cc/BarrierOperatorCC.js +76 -15
- package/build/cc/BarrierOperatorCC.js.map +1 -1
- package/build/cc/BasicCC.d.ts +2 -1
- package/build/cc/BasicCC.d.ts.map +1 -1
- package/build/cc/BasicCC.js +49 -48
- package/build/cc/BasicCC.js.map +1 -1
- package/build/cc/BatteryCC.d.ts.map +1 -1
- package/build/cc/BatteryCC.js +1 -1
- package/build/cc/BatteryCC.js.map +1 -1
- package/build/cc/BinarySwitchCC.d.ts +2 -1
- package/build/cc/BinarySwitchCC.d.ts.map +1 -1
- package/build/cc/BinarySwitchCC.js +43 -46
- package/build/cc/BinarySwitchCC.js.map +1 -1
- package/build/cc/ColorSwitchCC.js +3 -3
- package/build/cc/ColorSwitchCC.js.map +1 -1
- package/build/cc/ConfigurationCC.d.ts +3 -3
- package/build/cc/ConfigurationCC.d.ts.map +1 -1
- package/build/cc/ConfigurationCC.js +83 -51
- package/build/cc/ConfigurationCC.js.map +1 -1
- package/build/cc/MultiChannelCC.js +1 -1
- package/build/cc/MultiChannelCC.js.map +1 -1
- package/build/cc/MultilevelSwitchCC.d.ts +2 -1
- package/build/cc/MultilevelSwitchCC.d.ts.map +1 -1
- package/build/cc/MultilevelSwitchCC.js +72 -76
- package/build/cc/MultilevelSwitchCC.js.map +1 -1
- package/build/cc/ScheduleEntryLockCC.d.ts +1 -0
- package/build/cc/ScheduleEntryLockCC.d.ts.map +1 -1
- package/build/cc/ScheduleEntryLockCC.js.map +1 -1
- package/build/cc/SoundSwitchCC.d.ts +1 -1
- package/build/cc/VersionCC.js +2 -2
- package/build/cc/VersionCC.js.map +1 -1
- package/build/cc/WindowCoveringCC.d.ts +24 -86
- package/build/cc/WindowCoveringCC.d.ts.map +1 -1
- package/build/cc/WindowCoveringCC.js +134 -198
- package/build/cc/WindowCoveringCC.js.map +1 -1
- package/build/cc/ZWavePlusCC.d.ts +1 -2
- package/build/cc/ZWavePlusCC.d.ts.map +1 -1
- package/build/cc/ZWavePlusCC.js +68 -15
- package/build/cc/ZWavePlusCC.js.map +1 -1
- package/build/lib/API.d.ts +18 -2
- package/build/lib/API.d.ts.map +1 -1
- package/build/lib/API.js +14 -5
- package/build/lib/API.js.map +1 -1
- package/build/lib/CommandClass.js +2 -2
- package/build/lib/CommandClass.js.map +1 -1
- package/package.json +6 -6
|
@@ -463,7 +463,7 @@ exports.ConfigurationCCValues = Object.freeze({
|
|
|
463
463
|
(parameter, bitMask) => parameter, (parameter, bitMask) => bitMask, ({ property, propertyKey }) => typeof property === "number" &&
|
|
464
464
|
(typeof propertyKey === "number" || propertyKey == undefined),
|
|
465
465
|
// Metadata is determined dynamically depending on other factors
|
|
466
|
-
undefined
|
|
466
|
+
undefined),
|
|
467
467
|
}),
|
|
468
468
|
});
|
|
469
469
|
function createConfigurationCCInstance(applHost, endpoint) {
|
|
@@ -551,6 +551,16 @@ function reInterpretSignedValue(value, valueSize, targetFormat) {
|
|
|
551
551
|
serializeValue(raw, 0, valueSize, safe_1.ConfigValueFormat.SignedInteger, value);
|
|
552
552
|
return parseValue(raw, valueSize, targetFormat);
|
|
553
553
|
}
|
|
554
|
+
function getParamInformationFromConfigFile(applHost, nodeId, endpointIndex) {
|
|
555
|
+
const deviceConfig = applHost.getDeviceConfig?.(nodeId);
|
|
556
|
+
if (endpointIndex === 0) {
|
|
557
|
+
return (deviceConfig?.paramInformation ??
|
|
558
|
+
deviceConfig?.endpoints?.get(0)?.paramInformation);
|
|
559
|
+
}
|
|
560
|
+
else {
|
|
561
|
+
return deviceConfig?.endpoints?.get(endpointIndex)?.paramInformation;
|
|
562
|
+
}
|
|
563
|
+
}
|
|
554
564
|
let ConfigurationCCAPI = class ConfigurationCCAPI extends API_1.CCAPI {
|
|
555
565
|
constructor() {
|
|
556
566
|
super(...arguments);
|
|
@@ -692,7 +702,7 @@ let ConfigurationCCAPI = class ConfigurationCCAPI extends API_1.CCAPI {
|
|
|
692
702
|
const { valueBitMask, allowUnexpectedResponse } = options ?? {};
|
|
693
703
|
const cc = new ConfigurationCCGet(this.applHost, {
|
|
694
704
|
nodeId: this.endpoint.nodeId,
|
|
695
|
-
|
|
705
|
+
endpoint: this.endpoint.index,
|
|
696
706
|
parameter,
|
|
697
707
|
allowUnexpectedResponse,
|
|
698
708
|
});
|
|
@@ -709,6 +719,7 @@ let ConfigurationCCAPI = class ConfigurationCCAPI extends API_1.CCAPI {
|
|
|
709
719
|
return (0, safe_1.parsePartial)(response.value, valueBitMask, isSignedPartial(valueBitMask, paramInfo.format));
|
|
710
720
|
}
|
|
711
721
|
this.applHost.controllerLog.logNode(this.endpoint.nodeId, {
|
|
722
|
+
endpoint: this.endpoint.index,
|
|
712
723
|
message: `Received unexpected ConfigurationReport (param = ${response.parameter}, value = ${response.value.toString()})`,
|
|
713
724
|
direction: "inbound",
|
|
714
725
|
level: "error",
|
|
@@ -730,7 +741,7 @@ let ConfigurationCCAPI = class ConfigurationCCAPI extends API_1.CCAPI {
|
|
|
730
741
|
(0, safe_1.isConsecutiveArray)(distinctParameters)) {
|
|
731
742
|
const cc = new ConfigurationCCBulkGet(this.applHost, {
|
|
732
743
|
nodeId: this.endpoint.nodeId,
|
|
733
|
-
|
|
744
|
+
endpoint: this.endpoint.index,
|
|
734
745
|
parameters: distinctParameters,
|
|
735
746
|
});
|
|
736
747
|
const response = await this.applHost.sendCommand(cc, this.commandOptions);
|
|
@@ -743,7 +754,7 @@ let ConfigurationCCAPI = class ConfigurationCCAPI extends API_1.CCAPI {
|
|
|
743
754
|
for (const parameter of distinctParameters) {
|
|
744
755
|
const cc = new ConfigurationCCGet(this.applHost, {
|
|
745
756
|
nodeId: this.endpoint.nodeId,
|
|
746
|
-
|
|
757
|
+
endpoint: this.endpoint.index,
|
|
747
758
|
parameter,
|
|
748
759
|
});
|
|
749
760
|
const response = await this.applHost.sendCommand(cc, this.commandOptions);
|
|
@@ -782,7 +793,7 @@ let ConfigurationCCAPI = class ConfigurationCCAPI extends API_1.CCAPI {
|
|
|
782
793
|
}
|
|
783
794
|
const cc = new ConfigurationCCSet(this.applHost, {
|
|
784
795
|
nodeId: this.endpoint.nodeId,
|
|
785
|
-
|
|
796
|
+
endpoint: this.endpoint.index,
|
|
786
797
|
resetToDefault: false,
|
|
787
798
|
parameter: normalized.parameter,
|
|
788
799
|
value,
|
|
@@ -810,29 +821,48 @@ let ConfigurationCCAPI = class ConfigurationCCAPI extends API_1.CCAPI {
|
|
|
810
821
|
if (canUseBulkSet) {
|
|
811
822
|
const cc = new ConfigurationCCBulkSet(this.applHost, {
|
|
812
823
|
nodeId: this.endpoint.nodeId,
|
|
813
|
-
|
|
824
|
+
endpoint: this.endpoint.index,
|
|
814
825
|
parameters: allParams.map((v) => v.parameter),
|
|
815
826
|
valueSize: allParams[0].valueSize,
|
|
816
827
|
valueFormat: allParams[0].valueFormat,
|
|
817
828
|
values: allParams.map((v) => v.value),
|
|
818
829
|
handshake: true,
|
|
819
830
|
});
|
|
820
|
-
|
|
831
|
+
// The handshake flag is set, so we expect a BulkReport in response
|
|
832
|
+
const result = await this.applHost.sendCommand(cc, this.commandOptions);
|
|
833
|
+
// If we did receive a response, we also received the updated parameters,
|
|
834
|
+
// so if any one was not accepted, we know by looking at the values.
|
|
835
|
+
// Translate the result into a SupervisionResult by comparing the values
|
|
836
|
+
if (result) {
|
|
837
|
+
const sentValues = cc.values;
|
|
838
|
+
const receivedValues = [...result.values.values()];
|
|
839
|
+
const success = sentValues.length === receivedValues.length &&
|
|
840
|
+
sentValues.every((v, i) => v === receivedValues[i]);
|
|
841
|
+
return {
|
|
842
|
+
status: success
|
|
843
|
+
? safe_1.SupervisionStatus.Success
|
|
844
|
+
: safe_1.SupervisionStatus.Fail,
|
|
845
|
+
};
|
|
846
|
+
}
|
|
847
|
+
else {
|
|
848
|
+
return undefined;
|
|
849
|
+
}
|
|
821
850
|
}
|
|
822
851
|
else {
|
|
823
852
|
this.assertSupportsCommand(_Types_1.ConfigurationCommand, _Types_1.ConfigurationCommand.Set);
|
|
853
|
+
const supervisionResults = [];
|
|
824
854
|
for (const { parameter, value, valueSize, valueFormat, } of allParams) {
|
|
825
855
|
const cc = new ConfigurationCCSet(this.applHost, {
|
|
826
856
|
nodeId: this.endpoint.nodeId,
|
|
827
|
-
|
|
857
|
+
endpoint: this.endpoint.index,
|
|
828
858
|
parameter,
|
|
829
859
|
value,
|
|
830
860
|
valueSize,
|
|
831
861
|
valueFormat,
|
|
832
862
|
});
|
|
833
|
-
|
|
834
|
-
await this.applHost.sendCommand(cc, this.commandOptions);
|
|
863
|
+
supervisionResults.push(await this.applHost.sendCommand(cc, this.commandOptions));
|
|
835
864
|
}
|
|
865
|
+
return (0, safe_1.mergeSupervisionResults)(supervisionResults);
|
|
836
866
|
}
|
|
837
867
|
}
|
|
838
868
|
/**
|
|
@@ -849,7 +879,7 @@ let ConfigurationCCAPI = class ConfigurationCCAPI extends API_1.CCAPI {
|
|
|
849
879
|
this.assertSupportsCommand(_Types_1.ConfigurationCommand, _Types_1.ConfigurationCommand.Set);
|
|
850
880
|
const cc = new ConfigurationCCSet(this.applHost, {
|
|
851
881
|
nodeId: this.endpoint.nodeId,
|
|
852
|
-
|
|
882
|
+
endpoint: this.endpoint.index,
|
|
853
883
|
parameter,
|
|
854
884
|
resetToDefault: true,
|
|
855
885
|
});
|
|
@@ -866,7 +896,7 @@ let ConfigurationCCAPI = class ConfigurationCCAPI extends API_1.CCAPI {
|
|
|
866
896
|
this.supportsCommand(_Types_1.ConfigurationCommand.BulkSet)) {
|
|
867
897
|
const cc = new ConfigurationCCBulkSet(this.applHost, {
|
|
868
898
|
nodeId: this.endpoint.nodeId,
|
|
869
|
-
|
|
899
|
+
endpoint: this.endpoint.index,
|
|
870
900
|
parameters,
|
|
871
901
|
resetToDefault: true,
|
|
872
902
|
});
|
|
@@ -876,7 +906,7 @@ let ConfigurationCCAPI = class ConfigurationCCAPI extends API_1.CCAPI {
|
|
|
876
906
|
this.assertSupportsCommand(_Types_1.ConfigurationCommand, _Types_1.ConfigurationCommand.Set);
|
|
877
907
|
const CCs = (0, arrays_1.distinct)(parameters).map((parameter) => new ConfigurationCCSet(this.applHost, {
|
|
878
908
|
nodeId: this.endpoint.nodeId,
|
|
879
|
-
|
|
909
|
+
endpoint: this.endpoint.index,
|
|
880
910
|
parameter,
|
|
881
911
|
resetToDefault: true,
|
|
882
912
|
}));
|
|
@@ -892,7 +922,7 @@ let ConfigurationCCAPI = class ConfigurationCCAPI extends API_1.CCAPI {
|
|
|
892
922
|
this.assertSupportsCommand(_Types_1.ConfigurationCommand, _Types_1.ConfigurationCommand.DefaultReset);
|
|
893
923
|
const cc = new ConfigurationCCDefaultReset(this.applHost, {
|
|
894
924
|
nodeId: this.endpoint.nodeId,
|
|
895
|
-
|
|
925
|
+
endpoint: this.endpoint.index,
|
|
896
926
|
});
|
|
897
927
|
await this.applHost.sendCommand(cc, this.commandOptions);
|
|
898
928
|
}
|
|
@@ -902,7 +932,7 @@ let ConfigurationCCAPI = class ConfigurationCCAPI extends API_1.CCAPI {
|
|
|
902
932
|
this.assertPhysicalEndpoint(this.endpoint);
|
|
903
933
|
const cc = new ConfigurationCCPropertiesGet(this.applHost, {
|
|
904
934
|
nodeId: this.endpoint.nodeId,
|
|
905
|
-
|
|
935
|
+
endpoint: this.endpoint.index,
|
|
906
936
|
parameter,
|
|
907
937
|
});
|
|
908
938
|
const response = await this.applHost.sendCommand(cc, this.commandOptions);
|
|
@@ -928,7 +958,7 @@ let ConfigurationCCAPI = class ConfigurationCCAPI extends API_1.CCAPI {
|
|
|
928
958
|
this.assertPhysicalEndpoint(this.endpoint);
|
|
929
959
|
const cc = new ConfigurationCCNameGet(this.applHost, {
|
|
930
960
|
nodeId: this.endpoint.nodeId,
|
|
931
|
-
|
|
961
|
+
endpoint: this.endpoint.index,
|
|
932
962
|
parameter,
|
|
933
963
|
});
|
|
934
964
|
const response = await this.applHost.sendCommand(cc, this.commandOptions);
|
|
@@ -941,7 +971,7 @@ let ConfigurationCCAPI = class ConfigurationCCAPI extends API_1.CCAPI {
|
|
|
941
971
|
this.assertPhysicalEndpoint(this.endpoint);
|
|
942
972
|
const cc = new ConfigurationCCInfoGet(this.applHost, {
|
|
943
973
|
nodeId: this.endpoint.nodeId,
|
|
944
|
-
|
|
974
|
+
endpoint: this.endpoint.index,
|
|
945
975
|
parameter,
|
|
946
976
|
});
|
|
947
977
|
const response = await this.applHost.sendCommand(cc, this.commandOptions);
|
|
@@ -965,12 +995,16 @@ let ConfigurationCCAPI = class ConfigurationCCAPI extends API_1.CCAPI {
|
|
|
965
995
|
// Get-type commands are only possible in singlecast
|
|
966
996
|
this.assertPhysicalEndpoint(this.endpoint);
|
|
967
997
|
// TODO: Reduce the priority of the messages
|
|
968
|
-
this.applHost.controllerLog.logNode(this.endpoint.nodeId,
|
|
998
|
+
this.applHost.controllerLog.logNode(this.endpoint.nodeId, {
|
|
999
|
+
endpoint: this.endpoint.index,
|
|
1000
|
+
message: `Scanning available parameters...`,
|
|
1001
|
+
});
|
|
969
1002
|
const ccInstance = createConfigurationCCInstance(this.applHost, this.endpoint);
|
|
970
1003
|
for (let param = 1; param <= 255; param++) {
|
|
971
1004
|
// Check if the parameter is readable
|
|
972
1005
|
let originalValue;
|
|
973
1006
|
this.applHost.controllerLog.logNode(this.endpoint.nodeId, {
|
|
1007
|
+
endpoint: this.endpoint.index,
|
|
974
1008
|
message: ` trying param ${param}...`,
|
|
975
1009
|
direction: "outbound",
|
|
976
1010
|
});
|
|
@@ -987,6 +1021,7 @@ let ConfigurationCCAPI = class ConfigurationCCAPI extends API_1.CCAPI {
|
|
|
987
1021
|
valueSize = ${ccInstance.getParamInformation(this.applHost, param).valueSize}
|
|
988
1022
|
value = ${originalValue.toString()}`;
|
|
989
1023
|
this.applHost.controllerLog.logNode(this.endpoint.nodeId, {
|
|
1024
|
+
endpoint: this.endpoint.index,
|
|
990
1025
|
message: logMessage,
|
|
991
1026
|
direction: "inbound",
|
|
992
1027
|
});
|
|
@@ -1024,7 +1059,7 @@ let ConfigurationCC = class ConfigurationCC extends CommandClass_1.CommandClass
|
|
|
1024
1059
|
direction: "none",
|
|
1025
1060
|
});
|
|
1026
1061
|
const deviceConfig = applHost.getDeviceConfig?.(node.id);
|
|
1027
|
-
const paramInfo =
|
|
1062
|
+
const paramInfo = getParamInformationFromConfigFile(applHost, node.id, this.endpointIndex);
|
|
1028
1063
|
if (paramInfo) {
|
|
1029
1064
|
applHost.controllerLog.logNode(node.id, {
|
|
1030
1065
|
endpoint: this.endpointIndex,
|
|
@@ -1033,6 +1068,7 @@ let ConfigurationCC = class ConfigurationCC extends CommandClass_1.CommandClass
|
|
|
1033
1068
|
});
|
|
1034
1069
|
this.deserializeParamInformationFromConfig(applHost, paramInfo);
|
|
1035
1070
|
}
|
|
1071
|
+
const documentedParamNumbers = new Set(Array.from(paramInfo?.keys() ?? []).map((k) => k.parameter));
|
|
1036
1072
|
if (this.version >= 3) {
|
|
1037
1073
|
applHost.controllerLog.logNode(node.id, {
|
|
1038
1074
|
endpoint: this.endpointIndex,
|
|
@@ -1067,14 +1103,16 @@ let ConfigurationCC = class ConfigurationCC extends CommandClass_1.CommandClass
|
|
|
1067
1103
|
direction: "outbound",
|
|
1068
1104
|
});
|
|
1069
1105
|
// Query properties and the next param
|
|
1070
|
-
const props = await api.getProperties(param)
|
|
1106
|
+
const props = await api.getProperties(param).catch(
|
|
1107
|
+
// If querying the properties fails, don't abort the entire interview
|
|
1108
|
+
() => undefined);
|
|
1071
1109
|
if (!props) {
|
|
1072
1110
|
applHost.controllerLog.logNode(node.id, {
|
|
1073
1111
|
endpoint: this.endpointIndex,
|
|
1074
|
-
message: `Querying parameter #${param} information timed out, skipping
|
|
1112
|
+
message: `Querying parameter #${param} information timed out, skipping scan...`,
|
|
1075
1113
|
level: "warn",
|
|
1076
1114
|
});
|
|
1077
|
-
|
|
1115
|
+
break;
|
|
1078
1116
|
}
|
|
1079
1117
|
const { nextParameter, ...properties } = props;
|
|
1080
1118
|
let logMessage;
|
|
@@ -1082,14 +1120,21 @@ let ConfigurationCC = class ConfigurationCC extends CommandClass_1.CommandClass
|
|
|
1082
1120
|
logMessage = `Parameter #${param} is unsupported. Next parameter: ${nextParameter}`;
|
|
1083
1121
|
}
|
|
1084
1122
|
else {
|
|
1085
|
-
// Query name and info only if the parameter is supported, but skip the query for bugged devices
|
|
1086
1123
|
let name;
|
|
1087
|
-
|
|
1088
|
-
|
|
1089
|
-
|
|
1090
|
-
|
|
1091
|
-
|
|
1092
|
-
|
|
1124
|
+
// Query the name and info for parameters that are NOT defined in a config file
|
|
1125
|
+
if (!documentedParamNumbers.has(param)) {
|
|
1126
|
+
// Skip the name query for bugged devices
|
|
1127
|
+
if (!deviceConfig?.compat?.skipConfigurationNameQuery) {
|
|
1128
|
+
name = await api.getName(param).catch(
|
|
1129
|
+
// If querying the name fails, don't abort the entire interview
|
|
1130
|
+
() => undefined);
|
|
1131
|
+
}
|
|
1132
|
+
// Skip the info query for bugged devices
|
|
1133
|
+
if (!deviceConfig?.compat?.skipConfigurationInfoQuery) {
|
|
1134
|
+
await api.getInfo(param).catch(
|
|
1135
|
+
// If querying the info fails, don't abort the entire interview
|
|
1136
|
+
() => undefined);
|
|
1137
|
+
}
|
|
1093
1138
|
}
|
|
1094
1139
|
logMessage = `received information for parameter #${param}:`;
|
|
1095
1140
|
if (name) {
|
|
@@ -1135,7 +1180,7 @@ alters capabilities: ${!!properties.altersCapabilities}`;
|
|
|
1135
1180
|
});
|
|
1136
1181
|
if (this.version < 3) {
|
|
1137
1182
|
// V1/V2: Query all values defined in the config file
|
|
1138
|
-
const paramInfo = applHost
|
|
1183
|
+
const paramInfo = getParamInformationFromConfigFile(applHost, node.id, this.endpointIndex);
|
|
1139
1184
|
if (paramInfo?.size) {
|
|
1140
1185
|
// Because partial params share the same parameter number,
|
|
1141
1186
|
// we need to remember which ones we have already queried.
|
|
@@ -1220,14 +1265,12 @@ alters capabilities: ${!!properties.altersCapabilities}`;
|
|
|
1220
1265
|
// Don't trust param information that a node reports if we have already loaded it from a config file
|
|
1221
1266
|
if (this.isParamInformationFromConfig(applHost))
|
|
1222
1267
|
return;
|
|
1223
|
-
const valueDB = this.getValueDB(applHost);
|
|
1224
|
-
const valueId = exports.ConfigurationCCValues.paramInformation(parameter, valueBitMask).id;
|
|
1225
1268
|
// Retrieve the base metadata
|
|
1226
1269
|
const metadata = this.getParamInformation(applHost, parameter, valueBitMask);
|
|
1227
1270
|
// Override it with new data
|
|
1228
1271
|
Object.assign(metadata, info);
|
|
1229
1272
|
// And store it back
|
|
1230
|
-
|
|
1273
|
+
this.setMetadata(applHost, exports.ConfigurationCCValues.paramInformation(parameter, valueBitMask), metadata);
|
|
1231
1274
|
}
|
|
1232
1275
|
/**
|
|
1233
1276
|
* @internal
|
|
@@ -1257,6 +1300,7 @@ alters capabilities: ${!!properties.altersCapabilities}`;
|
|
|
1257
1300
|
getPartialParamInfos(applHost, parameter) {
|
|
1258
1301
|
const valueDB = this.getValueDB(applHost);
|
|
1259
1302
|
return valueDB.findMetadata((id) => id.commandClass === this.ccId &&
|
|
1303
|
+
(id.endpoint ?? 0) === this.endpointIndex &&
|
|
1260
1304
|
id.property === parameter &&
|
|
1261
1305
|
id.propertyKey != undefined);
|
|
1262
1306
|
}
|
|
@@ -1275,6 +1319,7 @@ alters capabilities: ${!!properties.altersCapabilities}`;
|
|
|
1275
1319
|
const valueDB = this.getValueDB(applHost);
|
|
1276
1320
|
// Add the other values together
|
|
1277
1321
|
const otherValues = valueDB.findValues((id) => id.commandClass === this.ccId &&
|
|
1322
|
+
(id.endpoint ?? 0) === this.endpointIndex &&
|
|
1278
1323
|
id.property === parameter &&
|
|
1279
1324
|
id.propertyKey != undefined &&
|
|
1280
1325
|
!partials.some((p) => id.propertyKey === p.bitMask));
|
|
@@ -1292,7 +1337,8 @@ alters capabilities: ${!!properties.altersCapabilities}`;
|
|
|
1292
1337
|
const valueDB = this.getValueDB(applHost);
|
|
1293
1338
|
// Clear old param information
|
|
1294
1339
|
for (const meta of valueDB.getAllMetadata(this.ccId)) {
|
|
1295
|
-
if (typeof meta.property === "number"
|
|
1340
|
+
if (typeof meta.property === "number" &&
|
|
1341
|
+
(meta.endpoint ?? 0) === this.endpointIndex) {
|
|
1296
1342
|
// this is a param information, delete it
|
|
1297
1343
|
valueDB.setMetadata(meta, undefined,
|
|
1298
1344
|
// Don't emit the added/updated events, as this will spam applications with untranslated events
|
|
@@ -1389,7 +1435,6 @@ let ConfigurationCCReport = class ConfigurationCCReport extends ConfigurationCC
|
|
|
1389
1435
|
persistValues(applHost) {
|
|
1390
1436
|
if (!super.persistValues(applHost))
|
|
1391
1437
|
return false;
|
|
1392
|
-
const valueDB = this.getValueDB(applHost);
|
|
1393
1438
|
// Check if the initial assumption of SignedInteger holds true
|
|
1394
1439
|
const oldParamInformation = this.getParamInformation(applHost, this.parameter);
|
|
1395
1440
|
if (oldParamInformation.format != undefined &&
|
|
@@ -1418,20 +1463,13 @@ let ConfigurationCCReport = class ConfigurationCCReport extends ConfigurationCC
|
|
|
1418
1463
|
if (partialParams.length > 0) {
|
|
1419
1464
|
for (const param of partialParams) {
|
|
1420
1465
|
if (typeof param.propertyKey === "number") {
|
|
1421
|
-
|
|
1422
|
-
commandClass: this.ccId,
|
|
1423
|
-
property: this.parameter,
|
|
1424
|
-
propertyKey: param.propertyKey,
|
|
1425
|
-
}, (0, safe_1.parsePartial)(this.value, param.propertyKey, isSignedPartial(param.propertyKey, param.metadata.format)));
|
|
1466
|
+
this.setValue(applHost, exports.ConfigurationCCValues.paramInformation(this.parameter), (0, safe_1.parsePartial)(this.value, param.propertyKey, isSignedPartial(param.propertyKey, param.metadata.format)));
|
|
1426
1467
|
}
|
|
1427
1468
|
}
|
|
1428
1469
|
}
|
|
1429
1470
|
else {
|
|
1430
1471
|
// This is a single param
|
|
1431
|
-
|
|
1432
|
-
commandClass: this.ccId,
|
|
1433
|
-
property: this.parameter,
|
|
1434
|
-
}, this.value);
|
|
1472
|
+
this.setValue(applHost, exports.ConfigurationCCValues.paramInformation(this.parameter), this.value);
|
|
1435
1473
|
}
|
|
1436
1474
|
return true;
|
|
1437
1475
|
}
|
|
@@ -1702,7 +1740,6 @@ let ConfigurationCCBulkReport = class ConfigurationCCBulkReport extends Configur
|
|
|
1702
1740
|
persistValues(applHost) {
|
|
1703
1741
|
if (!super.persistValues(applHost))
|
|
1704
1742
|
return false;
|
|
1705
|
-
const valueDB = this.getValueDB(applHost);
|
|
1706
1743
|
// Store every received parameter
|
|
1707
1744
|
// eslint-disable-next-line prefer-const
|
|
1708
1745
|
for (let [parameter, value] of this._values.entries()) {
|
|
@@ -1714,10 +1751,7 @@ let ConfigurationCCBulkReport = class ConfigurationCCBulkReport extends Configur
|
|
|
1714
1751
|
value = reInterpretSignedValue(value, this._valueSize, oldParamInformation.format);
|
|
1715
1752
|
this._values.set(parameter, value);
|
|
1716
1753
|
}
|
|
1717
|
-
|
|
1718
|
-
commandClass: this.ccId,
|
|
1719
|
-
property: parameter,
|
|
1720
|
-
}, value);
|
|
1754
|
+
this.setValue(applHost, exports.ConfigurationCCValues.paramInformation(parameter), value);
|
|
1721
1755
|
}
|
|
1722
1756
|
return true;
|
|
1723
1757
|
}
|
|
@@ -1825,7 +1859,6 @@ let ConfigurationCCNameReport = class ConfigurationCCNameReport extends Configur
|
|
|
1825
1859
|
if (!super.persistValues(applHost))
|
|
1826
1860
|
return false;
|
|
1827
1861
|
this.extendParamInformation(applHost, this.parameter, undefined, {
|
|
1828
|
-
name: this.name,
|
|
1829
1862
|
label: this.name,
|
|
1830
1863
|
});
|
|
1831
1864
|
return true;
|
|
@@ -1918,7 +1951,6 @@ let ConfigurationCCInfoReport = class ConfigurationCCInfoReport extends Configur
|
|
|
1918
1951
|
if (!super.persistValues(applHost))
|
|
1919
1952
|
return false;
|
|
1920
1953
|
this.extendParamInformation(applHost, this.parameter, undefined, {
|
|
1921
|
-
info: this.info,
|
|
1922
1954
|
description: this.info,
|
|
1923
1955
|
});
|
|
1924
1956
|
return true;
|