@zwave-js/cc 15.29.0 → 15.31.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/cjs/cc/AlarmSensorCC.d.ts +3 -1
- package/build/cjs/cc/AlarmSensorCC.js +22 -2
- package/build/cjs/cc/AlarmSensorCC.js.map +2 -2
- package/build/cjs/cc/BarrierOperatorCC.d.ts +6 -3
- package/build/cjs/cc/BarrierOperatorCC.js +40 -6
- package/build/cjs/cc/BarrierOperatorCC.js.map +2 -2
- package/build/cjs/cc/CentralSceneCC.d.ts +4 -1
- package/build/cjs/cc/CentralSceneCC.js +34 -2
- package/build/cjs/cc/CentralSceneCC.js.map +2 -2
- package/build/cjs/cc/ClimateControlScheduleCC.d.ts +6 -3
- package/build/cjs/cc/ClimateControlScheduleCC.js +54 -6
- package/build/cjs/cc/ClimateControlScheduleCC.js.map +2 -2
- package/build/cjs/cc/ClockCC.d.ts +2 -1
- package/build/cjs/cc/ClockCC.js +19 -2
- package/build/cjs/cc/ClockCC.js.map +2 -2
- package/build/cjs/cc/ConfigurationCC.d.ts +3 -2
- package/build/cjs/cc/ConfigurationCC.js +61 -4
- package/build/cjs/cc/ConfigurationCC.js.map +2 -2
- package/build/cjs/cc/DoorLockLoggingCC.d.ts +3 -1
- package/build/cjs/cc/DoorLockLoggingCC.js +35 -2
- package/build/cjs/cc/DoorLockLoggingCC.js.map +2 -2
- package/build/cjs/cc/EntryControlCC.d.ts +5 -1
- package/build/cjs/cc/EntryControlCC.js +57 -2
- package/build/cjs/cc/EntryControlCC.js.map +2 -2
- package/build/cjs/cc/HumidityControlModeCC.d.ts +3 -1
- package/build/cjs/cc/HumidityControlModeCC.js +14 -2
- package/build/cjs/cc/HumidityControlModeCC.js.map +2 -2
- package/build/cjs/cc/HumidityControlOperatingStateCC.d.ts +3 -1
- package/build/cjs/cc/HumidityControlOperatingStateCC.js +4 -0
- package/build/cjs/cc/HumidityControlOperatingStateCC.js.map +2 -2
- package/build/cjs/cc/HumidityControlSetpointCC.d.ts +8 -4
- package/build/cjs/cc/HumidityControlSetpointCC.js +51 -8
- package/build/cjs/cc/HumidityControlSetpointCC.js.map +2 -2
- package/build/cjs/cc/IrrigationCC.d.ts +15 -9
- package/build/cjs/cc/IrrigationCC.js +260 -24
- package/build/cjs/cc/IrrigationCC.js.map +2 -2
- package/build/cjs/cc/LanguageCC.d.ts +2 -1
- package/build/cjs/cc/LanguageCC.js +18 -2
- package/build/cjs/cc/LanguageCC.js.map +2 -2
- package/build/cjs/cc/MultiChannelCC.d.ts +2 -1
- package/build/cjs/cc/MultiChannelCC.js +14 -2
- package/build/cjs/cc/MultiChannelCC.js.map +2 -2
- package/build/cjs/cc/SceneActuatorConfigurationCC.d.ts +3 -2
- package/build/cjs/cc/SceneActuatorConfigurationCC.js +38 -5
- package/build/cjs/cc/SceneActuatorConfigurationCC.js.map +2 -2
- package/build/cjs/cc/SceneControllerConfigurationCC.d.ts +3 -2
- package/build/cjs/cc/SceneControllerConfigurationCC.js +25 -4
- package/build/cjs/cc/SceneControllerConfigurationCC.js.map +2 -2
- package/build/cjs/cc/ThermostatFanModeCC.d.ts +3 -1
- package/build/cjs/cc/ThermostatFanModeCC.js +17 -2
- package/build/cjs/cc/ThermostatFanModeCC.js.map +2 -2
- package/build/cjs/cc/ThermostatFanStateCC.d.ts +3 -1
- package/build/cjs/cc/ThermostatFanStateCC.js +4 -0
- package/build/cjs/cc/ThermostatFanStateCC.js.map +2 -2
- package/build/cjs/cc/ThermostatModeCC.js +2 -2
- package/build/cjs/cc/ThermostatModeCC.js.map +2 -2
- package/build/cjs/cc/TimeCC.d.ts +1 -1
- package/build/cjs/cc/TimeCC.js +11 -2
- package/build/cjs/cc/TimeCC.js.map +2 -2
- package/build/cjs/cc/UserCodeCC.d.ts +2 -1
- package/build/cjs/cc/UserCodeCC.js +31 -2
- package/build/cjs/cc/UserCodeCC.js.map +2 -2
- package/build/cjs/cc/VersionCC.d.ts +1 -0
- package/build/cjs/cc/VersionCC.js +32 -0
- package/build/cjs/cc/VersionCC.js.map +2 -2
- package/build/cjs/cc/WakeUpCC.d.ts +2 -0
- package/build/cjs/cc/WakeUpCC.js +14 -0
- package/build/cjs/cc/WakeUpCC.js.map +2 -2
- package/build/cjs/cc/manufacturerProprietary/FibaroCC.d.ts +2 -1
- package/build/cjs/cc/manufacturerProprietary/FibaroCC.js +30 -2
- package/build/cjs/cc/manufacturerProprietary/FibaroCC.js.map +2 -2
- package/build/esm/cc/AlarmSensorCC.d.ts +3 -1
- package/build/esm/cc/AlarmSensorCC.d.ts.map +1 -1
- package/build/esm/cc/AlarmSensorCC.js +25 -7
- package/build/esm/cc/AlarmSensorCC.js.map +1 -1
- package/build/esm/cc/BarrierOperatorCC.d.ts +6 -3
- package/build/esm/cc/BarrierOperatorCC.d.ts.map +1 -1
- package/build/esm/cc/BarrierOperatorCC.js +45 -18
- package/build/esm/cc/BarrierOperatorCC.js.map +1 -1
- package/build/esm/cc/CentralSceneCC.d.ts +4 -1
- package/build/esm/cc/CentralSceneCC.d.ts.map +1 -1
- package/build/esm/cc/CentralSceneCC.js +35 -6
- package/build/esm/cc/CentralSceneCC.js.map +1 -1
- package/build/esm/cc/ClimateControlScheduleCC.d.ts +6 -3
- package/build/esm/cc/ClimateControlScheduleCC.d.ts.map +1 -1
- package/build/esm/cc/ClimateControlScheduleCC.js +57 -16
- package/build/esm/cc/ClimateControlScheduleCC.js.map +1 -1
- package/build/esm/cc/ClockCC.d.ts +2 -1
- package/build/esm/cc/ClockCC.d.ts.map +1 -1
- package/build/esm/cc/ClockCC.js +20 -7
- package/build/esm/cc/ClockCC.js.map +1 -1
- package/build/esm/cc/ConfigurationCC.d.ts +3 -2
- package/build/esm/cc/ConfigurationCC.d.ts.map +1 -1
- package/build/esm/cc/ConfigurationCC.js +63 -12
- package/build/esm/cc/ConfigurationCC.js.map +1 -1
- package/build/esm/cc/DoorLockLoggingCC.d.ts +3 -1
- package/build/esm/cc/DoorLockLoggingCC.d.ts.map +1 -1
- package/build/esm/cc/DoorLockLoggingCC.js +39 -5
- package/build/esm/cc/DoorLockLoggingCC.js.map +1 -1
- package/build/esm/cc/EntryControlCC.d.ts +5 -1
- package/build/esm/cc/EntryControlCC.d.ts.map +1 -1
- package/build/esm/cc/EntryControlCC.js +64 -7
- package/build/esm/cc/EntryControlCC.js.map +1 -1
- package/build/esm/cc/HumidityControlModeCC.d.ts +3 -1
- package/build/esm/cc/HumidityControlModeCC.d.ts.map +1 -1
- package/build/esm/cc/HumidityControlModeCC.js +15 -7
- package/build/esm/cc/HumidityControlModeCC.js.map +1 -1
- package/build/esm/cc/HumidityControlOperatingStateCC.d.ts +3 -1
- package/build/esm/cc/HumidityControlOperatingStateCC.d.ts.map +1 -1
- package/build/esm/cc/HumidityControlOperatingStateCC.js +5 -1
- package/build/esm/cc/HumidityControlOperatingStateCC.js.map +1 -1
- package/build/esm/cc/HumidityControlSetpointCC.d.ts +8 -4
- package/build/esm/cc/HumidityControlSetpointCC.d.ts.map +1 -1
- package/build/esm/cc/HumidityControlSetpointCC.js +52 -25
- package/build/esm/cc/HumidityControlSetpointCC.js.map +1 -1
- package/build/esm/cc/IrrigationCC.d.ts +15 -9
- package/build/esm/cc/IrrigationCC.d.ts.map +1 -1
- package/build/esm/cc/IrrigationCC.js +268 -61
- package/build/esm/cc/IrrigationCC.js.map +1 -1
- package/build/esm/cc/LanguageCC.d.ts +2 -1
- package/build/esm/cc/LanguageCC.d.ts.map +1 -1
- package/build/esm/cc/LanguageCC.js +18 -6
- package/build/esm/cc/LanguageCC.js.map +1 -1
- package/build/esm/cc/MultiChannelCC.d.ts +2 -1
- package/build/esm/cc/MultiChannelCC.d.ts.map +1 -1
- package/build/esm/cc/MultiChannelCC.js +15 -7
- package/build/esm/cc/MultiChannelCC.js.map +1 -1
- package/build/esm/cc/SceneActuatorConfigurationCC.d.ts +3 -2
- package/build/esm/cc/SceneActuatorConfigurationCC.d.ts.map +1 -1
- package/build/esm/cc/SceneActuatorConfigurationCC.js +39 -13
- package/build/esm/cc/SceneActuatorConfigurationCC.js.map +1 -1
- package/build/esm/cc/SceneControllerConfigurationCC.d.ts +3 -2
- package/build/esm/cc/SceneControllerConfigurationCC.d.ts.map +1 -1
- package/build/esm/cc/SceneControllerConfigurationCC.js +25 -12
- package/build/esm/cc/SceneControllerConfigurationCC.js.map +1 -1
- package/build/esm/cc/ThermostatFanModeCC.d.ts +3 -1
- package/build/esm/cc/ThermostatFanModeCC.d.ts.map +1 -1
- package/build/esm/cc/ThermostatFanModeCC.js +18 -7
- package/build/esm/cc/ThermostatFanModeCC.js.map +1 -1
- package/build/esm/cc/ThermostatFanStateCC.d.ts +3 -1
- package/build/esm/cc/ThermostatFanStateCC.d.ts.map +1 -1
- package/build/esm/cc/ThermostatFanStateCC.js +5 -1
- package/build/esm/cc/ThermostatFanStateCC.js.map +1 -1
- package/build/esm/cc/ThermostatModeCC.js +2 -2
- package/build/esm/cc/ThermostatModeCC.js.map +1 -1
- package/build/esm/cc/TimeCC.d.ts +1 -1
- package/build/esm/cc/TimeCC.d.ts.map +1 -1
- package/build/esm/cc/TimeCC.js +12 -7
- package/build/esm/cc/TimeCC.js.map +1 -1
- package/build/esm/cc/UserCodeCC.d.ts +2 -1
- package/build/esm/cc/UserCodeCC.d.ts.map +1 -1
- package/build/esm/cc/UserCodeCC.js +31 -6
- package/build/esm/cc/UserCodeCC.js.map +1 -1
- package/build/esm/cc/VersionCC.d.ts +1 -0
- package/build/esm/cc/VersionCC.d.ts.map +1 -1
- package/build/esm/cc/VersionCC.js +34 -0
- package/build/esm/cc/VersionCC.js.map +1 -1
- package/build/esm/cc/WakeUpCC.d.ts +2 -0
- package/build/esm/cc/WakeUpCC.d.ts.map +1 -1
- package/build/esm/cc/WakeUpCC.js +14 -0
- package/build/esm/cc/WakeUpCC.js.map +1 -1
- package/build/esm/cc/manufacturerProprietary/FibaroCC.d.ts +2 -1
- package/build/esm/cc/manufacturerProprietary/FibaroCC.d.ts.map +1 -1
- package/build/esm/cc/manufacturerProprietary/FibaroCC.js +34 -4
- package/build/esm/cc/manufacturerProprietary/FibaroCC.js.map +1 -1
- package/package.json +2 -2
|
@@ -643,6 +643,15 @@ let IrrigationCCSystemInfoReport = (() => {
|
|
|
643
643
|
numValveTables;
|
|
644
644
|
supportsMasterValve;
|
|
645
645
|
maxValveTableSize;
|
|
646
|
+
serialize(ctx) {
|
|
647
|
+
this.payload = Bytes.from([
|
|
648
|
+
this.supportsMasterValve ? 1 : 0,
|
|
649
|
+
this.numValves,
|
|
650
|
+
this.numValveTables,
|
|
651
|
+
this.maxValveTableSize & 0b1111,
|
|
652
|
+
]);
|
|
653
|
+
return super.serialize(ctx);
|
|
654
|
+
}
|
|
646
655
|
toLogEntry(ctx) {
|
|
647
656
|
return {
|
|
648
657
|
...super.toLogEntry(ctx),
|
|
@@ -781,6 +790,40 @@ let IrrigationCCSystemStatusReport = (() => {
|
|
|
781
790
|
errorValve;
|
|
782
791
|
masterValveOpen;
|
|
783
792
|
firstOpenZoneId;
|
|
793
|
+
serialize(ctx) {
|
|
794
|
+
let sensorFlags = 0;
|
|
795
|
+
if (this.flowSensorActive)
|
|
796
|
+
sensorFlags |= 0x01;
|
|
797
|
+
if (this.pressureSensorActive)
|
|
798
|
+
sensorFlags |= 0x02;
|
|
799
|
+
if (this.rainSensorActive)
|
|
800
|
+
sensorFlags |= 0x04;
|
|
801
|
+
if (this.moistureSensorActive)
|
|
802
|
+
sensorFlags |= 0x08;
|
|
803
|
+
let errorFlags = 0;
|
|
804
|
+
if (this.errorNotProgrammed)
|
|
805
|
+
errorFlags |= 0x01;
|
|
806
|
+
if (this.errorEmergencyShutdown)
|
|
807
|
+
errorFlags |= 0x02;
|
|
808
|
+
if (this.errorHighPressure)
|
|
809
|
+
errorFlags |= 0x04;
|
|
810
|
+
if (this.errorLowPressure)
|
|
811
|
+
errorFlags |= 0x08;
|
|
812
|
+
if (this.errorValve)
|
|
813
|
+
errorFlags |= 0x10;
|
|
814
|
+
this.payload = Bytes.concat([
|
|
815
|
+
[this.systemVoltage, sensorFlags],
|
|
816
|
+
encodeFloatWithScale(this.flow ?? 0, 0),
|
|
817
|
+
encodeFloatWithScale(this.pressure ?? 0, 0),
|
|
818
|
+
[
|
|
819
|
+
this.shutoffDuration,
|
|
820
|
+
errorFlags,
|
|
821
|
+
this.masterValveOpen ? 1 : 0,
|
|
822
|
+
this.firstOpenZoneId ?? 0,
|
|
823
|
+
],
|
|
824
|
+
]);
|
|
825
|
+
return super.serialize(ctx);
|
|
826
|
+
}
|
|
784
827
|
toLogEntry(ctx) {
|
|
785
828
|
const message = {
|
|
786
829
|
"system voltage": `${this.systemVoltage} V`,
|
|
@@ -871,12 +914,40 @@ let IrrigationCCSystemConfigSet = (() => {
|
|
|
871
914
|
this.rainSensorPolarity = options.rainSensorPolarity;
|
|
872
915
|
this.moistureSensorPolarity = options.moistureSensorPolarity;
|
|
873
916
|
}
|
|
874
|
-
static from(
|
|
875
|
-
|
|
876
|
-
|
|
877
|
-
|
|
878
|
-
|
|
879
|
-
|
|
917
|
+
static from(raw, ctx) {
|
|
918
|
+
validatePayload(raw.payload.length >= 2);
|
|
919
|
+
const masterValveDelay = raw.payload[0];
|
|
920
|
+
let offset = 1;
|
|
921
|
+
let highPressureThreshold;
|
|
922
|
+
{
|
|
923
|
+
const { value, scale, bytesRead } = parseFloatWithScale(raw.payload.subarray(offset));
|
|
924
|
+
validatePayload(scale === 0);
|
|
925
|
+
highPressureThreshold = value;
|
|
926
|
+
offset += bytesRead;
|
|
927
|
+
}
|
|
928
|
+
let lowPressureThreshold;
|
|
929
|
+
{
|
|
930
|
+
const { value, scale, bytesRead } = parseFloatWithScale(raw.payload.subarray(offset));
|
|
931
|
+
validatePayload(scale === 0);
|
|
932
|
+
lowPressureThreshold = value;
|
|
933
|
+
offset += bytesRead;
|
|
934
|
+
}
|
|
935
|
+
validatePayload(raw.payload.length >= offset + 1);
|
|
936
|
+
const polarity = raw.payload[offset];
|
|
937
|
+
let rainSensorPolarity;
|
|
938
|
+
let moistureSensorPolarity;
|
|
939
|
+
if (!!(polarity & 128)) {
|
|
940
|
+
rainSensorPolarity = polarity & 0b1;
|
|
941
|
+
moistureSensorPolarity = (polarity & 0b10) >>> 1;
|
|
942
|
+
}
|
|
943
|
+
return new this({
|
|
944
|
+
nodeId: ctx.sourceNodeId,
|
|
945
|
+
masterValveDelay,
|
|
946
|
+
highPressureThreshold,
|
|
947
|
+
lowPressureThreshold,
|
|
948
|
+
rainSensorPolarity,
|
|
949
|
+
moistureSensorPolarity,
|
|
950
|
+
});
|
|
880
951
|
}
|
|
881
952
|
masterValveDelay;
|
|
882
953
|
highPressureThreshold;
|
|
@@ -884,13 +955,10 @@ let IrrigationCCSystemConfigSet = (() => {
|
|
|
884
955
|
rainSensorPolarity;
|
|
885
956
|
moistureSensorPolarity;
|
|
886
957
|
serialize(ctx) {
|
|
887
|
-
let polarity = 0
|
|
888
|
-
|
|
889
|
-
|
|
890
|
-
|
|
891
|
-
polarity |= 0b10;
|
|
892
|
-
if (this.rainSensorPolarity == undefined
|
|
893
|
-
&& this.moistureSensorPolarity == undefined) {
|
|
958
|
+
let polarity = (this.rainSensorPolarity ?? 0)
|
|
959
|
+
| ((this.moistureSensorPolarity ?? 0) << 1);
|
|
960
|
+
if (this.rainSensorPolarity != undefined
|
|
961
|
+
|| this.moistureSensorPolarity != undefined) {
|
|
894
962
|
// Valid bit
|
|
895
963
|
polarity |= 128;
|
|
896
964
|
}
|
|
@@ -988,6 +1056,21 @@ let IrrigationCCSystemConfigReport = (() => {
|
|
|
988
1056
|
lowPressureThreshold;
|
|
989
1057
|
rainSensorPolarity;
|
|
990
1058
|
moistureSensorPolarity;
|
|
1059
|
+
serialize(ctx) {
|
|
1060
|
+
let polarity = (this.rainSensorPolarity ?? 0)
|
|
1061
|
+
| ((this.moistureSensorPolarity ?? 0) << 1);
|
|
1062
|
+
if (this.rainSensorPolarity != undefined
|
|
1063
|
+
|| this.moistureSensorPolarity != undefined) {
|
|
1064
|
+
polarity |= 128;
|
|
1065
|
+
}
|
|
1066
|
+
this.payload = Bytes.concat([
|
|
1067
|
+
[this.masterValveDelay],
|
|
1068
|
+
encodeFloatWithScale(this.highPressureThreshold, 0),
|
|
1069
|
+
encodeFloatWithScale(this.lowPressureThreshold, 0),
|
|
1070
|
+
[polarity],
|
|
1071
|
+
]);
|
|
1072
|
+
return super.serialize(ctx);
|
|
1073
|
+
}
|
|
991
1074
|
toLogEntry(ctx) {
|
|
992
1075
|
const message = {
|
|
993
1076
|
"master valve delay": `${this.masterValveDelay} s`,
|
|
@@ -1100,6 +1183,35 @@ let IrrigationCCValveInfoReport = (() => {
|
|
|
1100
1183
|
errorMaximumFlow;
|
|
1101
1184
|
errorHighFlow;
|
|
1102
1185
|
errorLowFlow;
|
|
1186
|
+
serialize(ctx) {
|
|
1187
|
+
let byte0 = 0;
|
|
1188
|
+
if (this.valveId === "master")
|
|
1189
|
+
byte0 |= 0b1;
|
|
1190
|
+
if (this.connected)
|
|
1191
|
+
byte0 |= 0b10;
|
|
1192
|
+
let errorFlags = 0;
|
|
1193
|
+
if (this.errorShortCircuit)
|
|
1194
|
+
errorFlags |= 0b1;
|
|
1195
|
+
if (this.errorHighCurrent)
|
|
1196
|
+
errorFlags |= 0b10;
|
|
1197
|
+
if (this.errorLowCurrent)
|
|
1198
|
+
errorFlags |= 0b100;
|
|
1199
|
+
if (this.valveId === "master") {
|
|
1200
|
+
if (this.errorMaximumFlow)
|
|
1201
|
+
errorFlags |= 0b1000;
|
|
1202
|
+
if (this.errorHighFlow)
|
|
1203
|
+
errorFlags |= 16;
|
|
1204
|
+
if (this.errorLowFlow)
|
|
1205
|
+
errorFlags |= 32;
|
|
1206
|
+
}
|
|
1207
|
+
this.payload = Bytes.from([
|
|
1208
|
+
byte0,
|
|
1209
|
+
this.valveId === "master" ? 1 : this.valveId,
|
|
1210
|
+
Math.floor(this.nominalCurrent / 10),
|
|
1211
|
+
errorFlags,
|
|
1212
|
+
]);
|
|
1213
|
+
return super.serialize(ctx);
|
|
1214
|
+
}
|
|
1103
1215
|
persistValues(ctx) {
|
|
1104
1216
|
if (!super.persistValues(ctx))
|
|
1105
1217
|
return false;
|
|
@@ -1188,12 +1300,19 @@ let IrrigationCCValveInfoGet = (() => {
|
|
|
1188
1300
|
super(options);
|
|
1189
1301
|
this.valveId = options.valveId;
|
|
1190
1302
|
}
|
|
1191
|
-
static from(
|
|
1192
|
-
|
|
1193
|
-
|
|
1194
|
-
|
|
1195
|
-
|
|
1196
|
-
|
|
1303
|
+
static from(raw, ctx) {
|
|
1304
|
+
validatePayload(raw.payload.length >= 2);
|
|
1305
|
+
let valveId;
|
|
1306
|
+
if (raw.payload[0] & 0b1) {
|
|
1307
|
+
valveId = "master";
|
|
1308
|
+
}
|
|
1309
|
+
else {
|
|
1310
|
+
valveId = raw.payload[1];
|
|
1311
|
+
}
|
|
1312
|
+
return new this({
|
|
1313
|
+
nodeId: ctx.sourceNodeId,
|
|
1314
|
+
valveId,
|
|
1315
|
+
});
|
|
1197
1316
|
}
|
|
1198
1317
|
valveId;
|
|
1199
1318
|
serialize(ctx) {
|
|
@@ -1241,12 +1360,53 @@ let IrrigationCCValveConfigSet = (() => {
|
|
|
1241
1360
|
this.useRainSensor = options.useRainSensor;
|
|
1242
1361
|
this.useMoistureSensor = options.useMoistureSensor;
|
|
1243
1362
|
}
|
|
1244
|
-
static from(
|
|
1245
|
-
|
|
1246
|
-
|
|
1247
|
-
|
|
1248
|
-
|
|
1249
|
-
|
|
1363
|
+
static from(raw, ctx) {
|
|
1364
|
+
validatePayload(raw.payload.length >= 4);
|
|
1365
|
+
let valveId;
|
|
1366
|
+
if (raw.payload[0] & 0b1) {
|
|
1367
|
+
valveId = "master";
|
|
1368
|
+
}
|
|
1369
|
+
else {
|
|
1370
|
+
valveId = raw.payload[1];
|
|
1371
|
+
}
|
|
1372
|
+
const nominalCurrentHighThreshold = 10 * raw.payload[2];
|
|
1373
|
+
const nominalCurrentLowThreshold = 10 * raw.payload[3];
|
|
1374
|
+
let offset = 4;
|
|
1375
|
+
let maximumFlow;
|
|
1376
|
+
{
|
|
1377
|
+
const { value, scale, bytesRead } = parseFloatWithScale(raw.payload.subarray(offset));
|
|
1378
|
+
validatePayload(scale === 0);
|
|
1379
|
+
maximumFlow = value;
|
|
1380
|
+
offset += bytesRead;
|
|
1381
|
+
}
|
|
1382
|
+
let highFlowThreshold;
|
|
1383
|
+
{
|
|
1384
|
+
const { value, scale, bytesRead } = parseFloatWithScale(raw.payload.subarray(offset));
|
|
1385
|
+
validatePayload(scale === 0);
|
|
1386
|
+
highFlowThreshold = value;
|
|
1387
|
+
offset += bytesRead;
|
|
1388
|
+
}
|
|
1389
|
+
let lowFlowThreshold;
|
|
1390
|
+
{
|
|
1391
|
+
const { value, scale, bytesRead } = parseFloatWithScale(raw.payload.subarray(offset));
|
|
1392
|
+
validatePayload(scale === 0);
|
|
1393
|
+
lowFlowThreshold = value;
|
|
1394
|
+
offset += bytesRead;
|
|
1395
|
+
}
|
|
1396
|
+
validatePayload(raw.payload.length >= offset + 1);
|
|
1397
|
+
const useRainSensor = !!(raw.payload[offset] & 0b1);
|
|
1398
|
+
const useMoistureSensor = !!(raw.payload[offset] & 0b10);
|
|
1399
|
+
return new this({
|
|
1400
|
+
nodeId: ctx.sourceNodeId,
|
|
1401
|
+
valveId,
|
|
1402
|
+
nominalCurrentHighThreshold,
|
|
1403
|
+
nominalCurrentLowThreshold,
|
|
1404
|
+
maximumFlow,
|
|
1405
|
+
highFlowThreshold,
|
|
1406
|
+
lowFlowThreshold,
|
|
1407
|
+
useRainSensor,
|
|
1408
|
+
useMoistureSensor,
|
|
1409
|
+
});
|
|
1250
1410
|
}
|
|
1251
1411
|
valveId;
|
|
1252
1412
|
nominalCurrentHighThreshold;
|
|
@@ -1409,6 +1569,26 @@ let IrrigationCCValveConfigReport = (() => {
|
|
|
1409
1569
|
lowFlowThreshold;
|
|
1410
1570
|
useRainSensor;
|
|
1411
1571
|
useMoistureSensor;
|
|
1572
|
+
serialize(ctx) {
|
|
1573
|
+
let sensorFlags = 0;
|
|
1574
|
+
if (this.useRainSensor)
|
|
1575
|
+
sensorFlags |= 0b1;
|
|
1576
|
+
if (this.useMoistureSensor)
|
|
1577
|
+
sensorFlags |= 0b10;
|
|
1578
|
+
this.payload = Bytes.concat([
|
|
1579
|
+
[
|
|
1580
|
+
this.valveId === "master" ? 1 : 0,
|
|
1581
|
+
this.valveId === "master" ? 1 : this.valveId,
|
|
1582
|
+
Math.floor(this.nominalCurrentHighThreshold / 10),
|
|
1583
|
+
Math.floor(this.nominalCurrentLowThreshold / 10),
|
|
1584
|
+
],
|
|
1585
|
+
encodeFloatWithScale(this.maximumFlow, 0),
|
|
1586
|
+
encodeFloatWithScale(this.highFlowThreshold, 0),
|
|
1587
|
+
encodeFloatWithScale(this.lowFlowThreshold, 0),
|
|
1588
|
+
[sensorFlags],
|
|
1589
|
+
]);
|
|
1590
|
+
return super.serialize(ctx);
|
|
1591
|
+
}
|
|
1412
1592
|
toLogEntry(ctx) {
|
|
1413
1593
|
return {
|
|
1414
1594
|
...super.toLogEntry(ctx),
|
|
@@ -1447,12 +1627,19 @@ let IrrigationCCValveConfigGet = (() => {
|
|
|
1447
1627
|
super(options);
|
|
1448
1628
|
this.valveId = options.valveId;
|
|
1449
1629
|
}
|
|
1450
|
-
static from(
|
|
1451
|
-
|
|
1452
|
-
|
|
1453
|
-
|
|
1454
|
-
|
|
1455
|
-
|
|
1630
|
+
static from(raw, ctx) {
|
|
1631
|
+
validatePayload(raw.payload.length >= 2);
|
|
1632
|
+
let valveId;
|
|
1633
|
+
if (raw.payload[0] & 0b1) {
|
|
1634
|
+
valveId = "master";
|
|
1635
|
+
}
|
|
1636
|
+
else {
|
|
1637
|
+
valveId = raw.payload[1];
|
|
1638
|
+
}
|
|
1639
|
+
return new this({
|
|
1640
|
+
nodeId: ctx.sourceNodeId,
|
|
1641
|
+
valveId,
|
|
1642
|
+
});
|
|
1456
1643
|
}
|
|
1457
1644
|
valveId;
|
|
1458
1645
|
serialize(ctx) {
|
|
@@ -1494,12 +1681,21 @@ let IrrigationCCValveRun = (() => {
|
|
|
1494
1681
|
this.valveId = options.valveId;
|
|
1495
1682
|
this.duration = options.duration;
|
|
1496
1683
|
}
|
|
1497
|
-
static from(
|
|
1498
|
-
|
|
1499
|
-
|
|
1500
|
-
|
|
1501
|
-
|
|
1502
|
-
|
|
1684
|
+
static from(raw, ctx) {
|
|
1685
|
+
validatePayload(raw.payload.length >= 4);
|
|
1686
|
+
let valveId;
|
|
1687
|
+
if (raw.payload[0] & 0b1) {
|
|
1688
|
+
valveId = "master";
|
|
1689
|
+
}
|
|
1690
|
+
else {
|
|
1691
|
+
valveId = raw.payload[1];
|
|
1692
|
+
}
|
|
1693
|
+
const duration = raw.payload.readUInt16BE(2);
|
|
1694
|
+
return new this({
|
|
1695
|
+
nodeId: ctx.sourceNodeId,
|
|
1696
|
+
valveId,
|
|
1697
|
+
duration,
|
|
1698
|
+
});
|
|
1503
1699
|
}
|
|
1504
1700
|
valveId;
|
|
1505
1701
|
duration;
|
|
@@ -1552,12 +1748,13 @@ let IrrigationCCValveTableSet = (() => {
|
|
|
1552
1748
|
this.tableId = options.tableId;
|
|
1553
1749
|
this.entries = options.entries;
|
|
1554
1750
|
}
|
|
1555
|
-
static from(
|
|
1556
|
-
|
|
1557
|
-
|
|
1558
|
-
|
|
1559
|
-
|
|
1560
|
-
|
|
1751
|
+
static from(raw, ctx) {
|
|
1752
|
+
const report = IrrigationCCValveTableReport.from(raw, ctx);
|
|
1753
|
+
return new this({
|
|
1754
|
+
nodeId: ctx.sourceNodeId,
|
|
1755
|
+
tableId: report.tableId,
|
|
1756
|
+
entries: report.entries,
|
|
1757
|
+
});
|
|
1561
1758
|
}
|
|
1562
1759
|
tableId;
|
|
1563
1760
|
entries;
|
|
@@ -1634,6 +1831,16 @@ let IrrigationCCValveTableReport = (() => {
|
|
|
1634
1831
|
}
|
|
1635
1832
|
tableId;
|
|
1636
1833
|
entries;
|
|
1834
|
+
serialize(ctx) {
|
|
1835
|
+
this.payload = new Bytes(1 + this.entries.length * 3);
|
|
1836
|
+
this.payload[0] = this.tableId;
|
|
1837
|
+
for (let i = 0; i < this.entries.length; i++) {
|
|
1838
|
+
const offset = 1 + i * 3;
|
|
1839
|
+
this.payload[offset] = this.entries[i].valveId;
|
|
1840
|
+
this.payload.writeUInt16BE(this.entries[i].duration, offset + 1);
|
|
1841
|
+
}
|
|
1842
|
+
return super.serialize(ctx);
|
|
1843
|
+
}
|
|
1637
1844
|
toLogEntry(ctx) {
|
|
1638
1845
|
const message = {
|
|
1639
1846
|
"table ID": this.tableId,
|
|
@@ -1679,12 +1886,12 @@ let IrrigationCCValveTableGet = (() => {
|
|
|
1679
1886
|
super(options);
|
|
1680
1887
|
this.tableId = options.tableId;
|
|
1681
1888
|
}
|
|
1682
|
-
static from(
|
|
1683
|
-
|
|
1684
|
-
|
|
1685
|
-
|
|
1686
|
-
|
|
1687
|
-
|
|
1889
|
+
static from(raw, ctx) {
|
|
1890
|
+
validatePayload(raw.payload.length >= 1);
|
|
1891
|
+
return new this({
|
|
1892
|
+
nodeId: ctx.sourceNodeId,
|
|
1893
|
+
tableId: raw.payload[0],
|
|
1894
|
+
});
|
|
1688
1895
|
}
|
|
1689
1896
|
tableId;
|
|
1690
1897
|
serialize(ctx) {
|
|
@@ -1725,12 +1932,12 @@ let IrrigationCCValveTableRun = (() => {
|
|
|
1725
1932
|
throw new ZWaveError(`${this.constructor.name}: At least one table ID must be specified.`, ZWaveErrorCodes.Argument_Invalid);
|
|
1726
1933
|
}
|
|
1727
1934
|
}
|
|
1728
|
-
static from(
|
|
1729
|
-
|
|
1730
|
-
|
|
1731
|
-
|
|
1732
|
-
|
|
1733
|
-
|
|
1935
|
+
static from(raw, ctx) {
|
|
1936
|
+
validatePayload(raw.payload.length >= 1);
|
|
1937
|
+
return new this({
|
|
1938
|
+
nodeId: ctx.sourceNodeId,
|
|
1939
|
+
tableIDs: [...raw.payload],
|
|
1940
|
+
});
|
|
1734
1941
|
}
|
|
1735
1942
|
tableIDs;
|
|
1736
1943
|
serialize(ctx) {
|
|
@@ -1770,12 +1977,12 @@ let IrrigationCCSystemShutoff = (() => {
|
|
|
1770
1977
|
super(options);
|
|
1771
1978
|
this.duration = options.duration;
|
|
1772
1979
|
}
|
|
1773
|
-
static from(
|
|
1774
|
-
|
|
1775
|
-
|
|
1776
|
-
|
|
1777
|
-
|
|
1778
|
-
|
|
1980
|
+
static from(raw, ctx) {
|
|
1981
|
+
validatePayload(raw.payload.length >= 1);
|
|
1982
|
+
return new this({
|
|
1983
|
+
nodeId: ctx.sourceNodeId,
|
|
1984
|
+
duration: raw.payload[0],
|
|
1985
|
+
});
|
|
1779
1986
|
}
|
|
1780
1987
|
duration;
|
|
1781
1988
|
serialize(ctx) {
|