@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
@@ -40,13 +40,45 @@ var import_CommandClass = require("../lib/CommandClass.js");
40
40
  var import_CommandClassDecorators = require("../lib/CommandClassDecorators.js");
41
41
  var import_Values = require("../lib/Values.js");
42
42
  var import_Types = require("../lib/_Types.js");
43
- var __decorate = function(decorators, target, key, desc) {
44
- var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
45
- if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
46
- 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;
47
- return c > 3 && r && Object.defineProperty(target, key, r), r;
43
+ var __esDecorate = function(ctor, descriptorIn, decorators, contextIn, initializers, extraInitializers) {
44
+ function accept(f) {
45
+ if (f !== void 0 && typeof f !== "function") throw new TypeError("Function expected");
46
+ return f;
47
+ }
48
+ var kind = contextIn.kind, key = kind === "getter" ? "get" : kind === "setter" ? "set" : "value";
49
+ var target = !descriptorIn && ctor ? contextIn["static"] ? ctor : ctor.prototype : null;
50
+ var descriptor = descriptorIn || (target ? Object.getOwnPropertyDescriptor(target, contextIn.name) : {});
51
+ var _, done = false;
52
+ for (var i = decorators.length - 1; i >= 0; i--) {
53
+ var context = {};
54
+ for (var p in contextIn) context[p] = p === "access" ? {} : contextIn[p];
55
+ for (var p in contextIn.access) context.access[p] = contextIn.access[p];
56
+ context.addInitializer = function(f) {
57
+ if (done) throw new TypeError("Cannot add initializers after decoration has completed");
58
+ extraInitializers.push(accept(f || null));
59
+ };
60
+ var result = (0, decorators[i])(kind === "accessor" ? { get: descriptor.get, set: descriptor.set } : descriptor[key], context);
61
+ if (kind === "accessor") {
62
+ if (result === void 0) continue;
63
+ if (result === null || typeof result !== "object") throw new TypeError("Object expected");
64
+ if (_ = accept(result.get)) descriptor.get = _;
65
+ if (_ = accept(result.set)) descriptor.set = _;
66
+ if (_ = accept(result.init)) initializers.unshift(_);
67
+ } else if (_ = accept(result)) {
68
+ if (kind === "field") initializers.unshift(_);
69
+ else descriptor[key] = _;
70
+ }
71
+ }
72
+ if (target) Object.defineProperty(target, contextIn.name, descriptor);
73
+ done = true;
74
+ };
75
+ var __runInitializers = function(thisArg, initializers, value) {
76
+ var useValue = arguments.length > 2;
77
+ for (var i = 0; i < initializers.length; i++) {
78
+ value = useValue ? initializers[i].call(thisArg, value) : initializers[i].call(thisArg);
79
+ }
80
+ return useValue ? value : void 0;
48
81
  };
49
- var IndicatorCCSet_1, IndicatorCCReport_1, IndicatorCCGet_1, IndicatorCCSupportedReport_1, IndicatorCCSupportedGet_1, IndicatorCCDescriptionReport_1, IndicatorCCDescriptionGet_1;
50
82
  function __assertType(argName, typeName, boundHasError) {
51
83
  const { ZWaveError: ZWaveError2, ZWaveErrorCodes: ZWaveErrorCodes2 } = require("@zwave-js/core");
52
84
  if (boundHasError()) {
@@ -414,810 +446,939 @@ function getIndicatorName(indicatorId) {
414
446
  }
415
447
  }
416
448
  const MAX_INDICATOR_OBJECTS = 31;
417
- let IndicatorCCAPI = class IndicatorCCAPI2 extends import_API.CCAPI {
418
- supportsCommand(cmd) {
419
- switch (cmd) {
420
- case import_Types.IndicatorCommand.Get:
421
- case import_Types.IndicatorCommand.Report:
422
- return this.isSinglecast();
423
- case import_Types.IndicatorCommand.Set:
424
- return true;
425
- // This is mandatory
426
- case import_Types.IndicatorCommand.SupportedGet:
427
- case import_Types.IndicatorCommand.SupportedReport:
428
- return this.version >= 2 && this.isSinglecast();
429
- case import_Types.IndicatorCommand.DescriptionGet:
430
- case import_Types.IndicatorCommand.DescriptionReport:
431
- return this.version >= 4 && this.isSinglecast();
432
- }
433
- return super.supportsCommand(cmd);
434
- }
435
- get [import_API.SET_VALUE]() {
436
- return async function({ property, propertyKey }, value) {
437
- if (property === "value") {
438
- if (typeof value !== "number") {
439
- (0, import_API.throwWrongValueType)(this.ccId, property, "number", typeof value);
440
- }
441
- return this.set(value);
442
- } else if (typeof property === "number" && typeof propertyKey === "number") {
443
- const indicatorId = property;
444
- const propertyId = propertyKey;
445
- const expectedType = getIndicatorMetadata(indicatorId, propertyId).type;
446
- if (typeof value !== expectedType) {
447
- (0, import_API.throwWrongValueType)(this.ccId, property, expectedType, typeof value);
448
- }
449
- return this.set([
450
- {
451
- indicatorId: property,
452
- propertyId: propertyKey,
453
- value
449
+ let IndicatorCCAPI = (() => {
450
+ let _classDecorators = [(0, import_CommandClassDecorators.API)(import_safe.CommandClasses.Indicator)];
451
+ let _classDescriptor;
452
+ let _classExtraInitializers = [];
453
+ let _classThis;
454
+ let _classSuper = import_API.CCAPI;
455
+ var IndicatorCCAPI2 = class extends _classSuper {
456
+ static {
457
+ _classThis = this;
458
+ }
459
+ static {
460
+ const _metadata = typeof Symbol === "function" && Symbol.metadata ? Object.create(_classSuper[Symbol.metadata] ?? null) : void 0;
461
+ __esDecorate(null, _classDescriptor = { value: _classThis }, _classDecorators, { kind: "class", name: _classThis.name, metadata: _metadata }, null, _classExtraInitializers);
462
+ IndicatorCCAPI2 = _classThis = _classDescriptor.value;
463
+ if (_metadata) Object.defineProperty(_classThis, Symbol.metadata, { enumerable: true, configurable: true, writable: true, value: _metadata });
464
+ __runInitializers(_classThis, _classExtraInitializers);
465
+ }
466
+ supportsCommand(cmd) {
467
+ switch (cmd) {
468
+ case import_Types.IndicatorCommand.Get:
469
+ case import_Types.IndicatorCommand.Report:
470
+ return this.isSinglecast();
471
+ case import_Types.IndicatorCommand.Set:
472
+ return true;
473
+ // This is mandatory
474
+ case import_Types.IndicatorCommand.SupportedGet:
475
+ case import_Types.IndicatorCommand.SupportedReport:
476
+ return this.version >= 2 && this.isSinglecast();
477
+ case import_Types.IndicatorCommand.DescriptionGet:
478
+ case import_Types.IndicatorCommand.DescriptionReport:
479
+ return this.version >= 4 && this.isSinglecast();
480
+ }
481
+ return super.supportsCommand(cmd);
482
+ }
483
+ get [import_API.SET_VALUE]() {
484
+ return async function({ property, propertyKey }, value) {
485
+ if (property === "value") {
486
+ if (typeof value !== "number") {
487
+ (0, import_API.throwWrongValueType)(this.ccId, property, "number", typeof value);
488
+ }
489
+ return this.set(value);
490
+ } else if (typeof property === "number" && typeof propertyKey === "number") {
491
+ const indicatorId = property;
492
+ const propertyId = propertyKey;
493
+ const expectedType = getIndicatorMetadata(indicatorId, propertyId).type;
494
+ if (typeof value !== expectedType) {
495
+ (0, import_API.throwWrongValueType)(this.ccId, property, expectedType, typeof value);
454
496
  }
455
- ]);
456
- } else if (property === "identify") {
457
- if (typeof value !== "boolean") {
458
- (0, import_API.throwWrongValueType)(this.ccId, property, "boolean", typeof value);
497
+ return this.set([
498
+ {
499
+ indicatorId: property,
500
+ propertyId: propertyKey,
501
+ value
502
+ }
503
+ ]);
504
+ } else if (property === "identify") {
505
+ if (typeof value !== "boolean") {
506
+ (0, import_API.throwWrongValueType)(this.ccId, property, "boolean", typeof value);
507
+ }
508
+ return this.identify();
509
+ } else {
510
+ (0, import_API.throwUnsupportedProperty)(this.ccId, property);
511
+ }
512
+ };
513
+ }
514
+ get [import_API.POLL_VALUE]() {
515
+ return async function({ property }) {
516
+ if (property === "value")
517
+ return this.get();
518
+ if (typeof property === "number") {
519
+ return this.get(property);
459
520
  }
460
- return this.identify();
461
- } else {
462
521
  (0, import_API.throwUnsupportedProperty)(this.ccId, property);
463
- }
464
- };
465
- }
466
- get [import_API.POLL_VALUE]() {
467
- return async function({ property }) {
468
- if (property === "value")
469
- return this.get();
470
- if (typeof property === "number") {
471
- return this.get(property);
472
- }
473
- (0, import_API.throwUnsupportedProperty)(this.ccId, property);
474
- };
475
- }
476
- async get(indicatorId) {
477
- __assertType("indicatorId", "(optional) number", __assertType__optional_number.bind(void 0, indicatorId));
478
- this.assertSupportsCommand(import_Types.IndicatorCommand, import_Types.IndicatorCommand.Get);
479
- const cc = new IndicatorCCGet({
480
- nodeId: this.endpoint.nodeId,
481
- endpointIndex: this.endpoint.index,
482
- indicatorId
483
- });
484
- const response = await this.host.sendCommand(cc, this.commandOptions);
485
- if (!response)
486
- return;
487
- if (response.values)
488
- return response.values;
489
- return response.indicator0Value;
490
- }
491
- async set(value) {
492
- __assertType("value", void 0, __assertType__su__number_sa__5_ea_5_5_5_eu.bind(void 0, value));
493
- this.assertSupportsCommand(import_Types.IndicatorCommand, import_Types.IndicatorCommand.Set);
494
- if (this.version === 1 && typeof value !== "number") {
495
- throw new import_safe.ZWaveError(`Node ${this.endpoint.nodeId} only supports IndicatorCC V1 which requires a single value to be set`, import_safe.ZWaveErrorCodes.Argument_Invalid);
496
- } else if (this.version >= 2 && (0, import_typeguards.isArray)(value) && value.length > MAX_INDICATOR_OBJECTS) {
497
- throw new import_safe.ZWaveError(`Only ${MAX_INDICATOR_OBJECTS} indicator values can be set at a time!`, import_safe.ZWaveErrorCodes.Argument_Invalid);
498
- }
499
- const cc = new IndicatorCCSet({
500
- nodeId: this.endpoint.nodeId,
501
- endpointIndex: this.endpoint.index,
502
- ...typeof value === "number" ? { value } : { values: value }
503
- });
504
- return this.host.sendCommand(cc, this.commandOptions);
505
- }
506
- async sendReport(options) {
507
- __assertType("options", "IndicatorCCReportOptions", __assertType__IndicatorCCReportOptions.bind(void 0, options));
508
- this.assertSupportsCommand(import_Types.IndicatorCommand, import_Types.IndicatorCommand.Report);
509
- const cc = new IndicatorCCReport({
510
- nodeId: this.endpoint.nodeId,
511
- endpointIndex: this.endpoint.index,
512
- ...options
513
- });
514
- await this.host.sendCommand(cc, this.commandOptions);
515
- }
516
- async getSupported(indicatorId) {
517
- __assertType("indicatorId", "number", __assertType__number.bind(void 0, indicatorId));
518
- this.assertSupportsCommand(import_Types.IndicatorCommand, import_Types.IndicatorCommand.SupportedGet);
519
- const cc = new IndicatorCCSupportedGet({
520
- nodeId: this.endpoint.nodeId,
521
- endpointIndex: this.endpoint.index,
522
- indicatorId
523
- });
524
- const response = await this.host.sendCommand(cc, this.commandOptions);
525
- if (response) {
526
- return {
527
- // Include the actual indicator ID if 0x00 was requested
528
- ...indicatorId === 0 ? { indicatorId: response.indicatorId } : void 0,
529
- supportedProperties: response.supportedProperties,
530
- nextIndicatorId: response.nextIndicatorId
531
522
  };
532
523
  }
533
- }
534
- async reportSupported(indicatorId, supportedProperties, nextIndicatorId) {
535
- __assertType("indicatorId", "number", __assertType__number.bind(void 0, indicatorId));
536
- __assertType("supportedProperties", void 0, __assertType__sa__number_ea_2.bind(void 0, supportedProperties));
537
- __assertType("nextIndicatorId", "number", __assertType__number.bind(void 0, nextIndicatorId));
538
- this.assertSupportsCommand(import_Types.IndicatorCommand, import_Types.IndicatorCommand.SupportedReport);
539
- const cc = new IndicatorCCSupportedReport({
540
- nodeId: this.endpoint.nodeId,
541
- endpointIndex: this.endpoint.index,
542
- indicatorId,
543
- supportedProperties,
544
- nextIndicatorId
545
- });
546
- await this.host.sendCommand(cc, this.commandOptions);
547
- }
548
- async reportDescription(indicatorId, description) {
549
- __assertType("indicatorId", "number", __assertType__number.bind(void 0, indicatorId));
550
- __assertType("description", "string", __assertType__string.bind(void 0, description));
551
- this.assertSupportsCommand(import_Types.IndicatorCommand, import_Types.IndicatorCommand.DescriptionReport);
552
- const cc = new IndicatorCCDescriptionReport({
553
- nodeId: this.endpoint.nodeId,
554
- endpointIndex: this.endpoint.index,
555
- indicatorId,
556
- description
557
- });
558
- await this.host.sendCommand(cc, this.commandOptions);
559
- }
560
- /**
561
- * Instructs the node to identify itself. Available starting with V3 of this CC.
562
- */
563
- async identify() {
564
- if (this.version < 3) {
565
- throw new import_safe.ZWaveError(`The identify command is only supported in Indicator CC version 3 and above`, import_safe.ZWaveErrorCodes.CC_NotSupported);
566
- }
567
- return this.set([
568
- {
569
- indicatorId: 80,
570
- propertyId: 3,
571
- value: 8
572
- },
573
- {
574
- indicatorId: 80,
575
- propertyId: 4,
576
- value: 3
577
- },
578
- {
579
- indicatorId: 80,
580
- propertyId: 5,
581
- value: 6
524
+ async get(indicatorId) {
525
+ __assertType("indicatorId", "(optional) number", __assertType__optional_number.bind(void 0, indicatorId));
526
+ this.assertSupportsCommand(import_Types.IndicatorCommand, import_Types.IndicatorCommand.Get);
527
+ const cc = new IndicatorCCGet({
528
+ nodeId: this.endpoint.nodeId,
529
+ endpointIndex: this.endpoint.index,
530
+ indicatorId
531
+ });
532
+ const response = await this.host.sendCommand(cc, this.commandOptions);
533
+ if (!response)
534
+ return;
535
+ if (response.values)
536
+ return response.values;
537
+ return response.indicator0Value;
538
+ }
539
+ async set(value) {
540
+ __assertType("value", void 0, __assertType__su__number_sa__5_ea_5_5_5_eu.bind(void 0, value));
541
+ this.assertSupportsCommand(import_Types.IndicatorCommand, import_Types.IndicatorCommand.Set);
542
+ if (this.version === 1 && typeof value !== "number") {
543
+ throw new import_safe.ZWaveError(`Node ${this.endpoint.nodeId} only supports IndicatorCC V1 which requires a single value to be set`, import_safe.ZWaveErrorCodes.Argument_Invalid);
544
+ } else if (this.version >= 2 && (0, import_typeguards.isArray)(value) && value.length > MAX_INDICATOR_OBJECTS) {
545
+ throw new import_safe.ZWaveError(`Only ${MAX_INDICATOR_OBJECTS} indicator values can be set at a time!`, import_safe.ZWaveErrorCodes.Argument_Invalid);
582
546
  }
583
- ]);
584
- }
585
- /**
586
- * Set a timeout for a given indicator ID after which the indicator will be turned off.
587
- * @param timeout The timeout in one of the supported forms:
588
- * - a timeout string in the form `12h18m17.59s`. All parts (hours, minutes, seconds, hundredths) are optional, but must be specified in this order. An empty string will be treated like `undefined`.
589
- * - an object specifying the timeout parts. An empty object will be treated like `undefined`.
590
- * - `undefined` to disable the timeout.
591
- */
592
- async setTimeout(indicatorId, timeout) {
593
- __assertType("indicatorId", "number", __assertType__number.bind(void 0, indicatorId));
594
- __assertType("timeout", void 0, __assertType__su__undefined__string__3_eu.bind(void 0, timeout));
595
- this.assertPhysicalEndpoint(this.endpoint);
596
- if (this.version < 3) {
597
- throw new import_safe.ZWaveError(`The setTimeout command is only supported in Indicator CC version 3 and above`, import_safe.ZWaveErrorCodes.CC_NotSupported);
598
- }
599
- if (typeof timeout === "string") {
600
- if (timeout === "") {
601
- timeout = void 0;
602
- } else {
603
- const parsed = parseIndicatorTimeoutString(timeout);
604
- if (!parsed) {
605
- throw new import_safe.ZWaveError(`The timeout string "${timeout}" is not valid`, import_safe.ZWaveErrorCodes.Argument_Invalid);
606
- }
607
- timeout = parsed;
547
+ const cc = new IndicatorCCSet({
548
+ nodeId: this.endpoint.nodeId,
549
+ endpointIndex: this.endpoint.index,
550
+ ...typeof value === "number" ? { value } : { values: value }
551
+ });
552
+ return this.host.sendCommand(cc, this.commandOptions);
553
+ }
554
+ async sendReport(options) {
555
+ __assertType("options", "IndicatorCCReportOptions", __assertType__IndicatorCCReportOptions.bind(void 0, options));
556
+ this.assertSupportsCommand(import_Types.IndicatorCommand, import_Types.IndicatorCommand.Report);
557
+ const cc = new IndicatorCCReport({
558
+ nodeId: this.endpoint.nodeId,
559
+ endpointIndex: this.endpoint.index,
560
+ ...options
561
+ });
562
+ await this.host.sendCommand(cc, this.commandOptions);
563
+ }
564
+ async getSupported(indicatorId) {
565
+ __assertType("indicatorId", "number", __assertType__number.bind(void 0, indicatorId));
566
+ this.assertSupportsCommand(import_Types.IndicatorCommand, import_Types.IndicatorCommand.SupportedGet);
567
+ const cc = new IndicatorCCSupportedGet({
568
+ nodeId: this.endpoint.nodeId,
569
+ endpointIndex: this.endpoint.index,
570
+ indicatorId
571
+ });
572
+ const response = await this.host.sendCommand(cc, this.commandOptions);
573
+ if (response) {
574
+ return {
575
+ // Include the actual indicator ID if 0x00 was requested
576
+ ...indicatorId === 0 ? { indicatorId: response.indicatorId } : void 0,
577
+ supportedProperties: response.supportedProperties,
578
+ nextIndicatorId: response.nextIndicatorId
579
+ };
608
580
  }
609
581
  }
610
- const supportedPropertyIDs = IndicatorCC.getSupportedPropertyIDsCached(this.host, this.endpoint, indicatorId);
611
- const objects = [];
612
- if (timeout) {
613
- const hours = timeout.hours ?? 0;
614
- const minutes = timeout.minutes ?? 0;
615
- const seconds = Math.floor(timeout.seconds ?? 0);
616
- const hundredths = Math.round((timeout.seconds ?? 0) % 1 * 100);
617
- if (hours) {
618
- if (!supportedPropertyIDs?.includes(10)) {
619
- throw new import_safe.ZWaveError(`The indicator ${indicatorId} does not support setting the timeout in hours`, import_safe.ZWaveErrorCodes.Argument_Invalid);
620
- }
621
- objects.push({
622
- indicatorId,
623
- propertyId: 10,
624
- value: hours
625
- });
582
+ async reportSupported(indicatorId, supportedProperties, nextIndicatorId) {
583
+ __assertType("indicatorId", "number", __assertType__number.bind(void 0, indicatorId));
584
+ __assertType("supportedProperties", void 0, __assertType__sa__number_ea_2.bind(void 0, supportedProperties));
585
+ __assertType("nextIndicatorId", "number", __assertType__number.bind(void 0, nextIndicatorId));
586
+ this.assertSupportsCommand(import_Types.IndicatorCommand, import_Types.IndicatorCommand.SupportedReport);
587
+ const cc = new IndicatorCCSupportedReport({
588
+ nodeId: this.endpoint.nodeId,
589
+ endpointIndex: this.endpoint.index,
590
+ indicatorId,
591
+ supportedProperties,
592
+ nextIndicatorId
593
+ });
594
+ await this.host.sendCommand(cc, this.commandOptions);
595
+ }
596
+ async reportDescription(indicatorId, description) {
597
+ __assertType("indicatorId", "number", __assertType__number.bind(void 0, indicatorId));
598
+ __assertType("description", "string", __assertType__string.bind(void 0, description));
599
+ this.assertSupportsCommand(import_Types.IndicatorCommand, import_Types.IndicatorCommand.DescriptionReport);
600
+ const cc = new IndicatorCCDescriptionReport({
601
+ nodeId: this.endpoint.nodeId,
602
+ endpointIndex: this.endpoint.index,
603
+ indicatorId,
604
+ description
605
+ });
606
+ await this.host.sendCommand(cc, this.commandOptions);
607
+ }
608
+ /**
609
+ * Instructs the node to identify itself. Available starting with V3 of this CC.
610
+ */
611
+ async identify() {
612
+ if (this.version < 3) {
613
+ throw new import_safe.ZWaveError(`The identify command is only supported in Indicator CC version 3 and above`, import_safe.ZWaveErrorCodes.CC_NotSupported);
626
614
  }
627
- if (minutes) {
628
- if (!supportedPropertyIDs?.includes(6)) {
629
- throw new import_safe.ZWaveError(`The indicator ${indicatorId} does not support setting the timeout in minutes`, import_safe.ZWaveErrorCodes.Argument_Invalid);
615
+ return this.set([
616
+ {
617
+ indicatorId: 80,
618
+ propertyId: 3,
619
+ value: 8
620
+ },
621
+ {
622
+ indicatorId: 80,
623
+ propertyId: 4,
624
+ value: 3
625
+ },
626
+ {
627
+ indicatorId: 80,
628
+ propertyId: 5,
629
+ value: 6
630
630
  }
631
- objects.push({
632
- indicatorId,
633
- propertyId: 6,
634
- value: minutes
635
- });
631
+ ]);
632
+ }
633
+ /**
634
+ * Set a timeout for a given indicator ID after which the indicator will be turned off.
635
+ * @param timeout The timeout in one of the supported forms:
636
+ * - a timeout string in the form `12h18m17.59s`. All parts (hours, minutes, seconds, hundredths) are optional, but must be specified in this order. An empty string will be treated like `undefined`.
637
+ * - an object specifying the timeout parts. An empty object will be treated like `undefined`.
638
+ * - `undefined` to disable the timeout.
639
+ */
640
+ async setTimeout(indicatorId, timeout) {
641
+ __assertType("indicatorId", "number", __assertType__number.bind(void 0, indicatorId));
642
+ __assertType("timeout", void 0, __assertType__su__undefined__string__3_eu.bind(void 0, timeout));
643
+ this.assertPhysicalEndpoint(this.endpoint);
644
+ if (this.version < 3) {
645
+ throw new import_safe.ZWaveError(`The setTimeout command is only supported in Indicator CC version 3 and above`, import_safe.ZWaveErrorCodes.CC_NotSupported);
636
646
  }
637
- if (seconds) {
638
- if (!supportedPropertyIDs?.includes(7)) {
639
- throw new import_safe.ZWaveError(`The indicator ${indicatorId} does not support setting the timeout in seconds`, import_safe.ZWaveErrorCodes.Argument_Invalid);
647
+ if (typeof timeout === "string") {
648
+ if (timeout === "") {
649
+ timeout = void 0;
650
+ } else {
651
+ const parsed = parseIndicatorTimeoutString(timeout);
652
+ if (!parsed) {
653
+ throw new import_safe.ZWaveError(`The timeout string "${timeout}" is not valid`, import_safe.ZWaveErrorCodes.Argument_Invalid);
654
+ }
655
+ timeout = parsed;
640
656
  }
641
- objects.push({
642
- indicatorId,
643
- propertyId: 7,
644
- value: seconds
645
- });
646
657
  }
647
- if (hundredths) {
648
- if (!supportedPropertyIDs?.includes(8)) {
649
- throw new import_safe.ZWaveError(`The indicator ${indicatorId} does not support setting the timeout in 1/100 seconds`, import_safe.ZWaveErrorCodes.Argument_Invalid);
658
+ const supportedPropertyIDs = IndicatorCC.getSupportedPropertyIDsCached(this.host, this.endpoint, indicatorId);
659
+ const objects = [];
660
+ if (timeout) {
661
+ const hours = timeout.hours ?? 0;
662
+ const minutes = timeout.minutes ?? 0;
663
+ const seconds = Math.floor(timeout.seconds ?? 0);
664
+ const hundredths = Math.round((timeout.seconds ?? 0) % 1 * 100);
665
+ if (hours) {
666
+ if (!supportedPropertyIDs?.includes(10)) {
667
+ throw new import_safe.ZWaveError(`The indicator ${indicatorId} does not support setting the timeout in hours`, import_safe.ZWaveErrorCodes.Argument_Invalid);
668
+ }
669
+ objects.push({
670
+ indicatorId,
671
+ propertyId: 10,
672
+ value: hours
673
+ });
674
+ }
675
+ if (minutes) {
676
+ if (!supportedPropertyIDs?.includes(6)) {
677
+ throw new import_safe.ZWaveError(`The indicator ${indicatorId} does not support setting the timeout in minutes`, import_safe.ZWaveErrorCodes.Argument_Invalid);
678
+ }
679
+ objects.push({
680
+ indicatorId,
681
+ propertyId: 6,
682
+ value: minutes
683
+ });
650
684
  }
651
- objects.push({
685
+ if (seconds) {
686
+ if (!supportedPropertyIDs?.includes(7)) {
687
+ throw new import_safe.ZWaveError(`The indicator ${indicatorId} does not support setting the timeout in seconds`, import_safe.ZWaveErrorCodes.Argument_Invalid);
688
+ }
689
+ objects.push({
690
+ indicatorId,
691
+ propertyId: 7,
692
+ value: seconds
693
+ });
694
+ }
695
+ if (hundredths) {
696
+ if (!supportedPropertyIDs?.includes(8)) {
697
+ throw new import_safe.ZWaveError(`The indicator ${indicatorId} does not support setting the timeout in 1/100 seconds`, import_safe.ZWaveErrorCodes.Argument_Invalid);
698
+ }
699
+ objects.push({
700
+ indicatorId,
701
+ propertyId: 8,
702
+ value: hundredths
703
+ });
704
+ }
705
+ }
706
+ if (!objects.length) {
707
+ objects.push(...(supportedPropertyIDs ?? []).map((p) => ({
652
708
  indicatorId,
653
- propertyId: 8,
654
- value: hundredths
655
- });
709
+ propertyId: p,
710
+ value: 0
711
+ })));
656
712
  }
713
+ return this.set(objects);
657
714
  }
658
- if (!objects.length) {
659
- objects.push(...(supportedPropertyIDs ?? []).map((p) => ({
660
- indicatorId,
661
- propertyId: p,
662
- value: 0
663
- })));
715
+ /**
716
+ * Returns the timeout after which the given indicator will be turned off.
717
+ */
718
+ async getTimeout(indicatorId) {
719
+ __assertType("indicatorId", "number", __assertType__number.bind(void 0, indicatorId));
720
+ const values = await this.get(indicatorId);
721
+ if (!(0, import_typeguards.isArray)(values))
722
+ return;
723
+ return indicatorObjectsToTimeout(values);
664
724
  }
665
- return this.set(objects);
666
- }
667
- /**
668
- * Returns the timeout after which the given indicator will be turned off.
669
- */
670
- async getTimeout(indicatorId) {
671
- __assertType("indicatorId", "number", __assertType__number.bind(void 0, indicatorId));
672
- const values = await this.get(indicatorId);
673
- if (!(0, import_typeguards.isArray)(values))
674
- return;
675
- return indicatorObjectsToTimeout(values);
676
- }
677
- async getDescription(indicatorId) {
678
- __assertType("indicatorId", "number", __assertType__number.bind(void 0, indicatorId));
679
- this.assertSupportsCommand(import_Types.IndicatorCommand, import_Types.IndicatorCommand.DescriptionGet);
680
- const cc = new IndicatorCCDescriptionGet({
681
- nodeId: this.endpoint.nodeId,
682
- endpointIndex: this.endpoint.index,
683
- indicatorId
684
- });
685
- const response = await this.host.sendCommand(cc, this.commandOptions);
686
- return response?.description;
687
- }
688
- };
689
- IndicatorCCAPI = __decorate([
690
- (0, import_CommandClassDecorators.API)(import_safe.CommandClasses.Indicator)
691
- ], IndicatorCCAPI);
692
- let IndicatorCC = class IndicatorCC2 extends import_CommandClass.CommandClass {
693
- async interview(ctx) {
694
- const node = this.getNode(ctx);
695
- const endpoint = this.getEndpoint(ctx);
696
- const api = import_API.CCAPI.create(import_safe.CommandClasses.Indicator, ctx, endpoint).withOptions({
697
- priority: import_safe.MessagePriority.NodeQuery
698
- });
699
- ctx.logNode(node.id, {
700
- endpoint: this.endpointIndex,
701
- message: `Interviewing ${this.ccName}...`,
702
- direction: "none"
703
- });
704
- if (api.version > 1) {
705
- ctx.logNode(node.id, {
706
- endpoint: this.endpointIndex,
707
- message: "scanning supported indicator IDs...",
708
- direction: "outbound"
725
+ async getDescription(indicatorId) {
726
+ __assertType("indicatorId", "number", __assertType__number.bind(void 0, indicatorId));
727
+ this.assertSupportsCommand(import_Types.IndicatorCommand, import_Types.IndicatorCommand.DescriptionGet);
728
+ const cc = new IndicatorCCDescriptionGet({
729
+ nodeId: this.endpoint.nodeId,
730
+ endpointIndex: this.endpoint.index,
731
+ indicatorId
732
+ });
733
+ const response = await this.host.sendCommand(cc, this.commandOptions);
734
+ return response?.description;
735
+ }
736
+ };
737
+ return IndicatorCCAPI2 = _classThis;
738
+ })();
739
+ let IndicatorCC = (() => {
740
+ let _classDecorators = [(0, import_CommandClassDecorators.commandClass)(import_safe.CommandClasses.Indicator), (0, import_CommandClassDecorators.implementedVersion)(4), (0, import_CommandClassDecorators.ccValues)(IndicatorCCValues)];
741
+ let _classDescriptor;
742
+ let _classExtraInitializers = [];
743
+ let _classThis;
744
+ let _classSuper = import_CommandClass.CommandClass;
745
+ var IndicatorCC2 = class extends _classSuper {
746
+ static {
747
+ _classThis = this;
748
+ }
749
+ static {
750
+ const _metadata = typeof Symbol === "function" && Symbol.metadata ? Object.create(_classSuper[Symbol.metadata] ?? null) : void 0;
751
+ __esDecorate(null, _classDescriptor = { value: _classThis }, _classDecorators, { kind: "class", name: _classThis.name, metadata: _metadata }, null, _classExtraInitializers);
752
+ IndicatorCC2 = _classThis = _classDescriptor.value;
753
+ if (_metadata) Object.defineProperty(_classThis, Symbol.metadata, { enumerable: true, configurable: true, writable: true, value: _metadata });
754
+ __runInitializers(_classThis, _classExtraInitializers);
755
+ }
756
+ async interview(ctx) {
757
+ const node = this.getNode(ctx);
758
+ const endpoint = this.getEndpoint(ctx);
759
+ const api = import_API.CCAPI.create(import_safe.CommandClasses.Indicator, ctx, endpoint).withOptions({
760
+ priority: import_safe.MessagePriority.NodeQuery
709
761
  });
710
- let curId = 0;
711
- const supportedIndicatorIds = [];
712
- do {
713
- const supportedResponse = await api.getSupported(curId);
714
- if (!supportedResponse) {
715
- ctx.logNode(node.id, {
716
- endpoint: this.endpointIndex,
717
- message: "Time out while scanning supported indicator IDs, skipping interview...",
718
- level: "warn"
719
- });
720
- return;
721
- }
722
- supportedIndicatorIds.push(supportedResponse.indicatorId ?? curId);
723
- curId = supportedResponse.nextIndicatorId;
724
- } while (curId !== 0);
725
- this.setValue(ctx, IndicatorCCValues.supportedIndicatorIds, supportedIndicatorIds);
726
- const logMessage = `supported indicator IDs: ${supportedIndicatorIds.join(", ")}`;
727
762
  ctx.logNode(node.id, {
728
763
  endpoint: this.endpointIndex,
729
- message: logMessage,
730
- direction: "inbound"
764
+ message: `Interviewing ${this.ccName}...`,
765
+ direction: "none"
731
766
  });
732
- if (api.version >= 4) {
733
- const manufacturerDefinedIndicatorIds = supportedIndicatorIds.filter((id) => isManufacturerDefinedIndicator(id));
734
- if (manufacturerDefinedIndicatorIds.length > 0) {
735
- ctx.logNode(node.id, {
736
- endpoint: this.endpointIndex,
737
- message: "retrieving description for manufacturer-defined indicator IDs...",
738
- direction: "outbound"
739
- });
740
- for (const id of manufacturerDefinedIndicatorIds) {
741
- await api.getDescription(id);
767
+ if (api.version > 1) {
768
+ ctx.logNode(node.id, {
769
+ endpoint: this.endpointIndex,
770
+ message: "scanning supported indicator IDs...",
771
+ direction: "outbound"
772
+ });
773
+ let curId = 0;
774
+ const supportedIndicatorIds = [];
775
+ do {
776
+ const supportedResponse = await api.getSupported(curId);
777
+ if (!supportedResponse) {
778
+ ctx.logNode(node.id, {
779
+ endpoint: this.endpointIndex,
780
+ message: "Time out while scanning supported indicator IDs, skipping interview...",
781
+ level: "warn"
782
+ });
783
+ return;
784
+ }
785
+ supportedIndicatorIds.push(supportedResponse.indicatorId ?? curId);
786
+ curId = supportedResponse.nextIndicatorId;
787
+ } while (curId !== 0);
788
+ this.setValue(ctx, IndicatorCCValues.supportedIndicatorIds, supportedIndicatorIds);
789
+ const logMessage = `supported indicator IDs: ${supportedIndicatorIds.join(", ")}`;
790
+ ctx.logNode(node.id, {
791
+ endpoint: this.endpointIndex,
792
+ message: logMessage,
793
+ direction: "inbound"
794
+ });
795
+ if (api.version >= 4) {
796
+ const manufacturerDefinedIndicatorIds = supportedIndicatorIds.filter((id) => isManufacturerDefinedIndicator(id));
797
+ if (manufacturerDefinedIndicatorIds.length > 0) {
798
+ ctx.logNode(node.id, {
799
+ endpoint: this.endpointIndex,
800
+ message: "retrieving description for manufacturer-defined indicator IDs...",
801
+ direction: "outbound"
802
+ });
803
+ for (const id of manufacturerDefinedIndicatorIds) {
804
+ await api.getDescription(id);
805
+ }
742
806
  }
743
807
  }
744
808
  }
809
+ await this.refreshValues(ctx);
810
+ this.setInterviewComplete(ctx, true);
745
811
  }
746
- await this.refreshValues(ctx);
747
- this.setInterviewComplete(ctx, true);
748
- }
749
- async refreshValues(ctx) {
750
- const node = this.getNode(ctx);
751
- const endpoint = this.getEndpoint(ctx);
752
- const api = import_API.CCAPI.create(import_safe.CommandClasses.Indicator, ctx, endpoint).withOptions({
753
- priority: import_safe.MessagePriority.NodeQuery
754
- });
755
- if (api.version === 1) {
756
- ctx.logNode(node.id, {
757
- endpoint: this.endpointIndex,
758
- message: "requesting current indicator value...",
759
- direction: "outbound"
812
+ async refreshValues(ctx) {
813
+ const node = this.getNode(ctx);
814
+ const endpoint = this.getEndpoint(ctx);
815
+ const api = import_API.CCAPI.create(import_safe.CommandClasses.Indicator, ctx, endpoint).withOptions({
816
+ priority: import_safe.MessagePriority.NodeQuery
760
817
  });
761
- await api.get();
762
- } else {
763
- const supportedIndicatorIds = this.getValue(ctx, IndicatorCCValues.supportedIndicatorIds) ?? [];
764
- for (const indicatorId of supportedIndicatorIds) {
818
+ if (api.version === 1) {
765
819
  ctx.logNode(node.id, {
766
820
  endpoint: this.endpointIndex,
767
- message: `requesting current indicator value (id = ${(0, import_safe3.num2hex)(indicatorId)})...`,
821
+ message: "requesting current indicator value...",
768
822
  direction: "outbound"
769
823
  });
770
- await api.get(indicatorId);
824
+ await api.get();
825
+ } else {
826
+ const supportedIndicatorIds = this.getValue(ctx, IndicatorCCValues.supportedIndicatorIds) ?? [];
827
+ for (const indicatorId of supportedIndicatorIds) {
828
+ ctx.logNode(node.id, {
829
+ endpoint: this.endpointIndex,
830
+ message: `requesting current indicator value (id = ${(0, import_safe3.num2hex)(indicatorId)})...`,
831
+ direction: "outbound"
832
+ });
833
+ await api.get(indicatorId);
834
+ }
771
835
  }
772
836
  }
773
- }
774
- translatePropertyKey(ctx, property, propertyKey) {
775
- if (property === "value") {
776
- return void 0;
777
- } else if (typeof property === "number" && typeof propertyKey === "number") {
778
- const prop = (0, import_safe.getIndicatorProperty)(propertyKey);
779
- if (prop)
780
- return prop.label;
781
- }
782
- return super.translatePropertyKey(ctx, property, propertyKey);
783
- }
784
- translateProperty(ctx, property, propertyKey) {
785
- if (typeof property === "number" && typeof propertyKey === "number") {
786
- if (property in import_safe.Indicator)
787
- return import_safe.Indicator[property];
837
+ translatePropertyKey(ctx, property, propertyKey) {
838
+ if (property === "value") {
839
+ return void 0;
840
+ } else if (typeof property === "number" && typeof propertyKey === "number") {
841
+ const prop = (0, import_safe.getIndicatorProperty)(propertyKey);
842
+ if (prop)
843
+ return prop.label;
844
+ }
845
+ return super.translatePropertyKey(ctx, property, propertyKey);
788
846
  }
789
- return super.translateProperty(ctx, property, propertyKey);
790
- }
791
- supportsV2Indicators(ctx) {
792
- const supportedIndicatorIds = this.getValue(ctx, IndicatorCCValues.supportedIndicatorIds);
793
- if (!supportedIndicatorIds?.length)
794
- return false;
795
- return supportedIndicatorIds.some((indicatorId) => !!this.getValue(ctx, IndicatorCCValues.supportedPropertyIDs(indicatorId))?.length);
796
- }
797
- static getSupportedPropertyIDsCached(ctx, endpoint, indicatorId) {
798
- return ctx.getValueDB(endpoint.nodeId).getValue(IndicatorCCValues.supportedPropertyIDs(indicatorId).endpoint(endpoint.index));
799
- }
800
- };
801
- IndicatorCC = __decorate([
802
- (0, import_CommandClassDecorators.commandClass)(import_safe.CommandClasses.Indicator),
803
- (0, import_CommandClassDecorators.implementedVersion)(4),
804
- (0, import_CommandClassDecorators.ccValues)(IndicatorCCValues)
805
- ], IndicatorCC);
806
- let IndicatorCCSet = IndicatorCCSet_1 = class IndicatorCCSet2 extends IndicatorCC {
807
- constructor(options) {
808
- super(options);
809
- if ("value" in options) {
810
- this.indicator0Value = options.value;
811
- } else {
812
- this.values = options.values;
847
+ translateProperty(ctx, property, propertyKey) {
848
+ if (typeof property === "number" && typeof propertyKey === "number") {
849
+ if (property in import_safe.Indicator)
850
+ return import_safe.Indicator[property];
851
+ }
852
+ return super.translateProperty(ctx, property, propertyKey);
813
853
  }
814
- }
815
- static from(raw, ctx) {
816
- (0, import_safe.validatePayload)(raw.payload.length >= 1);
817
- const objCount = raw.payload.length >= 2 ? raw.payload[1] & 31 : 0;
818
- if (objCount === 0) {
819
- const indicator0Value = raw.payload[0];
820
- return new IndicatorCCSet_1({
821
- nodeId: ctx.sourceNodeId,
822
- value: indicator0Value
823
- });
854
+ supportsV2Indicators(ctx) {
855
+ const supportedIndicatorIds = this.getValue(ctx, IndicatorCCValues.supportedIndicatorIds);
856
+ if (!supportedIndicatorIds?.length)
857
+ return false;
858
+ return supportedIndicatorIds.some((indicatorId) => !!this.getValue(ctx, IndicatorCCValues.supportedPropertyIDs(indicatorId))?.length);
824
859
  }
825
- (0, import_safe.validatePayload)(raw.payload.length >= 2 + 3 * objCount);
826
- const values = [];
827
- for (let i = 0; i < objCount; i++) {
828
- const offset = 2 + 3 * i;
829
- const value = {
830
- indicatorId: raw.payload[offset],
831
- propertyId: raw.payload[offset + 1],
832
- value: raw.payload[offset + 2]
833
- };
834
- values.push(value);
860
+ static getSupportedPropertyIDsCached(ctx, endpoint, indicatorId) {
861
+ return ctx.getValueDB(endpoint.nodeId).getValue(IndicatorCCValues.supportedPropertyIDs(indicatorId).endpoint(endpoint.index));
835
862
  }
836
- return new IndicatorCCSet_1({
837
- nodeId: ctx.sourceNodeId,
838
- values
839
- });
840
- }
841
- indicator0Value;
842
- values;
843
- serialize(ctx) {
844
- if (this.values != void 0) {
845
- this.payload = import_safe2.Bytes.alloc(2 + 3 * this.values.length, 0);
846
- const objCount = this.values.length & MAX_INDICATOR_OBJECTS;
847
- this.payload[1] = objCount;
863
+ };
864
+ return IndicatorCC2 = _classThis;
865
+ })();
866
+ let IndicatorCCSet = (() => {
867
+ let _classDecorators = [(0, import_CommandClassDecorators.CCCommand)(import_Types.IndicatorCommand.Set), (0, import_CommandClassDecorators.useSupervision)()];
868
+ let _classDescriptor;
869
+ let _classExtraInitializers = [];
870
+ let _classThis;
871
+ let _classSuper = IndicatorCC;
872
+ var IndicatorCCSet2 = class extends _classSuper {
873
+ static {
874
+ _classThis = this;
875
+ }
876
+ static {
877
+ const _metadata = typeof Symbol === "function" && Symbol.metadata ? Object.create(_classSuper[Symbol.metadata] ?? null) : void 0;
878
+ __esDecorate(null, _classDescriptor = { value: _classThis }, _classDecorators, { kind: "class", name: _classThis.name, metadata: _metadata }, null, _classExtraInitializers);
879
+ IndicatorCCSet2 = _classThis = _classDescriptor.value;
880
+ if (_metadata) Object.defineProperty(_classThis, Symbol.metadata, { enumerable: true, configurable: true, writable: true, value: _metadata });
881
+ __runInitializers(_classThis, _classExtraInitializers);
882
+ }
883
+ constructor(options) {
884
+ super(options);
885
+ if ("value" in options) {
886
+ this.indicator0Value = options.value;
887
+ } else {
888
+ this.values = options.values;
889
+ }
890
+ }
891
+ static from(raw, ctx) {
892
+ (0, import_safe.validatePayload)(raw.payload.length >= 1);
893
+ const objCount = raw.payload.length >= 2 ? raw.payload[1] & 31 : 0;
894
+ if (objCount === 0) {
895
+ const indicator0Value = raw.payload[0];
896
+ return new this({
897
+ nodeId: ctx.sourceNodeId,
898
+ value: indicator0Value
899
+ });
900
+ }
901
+ (0, import_safe.validatePayload)(raw.payload.length >= 2 + 3 * objCount);
902
+ const values = [];
848
903
  for (let i = 0; i < objCount; i++) {
849
904
  const offset = 2 + 3 * i;
850
- this.payload[offset] = this.values[i].indicatorId;
851
- this.payload[offset + 1] = this.values[i].propertyId;
852
- const value = this.values[i].value;
853
- this.payload[offset + 2] = value === true ? 255 : value === false ? 0 : value;
905
+ const value = {
906
+ indicatorId: raw.payload[offset],
907
+ propertyId: raw.payload[offset + 1],
908
+ value: raw.payload[offset + 2]
909
+ };
910
+ values.push(value);
854
911
  }
855
- } else {
856
- this.payload = import_safe2.Bytes.from([this.indicator0Value ?? 0]);
912
+ return new this({
913
+ nodeId: ctx.sourceNodeId,
914
+ values
915
+ });
857
916
  }
858
- return super.serialize(ctx);
859
- }
860
- toLogEntry(ctx) {
861
- const message = {};
862
- if (this.indicator0Value != void 0) {
863
- message["indicator 0 value"] = this.indicator0Value;
917
+ indicator0Value;
918
+ values;
919
+ serialize(ctx) {
920
+ if (this.values != void 0) {
921
+ this.payload = import_safe2.Bytes.alloc(2 + 3 * this.values.length, 0);
922
+ const objCount = this.values.length & MAX_INDICATOR_OBJECTS;
923
+ this.payload[1] = objCount;
924
+ for (let i = 0; i < objCount; i++) {
925
+ const offset = 2 + 3 * i;
926
+ this.payload[offset] = this.values[i].indicatorId;
927
+ this.payload[offset + 1] = this.values[i].propertyId;
928
+ const value = this.values[i].value;
929
+ this.payload[offset + 2] = value === true ? 255 : value === false ? 0 : value;
930
+ }
931
+ } else {
932
+ this.payload = import_safe2.Bytes.from([this.indicator0Value ?? 0]);
933
+ }
934
+ return super.serialize(ctx);
864
935
  }
865
- if (this.values != void 0) {
866
- message.values = `${this.values.map((v) => `
936
+ toLogEntry(ctx) {
937
+ const message = {};
938
+ if (this.indicator0Value != void 0) {
939
+ message["indicator 0 value"] = this.indicator0Value;
940
+ }
941
+ if (this.values != void 0) {
942
+ message.values = `${this.values.map((v) => `
867
943
  \xB7 indicatorId: ${v.indicatorId}
868
944
  propertyId: ${v.propertyId}
869
945
  value: ${v.value}`).join("")}`;
870
- }
871
- return {
872
- ...super.toLogEntry(ctx),
873
- message
874
- };
875
- }
876
- };
877
- IndicatorCCSet = IndicatorCCSet_1 = __decorate([
878
- (0, import_CommandClassDecorators.CCCommand)(import_Types.IndicatorCommand.Set),
879
- (0, import_CommandClassDecorators.useSupervision)()
880
- ], IndicatorCCSet);
881
- let IndicatorCCReport = IndicatorCCReport_1 = class IndicatorCCReport2 extends IndicatorCC {
882
- constructor(options) {
883
- super(options);
884
- if ("value" in options) {
885
- this.indicator0Value = options.value;
886
- } else if ("values" in options) {
887
- if (options.values.length > MAX_INDICATOR_OBJECTS) {
888
- throw new import_safe.ZWaveError(`Only ${MAX_INDICATOR_OBJECTS} indicator values can be set at a time!`, import_safe.ZWaveErrorCodes.Argument_Invalid);
889
946
  }
890
- this.values = options.values;
947
+ return {
948
+ ...super.toLogEntry(ctx),
949
+ message
950
+ };
891
951
  }
892
- }
893
- static from(raw, ctx) {
894
- (0, import_safe.validatePayload)(raw.payload.length >= 1);
895
- const objCount = raw.payload.length >= 2 ? raw.payload[1] & 31 : 0;
896
- if (objCount === 0) {
897
- const indicator0Value = raw.payload[0];
898
- return new IndicatorCCReport_1({
899
- nodeId: ctx.sourceNodeId,
900
- value: indicator0Value
901
- });
952
+ };
953
+ return IndicatorCCSet2 = _classThis;
954
+ })();
955
+ let IndicatorCCReport = (() => {
956
+ let _classDecorators = [(0, import_CommandClassDecorators.CCCommand)(import_Types.IndicatorCommand.Report)];
957
+ let _classDescriptor;
958
+ let _classExtraInitializers = [];
959
+ let _classThis;
960
+ let _classSuper = IndicatorCC;
961
+ var IndicatorCCReport2 = class extends _classSuper {
962
+ static {
963
+ _classThis = this;
902
964
  }
903
- (0, import_safe.validatePayload)(raw.payload.length >= 2 + 3 * objCount);
904
- const values = [];
905
- for (let i = 0; i < objCount; i++) {
906
- const offset = 2 + 3 * i;
907
- const value = {
908
- indicatorId: raw.payload[offset],
909
- propertyId: raw.payload[offset + 1],
910
- value: raw.payload[offset + 2]
911
- };
912
- values.push(value);
965
+ static {
966
+ const _metadata = typeof Symbol === "function" && Symbol.metadata ? Object.create(_classSuper[Symbol.metadata] ?? null) : void 0;
967
+ __esDecorate(null, _classDescriptor = { value: _classThis }, _classDecorators, { kind: "class", name: _classThis.name, metadata: _metadata }, null, _classExtraInitializers);
968
+ IndicatorCCReport2 = _classThis = _classDescriptor.value;
969
+ if (_metadata) Object.defineProperty(_classThis, Symbol.metadata, { enumerable: true, configurable: true, writable: true, value: _metadata });
970
+ __runInitializers(_classThis, _classExtraInitializers);
913
971
  }
914
- return new IndicatorCCReport_1({
915
- nodeId: ctx.sourceNodeId,
916
- values
917
- });
918
- }
919
- persistValues(ctx) {
920
- if (!super.persistValues(ctx))
921
- return false;
922
- if (this.indicator0Value != void 0) {
923
- if (!this.supportsV2Indicators(ctx)) {
924
- const valueV1 = IndicatorCCValues.valueV1;
925
- this.setMetadata(ctx, valueV1);
926
- this.setValue(ctx, valueV1, this.indicator0Value);
927
- } else {
928
- if (this.isSinglecast()) {
929
- ctx.logNode(this.nodeId, {
930
- message: `ignoring V1 indicator report because the node supports V2 indicators`,
931
- direction: "none",
932
- endpoint: this.endpointIndex
933
- });
972
+ constructor(options) {
973
+ super(options);
974
+ if ("value" in options) {
975
+ this.indicator0Value = options.value;
976
+ } else if ("values" in options) {
977
+ if (options.values.length > MAX_INDICATOR_OBJECTS) {
978
+ throw new import_safe.ZWaveError(`Only ${MAX_INDICATOR_OBJECTS} indicator values can be set at a time!`, import_safe.ZWaveErrorCodes.Argument_Invalid);
934
979
  }
935
- }
936
- } else if (this.values) {
937
- for (const value of this.values) {
938
- this.setIndicatorValue(ctx, value);
939
- }
940
- const timeout = indicatorObjectsToTimeout(this.values);
941
- if (timeout) {
942
- let timeoutString = "";
943
- if (timeout?.hours)
944
- timeoutString += `${timeout.hours}h`;
945
- if (timeout?.minutes)
946
- timeoutString += `${timeout.minutes}m`;
947
- if (timeout?.seconds)
948
- timeoutString += `${timeout.seconds}s`;
949
- this.setValue(ctx, IndicatorCCValues.timeout, timeoutString);
980
+ this.values = options.values;
950
981
  }
951
982
  }
952
- return true;
953
- }
954
- indicator0Value;
955
- values;
956
- setIndicatorValue(ctx, value) {
957
- const overrideIndicatorLabel = isManufacturerDefinedIndicator(value.indicatorId) ? this.getValue(ctx, IndicatorCCValues.indicatorDescription(value.indicatorId)) : void 0;
958
- const metadata = getIndicatorMetadata(value.indicatorId, value.propertyId, overrideIndicatorLabel);
959
- if (metadata.type === "boolean") {
960
- value.value = !!value.value;
961
- }
962
- const valueV2 = IndicatorCCValues.valueV2(value.indicatorId, value.propertyId);
963
- this.setMetadata(ctx, valueV2, metadata);
964
- this.setValue(ctx, valueV2, value.value);
965
- }
966
- serialize(ctx) {
967
- if (this.values != void 0) {
968
- this.payload = import_safe2.Bytes.alloc(2 + 3 * this.values.length, 0);
969
- const objCount = this.values.length & MAX_INDICATOR_OBJECTS;
970
- this.payload[1] = objCount;
983
+ static from(raw, ctx) {
984
+ (0, import_safe.validatePayload)(raw.payload.length >= 1);
985
+ const objCount = raw.payload.length >= 2 ? raw.payload[1] & 31 : 0;
986
+ if (objCount === 0) {
987
+ const indicator0Value = raw.payload[0];
988
+ return new this({
989
+ nodeId: ctx.sourceNodeId,
990
+ value: indicator0Value
991
+ });
992
+ }
993
+ (0, import_safe.validatePayload)(raw.payload.length >= 2 + 3 * objCount);
994
+ const values = [];
971
995
  for (let i = 0; i < objCount; i++) {
972
996
  const offset = 2 + 3 * i;
973
- this.payload[offset] = this.values[i].indicatorId;
974
- this.payload[offset + 1] = this.values[i].propertyId;
975
- const value = this.values[i].value;
976
- this.payload[offset + 2] = value === true ? 255 : value === false ? 0 : value;
997
+ const value = {
998
+ indicatorId: raw.payload[offset],
999
+ propertyId: raw.payload[offset + 1],
1000
+ value: raw.payload[offset + 2]
1001
+ };
1002
+ values.push(value);
977
1003
  }
978
- } else {
979
- this.payload = import_safe2.Bytes.from([this.indicator0Value ?? 0]);
1004
+ return new this({
1005
+ nodeId: ctx.sourceNodeId,
1006
+ values
1007
+ });
980
1008
  }
981
- return super.serialize(ctx);
982
- }
983
- toLogEntry(ctx) {
984
- const message = {};
985
- if (this.indicator0Value != void 0) {
986
- message["indicator 0 value"] = this.indicator0Value;
1009
+ persistValues(ctx) {
1010
+ if (!super.persistValues(ctx))
1011
+ return false;
1012
+ if (this.indicator0Value != void 0) {
1013
+ if (!this.supportsV2Indicators(ctx)) {
1014
+ const valueV1 = IndicatorCCValues.valueV1;
1015
+ this.setMetadata(ctx, valueV1);
1016
+ this.setValue(ctx, valueV1, this.indicator0Value);
1017
+ } else {
1018
+ if (this.isSinglecast()) {
1019
+ ctx.logNode(this.nodeId, {
1020
+ message: `ignoring V1 indicator report because the node supports V2 indicators`,
1021
+ direction: "none",
1022
+ endpoint: this.endpointIndex
1023
+ });
1024
+ }
1025
+ }
1026
+ } else if (this.values) {
1027
+ for (const value of this.values) {
1028
+ this.setIndicatorValue(ctx, value);
1029
+ }
1030
+ const timeout = indicatorObjectsToTimeout(this.values);
1031
+ if (timeout) {
1032
+ let timeoutString = "";
1033
+ if (timeout?.hours)
1034
+ timeoutString += `${timeout.hours}h`;
1035
+ if (timeout?.minutes)
1036
+ timeoutString += `${timeout.minutes}m`;
1037
+ if (timeout?.seconds)
1038
+ timeoutString += `${timeout.seconds}s`;
1039
+ this.setValue(ctx, IndicatorCCValues.timeout, timeoutString);
1040
+ }
1041
+ }
1042
+ return true;
1043
+ }
1044
+ indicator0Value;
1045
+ values;
1046
+ setIndicatorValue(ctx, value) {
1047
+ const overrideIndicatorLabel = isManufacturerDefinedIndicator(value.indicatorId) ? this.getValue(ctx, IndicatorCCValues.indicatorDescription(value.indicatorId)) : void 0;
1048
+ const metadata = getIndicatorMetadata(value.indicatorId, value.propertyId, overrideIndicatorLabel);
1049
+ if (metadata.type === "boolean") {
1050
+ value.value = !!value.value;
1051
+ }
1052
+ const valueV2 = IndicatorCCValues.valueV2(value.indicatorId, value.propertyId);
1053
+ this.setMetadata(ctx, valueV2, metadata);
1054
+ this.setValue(ctx, valueV2, value.value);
1055
+ }
1056
+ serialize(ctx) {
1057
+ if (this.values != void 0) {
1058
+ this.payload = import_safe2.Bytes.alloc(2 + 3 * this.values.length, 0);
1059
+ const objCount = this.values.length & MAX_INDICATOR_OBJECTS;
1060
+ this.payload[1] = objCount;
1061
+ for (let i = 0; i < objCount; i++) {
1062
+ const offset = 2 + 3 * i;
1063
+ this.payload[offset] = this.values[i].indicatorId;
1064
+ this.payload[offset + 1] = this.values[i].propertyId;
1065
+ const value = this.values[i].value;
1066
+ this.payload[offset + 2] = value === true ? 255 : value === false ? 0 : value;
1067
+ }
1068
+ } else {
1069
+ this.payload = import_safe2.Bytes.from([this.indicator0Value ?? 0]);
1070
+ }
1071
+ return super.serialize(ctx);
987
1072
  }
988
- if (this.values != void 0) {
989
- message.values = `${this.values.map((v) => `
1073
+ toLogEntry(ctx) {
1074
+ const message = {};
1075
+ if (this.indicator0Value != void 0) {
1076
+ message["indicator 0 value"] = this.indicator0Value;
1077
+ }
1078
+ if (this.values != void 0) {
1079
+ message.values = `${this.values.map((v) => `
990
1080
  \xB7 indicatorId: ${v.indicatorId}
991
1081
  propertyId: ${v.propertyId}
992
1082
  value: ${v.value}`).join("")}`;
1083
+ }
1084
+ return {
1085
+ ...super.toLogEntry(ctx),
1086
+ message
1087
+ };
993
1088
  }
994
- return {
995
- ...super.toLogEntry(ctx),
996
- message
997
- };
998
- }
999
- };
1000
- IndicatorCCReport = IndicatorCCReport_1 = __decorate([
1001
- (0, import_CommandClassDecorators.CCCommand)(import_Types.IndicatorCommand.Report)
1002
- ], IndicatorCCReport);
1003
- let IndicatorCCGet = IndicatorCCGet_1 = class IndicatorCCGet2 extends IndicatorCC {
1004
- constructor(options) {
1005
- super(options);
1006
- this.indicatorId = options.indicatorId;
1007
- }
1008
- static from(raw, ctx) {
1009
- let indicatorId;
1010
- if (raw.payload.length > 0) {
1011
- indicatorId = raw.payload[0];
1012
- }
1013
- return new IndicatorCCGet_1({
1014
- nodeId: ctx.sourceNodeId,
1015
- indicatorId
1016
- });
1017
- }
1018
- indicatorId;
1019
- serialize(ctx) {
1020
- if (this.indicatorId != void 0) {
1021
- this.payload = import_safe2.Bytes.from([this.indicatorId]);
1089
+ };
1090
+ return IndicatorCCReport2 = _classThis;
1091
+ })();
1092
+ let IndicatorCCGet = (() => {
1093
+ let _classDecorators = [(0, import_CommandClassDecorators.CCCommand)(import_Types.IndicatorCommand.Get), (0, import_CommandClassDecorators.expectedCCResponse)(IndicatorCCReport)];
1094
+ let _classDescriptor;
1095
+ let _classExtraInitializers = [];
1096
+ let _classThis;
1097
+ let _classSuper = IndicatorCC;
1098
+ var IndicatorCCGet2 = class extends _classSuper {
1099
+ static {
1100
+ _classThis = this;
1022
1101
  }
1023
- return super.serialize(ctx);
1024
- }
1025
- toLogEntry(ctx) {
1026
- return {
1027
- ...super.toLogEntry(ctx),
1028
- message: {
1029
- indicator: getIndicatorName(this.indicatorId)
1102
+ static {
1103
+ const _metadata = typeof Symbol === "function" && Symbol.metadata ? Object.create(_classSuper[Symbol.metadata] ?? null) : void 0;
1104
+ __esDecorate(null, _classDescriptor = { value: _classThis }, _classDecorators, { kind: "class", name: _classThis.name, metadata: _metadata }, null, _classExtraInitializers);
1105
+ IndicatorCCGet2 = _classThis = _classDescriptor.value;
1106
+ if (_metadata) Object.defineProperty(_classThis, Symbol.metadata, { enumerable: true, configurable: true, writable: true, value: _metadata });
1107
+ __runInitializers(_classThis, _classExtraInitializers);
1108
+ }
1109
+ constructor(options) {
1110
+ super(options);
1111
+ this.indicatorId = options.indicatorId;
1112
+ }
1113
+ static from(raw, ctx) {
1114
+ let indicatorId;
1115
+ if (raw.payload.length > 0) {
1116
+ indicatorId = raw.payload[0];
1030
1117
  }
1031
- };
1032
- }
1033
- };
1034
- IndicatorCCGet = IndicatorCCGet_1 = __decorate([
1035
- (0, import_CommandClassDecorators.CCCommand)(import_Types.IndicatorCommand.Get),
1036
- (0, import_CommandClassDecorators.expectedCCResponse)(IndicatorCCReport)
1037
- ], IndicatorCCGet);
1038
- let IndicatorCCSupportedReport = IndicatorCCSupportedReport_1 = class IndicatorCCSupportedReport2 extends IndicatorCC {
1039
- constructor(options) {
1040
- super(options);
1041
- this.indicatorId = options.indicatorId;
1042
- this.nextIndicatorId = options.nextIndicatorId;
1043
- this.supportedProperties = options.supportedProperties;
1044
- }
1045
- static from(raw, ctx) {
1046
- (0, import_safe.validatePayload)(raw.payload.length >= 3);
1047
- const indicatorId = raw.payload[0];
1048
- const nextIndicatorId = raw.payload[1];
1049
- const bitMaskLength = raw.payload[2] & 31;
1050
- let supportedProperties;
1051
- if (bitMaskLength === 0) {
1052
- supportedProperties = [];
1053
- } else {
1054
- (0, import_safe.validatePayload)(raw.payload.length >= 3 + bitMaskLength);
1055
- supportedProperties = (0, import_safe.parseBitMask)(raw.payload.subarray(3, 3 + bitMaskLength), 0).filter((v) => v !== 0);
1056
- }
1057
- return new IndicatorCCSupportedReport_1({
1058
- nodeId: ctx.sourceNodeId,
1059
- indicatorId,
1060
- nextIndicatorId,
1061
- supportedProperties
1062
- });
1063
- }
1064
- persistValues(ctx) {
1065
- if (!super.persistValues(ctx))
1066
- return false;
1067
- if (this.indicatorId !== 0) {
1068
- this.setValue(ctx, IndicatorCCValues.supportedPropertyIDs(this.indicatorId), this.supportedProperties);
1118
+ return new this({
1119
+ nodeId: ctx.sourceNodeId,
1120
+ indicatorId
1121
+ });
1069
1122
  }
1070
- return true;
1071
- }
1072
- indicatorId;
1073
- nextIndicatorId;
1074
- supportedProperties;
1075
- serialize(ctx) {
1076
- const bitmask = this.supportedProperties.length > 0 ? (0, import_safe.encodeBitMask)(this.supportedProperties, void 0, 0) : new import_safe2.Bytes();
1077
- this.payload = import_safe2.Bytes.concat([
1078
- import_safe2.Bytes.from([
1079
- this.indicatorId,
1080
- this.nextIndicatorId,
1081
- bitmask.length
1082
- ]),
1083
- bitmask
1084
- ]);
1085
- return super.serialize(ctx);
1086
- }
1087
- toLogEntry(ctx) {
1088
- return {
1089
- ...super.toLogEntry(ctx),
1090
- message: {
1091
- indicator: getIndicatorName(this.indicatorId),
1092
- "supported properties": `${this.supportedProperties.map((id) => (0, import_safe.getIndicatorProperty)(id)?.label ?? `Unknown (${(0, import_safe3.num2hex)(id)})`).join(", ")}`,
1093
- "next indicator": getIndicatorName(this.nextIndicatorId)
1123
+ indicatorId;
1124
+ serialize(ctx) {
1125
+ if (this.indicatorId != void 0) {
1126
+ this.payload = import_safe2.Bytes.from([this.indicatorId]);
1094
1127
  }
1095
- };
1096
- }
1097
- };
1098
- IndicatorCCSupportedReport = IndicatorCCSupportedReport_1 = __decorate([
1099
- (0, import_CommandClassDecorators.CCCommand)(import_Types.IndicatorCommand.SupportedReport)
1100
- ], IndicatorCCSupportedReport);
1128
+ return super.serialize(ctx);
1129
+ }
1130
+ toLogEntry(ctx) {
1131
+ return {
1132
+ ...super.toLogEntry(ctx),
1133
+ message: {
1134
+ indicator: getIndicatorName(this.indicatorId)
1135
+ }
1136
+ };
1137
+ }
1138
+ };
1139
+ return IndicatorCCGet2 = _classThis;
1140
+ })();
1141
+ let IndicatorCCSupportedReport = (() => {
1142
+ let _classDecorators = [(0, import_CommandClassDecorators.CCCommand)(import_Types.IndicatorCommand.SupportedReport)];
1143
+ let _classDescriptor;
1144
+ let _classExtraInitializers = [];
1145
+ let _classThis;
1146
+ let _classSuper = IndicatorCC;
1147
+ var IndicatorCCSupportedReport2 = class extends _classSuper {
1148
+ static {
1149
+ _classThis = this;
1150
+ }
1151
+ static {
1152
+ const _metadata = typeof Symbol === "function" && Symbol.metadata ? Object.create(_classSuper[Symbol.metadata] ?? null) : void 0;
1153
+ __esDecorate(null, _classDescriptor = { value: _classThis }, _classDecorators, { kind: "class", name: _classThis.name, metadata: _metadata }, null, _classExtraInitializers);
1154
+ IndicatorCCSupportedReport2 = _classThis = _classDescriptor.value;
1155
+ if (_metadata) Object.defineProperty(_classThis, Symbol.metadata, { enumerable: true, configurable: true, writable: true, value: _metadata });
1156
+ __runInitializers(_classThis, _classExtraInitializers);
1157
+ }
1158
+ constructor(options) {
1159
+ super(options);
1160
+ this.indicatorId = options.indicatorId;
1161
+ this.nextIndicatorId = options.nextIndicatorId;
1162
+ this.supportedProperties = options.supportedProperties;
1163
+ }
1164
+ static from(raw, ctx) {
1165
+ (0, import_safe.validatePayload)(raw.payload.length >= 3);
1166
+ const indicatorId = raw.payload[0];
1167
+ const nextIndicatorId = raw.payload[1];
1168
+ const bitMaskLength = raw.payload[2] & 31;
1169
+ let supportedProperties;
1170
+ if (bitMaskLength === 0) {
1171
+ supportedProperties = [];
1172
+ } else {
1173
+ (0, import_safe.validatePayload)(raw.payload.length >= 3 + bitMaskLength);
1174
+ supportedProperties = (0, import_safe.parseBitMask)(raw.payload.subarray(3, 3 + bitMaskLength), 0).filter((v) => v !== 0);
1175
+ }
1176
+ return new this({
1177
+ nodeId: ctx.sourceNodeId,
1178
+ indicatorId,
1179
+ nextIndicatorId,
1180
+ supportedProperties
1181
+ });
1182
+ }
1183
+ persistValues(ctx) {
1184
+ if (!super.persistValues(ctx))
1185
+ return false;
1186
+ if (this.indicatorId !== 0) {
1187
+ this.setValue(ctx, IndicatorCCValues.supportedPropertyIDs(this.indicatorId), this.supportedProperties);
1188
+ }
1189
+ return true;
1190
+ }
1191
+ indicatorId;
1192
+ nextIndicatorId;
1193
+ supportedProperties;
1194
+ serialize(ctx) {
1195
+ const bitmask = this.supportedProperties.length > 0 ? (0, import_safe.encodeBitMask)(this.supportedProperties, void 0, 0) : new import_safe2.Bytes();
1196
+ this.payload = import_safe2.Bytes.concat([
1197
+ import_safe2.Bytes.from([
1198
+ this.indicatorId,
1199
+ this.nextIndicatorId,
1200
+ bitmask.length
1201
+ ]),
1202
+ bitmask
1203
+ ]);
1204
+ return super.serialize(ctx);
1205
+ }
1206
+ toLogEntry(ctx) {
1207
+ return {
1208
+ ...super.toLogEntry(ctx),
1209
+ message: {
1210
+ indicator: getIndicatorName(this.indicatorId),
1211
+ "supported properties": `${this.supportedProperties.map((id) => (0, import_safe.getIndicatorProperty)(id)?.label ?? `Unknown (${(0, import_safe3.num2hex)(id)})`).join(", ")}`,
1212
+ "next indicator": getIndicatorName(this.nextIndicatorId)
1213
+ }
1214
+ };
1215
+ }
1216
+ };
1217
+ return IndicatorCCSupportedReport2 = _classThis;
1218
+ })();
1101
1219
  function testResponseForIndicatorSupportedGet(sent, received) {
1102
1220
  return sent.indicatorId === 0 || received.indicatorId === sent.indicatorId;
1103
1221
  }
1104
- let IndicatorCCSupportedGet = IndicatorCCSupportedGet_1 = class IndicatorCCSupportedGet2 extends IndicatorCC {
1105
- constructor(options) {
1106
- super(options);
1107
- this.indicatorId = options.indicatorId;
1108
- }
1109
- static from(raw, ctx) {
1110
- (0, import_safe.validatePayload)(raw.payload.length >= 1);
1111
- const indicatorId = raw.payload[0];
1112
- return new IndicatorCCSupportedGet_1({
1113
- nodeId: ctx.sourceNodeId,
1114
- indicatorId
1115
- });
1116
- }
1117
- indicatorId;
1118
- serialize(ctx) {
1119
- this.payload = import_safe2.Bytes.from([this.indicatorId]);
1120
- return super.serialize(ctx);
1121
- }
1122
- toLogEntry(ctx) {
1123
- return {
1124
- ...super.toLogEntry(ctx),
1125
- message: {
1126
- indicator: getIndicatorName(this.indicatorId)
1127
- }
1128
- };
1129
- }
1130
- };
1131
- IndicatorCCSupportedGet = IndicatorCCSupportedGet_1 = __decorate([
1132
- (0, import_CommandClassDecorators.CCCommand)(import_Types.IndicatorCommand.SupportedGet),
1133
- (0, import_CommandClassDecorators.expectedCCResponse)(IndicatorCCSupportedReport, testResponseForIndicatorSupportedGet)
1134
- ], IndicatorCCSupportedGet);
1135
- let IndicatorCCDescriptionReport = IndicatorCCDescriptionReport_1 = class IndicatorCCDescriptionReport2 extends IndicatorCC {
1136
- constructor(options) {
1137
- super(options);
1138
- this.indicatorId = options.indicatorId;
1139
- this.description = options.description;
1140
- }
1141
- static from(raw, ctx) {
1142
- (0, import_safe.validatePayload)(raw.payload.length >= 2);
1143
- const indicatorId = raw.payload[0];
1144
- const descrptionLength = raw.payload[1];
1145
- (0, import_safe.validatePayload)(raw.payload.length >= 2 + descrptionLength);
1146
- const description = raw.payload.subarray(2, 2 + descrptionLength).toString("utf8");
1147
- return new IndicatorCCDescriptionReport_1({
1148
- nodeId: ctx.sourceNodeId,
1149
- indicatorId,
1150
- description
1151
- });
1152
- }
1153
- indicatorId;
1154
- description;
1155
- persistValues(ctx) {
1156
- if (!super.persistValues(ctx))
1157
- return false;
1158
- if (this.description) {
1159
- this.setValue(ctx, IndicatorCCValues.indicatorDescription(this.indicatorId), this.description);
1160
- }
1161
- return true;
1162
- }
1163
- serialize(ctx) {
1164
- const description = import_safe2.Bytes.from(this.description, "utf8");
1165
- this.payload = import_safe2.Bytes.concat([
1166
- import_safe2.Bytes.from([this.indicatorId, description.length]),
1167
- description
1168
- ]);
1169
- return super.serialize(ctx);
1170
- }
1171
- toLogEntry(ctx) {
1172
- return {
1173
- ...super.toLogEntry(ctx),
1174
- message: {
1175
- "indicator ID": this.indicatorId,
1176
- description: this.description || "(none)"
1222
+ let IndicatorCCSupportedGet = (() => {
1223
+ let _classDecorators = [(0, import_CommandClassDecorators.CCCommand)(import_Types.IndicatorCommand.SupportedGet), (0, import_CommandClassDecorators.expectedCCResponse)(IndicatorCCSupportedReport, testResponseForIndicatorSupportedGet)];
1224
+ let _classDescriptor;
1225
+ let _classExtraInitializers = [];
1226
+ let _classThis;
1227
+ let _classSuper = IndicatorCC;
1228
+ var IndicatorCCSupportedGet2 = class extends _classSuper {
1229
+ static {
1230
+ _classThis = this;
1231
+ }
1232
+ static {
1233
+ const _metadata = typeof Symbol === "function" && Symbol.metadata ? Object.create(_classSuper[Symbol.metadata] ?? null) : void 0;
1234
+ __esDecorate(null, _classDescriptor = { value: _classThis }, _classDecorators, { kind: "class", name: _classThis.name, metadata: _metadata }, null, _classExtraInitializers);
1235
+ IndicatorCCSupportedGet2 = _classThis = _classDescriptor.value;
1236
+ if (_metadata) Object.defineProperty(_classThis, Symbol.metadata, { enumerable: true, configurable: true, writable: true, value: _metadata });
1237
+ __runInitializers(_classThis, _classExtraInitializers);
1238
+ }
1239
+ constructor(options) {
1240
+ super(options);
1241
+ this.indicatorId = options.indicatorId;
1242
+ }
1243
+ static from(raw, ctx) {
1244
+ (0, import_safe.validatePayload)(raw.payload.length >= 1);
1245
+ const indicatorId = raw.payload[0];
1246
+ return new this({
1247
+ nodeId: ctx.sourceNodeId,
1248
+ indicatorId
1249
+ });
1250
+ }
1251
+ indicatorId;
1252
+ serialize(ctx) {
1253
+ this.payload = import_safe2.Bytes.from([this.indicatorId]);
1254
+ return super.serialize(ctx);
1255
+ }
1256
+ toLogEntry(ctx) {
1257
+ return {
1258
+ ...super.toLogEntry(ctx),
1259
+ message: {
1260
+ indicator: getIndicatorName(this.indicatorId)
1261
+ }
1262
+ };
1263
+ }
1264
+ };
1265
+ return IndicatorCCSupportedGet2 = _classThis;
1266
+ })();
1267
+ let IndicatorCCDescriptionReport = (() => {
1268
+ let _classDecorators = [(0, import_CommandClassDecorators.CCCommand)(import_Types.IndicatorCommand.DescriptionReport)];
1269
+ let _classDescriptor;
1270
+ let _classExtraInitializers = [];
1271
+ let _classThis;
1272
+ let _classSuper = IndicatorCC;
1273
+ var IndicatorCCDescriptionReport2 = class extends _classSuper {
1274
+ static {
1275
+ _classThis = this;
1276
+ }
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
+ IndicatorCCDescriptionReport2 = _classThis = _classDescriptor.value;
1281
+ if (_metadata) Object.defineProperty(_classThis, Symbol.metadata, { enumerable: true, configurable: true, writable: true, value: _metadata });
1282
+ __runInitializers(_classThis, _classExtraInitializers);
1283
+ }
1284
+ constructor(options) {
1285
+ super(options);
1286
+ this.indicatorId = options.indicatorId;
1287
+ this.description = options.description;
1288
+ }
1289
+ static from(raw, ctx) {
1290
+ (0, import_safe.validatePayload)(raw.payload.length >= 2);
1291
+ const indicatorId = raw.payload[0];
1292
+ const descrptionLength = raw.payload[1];
1293
+ (0, import_safe.validatePayload)(raw.payload.length >= 2 + descrptionLength);
1294
+ const description = raw.payload.subarray(2, 2 + descrptionLength).toString("utf8");
1295
+ return new this({
1296
+ nodeId: ctx.sourceNodeId,
1297
+ indicatorId,
1298
+ description
1299
+ });
1300
+ }
1301
+ indicatorId;
1302
+ description;
1303
+ persistValues(ctx) {
1304
+ if (!super.persistValues(ctx))
1305
+ return false;
1306
+ if (this.description) {
1307
+ this.setValue(ctx, IndicatorCCValues.indicatorDescription(this.indicatorId), this.description);
1177
1308
  }
1178
- };
1179
- }
1180
- };
1181
- IndicatorCCDescriptionReport = IndicatorCCDescriptionReport_1 = __decorate([
1182
- (0, import_CommandClassDecorators.CCCommand)(import_Types.IndicatorCommand.DescriptionReport)
1183
- ], IndicatorCCDescriptionReport);
1309
+ return true;
1310
+ }
1311
+ serialize(ctx) {
1312
+ const description = import_safe2.Bytes.from(this.description, "utf8");
1313
+ this.payload = import_safe2.Bytes.concat([
1314
+ import_safe2.Bytes.from([this.indicatorId, description.length]),
1315
+ description
1316
+ ]);
1317
+ return super.serialize(ctx);
1318
+ }
1319
+ toLogEntry(ctx) {
1320
+ return {
1321
+ ...super.toLogEntry(ctx),
1322
+ message: {
1323
+ "indicator ID": this.indicatorId,
1324
+ description: this.description || "(none)"
1325
+ }
1326
+ };
1327
+ }
1328
+ };
1329
+ return IndicatorCCDescriptionReport2 = _classThis;
1330
+ })();
1184
1331
  function testResponseForIndicatorDescriptionGet(sent, received) {
1185
1332
  return received.indicatorId === sent.indicatorId;
1186
1333
  }
1187
- let IndicatorCCDescriptionGet = IndicatorCCDescriptionGet_1 = class IndicatorCCDescriptionGet2 extends IndicatorCC {
1188
- constructor(options) {
1189
- super(options);
1190
- this.indicatorId = options.indicatorId;
1191
- if (!isManufacturerDefinedIndicator(this.indicatorId)) {
1192
- throw new import_safe.ZWaveError("The indicator ID must be between 0x80 and 0x9f", import_safe.ZWaveErrorCodes.Argument_Invalid);
1334
+ let IndicatorCCDescriptionGet = (() => {
1335
+ let _classDecorators = [(0, import_CommandClassDecorators.CCCommand)(import_Types.IndicatorCommand.DescriptionGet), (0, import_CommandClassDecorators.expectedCCResponse)(IndicatorCCDescriptionReport, testResponseForIndicatorDescriptionGet)];
1336
+ let _classDescriptor;
1337
+ let _classExtraInitializers = [];
1338
+ let _classThis;
1339
+ let _classSuper = IndicatorCC;
1340
+ var IndicatorCCDescriptionGet2 = class extends _classSuper {
1341
+ static {
1342
+ _classThis = this;
1193
1343
  }
1194
- }
1195
- static from(raw, ctx) {
1196
- (0, import_safe.validatePayload)(raw.payload.length >= 1);
1197
- const indicatorId = raw.payload[0];
1198
- return new IndicatorCCDescriptionGet_1({
1199
- nodeId: ctx.sourceNodeId,
1200
- indicatorId
1201
- });
1202
- }
1203
- indicatorId;
1204
- serialize(ctx) {
1205
- this.payload = import_safe2.Bytes.from([this.indicatorId]);
1206
- return super.serialize(ctx);
1207
- }
1208
- toLogEntry(ctx) {
1209
- return {
1210
- ...super.toLogEntry(ctx),
1211
- message: {
1212
- "indicator ID": this.indicatorId
1344
+ static {
1345
+ const _metadata = typeof Symbol === "function" && Symbol.metadata ? Object.create(_classSuper[Symbol.metadata] ?? null) : void 0;
1346
+ __esDecorate(null, _classDescriptor = { value: _classThis }, _classDecorators, { kind: "class", name: _classThis.name, metadata: _metadata }, null, _classExtraInitializers);
1347
+ IndicatorCCDescriptionGet2 = _classThis = _classDescriptor.value;
1348
+ if (_metadata) Object.defineProperty(_classThis, Symbol.metadata, { enumerable: true, configurable: true, writable: true, value: _metadata });
1349
+ __runInitializers(_classThis, _classExtraInitializers);
1350
+ }
1351
+ constructor(options) {
1352
+ super(options);
1353
+ this.indicatorId = options.indicatorId;
1354
+ if (!isManufacturerDefinedIndicator(this.indicatorId)) {
1355
+ throw new import_safe.ZWaveError("The indicator ID must be between 0x80 and 0x9f", import_safe.ZWaveErrorCodes.Argument_Invalid);
1213
1356
  }
1214
- };
1215
- }
1216
- };
1217
- IndicatorCCDescriptionGet = IndicatorCCDescriptionGet_1 = __decorate([
1218
- (0, import_CommandClassDecorators.CCCommand)(import_Types.IndicatorCommand.DescriptionGet),
1219
- (0, import_CommandClassDecorators.expectedCCResponse)(IndicatorCCDescriptionReport, testResponseForIndicatorDescriptionGet)
1220
- ], IndicatorCCDescriptionGet);
1357
+ }
1358
+ static from(raw, ctx) {
1359
+ (0, import_safe.validatePayload)(raw.payload.length >= 1);
1360
+ const indicatorId = raw.payload[0];
1361
+ return new this({
1362
+ nodeId: ctx.sourceNodeId,
1363
+ indicatorId
1364
+ });
1365
+ }
1366
+ indicatorId;
1367
+ serialize(ctx) {
1368
+ this.payload = import_safe2.Bytes.from([this.indicatorId]);
1369
+ return super.serialize(ctx);
1370
+ }
1371
+ toLogEntry(ctx) {
1372
+ return {
1373
+ ...super.toLogEntry(ctx),
1374
+ message: {
1375
+ "indicator ID": this.indicatorId
1376
+ }
1377
+ };
1378
+ }
1379
+ };
1380
+ return IndicatorCCDescriptionGet2 = _classThis;
1381
+ })();
1221
1382
  // Annotate the CommonJS export names for ESM import in node:
1222
1383
  0 && (module.exports = {
1223
1384
  IndicatorCC,