@zwave-js/cc 14.0.0-beta.4 → 14.0.0-beta.5

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
@@ -37,13 +37,45 @@ var import_CommandClassDecorators = require("../lib/CommandClassDecorators.js");
37
37
  var import_Values = require("../lib/Values.js");
38
38
  var import_Types = require("../lib/_Types.js");
39
39
  var import_NotificationCC = require("./NotificationCC.js");
40
- var __decorate = function(decorators, target, key, desc) {
41
- var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
42
- if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
43
- 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;
44
- return c > 3 && r && Object.defineProperty(target, key, r), r;
40
+ var __esDecorate = function(ctor, descriptorIn, decorators, contextIn, initializers, extraInitializers) {
41
+ function accept(f) {
42
+ if (f !== void 0 && typeof f !== "function") throw new TypeError("Function expected");
43
+ return f;
44
+ }
45
+ var kind = contextIn.kind, key = kind === "getter" ? "get" : kind === "setter" ? "set" : "value";
46
+ var target = !descriptorIn && ctor ? contextIn["static"] ? ctor : ctor.prototype : null;
47
+ var descriptor = descriptorIn || (target ? Object.getOwnPropertyDescriptor(target, contextIn.name) : {});
48
+ var _, done = false;
49
+ for (var i = decorators.length - 1; i >= 0; i--) {
50
+ var context = {};
51
+ for (var p in contextIn) context[p] = p === "access" ? {} : contextIn[p];
52
+ for (var p in contextIn.access) context.access[p] = contextIn.access[p];
53
+ context.addInitializer = function(f) {
54
+ if (done) throw new TypeError("Cannot add initializers after decoration has completed");
55
+ extraInitializers.push(accept(f || null));
56
+ };
57
+ var result = (0, decorators[i])(kind === "accessor" ? { get: descriptor.get, set: descriptor.set } : descriptor[key], context);
58
+ if (kind === "accessor") {
59
+ if (result === void 0) continue;
60
+ if (result === null || typeof result !== "object") throw new TypeError("Object expected");
61
+ if (_ = accept(result.get)) descriptor.get = _;
62
+ if (_ = accept(result.set)) descriptor.set = _;
63
+ if (_ = accept(result.init)) initializers.unshift(_);
64
+ } else if (_ = accept(result)) {
65
+ if (kind === "field") initializers.unshift(_);
66
+ else descriptor[key] = _;
67
+ }
68
+ }
69
+ if (target) Object.defineProperty(target, contextIn.name, descriptor);
70
+ done = true;
71
+ };
72
+ var __runInitializers = function(thisArg, initializers, value) {
73
+ var useValue = arguments.length > 2;
74
+ for (var i = 0; i < initializers.length; i++) {
75
+ value = useValue ? initializers[i].call(thisArg, value) : initializers[i].call(thisArg);
76
+ }
77
+ return useValue ? value : void 0;
45
78
  };
46
- var BatteryCCReport_1, BatteryCCHealthReport_1;
47
79
  const BatteryCCValues = Object.freeze({
48
80
  ...import_Values.V.defineStaticCCValues(import_safe.CommandClasses.Battery, {
49
81
  ...import_Values.V.staticProperty("level", {
@@ -122,379 +154,429 @@ const BatteryCCValues = Object.freeze({
122
154
  })
123
155
  })
124
156
  });
125
- let BatteryCCAPI = class BatteryCCAPI2 extends import_API.PhysicalCCAPI {
126
- supportsCommand(cmd) {
127
- switch (cmd) {
128
- case import_Types.BatteryCommand.Get:
129
- return true;
130
- // This is mandatory
131
- case import_Types.BatteryCommand.HealthGet:
132
- return this.version >= 2;
157
+ let BatteryCCAPI = (() => {
158
+ let _classDecorators = [(0, import_CommandClassDecorators.API)(import_safe.CommandClasses.Battery)];
159
+ let _classDescriptor;
160
+ let _classExtraInitializers = [];
161
+ let _classThis;
162
+ let _classSuper = import_API.PhysicalCCAPI;
163
+ var BatteryCCAPI2 = class extends _classSuper {
164
+ static {
165
+ _classThis = this;
133
166
  }
134
- return super.supportsCommand(cmd);
135
- }
136
- get [import_API.POLL_VALUE]() {
137
- return async function({ property }) {
138
- switch (property) {
139
- case "level":
140
- case "isLow":
141
- case "chargingStatus":
142
- case "rechargeable":
143
- case "backup":
144
- case "overheating":
145
- case "lowFluid":
146
- case "rechargeOrReplace":
147
- case "lowTemperatureStatus":
148
- case "disconnected":
149
- return (await this.get())?.[property];
150
- case "maximumCapacity":
151
- case "temperature":
152
- return (await this.getHealth())?.[property];
153
- default:
154
- (0, import_API.throwUnsupportedProperty)(this.ccId, property);
167
+ static {
168
+ const _metadata = typeof Symbol === "function" && Symbol.metadata ? Object.create(_classSuper[Symbol.metadata] ?? null) : void 0;
169
+ __esDecorate(null, _classDescriptor = { value: _classThis }, _classDecorators, { kind: "class", name: _classThis.name, metadata: _metadata }, null, _classExtraInitializers);
170
+ BatteryCCAPI2 = _classThis = _classDescriptor.value;
171
+ if (_metadata) Object.defineProperty(_classThis, Symbol.metadata, { enumerable: true, configurable: true, writable: true, value: _metadata });
172
+ __runInitializers(_classThis, _classExtraInitializers);
173
+ }
174
+ supportsCommand(cmd) {
175
+ switch (cmd) {
176
+ case import_Types.BatteryCommand.Get:
177
+ return true;
178
+ // This is mandatory
179
+ case import_Types.BatteryCommand.HealthGet:
180
+ return this.version >= 2;
155
181
  }
156
- };
157
- }
158
- // eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types
159
- async get() {
160
- this.assertSupportsCommand(import_Types.BatteryCommand, import_Types.BatteryCommand.Get);
161
- const cc = new BatteryCCGet({
162
- nodeId: this.endpoint.nodeId,
163
- endpointIndex: this.endpoint.index
164
- });
165
- const response = await this.host.sendCommand(cc, this.commandOptions);
166
- if (response) {
167
- return (0, import_safe3.pick)(response, [
168
- "level",
169
- "isLow",
170
- "chargingStatus",
171
- "rechargeable",
172
- "backup",
173
- "overheating",
174
- "lowFluid",
175
- "rechargeOrReplace",
176
- "lowTemperatureStatus",
177
- "disconnected"
178
- ]);
182
+ return super.supportsCommand(cmd);
179
183
  }
180
- }
181
- // eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types
182
- async getHealth() {
183
- this.assertSupportsCommand(import_Types.BatteryCommand, import_Types.BatteryCommand.HealthGet);
184
- const cc = new BatteryCCHealthGet({
185
- nodeId: this.endpoint.nodeId,
186
- endpointIndex: this.endpoint.index
187
- });
188
- const response = await this.host.sendCommand(cc, this.commandOptions);
189
- if (response) {
190
- return (0, import_safe3.pick)(response, ["maximumCapacity", "temperature"]);
184
+ get [import_API.POLL_VALUE]() {
185
+ return async function({ property }) {
186
+ switch (property) {
187
+ case "level":
188
+ case "isLow":
189
+ case "chargingStatus":
190
+ case "rechargeable":
191
+ case "backup":
192
+ case "overheating":
193
+ case "lowFluid":
194
+ case "rechargeOrReplace":
195
+ case "lowTemperatureStatus":
196
+ case "disconnected":
197
+ return (await this.get())?.[property];
198
+ case "maximumCapacity":
199
+ case "temperature":
200
+ return (await this.getHealth())?.[property];
201
+ default:
202
+ (0, import_API.throwUnsupportedProperty)(this.ccId, property);
203
+ }
204
+ };
191
205
  }
192
- }
193
- };
194
- BatteryCCAPI = __decorate([
195
- (0, import_CommandClassDecorators.API)(import_safe.CommandClasses.Battery)
196
- ], BatteryCCAPI);
197
- let BatteryCC = class BatteryCC2 extends import_CommandClass.CommandClass {
198
- async interview(ctx) {
199
- const node = this.getNode(ctx);
200
- ctx.logNode(node.id, {
201
- endpoint: this.endpointIndex,
202
- message: `Interviewing ${this.ccName}...`,
203
- direction: "none"
204
- });
205
- await this.refreshValues(ctx);
206
- this.setInterviewComplete(ctx, true);
207
- }
208
- async refreshValues(ctx) {
209
- const node = this.getNode(ctx);
210
- const endpoint = this.getEndpoint(ctx);
211
- const api = import_API.CCAPI.create(import_safe.CommandClasses.Battery, ctx, endpoint).withOptions({
212
- priority: import_safe.MessagePriority.NodeQuery
213
- });
214
- ctx.logNode(node.id, {
215
- endpoint: this.endpointIndex,
216
- message: "querying battery status...",
217
- direction: "outbound"
218
- });
219
- const batteryStatus = await api.get();
220
- if (batteryStatus) {
221
- let logMessage = `received response for battery information:
222
- level: ${batteryStatus.level}${batteryStatus.isLow ? " (low)" : ""}`;
223
- if (api.version >= 2) {
224
- logMessage += `
225
- status: ${import_Types.BatteryChargingStatus[batteryStatus.chargingStatus]}
226
- rechargeable: ${batteryStatus.rechargeable}
227
- is backup: ${batteryStatus.backup}
228
- is overheating: ${batteryStatus.overheating}
229
- fluid is low: ${batteryStatus.lowFluid}
230
- needs to be replaced or charged: ${import_Types.BatteryReplacementStatus[batteryStatus.rechargeOrReplace]}
231
- is low temperature ${batteryStatus.lowTemperatureStatus}
232
- is disconnected: ${batteryStatus.disconnected}`;
206
+ // eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types
207
+ async get() {
208
+ this.assertSupportsCommand(import_Types.BatteryCommand, import_Types.BatteryCommand.Get);
209
+ const cc = new BatteryCCGet({
210
+ nodeId: this.endpoint.nodeId,
211
+ endpointIndex: this.endpoint.index
212
+ });
213
+ const response = await this.host.sendCommand(cc, this.commandOptions);
214
+ if (response) {
215
+ return (0, import_safe3.pick)(response, [
216
+ "level",
217
+ "isLow",
218
+ "chargingStatus",
219
+ "rechargeable",
220
+ "backup",
221
+ "overheating",
222
+ "lowFluid",
223
+ "rechargeOrReplace",
224
+ "lowTemperatureStatus",
225
+ "disconnected"
226
+ ]);
227
+ }
228
+ }
229
+ // eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types
230
+ async getHealth() {
231
+ this.assertSupportsCommand(import_Types.BatteryCommand, import_Types.BatteryCommand.HealthGet);
232
+ const cc = new BatteryCCHealthGet({
233
+ nodeId: this.endpoint.nodeId,
234
+ endpointIndex: this.endpoint.index
235
+ });
236
+ const response = await this.host.sendCommand(cc, this.commandOptions);
237
+ if (response) {
238
+ return (0, import_safe3.pick)(response, ["maximumCapacity", "temperature"]);
233
239
  }
240
+ }
241
+ };
242
+ return BatteryCCAPI2 = _classThis;
243
+ })();
244
+ let BatteryCC = (() => {
245
+ let _classDecorators = [(0, import_CommandClassDecorators.commandClass)(import_safe.CommandClasses.Battery), (0, import_CommandClassDecorators.implementedVersion)(3), (0, import_CommandClassDecorators.ccValues)(BatteryCCValues)];
246
+ let _classDescriptor;
247
+ let _classExtraInitializers = [];
248
+ let _classThis;
249
+ let _classSuper = import_CommandClass.CommandClass;
250
+ var BatteryCC2 = class extends _classSuper {
251
+ static {
252
+ _classThis = this;
253
+ }
254
+ static {
255
+ const _metadata = typeof Symbol === "function" && Symbol.metadata ? Object.create(_classSuper[Symbol.metadata] ?? null) : void 0;
256
+ __esDecorate(null, _classDescriptor = { value: _classThis }, _classDecorators, { kind: "class", name: _classThis.name, metadata: _metadata }, null, _classExtraInitializers);
257
+ BatteryCC2 = _classThis = _classDescriptor.value;
258
+ if (_metadata) Object.defineProperty(_classThis, Symbol.metadata, { enumerable: true, configurable: true, writable: true, value: _metadata });
259
+ __runInitializers(_classThis, _classExtraInitializers);
260
+ }
261
+ async interview(ctx) {
262
+ const node = this.getNode(ctx);
234
263
  ctx.logNode(node.id, {
235
264
  endpoint: this.endpointIndex,
236
- message: logMessage,
237
- direction: "inbound"
265
+ message: `Interviewing ${this.ccName}...`,
266
+ direction: "none"
238
267
  });
268
+ await this.refreshValues(ctx);
269
+ this.setInterviewComplete(ctx, true);
239
270
  }
240
- if (api.version >= 2) {
271
+ async refreshValues(ctx) {
272
+ const node = this.getNode(ctx);
273
+ const endpoint = this.getEndpoint(ctx);
274
+ const api = import_API.CCAPI.create(import_safe.CommandClasses.Battery, ctx, endpoint).withOptions({
275
+ priority: import_safe.MessagePriority.NodeQuery
276
+ });
241
277
  ctx.logNode(node.id, {
242
278
  endpoint: this.endpointIndex,
243
- message: "querying battery health...",
279
+ message: "querying battery status...",
244
280
  direction: "outbound"
245
281
  });
246
- const batteryHealth = await api.getHealth();
247
- if (batteryHealth) {
248
- const logMessage = `received response for battery health:
249
- max. capacity: ${batteryHealth.maximumCapacity} %
250
- temperature: ${batteryHealth.temperature} \xB0C`;
282
+ const batteryStatus = await api.get();
283
+ if (batteryStatus) {
284
+ let logMessage = `received response for battery information:
285
+ level: ${batteryStatus.level}${batteryStatus.isLow ? " (low)" : ""}`;
286
+ if (api.version >= 2) {
287
+ logMessage += `
288
+ status: ${import_Types.BatteryChargingStatus[batteryStatus.chargingStatus]}
289
+ rechargeable: ${batteryStatus.rechargeable}
290
+ is backup: ${batteryStatus.backup}
291
+ is overheating: ${batteryStatus.overheating}
292
+ fluid is low: ${batteryStatus.lowFluid}
293
+ needs to be replaced or charged: ${import_Types.BatteryReplacementStatus[batteryStatus.rechargeOrReplace]}
294
+ is low temperature ${batteryStatus.lowTemperatureStatus}
295
+ is disconnected: ${batteryStatus.disconnected}`;
296
+ }
251
297
  ctx.logNode(node.id, {
252
298
  endpoint: this.endpointIndex,
253
299
  message: logMessage,
254
300
  direction: "inbound"
255
301
  });
256
302
  }
303
+ if (api.version >= 2) {
304
+ ctx.logNode(node.id, {
305
+ endpoint: this.endpointIndex,
306
+ message: "querying battery health...",
307
+ direction: "outbound"
308
+ });
309
+ const batteryHealth = await api.getHealth();
310
+ if (batteryHealth) {
311
+ const logMessage = `received response for battery health:
312
+ max. capacity: ${batteryHealth.maximumCapacity} %
313
+ temperature: ${batteryHealth.temperature} \xB0C`;
314
+ ctx.logNode(node.id, {
315
+ endpoint: this.endpointIndex,
316
+ message: logMessage,
317
+ direction: "inbound"
318
+ });
319
+ }
320
+ }
257
321
  }
258
- }
259
- shouldRefreshValues(ctx) {
260
- const valueDB = ctx.tryGetValueDB(this.nodeId);
261
- if (!valueDB)
262
- return true;
263
- const lastUpdated = valueDB.getTimestamp(BatteryCCValues.level.endpoint(this.endpointIndex));
264
- return lastUpdated == void 0 || Date.now() - lastUpdated > import_core.timespan.days(7);
265
- }
266
- };
267
- BatteryCC = __decorate([
268
- (0, import_CommandClassDecorators.commandClass)(import_safe.CommandClasses.Battery),
269
- (0, import_CommandClassDecorators.implementedVersion)(3),
270
- (0, import_CommandClassDecorators.ccValues)(BatteryCCValues)
271
- ], BatteryCC);
272
- let BatteryCCReport = BatteryCCReport_1 = class BatteryCCReport2 extends BatteryCC {
273
- constructor(options) {
274
- super(options);
275
- this.level = options.isLow ? 0 : options.level;
276
- this.isLow = !!options.isLow;
277
- this.chargingStatus = options.chargingStatus;
278
- this.rechargeable = options.rechargeable;
279
- this.backup = options.backup;
280
- this.overheating = options.overheating;
281
- this.lowFluid = options.lowFluid;
282
- this.rechargeOrReplace = options.rechargeOrReplace;
283
- this.disconnected = options.disconnected;
284
- this.lowTemperatureStatus = options.lowTemperatureStatus;
285
- }
286
- static from(raw, ctx) {
287
- let ccOptions;
288
- (0, import_safe.validatePayload)(raw.payload.length >= 1);
289
- const level = raw.payload[0];
290
- if (level === 255) {
291
- ccOptions = {
292
- isLow: true
293
- };
294
- } else {
295
- ccOptions = {
296
- isLow: false,
297
- level
298
- };
322
+ shouldRefreshValues(ctx) {
323
+ const valueDB = ctx.tryGetValueDB(this.nodeId);
324
+ if (!valueDB)
325
+ return true;
326
+ const lastUpdated = valueDB.getTimestamp(BatteryCCValues.level.endpoint(this.endpointIndex));
327
+ return lastUpdated == void 0 || Date.now() - lastUpdated > import_core.timespan.days(7);
299
328
  }
300
- if (raw.payload.length >= 3) {
301
- const chargingStatus = raw.payload[1] >>> 6;
302
- const rechargeable = !!(raw.payload[1] & 32);
303
- const backup = !!(raw.payload[1] & 16);
304
- const overheating = !!(raw.payload[1] & 8);
305
- const lowFluid = !!(raw.payload[1] & 4);
306
- const rechargeOrReplace = !!(raw.payload[1] & 2) ? import_Types.BatteryReplacementStatus.Now : !!(raw.payload[1] & 1) ? import_Types.BatteryReplacementStatus.Soon : import_Types.BatteryReplacementStatus.No;
307
- const lowTemperatureStatus = !!(raw.payload[2] & 2);
308
- const disconnected = !!(raw.payload[2] & 1);
309
- ccOptions = {
310
- ...ccOptions,
311
- chargingStatus,
312
- rechargeable,
313
- backup,
314
- overheating,
315
- lowFluid,
316
- rechargeOrReplace,
317
- lowTemperatureStatus,
318
- disconnected
319
- };
329
+ };
330
+ return BatteryCC2 = _classThis;
331
+ })();
332
+ let BatteryCCReport = (() => {
333
+ let _classDecorators = [(0, import_CommandClassDecorators.CCCommand)(import_Types.BatteryCommand.Report), (0, import_CommandClassDecorators.ccValueProperty)("level", BatteryCCValues.level), (0, import_CommandClassDecorators.ccValueProperty)("isLow", BatteryCCValues.isLow), (0, import_CommandClassDecorators.ccValueProperty)("chargingStatus", BatteryCCValues.chargingStatus), (0, import_CommandClassDecorators.ccValueProperty)("rechargeable", BatteryCCValues.rechargeable), (0, import_CommandClassDecorators.ccValueProperty)("backup", BatteryCCValues.backup), (0, import_CommandClassDecorators.ccValueProperty)("overheating", BatteryCCValues.overheating), (0, import_CommandClassDecorators.ccValueProperty)("lowFluid", BatteryCCValues.lowFluid), (0, import_CommandClassDecorators.ccValueProperty)("rechargeOrReplace", BatteryCCValues.rechargeOrReplace), (0, import_CommandClassDecorators.ccValueProperty)("disconnected", BatteryCCValues.disconnected), (0, import_CommandClassDecorators.ccValueProperty)("lowTemperatureStatus", BatteryCCValues.lowTemperatureStatus)];
334
+ let _classDescriptor;
335
+ let _classExtraInitializers = [];
336
+ let _classThis;
337
+ let _classSuper = BatteryCC;
338
+ var BatteryCCReport2 = class extends _classSuper {
339
+ static {
340
+ _classThis = this;
320
341
  }
321
- return new BatteryCCReport_1({
322
- nodeId: ctx.sourceNodeId,
323
- ...ccOptions
324
- });
325
- }
326
- persistValues(ctx) {
327
- if (!super.persistValues(ctx))
328
- return false;
329
- if (this.level >= 90) {
330
- const notificationCCVersion = ctx.getSupportedCCVersion(import_safe.CommandClasses.Notification, this.nodeId, this.endpointIndex);
331
- if (
332
- // supported
333
- notificationCCVersion > 0 && notificationCCVersion < 8
334
- ) {
335
- const batteryLevelStatusValue = import_NotificationCC.NotificationCCValues.notificationVariable("Power Management", "Battery level status");
336
- if (this.getValue(ctx, batteryLevelStatusValue)) {
337
- this.setValue(ctx, batteryLevelStatusValue, 0);
342
+ static {
343
+ const _metadata = typeof Symbol === "function" && Symbol.metadata ? Object.create(_classSuper[Symbol.metadata] ?? null) : void 0;
344
+ __esDecorate(null, _classDescriptor = { value: _classThis }, _classDecorators, { kind: "class", name: _classThis.name, metadata: _metadata }, null, _classExtraInitializers);
345
+ BatteryCCReport2 = _classThis = _classDescriptor.value;
346
+ if (_metadata) Object.defineProperty(_classThis, Symbol.metadata, { enumerable: true, configurable: true, writable: true, value: _metadata });
347
+ __runInitializers(_classThis, _classExtraInitializers);
348
+ }
349
+ constructor(options) {
350
+ super(options);
351
+ this.level = options.isLow ? 0 : options.level;
352
+ this.isLow = !!options.isLow;
353
+ this.chargingStatus = options.chargingStatus;
354
+ this.rechargeable = options.rechargeable;
355
+ this.backup = options.backup;
356
+ this.overheating = options.overheating;
357
+ this.lowFluid = options.lowFluid;
358
+ this.rechargeOrReplace = options.rechargeOrReplace;
359
+ this.disconnected = options.disconnected;
360
+ this.lowTemperatureStatus = options.lowTemperatureStatus;
361
+ }
362
+ static from(raw, ctx) {
363
+ let ccOptions;
364
+ (0, import_safe.validatePayload)(raw.payload.length >= 1);
365
+ const level = raw.payload[0];
366
+ if (level === 255) {
367
+ ccOptions = {
368
+ isLow: true
369
+ };
370
+ } else {
371
+ ccOptions = {
372
+ isLow: false,
373
+ level
374
+ };
375
+ }
376
+ if (raw.payload.length >= 3) {
377
+ const chargingStatus = raw.payload[1] >>> 6;
378
+ const rechargeable = !!(raw.payload[1] & 32);
379
+ const backup = !!(raw.payload[1] & 16);
380
+ const overheating = !!(raw.payload[1] & 8);
381
+ const lowFluid = !!(raw.payload[1] & 4);
382
+ const rechargeOrReplace = !!(raw.payload[1] & 2) ? import_Types.BatteryReplacementStatus.Now : !!(raw.payload[1] & 1) ? import_Types.BatteryReplacementStatus.Soon : import_Types.BatteryReplacementStatus.No;
383
+ const lowTemperatureStatus = !!(raw.payload[2] & 2);
384
+ const disconnected = !!(raw.payload[2] & 1);
385
+ ccOptions = {
386
+ ...ccOptions,
387
+ chargingStatus,
388
+ rechargeable,
389
+ backup,
390
+ overheating,
391
+ lowFluid,
392
+ rechargeOrReplace,
393
+ lowTemperatureStatus,
394
+ disconnected
395
+ };
396
+ }
397
+ return new this({
398
+ nodeId: ctx.sourceNodeId,
399
+ ...ccOptions
400
+ });
401
+ }
402
+ persistValues(ctx) {
403
+ if (!super.persistValues(ctx))
404
+ return false;
405
+ if (this.level >= 90) {
406
+ const notificationCCVersion = ctx.getSupportedCCVersion(import_safe.CommandClasses.Notification, this.nodeId, this.endpointIndex);
407
+ if (
408
+ // supported
409
+ notificationCCVersion > 0 && notificationCCVersion < 8
410
+ ) {
411
+ const batteryLevelStatusValue = import_NotificationCC.NotificationCCValues.notificationVariable("Power Management", "Battery level status");
412
+ if (this.getValue(ctx, batteryLevelStatusValue)) {
413
+ this.setValue(ctx, batteryLevelStatusValue, 0);
414
+ }
338
415
  }
339
416
  }
417
+ return true;
340
418
  }
341
- return true;
342
- }
343
- level;
344
- isLow;
345
- chargingStatus;
346
- rechargeable;
347
- backup;
348
- overheating;
349
- lowFluid;
350
- rechargeOrReplace;
351
- disconnected;
352
- lowTemperatureStatus;
353
- serialize(ctx) {
354
- this.payload = import_safe2.Bytes.from([this.isLow ? 255 : this.level]);
355
- if (this.chargingStatus != void 0) {
356
- this.payload = import_safe2.Bytes.concat([
357
- this.payload,
358
- import_safe2.Bytes.from([
359
- (this.chargingStatus << 6) + (this.rechargeable ? 32 : 0) + (this.backup ? 16 : 0) + (this.overheating ? 8 : 0) + (this.lowFluid ? 4 : 0) + (this.rechargeOrReplace === import_Types.BatteryReplacementStatus.Now ? 2 : this.rechargeOrReplace === import_Types.BatteryReplacementStatus.Soon ? 1 : 0),
360
- (this.lowTemperatureStatus ? 2 : 0) + (this.disconnected ? 1 : 0)
361
- ])
362
- ]);
419
+ level;
420
+ isLow;
421
+ chargingStatus;
422
+ rechargeable;
423
+ backup;
424
+ overheating;
425
+ lowFluid;
426
+ rechargeOrReplace;
427
+ disconnected;
428
+ lowTemperatureStatus;
429
+ serialize(ctx) {
430
+ this.payload = import_safe2.Bytes.from([this.isLow ? 255 : this.level]);
431
+ if (this.chargingStatus != void 0) {
432
+ this.payload = import_safe2.Bytes.concat([
433
+ this.payload,
434
+ import_safe2.Bytes.from([
435
+ (this.chargingStatus << 6) + (this.rechargeable ? 32 : 0) + (this.backup ? 16 : 0) + (this.overheating ? 8 : 0) + (this.lowFluid ? 4 : 0) + (this.rechargeOrReplace === import_Types.BatteryReplacementStatus.Now ? 2 : this.rechargeOrReplace === import_Types.BatteryReplacementStatus.Soon ? 1 : 0),
436
+ (this.lowTemperatureStatus ? 2 : 0) + (this.disconnected ? 1 : 0)
437
+ ])
438
+ ]);
439
+ }
440
+ return super.serialize(ctx);
363
441
  }
364
- return super.serialize(ctx);
365
- }
366
- toLogEntry(ctx) {
367
- const message = {
368
- level: this.level,
369
- "is low": this.isLow
370
- };
371
- if (this.chargingStatus != void 0) {
372
- message["charging status"] = (0, import_safe3.getEnumMemberName)(import_Types.BatteryChargingStatus, this.chargingStatus);
442
+ toLogEntry(ctx) {
443
+ const message = {
444
+ level: this.level,
445
+ "is low": this.isLow
446
+ };
447
+ if (this.chargingStatus != void 0) {
448
+ message["charging status"] = (0, import_safe3.getEnumMemberName)(import_Types.BatteryChargingStatus, this.chargingStatus);
449
+ }
450
+ if (this.rechargeable != void 0) {
451
+ message.rechargeable = this.rechargeable;
452
+ }
453
+ if (this.backup != void 0) {
454
+ message.backup = this.backup;
455
+ }
456
+ if (this.overheating != void 0) {
457
+ message.overheating = this.overheating;
458
+ }
459
+ if (this.lowFluid != void 0) {
460
+ message["low fluid"] = this.lowFluid;
461
+ }
462
+ if (this.rechargeOrReplace != void 0) {
463
+ message["recharge or replace"] = (0, import_safe3.getEnumMemberName)(import_Types.BatteryReplacementStatus, this.rechargeOrReplace);
464
+ }
465
+ if (this.lowTemperatureStatus != void 0) {
466
+ message.lowTemperatureStatus = this.lowTemperatureStatus;
467
+ }
468
+ if (this.disconnected != void 0) {
469
+ message.disconnected = this.disconnected;
470
+ }
471
+ return {
472
+ ...super.toLogEntry(ctx),
473
+ message
474
+ };
373
475
  }
374
- if (this.rechargeable != void 0) {
375
- message.rechargeable = this.rechargeable;
476
+ };
477
+ return BatteryCCReport2 = _classThis;
478
+ })();
479
+ let BatteryCCGet = (() => {
480
+ let _classDecorators = [(0, import_CommandClassDecorators.CCCommand)(import_Types.BatteryCommand.Get), (0, import_CommandClassDecorators.expectedCCResponse)(BatteryCCReport)];
481
+ let _classDescriptor;
482
+ let _classExtraInitializers = [];
483
+ let _classThis;
484
+ let _classSuper = BatteryCC;
485
+ var BatteryCCGet2 = class extends _classSuper {
486
+ static {
487
+ _classThis = this;
376
488
  }
377
- if (this.backup != void 0) {
378
- message.backup = this.backup;
489
+ static {
490
+ const _metadata = typeof Symbol === "function" && Symbol.metadata ? Object.create(_classSuper[Symbol.metadata] ?? null) : void 0;
491
+ __esDecorate(null, _classDescriptor = { value: _classThis }, _classDecorators, { kind: "class", name: _classThis.name, metadata: _metadata }, null, _classExtraInitializers);
492
+ BatteryCCGet2 = _classThis = _classDescriptor.value;
493
+ if (_metadata) Object.defineProperty(_classThis, Symbol.metadata, { enumerable: true, configurable: true, writable: true, value: _metadata });
494
+ __runInitializers(_classThis, _classExtraInitializers);
379
495
  }
380
- if (this.overheating != void 0) {
381
- message.overheating = this.overheating;
496
+ };
497
+ return BatteryCCGet2 = _classThis;
498
+ })();
499
+ let BatteryCCHealthReport = (() => {
500
+ let _classDecorators = [(0, import_CommandClassDecorators.CCCommand)(import_Types.BatteryCommand.HealthReport), (0, import_CommandClassDecorators.ccValueProperty)("maximumCapacity", BatteryCCValues.maximumCapacity), (0, import_CommandClassDecorators.ccValueProperty)("temperature", BatteryCCValues.temperature)];
501
+ let _classDescriptor;
502
+ let _classExtraInitializers = [];
503
+ let _classThis;
504
+ let _classSuper = BatteryCC;
505
+ var BatteryCCHealthReport2 = class extends _classSuper {
506
+ static {
507
+ _classThis = this;
382
508
  }
383
- if (this.lowFluid != void 0) {
384
- message["low fluid"] = this.lowFluid;
509
+ static {
510
+ const _metadata = typeof Symbol === "function" && Symbol.metadata ? Object.create(_classSuper[Symbol.metadata] ?? null) : void 0;
511
+ __esDecorate(null, _classDescriptor = { value: _classThis }, _classDecorators, { kind: "class", name: _classThis.name, metadata: _metadata }, null, _classExtraInitializers);
512
+ BatteryCCHealthReport2 = _classThis = _classDescriptor.value;
513
+ if (_metadata) Object.defineProperty(_classThis, Symbol.metadata, { enumerable: true, configurable: true, writable: true, value: _metadata });
514
+ __runInitializers(_classThis, _classExtraInitializers);
385
515
  }
386
- if (this.rechargeOrReplace != void 0) {
387
- message["recharge or replace"] = (0, import_safe3.getEnumMemberName)(import_Types.BatteryReplacementStatus, this.rechargeOrReplace);
516
+ constructor(options) {
517
+ super(options);
518
+ this.maximumCapacity = options.maximumCapacity;
519
+ this.temperature = options.temperature;
520
+ this.temperatureScale = options.temperatureScale;
388
521
  }
389
- if (this.lowTemperatureStatus != void 0) {
390
- message.lowTemperatureStatus = this.lowTemperatureStatus;
522
+ static from(raw, ctx) {
523
+ (0, import_safe.validatePayload)(raw.payload.length >= 2);
524
+ let maximumCapacity = raw.payload[0];
525
+ if (maximumCapacity === 255)
526
+ maximumCapacity = void 0;
527
+ const { value: temperature, scale: temperatureScale } = (0, import_safe.parseFloatWithScale)(raw.payload.subarray(1), true);
528
+ return new this({
529
+ nodeId: ctx.sourceNodeId,
530
+ maximumCapacity,
531
+ temperature,
532
+ temperatureScale
533
+ });
391
534
  }
392
- if (this.disconnected != void 0) {
393
- message.disconnected = this.disconnected;
535
+ persistValues(ctx) {
536
+ if (!super.persistValues(ctx))
537
+ return false;
538
+ const temperatureValue = BatteryCCValues.temperature;
539
+ this.setMetadata(ctx, temperatureValue, {
540
+ ...temperatureValue.meta,
541
+ unit: this.temperatureScale === 0 ? "\xB0C" : void 0
542
+ });
543
+ return true;
394
544
  }
395
- return {
396
- ...super.toLogEntry(ctx),
397
- message
398
- };
399
- }
400
- };
401
- __decorate([
402
- (0, import_CommandClassDecorators.ccValue)(BatteryCCValues.level)
403
- ], BatteryCCReport.prototype, "level", void 0);
404
- __decorate([
405
- (0, import_CommandClassDecorators.ccValue)(BatteryCCValues.isLow)
406
- ], BatteryCCReport.prototype, "isLow", void 0);
407
- __decorate([
408
- (0, import_CommandClassDecorators.ccValue)(BatteryCCValues.chargingStatus)
409
- ], BatteryCCReport.prototype, "chargingStatus", void 0);
410
- __decorate([
411
- (0, import_CommandClassDecorators.ccValue)(BatteryCCValues.rechargeable)
412
- ], BatteryCCReport.prototype, "rechargeable", void 0);
413
- __decorate([
414
- (0, import_CommandClassDecorators.ccValue)(BatteryCCValues.backup)
415
- ], BatteryCCReport.prototype, "backup", void 0);
416
- __decorate([
417
- (0, import_CommandClassDecorators.ccValue)(BatteryCCValues.overheating)
418
- ], BatteryCCReport.prototype, "overheating", void 0);
419
- __decorate([
420
- (0, import_CommandClassDecorators.ccValue)(BatteryCCValues.lowFluid)
421
- ], BatteryCCReport.prototype, "lowFluid", void 0);
422
- __decorate([
423
- (0, import_CommandClassDecorators.ccValue)(BatteryCCValues.rechargeOrReplace)
424
- ], BatteryCCReport.prototype, "rechargeOrReplace", void 0);
425
- __decorate([
426
- (0, import_CommandClassDecorators.ccValue)(BatteryCCValues.disconnected)
427
- ], BatteryCCReport.prototype, "disconnected", void 0);
428
- __decorate([
429
- (0, import_CommandClassDecorators.ccValue)(BatteryCCValues.lowTemperatureStatus)
430
- ], BatteryCCReport.prototype, "lowTemperatureStatus", void 0);
431
- BatteryCCReport = BatteryCCReport_1 = __decorate([
432
- (0, import_CommandClassDecorators.CCCommand)(import_Types.BatteryCommand.Report)
433
- ], BatteryCCReport);
434
- let BatteryCCGet = class BatteryCCGet2 extends BatteryCC {
435
- };
436
- BatteryCCGet = __decorate([
437
- (0, import_CommandClassDecorators.CCCommand)(import_Types.BatteryCommand.Get),
438
- (0, import_CommandClassDecorators.expectedCCResponse)(BatteryCCReport)
439
- ], BatteryCCGet);
440
- let BatteryCCHealthReport = BatteryCCHealthReport_1 = class BatteryCCHealthReport2 extends BatteryCC {
441
- constructor(options) {
442
- super(options);
443
- this.maximumCapacity = options.maximumCapacity;
444
- this.temperature = options.temperature;
445
- this.temperatureScale = options.temperatureScale;
446
- }
447
- static from(raw, ctx) {
448
- (0, import_safe.validatePayload)(raw.payload.length >= 2);
449
- let maximumCapacity = raw.payload[0];
450
- if (maximumCapacity === 255)
451
- maximumCapacity = void 0;
452
- const { value: temperature, scale: temperatureScale } = (0, import_safe.parseFloatWithScale)(raw.payload.subarray(1), true);
453
- return new BatteryCCHealthReport_1({
454
- nodeId: ctx.sourceNodeId,
455
- maximumCapacity,
456
- temperature,
457
- temperatureScale
458
- });
459
- }
460
- persistValues(ctx) {
461
- if (!super.persistValues(ctx))
462
- return false;
463
- const temperatureValue = BatteryCCValues.temperature;
464
- this.setMetadata(ctx, temperatureValue, {
465
- ...temperatureValue.meta,
466
- unit: this.temperatureScale === 0 ? "\xB0C" : void 0
467
- });
468
- return true;
469
- }
470
- maximumCapacity;
471
- temperature;
472
- temperatureScale;
473
- toLogEntry(ctx) {
474
- return {
475
- ...super.toLogEntry(ctx),
476
- message: {
477
- temperature: this.temperature != void 0 ? this.temperature : "unknown",
478
- "max capacity": this.maximumCapacity != void 0 ? `${this.maximumCapacity} %` : "unknown"
479
- }
480
- };
481
- }
482
- };
483
- __decorate([
484
- (0, import_CommandClassDecorators.ccValue)(BatteryCCValues.maximumCapacity)
485
- ], BatteryCCHealthReport.prototype, "maximumCapacity", void 0);
486
- __decorate([
487
- (0, import_CommandClassDecorators.ccValue)(BatteryCCValues.temperature)
488
- ], BatteryCCHealthReport.prototype, "temperature", void 0);
489
- BatteryCCHealthReport = BatteryCCHealthReport_1 = __decorate([
490
- (0, import_CommandClassDecorators.CCCommand)(import_Types.BatteryCommand.HealthReport)
491
- ], BatteryCCHealthReport);
492
- let BatteryCCHealthGet = class BatteryCCHealthGet2 extends BatteryCC {
493
- };
494
- BatteryCCHealthGet = __decorate([
495
- (0, import_CommandClassDecorators.CCCommand)(import_Types.BatteryCommand.HealthGet),
496
- (0, import_CommandClassDecorators.expectedCCResponse)(BatteryCCHealthReport)
497
- ], BatteryCCHealthGet);
545
+ maximumCapacity;
546
+ temperature;
547
+ temperatureScale;
548
+ toLogEntry(ctx) {
549
+ return {
550
+ ...super.toLogEntry(ctx),
551
+ message: {
552
+ temperature: this.temperature != void 0 ? this.temperature : "unknown",
553
+ "max capacity": this.maximumCapacity != void 0 ? `${this.maximumCapacity} %` : "unknown"
554
+ }
555
+ };
556
+ }
557
+ };
558
+ return BatteryCCHealthReport2 = _classThis;
559
+ })();
560
+ let BatteryCCHealthGet = (() => {
561
+ let _classDecorators = [(0, import_CommandClassDecorators.CCCommand)(import_Types.BatteryCommand.HealthGet), (0, import_CommandClassDecorators.expectedCCResponse)(BatteryCCHealthReport)];
562
+ let _classDescriptor;
563
+ let _classExtraInitializers = [];
564
+ let _classThis;
565
+ let _classSuper = BatteryCC;
566
+ var BatteryCCHealthGet2 = class extends _classSuper {
567
+ static {
568
+ _classThis = this;
569
+ }
570
+ static {
571
+ const _metadata = typeof Symbol === "function" && Symbol.metadata ? Object.create(_classSuper[Symbol.metadata] ?? null) : void 0;
572
+ __esDecorate(null, _classDescriptor = { value: _classThis }, _classDecorators, { kind: "class", name: _classThis.name, metadata: _metadata }, null, _classExtraInitializers);
573
+ BatteryCCHealthGet2 = _classThis = _classDescriptor.value;
574
+ if (_metadata) Object.defineProperty(_classThis, Symbol.metadata, { enumerable: true, configurable: true, writable: true, value: _metadata });
575
+ __runInitializers(_classThis, _classExtraInitializers);
576
+ }
577
+ };
578
+ return BatteryCCHealthGet2 = _classThis;
579
+ })();
498
580
  // Annotate the CommonJS export names for ESM import in node:
499
581
  0 && (module.exports = {
500
582
  BatteryCC,