@zwave-js/cc 14.0.0-beta.4 → 14.0.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 (331) hide show
  1. package/build/cjs/cc/AlarmSensorCC.js +381 -266
  2. package/build/cjs/cc/AlarmSensorCC.js.map +3 -3
  3. package/build/cjs/cc/AssociationCC.js +669 -503
  4. package/build/cjs/cc/AssociationCC.js.map +3 -3
  5. package/build/cjs/cc/AssociationGroupInfoCC.js +633 -492
  6. package/build/cjs/cc/AssociationGroupInfoCC.js.map +3 -3
  7. package/build/cjs/cc/BarrierOperatorCC.js +595 -429
  8. package/build/cjs/cc/BarrierOperatorCC.js.map +3 -3
  9. package/build/cjs/cc/BasicCC.js +354 -260
  10. package/build/cjs/cc/BasicCC.js.map +3 -3
  11. package/build/cjs/cc/BatteryCC.js +427 -345
  12. package/build/cjs/cc/BatteryCC.js.map +3 -3
  13. package/build/cjs/cc/BinarySensorCC.js +391 -276
  14. package/build/cjs/cc/BinarySensorCC.js.map +3 -3
  15. package/build/cjs/cc/BinarySwitchCC.js +347 -253
  16. package/build/cjs/cc/BinarySwitchCC.js.map +3 -3
  17. package/build/cjs/cc/CRC16CC.js +160 -85
  18. package/build/cjs/cc/CRC16CC.js.map +3 -3
  19. package/build/cjs/cc/CentralSceneCC.js +459 -324
  20. package/build/cjs/cc/CentralSceneCC.js.map +3 -3
  21. package/build/cjs/cc/ClimateControlScheduleCC.js +459 -293
  22. package/build/cjs/cc/ClimateControlScheduleCC.js.map +3 -3
  23. package/build/cjs/cc/ClockCC.js +254 -150
  24. package/build/cjs/cc/ClockCC.js.map +3 -3
  25. package/build/cjs/cc/ColorSwitchCC.js +758 -610
  26. package/build/cjs/cc/ColorSwitchCC.js.map +3 -3
  27. package/build/cjs/cc/ConfigurationCC.js +1700 -1453
  28. package/build/cjs/cc/ConfigurationCC.js.map +3 -3
  29. package/build/cjs/cc/DeviceResetLocallyCC.js +125 -49
  30. package/build/cjs/cc/DeviceResetLocallyCC.js.map +3 -3
  31. package/build/cjs/cc/DoorLockCC.js +904 -777
  32. package/build/cjs/cc/DoorLockCC.js.map +3 -3
  33. package/build/cjs/cc/DoorLockLoggingCC.js +321 -206
  34. package/build/cjs/cc/DoorLockLoggingCC.js.map +3 -3
  35. package/build/cjs/cc/EnergyProductionCC.js +249 -160
  36. package/build/cjs/cc/EnergyProductionCC.js.map +3 -3
  37. package/build/cjs/cc/EntryControlCC.js +619 -458
  38. package/build/cjs/cc/EntryControlCC.js.map +3 -3
  39. package/build/cjs/cc/FirmwareUpdateMetaDataCC.js +898 -698
  40. package/build/cjs/cc/FirmwareUpdateMetaDataCC.js.map +3 -3
  41. package/build/cjs/cc/HailCC.js +57 -11
  42. package/build/cjs/cc/HailCC.js.map +2 -2
  43. package/build/cjs/cc/HumidityControlModeCC.js +359 -233
  44. package/build/cjs/cc/HumidityControlModeCC.js.map +3 -3
  45. package/build/cjs/cc/HumidityControlOperatingStateCC.js +189 -103
  46. package/build/cjs/cc/HumidityControlOperatingStateCC.js.map +3 -3
  47. package/build/cjs/cc/HumidityControlSetpointCC.js +682 -495
  48. package/build/cjs/cc/HumidityControlSetpointCC.js.map +3 -3
  49. package/build/cjs/cc/InclusionControllerCC.js +205 -114
  50. package/build/cjs/cc/InclusionControllerCC.js.map +3 -3
  51. package/build/cjs/cc/IndicatorCC.js +897 -736
  52. package/build/cjs/cc/IndicatorCC.js.map +3 -3
  53. package/build/cjs/cc/IrrigationCC.js +1651 -1405
  54. package/build/cjs/cc/IrrigationCC.js.map +3 -3
  55. package/build/cjs/cc/LanguageCC.js +268 -171
  56. package/build/cjs/cc/LanguageCC.js.map +3 -3
  57. package/build/cjs/cc/LockCC.js +254 -154
  58. package/build/cjs/cc/LockCC.js.map +3 -3
  59. package/build/cjs/cc/ManufacturerProprietaryCC.js +189 -129
  60. package/build/cjs/cc/ManufacturerProprietaryCC.js.map +2 -2
  61. package/build/cjs/cc/ManufacturerSpecificCC.js +319 -213
  62. package/build/cjs/cc/ManufacturerSpecificCC.js.map +3 -3
  63. package/build/cjs/cc/MeterCC.js +827 -707
  64. package/build/cjs/cc/MeterCC.js.map +3 -3
  65. package/build/cjs/cc/MultiChannelAssociationCC.js +612 -478
  66. package/build/cjs/cc/MultiChannelAssociationCC.js.map +3 -3
  67. package/build/cjs/cc/MultiChannelCC.js +1037 -819
  68. package/build/cjs/cc/MultiChannelCC.js.map +3 -3
  69. package/build/cjs/cc/MultiCommandCC.js +172 -97
  70. package/build/cjs/cc/MultiCommandCC.js.map +3 -3
  71. package/build/cjs/cc/MultilevelSensorCC.js +589 -449
  72. package/build/cjs/cc/MultilevelSensorCC.js.map +3 -3
  73. package/build/cjs/cc/MultilevelSwitchCC.js +587 -439
  74. package/build/cjs/cc/MultilevelSwitchCC.js.map +3 -3
  75. package/build/cjs/cc/NoOperationCC.js +89 -27
  76. package/build/cjs/cc/NoOperationCC.js.map +2 -2
  77. package/build/cjs/cc/NodeNamingCC.js +417 -277
  78. package/build/cjs/cc/NodeNamingCC.js.map +3 -3
  79. package/build/cjs/cc/NotificationCC.js +972 -818
  80. package/build/cjs/cc/NotificationCC.js.map +3 -3
  81. package/build/cjs/cc/PowerlevelCC.js +450 -303
  82. package/build/cjs/cc/PowerlevelCC.js.map +3 -3
  83. package/build/cjs/cc/ProtectionCC.js +686 -494
  84. package/build/cjs/cc/ProtectionCC.js.map +3 -3
  85. package/build/cjs/cc/SceneActivationCC.js +165 -97
  86. package/build/cjs/cc/SceneActivationCC.js.map +3 -3
  87. package/build/cjs/cc/SceneActuatorConfigurationCC.js +346 -243
  88. package/build/cjs/cc/SceneActuatorConfigurationCC.js.map +3 -3
  89. package/build/cjs/cc/SceneControllerConfigurationCC.js +401 -298
  90. package/build/cjs/cc/SceneControllerConfigurationCC.js.map +3 -3
  91. package/build/cjs/cc/ScheduleEntryLockCC.js +1552 -1272
  92. package/build/cjs/cc/ScheduleEntryLockCC.js.map +3 -3
  93. package/build/cjs/cc/Security2CC.js +1483 -1219
  94. package/build/cjs/cc/Security2CC.js.map +3 -3
  95. package/build/cjs/cc/SecurityCC.js +839 -619
  96. package/build/cjs/cc/SecurityCC.js.map +3 -3
  97. package/build/cjs/cc/SoundSwitchCC.js +707 -515
  98. package/build/cjs/cc/SoundSwitchCC.js.map +3 -3
  99. package/build/cjs/cc/SupervisionCC.js +327 -237
  100. package/build/cjs/cc/SupervisionCC.js.map +3 -3
  101. package/build/cjs/cc/ThermostatFanModeCC.js +386 -263
  102. package/build/cjs/cc/ThermostatFanModeCC.js.map +3 -3
  103. package/build/cjs/cc/ThermostatFanStateCC.js +192 -106
  104. package/build/cjs/cc/ThermostatFanStateCC.js.map +3 -3
  105. package/build/cjs/cc/ThermostatModeCC.js +425 -302
  106. package/build/cjs/cc/ThermostatModeCC.js.map +3 -3
  107. package/build/cjs/cc/ThermostatOperatingStateCC.js +188 -102
  108. package/build/cjs/cc/ThermostatOperatingStateCC.js.map +3 -3
  109. package/build/cjs/cc/ThermostatSetbackCC.js +277 -173
  110. package/build/cjs/cc/ThermostatSetbackCC.js.map +3 -3
  111. package/build/cjs/cc/ThermostatSetpointCC.js +645 -491
  112. package/build/cjs/cc/ThermostatSetpointCC.js.map +3 -3
  113. package/build/cjs/cc/TimeCC.js +515 -353
  114. package/build/cjs/cc/TimeCC.js.map +3 -3
  115. package/build/cjs/cc/TimeParametersCC.js +302 -202
  116. package/build/cjs/cc/TimeParametersCC.js.map +3 -3
  117. package/build/cjs/cc/TransportServiceCC.js +433 -315
  118. package/build/cjs/cc/TransportServiceCC.js.map +3 -3
  119. package/build/cjs/cc/UserCodeCC.js +1385 -1102
  120. package/build/cjs/cc/UserCodeCC.js.map +3 -3
  121. package/build/cjs/cc/VersionCC.js +696 -562
  122. package/build/cjs/cc/VersionCC.js.map +3 -3
  123. package/build/cjs/cc/WakeUpCC.js +499 -346
  124. package/build/cjs/cc/WakeUpCC.js.map +3 -3
  125. package/build/cjs/cc/WindowCoveringCC.js +626 -478
  126. package/build/cjs/cc/WindowCoveringCC.js.map +3 -3
  127. package/build/cjs/cc/ZWaveLongRangeCC.js +57 -10
  128. package/build/cjs/cc/ZWaveLongRangeCC.js.map +2 -2
  129. package/build/cjs/cc/ZWavePlusCC.js +233 -159
  130. package/build/cjs/cc/ZWavePlusCC.js.map +3 -3
  131. package/build/cjs/cc/ZWaveProtocolCC.js +1515 -948
  132. package/build/cjs/cc/ZWaveProtocolCC.js.map +3 -3
  133. package/build/cjs/cc/manufacturerProprietary/Decorators.d.ts +4 -4
  134. package/build/cjs/cc/manufacturerProprietary/Decorators.js.map +1 -1
  135. package/build/cjs/cc/manufacturerProprietary/FibaroCC.js +395 -274
  136. package/build/cjs/cc/manufacturerProprietary/FibaroCC.js.map +3 -3
  137. package/build/cjs/lib/CommandClassDecorators.d.ts +11 -15
  138. package/build/cjs/lib/CommandClassDecorators.js +19 -20
  139. package/build/cjs/lib/CommandClassDecorators.js.map +2 -2
  140. package/build/cjs/lib/Security2/Extension.d.ts +1 -1
  141. package/build/cjs/lib/Security2/Extension.js +217 -126
  142. package/build/cjs/lib/Security2/Extension.js.map +3 -3
  143. package/build/esm/cc/AlarmSensorCC.d.ts.map +1 -1
  144. package/build/esm/cc/AlarmSensorCC.js +389 -291
  145. package/build/esm/cc/AlarmSensorCC.js.map +1 -1
  146. package/build/esm/cc/AssociationCC.d.ts.map +1 -1
  147. package/build/esm/cc/AssociationCC.js +678 -537
  148. package/build/esm/cc/AssociationCC.js.map +1 -1
  149. package/build/esm/cc/AssociationGroupInfoCC.d.ts.map +1 -1
  150. package/build/esm/cc/AssociationGroupInfoCC.js +659 -539
  151. package/build/esm/cc/AssociationGroupInfoCC.js.map +1 -1
  152. package/build/esm/cc/BarrierOperatorCC.d.ts.map +1 -1
  153. package/build/esm/cc/BarrierOperatorCC.js +634 -493
  154. package/build/esm/cc/BarrierOperatorCC.js.map +1 -1
  155. package/build/esm/cc/BasicCC.d.ts.map +1 -1
  156. package/build/esm/cc/BasicCC.js +380 -302
  157. package/build/esm/cc/BasicCC.js.map +1 -1
  158. package/build/esm/cc/BatteryCC.d.ts.map +1 -1
  159. package/build/esm/cc/BatteryCC.js +449 -384
  160. package/build/esm/cc/BatteryCC.js.map +1 -1
  161. package/build/esm/cc/BinarySensorCC.d.ts.map +1 -1
  162. package/build/esm/cc/BinarySensorCC.js +395 -297
  163. package/build/esm/cc/BinarySensorCC.js.map +1 -1
  164. package/build/esm/cc/BinarySwitchCC.d.ts.map +1 -1
  165. package/build/esm/cc/BinarySwitchCC.js +353 -274
  166. package/build/esm/cc/BinarySwitchCC.js.map +1 -1
  167. package/build/esm/cc/CRC16CC.js +162 -98
  168. package/build/esm/cc/CRC16CC.js.map +1 -1
  169. package/build/esm/cc/CentralSceneCC.d.ts.map +1 -1
  170. package/build/esm/cc/CentralSceneCC.js +465 -351
  171. package/build/esm/cc/CentralSceneCC.js.map +1 -1
  172. package/build/esm/cc/ClimateControlScheduleCC.d.ts.map +1 -1
  173. package/build/esm/cc/ClimateControlScheduleCC.js +454 -313
  174. package/build/esm/cc/ClimateControlScheduleCC.js.map +1 -1
  175. package/build/esm/cc/ClockCC.js +248 -159
  176. package/build/esm/cc/ClockCC.js.map +1 -1
  177. package/build/esm/cc/ColorSwitchCC.d.ts.map +1 -1
  178. package/build/esm/cc/ColorSwitchCC.js +802 -677
  179. package/build/esm/cc/ColorSwitchCC.js.map +1 -1
  180. package/build/esm/cc/ConfigurationCC.js +1899 -1687
  181. package/build/esm/cc/ConfigurationCC.js.map +1 -1
  182. package/build/esm/cc/DeviceResetLocallyCC.js +124 -59
  183. package/build/esm/cc/DeviceResetLocallyCC.js.map +1 -1
  184. package/build/esm/cc/DoorLockCC.d.ts.map +1 -1
  185. package/build/esm/cc/DoorLockCC.js +951 -849
  186. package/build/esm/cc/DoorLockCC.js.map +1 -1
  187. package/build/esm/cc/DoorLockLoggingCC.d.ts.map +1 -1
  188. package/build/esm/cc/DoorLockLoggingCC.js +316 -218
  189. package/build/esm/cc/DoorLockLoggingCC.js.map +1 -1
  190. package/build/esm/cc/EnergyProductionCC.js +240 -164
  191. package/build/esm/cc/EnergyProductionCC.js.map +1 -1
  192. package/build/esm/cc/EntryControlCC.d.ts.map +1 -1
  193. package/build/esm/cc/EntryControlCC.js +629 -493
  194. package/build/esm/cc/EntryControlCC.js.map +1 -1
  195. package/build/esm/cc/FirmwareUpdateMetaDataCC.d.ts.map +1 -1
  196. package/build/esm/cc/FirmwareUpdateMetaDataCC.js +938 -769
  197. package/build/esm/cc/FirmwareUpdateMetaDataCC.js.map +1 -1
  198. package/build/esm/cc/HailCC.js +51 -12
  199. package/build/esm/cc/HailCC.js.map +1 -1
  200. package/build/esm/cc/HumidityControlModeCC.d.ts.map +1 -1
  201. package/build/esm/cc/HumidityControlModeCC.js +357 -250
  202. package/build/esm/cc/HumidityControlModeCC.js.map +1 -1
  203. package/build/esm/cc/HumidityControlOperatingStateCC.d.ts.map +1 -1
  204. package/build/esm/cc/HumidityControlOperatingStateCC.js +182 -109
  205. package/build/esm/cc/HumidityControlOperatingStateCC.js.map +1 -1
  206. package/build/esm/cc/HumidityControlSetpointCC.d.ts.map +1 -1
  207. package/build/esm/cc/HumidityControlSetpointCC.js +706 -546
  208. package/build/esm/cc/HumidityControlSetpointCC.js.map +1 -1
  209. package/build/esm/cc/InclusionControllerCC.js +197 -119
  210. package/build/esm/cc/InclusionControllerCC.js.map +1 -1
  211. package/build/esm/cc/IndicatorCC.js +973 -835
  212. package/build/esm/cc/IndicatorCC.js.map +1 -1
  213. package/build/esm/cc/IrrigationCC.d.ts.map +1 -1
  214. package/build/esm/cc/IrrigationCC.js +1697 -1496
  215. package/build/esm/cc/IrrigationCC.js.map +1 -1
  216. package/build/esm/cc/LanguageCC.d.ts.map +1 -1
  217. package/build/esm/cc/LanguageCC.js +266 -184
  218. package/build/esm/cc/LanguageCC.js.map +1 -1
  219. package/build/esm/cc/LockCC.d.ts.map +1 -1
  220. package/build/esm/cc/LockCC.js +247 -162
  221. package/build/esm/cc/LockCC.js.map +1 -1
  222. package/build/esm/cc/ManufacturerProprietaryCC.js +192 -141
  223. package/build/esm/cc/ManufacturerProprietaryCC.js.map +1 -1
  224. package/build/esm/cc/ManufacturerSpecificCC.d.ts.map +1 -1
  225. package/build/esm/cc/ManufacturerSpecificCC.js +312 -223
  226. package/build/esm/cc/ManufacturerSpecificCC.js.map +1 -1
  227. package/build/esm/cc/MeterCC.d.ts.map +1 -1
  228. package/build/esm/cc/MeterCC.js +896 -795
  229. package/build/esm/cc/MeterCC.js.map +1 -1
  230. package/build/esm/cc/MultiChannelAssociationCC.d.ts.map +1 -1
  231. package/build/esm/cc/MultiChannelAssociationCC.js +631 -518
  232. package/build/esm/cc/MultiChannelAssociationCC.js.map +1 -1
  233. package/build/esm/cc/MultiChannelCC.d.ts.map +1 -1
  234. package/build/esm/cc/MultiChannelCC.js +1106 -921
  235. package/build/esm/cc/MultiChannelCC.js.map +1 -1
  236. package/build/esm/cc/MultiCommandCC.js +166 -102
  237. package/build/esm/cc/MultiCommandCC.js.map +1 -1
  238. package/build/esm/cc/MultilevelSensorCC.d.ts.map +1 -1
  239. package/build/esm/cc/MultilevelSensorCC.js +616 -497
  240. package/build/esm/cc/MultilevelSensorCC.js.map +1 -1
  241. package/build/esm/cc/MultilevelSwitchCC.d.ts.map +1 -1
  242. package/build/esm/cc/MultilevelSwitchCC.js +621 -496
  243. package/build/esm/cc/MultilevelSwitchCC.js.map +1 -1
  244. package/build/esm/cc/NoOperationCC.js +82 -29
  245. package/build/esm/cc/NoOperationCC.js.map +1 -1
  246. package/build/esm/cc/NodeNamingCC.d.ts.map +1 -1
  247. package/build/esm/cc/NodeNamingCC.js +413 -294
  248. package/build/esm/cc/NodeNamingCC.js.map +1 -1
  249. package/build/esm/cc/NotificationCC.d.ts.map +1 -1
  250. package/build/esm/cc/NotificationCC.js +1097 -966
  251. package/build/esm/cc/NotificationCC.js.map +1 -1
  252. package/build/esm/cc/PowerlevelCC.js +437 -311
  253. package/build/esm/cc/PowerlevelCC.js.map +1 -1
  254. package/build/esm/cc/ProtectionCC.d.ts.map +1 -1
  255. package/build/esm/cc/ProtectionCC.js +704 -543
  256. package/build/esm/cc/ProtectionCC.js.map +1 -1
  257. package/build/esm/cc/SceneActivationCC.d.ts.map +1 -1
  258. package/build/esm/cc/SceneActivationCC.js +157 -100
  259. package/build/esm/cc/SceneActivationCC.js.map +1 -1
  260. package/build/esm/cc/SceneActuatorConfigurationCC.js +357 -269
  261. package/build/esm/cc/SceneActuatorConfigurationCC.js.map +1 -1
  262. package/build/esm/cc/SceneControllerConfigurationCC.js +434 -346
  263. package/build/esm/cc/SceneControllerConfigurationCC.js.map +1 -1
  264. package/build/esm/cc/ScheduleEntryLockCC.d.ts.map +1 -1
  265. package/build/esm/cc/ScheduleEntryLockCC.js +1596 -1357
  266. package/build/esm/cc/ScheduleEntryLockCC.js.map +1 -1
  267. package/build/esm/cc/Security2CC.js +1633 -1406
  268. package/build/esm/cc/Security2CC.js.map +1 -1
  269. package/build/esm/cc/SecurityCC.js +876 -687
  270. package/build/esm/cc/SecurityCC.js.map +1 -1
  271. package/build/esm/cc/SoundSwitchCC.d.ts.map +1 -1
  272. package/build/esm/cc/SoundSwitchCC.js +689 -526
  273. package/build/esm/cc/SoundSwitchCC.js.map +1 -1
  274. package/build/esm/cc/SupervisionCC.js +349 -272
  275. package/build/esm/cc/SupervisionCC.js.map +1 -1
  276. package/build/esm/cc/ThermostatFanModeCC.d.ts.map +1 -1
  277. package/build/esm/cc/ThermostatFanModeCC.js +388 -284
  278. package/build/esm/cc/ThermostatFanModeCC.js.map +1 -1
  279. package/build/esm/cc/ThermostatFanStateCC.d.ts.map +1 -1
  280. package/build/esm/cc/ThermostatFanStateCC.js +184 -111
  281. package/build/esm/cc/ThermostatFanStateCC.js.map +1 -1
  282. package/build/esm/cc/ThermostatModeCC.d.ts.map +1 -1
  283. package/build/esm/cc/ThermostatModeCC.js +435 -331
  284. package/build/esm/cc/ThermostatModeCC.js.map +1 -1
  285. package/build/esm/cc/ThermostatOperatingStateCC.d.ts.map +1 -1
  286. package/build/esm/cc/ThermostatOperatingStateCC.js +180 -107
  287. package/build/esm/cc/ThermostatOperatingStateCC.js.map +1 -1
  288. package/build/esm/cc/ThermostatSetbackCC.js +274 -185
  289. package/build/esm/cc/ThermostatSetbackCC.js.map +1 -1
  290. package/build/esm/cc/ThermostatSetpointCC.d.ts.map +1 -1
  291. package/build/esm/cc/ThermostatSetpointCC.js +674 -543
  292. package/build/esm/cc/ThermostatSetpointCC.js.map +1 -1
  293. package/build/esm/cc/TimeCC.js +499 -360
  294. package/build/esm/cc/TimeCC.js.map +1 -1
  295. package/build/esm/cc/TimeParametersCC.d.ts.map +1 -1
  296. package/build/esm/cc/TimeParametersCC.js +296 -211
  297. package/build/esm/cc/TimeParametersCC.js.map +1 -1
  298. package/build/esm/cc/TransportServiceCC.js +464 -363
  299. package/build/esm/cc/TransportServiceCC.js.map +1 -1
  300. package/build/esm/cc/UserCodeCC.d.ts.map +1 -1
  301. package/build/esm/cc/UserCodeCC.js +1443 -1205
  302. package/build/esm/cc/UserCodeCC.js.map +1 -1
  303. package/build/esm/cc/VersionCC.d.ts.map +1 -1
  304. package/build/esm/cc/VersionCC.js +744 -635
  305. package/build/esm/cc/VersionCC.js.map +1 -1
  306. package/build/esm/cc/WakeUpCC.d.ts.map +1 -1
  307. package/build/esm/cc/WakeUpCC.js +494 -364
  308. package/build/esm/cc/WakeUpCC.js.map +1 -1
  309. package/build/esm/cc/WindowCoveringCC.d.ts.map +1 -1
  310. package/build/esm/cc/WindowCoveringCC.js +655 -530
  311. package/build/esm/cc/WindowCoveringCC.js.map +1 -1
  312. package/build/esm/cc/ZWaveLongRangeCC.js +51 -11
  313. package/build/esm/cc/ZWaveLongRangeCC.js.map +1 -1
  314. package/build/esm/cc/ZWavePlusCC.d.ts.map +1 -1
  315. package/build/esm/cc/ZWavePlusCC.js +223 -162
  316. package/build/esm/cc/ZWavePlusCC.js.map +1 -1
  317. package/build/esm/cc/ZWaveProtocolCC.js +1443 -953
  318. package/build/esm/cc/ZWaveProtocolCC.js.map +1 -1
  319. package/build/esm/cc/manufacturerProprietary/Decorators.d.ts +4 -4
  320. package/build/esm/cc/manufacturerProprietary/Decorators.d.ts.map +1 -1
  321. package/build/esm/cc/manufacturerProprietary/FibaroCC.js +390 -286
  322. package/build/esm/cc/manufacturerProprietary/FibaroCC.js.map +1 -1
  323. package/build/esm/lib/CommandClassDecorators.d.ts +11 -15
  324. package/build/esm/lib/CommandClassDecorators.d.ts.map +1 -1
  325. package/build/esm/lib/CommandClassDecorators.js +24 -24
  326. package/build/esm/lib/CommandClassDecorators.js.map +1 -1
  327. package/build/esm/lib/Security2/Extension.d.ts +1 -1
  328. package/build/esm/lib/Security2/Extension.d.ts.map +1 -1
  329. package/build/esm/lib/Security2/Extension.js +207 -123
  330. package/build/esm/lib/Security2/Extension.js.map +1 -1
  331. package/package.json +6 -6
@@ -50,13 +50,45 @@ var import_CommandClass = require("../lib/CommandClass.js");
50
50
  var import_CommandClassDecorators = require("../lib/CommandClassDecorators.js");
51
51
  var import_Values = require("../lib/Values.js");
52
52
  var import_Types = require("../lib/_Types.js");
53
- var __decorate = function(decorators, target, key, desc) {
54
- var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
55
- if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
56
- else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
57
- return c > 3 && r && Object.defineProperty(target, key, r), r;
53
+ var __esDecorate = function(ctor, descriptorIn, decorators, contextIn, initializers, extraInitializers) {
54
+ function accept(f) {
55
+ if (f !== void 0 && typeof f !== "function") throw new TypeError("Function expected");
56
+ return f;
57
+ }
58
+ var kind = contextIn.kind, key = kind === "getter" ? "get" : kind === "setter" ? "set" : "value";
59
+ var target = !descriptorIn && ctor ? contextIn["static"] ? ctor : ctor.prototype : null;
60
+ var descriptor = descriptorIn || (target ? Object.getOwnPropertyDescriptor(target, contextIn.name) : {});
61
+ var _, done = false;
62
+ for (var i = decorators.length - 1; i >= 0; i--) {
63
+ var context = {};
64
+ for (var p in contextIn) context[p] = p === "access" ? {} : contextIn[p];
65
+ for (var p in contextIn.access) context.access[p] = contextIn.access[p];
66
+ context.addInitializer = function(f) {
67
+ if (done) throw new TypeError("Cannot add initializers after decoration has completed");
68
+ extraInitializers.push(accept(f || null));
69
+ };
70
+ var result = (0, decorators[i])(kind === "accessor" ? { get: descriptor.get, set: descriptor.set } : descriptor[key], context);
71
+ if (kind === "accessor") {
72
+ if (result === void 0) continue;
73
+ if (result === null || typeof result !== "object") throw new TypeError("Object expected");
74
+ if (_ = accept(result.get)) descriptor.get = _;
75
+ if (_ = accept(result.set)) descriptor.set = _;
76
+ if (_ = accept(result.init)) initializers.unshift(_);
77
+ } else if (_ = accept(result)) {
78
+ if (kind === "field") initializers.unshift(_);
79
+ else descriptor[key] = _;
80
+ }
81
+ }
82
+ if (target) Object.defineProperty(target, contextIn.name, descriptor);
83
+ done = true;
84
+ };
85
+ var __runInitializers = function(thisArg, initializers, value) {
86
+ var useValue = arguments.length > 2;
87
+ for (var i = 0; i < initializers.length; i++) {
88
+ value = useValue ? initializers[i].call(thisArg, value) : initializers[i].call(thisArg);
89
+ }
90
+ return useValue ? value : void 0;
58
91
  };
59
- var IrrigationCC_1, IrrigationCCSystemInfoReport_1, IrrigationCCSystemStatusReport_1, IrrigationCCSystemConfigReport_1, IrrigationCCValveInfoReport_1, IrrigationCCValveConfigReport_1, IrrigationCCValveTableReport_1;
60
92
  function __assertType(argName, typeName, boundHasError) {
61
93
  const { ZWaveError: ZWaveError2, ZWaveErrorCodes: ZWaveErrorCodes2 } = require("@zwave-js/core");
62
94
  if (boundHasError()) {
@@ -473,1484 +505,1698 @@ const valveConfigPropertyKeys = [
473
505
  "useRainSensor",
474
506
  "useMoistureSensor"
475
507
  ];
476
- let IrrigationCCAPI = class IrrigationCCAPI2 extends import_API.CCAPI {
477
- supportsCommand(cmd) {
478
- switch (cmd) {
479
- case import_Types.IrrigationCommand.SystemInfoGet:
480
- case import_Types.IrrigationCommand.SystemStatusGet:
481
- case import_Types.IrrigationCommand.SystemConfigSet:
482
- case import_Types.IrrigationCommand.SystemConfigGet:
483
- case import_Types.IrrigationCommand.ValveInfoGet:
484
- case import_Types.IrrigationCommand.ValveConfigSet:
485
- case import_Types.IrrigationCommand.ValveConfigGet:
486
- case import_Types.IrrigationCommand.ValveRun:
487
- case import_Types.IrrigationCommand.ValveTableSet:
488
- case import_Types.IrrigationCommand.ValveTableGet:
489
- case import_Types.IrrigationCommand.ValveTableRun:
490
- case import_Types.IrrigationCommand.SystemShutoff:
491
- return true;
492
- }
493
- return super.supportsCommand(cmd);
494
- }
495
- // eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types
496
- async getSystemInfo() {
497
- this.assertSupportsCommand(import_Types.IrrigationCommand, import_Types.IrrigationCommand.SystemInfoGet);
498
- const cc = new IrrigationCCSystemInfoGet({
499
- nodeId: this.endpoint.nodeId,
500
- endpointIndex: this.endpoint.index
501
- });
502
- const response = await this.host.sendCommand(cc, this.commandOptions);
503
- if (response) {
504
- return (0, import_safe3.pick)(response, [
505
- "numValves",
506
- "numValveTables",
507
- "supportsMasterValve",
508
- "maxValveTableSize"
509
- ]);
508
+ let IrrigationCCAPI = (() => {
509
+ let _classDecorators = [(0, import_CommandClassDecorators.API)(import_safe.CommandClasses.Irrigation)];
510
+ let _classDescriptor;
511
+ let _classExtraInitializers = [];
512
+ let _classThis;
513
+ let _classSuper = import_API.CCAPI;
514
+ var IrrigationCCAPI2 = class extends _classSuper {
515
+ static {
516
+ _classThis = this;
510
517
  }
511
- }
512
- // eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types
513
- async getSystemStatus() {
514
- this.assertSupportsCommand(import_Types.IrrigationCommand, import_Types.IrrigationCommand.SystemStatusGet);
515
- const cc = new IrrigationCCSystemStatusGet({
516
- nodeId: this.endpoint.nodeId,
517
- endpointIndex: this.endpoint.index
518
- });
519
- const response = await this.host.sendCommand(cc, this.commandOptions);
520
- if (response) {
521
- return (0, import_safe3.pick)(response, [
522
- "systemVoltage",
523
- "flowSensorActive",
524
- "pressureSensorActive",
525
- "rainSensorActive",
526
- "moistureSensorActive",
527
- "flow",
528
- "pressure",
529
- "shutoffDuration",
530
- "errorNotProgrammed",
531
- "errorEmergencyShutdown",
532
- "errorHighPressure",
533
- "errorLowPressure",
534
- "errorValve",
535
- "masterValveOpen",
536
- "firstOpenZoneId"
537
- ]);
518
+ static {
519
+ const _metadata = typeof Symbol === "function" && Symbol.metadata ? Object.create(_classSuper[Symbol.metadata] ?? null) : void 0;
520
+ __esDecorate(null, _classDescriptor = { value: _classThis }, _classDecorators, { kind: "class", name: _classThis.name, metadata: _metadata }, null, _classExtraInitializers);
521
+ IrrigationCCAPI2 = _classThis = _classDescriptor.value;
522
+ if (_metadata) Object.defineProperty(_classThis, Symbol.metadata, { enumerable: true, configurable: true, writable: true, value: _metadata });
523
+ __runInitializers(_classThis, _classExtraInitializers);
538
524
  }
539
- }
540
- // eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types
541
- async getSystemConfig() {
542
- this.assertSupportsCommand(import_Types.IrrigationCommand, import_Types.IrrigationCommand.SystemConfigGet);
543
- const cc = new IrrigationCCSystemConfigGet({
544
- nodeId: this.endpoint.nodeId,
545
- endpointIndex: this.endpoint.index
546
- });
547
- const response = await this.host.sendCommand(cc, this.commandOptions);
548
- if (response) {
549
- return (0, import_safe3.pick)(response, [
550
- "masterValveDelay",
551
- "highPressureThreshold",
552
- "lowPressureThreshold",
553
- "rainSensorPolarity",
554
- "moistureSensorPolarity"
555
- ]);
525
+ supportsCommand(cmd) {
526
+ switch (cmd) {
527
+ case import_Types.IrrigationCommand.SystemInfoGet:
528
+ case import_Types.IrrigationCommand.SystemStatusGet:
529
+ case import_Types.IrrigationCommand.SystemConfigSet:
530
+ case import_Types.IrrigationCommand.SystemConfigGet:
531
+ case import_Types.IrrigationCommand.ValveInfoGet:
532
+ case import_Types.IrrigationCommand.ValveConfigSet:
533
+ case import_Types.IrrigationCommand.ValveConfigGet:
534
+ case import_Types.IrrigationCommand.ValveRun:
535
+ case import_Types.IrrigationCommand.ValveTableSet:
536
+ case import_Types.IrrigationCommand.ValveTableGet:
537
+ case import_Types.IrrigationCommand.ValveTableRun:
538
+ case import_Types.IrrigationCommand.SystemShutoff:
539
+ return true;
540
+ }
541
+ return super.supportsCommand(cmd);
556
542
  }
557
- }
558
- async setSystemConfig(config) {
559
- __assertType("config", "IrrigationCCSystemConfigSetOptions", __assertType__IrrigationCCSystemConfigSetOptions.bind(void 0, config));
560
- this.assertSupportsCommand(import_Types.IrrigationCommand, import_Types.IrrigationCommand.SystemConfigSet);
561
- const cc = new IrrigationCCSystemConfigSet({
562
- nodeId: this.endpoint.nodeId,
563
- endpointIndex: this.endpoint.index,
564
- ...config
565
- });
566
- return this.host.sendCommand(cc, this.commandOptions);
567
- }
568
- async getValveInfo(valveId) {
569
- __assertType("valveId", "ValveId", __assertType__ValveId.bind(void 0, valveId));
570
- this.assertSupportsCommand(import_Types.IrrigationCommand, import_Types.IrrigationCommand.ValveInfoGet);
571
- const cc = new IrrigationCCValveInfoGet({
572
- nodeId: this.endpoint.nodeId,
573
- endpointIndex: this.endpoint.index,
574
- valveId
575
- });
576
- const response = await this.host.sendCommand(cc, this.commandOptions);
577
- if (response) {
578
- return (0, import_safe3.pick)(response, [
579
- "connected",
580
- "nominalCurrent",
581
- "errorShortCircuit",
582
- "errorHighCurrent",
583
- "errorLowCurrent",
584
- "errorMaximumFlow",
585
- "errorHighFlow",
586
- "errorLowFlow"
587
- ]);
543
+ // eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types
544
+ async getSystemInfo() {
545
+ this.assertSupportsCommand(import_Types.IrrigationCommand, import_Types.IrrigationCommand.SystemInfoGet);
546
+ const cc = new IrrigationCCSystemInfoGet({
547
+ nodeId: this.endpoint.nodeId,
548
+ endpointIndex: this.endpoint.index
549
+ });
550
+ const response = await this.host.sendCommand(cc, this.commandOptions);
551
+ if (response) {
552
+ return (0, import_safe3.pick)(response, [
553
+ "numValves",
554
+ "numValveTables",
555
+ "supportsMasterValve",
556
+ "maxValveTableSize"
557
+ ]);
558
+ }
588
559
  }
589
- }
590
- async setValveConfig(options) {
591
- __assertType("options", "IrrigationCCValveConfigSetOptions", __assertType__IrrigationCCValveConfigSetOptions.bind(void 0, options));
592
- this.assertSupportsCommand(import_Types.IrrigationCommand, import_Types.IrrigationCommand.ValveConfigSet);
593
- const cc = new IrrigationCCValveConfigSet({
594
- nodeId: this.endpoint.nodeId,
595
- endpointIndex: this.endpoint.index,
596
- ...options
597
- });
598
- return this.host.sendCommand(cc, this.commandOptions);
599
- }
600
- async getValveConfig(valveId) {
601
- __assertType("valveId", "ValveId", __assertType__ValveId.bind(void 0, valveId));
602
- this.assertSupportsCommand(import_Types.IrrigationCommand, import_Types.IrrigationCommand.ValveConfigGet);
603
- const cc = new IrrigationCCValveConfigGet({
604
- nodeId: this.endpoint.nodeId,
605
- endpointIndex: this.endpoint.index,
606
- valveId
607
- });
608
- const response = await this.host.sendCommand(cc, this.commandOptions);
609
- if (response) {
610
- return (0, import_safe3.pick)(response, [
611
- "nominalCurrentHighThreshold",
612
- "nominalCurrentLowThreshold",
613
- "maximumFlow",
614
- "highFlowThreshold",
615
- "lowFlowThreshold",
616
- "useRainSensor",
617
- "useMoistureSensor"
618
- ]);
560
+ // eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types
561
+ async getSystemStatus() {
562
+ this.assertSupportsCommand(import_Types.IrrigationCommand, import_Types.IrrigationCommand.SystemStatusGet);
563
+ const cc = new IrrigationCCSystemStatusGet({
564
+ nodeId: this.endpoint.nodeId,
565
+ endpointIndex: this.endpoint.index
566
+ });
567
+ const response = await this.host.sendCommand(cc, this.commandOptions);
568
+ if (response) {
569
+ return (0, import_safe3.pick)(response, [
570
+ "systemVoltage",
571
+ "flowSensorActive",
572
+ "pressureSensorActive",
573
+ "rainSensorActive",
574
+ "moistureSensorActive",
575
+ "flow",
576
+ "pressure",
577
+ "shutoffDuration",
578
+ "errorNotProgrammed",
579
+ "errorEmergencyShutdown",
580
+ "errorHighPressure",
581
+ "errorLowPressure",
582
+ "errorValve",
583
+ "masterValveOpen",
584
+ "firstOpenZoneId"
585
+ ]);
586
+ }
619
587
  }
620
- }
621
- async runValve(valveId, duration) {
622
- __assertType("valveId", "ValveId", __assertType__ValveId.bind(void 0, valveId));
623
- __assertType("duration", "number", __assertType__number.bind(void 0, duration));
624
- this.assertSupportsCommand(import_Types.IrrigationCommand, import_Types.IrrigationCommand.ValveRun);
625
- const cc = new IrrigationCCValveRun({
626
- nodeId: this.endpoint.nodeId,
627
- endpointIndex: this.endpoint.index,
628
- valveId,
629
- duration
630
- });
631
- return this.host.sendCommand(cc, this.commandOptions);
632
- }
633
- shutoffValve(valveId) {
634
- __assertType("valveId", "ValveId", __assertType__ValveId.bind(void 0, valveId));
635
- return this.runValve(valveId, 0);
636
- }
637
- async setValveTable(tableId, entries) {
638
- __assertType("tableId", "number", __assertType__number.bind(void 0, tableId));
639
- __assertType("entries", void 0, __assertType__sa__2_ea_2.bind(void 0, entries));
640
- this.assertSupportsCommand(import_Types.IrrigationCommand, import_Types.IrrigationCommand.ValveTableSet);
641
- if (!this.endpoint.virtual) {
642
- const maxValveTableSize = IrrigationCC.getMaxValveTableSizeCached(this.host, this.endpoint);
643
- if (maxValveTableSize != void 0 && entries.length > maxValveTableSize) {
644
- throw new import_safe.ZWaveError(`The number of valve table entries must not exceed ${maxValveTableSize}.`, import_safe.ZWaveErrorCodes.Argument_Invalid);
588
+ // eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types
589
+ async getSystemConfig() {
590
+ this.assertSupportsCommand(import_Types.IrrigationCommand, import_Types.IrrigationCommand.SystemConfigGet);
591
+ const cc = new IrrigationCCSystemConfigGet({
592
+ nodeId: this.endpoint.nodeId,
593
+ endpointIndex: this.endpoint.index
594
+ });
595
+ const response = await this.host.sendCommand(cc, this.commandOptions);
596
+ if (response) {
597
+ return (0, import_safe3.pick)(response, [
598
+ "masterValveDelay",
599
+ "highPressureThreshold",
600
+ "lowPressureThreshold",
601
+ "rainSensorPolarity",
602
+ "moistureSensorPolarity"
603
+ ]);
645
604
  }
646
605
  }
647
- const cc = new IrrigationCCValveTableSet({
648
- nodeId: this.endpoint.nodeId,
649
- endpointIndex: this.endpoint.index,
650
- tableId,
651
- entries
652
- });
653
- return this.host.sendCommand(cc, this.commandOptions);
654
- }
655
- async getValveTable(tableId) {
656
- __assertType("tableId", "number", __assertType__number.bind(void 0, tableId));
657
- this.assertSupportsCommand(import_Types.IrrigationCommand, import_Types.IrrigationCommand.ValveTableGet);
658
- const cc = new IrrigationCCValveTableGet({
659
- nodeId: this.endpoint.nodeId,
660
- endpointIndex: this.endpoint.index,
661
- tableId
662
- });
663
- const response = await this.host.sendCommand(cc, this.commandOptions);
664
- if (response) {
665
- return response?.entries;
606
+ async setSystemConfig(config) {
607
+ __assertType("config", "IrrigationCCSystemConfigSetOptions", __assertType__IrrigationCCSystemConfigSetOptions.bind(void 0, config));
608
+ this.assertSupportsCommand(import_Types.IrrigationCommand, import_Types.IrrigationCommand.SystemConfigSet);
609
+ const cc = new IrrigationCCSystemConfigSet({
610
+ nodeId: this.endpoint.nodeId,
611
+ endpointIndex: this.endpoint.index,
612
+ ...config
613
+ });
614
+ return this.host.sendCommand(cc, this.commandOptions);
666
615
  }
667
- }
668
- async runTables(tableIDs) {
669
- __assertType("tableIDs", void 0, __assertType__sa__number_ea_2.bind(void 0, tableIDs));
670
- this.assertSupportsCommand(import_Types.IrrigationCommand, import_Types.IrrigationCommand.ValveTableRun);
671
- const cc = new IrrigationCCValveTableRun({
672
- nodeId: this.endpoint.nodeId,
673
- endpointIndex: this.endpoint.index,
674
- tableIDs
675
- });
676
- return this.host.sendCommand(cc, this.commandOptions);
677
- }
678
- /**
679
- * Shuts off the entire system for the given duration.
680
- * @param duration Shutoff duration in hours. A value of 255 will shut off the entire system permanently and prevents schedules from running.
681
- */
682
- async shutoffSystem(duration) {
683
- __assertType("duration", "number", __assertType__number.bind(void 0, duration));
684
- this.assertSupportsCommand(import_Types.IrrigationCommand, import_Types.IrrigationCommand.SystemShutoff);
685
- const cc = new IrrigationCCSystemShutoff({
686
- nodeId: this.endpoint.nodeId,
687
- endpointIndex: this.endpoint.index,
688
- duration
689
- });
690
- return this.host.sendCommand(cc, this.commandOptions);
691
- }
692
- /** Shuts off the entire system permanently and prevents schedules from running */
693
- shutoffSystemPermanently() {
694
- return this.shutoffSystem(255);
695
- }
696
- get [import_API.SET_VALUE]() {
697
- return async function({ property, propertyKey }, value) {
698
- const valueDB = this.getValueDB();
699
- if (systemConfigProperties.includes(property)) {
700
- const options = {};
701
- for (const prop of systemConfigProperties) {
702
- if (prop === property)
703
- continue;
704
- const valueId = {
705
- commandClass: this.ccId,
706
- endpoint: this.endpoint.index,
707
- property: prop
708
- };
709
- const cachedVal = valueDB.getValue(valueId);
710
- if (cachedVal == void 0) {
711
- throw new import_safe.ZWaveError(`The "${property}" property cannot be changed before ${prop} is known!`, import_safe.ZWaveErrorCodes.Argument_Invalid);
712
- }
713
- options[prop] = cachedVal;
714
- }
715
- options[property] = value;
716
- return this.setSystemConfig(options);
717
- } else if (property === "shutoff") {
718
- return this.shutoffSystem(0);
719
- } else if (property === "master" || typeof property === "number" && property >= 1) {
720
- if (propertyKey == void 0) {
721
- (0, import_API.throwMissingPropertyKey)(this.ccId, property);
616
+ async getValveInfo(valveId) {
617
+ __assertType("valveId", "ValveId", __assertType__ValveId.bind(void 0, valveId));
618
+ this.assertSupportsCommand(import_Types.IrrigationCommand, import_Types.IrrigationCommand.ValveInfoGet);
619
+ const cc = new IrrigationCCValveInfoGet({
620
+ nodeId: this.endpoint.nodeId,
621
+ endpointIndex: this.endpoint.index,
622
+ valveId
623
+ });
624
+ const response = await this.host.sendCommand(cc, this.commandOptions);
625
+ if (response) {
626
+ return (0, import_safe3.pick)(response, [
627
+ "connected",
628
+ "nominalCurrent",
629
+ "errorShortCircuit",
630
+ "errorHighCurrent",
631
+ "errorLowCurrent",
632
+ "errorMaximumFlow",
633
+ "errorHighFlow",
634
+ "errorLowFlow"
635
+ ]);
636
+ }
637
+ }
638
+ async setValveConfig(options) {
639
+ __assertType("options", "IrrigationCCValveConfigSetOptions", __assertType__IrrigationCCValveConfigSetOptions.bind(void 0, options));
640
+ this.assertSupportsCommand(import_Types.IrrigationCommand, import_Types.IrrigationCommand.ValveConfigSet);
641
+ const cc = new IrrigationCCValveConfigSet({
642
+ nodeId: this.endpoint.nodeId,
643
+ endpointIndex: this.endpoint.index,
644
+ ...options
645
+ });
646
+ return this.host.sendCommand(cc, this.commandOptions);
647
+ }
648
+ async getValveConfig(valveId) {
649
+ __assertType("valveId", "ValveId", __assertType__ValveId.bind(void 0, valveId));
650
+ this.assertSupportsCommand(import_Types.IrrigationCommand, import_Types.IrrigationCommand.ValveConfigGet);
651
+ const cc = new IrrigationCCValveConfigGet({
652
+ nodeId: this.endpoint.nodeId,
653
+ endpointIndex: this.endpoint.index,
654
+ valveId
655
+ });
656
+ const response = await this.host.sendCommand(cc, this.commandOptions);
657
+ if (response) {
658
+ return (0, import_safe3.pick)(response, [
659
+ "nominalCurrentHighThreshold",
660
+ "nominalCurrentLowThreshold",
661
+ "maximumFlow",
662
+ "highFlowThreshold",
663
+ "lowFlowThreshold",
664
+ "useRainSensor",
665
+ "useMoistureSensor"
666
+ ]);
667
+ }
668
+ }
669
+ async runValve(valveId, duration) {
670
+ __assertType("valveId", "ValveId", __assertType__ValveId.bind(void 0, valveId));
671
+ __assertType("duration", "number", __assertType__number.bind(void 0, duration));
672
+ this.assertSupportsCommand(import_Types.IrrigationCommand, import_Types.IrrigationCommand.ValveRun);
673
+ const cc = new IrrigationCCValveRun({
674
+ nodeId: this.endpoint.nodeId,
675
+ endpointIndex: this.endpoint.index,
676
+ valveId,
677
+ duration
678
+ });
679
+ return this.host.sendCommand(cc, this.commandOptions);
680
+ }
681
+ shutoffValve(valveId) {
682
+ __assertType("valveId", "ValveId", __assertType__ValveId.bind(void 0, valveId));
683
+ return this.runValve(valveId, 0);
684
+ }
685
+ async setValveTable(tableId, entries) {
686
+ __assertType("tableId", "number", __assertType__number.bind(void 0, tableId));
687
+ __assertType("entries", void 0, __assertType__sa__2_ea_2.bind(void 0, entries));
688
+ this.assertSupportsCommand(import_Types.IrrigationCommand, import_Types.IrrigationCommand.ValveTableSet);
689
+ if (!this.endpoint.virtual) {
690
+ const maxValveTableSize = IrrigationCC.getMaxValveTableSizeCached(this.host, this.endpoint);
691
+ if (maxValveTableSize != void 0 && entries.length > maxValveTableSize) {
692
+ throw new import_safe.ZWaveError(`The number of valve table entries must not exceed ${maxValveTableSize}.`, import_safe.ZWaveErrorCodes.Argument_Invalid);
722
693
  }
723
- if (valveConfigPropertyKeys.includes(propertyKey)) {
724
- const options = {
725
- valveId: property
726
- };
727
- for (const prop of valveConfigPropertyKeys) {
728
- if (prop === propertyKey)
694
+ }
695
+ const cc = new IrrigationCCValveTableSet({
696
+ nodeId: this.endpoint.nodeId,
697
+ endpointIndex: this.endpoint.index,
698
+ tableId,
699
+ entries
700
+ });
701
+ return this.host.sendCommand(cc, this.commandOptions);
702
+ }
703
+ async getValveTable(tableId) {
704
+ __assertType("tableId", "number", __assertType__number.bind(void 0, tableId));
705
+ this.assertSupportsCommand(import_Types.IrrigationCommand, import_Types.IrrigationCommand.ValveTableGet);
706
+ const cc = new IrrigationCCValveTableGet({
707
+ nodeId: this.endpoint.nodeId,
708
+ endpointIndex: this.endpoint.index,
709
+ tableId
710
+ });
711
+ const response = await this.host.sendCommand(cc, this.commandOptions);
712
+ if (response) {
713
+ return response?.entries;
714
+ }
715
+ }
716
+ async runTables(tableIDs) {
717
+ __assertType("tableIDs", void 0, __assertType__sa__number_ea_2.bind(void 0, tableIDs));
718
+ this.assertSupportsCommand(import_Types.IrrigationCommand, import_Types.IrrigationCommand.ValveTableRun);
719
+ const cc = new IrrigationCCValveTableRun({
720
+ nodeId: this.endpoint.nodeId,
721
+ endpointIndex: this.endpoint.index,
722
+ tableIDs
723
+ });
724
+ return this.host.sendCommand(cc, this.commandOptions);
725
+ }
726
+ /**
727
+ * Shuts off the entire system for the given duration.
728
+ * @param duration Shutoff duration in hours. A value of 255 will shut off the entire system permanently and prevents schedules from running.
729
+ */
730
+ async shutoffSystem(duration) {
731
+ __assertType("duration", "number", __assertType__number.bind(void 0, duration));
732
+ this.assertSupportsCommand(import_Types.IrrigationCommand, import_Types.IrrigationCommand.SystemShutoff);
733
+ const cc = new IrrigationCCSystemShutoff({
734
+ nodeId: this.endpoint.nodeId,
735
+ endpointIndex: this.endpoint.index,
736
+ duration
737
+ });
738
+ return this.host.sendCommand(cc, this.commandOptions);
739
+ }
740
+ /** Shuts off the entire system permanently and prevents schedules from running */
741
+ shutoffSystemPermanently() {
742
+ return this.shutoffSystem(255);
743
+ }
744
+ get [import_API.SET_VALUE]() {
745
+ return async function({ property, propertyKey }, value) {
746
+ const valueDB = this.getValueDB();
747
+ if (systemConfigProperties.includes(property)) {
748
+ const options = {};
749
+ for (const prop of systemConfigProperties) {
750
+ if (prop === property)
729
751
  continue;
730
752
  const valueId = {
731
753
  commandClass: this.ccId,
732
754
  endpoint: this.endpoint.index,
733
- property,
734
- propertyKey: prop
755
+ property: prop
735
756
  };
736
757
  const cachedVal = valueDB.getValue(valueId);
737
758
  if (cachedVal == void 0) {
738
- throw new import_safe.ZWaveError(`The "${property}_${propertyKey}" property cannot be changed before ${property}_${prop} is known!`, import_safe.ZWaveErrorCodes.Argument_Invalid);
759
+ throw new import_safe.ZWaveError(`The "${property}" property cannot be changed before ${prop} is known!`, import_safe.ZWaveErrorCodes.Argument_Invalid);
739
760
  }
740
761
  options[prop] = cachedVal;
741
762
  }
742
- options[propertyKey] = value;
743
- return this.setValveConfig(options);
744
- } else if (propertyKey === "duration") {
745
- return;
746
- } else if (propertyKey === "startStop") {
747
- if (typeof value !== "boolean") {
748
- (0, import_API.throwWrongValueType)(this.ccId, property, "boolean", typeof value);
763
+ options[property] = value;
764
+ return this.setSystemConfig(options);
765
+ } else if (property === "shutoff") {
766
+ return this.shutoffSystem(0);
767
+ } else if (property === "master" || typeof property === "number" && property >= 1) {
768
+ if (propertyKey == void 0) {
769
+ (0, import_API.throwMissingPropertyKey)(this.ccId, property);
749
770
  }
750
- if (value) {
751
- const duration = valueDB.getValue(IrrigationCCValues.valveRunDuration(property).endpoint(this.endpoint.index));
752
- if (duration == void 0) {
753
- throw new import_safe.ZWaveError(`Cannot start a valve run without specifying a duration first!`, import_safe.ZWaveErrorCodes.Argument_Invalid);
771
+ if (valveConfigPropertyKeys.includes(propertyKey)) {
772
+ const options = {
773
+ valveId: property
774
+ };
775
+ for (const prop of valveConfigPropertyKeys) {
776
+ if (prop === propertyKey)
777
+ continue;
778
+ const valueId = {
779
+ commandClass: this.ccId,
780
+ endpoint: this.endpoint.index,
781
+ property,
782
+ propertyKey: prop
783
+ };
784
+ const cachedVal = valueDB.getValue(valueId);
785
+ if (cachedVal == void 0) {
786
+ throw new import_safe.ZWaveError(`The "${property}_${propertyKey}" property cannot be changed before ${property}_${prop} is known!`, import_safe.ZWaveErrorCodes.Argument_Invalid);
787
+ }
788
+ options[prop] = cachedVal;
789
+ }
790
+ options[propertyKey] = value;
791
+ return this.setValveConfig(options);
792
+ } else if (propertyKey === "duration") {
793
+ return;
794
+ } else if (propertyKey === "startStop") {
795
+ if (typeof value !== "boolean") {
796
+ (0, import_API.throwWrongValueType)(this.ccId, property, "boolean", typeof value);
797
+ }
798
+ if (value) {
799
+ const duration = valueDB.getValue(IrrigationCCValues.valveRunDuration(property).endpoint(this.endpoint.index));
800
+ if (duration == void 0) {
801
+ throw new import_safe.ZWaveError(`Cannot start a valve run without specifying a duration first!`, import_safe.ZWaveErrorCodes.Argument_Invalid);
802
+ }
803
+ return this.runValve(property, duration);
804
+ } else {
805
+ return this.shutoffValve(property);
754
806
  }
755
- return this.runValve(property, duration);
756
807
  } else {
757
- return this.shutoffValve(property);
808
+ (0, import_API.throwUnsupportedPropertyKey)(this.ccId, property, propertyKey);
758
809
  }
759
- } else {
760
- (0, import_API.throwUnsupportedPropertyKey)(this.ccId, property, propertyKey);
761
810
  }
762
- }
763
- };
764
- }
765
- get [import_API.POLL_VALUE]() {
766
- return async function({ property, propertyKey }) {
767
- switch (property) {
768
- case "systemVoltage":
769
- case "flowSensorActive":
770
- case "pressureSensorActive":
771
- case "rainSensorActive":
772
- case "moistureSensorActive":
773
- case "flow":
774
- case "pressure":
775
- case "shutoffDuration":
776
- case "errorNotProgrammed":
777
- case "errorEmergencyShutdown":
778
- case "errorHighPressure":
779
- case "errorLowPressure":
780
- case "errorValve":
781
- case "masterValveOpen":
782
- case "firstOpenZoneId":
783
- return (await this.getSystemStatus())?.[property];
784
- case "masterValveDelay":
785
- case "highPressureThreshold":
786
- case "lowPressureThreshold":
787
- case "rainSensorPolarity":
788
- case "moistureSensorPolarity":
789
- return (await this.getSystemConfig())?.[property];
790
- }
791
- if (property === "master" || typeof property === "number" && property >= 1) {
792
- switch (propertyKey) {
793
- case "connected":
794
- case "nominalCurrent":
795
- case "errorShortCircuit":
796
- case "errorHighCurrent":
797
- case "errorLowCurrent":
798
- case "errorMaximumFlow":
799
- case "errorHighFlow":
800
- case "errorLowFlow":
801
- return (await this.getValveInfo(property))?.[propertyKey];
802
- case "nominalCurrentHighThreshold":
803
- case "nominalCurrentLowThreshold":
804
- case "maximumFlow":
805
- case "highFlowThreshold":
806
- case "lowFlowThreshold":
807
- case "useRainSensor":
808
- case "useMoistureSensor":
809
- return (await this.getValveConfig(property))?.[propertyKey];
810
- case void 0:
811
- (0, import_API.throwMissingPropertyKey)(this.ccId, property);
812
- default:
813
- (0, import_API.throwUnsupportedPropertyKey)(this.ccId, property, propertyKey);
811
+ };
812
+ }
813
+ get [import_API.POLL_VALUE]() {
814
+ return async function({ property, propertyKey }) {
815
+ switch (property) {
816
+ case "systemVoltage":
817
+ case "flowSensorActive":
818
+ case "pressureSensorActive":
819
+ case "rainSensorActive":
820
+ case "moistureSensorActive":
821
+ case "flow":
822
+ case "pressure":
823
+ case "shutoffDuration":
824
+ case "errorNotProgrammed":
825
+ case "errorEmergencyShutdown":
826
+ case "errorHighPressure":
827
+ case "errorLowPressure":
828
+ case "errorValve":
829
+ case "masterValveOpen":
830
+ case "firstOpenZoneId":
831
+ return (await this.getSystemStatus())?.[property];
832
+ case "masterValveDelay":
833
+ case "highPressureThreshold":
834
+ case "lowPressureThreshold":
835
+ case "rainSensorPolarity":
836
+ case "moistureSensorPolarity":
837
+ return (await this.getSystemConfig())?.[property];
814
838
  }
815
- }
816
- (0, import_API.throwUnsupportedProperty)(this.ccId, property);
817
- };
818
- }
819
- };
820
- IrrigationCCAPI = __decorate([
821
- (0, import_CommandClassDecorators.API)(import_safe.CommandClasses.Irrigation)
822
- ], IrrigationCCAPI);
823
- let IrrigationCC = IrrigationCC_1 = class IrrigationCC2 extends import_CommandClass.CommandClass {
824
- /**
825
- * Returns the maximum number of valve table entries reported by the node.
826
- * This only works AFTER the node has been interviewed.
827
- */
828
- static getMaxValveTableSizeCached(ctx, endpoint) {
829
- return ctx.getValueDB(endpoint.nodeId).getValue(IrrigationCCValues.maxValveTableSize.endpoint(endpoint.index));
830
- }
831
- /**
832
- * Returns the number of zone valves reported by the node.
833
- * This only works AFTER the node has been interviewed.
834
- */
835
- static getNumValvesCached(ctx, endpoint) {
836
- return ctx.getValueDB(endpoint.nodeId).getValue(IrrigationCCValues.numValves.endpoint(endpoint.index));
837
- }
838
- /**
839
- * Returns whether the node supports a master valve
840
- * This only works AFTER the node has been interviewed.
841
- */
842
- static supportsMasterValveCached(ctx, endpoint) {
843
- return !!ctx.getValueDB(endpoint.nodeId).getValue(IrrigationCCValues.supportsMasterValve.endpoint(endpoint.index));
844
- }
845
- async interview(ctx) {
846
- const node = this.getNode(ctx);
847
- const endpoint = this.getEndpoint(ctx);
848
- const api = import_API.CCAPI.create(import_safe.CommandClasses.Irrigation, ctx, endpoint).withOptions({
849
- priority: import_safe.MessagePriority.NodeQuery
850
- });
851
- ctx.logNode(node.id, {
852
- endpoint: this.endpointIndex,
853
- message: `Interviewing ${this.ccName}...`,
854
- direction: "none"
855
- });
856
- ctx.logNode(node.id, {
857
- endpoint: this.endpointIndex,
858
- message: "Querying irrigation system info...",
859
- direction: "outbound"
860
- });
861
- const systemInfo = await api.getSystemInfo();
862
- if (!systemInfo) {
839
+ if (property === "master" || typeof property === "number" && property >= 1) {
840
+ switch (propertyKey) {
841
+ case "connected":
842
+ case "nominalCurrent":
843
+ case "errorShortCircuit":
844
+ case "errorHighCurrent":
845
+ case "errorLowCurrent":
846
+ case "errorMaximumFlow":
847
+ case "errorHighFlow":
848
+ case "errorLowFlow":
849
+ return (await this.getValveInfo(property))?.[propertyKey];
850
+ case "nominalCurrentHighThreshold":
851
+ case "nominalCurrentLowThreshold":
852
+ case "maximumFlow":
853
+ case "highFlowThreshold":
854
+ case "lowFlowThreshold":
855
+ case "useRainSensor":
856
+ case "useMoistureSensor":
857
+ return (await this.getValveConfig(property))?.[propertyKey];
858
+ case void 0:
859
+ (0, import_API.throwMissingPropertyKey)(this.ccId, property);
860
+ default:
861
+ (0, import_API.throwUnsupportedPropertyKey)(this.ccId, property, propertyKey);
862
+ }
863
+ }
864
+ (0, import_API.throwUnsupportedProperty)(this.ccId, property);
865
+ };
866
+ }
867
+ };
868
+ return IrrigationCCAPI2 = _classThis;
869
+ })();
870
+ let IrrigationCC = (() => {
871
+ let _classDecorators = [(0, import_CommandClassDecorators.commandClass)(import_safe.CommandClasses.Irrigation), (0, import_CommandClassDecorators.implementedVersion)(1), (0, import_CommandClassDecorators.ccValues)(IrrigationCCValues)];
872
+ let _classDescriptor;
873
+ let _classExtraInitializers = [];
874
+ let _classThis;
875
+ let _classSuper = import_CommandClass.CommandClass;
876
+ var IrrigationCC2 = class extends _classSuper {
877
+ static {
878
+ _classThis = this;
879
+ }
880
+ static {
881
+ const _metadata = typeof Symbol === "function" && Symbol.metadata ? Object.create(_classSuper[Symbol.metadata] ?? null) : void 0;
882
+ __esDecorate(null, _classDescriptor = { value: _classThis }, _classDecorators, { kind: "class", name: _classThis.name, metadata: _metadata }, null, _classExtraInitializers);
883
+ IrrigationCC2 = _classThis = _classDescriptor.value;
884
+ if (_metadata) Object.defineProperty(_classThis, Symbol.metadata, { enumerable: true, configurable: true, writable: true, value: _metadata });
885
+ __runInitializers(_classThis, _classExtraInitializers);
886
+ }
887
+ /**
888
+ * Returns the maximum number of valve table entries reported by the node.
889
+ * This only works AFTER the node has been interviewed.
890
+ */
891
+ static getMaxValveTableSizeCached(ctx, endpoint) {
892
+ return ctx.getValueDB(endpoint.nodeId).getValue(IrrigationCCValues.maxValveTableSize.endpoint(endpoint.index));
893
+ }
894
+ /**
895
+ * Returns the number of zone valves reported by the node.
896
+ * This only works AFTER the node has been interviewed.
897
+ */
898
+ static getNumValvesCached(ctx, endpoint) {
899
+ return ctx.getValueDB(endpoint.nodeId).getValue(IrrigationCCValues.numValves.endpoint(endpoint.index));
900
+ }
901
+ /**
902
+ * Returns whether the node supports a master valve
903
+ * This only works AFTER the node has been interviewed.
904
+ */
905
+ static supportsMasterValveCached(ctx, endpoint) {
906
+ return !!ctx.getValueDB(endpoint.nodeId).getValue(IrrigationCCValues.supportsMasterValve.endpoint(endpoint.index));
907
+ }
908
+ async interview(ctx) {
909
+ const node = this.getNode(ctx);
910
+ const endpoint = this.getEndpoint(ctx);
911
+ const api = import_API.CCAPI.create(import_safe.CommandClasses.Irrigation, ctx, endpoint).withOptions({
912
+ priority: import_safe.MessagePriority.NodeQuery
913
+ });
863
914
  ctx.logNode(node.id, {
864
915
  endpoint: this.endpointIndex,
865
- message: "Time out while querying irrigation system info, skipping interview...",
866
- level: "warn"
916
+ message: `Interviewing ${this.ccName}...`,
917
+ direction: "none"
867
918
  });
868
- return;
869
- }
870
- const logMessage = `received irrigation system info:
919
+ ctx.logNode(node.id, {
920
+ endpoint: this.endpointIndex,
921
+ message: "Querying irrigation system info...",
922
+ direction: "outbound"
923
+ });
924
+ const systemInfo = await api.getSystemInfo();
925
+ if (!systemInfo) {
926
+ ctx.logNode(node.id, {
927
+ endpoint: this.endpointIndex,
928
+ message: "Time out while querying irrigation system info, skipping interview...",
929
+ level: "warn"
930
+ });
931
+ return;
932
+ }
933
+ const logMessage = `received irrigation system info:
871
934
  supports master valve: ${systemInfo.supportsMasterValve}
872
935
  no. of valves: ${systemInfo.numValves}
873
936
  no. of valve tables: ${systemInfo.numValveTables}
874
937
  max. valve table size: ${systemInfo.maxValveTableSize}`;
875
- ctx.logNode(node.id, {
876
- endpoint: this.endpointIndex,
877
- message: logMessage,
878
- direction: "inbound"
879
- });
880
- for (let i = 1; i <= systemInfo.numValves; i++) {
881
- this.ensureMetadata(ctx, IrrigationCCValues.valveRunDuration(i));
882
- this.ensureMetadata(ctx, IrrigationCCValues.valveRunStartStop(i));
883
- }
884
- this.ensureMetadata(ctx, IrrigationCCValues.shutoffSystem);
885
- await this.refreshValues(ctx);
886
- this.setInterviewComplete(ctx, true);
887
- }
888
- async refreshValues(ctx) {
889
- const node = this.getNode(ctx);
890
- const endpoint = this.getEndpoint(ctx);
891
- const api = import_API.CCAPI.create(import_safe.CommandClasses.Irrigation, ctx, endpoint).withOptions({
892
- priority: import_safe.MessagePriority.NodeQuery
893
- });
894
- ctx.logNode(node.id, {
895
- endpoint: this.endpointIndex,
896
- message: "Querying irrigation system configuration...",
897
- direction: "outbound"
898
- });
899
- const systemConfig = await api.getSystemConfig();
900
- if (systemConfig) {
901
- let logMessage = `received irrigation system configuration:
902
- master valve delay: ${systemConfig.masterValveDelay} seconds
903
- high pressure threshold: ${systemConfig.highPressureThreshold} kPa
904
- low pressure threshold: ${systemConfig.lowPressureThreshold} kPa`;
905
- if (systemConfig.rainSensorPolarity != void 0) {
906
- logMessage += `
907
- rain sensor polarity: ${(0, import_safe3.getEnumMemberName)(import_Types.IrrigationSensorPolarity, systemConfig.rainSensorPolarity)}`;
908
- }
909
- if (systemConfig.moistureSensorPolarity != void 0) {
910
- logMessage += `
911
- moisture sensor polarity: ${(0, import_safe3.getEnumMemberName)(import_Types.IrrigationSensorPolarity, systemConfig.moistureSensorPolarity)}`;
912
- }
913
938
  ctx.logNode(node.id, {
914
939
  endpoint: this.endpointIndex,
915
940
  message: logMessage,
916
941
  direction: "inbound"
917
942
  });
943
+ for (let i = 1; i <= systemInfo.numValves; i++) {
944
+ this.ensureMetadata(ctx, IrrigationCCValues.valveRunDuration(i));
945
+ this.ensureMetadata(ctx, IrrigationCCValues.valveRunStartStop(i));
946
+ }
947
+ this.ensureMetadata(ctx, IrrigationCCValues.shutoffSystem);
948
+ await this.refreshValues(ctx);
949
+ this.setInterviewComplete(ctx, true);
918
950
  }
919
- ctx.logNode(node.id, {
920
- endpoint: this.endpointIndex,
921
- message: "Querying irrigation system status...",
922
- direction: "outbound"
923
- });
924
- await api.getSystemStatus();
925
- if (IrrigationCC_1.supportsMasterValveCached(ctx, endpoint)) {
926
- ctx.logNode(node.id, {
927
- endpoint: this.endpointIndex,
928
- message: "Querying master valve configuration...",
929
- direction: "outbound"
951
+ async refreshValues(ctx) {
952
+ const node = this.getNode(ctx);
953
+ const endpoint = this.getEndpoint(ctx);
954
+ const api = import_API.CCAPI.create(import_safe.CommandClasses.Irrigation, ctx, endpoint).withOptions({
955
+ priority: import_safe.MessagePriority.NodeQuery
930
956
  });
931
- await api.getValveConfig("master");
932
957
  ctx.logNode(node.id, {
933
958
  endpoint: this.endpointIndex,
934
- message: "Querying master valve status...",
959
+ message: "Querying irrigation system configuration...",
935
960
  direction: "outbound"
936
961
  });
937
- await api.getValveInfo("master");
938
- }
939
- for (let i = 1; i <= (IrrigationCC_1.getNumValvesCached(ctx, endpoint) ?? 0); i++) {
962
+ const systemConfig = await api.getSystemConfig();
963
+ if (systemConfig) {
964
+ let logMessage = `received irrigation system configuration:
965
+ master valve delay: ${systemConfig.masterValveDelay} seconds
966
+ high pressure threshold: ${systemConfig.highPressureThreshold} kPa
967
+ low pressure threshold: ${systemConfig.lowPressureThreshold} kPa`;
968
+ if (systemConfig.rainSensorPolarity != void 0) {
969
+ logMessage += `
970
+ rain sensor polarity: ${(0, import_safe3.getEnumMemberName)(import_Types.IrrigationSensorPolarity, systemConfig.rainSensorPolarity)}`;
971
+ }
972
+ if (systemConfig.moistureSensorPolarity != void 0) {
973
+ logMessage += `
974
+ moisture sensor polarity: ${(0, import_safe3.getEnumMemberName)(import_Types.IrrigationSensorPolarity, systemConfig.moistureSensorPolarity)}`;
975
+ }
976
+ ctx.logNode(node.id, {
977
+ endpoint: this.endpointIndex,
978
+ message: logMessage,
979
+ direction: "inbound"
980
+ });
981
+ }
940
982
  ctx.logNode(node.id, {
941
983
  endpoint: this.endpointIndex,
942
- message: `Querying configuration for valve ${(0, import_strings.padStart)(i.toString(), 3, "0")}...`,
984
+ message: "Querying irrigation system status...",
943
985
  direction: "outbound"
944
986
  });
945
- await api.getValveConfig(i);
946
- ctx.logNode(node.id, {
947
- endpoint: this.endpointIndex,
948
- message: `Querying status for valve ${(0, import_strings.padStart)(i.toString(), 3, "0")}...`,
949
- direction: "outbound"
987
+ await api.getSystemStatus();
988
+ if (IrrigationCC2.supportsMasterValveCached(ctx, endpoint)) {
989
+ ctx.logNode(node.id, {
990
+ endpoint: this.endpointIndex,
991
+ message: "Querying master valve configuration...",
992
+ direction: "outbound"
993
+ });
994
+ await api.getValveConfig("master");
995
+ ctx.logNode(node.id, {
996
+ endpoint: this.endpointIndex,
997
+ message: "Querying master valve status...",
998
+ direction: "outbound"
999
+ });
1000
+ await api.getValveInfo("master");
1001
+ }
1002
+ for (let i = 1; i <= (IrrigationCC2.getNumValvesCached(ctx, endpoint) ?? 0); i++) {
1003
+ ctx.logNode(node.id, {
1004
+ endpoint: this.endpointIndex,
1005
+ message: `Querying configuration for valve ${(0, import_strings.padStart)(i.toString(), 3, "0")}...`,
1006
+ direction: "outbound"
1007
+ });
1008
+ await api.getValveConfig(i);
1009
+ ctx.logNode(node.id, {
1010
+ endpoint: this.endpointIndex,
1011
+ message: `Querying status for valve ${(0, import_strings.padStart)(i.toString(), 3, "0")}...`,
1012
+ direction: "outbound"
1013
+ });
1014
+ await api.getValveInfo(i);
1015
+ }
1016
+ }
1017
+ translateProperty(ctx, property, propertyKey) {
1018
+ if (property === "master") {
1019
+ return "Master valve";
1020
+ } else if (typeof property === "number") {
1021
+ return `Valve ${(0, import_strings.padStart)(property.toString(), 3, "0")}`;
1022
+ }
1023
+ return super.translateProperty(ctx, property, propertyKey);
1024
+ }
1025
+ };
1026
+ return IrrigationCC2 = _classThis;
1027
+ })();
1028
+ let IrrigationCCSystemInfoReport = (() => {
1029
+ let _classDecorators = [(0, import_CommandClassDecorators.CCCommand)(import_Types.IrrigationCommand.SystemInfoReport), (0, import_CommandClassDecorators.ccValueProperty)("numValves", IrrigationCCValues.numValves), (0, import_CommandClassDecorators.ccValueProperty)("numValveTables", IrrigationCCValues.numValveTables), (0, import_CommandClassDecorators.ccValueProperty)("supportsMasterValve", IrrigationCCValues.supportsMasterValve), (0, import_CommandClassDecorators.ccValueProperty)("maxValveTableSize", IrrigationCCValues.maxValveTableSize)];
1030
+ let _classDescriptor;
1031
+ let _classExtraInitializers = [];
1032
+ let _classThis;
1033
+ let _classSuper = IrrigationCC;
1034
+ var IrrigationCCSystemInfoReport2 = class extends _classSuper {
1035
+ static {
1036
+ _classThis = this;
1037
+ }
1038
+ static {
1039
+ const _metadata = typeof Symbol === "function" && Symbol.metadata ? Object.create(_classSuper[Symbol.metadata] ?? null) : void 0;
1040
+ __esDecorate(null, _classDescriptor = { value: _classThis }, _classDecorators, { kind: "class", name: _classThis.name, metadata: _metadata }, null, _classExtraInitializers);
1041
+ IrrigationCCSystemInfoReport2 = _classThis = _classDescriptor.value;
1042
+ if (_metadata) Object.defineProperty(_classThis, Symbol.metadata, { enumerable: true, configurable: true, writable: true, value: _metadata });
1043
+ __runInitializers(_classThis, _classExtraInitializers);
1044
+ }
1045
+ constructor(options) {
1046
+ super(options);
1047
+ this.supportsMasterValve = options.supportsMasterValve;
1048
+ this.numValves = options.numValves;
1049
+ this.numValveTables = options.numValveTables;
1050
+ this.maxValveTableSize = options.maxValveTableSize;
1051
+ }
1052
+ static from(raw, ctx) {
1053
+ (0, import_safe.validatePayload)(raw.payload.length >= 4);
1054
+ const supportsMasterValve = !!(raw.payload[0] & 1);
1055
+ const numValves = raw.payload[1];
1056
+ const numValveTables = raw.payload[2];
1057
+ const maxValveTableSize = raw.payload[3] & 15;
1058
+ return new this({
1059
+ nodeId: ctx.sourceNodeId,
1060
+ supportsMasterValve,
1061
+ numValves,
1062
+ numValveTables,
1063
+ maxValveTableSize
950
1064
  });
951
- await api.getValveInfo(i);
952
1065
  }
953
- }
954
- translateProperty(ctx, property, propertyKey) {
955
- if (property === "master") {
956
- return "Master valve";
957
- } else if (typeof property === "number") {
958
- return `Valve ${(0, import_strings.padStart)(property.toString(), 3, "0")}`;
1066
+ numValves;
1067
+ numValveTables;
1068
+ supportsMasterValve;
1069
+ maxValveTableSize;
1070
+ toLogEntry(ctx) {
1071
+ return {
1072
+ ...super.toLogEntry(ctx),
1073
+ message: {
1074
+ "supports master valve": this.supportsMasterValve,
1075
+ "no. of valves": this.numValves,
1076
+ "no. of valve tables": this.numValveTables,
1077
+ "max. valve table size": this.maxValveTableSize
1078
+ }
1079
+ };
959
1080
  }
960
- return super.translateProperty(ctx, property, propertyKey);
961
- }
962
- };
963
- IrrigationCC = IrrigationCC_1 = __decorate([
964
- (0, import_CommandClassDecorators.commandClass)(import_safe.CommandClasses.Irrigation),
965
- (0, import_CommandClassDecorators.implementedVersion)(1),
966
- (0, import_CommandClassDecorators.ccValues)(IrrigationCCValues)
967
- ], IrrigationCC);
968
- let IrrigationCCSystemInfoReport = IrrigationCCSystemInfoReport_1 = class IrrigationCCSystemInfoReport2 extends IrrigationCC {
969
- constructor(options) {
970
- super(options);
971
- this.supportsMasterValve = options.supportsMasterValve;
972
- this.numValves = options.numValves;
973
- this.numValveTables = options.numValveTables;
974
- this.maxValveTableSize = options.maxValveTableSize;
975
- }
976
- static from(raw, ctx) {
977
- (0, import_safe.validatePayload)(raw.payload.length >= 4);
978
- const supportsMasterValve = !!(raw.payload[0] & 1);
979
- const numValves = raw.payload[1];
980
- const numValveTables = raw.payload[2];
981
- const maxValveTableSize = raw.payload[3] & 15;
982
- return new IrrigationCCSystemInfoReport_1({
983
- nodeId: ctx.sourceNodeId,
984
- supportsMasterValve,
985
- numValves,
986
- numValveTables,
987
- maxValveTableSize
988
- });
989
- }
990
- numValves;
991
- numValveTables;
992
- supportsMasterValve;
993
- maxValveTableSize;
994
- toLogEntry(ctx) {
995
- return {
996
- ...super.toLogEntry(ctx),
997
- message: {
998
- "supports master valve": this.supportsMasterValve,
999
- "no. of valves": this.numValves,
1000
- "no. of valve tables": this.numValveTables,
1001
- "max. valve table size": this.maxValveTableSize
1081
+ };
1082
+ return IrrigationCCSystemInfoReport2 = _classThis;
1083
+ })();
1084
+ let IrrigationCCSystemInfoGet = (() => {
1085
+ let _classDecorators = [(0, import_CommandClassDecorators.CCCommand)(import_Types.IrrigationCommand.SystemInfoGet), (0, import_CommandClassDecorators.expectedCCResponse)(IrrigationCCSystemInfoReport)];
1086
+ let _classDescriptor;
1087
+ let _classExtraInitializers = [];
1088
+ let _classThis;
1089
+ let _classSuper = IrrigationCC;
1090
+ var IrrigationCCSystemInfoGet2 = class extends _classSuper {
1091
+ static {
1092
+ _classThis = this;
1093
+ }
1094
+ static {
1095
+ const _metadata = typeof Symbol === "function" && Symbol.metadata ? Object.create(_classSuper[Symbol.metadata] ?? null) : void 0;
1096
+ __esDecorate(null, _classDescriptor = { value: _classThis }, _classDecorators, { kind: "class", name: _classThis.name, metadata: _metadata }, null, _classExtraInitializers);
1097
+ IrrigationCCSystemInfoGet2 = _classThis = _classDescriptor.value;
1098
+ if (_metadata) Object.defineProperty(_classThis, Symbol.metadata, { enumerable: true, configurable: true, writable: true, value: _metadata });
1099
+ __runInitializers(_classThis, _classExtraInitializers);
1100
+ }
1101
+ };
1102
+ return IrrigationCCSystemInfoGet2 = _classThis;
1103
+ })();
1104
+ let IrrigationCCSystemStatusReport = (() => {
1105
+ let _classDecorators = [(0, import_CommandClassDecorators.CCCommand)(import_Types.IrrigationCommand.SystemStatusReport), (0, import_CommandClassDecorators.ccValueProperty)("systemVoltage", IrrigationCCValues.systemVoltage), (0, import_CommandClassDecorators.ccValueProperty)("flowSensorActive", IrrigationCCValues.flowSensorActive), (0, import_CommandClassDecorators.ccValueProperty)("pressureSensorActive", IrrigationCCValues.pressureSensorActive), (0, import_CommandClassDecorators.ccValueProperty)("rainSensorActive", IrrigationCCValues.rainSensorActive), (0, import_CommandClassDecorators.ccValueProperty)("moistureSensorActive", IrrigationCCValues.moistureSensorActive), (0, import_CommandClassDecorators.ccValueProperty)("flow", IrrigationCCValues.flow), (0, import_CommandClassDecorators.ccValueProperty)("pressure", IrrigationCCValues.pressure), (0, import_CommandClassDecorators.ccValueProperty)("shutoffDuration", IrrigationCCValues.shutoffDuration), (0, import_CommandClassDecorators.ccValueProperty)("errorNotProgrammed", IrrigationCCValues.errorNotProgrammed), (0, import_CommandClassDecorators.ccValueProperty)("errorEmergencyShutdown", IrrigationCCValues.errorEmergencyShutdown), (0, import_CommandClassDecorators.ccValueProperty)("errorHighPressure", IrrigationCCValues.errorHighPressure), (0, import_CommandClassDecorators.ccValueProperty)("errorLowPressure", IrrigationCCValues.errorLowPressure), (0, import_CommandClassDecorators.ccValueProperty)("errorValve", IrrigationCCValues.errorValve), (0, import_CommandClassDecorators.ccValueProperty)("masterValveOpen", IrrigationCCValues.masterValveOpen), (0, import_CommandClassDecorators.ccValueProperty)("firstOpenZoneId", IrrigationCCValues.firstOpenZoneId)];
1106
+ let _classDescriptor;
1107
+ let _classExtraInitializers = [];
1108
+ let _classThis;
1109
+ let _classSuper = IrrigationCC;
1110
+ var IrrigationCCSystemStatusReport2 = class extends _classSuper {
1111
+ static {
1112
+ _classThis = this;
1113
+ }
1114
+ static {
1115
+ const _metadata = typeof Symbol === "function" && Symbol.metadata ? Object.create(_classSuper[Symbol.metadata] ?? null) : void 0;
1116
+ __esDecorate(null, _classDescriptor = { value: _classThis }, _classDecorators, { kind: "class", name: _classThis.name, metadata: _metadata }, null, _classExtraInitializers);
1117
+ IrrigationCCSystemStatusReport2 = _classThis = _classDescriptor.value;
1118
+ if (_metadata) Object.defineProperty(_classThis, Symbol.metadata, { enumerable: true, configurable: true, writable: true, value: _metadata });
1119
+ __runInitializers(_classThis, _classExtraInitializers);
1120
+ }
1121
+ constructor(options) {
1122
+ super(options);
1123
+ this.systemVoltage = options.systemVoltage;
1124
+ this.flowSensorActive = options.flowSensorActive;
1125
+ this.pressureSensorActive = options.pressureSensorActive;
1126
+ this.rainSensorActive = options.rainSensorActive;
1127
+ this.moistureSensorActive = options.moistureSensorActive;
1128
+ this.flow = options.flow;
1129
+ this.pressure = options.pressure;
1130
+ this.shutoffDuration = options.shutoffDuration;
1131
+ this.errorNotProgrammed = options.errorNotProgrammed;
1132
+ this.errorEmergencyShutdown = options.errorEmergencyShutdown;
1133
+ this.errorHighPressure = options.errorHighPressure;
1134
+ this.errorLowPressure = options.errorLowPressure;
1135
+ this.errorValve = options.errorValve;
1136
+ this.masterValveOpen = options.masterValveOpen;
1137
+ this.firstOpenZoneId = options.firstOpenZoneId;
1138
+ }
1139
+ static from(raw, ctx) {
1140
+ (0, import_safe.validatePayload)(raw.payload.length >= 2);
1141
+ const systemVoltage = raw.payload[0];
1142
+ const flowSensorActive = !!(raw.payload[1] & 1);
1143
+ const pressureSensorActive = !!(raw.payload[1] & 2);
1144
+ const rainSensorActive = !!(raw.payload[1] & 4);
1145
+ const moistureSensorActive = !!(raw.payload[1] & 8);
1146
+ let offset = 2;
1147
+ let flow;
1148
+ {
1149
+ const { value, scale, bytesRead } = (0, import_safe.parseFloatWithScale)(raw.payload.subarray(offset));
1150
+ (0, import_safe.validatePayload)(scale === 0);
1151
+ if (flowSensorActive)
1152
+ flow = value;
1153
+ offset += bytesRead;
1002
1154
  }
1003
- };
1004
- }
1005
- };
1006
- __decorate([
1007
- (0, import_CommandClassDecorators.ccValue)(IrrigationCCValues.numValves)
1008
- ], IrrigationCCSystemInfoReport.prototype, "numValves", void 0);
1009
- __decorate([
1010
- (0, import_CommandClassDecorators.ccValue)(IrrigationCCValues.numValveTables)
1011
- ], IrrigationCCSystemInfoReport.prototype, "numValveTables", void 0);
1012
- __decorate([
1013
- (0, import_CommandClassDecorators.ccValue)(IrrigationCCValues.supportsMasterValve)
1014
- ], IrrigationCCSystemInfoReport.prototype, "supportsMasterValve", void 0);
1015
- __decorate([
1016
- (0, import_CommandClassDecorators.ccValue)(IrrigationCCValues.maxValveTableSize)
1017
- ], IrrigationCCSystemInfoReport.prototype, "maxValveTableSize", void 0);
1018
- IrrigationCCSystemInfoReport = IrrigationCCSystemInfoReport_1 = __decorate([
1019
- (0, import_CommandClassDecorators.CCCommand)(import_Types.IrrigationCommand.SystemInfoReport)
1020
- ], IrrigationCCSystemInfoReport);
1021
- let IrrigationCCSystemInfoGet = class IrrigationCCSystemInfoGet2 extends IrrigationCC {
1022
- };
1023
- IrrigationCCSystemInfoGet = __decorate([
1024
- (0, import_CommandClassDecorators.CCCommand)(import_Types.IrrigationCommand.SystemInfoGet),
1025
- (0, import_CommandClassDecorators.expectedCCResponse)(IrrigationCCSystemInfoReport)
1026
- ], IrrigationCCSystemInfoGet);
1027
- let IrrigationCCSystemStatusReport = IrrigationCCSystemStatusReport_1 = class IrrigationCCSystemStatusReport2 extends IrrigationCC {
1028
- constructor(options) {
1029
- super(options);
1030
- this.systemVoltage = options.systemVoltage;
1031
- this.flowSensorActive = options.flowSensorActive;
1032
- this.pressureSensorActive = options.pressureSensorActive;
1033
- this.rainSensorActive = options.rainSensorActive;
1034
- this.moistureSensorActive = options.moistureSensorActive;
1035
- this.flow = options.flow;
1036
- this.pressure = options.pressure;
1037
- this.shutoffDuration = options.shutoffDuration;
1038
- this.errorNotProgrammed = options.errorNotProgrammed;
1039
- this.errorEmergencyShutdown = options.errorEmergencyShutdown;
1040
- this.errorHighPressure = options.errorHighPressure;
1041
- this.errorLowPressure = options.errorLowPressure;
1042
- this.errorValve = options.errorValve;
1043
- this.masterValveOpen = options.masterValveOpen;
1044
- this.firstOpenZoneId = options.firstOpenZoneId;
1045
- }
1046
- static from(raw, ctx) {
1047
- (0, import_safe.validatePayload)(raw.payload.length >= 2);
1048
- const systemVoltage = raw.payload[0];
1049
- const flowSensorActive = !!(raw.payload[1] & 1);
1050
- const pressureSensorActive = !!(raw.payload[1] & 2);
1051
- const rainSensorActive = !!(raw.payload[1] & 4);
1052
- const moistureSensorActive = !!(raw.payload[1] & 8);
1053
- let offset = 2;
1054
- let flow;
1055
- {
1056
- const { value, scale, bytesRead } = (0, import_safe.parseFloatWithScale)(raw.payload.subarray(offset));
1057
- (0, import_safe.validatePayload)(scale === 0);
1058
- if (flowSensorActive)
1059
- flow = value;
1060
- offset += bytesRead;
1061
- }
1062
- let pressure;
1063
- {
1064
- const { value, scale, bytesRead } = (0, import_safe.parseFloatWithScale)(raw.payload.subarray(offset));
1065
- (0, import_safe.validatePayload)(scale === 0);
1066
- if (pressureSensorActive)
1067
- pressure = value;
1068
- offset += bytesRead;
1069
- }
1070
- (0, import_safe.validatePayload)(raw.payload.length >= offset + 4);
1071
- const shutoffDuration = raw.payload[offset];
1072
- const errorNotProgrammed = !!(raw.payload[offset + 1] & 1);
1073
- const errorEmergencyShutdown = !!(raw.payload[offset + 1] & 2);
1074
- const errorHighPressure = !!(raw.payload[offset + 1] & 4);
1075
- const errorLowPressure = !!(raw.payload[offset + 1] & 8);
1076
- const errorValve = !!(raw.payload[offset + 1] & 16);
1077
- const masterValveOpen = !!(raw.payload[offset + 2] & 1);
1078
- let firstOpenZoneId;
1079
- if (raw.payload[offset + 3]) {
1080
- firstOpenZoneId = raw.payload[offset + 3];
1081
- }
1082
- return new IrrigationCCSystemStatusReport_1({
1083
- nodeId: ctx.sourceNodeId,
1084
- systemVoltage,
1085
- flowSensorActive,
1086
- pressureSensorActive,
1087
- rainSensorActive,
1088
- moistureSensorActive,
1089
- flow,
1090
- pressure,
1091
- shutoffDuration,
1092
- errorNotProgrammed,
1093
- errorEmergencyShutdown,
1094
- errorHighPressure,
1095
- errorLowPressure,
1096
- errorValve,
1097
- masterValveOpen,
1098
- firstOpenZoneId
1099
- });
1100
- }
1101
- systemVoltage;
1102
- flowSensorActive;
1103
- pressureSensorActive;
1104
- rainSensorActive;
1105
- moistureSensorActive;
1106
- flow;
1107
- pressure;
1108
- shutoffDuration;
1109
- errorNotProgrammed;
1110
- errorEmergencyShutdown;
1111
- errorHighPressure;
1112
- errorLowPressure;
1113
- errorValve;
1114
- masterValveOpen;
1115
- firstOpenZoneId;
1116
- toLogEntry(ctx) {
1117
- const message = {
1118
- "system voltage": `${this.systemVoltage} V`,
1119
- "active sensors": [
1120
- this.flowSensorActive ? "flow" : void 0,
1121
- this.pressureSensorActive ? "pressure" : void 0,
1122
- this.rainSensorActive ? "rain" : void 0,
1123
- this.moistureSensorActive ? "moisture" : void 0
1124
- ].filter(Boolean).join(", ")
1125
- };
1126
- if (this.flow != void 0) {
1127
- message.flow = `${this.flow} l/h`;
1128
- }
1129
- if (this.pressure != void 0) {
1130
- message.pressure = `${this.pressure} kPa`;
1131
- }
1132
- message["remaining shutoff duration"] = `${this.shutoffDuration} hours`;
1133
- message["master valve status"] = this.masterValveOpen ? "open" : "closed";
1134
- message["first open zone valve"] = this.firstOpenZoneId || "none";
1135
- const errors = [
1136
- this.errorNotProgrammed ? "device not programmed" : void 0,
1137
- this.errorEmergencyShutdown ? "emergency shutdown" : void 0,
1138
- this.errorHighPressure ? "high pressure threshold triggered" : void 0,
1139
- this.errorLowPressure ? "low pressure threshold triggered" : void 0,
1140
- this.errorValve ? "a valve or the master valve has an error" : void 0
1141
- ].filter(Boolean);
1142
- if (errors.length > 0) {
1143
- message.errors = errors.map((e) => `
1155
+ let pressure;
1156
+ {
1157
+ const { value, scale, bytesRead } = (0, import_safe.parseFloatWithScale)(raw.payload.subarray(offset));
1158
+ (0, import_safe.validatePayload)(scale === 0);
1159
+ if (pressureSensorActive)
1160
+ pressure = value;
1161
+ offset += bytesRead;
1162
+ }
1163
+ (0, import_safe.validatePayload)(raw.payload.length >= offset + 4);
1164
+ const shutoffDuration = raw.payload[offset];
1165
+ const errorNotProgrammed = !!(raw.payload[offset + 1] & 1);
1166
+ const errorEmergencyShutdown = !!(raw.payload[offset + 1] & 2);
1167
+ const errorHighPressure = !!(raw.payload[offset + 1] & 4);
1168
+ const errorLowPressure = !!(raw.payload[offset + 1] & 8);
1169
+ const errorValve = !!(raw.payload[offset + 1] & 16);
1170
+ const masterValveOpen = !!(raw.payload[offset + 2] & 1);
1171
+ let firstOpenZoneId;
1172
+ if (raw.payload[offset + 3]) {
1173
+ firstOpenZoneId = raw.payload[offset + 3];
1174
+ }
1175
+ return new this({
1176
+ nodeId: ctx.sourceNodeId,
1177
+ systemVoltage,
1178
+ flowSensorActive,
1179
+ pressureSensorActive,
1180
+ rainSensorActive,
1181
+ moistureSensorActive,
1182
+ flow,
1183
+ pressure,
1184
+ shutoffDuration,
1185
+ errorNotProgrammed,
1186
+ errorEmergencyShutdown,
1187
+ errorHighPressure,
1188
+ errorLowPressure,
1189
+ errorValve,
1190
+ masterValveOpen,
1191
+ firstOpenZoneId
1192
+ });
1193
+ }
1194
+ systemVoltage;
1195
+ flowSensorActive;
1196
+ pressureSensorActive;
1197
+ rainSensorActive;
1198
+ moistureSensorActive;
1199
+ flow;
1200
+ pressure;
1201
+ shutoffDuration;
1202
+ errorNotProgrammed;
1203
+ errorEmergencyShutdown;
1204
+ errorHighPressure;
1205
+ errorLowPressure;
1206
+ errorValve;
1207
+ masterValveOpen;
1208
+ firstOpenZoneId;
1209
+ toLogEntry(ctx) {
1210
+ const message = {
1211
+ "system voltage": `${this.systemVoltage} V`,
1212
+ "active sensors": [
1213
+ this.flowSensorActive ? "flow" : void 0,
1214
+ this.pressureSensorActive ? "pressure" : void 0,
1215
+ this.rainSensorActive ? "rain" : void 0,
1216
+ this.moistureSensorActive ? "moisture" : void 0
1217
+ ].filter(Boolean).join(", ")
1218
+ };
1219
+ if (this.flow != void 0) {
1220
+ message.flow = `${this.flow} l/h`;
1221
+ }
1222
+ if (this.pressure != void 0) {
1223
+ message.pressure = `${this.pressure} kPa`;
1224
+ }
1225
+ message["remaining shutoff duration"] = `${this.shutoffDuration} hours`;
1226
+ message["master valve status"] = this.masterValveOpen ? "open" : "closed";
1227
+ message["first open zone valve"] = this.firstOpenZoneId || "none";
1228
+ const errors = [
1229
+ this.errorNotProgrammed ? "device not programmed" : void 0,
1230
+ this.errorEmergencyShutdown ? "emergency shutdown" : void 0,
1231
+ this.errorHighPressure ? "high pressure threshold triggered" : void 0,
1232
+ this.errorLowPressure ? "low pressure threshold triggered" : void 0,
1233
+ this.errorValve ? "a valve or the master valve has an error" : void 0
1234
+ ].filter(Boolean);
1235
+ if (errors.length > 0) {
1236
+ message.errors = errors.map((e) => `
1144
1237
  \xB7 ${e}`).join("");
1238
+ }
1239
+ return {
1240
+ ...super.toLogEntry(ctx),
1241
+ message
1242
+ };
1145
1243
  }
1146
- return {
1147
- ...super.toLogEntry(ctx),
1148
- message
1149
- };
1150
- }
1151
- };
1152
- __decorate([
1153
- (0, import_CommandClassDecorators.ccValue)(IrrigationCCValues.systemVoltage)
1154
- ], IrrigationCCSystemStatusReport.prototype, "systemVoltage", void 0);
1155
- __decorate([
1156
- (0, import_CommandClassDecorators.ccValue)(IrrigationCCValues.flowSensorActive)
1157
- ], IrrigationCCSystemStatusReport.prototype, "flowSensorActive", void 0);
1158
- __decorate([
1159
- (0, import_CommandClassDecorators.ccValue)(IrrigationCCValues.pressureSensorActive)
1160
- ], IrrigationCCSystemStatusReport.prototype, "pressureSensorActive", void 0);
1161
- __decorate([
1162
- (0, import_CommandClassDecorators.ccValue)(IrrigationCCValues.rainSensorActive)
1163
- ], IrrigationCCSystemStatusReport.prototype, "rainSensorActive", void 0);
1164
- __decorate([
1165
- (0, import_CommandClassDecorators.ccValue)(IrrigationCCValues.moistureSensorActive)
1166
- ], IrrigationCCSystemStatusReport.prototype, "moistureSensorActive", void 0);
1167
- __decorate([
1168
- (0, import_CommandClassDecorators.ccValue)(IrrigationCCValues.flow)
1169
- ], IrrigationCCSystemStatusReport.prototype, "flow", void 0);
1170
- __decorate([
1171
- (0, import_CommandClassDecorators.ccValue)(IrrigationCCValues.pressure)
1172
- ], IrrigationCCSystemStatusReport.prototype, "pressure", void 0);
1173
- __decorate([
1174
- (0, import_CommandClassDecorators.ccValue)(IrrigationCCValues.shutoffDuration)
1175
- ], IrrigationCCSystemStatusReport.prototype, "shutoffDuration", void 0);
1176
- __decorate([
1177
- (0, import_CommandClassDecorators.ccValue)(IrrigationCCValues.errorNotProgrammed)
1178
- ], IrrigationCCSystemStatusReport.prototype, "errorNotProgrammed", void 0);
1179
- __decorate([
1180
- (0, import_CommandClassDecorators.ccValue)(IrrigationCCValues.errorEmergencyShutdown)
1181
- ], IrrigationCCSystemStatusReport.prototype, "errorEmergencyShutdown", void 0);
1182
- __decorate([
1183
- (0, import_CommandClassDecorators.ccValue)(IrrigationCCValues.errorHighPressure)
1184
- ], IrrigationCCSystemStatusReport.prototype, "errorHighPressure", void 0);
1185
- __decorate([
1186
- (0, import_CommandClassDecorators.ccValue)(IrrigationCCValues.errorLowPressure)
1187
- ], IrrigationCCSystemStatusReport.prototype, "errorLowPressure", void 0);
1188
- __decorate([
1189
- (0, import_CommandClassDecorators.ccValue)(IrrigationCCValues.errorValve)
1190
- ], IrrigationCCSystemStatusReport.prototype, "errorValve", void 0);
1191
- __decorate([
1192
- (0, import_CommandClassDecorators.ccValue)(IrrigationCCValues.masterValveOpen)
1193
- ], IrrigationCCSystemStatusReport.prototype, "masterValveOpen", void 0);
1194
- __decorate([
1195
- (0, import_CommandClassDecorators.ccValue)(IrrigationCCValues.firstOpenZoneId)
1196
- ], IrrigationCCSystemStatusReport.prototype, "firstOpenZoneId", void 0);
1197
- IrrigationCCSystemStatusReport = IrrigationCCSystemStatusReport_1 = __decorate([
1198
- (0, import_CommandClassDecorators.CCCommand)(import_Types.IrrigationCommand.SystemStatusReport)
1199
- ], IrrigationCCSystemStatusReport);
1200
- let IrrigationCCSystemStatusGet = class IrrigationCCSystemStatusGet2 extends IrrigationCC {
1201
- };
1202
- IrrigationCCSystemStatusGet = __decorate([
1203
- (0, import_CommandClassDecorators.CCCommand)(import_Types.IrrigationCommand.SystemStatusGet),
1204
- (0, import_CommandClassDecorators.expectedCCResponse)(IrrigationCCSystemStatusReport)
1205
- ], IrrigationCCSystemStatusGet);
1206
- let IrrigationCCSystemConfigSet = class IrrigationCCSystemConfigSet2 extends IrrigationCC {
1207
- constructor(options) {
1208
- super(options);
1209
- this.masterValveDelay = options.masterValveDelay;
1210
- this.highPressureThreshold = options.highPressureThreshold;
1211
- this.lowPressureThreshold = options.lowPressureThreshold;
1212
- this.rainSensorPolarity = options.rainSensorPolarity;
1213
- this.moistureSensorPolarity = options.moistureSensorPolarity;
1214
- }
1215
- static from(_raw, _ctx) {
1216
- throw new import_safe.ZWaveError(`${this.name}: deserialization not implemented`, import_safe.ZWaveErrorCodes.Deserialization_NotImplemented);
1217
- }
1218
- masterValveDelay;
1219
- highPressureThreshold;
1220
- lowPressureThreshold;
1221
- rainSensorPolarity;
1222
- moistureSensorPolarity;
1223
- serialize(ctx) {
1224
- let polarity = 0;
1225
- if (this.rainSensorPolarity != void 0)
1226
- polarity |= 1;
1227
- if (this.moistureSensorPolarity != void 0)
1228
- polarity |= 2;
1229
- if (this.rainSensorPolarity == void 0 && this.moistureSensorPolarity == void 0) {
1230
- polarity |= 128;
1231
- }
1232
- this.payload = import_safe2.Bytes.concat([
1233
- import_safe2.Bytes.from([this.masterValveDelay]),
1234
- (0, import_safe.encodeFloatWithScale)(
1235
- this.highPressureThreshold,
1236
- 0
1237
- /* kPa */
1238
- ),
1239
- (0, import_safe.encodeFloatWithScale)(
1240
- this.lowPressureThreshold,
1241
- 0
1242
- /* kPa */
1243
- ),
1244
- import_safe2.Bytes.from([polarity])
1245
- ]);
1246
- return super.serialize(ctx);
1247
- }
1248
- toLogEntry(ctx) {
1249
- const message = {
1250
- "master valve delay": `${this.masterValveDelay} s`,
1251
- "high pressure threshold": `${this.highPressureThreshold} kPa`,
1252
- "low pressure threshold": `${this.lowPressureThreshold} kPa`
1253
- };
1254
- if (this.rainSensorPolarity != void 0) {
1255
- message["rain sensor polarity"] = (0, import_safe3.getEnumMemberName)(import_Types.IrrigationSensorPolarity, this.rainSensorPolarity);
1244
+ };
1245
+ return IrrigationCCSystemStatusReport2 = _classThis;
1246
+ })();
1247
+ let IrrigationCCSystemStatusGet = (() => {
1248
+ let _classDecorators = [(0, import_CommandClassDecorators.CCCommand)(import_Types.IrrigationCommand.SystemStatusGet), (0, import_CommandClassDecorators.expectedCCResponse)(IrrigationCCSystemStatusReport)];
1249
+ let _classDescriptor;
1250
+ let _classExtraInitializers = [];
1251
+ let _classThis;
1252
+ let _classSuper = IrrigationCC;
1253
+ var IrrigationCCSystemStatusGet2 = class extends _classSuper {
1254
+ static {
1255
+ _classThis = this;
1256
1256
  }
1257
- if (this.moistureSensorPolarity != void 0) {
1258
- message["moisture sensor polarity"] = (0, import_safe3.getEnumMemberName)(import_Types.IrrigationSensorPolarity, this.moistureSensorPolarity);
1257
+ static {
1258
+ const _metadata = typeof Symbol === "function" && Symbol.metadata ? Object.create(_classSuper[Symbol.metadata] ?? null) : void 0;
1259
+ __esDecorate(null, _classDescriptor = { value: _classThis }, _classDecorators, { kind: "class", name: _classThis.name, metadata: _metadata }, null, _classExtraInitializers);
1260
+ IrrigationCCSystemStatusGet2 = _classThis = _classDescriptor.value;
1261
+ if (_metadata) Object.defineProperty(_classThis, Symbol.metadata, { enumerable: true, configurable: true, writable: true, value: _metadata });
1262
+ __runInitializers(_classThis, _classExtraInitializers);
1259
1263
  }
1260
- return {
1261
- ...super.toLogEntry(ctx),
1262
- message
1263
- };
1264
- }
1265
- };
1266
- IrrigationCCSystemConfigSet = __decorate([
1267
- (0, import_CommandClassDecorators.CCCommand)(import_Types.IrrigationCommand.SystemConfigSet),
1268
- (0, import_CommandClassDecorators.useSupervision)()
1269
- ], IrrigationCCSystemConfigSet);
1270
- let IrrigationCCSystemConfigReport = IrrigationCCSystemConfigReport_1 = class IrrigationCCSystemConfigReport2 extends IrrigationCC {
1271
- constructor(options) {
1272
- super(options);
1273
- this.masterValveDelay = options.masterValveDelay;
1274
- this.highPressureThreshold = options.highPressureThreshold;
1275
- this.lowPressureThreshold = options.lowPressureThreshold;
1276
- this.rainSensorPolarity = options.rainSensorPolarity;
1277
- this.moistureSensorPolarity = options.moistureSensorPolarity;
1278
- }
1279
- static from(raw, ctx) {
1280
- (0, import_safe.validatePayload)(raw.payload.length >= 2);
1281
- const masterValveDelay = raw.payload[0];
1282
- let offset = 1;
1283
- let highPressureThreshold;
1284
- {
1285
- const { value, scale, bytesRead } = (0, import_safe.parseFloatWithScale)(raw.payload.subarray(offset));
1286
- (0, import_safe.validatePayload)(
1287
- scale === 0
1288
- /* kPa */
1289
- );
1290
- highPressureThreshold = value;
1291
- offset += bytesRead;
1292
- }
1293
- let lowPressureThreshold;
1294
- {
1295
- const { value, scale, bytesRead } = (0, import_safe.parseFloatWithScale)(raw.payload.subarray(offset));
1296
- (0, import_safe.validatePayload)(
1297
- scale === 0
1298
- /* kPa */
1299
- );
1300
- lowPressureThreshold = value;
1301
- offset += bytesRead;
1302
- }
1303
- (0, import_safe.validatePayload)(raw.payload.length >= offset + 1);
1304
- const polarity = raw.payload[offset];
1305
- let rainSensorPolarity;
1306
- let moistureSensorPolarity;
1307
- if (!!(polarity & 128)) {
1308
- rainSensorPolarity = polarity & 1;
1309
- moistureSensorPolarity = (polarity & 2) >>> 1;
1310
- }
1311
- return new IrrigationCCSystemConfigReport_1({
1312
- nodeId: ctx.sourceNodeId,
1313
- masterValveDelay,
1314
- highPressureThreshold,
1315
- lowPressureThreshold,
1316
- rainSensorPolarity,
1317
- moistureSensorPolarity
1318
- });
1319
- }
1320
- masterValveDelay;
1321
- highPressureThreshold;
1322
- lowPressureThreshold;
1323
- rainSensorPolarity;
1324
- moistureSensorPolarity;
1325
- toLogEntry(ctx) {
1326
- const message = {
1327
- "master valve delay": `${this.masterValveDelay} s`,
1328
- "high pressure threshold": `${this.highPressureThreshold} kPa`,
1329
- "low pressure threshold": `${this.lowPressureThreshold} kPa`
1330
- };
1331
- if (this.rainSensorPolarity != void 0) {
1332
- message["rain sensor polarity"] = (0, import_safe3.getEnumMemberName)(import_Types.IrrigationSensorPolarity, this.rainSensorPolarity);
1264
+ };
1265
+ return IrrigationCCSystemStatusGet2 = _classThis;
1266
+ })();
1267
+ let IrrigationCCSystemConfigSet = (() => {
1268
+ let _classDecorators = [(0, import_CommandClassDecorators.CCCommand)(import_Types.IrrigationCommand.SystemConfigSet), (0, import_CommandClassDecorators.useSupervision)()];
1269
+ let _classDescriptor;
1270
+ let _classExtraInitializers = [];
1271
+ let _classThis;
1272
+ let _classSuper = IrrigationCC;
1273
+ var IrrigationCCSystemConfigSet2 = class extends _classSuper {
1274
+ static {
1275
+ _classThis = this;
1333
1276
  }
1334
- if (this.moistureSensorPolarity != void 0) {
1335
- message["moisture sensor polarity"] = (0, import_safe3.getEnumMemberName)(import_Types.IrrigationSensorPolarity, this.moistureSensorPolarity);
1277
+ static {
1278
+ const _metadata = typeof Symbol === "function" && Symbol.metadata ? Object.create(_classSuper[Symbol.metadata] ?? null) : void 0;
1279
+ __esDecorate(null, _classDescriptor = { value: _classThis }, _classDecorators, { kind: "class", name: _classThis.name, metadata: _metadata }, null, _classExtraInitializers);
1280
+ IrrigationCCSystemConfigSet2 = _classThis = _classDescriptor.value;
1281
+ if (_metadata) Object.defineProperty(_classThis, Symbol.metadata, { enumerable: true, configurable: true, writable: true, value: _metadata });
1282
+ __runInitializers(_classThis, _classExtraInitializers);
1336
1283
  }
1337
- return {
1338
- ...super.toLogEntry(ctx),
1339
- message
1340
- };
1341
- }
1342
- };
1343
- __decorate([
1344
- (0, import_CommandClassDecorators.ccValue)(IrrigationCCValues.masterValveDelay)
1345
- ], IrrigationCCSystemConfigReport.prototype, "masterValveDelay", void 0);
1346
- __decorate([
1347
- (0, import_CommandClassDecorators.ccValue)(IrrigationCCValues.highPressureThreshold)
1348
- ], IrrigationCCSystemConfigReport.prototype, "highPressureThreshold", void 0);
1349
- __decorate([
1350
- (0, import_CommandClassDecorators.ccValue)(IrrigationCCValues.lowPressureThreshold)
1351
- ], IrrigationCCSystemConfigReport.prototype, "lowPressureThreshold", void 0);
1352
- __decorate([
1353
- (0, import_CommandClassDecorators.ccValue)(IrrigationCCValues.rainSensorPolarity)
1354
- ], IrrigationCCSystemConfigReport.prototype, "rainSensorPolarity", void 0);
1355
- __decorate([
1356
- (0, import_CommandClassDecorators.ccValue)(IrrigationCCValues.moistureSensorPolarity)
1357
- ], IrrigationCCSystemConfigReport.prototype, "moistureSensorPolarity", void 0);
1358
- IrrigationCCSystemConfigReport = IrrigationCCSystemConfigReport_1 = __decorate([
1359
- (0, import_CommandClassDecorators.CCCommand)(import_Types.IrrigationCommand.SystemConfigReport)
1360
- ], IrrigationCCSystemConfigReport);
1361
- let IrrigationCCSystemConfigGet = class IrrigationCCSystemConfigGet2 extends IrrigationCC {
1362
- };
1363
- IrrigationCCSystemConfigGet = __decorate([
1364
- (0, import_CommandClassDecorators.CCCommand)(import_Types.IrrigationCommand.SystemConfigGet),
1365
- (0, import_CommandClassDecorators.expectedCCResponse)(IrrigationCCSystemConfigReport)
1366
- ], IrrigationCCSystemConfigGet);
1367
- let IrrigationCCValveInfoReport = IrrigationCCValveInfoReport_1 = class IrrigationCCValveInfoReport2 extends IrrigationCC {
1368
- constructor(options) {
1369
- super(options);
1370
- this.valveId = options.valveId;
1371
- this.connected = options.connected;
1372
- this.nominalCurrent = options.nominalCurrent;
1373
- this.errorShortCircuit = options.errorShortCircuit;
1374
- this.errorHighCurrent = options.errorHighCurrent;
1375
- this.errorLowCurrent = options.errorLowCurrent;
1376
- this.errorMaximumFlow = options.errorMaximumFlow;
1377
- this.errorHighFlow = options.errorHighFlow;
1378
- this.errorLowFlow = options.errorLowFlow;
1379
- }
1380
- static from(raw, ctx) {
1381
- (0, import_safe.validatePayload)(raw.payload.length >= 4);
1382
- let valveId;
1383
- if ((raw.payload[0] & 1) === import_Types.ValveType.MasterValve) {
1384
- valveId = "master";
1385
- } else {
1386
- valveId = raw.payload[1];
1387
- }
1388
- const connected = !!(raw.payload[0] & 2);
1389
- const nominalCurrent = 10 * raw.payload[2];
1390
- const errorShortCircuit = !!(raw.payload[3] & 1);
1391
- const errorHighCurrent = !!(raw.payload[3] & 2);
1392
- const errorLowCurrent = !!(raw.payload[3] & 4);
1393
- let errorMaximumFlow;
1394
- let errorHighFlow;
1395
- let errorLowFlow;
1396
- if (valveId === "master") {
1397
- errorMaximumFlow = !!(raw.payload[3] & 8);
1398
- errorHighFlow = !!(raw.payload[3] & 16);
1399
- errorLowFlow = !!(raw.payload[3] & 32);
1400
- }
1401
- return new IrrigationCCValveInfoReport_1({
1402
- nodeId: ctx.sourceNodeId,
1403
- valveId,
1404
- connected,
1405
- nominalCurrent,
1406
- errorShortCircuit,
1407
- errorHighCurrent,
1408
- errorLowCurrent,
1409
- errorMaximumFlow,
1410
- errorHighFlow,
1411
- errorLowFlow
1412
- });
1413
- }
1414
- valveId;
1415
- connected;
1416
- nominalCurrent;
1417
- errorShortCircuit;
1418
- errorHighCurrent;
1419
- errorLowCurrent;
1420
- errorMaximumFlow;
1421
- errorHighFlow;
1422
- errorLowFlow;
1423
- persistValues(ctx) {
1424
- if (!super.persistValues(ctx))
1425
- return false;
1426
- const valveConnectedValue = IrrigationCCValues.valveConnected(this.valveId);
1427
- this.ensureMetadata(ctx, valveConnectedValue);
1428
- this.setValue(ctx, valveConnectedValue, this.connected);
1429
- const nominalCurrentValue = IrrigationCCValues.nominalCurrent(this.valveId);
1430
- this.ensureMetadata(ctx, nominalCurrentValue);
1431
- this.setValue(ctx, nominalCurrentValue, this.nominalCurrent);
1432
- const errorShortCircuitValue = IrrigationCCValues.errorShortCircuit(this.valveId);
1433
- this.ensureMetadata(ctx, errorShortCircuitValue);
1434
- this.setValue(ctx, errorShortCircuitValue, this.errorShortCircuit);
1435
- const errorHighCurrentValue = IrrigationCCValues.errorHighCurrent(this.valveId);
1436
- this.ensureMetadata(ctx, errorHighCurrentValue);
1437
- this.setValue(ctx, errorHighCurrentValue, this.errorHighCurrent);
1438
- const errorLowCurrentValue = IrrigationCCValues.errorLowCurrent(this.valveId);
1439
- this.ensureMetadata(ctx, errorLowCurrentValue);
1440
- this.setValue(ctx, errorLowCurrentValue, this.errorLowCurrent);
1441
- if (this.errorMaximumFlow != void 0) {
1442
- const errorMaximumFlowValue = IrrigationCCValues.errorMaximumFlow(this.valveId);
1443
- this.ensureMetadata(ctx, errorMaximumFlowValue);
1444
- this.setValue(ctx, errorMaximumFlowValue, this.errorMaximumFlow);
1445
- }
1446
- if (this.errorHighFlow != void 0) {
1447
- const errorHighFlowValue = IrrigationCCValues.errorHighFlow(this.valveId);
1448
- this.ensureMetadata(ctx, errorHighFlowValue);
1449
- this.setValue(ctx, errorHighFlowValue, this.errorHighFlow);
1450
- }
1451
- if (this.errorLowFlow != void 0) {
1452
- const errorLowFlowValue = IrrigationCCValues.errorLowFlow(this.valveId);
1453
- this.ensureMetadata(ctx, errorLowFlowValue);
1454
- this.setValue(ctx, errorLowFlowValue, this.errorLowFlow);
1455
- }
1456
- return true;
1457
- }
1458
- toLogEntry(ctx) {
1459
- const message = {
1460
- "valve ID": this.valveId,
1461
- connected: this.connected,
1462
- "nominal current": `${this.nominalCurrent} mA`
1463
- };
1464
- const errors = [
1465
- this.errorShortCircuit ? "short circuit" : void 0,
1466
- this.errorHighCurrent ? "current above high threshold" : void 0,
1467
- this.errorLowCurrent ? "current below low threshold" : void 0,
1468
- this.errorMaximumFlow ? "maximum flow" : void 0,
1469
- this.errorHighFlow ? "flow above high threshold" : void 0,
1470
- this.errorLowFlow ? "flow below low threshold" : void 0
1471
- ].filter(Boolean);
1472
- if (errors.length > 0) {
1473
- message.errors = errors.map((e) => `
1284
+ constructor(options) {
1285
+ super(options);
1286
+ this.masterValveDelay = options.masterValveDelay;
1287
+ this.highPressureThreshold = options.highPressureThreshold;
1288
+ this.lowPressureThreshold = options.lowPressureThreshold;
1289
+ this.rainSensorPolarity = options.rainSensorPolarity;
1290
+ this.moistureSensorPolarity = options.moistureSensorPolarity;
1291
+ }
1292
+ static from(_raw, _ctx) {
1293
+ throw new import_safe.ZWaveError(`${this.name}: deserialization not implemented`, import_safe.ZWaveErrorCodes.Deserialization_NotImplemented);
1294
+ }
1295
+ masterValveDelay;
1296
+ highPressureThreshold;
1297
+ lowPressureThreshold;
1298
+ rainSensorPolarity;
1299
+ moistureSensorPolarity;
1300
+ serialize(ctx) {
1301
+ let polarity = 0;
1302
+ if (this.rainSensorPolarity != void 0)
1303
+ polarity |= 1;
1304
+ if (this.moistureSensorPolarity != void 0)
1305
+ polarity |= 2;
1306
+ if (this.rainSensorPolarity == void 0 && this.moistureSensorPolarity == void 0) {
1307
+ polarity |= 128;
1308
+ }
1309
+ this.payload = import_safe2.Bytes.concat([
1310
+ import_safe2.Bytes.from([this.masterValveDelay]),
1311
+ (0, import_safe.encodeFloatWithScale)(
1312
+ this.highPressureThreshold,
1313
+ 0
1314
+ /* kPa */
1315
+ ),
1316
+ (0, import_safe.encodeFloatWithScale)(
1317
+ this.lowPressureThreshold,
1318
+ 0
1319
+ /* kPa */
1320
+ ),
1321
+ import_safe2.Bytes.from([polarity])
1322
+ ]);
1323
+ return super.serialize(ctx);
1324
+ }
1325
+ toLogEntry(ctx) {
1326
+ const message = {
1327
+ "master valve delay": `${this.masterValveDelay} s`,
1328
+ "high pressure threshold": `${this.highPressureThreshold} kPa`,
1329
+ "low pressure threshold": `${this.lowPressureThreshold} kPa`
1330
+ };
1331
+ if (this.rainSensorPolarity != void 0) {
1332
+ message["rain sensor polarity"] = (0, import_safe3.getEnumMemberName)(import_Types.IrrigationSensorPolarity, this.rainSensorPolarity);
1333
+ }
1334
+ if (this.moistureSensorPolarity != void 0) {
1335
+ message["moisture sensor polarity"] = (0, import_safe3.getEnumMemberName)(import_Types.IrrigationSensorPolarity, this.moistureSensorPolarity);
1336
+ }
1337
+ return {
1338
+ ...super.toLogEntry(ctx),
1339
+ message
1340
+ };
1341
+ }
1342
+ };
1343
+ return IrrigationCCSystemConfigSet2 = _classThis;
1344
+ })();
1345
+ let IrrigationCCSystemConfigReport = (() => {
1346
+ let _classDecorators = [(0, import_CommandClassDecorators.CCCommand)(import_Types.IrrigationCommand.SystemConfigReport), (0, import_CommandClassDecorators.ccValueProperty)("masterValveDelay", IrrigationCCValues.masterValveDelay), (0, import_CommandClassDecorators.ccValueProperty)("highPressureThreshold", IrrigationCCValues.highPressureThreshold), (0, import_CommandClassDecorators.ccValueProperty)("lowPressureThreshold", IrrigationCCValues.lowPressureThreshold), (0, import_CommandClassDecorators.ccValueProperty)("rainSensorPolarity", IrrigationCCValues.rainSensorPolarity), (0, import_CommandClassDecorators.ccValueProperty)("moistureSensorPolarity", IrrigationCCValues.moistureSensorPolarity)];
1347
+ let _classDescriptor;
1348
+ let _classExtraInitializers = [];
1349
+ let _classThis;
1350
+ let _classSuper = IrrigationCC;
1351
+ var IrrigationCCSystemConfigReport2 = class extends _classSuper {
1352
+ static {
1353
+ _classThis = this;
1354
+ }
1355
+ static {
1356
+ const _metadata = typeof Symbol === "function" && Symbol.metadata ? Object.create(_classSuper[Symbol.metadata] ?? null) : void 0;
1357
+ __esDecorate(null, _classDescriptor = { value: _classThis }, _classDecorators, { kind: "class", name: _classThis.name, metadata: _metadata }, null, _classExtraInitializers);
1358
+ IrrigationCCSystemConfigReport2 = _classThis = _classDescriptor.value;
1359
+ if (_metadata) Object.defineProperty(_classThis, Symbol.metadata, { enumerable: true, configurable: true, writable: true, value: _metadata });
1360
+ __runInitializers(_classThis, _classExtraInitializers);
1361
+ }
1362
+ constructor(options) {
1363
+ super(options);
1364
+ this.masterValveDelay = options.masterValveDelay;
1365
+ this.highPressureThreshold = options.highPressureThreshold;
1366
+ this.lowPressureThreshold = options.lowPressureThreshold;
1367
+ this.rainSensorPolarity = options.rainSensorPolarity;
1368
+ this.moistureSensorPolarity = options.moistureSensorPolarity;
1369
+ }
1370
+ static from(raw, ctx) {
1371
+ (0, import_safe.validatePayload)(raw.payload.length >= 2);
1372
+ const masterValveDelay = raw.payload[0];
1373
+ let offset = 1;
1374
+ let highPressureThreshold;
1375
+ {
1376
+ const { value, scale, bytesRead } = (0, import_safe.parseFloatWithScale)(raw.payload.subarray(offset));
1377
+ (0, import_safe.validatePayload)(
1378
+ scale === 0
1379
+ /* kPa */
1380
+ );
1381
+ highPressureThreshold = value;
1382
+ offset += bytesRead;
1383
+ }
1384
+ let lowPressureThreshold;
1385
+ {
1386
+ const { value, scale, bytesRead } = (0, import_safe.parseFloatWithScale)(raw.payload.subarray(offset));
1387
+ (0, import_safe.validatePayload)(
1388
+ scale === 0
1389
+ /* kPa */
1390
+ );
1391
+ lowPressureThreshold = value;
1392
+ offset += bytesRead;
1393
+ }
1394
+ (0, import_safe.validatePayload)(raw.payload.length >= offset + 1);
1395
+ const polarity = raw.payload[offset];
1396
+ let rainSensorPolarity;
1397
+ let moistureSensorPolarity;
1398
+ if (!!(polarity & 128)) {
1399
+ rainSensorPolarity = polarity & 1;
1400
+ moistureSensorPolarity = (polarity & 2) >>> 1;
1401
+ }
1402
+ return new this({
1403
+ nodeId: ctx.sourceNodeId,
1404
+ masterValveDelay,
1405
+ highPressureThreshold,
1406
+ lowPressureThreshold,
1407
+ rainSensorPolarity,
1408
+ moistureSensorPolarity
1409
+ });
1410
+ }
1411
+ masterValveDelay;
1412
+ highPressureThreshold;
1413
+ lowPressureThreshold;
1414
+ rainSensorPolarity;
1415
+ moistureSensorPolarity;
1416
+ toLogEntry(ctx) {
1417
+ const message = {
1418
+ "master valve delay": `${this.masterValveDelay} s`,
1419
+ "high pressure threshold": `${this.highPressureThreshold} kPa`,
1420
+ "low pressure threshold": `${this.lowPressureThreshold} kPa`
1421
+ };
1422
+ if (this.rainSensorPolarity != void 0) {
1423
+ message["rain sensor polarity"] = (0, import_safe3.getEnumMemberName)(import_Types.IrrigationSensorPolarity, this.rainSensorPolarity);
1424
+ }
1425
+ if (this.moistureSensorPolarity != void 0) {
1426
+ message["moisture sensor polarity"] = (0, import_safe3.getEnumMemberName)(import_Types.IrrigationSensorPolarity, this.moistureSensorPolarity);
1427
+ }
1428
+ return {
1429
+ ...super.toLogEntry(ctx),
1430
+ message
1431
+ };
1432
+ }
1433
+ };
1434
+ return IrrigationCCSystemConfigReport2 = _classThis;
1435
+ })();
1436
+ let IrrigationCCSystemConfigGet = (() => {
1437
+ let _classDecorators = [(0, import_CommandClassDecorators.CCCommand)(import_Types.IrrigationCommand.SystemConfigGet), (0, import_CommandClassDecorators.expectedCCResponse)(IrrigationCCSystemConfigReport)];
1438
+ let _classDescriptor;
1439
+ let _classExtraInitializers = [];
1440
+ let _classThis;
1441
+ let _classSuper = IrrigationCC;
1442
+ var IrrigationCCSystemConfigGet2 = class extends _classSuper {
1443
+ static {
1444
+ _classThis = this;
1445
+ }
1446
+ static {
1447
+ const _metadata = typeof Symbol === "function" && Symbol.metadata ? Object.create(_classSuper[Symbol.metadata] ?? null) : void 0;
1448
+ __esDecorate(null, _classDescriptor = { value: _classThis }, _classDecorators, { kind: "class", name: _classThis.name, metadata: _metadata }, null, _classExtraInitializers);
1449
+ IrrigationCCSystemConfigGet2 = _classThis = _classDescriptor.value;
1450
+ if (_metadata) Object.defineProperty(_classThis, Symbol.metadata, { enumerable: true, configurable: true, writable: true, value: _metadata });
1451
+ __runInitializers(_classThis, _classExtraInitializers);
1452
+ }
1453
+ };
1454
+ return IrrigationCCSystemConfigGet2 = _classThis;
1455
+ })();
1456
+ let IrrigationCCValveInfoReport = (() => {
1457
+ let _classDecorators = [(0, import_CommandClassDecorators.CCCommand)(import_Types.IrrigationCommand.ValveInfoReport)];
1458
+ let _classDescriptor;
1459
+ let _classExtraInitializers = [];
1460
+ let _classThis;
1461
+ let _classSuper = IrrigationCC;
1462
+ var IrrigationCCValveInfoReport2 = class extends _classSuper {
1463
+ static {
1464
+ _classThis = this;
1465
+ }
1466
+ static {
1467
+ const _metadata = typeof Symbol === "function" && Symbol.metadata ? Object.create(_classSuper[Symbol.metadata] ?? null) : void 0;
1468
+ __esDecorate(null, _classDescriptor = { value: _classThis }, _classDecorators, { kind: "class", name: _classThis.name, metadata: _metadata }, null, _classExtraInitializers);
1469
+ IrrigationCCValveInfoReport2 = _classThis = _classDescriptor.value;
1470
+ if (_metadata) Object.defineProperty(_classThis, Symbol.metadata, { enumerable: true, configurable: true, writable: true, value: _metadata });
1471
+ __runInitializers(_classThis, _classExtraInitializers);
1472
+ }
1473
+ constructor(options) {
1474
+ super(options);
1475
+ this.valveId = options.valveId;
1476
+ this.connected = options.connected;
1477
+ this.nominalCurrent = options.nominalCurrent;
1478
+ this.errorShortCircuit = options.errorShortCircuit;
1479
+ this.errorHighCurrent = options.errorHighCurrent;
1480
+ this.errorLowCurrent = options.errorLowCurrent;
1481
+ this.errorMaximumFlow = options.errorMaximumFlow;
1482
+ this.errorHighFlow = options.errorHighFlow;
1483
+ this.errorLowFlow = options.errorLowFlow;
1484
+ }
1485
+ static from(raw, ctx) {
1486
+ (0, import_safe.validatePayload)(raw.payload.length >= 4);
1487
+ let valveId;
1488
+ if ((raw.payload[0] & 1) === import_Types.ValveType.MasterValve) {
1489
+ valveId = "master";
1490
+ } else {
1491
+ valveId = raw.payload[1];
1492
+ }
1493
+ const connected = !!(raw.payload[0] & 2);
1494
+ const nominalCurrent = 10 * raw.payload[2];
1495
+ const errorShortCircuit = !!(raw.payload[3] & 1);
1496
+ const errorHighCurrent = !!(raw.payload[3] & 2);
1497
+ const errorLowCurrent = !!(raw.payload[3] & 4);
1498
+ let errorMaximumFlow;
1499
+ let errorHighFlow;
1500
+ let errorLowFlow;
1501
+ if (valveId === "master") {
1502
+ errorMaximumFlow = !!(raw.payload[3] & 8);
1503
+ errorHighFlow = !!(raw.payload[3] & 16);
1504
+ errorLowFlow = !!(raw.payload[3] & 32);
1505
+ }
1506
+ return new this({
1507
+ nodeId: ctx.sourceNodeId,
1508
+ valveId,
1509
+ connected,
1510
+ nominalCurrent,
1511
+ errorShortCircuit,
1512
+ errorHighCurrent,
1513
+ errorLowCurrent,
1514
+ errorMaximumFlow,
1515
+ errorHighFlow,
1516
+ errorLowFlow
1517
+ });
1518
+ }
1519
+ valveId;
1520
+ connected;
1521
+ nominalCurrent;
1522
+ errorShortCircuit;
1523
+ errorHighCurrent;
1524
+ errorLowCurrent;
1525
+ errorMaximumFlow;
1526
+ errorHighFlow;
1527
+ errorLowFlow;
1528
+ persistValues(ctx) {
1529
+ if (!super.persistValues(ctx))
1530
+ return false;
1531
+ const valveConnectedValue = IrrigationCCValues.valveConnected(this.valveId);
1532
+ this.ensureMetadata(ctx, valveConnectedValue);
1533
+ this.setValue(ctx, valveConnectedValue, this.connected);
1534
+ const nominalCurrentValue = IrrigationCCValues.nominalCurrent(this.valveId);
1535
+ this.ensureMetadata(ctx, nominalCurrentValue);
1536
+ this.setValue(ctx, nominalCurrentValue, this.nominalCurrent);
1537
+ const errorShortCircuitValue = IrrigationCCValues.errorShortCircuit(this.valveId);
1538
+ this.ensureMetadata(ctx, errorShortCircuitValue);
1539
+ this.setValue(ctx, errorShortCircuitValue, this.errorShortCircuit);
1540
+ const errorHighCurrentValue = IrrigationCCValues.errorHighCurrent(this.valveId);
1541
+ this.ensureMetadata(ctx, errorHighCurrentValue);
1542
+ this.setValue(ctx, errorHighCurrentValue, this.errorHighCurrent);
1543
+ const errorLowCurrentValue = IrrigationCCValues.errorLowCurrent(this.valveId);
1544
+ this.ensureMetadata(ctx, errorLowCurrentValue);
1545
+ this.setValue(ctx, errorLowCurrentValue, this.errorLowCurrent);
1546
+ if (this.errorMaximumFlow != void 0) {
1547
+ const errorMaximumFlowValue = IrrigationCCValues.errorMaximumFlow(this.valveId);
1548
+ this.ensureMetadata(ctx, errorMaximumFlowValue);
1549
+ this.setValue(ctx, errorMaximumFlowValue, this.errorMaximumFlow);
1550
+ }
1551
+ if (this.errorHighFlow != void 0) {
1552
+ const errorHighFlowValue = IrrigationCCValues.errorHighFlow(this.valveId);
1553
+ this.ensureMetadata(ctx, errorHighFlowValue);
1554
+ this.setValue(ctx, errorHighFlowValue, this.errorHighFlow);
1555
+ }
1556
+ if (this.errorLowFlow != void 0) {
1557
+ const errorLowFlowValue = IrrigationCCValues.errorLowFlow(this.valveId);
1558
+ this.ensureMetadata(ctx, errorLowFlowValue);
1559
+ this.setValue(ctx, errorLowFlowValue, this.errorLowFlow);
1560
+ }
1561
+ return true;
1562
+ }
1563
+ toLogEntry(ctx) {
1564
+ const message = {
1565
+ "valve ID": this.valveId,
1566
+ connected: this.connected,
1567
+ "nominal current": `${this.nominalCurrent} mA`
1568
+ };
1569
+ const errors = [
1570
+ this.errorShortCircuit ? "short circuit" : void 0,
1571
+ this.errorHighCurrent ? "current above high threshold" : void 0,
1572
+ this.errorLowCurrent ? "current below low threshold" : void 0,
1573
+ this.errorMaximumFlow ? "maximum flow" : void 0,
1574
+ this.errorHighFlow ? "flow above high threshold" : void 0,
1575
+ this.errorLowFlow ? "flow below low threshold" : void 0
1576
+ ].filter(Boolean);
1577
+ if (errors.length > 0) {
1578
+ message.errors = errors.map((e) => `
1474
1579
  \xB7 ${e}`).join("");
1580
+ }
1581
+ return {
1582
+ ...super.toLogEntry(ctx),
1583
+ message
1584
+ };
1475
1585
  }
1476
- return {
1477
- ...super.toLogEntry(ctx),
1478
- message
1479
- };
1480
- }
1481
- };
1482
- IrrigationCCValveInfoReport = IrrigationCCValveInfoReport_1 = __decorate([
1483
- (0, import_CommandClassDecorators.CCCommand)(import_Types.IrrigationCommand.ValveInfoReport)
1484
- ], IrrigationCCValveInfoReport);
1586
+ };
1587
+ return IrrigationCCValveInfoReport2 = _classThis;
1588
+ })();
1485
1589
  function testResponseForIrrigationCommandWithValveId(sent, received) {
1486
1590
  return received.valveId === sent.valveId;
1487
1591
  }
1488
- let IrrigationCCValveInfoGet = class IrrigationCCValveInfoGet2 extends IrrigationCC {
1489
- constructor(options) {
1490
- super(options);
1491
- this.valveId = options.valveId;
1492
- }
1493
- static from(_raw, _ctx) {
1494
- throw new import_safe.ZWaveError(`${this.name}: deserialization not implemented`, import_safe.ZWaveErrorCodes.Deserialization_NotImplemented);
1495
- }
1496
- valveId;
1497
- serialize(ctx) {
1498
- this.payload = import_safe2.Bytes.from([
1499
- this.valveId === "master" ? 1 : 0,
1500
- this.valveId === "master" ? 1 : this.valveId || 1
1501
- ]);
1502
- return super.serialize(ctx);
1503
- }
1504
- toLogEntry(ctx) {
1505
- return {
1506
- ...super.toLogEntry(ctx),
1507
- message: {
1508
- "valve ID": this.valveId
1592
+ let IrrigationCCValveInfoGet = (() => {
1593
+ let _classDecorators = [(0, import_CommandClassDecorators.CCCommand)(import_Types.IrrigationCommand.ValveInfoGet), (0, import_CommandClassDecorators.expectedCCResponse)(IrrigationCCValveInfoReport, testResponseForIrrigationCommandWithValveId)];
1594
+ let _classDescriptor;
1595
+ let _classExtraInitializers = [];
1596
+ let _classThis;
1597
+ let _classSuper = IrrigationCC;
1598
+ var IrrigationCCValveInfoGet2 = class extends _classSuper {
1599
+ static {
1600
+ _classThis = this;
1601
+ }
1602
+ static {
1603
+ const _metadata = typeof Symbol === "function" && Symbol.metadata ? Object.create(_classSuper[Symbol.metadata] ?? null) : void 0;
1604
+ __esDecorate(null, _classDescriptor = { value: _classThis }, _classDecorators, { kind: "class", name: _classThis.name, metadata: _metadata }, null, _classExtraInitializers);
1605
+ IrrigationCCValveInfoGet2 = _classThis = _classDescriptor.value;
1606
+ if (_metadata) Object.defineProperty(_classThis, Symbol.metadata, { enumerable: true, configurable: true, writable: true, value: _metadata });
1607
+ __runInitializers(_classThis, _classExtraInitializers);
1608
+ }
1609
+ constructor(options) {
1610
+ super(options);
1611
+ this.valveId = options.valveId;
1612
+ }
1613
+ static from(_raw, _ctx) {
1614
+ throw new import_safe.ZWaveError(`${this.name}: deserialization not implemented`, import_safe.ZWaveErrorCodes.Deserialization_NotImplemented);
1615
+ }
1616
+ valveId;
1617
+ serialize(ctx) {
1618
+ this.payload = import_safe2.Bytes.from([
1619
+ this.valveId === "master" ? 1 : 0,
1620
+ this.valveId === "master" ? 1 : this.valveId || 1
1621
+ ]);
1622
+ return super.serialize(ctx);
1623
+ }
1624
+ toLogEntry(ctx) {
1625
+ return {
1626
+ ...super.toLogEntry(ctx),
1627
+ message: {
1628
+ "valve ID": this.valveId
1629
+ }
1630
+ };
1631
+ }
1632
+ };
1633
+ return IrrigationCCValveInfoGet2 = _classThis;
1634
+ })();
1635
+ let IrrigationCCValveConfigSet = (() => {
1636
+ let _classDecorators = [(0, import_CommandClassDecorators.CCCommand)(import_Types.IrrigationCommand.ValveConfigSet), (0, import_CommandClassDecorators.useSupervision)()];
1637
+ let _classDescriptor;
1638
+ let _classExtraInitializers = [];
1639
+ let _classThis;
1640
+ let _classSuper = IrrigationCC;
1641
+ var IrrigationCCValveConfigSet2 = class extends _classSuper {
1642
+ static {
1643
+ _classThis = this;
1644
+ }
1645
+ static {
1646
+ const _metadata = typeof Symbol === "function" && Symbol.metadata ? Object.create(_classSuper[Symbol.metadata] ?? null) : void 0;
1647
+ __esDecorate(null, _classDescriptor = { value: _classThis }, _classDecorators, { kind: "class", name: _classThis.name, metadata: _metadata }, null, _classExtraInitializers);
1648
+ IrrigationCCValveConfigSet2 = _classThis = _classDescriptor.value;
1649
+ if (_metadata) Object.defineProperty(_classThis, Symbol.metadata, { enumerable: true, configurable: true, writable: true, value: _metadata });
1650
+ __runInitializers(_classThis, _classExtraInitializers);
1651
+ }
1652
+ constructor(options) {
1653
+ super(options);
1654
+ this.valveId = options.valveId;
1655
+ this.nominalCurrentHighThreshold = options.nominalCurrentHighThreshold;
1656
+ this.nominalCurrentLowThreshold = options.nominalCurrentLowThreshold;
1657
+ this.maximumFlow = options.maximumFlow;
1658
+ this.highFlowThreshold = options.highFlowThreshold;
1659
+ this.lowFlowThreshold = options.lowFlowThreshold;
1660
+ this.useRainSensor = options.useRainSensor;
1661
+ this.useMoistureSensor = options.useMoistureSensor;
1662
+ }
1663
+ static from(_raw, _ctx) {
1664
+ throw new import_safe.ZWaveError(`${this.name}: deserialization not implemented`, import_safe.ZWaveErrorCodes.Deserialization_NotImplemented);
1665
+ }
1666
+ valveId;
1667
+ nominalCurrentHighThreshold;
1668
+ nominalCurrentLowThreshold;
1669
+ maximumFlow;
1670
+ highFlowThreshold;
1671
+ lowFlowThreshold;
1672
+ useRainSensor;
1673
+ useMoistureSensor;
1674
+ serialize(ctx) {
1675
+ this.payload = import_safe2.Bytes.concat([
1676
+ import_safe2.Bytes.from([
1677
+ this.valveId === "master" ? 1 : 0,
1678
+ this.valveId === "master" ? 1 : this.valveId || 1,
1679
+ Math.floor(this.nominalCurrentHighThreshold / 10),
1680
+ Math.floor(this.nominalCurrentLowThreshold / 10)
1681
+ ]),
1682
+ (0, import_safe.encodeFloatWithScale)(
1683
+ this.maximumFlow,
1684
+ 0
1685
+ /* l/h */
1686
+ ),
1687
+ (0, import_safe.encodeFloatWithScale)(
1688
+ this.highFlowThreshold,
1689
+ 0
1690
+ /* l/h */
1691
+ ),
1692
+ (0, import_safe.encodeFloatWithScale)(
1693
+ this.lowFlowThreshold,
1694
+ 0
1695
+ /* l/h */
1696
+ ),
1697
+ import_safe2.Bytes.from([
1698
+ (this.useRainSensor ? 1 : 0) | (this.useMoistureSensor ? 2 : 0)
1699
+ ])
1700
+ ]);
1701
+ return super.serialize(ctx);
1702
+ }
1703
+ toLogEntry(ctx) {
1704
+ return {
1705
+ ...super.toLogEntry(ctx),
1706
+ message: {
1707
+ "valve ID": this.valveId,
1708
+ "nominal current high threshold": `${this.nominalCurrentHighThreshold} mA`,
1709
+ "nominal current low threshold": `${this.nominalCurrentLowThreshold} mA`,
1710
+ "maximum flow": `${this.maximumFlow} l/h`,
1711
+ "high flow threshold": `${this.highFlowThreshold} l/h`,
1712
+ "low flow threshold": `${this.lowFlowThreshold} l/h`,
1713
+ "use rain sensor": this.useRainSensor,
1714
+ "use moisture sensor": this.useMoistureSensor
1715
+ }
1716
+ };
1717
+ }
1718
+ };
1719
+ return IrrigationCCValveConfigSet2 = _classThis;
1720
+ })();
1721
+ let IrrigationCCValveConfigReport = (() => {
1722
+ let _classDecorators = [(0, import_CommandClassDecorators.CCCommand)(import_Types.IrrigationCommand.ValveConfigReport)];
1723
+ let _classDescriptor;
1724
+ let _classExtraInitializers = [];
1725
+ let _classThis;
1726
+ let _classSuper = IrrigationCC;
1727
+ var IrrigationCCValveConfigReport2 = class extends _classSuper {
1728
+ static {
1729
+ _classThis = this;
1730
+ }
1731
+ static {
1732
+ const _metadata = typeof Symbol === "function" && Symbol.metadata ? Object.create(_classSuper[Symbol.metadata] ?? null) : void 0;
1733
+ __esDecorate(null, _classDescriptor = { value: _classThis }, _classDecorators, { kind: "class", name: _classThis.name, metadata: _metadata }, null, _classExtraInitializers);
1734
+ IrrigationCCValveConfigReport2 = _classThis = _classDescriptor.value;
1735
+ if (_metadata) Object.defineProperty(_classThis, Symbol.metadata, { enumerable: true, configurable: true, writable: true, value: _metadata });
1736
+ __runInitializers(_classThis, _classExtraInitializers);
1737
+ }
1738
+ constructor(options) {
1739
+ super(options);
1740
+ this.valveId = options.valveId;
1741
+ this.nominalCurrentHighThreshold = options.nominalCurrentHighThreshold;
1742
+ this.nominalCurrentLowThreshold = options.nominalCurrentLowThreshold;
1743
+ this.maximumFlow = options.maximumFlow;
1744
+ this.highFlowThreshold = options.highFlowThreshold;
1745
+ this.lowFlowThreshold = options.lowFlowThreshold;
1746
+ this.useRainSensor = options.useRainSensor;
1747
+ this.useMoistureSensor = options.useMoistureSensor;
1748
+ }
1749
+ static from(raw, ctx) {
1750
+ (0, import_safe.validatePayload)(raw.payload.length >= 4);
1751
+ let valveId;
1752
+ if ((raw.payload[0] & 1) === import_Types.ValveType.MasterValve) {
1753
+ valveId = "master";
1754
+ } else {
1755
+ valveId = raw.payload[1];
1509
1756
  }
1510
- };
1511
- }
1512
- };
1513
- IrrigationCCValveInfoGet = __decorate([
1514
- (0, import_CommandClassDecorators.CCCommand)(import_Types.IrrigationCommand.ValveInfoGet),
1515
- (0, import_CommandClassDecorators.expectedCCResponse)(IrrigationCCValveInfoReport, testResponseForIrrigationCommandWithValveId)
1516
- ], IrrigationCCValveInfoGet);
1517
- let IrrigationCCValveConfigSet = class IrrigationCCValveConfigSet2 extends IrrigationCC {
1518
- constructor(options) {
1519
- super(options);
1520
- this.valveId = options.valveId;
1521
- this.nominalCurrentHighThreshold = options.nominalCurrentHighThreshold;
1522
- this.nominalCurrentLowThreshold = options.nominalCurrentLowThreshold;
1523
- this.maximumFlow = options.maximumFlow;
1524
- this.highFlowThreshold = options.highFlowThreshold;
1525
- this.lowFlowThreshold = options.lowFlowThreshold;
1526
- this.useRainSensor = options.useRainSensor;
1527
- this.useMoistureSensor = options.useMoistureSensor;
1528
- }
1529
- static from(_raw, _ctx) {
1530
- throw new import_safe.ZWaveError(`${this.name}: deserialization not implemented`, import_safe.ZWaveErrorCodes.Deserialization_NotImplemented);
1531
- }
1532
- valveId;
1533
- nominalCurrentHighThreshold;
1534
- nominalCurrentLowThreshold;
1535
- maximumFlow;
1536
- highFlowThreshold;
1537
- lowFlowThreshold;
1538
- useRainSensor;
1539
- useMoistureSensor;
1540
- serialize(ctx) {
1541
- this.payload = import_safe2.Bytes.concat([
1542
- import_safe2.Bytes.from([
1757
+ const nominalCurrentHighThreshold = 10 * raw.payload[2];
1758
+ const nominalCurrentLowThreshold = 10 * raw.payload[3];
1759
+ let offset = 4;
1760
+ let maximumFlow;
1761
+ {
1762
+ const { value, scale, bytesRead } = (0, import_safe.parseFloatWithScale)(raw.payload.subarray(offset));
1763
+ (0, import_safe.validatePayload)(
1764
+ scale === 0
1765
+ /* l/h */
1766
+ );
1767
+ maximumFlow = value;
1768
+ offset += bytesRead;
1769
+ }
1770
+ let highFlowThreshold;
1771
+ {
1772
+ const { value, scale, bytesRead } = (0, import_safe.parseFloatWithScale)(raw.payload.subarray(offset));
1773
+ (0, import_safe.validatePayload)(
1774
+ scale === 0
1775
+ /* l/h */
1776
+ );
1777
+ highFlowThreshold = value;
1778
+ offset += bytesRead;
1779
+ }
1780
+ let lowFlowThreshold;
1781
+ {
1782
+ const { value, scale, bytesRead } = (0, import_safe.parseFloatWithScale)(raw.payload.subarray(offset));
1783
+ (0, import_safe.validatePayload)(
1784
+ scale === 0
1785
+ /* l/h */
1786
+ );
1787
+ lowFlowThreshold = value;
1788
+ offset += bytesRead;
1789
+ }
1790
+ (0, import_safe.validatePayload)(raw.payload.length >= offset + 1);
1791
+ const useRainSensor = !!(raw.payload[offset] & 1);
1792
+ const useMoistureSensor = !!(raw.payload[offset] & 2);
1793
+ return new this({
1794
+ nodeId: ctx.sourceNodeId,
1795
+ valveId,
1796
+ nominalCurrentHighThreshold,
1797
+ nominalCurrentLowThreshold,
1798
+ maximumFlow,
1799
+ highFlowThreshold,
1800
+ lowFlowThreshold,
1801
+ useRainSensor,
1802
+ useMoistureSensor
1803
+ });
1804
+ }
1805
+ persistValues(ctx) {
1806
+ if (!super.persistValues(ctx))
1807
+ return false;
1808
+ const nominalCurrentHighThresholdValue = IrrigationCCValues.nominalCurrentHighThreshold(this.valveId);
1809
+ this.ensureMetadata(ctx, nominalCurrentHighThresholdValue);
1810
+ this.setValue(ctx, nominalCurrentHighThresholdValue, this.nominalCurrentHighThreshold);
1811
+ const nominalCurrentLowThresholdValue = IrrigationCCValues.nominalCurrentLowThreshold(this.valveId);
1812
+ this.ensureMetadata(ctx, nominalCurrentLowThresholdValue);
1813
+ this.setValue(ctx, nominalCurrentLowThresholdValue, this.nominalCurrentLowThreshold);
1814
+ const maximumFlowValue = IrrigationCCValues.maximumFlow(this.valveId);
1815
+ this.ensureMetadata(ctx, maximumFlowValue);
1816
+ this.setValue(ctx, maximumFlowValue, this.maximumFlow);
1817
+ const highFlowThresholdValue = IrrigationCCValues.highFlowThreshold(this.valveId);
1818
+ this.ensureMetadata(ctx, highFlowThresholdValue);
1819
+ this.setValue(ctx, highFlowThresholdValue, this.highFlowThreshold);
1820
+ const lowFlowThresholdValue = IrrigationCCValues.lowFlowThreshold(this.valveId);
1821
+ this.ensureMetadata(ctx, lowFlowThresholdValue);
1822
+ this.setValue(ctx, lowFlowThresholdValue, this.lowFlowThreshold);
1823
+ const useRainSensorValue = IrrigationCCValues.useRainSensor(this.valveId);
1824
+ this.ensureMetadata(ctx, useRainSensorValue);
1825
+ this.setValue(ctx, useRainSensorValue, this.useRainSensor);
1826
+ const useMoistureSensorValue = IrrigationCCValues.useMoistureSensor(this.valveId);
1827
+ this.ensureMetadata(ctx, useMoistureSensorValue);
1828
+ this.setValue(ctx, useMoistureSensorValue, this.useMoistureSensor);
1829
+ return true;
1830
+ }
1831
+ valveId;
1832
+ nominalCurrentHighThreshold;
1833
+ nominalCurrentLowThreshold;
1834
+ maximumFlow;
1835
+ highFlowThreshold;
1836
+ lowFlowThreshold;
1837
+ useRainSensor;
1838
+ useMoistureSensor;
1839
+ toLogEntry(ctx) {
1840
+ return {
1841
+ ...super.toLogEntry(ctx),
1842
+ message: {
1843
+ "valve ID": this.valveId,
1844
+ "nominal current high threshold": `${this.nominalCurrentHighThreshold} mA`,
1845
+ "nominal current low threshold": `${this.nominalCurrentLowThreshold} mA`,
1846
+ "maximum flow": `${this.maximumFlow} l/h`,
1847
+ "high flow threshold": `${this.highFlowThreshold} l/h`,
1848
+ "low flow threshold": `${this.lowFlowThreshold} l/h`,
1849
+ "use rain sensor": this.useRainSensor,
1850
+ "use moisture sensor": this.useMoistureSensor
1851
+ }
1852
+ };
1853
+ }
1854
+ };
1855
+ return IrrigationCCValveConfigReport2 = _classThis;
1856
+ })();
1857
+ let IrrigationCCValveConfigGet = (() => {
1858
+ let _classDecorators = [(0, import_CommandClassDecorators.CCCommand)(import_Types.IrrigationCommand.ValveConfigGet), (0, import_CommandClassDecorators.expectedCCResponse)(IrrigationCCValveConfigReport, testResponseForIrrigationCommandWithValveId)];
1859
+ let _classDescriptor;
1860
+ let _classExtraInitializers = [];
1861
+ let _classThis;
1862
+ let _classSuper = IrrigationCC;
1863
+ var IrrigationCCValveConfigGet2 = class extends _classSuper {
1864
+ static {
1865
+ _classThis = this;
1866
+ }
1867
+ static {
1868
+ const _metadata = typeof Symbol === "function" && Symbol.metadata ? Object.create(_classSuper[Symbol.metadata] ?? null) : void 0;
1869
+ __esDecorate(null, _classDescriptor = { value: _classThis }, _classDecorators, { kind: "class", name: _classThis.name, metadata: _metadata }, null, _classExtraInitializers);
1870
+ IrrigationCCValveConfigGet2 = _classThis = _classDescriptor.value;
1871
+ if (_metadata) Object.defineProperty(_classThis, Symbol.metadata, { enumerable: true, configurable: true, writable: true, value: _metadata });
1872
+ __runInitializers(_classThis, _classExtraInitializers);
1873
+ }
1874
+ constructor(options) {
1875
+ super(options);
1876
+ this.valveId = options.valveId;
1877
+ }
1878
+ static from(_raw, _ctx) {
1879
+ throw new import_safe.ZWaveError(`${this.name}: deserialization not implemented`, import_safe.ZWaveErrorCodes.Deserialization_NotImplemented);
1880
+ }
1881
+ valveId;
1882
+ serialize(ctx) {
1883
+ this.payload = import_safe2.Bytes.from([
1884
+ this.valveId === "master" ? 1 : 0,
1885
+ this.valveId === "master" ? 1 : this.valveId || 1
1886
+ ]);
1887
+ return super.serialize(ctx);
1888
+ }
1889
+ toLogEntry(ctx) {
1890
+ return {
1891
+ ...super.toLogEntry(ctx),
1892
+ message: {
1893
+ "valve ID": this.valveId
1894
+ }
1895
+ };
1896
+ }
1897
+ };
1898
+ return IrrigationCCValveConfigGet2 = _classThis;
1899
+ })();
1900
+ let IrrigationCCValveRun = (() => {
1901
+ let _classDecorators = [(0, import_CommandClassDecorators.CCCommand)(import_Types.IrrigationCommand.ValveRun), (0, import_CommandClassDecorators.useSupervision)()];
1902
+ let _classDescriptor;
1903
+ let _classExtraInitializers = [];
1904
+ let _classThis;
1905
+ let _classSuper = IrrigationCC;
1906
+ var IrrigationCCValveRun2 = class extends _classSuper {
1907
+ static {
1908
+ _classThis = this;
1909
+ }
1910
+ static {
1911
+ const _metadata = typeof Symbol === "function" && Symbol.metadata ? Object.create(_classSuper[Symbol.metadata] ?? null) : void 0;
1912
+ __esDecorate(null, _classDescriptor = { value: _classThis }, _classDecorators, { kind: "class", name: _classThis.name, metadata: _metadata }, null, _classExtraInitializers);
1913
+ IrrigationCCValveRun2 = _classThis = _classDescriptor.value;
1914
+ if (_metadata) Object.defineProperty(_classThis, Symbol.metadata, { enumerable: true, configurable: true, writable: true, value: _metadata });
1915
+ __runInitializers(_classThis, _classExtraInitializers);
1916
+ }
1917
+ constructor(options) {
1918
+ super(options);
1919
+ this.valveId = options.valveId;
1920
+ this.duration = options.duration;
1921
+ }
1922
+ static from(_raw, _ctx) {
1923
+ throw new import_safe.ZWaveError(`${this.name}: deserialization not implemented`, import_safe.ZWaveErrorCodes.Deserialization_NotImplemented);
1924
+ }
1925
+ valveId;
1926
+ duration;
1927
+ serialize(ctx) {
1928
+ this.payload = import_safe2.Bytes.from([
1543
1929
  this.valveId === "master" ? 1 : 0,
1544
1930
  this.valveId === "master" ? 1 : this.valveId || 1,
1545
- Math.floor(this.nominalCurrentHighThreshold / 10),
1546
- Math.floor(this.nominalCurrentLowThreshold / 10)
1547
- ]),
1548
- (0, import_safe.encodeFloatWithScale)(
1549
- this.maximumFlow,
1931
+ 0,
1550
1932
  0
1551
- /* l/h */
1552
- ),
1553
- (0, import_safe.encodeFloatWithScale)(
1554
- this.highFlowThreshold,
1555
- 0
1556
- /* l/h */
1557
- ),
1558
- (0, import_safe.encodeFloatWithScale)(
1559
- this.lowFlowThreshold,
1560
- 0
1561
- /* l/h */
1562
- ),
1563
- import_safe2.Bytes.from([
1564
- (this.useRainSensor ? 1 : 0) | (this.useMoistureSensor ? 2 : 0)
1565
- ])
1566
- ]);
1567
- return super.serialize(ctx);
1568
- }
1569
- toLogEntry(ctx) {
1570
- return {
1571
- ...super.toLogEntry(ctx),
1572
- message: {
1573
- "valve ID": this.valveId,
1574
- "nominal current high threshold": `${this.nominalCurrentHighThreshold} mA`,
1575
- "nominal current low threshold": `${this.nominalCurrentLowThreshold} mA`,
1576
- "maximum flow": `${this.maximumFlow} l/h`,
1577
- "high flow threshold": `${this.highFlowThreshold} l/h`,
1578
- "low flow threshold": `${this.lowFlowThreshold} l/h`,
1579
- "use rain sensor": this.useRainSensor,
1580
- "use moisture sensor": this.useMoistureSensor
1581
- }
1582
- };
1583
- }
1584
- };
1585
- IrrigationCCValveConfigSet = __decorate([
1586
- (0, import_CommandClassDecorators.CCCommand)(import_Types.IrrigationCommand.ValveConfigSet),
1587
- (0, import_CommandClassDecorators.useSupervision)()
1588
- ], IrrigationCCValveConfigSet);
1589
- let IrrigationCCValveConfigReport = IrrigationCCValveConfigReport_1 = class IrrigationCCValveConfigReport2 extends IrrigationCC {
1590
- constructor(options) {
1591
- super(options);
1592
- this.valveId = options.valveId;
1593
- this.nominalCurrentHighThreshold = options.nominalCurrentHighThreshold;
1594
- this.nominalCurrentLowThreshold = options.nominalCurrentLowThreshold;
1595
- this.maximumFlow = options.maximumFlow;
1596
- this.highFlowThreshold = options.highFlowThreshold;
1597
- this.lowFlowThreshold = options.lowFlowThreshold;
1598
- this.useRainSensor = options.useRainSensor;
1599
- this.useMoistureSensor = options.useMoistureSensor;
1600
- }
1601
- static from(raw, ctx) {
1602
- (0, import_safe.validatePayload)(raw.payload.length >= 4);
1603
- let valveId;
1604
- if ((raw.payload[0] & 1) === import_Types.ValveType.MasterValve) {
1605
- valveId = "master";
1606
- } else {
1607
- valveId = raw.payload[1];
1608
- }
1609
- const nominalCurrentHighThreshold = 10 * raw.payload[2];
1610
- const nominalCurrentLowThreshold = 10 * raw.payload[3];
1611
- let offset = 4;
1612
- let maximumFlow;
1613
- {
1614
- const { value, scale, bytesRead } = (0, import_safe.parseFloatWithScale)(raw.payload.subarray(offset));
1615
- (0, import_safe.validatePayload)(
1616
- scale === 0
1617
- /* l/h */
1618
- );
1619
- maximumFlow = value;
1620
- offset += bytesRead;
1621
- }
1622
- let highFlowThreshold;
1623
- {
1624
- const { value, scale, bytesRead } = (0, import_safe.parseFloatWithScale)(raw.payload.subarray(offset));
1625
- (0, import_safe.validatePayload)(
1626
- scale === 0
1627
- /* l/h */
1628
- );
1629
- highFlowThreshold = value;
1630
- offset += bytesRead;
1631
- }
1632
- let lowFlowThreshold;
1633
- {
1634
- const { value, scale, bytesRead } = (0, import_safe.parseFloatWithScale)(raw.payload.subarray(offset));
1635
- (0, import_safe.validatePayload)(
1636
- scale === 0
1637
- /* l/h */
1638
- );
1639
- lowFlowThreshold = value;
1640
- offset += bytesRead;
1641
- }
1642
- (0, import_safe.validatePayload)(raw.payload.length >= offset + 1);
1643
- const useRainSensor = !!(raw.payload[offset] & 1);
1644
- const useMoistureSensor = !!(raw.payload[offset] & 2);
1645
- return new IrrigationCCValveConfigReport_1({
1646
- nodeId: ctx.sourceNodeId,
1647
- valveId,
1648
- nominalCurrentHighThreshold,
1649
- nominalCurrentLowThreshold,
1650
- maximumFlow,
1651
- highFlowThreshold,
1652
- lowFlowThreshold,
1653
- useRainSensor,
1654
- useMoistureSensor
1655
- });
1656
- }
1657
- persistValues(ctx) {
1658
- if (!super.persistValues(ctx))
1659
- return false;
1660
- const nominalCurrentHighThresholdValue = IrrigationCCValues.nominalCurrentHighThreshold(this.valveId);
1661
- this.ensureMetadata(ctx, nominalCurrentHighThresholdValue);
1662
- this.setValue(ctx, nominalCurrentHighThresholdValue, this.nominalCurrentHighThreshold);
1663
- const nominalCurrentLowThresholdValue = IrrigationCCValues.nominalCurrentLowThreshold(this.valveId);
1664
- this.ensureMetadata(ctx, nominalCurrentLowThresholdValue);
1665
- this.setValue(ctx, nominalCurrentLowThresholdValue, this.nominalCurrentLowThreshold);
1666
- const maximumFlowValue = IrrigationCCValues.maximumFlow(this.valveId);
1667
- this.ensureMetadata(ctx, maximumFlowValue);
1668
- this.setValue(ctx, maximumFlowValue, this.maximumFlow);
1669
- const highFlowThresholdValue = IrrigationCCValues.highFlowThreshold(this.valveId);
1670
- this.ensureMetadata(ctx, highFlowThresholdValue);
1671
- this.setValue(ctx, highFlowThresholdValue, this.highFlowThreshold);
1672
- const lowFlowThresholdValue = IrrigationCCValues.lowFlowThreshold(this.valveId);
1673
- this.ensureMetadata(ctx, lowFlowThresholdValue);
1674
- this.setValue(ctx, lowFlowThresholdValue, this.lowFlowThreshold);
1675
- const useRainSensorValue = IrrigationCCValues.useRainSensor(this.valveId);
1676
- this.ensureMetadata(ctx, useRainSensorValue);
1677
- this.setValue(ctx, useRainSensorValue, this.useRainSensor);
1678
- const useMoistureSensorValue = IrrigationCCValues.useMoistureSensor(this.valveId);
1679
- this.ensureMetadata(ctx, useMoistureSensorValue);
1680
- this.setValue(ctx, useMoistureSensorValue, this.useMoistureSensor);
1681
- return true;
1682
- }
1683
- valveId;
1684
- nominalCurrentHighThreshold;
1685
- nominalCurrentLowThreshold;
1686
- maximumFlow;
1687
- highFlowThreshold;
1688
- lowFlowThreshold;
1689
- useRainSensor;
1690
- useMoistureSensor;
1691
- toLogEntry(ctx) {
1692
- return {
1693
- ...super.toLogEntry(ctx),
1694
- message: {
1695
- "valve ID": this.valveId,
1696
- "nominal current high threshold": `${this.nominalCurrentHighThreshold} mA`,
1697
- "nominal current low threshold": `${this.nominalCurrentLowThreshold} mA`,
1698
- "maximum flow": `${this.maximumFlow} l/h`,
1699
- "high flow threshold": `${this.highFlowThreshold} l/h`,
1700
- "low flow threshold": `${this.lowFlowThreshold} l/h`,
1701
- "use rain sensor": this.useRainSensor,
1702
- "use moisture sensor": this.useMoistureSensor
1703
- }
1704
- };
1705
- }
1706
- };
1707
- IrrigationCCValveConfigReport = IrrigationCCValveConfigReport_1 = __decorate([
1708
- (0, import_CommandClassDecorators.CCCommand)(import_Types.IrrigationCommand.ValveConfigReport)
1709
- ], IrrigationCCValveConfigReport);
1710
- let IrrigationCCValveConfigGet = class IrrigationCCValveConfigGet2 extends IrrigationCC {
1711
- constructor(options) {
1712
- super(options);
1713
- this.valveId = options.valveId;
1714
- }
1715
- static from(_raw, _ctx) {
1716
- throw new import_safe.ZWaveError(`${this.name}: deserialization not implemented`, import_safe.ZWaveErrorCodes.Deserialization_NotImplemented);
1717
- }
1718
- valveId;
1719
- serialize(ctx) {
1720
- this.payload = import_safe2.Bytes.from([
1721
- this.valveId === "master" ? 1 : 0,
1722
- this.valveId === "master" ? 1 : this.valveId || 1
1723
- ]);
1724
- return super.serialize(ctx);
1725
- }
1726
- toLogEntry(ctx) {
1727
- return {
1728
- ...super.toLogEntry(ctx),
1729
- message: {
1933
+ ]);
1934
+ this.payload.writeUInt16BE(this.duration, 2);
1935
+ return super.serialize(ctx);
1936
+ }
1937
+ toLogEntry(ctx) {
1938
+ const message = {
1730
1939
  "valve ID": this.valveId
1731
- }
1732
- };
1733
- }
1734
- };
1735
- IrrigationCCValveConfigGet = __decorate([
1736
- (0, import_CommandClassDecorators.CCCommand)(import_Types.IrrigationCommand.ValveConfigGet),
1737
- (0, import_CommandClassDecorators.expectedCCResponse)(IrrigationCCValveConfigReport, testResponseForIrrigationCommandWithValveId)
1738
- ], IrrigationCCValveConfigGet);
1739
- let IrrigationCCValveRun = class IrrigationCCValveRun2 extends IrrigationCC {
1740
- constructor(options) {
1741
- super(options);
1742
- this.valveId = options.valveId;
1743
- this.duration = options.duration;
1744
- }
1745
- static from(_raw, _ctx) {
1746
- throw new import_safe.ZWaveError(`${this.name}: deserialization not implemented`, import_safe.ZWaveErrorCodes.Deserialization_NotImplemented);
1747
- }
1748
- valveId;
1749
- duration;
1750
- serialize(ctx) {
1751
- this.payload = import_safe2.Bytes.from([
1752
- this.valveId === "master" ? 1 : 0,
1753
- this.valveId === "master" ? 1 : this.valveId || 1,
1754
- 0,
1755
- 0
1756
- ]);
1757
- this.payload.writeUInt16BE(this.duration, 2);
1758
- return super.serialize(ctx);
1759
- }
1760
- toLogEntry(ctx) {
1761
- const message = {
1762
- "valve ID": this.valveId
1763
- };
1764
- if (this.duration) {
1765
- message.duration = `${this.duration} s`;
1766
- } else {
1767
- message.action = "turn off";
1768
- }
1769
- return {
1770
- ...super.toLogEntry(ctx),
1771
- message
1772
- };
1773
- }
1774
- };
1775
- IrrigationCCValveRun = __decorate([
1776
- (0, import_CommandClassDecorators.CCCommand)(import_Types.IrrigationCommand.ValveRun),
1777
- (0, import_CommandClassDecorators.useSupervision)()
1778
- ], IrrigationCCValveRun);
1779
- let IrrigationCCValveTableSet = class IrrigationCCValveTableSet2 extends IrrigationCC {
1780
- constructor(options) {
1781
- super(options);
1782
- this.tableId = options.tableId;
1783
- this.entries = options.entries;
1784
- }
1785
- static from(_raw, _ctx) {
1786
- throw new import_safe.ZWaveError(`${this.name}: deserialization not implemented`, import_safe.ZWaveErrorCodes.Deserialization_NotImplemented);
1787
- }
1788
- tableId;
1789
- entries;
1790
- serialize(ctx) {
1791
- this.payload = new import_safe2.Bytes(1 + this.entries.length * 3);
1792
- this.payload[0] = this.tableId;
1793
- for (let i = 0; i < this.entries.length; i++) {
1794
- const entry = this.entries[i];
1795
- const offset = 1 + i * 3;
1796
- this.payload[offset] = entry.valveId;
1797
- this.payload.writeUInt16BE(entry.duration, offset + 1);
1798
- }
1799
- return super.serialize(ctx);
1800
- }
1801
- toLogEntry(ctx) {
1802
- const message = {
1803
- "table ID": this.tableId
1804
- };
1805
- for (let i = 0; i < this.entries.length; i++) {
1806
- const entry = this.entries[i];
1807
- const valveLabel = (0, import_strings.padStart)(entry.valveId.toString(), 3, "0");
1808
- if (entry.duration) {
1809
- message[`valve ${valveLabel} duration`] = `${entry.duration} s`;
1940
+ };
1941
+ if (this.duration) {
1942
+ message.duration = `${this.duration} s`;
1810
1943
  } else {
1811
- message[`valve ${valveLabel} action`] = `turn off`;
1944
+ message.action = "turn off";
1812
1945
  }
1946
+ return {
1947
+ ...super.toLogEntry(ctx),
1948
+ message
1949
+ };
1813
1950
  }
1814
- return {
1815
- ...super.toLogEntry(ctx),
1816
- message
1817
- };
1818
- }
1819
- };
1820
- IrrigationCCValveTableSet = __decorate([
1821
- (0, import_CommandClassDecorators.CCCommand)(import_Types.IrrigationCommand.ValveTableSet),
1822
- (0, import_CommandClassDecorators.useSupervision)()
1823
- ], IrrigationCCValveTableSet);
1824
- let IrrigationCCValveTableReport = IrrigationCCValveTableReport_1 = class IrrigationCCValveTableReport2 extends IrrigationCC {
1825
- constructor(options) {
1826
- super(options);
1827
- this.tableId = options.tableId;
1828
- this.entries = options.entries;
1829
- }
1830
- static from(raw, ctx) {
1831
- (0, import_safe.validatePayload)((raw.payload.length - 1) % 3 === 0);
1832
- const tableId = raw.payload[0];
1833
- const entries = [];
1834
- for (let offset = 1; offset < raw.payload.length; offset += 3) {
1835
- entries.push({
1836
- valveId: raw.payload[offset],
1837
- duration: raw.payload.readUInt16BE(offset + 1)
1951
+ };
1952
+ return IrrigationCCValveRun2 = _classThis;
1953
+ })();
1954
+ let IrrigationCCValveTableSet = (() => {
1955
+ let _classDecorators = [(0, import_CommandClassDecorators.CCCommand)(import_Types.IrrigationCommand.ValveTableSet), (0, import_CommandClassDecorators.useSupervision)()];
1956
+ let _classDescriptor;
1957
+ let _classExtraInitializers = [];
1958
+ let _classThis;
1959
+ let _classSuper = IrrigationCC;
1960
+ var IrrigationCCValveTableSet2 = class extends _classSuper {
1961
+ static {
1962
+ _classThis = this;
1963
+ }
1964
+ static {
1965
+ const _metadata = typeof Symbol === "function" && Symbol.metadata ? Object.create(_classSuper[Symbol.metadata] ?? null) : void 0;
1966
+ __esDecorate(null, _classDescriptor = { value: _classThis }, _classDecorators, { kind: "class", name: _classThis.name, metadata: _metadata }, null, _classExtraInitializers);
1967
+ IrrigationCCValveTableSet2 = _classThis = _classDescriptor.value;
1968
+ if (_metadata) Object.defineProperty(_classThis, Symbol.metadata, { enumerable: true, configurable: true, writable: true, value: _metadata });
1969
+ __runInitializers(_classThis, _classExtraInitializers);
1970
+ }
1971
+ constructor(options) {
1972
+ super(options);
1973
+ this.tableId = options.tableId;
1974
+ this.entries = options.entries;
1975
+ }
1976
+ static from(_raw, _ctx) {
1977
+ throw new import_safe.ZWaveError(`${this.name}: deserialization not implemented`, import_safe.ZWaveErrorCodes.Deserialization_NotImplemented);
1978
+ }
1979
+ tableId;
1980
+ entries;
1981
+ serialize(ctx) {
1982
+ this.payload = new import_safe2.Bytes(1 + this.entries.length * 3);
1983
+ this.payload[0] = this.tableId;
1984
+ for (let i = 0; i < this.entries.length; i++) {
1985
+ const entry = this.entries[i];
1986
+ const offset = 1 + i * 3;
1987
+ this.payload[offset] = entry.valveId;
1988
+ this.payload.writeUInt16BE(entry.duration, offset + 1);
1989
+ }
1990
+ return super.serialize(ctx);
1991
+ }
1992
+ toLogEntry(ctx) {
1993
+ const message = {
1994
+ "table ID": this.tableId
1995
+ };
1996
+ for (let i = 0; i < this.entries.length; i++) {
1997
+ const entry = this.entries[i];
1998
+ const valveLabel = (0, import_strings.padStart)(entry.valveId.toString(), 3, "0");
1999
+ if (entry.duration) {
2000
+ message[`valve ${valveLabel} duration`] = `${entry.duration} s`;
2001
+ } else {
2002
+ message[`valve ${valveLabel} action`] = `turn off`;
2003
+ }
2004
+ }
2005
+ return {
2006
+ ...super.toLogEntry(ctx),
2007
+ message
2008
+ };
2009
+ }
2010
+ };
2011
+ return IrrigationCCValveTableSet2 = _classThis;
2012
+ })();
2013
+ let IrrigationCCValveTableReport = (() => {
2014
+ let _classDecorators = [(0, import_CommandClassDecorators.CCCommand)(import_Types.IrrigationCommand.ValveTableReport)];
2015
+ let _classDescriptor;
2016
+ let _classExtraInitializers = [];
2017
+ let _classThis;
2018
+ let _classSuper = IrrigationCC;
2019
+ var IrrigationCCValveTableReport2 = class extends _classSuper {
2020
+ static {
2021
+ _classThis = this;
2022
+ }
2023
+ static {
2024
+ const _metadata = typeof Symbol === "function" && Symbol.metadata ? Object.create(_classSuper[Symbol.metadata] ?? null) : void 0;
2025
+ __esDecorate(null, _classDescriptor = { value: _classThis }, _classDecorators, { kind: "class", name: _classThis.name, metadata: _metadata }, null, _classExtraInitializers);
2026
+ IrrigationCCValveTableReport2 = _classThis = _classDescriptor.value;
2027
+ if (_metadata) Object.defineProperty(_classThis, Symbol.metadata, { enumerable: true, configurable: true, writable: true, value: _metadata });
2028
+ __runInitializers(_classThis, _classExtraInitializers);
2029
+ }
2030
+ constructor(options) {
2031
+ super(options);
2032
+ this.tableId = options.tableId;
2033
+ this.entries = options.entries;
2034
+ }
2035
+ static from(raw, ctx) {
2036
+ (0, import_safe.validatePayload)((raw.payload.length - 1) % 3 === 0);
2037
+ const tableId = raw.payload[0];
2038
+ const entries = [];
2039
+ for (let offset = 1; offset < raw.payload.length; offset += 3) {
2040
+ entries.push({
2041
+ valveId: raw.payload[offset],
2042
+ duration: raw.payload.readUInt16BE(offset + 1)
2043
+ });
2044
+ }
2045
+ return new this({
2046
+ nodeId: ctx.sourceNodeId,
2047
+ tableId,
2048
+ entries
1838
2049
  });
1839
2050
  }
1840
- return new IrrigationCCValveTableReport_1({
1841
- nodeId: ctx.sourceNodeId,
1842
- tableId,
1843
- entries
1844
- });
1845
- }
1846
- tableId;
1847
- entries;
1848
- toLogEntry(ctx) {
1849
- const message = {
1850
- "table ID": this.tableId
1851
- };
1852
- for (let i = 0; i < this.entries.length; i++) {
1853
- const entry = this.entries[i];
1854
- const valveLabel = (0, import_strings.padStart)(entry.valveId.toString(), 3, "0");
1855
- if (entry.duration) {
1856
- message[`valve ${valveLabel} duration`] = `${entry.duration} s`;
1857
- } else {
1858
- message[`valve ${valveLabel} action`] = `turn off`;
2051
+ tableId;
2052
+ entries;
2053
+ toLogEntry(ctx) {
2054
+ const message = {
2055
+ "table ID": this.tableId
2056
+ };
2057
+ for (let i = 0; i < this.entries.length; i++) {
2058
+ const entry = this.entries[i];
2059
+ const valveLabel = (0, import_strings.padStart)(entry.valveId.toString(), 3, "0");
2060
+ if (entry.duration) {
2061
+ message[`valve ${valveLabel} duration`] = `${entry.duration} s`;
2062
+ } else {
2063
+ message[`valve ${valveLabel} action`] = `turn off`;
2064
+ }
1859
2065
  }
2066
+ return {
2067
+ ...super.toLogEntry(ctx),
2068
+ message
2069
+ };
1860
2070
  }
1861
- return {
1862
- ...super.toLogEntry(ctx),
1863
- message
1864
- };
1865
- }
1866
- };
1867
- IrrigationCCValveTableReport = IrrigationCCValveTableReport_1 = __decorate([
1868
- (0, import_CommandClassDecorators.CCCommand)(import_Types.IrrigationCommand.ValveTableReport)
1869
- ], IrrigationCCValveTableReport);
2071
+ };
2072
+ return IrrigationCCValveTableReport2 = _classThis;
2073
+ })();
1870
2074
  function testResponseForIrrigationValveTableGet(sent, received) {
1871
2075
  return received.tableId === sent.tableId;
1872
2076
  }
1873
- let IrrigationCCValveTableGet = class IrrigationCCValveTableGet2 extends IrrigationCC {
1874
- constructor(options) {
1875
- super(options);
1876
- this.tableId = options.tableId;
1877
- }
1878
- static from(_raw, _ctx) {
1879
- throw new import_safe.ZWaveError(`${this.name}: deserialization not implemented`, import_safe.ZWaveErrorCodes.Deserialization_NotImplemented);
1880
- }
1881
- tableId;
1882
- serialize(ctx) {
1883
- this.payload = import_safe2.Bytes.from([this.tableId]);
1884
- return super.serialize(ctx);
1885
- }
1886
- toLogEntry(ctx) {
1887
- return {
1888
- ...super.toLogEntry(ctx),
1889
- message: {
1890
- "table ID": this.tableId
1891
- }
1892
- };
1893
- }
1894
- };
1895
- IrrigationCCValveTableGet = __decorate([
1896
- (0, import_CommandClassDecorators.CCCommand)(import_Types.IrrigationCommand.ValveTableGet),
1897
- (0, import_CommandClassDecorators.expectedCCResponse)(IrrigationCCValveTableReport, testResponseForIrrigationValveTableGet)
1898
- ], IrrigationCCValveTableGet);
1899
- let IrrigationCCValveTableRun = class IrrigationCCValveTableRun2 extends IrrigationCC {
1900
- constructor(options) {
1901
- super(options);
1902
- this.tableIDs = options.tableIDs;
1903
- if (this.tableIDs.length < 1) {
1904
- throw new import_safe.ZWaveError(`${this.constructor.name}: At least one table ID must be specified.`, import_safe.ZWaveErrorCodes.Argument_Invalid);
2077
+ let IrrigationCCValveTableGet = (() => {
2078
+ let _classDecorators = [(0, import_CommandClassDecorators.CCCommand)(import_Types.IrrigationCommand.ValveTableGet), (0, import_CommandClassDecorators.expectedCCResponse)(IrrigationCCValveTableReport, testResponseForIrrigationValveTableGet)];
2079
+ let _classDescriptor;
2080
+ let _classExtraInitializers = [];
2081
+ let _classThis;
2082
+ let _classSuper = IrrigationCC;
2083
+ var IrrigationCCValveTableGet2 = class extends _classSuper {
2084
+ static {
2085
+ _classThis = this;
1905
2086
  }
1906
- }
1907
- static from(_raw, _ctx) {
1908
- throw new import_safe.ZWaveError(`${this.name}: deserialization not implemented`, import_safe.ZWaveErrorCodes.Deserialization_NotImplemented);
1909
- }
1910
- tableIDs;
1911
- serialize(ctx) {
1912
- this.payload = import_safe2.Bytes.from(this.tableIDs);
1913
- return super.serialize(ctx);
1914
- }
1915
- toLogEntry(ctx) {
1916
- return {
1917
- ...super.toLogEntry(ctx),
1918
- message: {
1919
- "table IDs": this.tableIDs.map((id) => (0, import_strings.padStart)(id.toString(), 3, "0")).join(", ")
1920
- }
1921
- };
1922
- }
1923
- };
1924
- IrrigationCCValveTableRun = __decorate([
1925
- (0, import_CommandClassDecorators.CCCommand)(import_Types.IrrigationCommand.ValveTableRun),
1926
- (0, import_CommandClassDecorators.useSupervision)()
1927
- ], IrrigationCCValveTableRun);
1928
- let IrrigationCCSystemShutoff = class IrrigationCCSystemShutoff2 extends IrrigationCC {
1929
- constructor(options) {
1930
- super(options);
1931
- this.duration = options.duration;
1932
- }
1933
- static from(_raw, _ctx) {
1934
- throw new import_safe.ZWaveError(`${this.name}: deserialization not implemented`, import_safe.ZWaveErrorCodes.Deserialization_NotImplemented);
1935
- }
1936
- duration;
1937
- serialize(ctx) {
1938
- this.payload = import_safe2.Bytes.from([this.duration ?? 255]);
1939
- return super.serialize(ctx);
1940
- }
1941
- toLogEntry(ctx) {
1942
- return {
1943
- ...super.toLogEntry(ctx),
1944
- message: {
1945
- duration: this.duration === 0 ? "temporarily" : this.duration === 255 || this.duration === void 0 ? "permanently" : `${this.duration} hours`
2087
+ static {
2088
+ const _metadata = typeof Symbol === "function" && Symbol.metadata ? Object.create(_classSuper[Symbol.metadata] ?? null) : void 0;
2089
+ __esDecorate(null, _classDescriptor = { value: _classThis }, _classDecorators, { kind: "class", name: _classThis.name, metadata: _metadata }, null, _classExtraInitializers);
2090
+ IrrigationCCValveTableGet2 = _classThis = _classDescriptor.value;
2091
+ if (_metadata) Object.defineProperty(_classThis, Symbol.metadata, { enumerable: true, configurable: true, writable: true, value: _metadata });
2092
+ __runInitializers(_classThis, _classExtraInitializers);
2093
+ }
2094
+ constructor(options) {
2095
+ super(options);
2096
+ this.tableId = options.tableId;
2097
+ }
2098
+ static from(_raw, _ctx) {
2099
+ throw new import_safe.ZWaveError(`${this.name}: deserialization not implemented`, import_safe.ZWaveErrorCodes.Deserialization_NotImplemented);
2100
+ }
2101
+ tableId;
2102
+ serialize(ctx) {
2103
+ this.payload = import_safe2.Bytes.from([this.tableId]);
2104
+ return super.serialize(ctx);
2105
+ }
2106
+ toLogEntry(ctx) {
2107
+ return {
2108
+ ...super.toLogEntry(ctx),
2109
+ message: {
2110
+ "table ID": this.tableId
2111
+ }
2112
+ };
2113
+ }
2114
+ };
2115
+ return IrrigationCCValveTableGet2 = _classThis;
2116
+ })();
2117
+ let IrrigationCCValveTableRun = (() => {
2118
+ let _classDecorators = [(0, import_CommandClassDecorators.CCCommand)(import_Types.IrrigationCommand.ValveTableRun), (0, import_CommandClassDecorators.useSupervision)()];
2119
+ let _classDescriptor;
2120
+ let _classExtraInitializers = [];
2121
+ let _classThis;
2122
+ let _classSuper = IrrigationCC;
2123
+ var IrrigationCCValveTableRun2 = class extends _classSuper {
2124
+ static {
2125
+ _classThis = this;
2126
+ }
2127
+ static {
2128
+ const _metadata = typeof Symbol === "function" && Symbol.metadata ? Object.create(_classSuper[Symbol.metadata] ?? null) : void 0;
2129
+ __esDecorate(null, _classDescriptor = { value: _classThis }, _classDecorators, { kind: "class", name: _classThis.name, metadata: _metadata }, null, _classExtraInitializers);
2130
+ IrrigationCCValveTableRun2 = _classThis = _classDescriptor.value;
2131
+ if (_metadata) Object.defineProperty(_classThis, Symbol.metadata, { enumerable: true, configurable: true, writable: true, value: _metadata });
2132
+ __runInitializers(_classThis, _classExtraInitializers);
2133
+ }
2134
+ constructor(options) {
2135
+ super(options);
2136
+ this.tableIDs = options.tableIDs;
2137
+ if (this.tableIDs.length < 1) {
2138
+ throw new import_safe.ZWaveError(`${this.constructor.name}: At least one table ID must be specified.`, import_safe.ZWaveErrorCodes.Argument_Invalid);
1946
2139
  }
1947
- };
1948
- }
1949
- };
1950
- IrrigationCCSystemShutoff = __decorate([
1951
- (0, import_CommandClassDecorators.CCCommand)(import_Types.IrrigationCommand.SystemShutoff),
1952
- (0, import_CommandClassDecorators.useSupervision)()
1953
- ], IrrigationCCSystemShutoff);
2140
+ }
2141
+ static from(_raw, _ctx) {
2142
+ throw new import_safe.ZWaveError(`${this.name}: deserialization not implemented`, import_safe.ZWaveErrorCodes.Deserialization_NotImplemented);
2143
+ }
2144
+ tableIDs;
2145
+ serialize(ctx) {
2146
+ this.payload = import_safe2.Bytes.from(this.tableIDs);
2147
+ return super.serialize(ctx);
2148
+ }
2149
+ toLogEntry(ctx) {
2150
+ return {
2151
+ ...super.toLogEntry(ctx),
2152
+ message: {
2153
+ "table IDs": this.tableIDs.map((id) => (0, import_strings.padStart)(id.toString(), 3, "0")).join(", ")
2154
+ }
2155
+ };
2156
+ }
2157
+ };
2158
+ return IrrigationCCValveTableRun2 = _classThis;
2159
+ })();
2160
+ let IrrigationCCSystemShutoff = (() => {
2161
+ let _classDecorators = [(0, import_CommandClassDecorators.CCCommand)(import_Types.IrrigationCommand.SystemShutoff), (0, import_CommandClassDecorators.useSupervision)()];
2162
+ let _classDescriptor;
2163
+ let _classExtraInitializers = [];
2164
+ let _classThis;
2165
+ let _classSuper = IrrigationCC;
2166
+ var IrrigationCCSystemShutoff2 = class extends _classSuper {
2167
+ static {
2168
+ _classThis = this;
2169
+ }
2170
+ static {
2171
+ const _metadata = typeof Symbol === "function" && Symbol.metadata ? Object.create(_classSuper[Symbol.metadata] ?? null) : void 0;
2172
+ __esDecorate(null, _classDescriptor = { value: _classThis }, _classDecorators, { kind: "class", name: _classThis.name, metadata: _metadata }, null, _classExtraInitializers);
2173
+ IrrigationCCSystemShutoff2 = _classThis = _classDescriptor.value;
2174
+ if (_metadata) Object.defineProperty(_classThis, Symbol.metadata, { enumerable: true, configurable: true, writable: true, value: _metadata });
2175
+ __runInitializers(_classThis, _classExtraInitializers);
2176
+ }
2177
+ constructor(options) {
2178
+ super(options);
2179
+ this.duration = options.duration;
2180
+ }
2181
+ static from(_raw, _ctx) {
2182
+ throw new import_safe.ZWaveError(`${this.name}: deserialization not implemented`, import_safe.ZWaveErrorCodes.Deserialization_NotImplemented);
2183
+ }
2184
+ duration;
2185
+ serialize(ctx) {
2186
+ this.payload = import_safe2.Bytes.from([this.duration ?? 255]);
2187
+ return super.serialize(ctx);
2188
+ }
2189
+ toLogEntry(ctx) {
2190
+ return {
2191
+ ...super.toLogEntry(ctx),
2192
+ message: {
2193
+ duration: this.duration === 0 ? "temporarily" : this.duration === 255 || this.duration === void 0 ? "permanently" : `${this.duration} hours`
2194
+ }
2195
+ };
2196
+ }
2197
+ };
2198
+ return IrrigationCCSystemShutoff2 = _classThis;
2199
+ })();
1954
2200
  // Annotate the CommonJS export names for ESM import in node:
1955
2201
  0 && (module.exports = {
1956
2202
  IrrigationCC,