@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.
Files changed (166) hide show
  1. package/build/cjs/cc/AlarmSensorCC.d.ts +3 -1
  2. package/build/cjs/cc/AlarmSensorCC.js +22 -2
  3. package/build/cjs/cc/AlarmSensorCC.js.map +2 -2
  4. package/build/cjs/cc/BarrierOperatorCC.d.ts +6 -3
  5. package/build/cjs/cc/BarrierOperatorCC.js +40 -6
  6. package/build/cjs/cc/BarrierOperatorCC.js.map +2 -2
  7. package/build/cjs/cc/CentralSceneCC.d.ts +4 -1
  8. package/build/cjs/cc/CentralSceneCC.js +34 -2
  9. package/build/cjs/cc/CentralSceneCC.js.map +2 -2
  10. package/build/cjs/cc/ClimateControlScheduleCC.d.ts +6 -3
  11. package/build/cjs/cc/ClimateControlScheduleCC.js +54 -6
  12. package/build/cjs/cc/ClimateControlScheduleCC.js.map +2 -2
  13. package/build/cjs/cc/ClockCC.d.ts +2 -1
  14. package/build/cjs/cc/ClockCC.js +19 -2
  15. package/build/cjs/cc/ClockCC.js.map +2 -2
  16. package/build/cjs/cc/ConfigurationCC.d.ts +3 -2
  17. package/build/cjs/cc/ConfigurationCC.js +61 -4
  18. package/build/cjs/cc/ConfigurationCC.js.map +2 -2
  19. package/build/cjs/cc/DoorLockLoggingCC.d.ts +3 -1
  20. package/build/cjs/cc/DoorLockLoggingCC.js +35 -2
  21. package/build/cjs/cc/DoorLockLoggingCC.js.map +2 -2
  22. package/build/cjs/cc/EntryControlCC.d.ts +5 -1
  23. package/build/cjs/cc/EntryControlCC.js +57 -2
  24. package/build/cjs/cc/EntryControlCC.js.map +2 -2
  25. package/build/cjs/cc/HumidityControlModeCC.d.ts +3 -1
  26. package/build/cjs/cc/HumidityControlModeCC.js +14 -2
  27. package/build/cjs/cc/HumidityControlModeCC.js.map +2 -2
  28. package/build/cjs/cc/HumidityControlOperatingStateCC.d.ts +3 -1
  29. package/build/cjs/cc/HumidityControlOperatingStateCC.js +4 -0
  30. package/build/cjs/cc/HumidityControlOperatingStateCC.js.map +2 -2
  31. package/build/cjs/cc/HumidityControlSetpointCC.d.ts +8 -4
  32. package/build/cjs/cc/HumidityControlSetpointCC.js +51 -8
  33. package/build/cjs/cc/HumidityControlSetpointCC.js.map +2 -2
  34. package/build/cjs/cc/IrrigationCC.d.ts +15 -9
  35. package/build/cjs/cc/IrrigationCC.js +260 -24
  36. package/build/cjs/cc/IrrigationCC.js.map +2 -2
  37. package/build/cjs/cc/LanguageCC.d.ts +2 -1
  38. package/build/cjs/cc/LanguageCC.js +18 -2
  39. package/build/cjs/cc/LanguageCC.js.map +2 -2
  40. package/build/cjs/cc/MultiChannelCC.d.ts +2 -1
  41. package/build/cjs/cc/MultiChannelCC.js +14 -2
  42. package/build/cjs/cc/MultiChannelCC.js.map +2 -2
  43. package/build/cjs/cc/SceneActuatorConfigurationCC.d.ts +3 -2
  44. package/build/cjs/cc/SceneActuatorConfigurationCC.js +38 -5
  45. package/build/cjs/cc/SceneActuatorConfigurationCC.js.map +2 -2
  46. package/build/cjs/cc/SceneControllerConfigurationCC.d.ts +3 -2
  47. package/build/cjs/cc/SceneControllerConfigurationCC.js +25 -4
  48. package/build/cjs/cc/SceneControllerConfigurationCC.js.map +2 -2
  49. package/build/cjs/cc/ThermostatFanModeCC.d.ts +3 -1
  50. package/build/cjs/cc/ThermostatFanModeCC.js +17 -2
  51. package/build/cjs/cc/ThermostatFanModeCC.js.map +2 -2
  52. package/build/cjs/cc/ThermostatFanStateCC.d.ts +3 -1
  53. package/build/cjs/cc/ThermostatFanStateCC.js +4 -0
  54. package/build/cjs/cc/ThermostatFanStateCC.js.map +2 -2
  55. package/build/cjs/cc/ThermostatModeCC.js +2 -2
  56. package/build/cjs/cc/ThermostatModeCC.js.map +2 -2
  57. package/build/cjs/cc/TimeCC.d.ts +1 -1
  58. package/build/cjs/cc/TimeCC.js +11 -2
  59. package/build/cjs/cc/TimeCC.js.map +2 -2
  60. package/build/cjs/cc/UserCodeCC.d.ts +2 -1
  61. package/build/cjs/cc/UserCodeCC.js +31 -2
  62. package/build/cjs/cc/UserCodeCC.js.map +2 -2
  63. package/build/cjs/cc/VersionCC.d.ts +1 -0
  64. package/build/cjs/cc/VersionCC.js +32 -0
  65. package/build/cjs/cc/VersionCC.js.map +2 -2
  66. package/build/cjs/cc/WakeUpCC.d.ts +2 -0
  67. package/build/cjs/cc/WakeUpCC.js +14 -0
  68. package/build/cjs/cc/WakeUpCC.js.map +2 -2
  69. package/build/cjs/cc/manufacturerProprietary/FibaroCC.d.ts +2 -1
  70. package/build/cjs/cc/manufacturerProprietary/FibaroCC.js +30 -2
  71. package/build/cjs/cc/manufacturerProprietary/FibaroCC.js.map +2 -2
  72. package/build/esm/cc/AlarmSensorCC.d.ts +3 -1
  73. package/build/esm/cc/AlarmSensorCC.d.ts.map +1 -1
  74. package/build/esm/cc/AlarmSensorCC.js +25 -7
  75. package/build/esm/cc/AlarmSensorCC.js.map +1 -1
  76. package/build/esm/cc/BarrierOperatorCC.d.ts +6 -3
  77. package/build/esm/cc/BarrierOperatorCC.d.ts.map +1 -1
  78. package/build/esm/cc/BarrierOperatorCC.js +45 -18
  79. package/build/esm/cc/BarrierOperatorCC.js.map +1 -1
  80. package/build/esm/cc/CentralSceneCC.d.ts +4 -1
  81. package/build/esm/cc/CentralSceneCC.d.ts.map +1 -1
  82. package/build/esm/cc/CentralSceneCC.js +35 -6
  83. package/build/esm/cc/CentralSceneCC.js.map +1 -1
  84. package/build/esm/cc/ClimateControlScheduleCC.d.ts +6 -3
  85. package/build/esm/cc/ClimateControlScheduleCC.d.ts.map +1 -1
  86. package/build/esm/cc/ClimateControlScheduleCC.js +57 -16
  87. package/build/esm/cc/ClimateControlScheduleCC.js.map +1 -1
  88. package/build/esm/cc/ClockCC.d.ts +2 -1
  89. package/build/esm/cc/ClockCC.d.ts.map +1 -1
  90. package/build/esm/cc/ClockCC.js +20 -7
  91. package/build/esm/cc/ClockCC.js.map +1 -1
  92. package/build/esm/cc/ConfigurationCC.d.ts +3 -2
  93. package/build/esm/cc/ConfigurationCC.d.ts.map +1 -1
  94. package/build/esm/cc/ConfigurationCC.js +63 -12
  95. package/build/esm/cc/ConfigurationCC.js.map +1 -1
  96. package/build/esm/cc/DoorLockLoggingCC.d.ts +3 -1
  97. package/build/esm/cc/DoorLockLoggingCC.d.ts.map +1 -1
  98. package/build/esm/cc/DoorLockLoggingCC.js +39 -5
  99. package/build/esm/cc/DoorLockLoggingCC.js.map +1 -1
  100. package/build/esm/cc/EntryControlCC.d.ts +5 -1
  101. package/build/esm/cc/EntryControlCC.d.ts.map +1 -1
  102. package/build/esm/cc/EntryControlCC.js +64 -7
  103. package/build/esm/cc/EntryControlCC.js.map +1 -1
  104. package/build/esm/cc/HumidityControlModeCC.d.ts +3 -1
  105. package/build/esm/cc/HumidityControlModeCC.d.ts.map +1 -1
  106. package/build/esm/cc/HumidityControlModeCC.js +15 -7
  107. package/build/esm/cc/HumidityControlModeCC.js.map +1 -1
  108. package/build/esm/cc/HumidityControlOperatingStateCC.d.ts +3 -1
  109. package/build/esm/cc/HumidityControlOperatingStateCC.d.ts.map +1 -1
  110. package/build/esm/cc/HumidityControlOperatingStateCC.js +5 -1
  111. package/build/esm/cc/HumidityControlOperatingStateCC.js.map +1 -1
  112. package/build/esm/cc/HumidityControlSetpointCC.d.ts +8 -4
  113. package/build/esm/cc/HumidityControlSetpointCC.d.ts.map +1 -1
  114. package/build/esm/cc/HumidityControlSetpointCC.js +52 -25
  115. package/build/esm/cc/HumidityControlSetpointCC.js.map +1 -1
  116. package/build/esm/cc/IrrigationCC.d.ts +15 -9
  117. package/build/esm/cc/IrrigationCC.d.ts.map +1 -1
  118. package/build/esm/cc/IrrigationCC.js +268 -61
  119. package/build/esm/cc/IrrigationCC.js.map +1 -1
  120. package/build/esm/cc/LanguageCC.d.ts +2 -1
  121. package/build/esm/cc/LanguageCC.d.ts.map +1 -1
  122. package/build/esm/cc/LanguageCC.js +18 -6
  123. package/build/esm/cc/LanguageCC.js.map +1 -1
  124. package/build/esm/cc/MultiChannelCC.d.ts +2 -1
  125. package/build/esm/cc/MultiChannelCC.d.ts.map +1 -1
  126. package/build/esm/cc/MultiChannelCC.js +15 -7
  127. package/build/esm/cc/MultiChannelCC.js.map +1 -1
  128. package/build/esm/cc/SceneActuatorConfigurationCC.d.ts +3 -2
  129. package/build/esm/cc/SceneActuatorConfigurationCC.d.ts.map +1 -1
  130. package/build/esm/cc/SceneActuatorConfigurationCC.js +39 -13
  131. package/build/esm/cc/SceneActuatorConfigurationCC.js.map +1 -1
  132. package/build/esm/cc/SceneControllerConfigurationCC.d.ts +3 -2
  133. package/build/esm/cc/SceneControllerConfigurationCC.d.ts.map +1 -1
  134. package/build/esm/cc/SceneControllerConfigurationCC.js +25 -12
  135. package/build/esm/cc/SceneControllerConfigurationCC.js.map +1 -1
  136. package/build/esm/cc/ThermostatFanModeCC.d.ts +3 -1
  137. package/build/esm/cc/ThermostatFanModeCC.d.ts.map +1 -1
  138. package/build/esm/cc/ThermostatFanModeCC.js +18 -7
  139. package/build/esm/cc/ThermostatFanModeCC.js.map +1 -1
  140. package/build/esm/cc/ThermostatFanStateCC.d.ts +3 -1
  141. package/build/esm/cc/ThermostatFanStateCC.d.ts.map +1 -1
  142. package/build/esm/cc/ThermostatFanStateCC.js +5 -1
  143. package/build/esm/cc/ThermostatFanStateCC.js.map +1 -1
  144. package/build/esm/cc/ThermostatModeCC.js +2 -2
  145. package/build/esm/cc/ThermostatModeCC.js.map +1 -1
  146. package/build/esm/cc/TimeCC.d.ts +1 -1
  147. package/build/esm/cc/TimeCC.d.ts.map +1 -1
  148. package/build/esm/cc/TimeCC.js +12 -7
  149. package/build/esm/cc/TimeCC.js.map +1 -1
  150. package/build/esm/cc/UserCodeCC.d.ts +2 -1
  151. package/build/esm/cc/UserCodeCC.d.ts.map +1 -1
  152. package/build/esm/cc/UserCodeCC.js +31 -6
  153. package/build/esm/cc/UserCodeCC.js.map +1 -1
  154. package/build/esm/cc/VersionCC.d.ts +1 -0
  155. package/build/esm/cc/VersionCC.d.ts.map +1 -1
  156. package/build/esm/cc/VersionCC.js +34 -0
  157. package/build/esm/cc/VersionCC.js.map +1 -1
  158. package/build/esm/cc/WakeUpCC.d.ts +2 -0
  159. package/build/esm/cc/WakeUpCC.d.ts.map +1 -1
  160. package/build/esm/cc/WakeUpCC.js +14 -0
  161. package/build/esm/cc/WakeUpCC.js.map +1 -1
  162. package/build/esm/cc/manufacturerProprietary/FibaroCC.d.ts +2 -1
  163. package/build/esm/cc/manufacturerProprietary/FibaroCC.d.ts.map +1 -1
  164. package/build/esm/cc/manufacturerProprietary/FibaroCC.js +34 -4
  165. package/build/esm/cc/manufacturerProprietary/FibaroCC.js.map +1 -1
  166. 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(_raw, _ctx) {
875
- // TODO: Deserialize payload
876
- throw new ZWaveError(`${this.name}: deserialization not implemented`, ZWaveErrorCodes.Deserialization_NotImplemented);
877
- // return new IrrigationCCSystemConfigSet({
878
- // nodeId: ctx.sourceNodeId,
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
- if (this.rainSensorPolarity != undefined)
889
- polarity |= 0b1;
890
- if (this.moistureSensorPolarity != undefined)
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(_raw, _ctx) {
1192
- // TODO: Deserialize payload
1193
- throw new ZWaveError(`${this.name}: deserialization not implemented`, ZWaveErrorCodes.Deserialization_NotImplemented);
1194
- // return new IrrigationCCValveInfoGet({
1195
- // nodeId: ctx.sourceNodeId,
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(_raw, _ctx) {
1245
- // TODO: Deserialize payload
1246
- throw new ZWaveError(`${this.name}: deserialization not implemented`, ZWaveErrorCodes.Deserialization_NotImplemented);
1247
- // return new IrrigationCCValveConfigSet({
1248
- // nodeId: ctx.sourceNodeId,
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(_raw, _ctx) {
1451
- // TODO: Deserialize payload
1452
- throw new ZWaveError(`${this.name}: deserialization not implemented`, ZWaveErrorCodes.Deserialization_NotImplemented);
1453
- // return new IrrigationCCValveConfigGet({
1454
- // nodeId: ctx.sourceNodeId,
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(_raw, _ctx) {
1498
- // TODO: Deserialize payload
1499
- throw new ZWaveError(`${this.name}: deserialization not implemented`, ZWaveErrorCodes.Deserialization_NotImplemented);
1500
- // return new IrrigationCCValveRun({
1501
- // nodeId: ctx.sourceNodeId,
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(_raw, _ctx) {
1556
- // TODO: Deserialize payload
1557
- throw new ZWaveError(`${this.name}: deserialization not implemented`, ZWaveErrorCodes.Deserialization_NotImplemented);
1558
- // return new IrrigationCCValveTableSet({
1559
- // nodeId: ctx.sourceNodeId,
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(_raw, _ctx) {
1683
- // TODO: Deserialize payload
1684
- throw new ZWaveError(`${this.name}: deserialization not implemented`, ZWaveErrorCodes.Deserialization_NotImplemented);
1685
- // return new IrrigationCCValveTableGet({
1686
- // nodeId: ctx.sourceNodeId,
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(_raw, _ctx) {
1729
- // TODO: Deserialize payload
1730
- throw new ZWaveError(`${this.name}: deserialization not implemented`, ZWaveErrorCodes.Deserialization_NotImplemented);
1731
- // return new IrrigationCCValveTableRun({
1732
- // nodeId: ctx.sourceNodeId,
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(_raw, _ctx) {
1774
- // TODO: Deserialize payload
1775
- throw new ZWaveError(`${this.name}: deserialization not implemented`, ZWaveErrorCodes.Deserialization_NotImplemented);
1776
- // return new IrrigationCCSystemShutoff({
1777
- // nodeId: ctx.sourceNodeId,
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) {