@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
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../src/cc/DoorLockLoggingCC.ts"],
4
- "sourcesContent": ["import {\n\tCommandClasses,\n\ttype MaybeNotKnown,\n\ttype MessageOrCCLogEntry,\n\tMessagePriority,\n\ttype MessageRecord,\n\ttype WithAddress,\n\tZWaveError,\n\tZWaveErrorCodes,\n\tvalidatePayload,\n} from \"@zwave-js/core/safe\";\nimport type {\n\tCCEncodingContext,\n\tCCParsingContext,\n\tGetValueDB,\n} from \"@zwave-js/host/safe\";\nimport { Bytes } from \"@zwave-js/shared/safe\";\nimport { isPrintableASCII, num2hex } from \"@zwave-js/shared/safe\";\nimport { validateArgs } from \"@zwave-js/transformers\";\nimport { CCAPI, PhysicalCCAPI } from \"../lib/API.js\";\nimport {\n\ttype CCRaw,\n\tCommandClass,\n\ttype InterviewContext,\n\ttype RefreshValuesContext,\n} from \"../lib/CommandClass.js\";\nimport {\n\tAPI,\n\tCCCommand,\n\tccValue,\n\tccValues,\n\tcommandClass,\n\texpectedCCResponse,\n\timplementedVersion,\n} from \"../lib/CommandClassDecorators.js\";\nimport { V } from \"../lib/Values.js\";\nimport {\n\tDoorLockLoggingCommand,\n\tDoorLockLoggingEventType,\n\ttype DoorLockLoggingRecord,\n\tDoorLockLoggingRecordStatus,\n} from \"../lib/_Types.js\";\nimport { userCodeToLogString } from \"./UserCodeCC.js\";\n\ninterface DateSegments {\n\tyear: number;\n\tmonth: number;\n\tday: number;\n\thour: number;\n\tminute: number;\n\tsecond: number;\n}\n\nfunction segmentsToDate(segments: DateSegments): Date {\n\treturn new Date(\n\t\tsegments.year,\n\t\tsegments.month - 1, // JS months are 0-based.\n\t\tsegments.day,\n\t\tsegments.hour,\n\t\tsegments.minute,\n\t\tsegments.second,\n\t);\n}\n\nconst eventTypeLabel = {\n\tLockCode: \"Locked via Access Code\",\n\tUnlockCode: \"Unlocked via Access Code\",\n\tLockButton: \"Locked via Lock Button\",\n\tUnlockButton: \"Unlocked via Unlock Button\",\n\tLockCodeOutOfSchedule: \"Out of Schedule Lock Attempt via Access Code\",\n\tUnlockCodeOutOfSchedule: \"Out of Schedule Unlock Attempt via Access Code\",\n\tIllegalCode: \"Illegal Access Code Entered\",\n\tLockManual: \"Manually Locked\",\n\tUnlockManual: \"Manually Unlocked\",\n\tLockAuto: \"Auto Locked\",\n\tUnlockAuto: \"Auto Unlocked\",\n\tLockRemoteCode: \"Locked via Remote Access Code\",\n\tUnlockRemoteCode: \"Unlocked via Remote Access Code\",\n\tLockRemote: \"Locked via Remote\",\n\tUnlockRemote: \"Unlocked via Remote\",\n\tLockRemoteCodeOutOfSchedule:\n\t\t\"Out of Schedule Lock Attempt via Remote Access Code\",\n\tUnlockRemoteCodeOutOfSchedule:\n\t\t\"Out of Schedule Unlock Attempt via Remote Access Code\",\n\tRemoteIllegalCode: \"Illegal Remote Access Code\",\n\tLockManual2: \"Manually Locked (2)\",\n\tUnlockManual2: \"Manually Unlocked (2)\",\n\tLockSecured: \"Lock Secured\",\n\tLockUnsecured: \"Lock Unsecured\",\n\tUserCodeAdded: \"User Code Added\",\n\tUserCodeDeleted: \"User Code Deleted\",\n\tAllUserCodesDeleted: \"All User Codes Deleted\",\n\tAdminCodeChanged: \"Admin Code Changed\",\n\tUserCodeChanged: \"User Code Changed\",\n\tLockReset: \"Lock Reset\",\n\tConfigurationChanged: \"Configuration Changed\",\n\tLowBattery: \"Low Battery\",\n\tNewBattery: \"New Battery Installed\",\n\tUnknown: \"Unknown\",\n} as const;\n\nconst LATEST_RECORD_NUMBER_KEY = 0;\n\nexport const DoorLockLoggingCCValues = Object.freeze({\n\t...V.defineStaticCCValues(CommandClasses[\"Door Lock Logging\"], {\n\t\t...V.staticProperty(\"recordsCount\", undefined, { internal: true }),\n\t}),\n});\n\n@API(CommandClasses[\"Door Lock Logging\"])\nexport class DoorLockLoggingCCAPI extends PhysicalCCAPI {\n\tpublic supportsCommand(\n\t\tcmd: DoorLockLoggingCommand,\n\t): MaybeNotKnown<boolean> {\n\t\tswitch (cmd) {\n\t\t\tcase DoorLockLoggingCommand.RecordsSupportedGet:\n\t\t\tcase DoorLockLoggingCommand.RecordsSupportedReport:\n\t\t\tcase DoorLockLoggingCommand.RecordGet:\n\t\t\tcase DoorLockLoggingCommand.RecordReport:\n\t\t\t\treturn true;\n\t\t}\n\t\treturn super.supportsCommand(cmd);\n\t}\n\n\tpublic async getRecordsCount(): Promise<MaybeNotKnown<number>> {\n\t\tthis.assertSupportsCommand(\n\t\t\tDoorLockLoggingCommand,\n\t\t\tDoorLockLoggingCommand.RecordsSupportedGet,\n\t\t);\n\n\t\tconst cc = new DoorLockLoggingCCRecordsSupportedGet({\n\t\t\tnodeId: this.endpoint.nodeId,\n\t\t\tendpointIndex: this.endpoint.index,\n\t\t});\n\t\tconst response = await this.host.sendCommand<\n\t\t\tDoorLockLoggingCCRecordsSupportedReport\n\t\t>(\n\t\t\tcc,\n\t\t\tthis.commandOptions,\n\t\t);\n\t\treturn response?.recordsCount;\n\t}\n\n\t/** Retrieves the specified audit record. Defaults to the latest one. */\n\t@validateArgs()\n\tpublic async getRecord(\n\t\trecordNumber: number = LATEST_RECORD_NUMBER_KEY,\n\t): Promise<MaybeNotKnown<DoorLockLoggingRecord>> {\n\t\tthis.assertSupportsCommand(\n\t\t\tDoorLockLoggingCommand,\n\t\t\tDoorLockLoggingCommand.RecordGet,\n\t\t);\n\n\t\tconst cc = new DoorLockLoggingCCRecordGet({\n\t\t\tnodeId: this.endpoint.nodeId,\n\t\t\tendpointIndex: this.endpoint.index,\n\t\t\trecordNumber,\n\t\t});\n\t\tconst response = await this.host.sendCommand<\n\t\t\tDoorLockLoggingCCRecordReport\n\t\t>(\n\t\t\tcc,\n\t\t\tthis.commandOptions,\n\t\t);\n\t\treturn response?.record;\n\t}\n}\n\n@commandClass(CommandClasses[\"Door Lock Logging\"])\n@implementedVersion(1)\n@ccValues(DoorLockLoggingCCValues)\nexport class DoorLockLoggingCC extends CommandClass {\n\tdeclare ccCommand: DoorLockLoggingCommand;\n\n\tpublic async interview(\n\t\tctx: InterviewContext,\n\t): Promise<void> {\n\t\tconst node = this.getNode(ctx)!;\n\n\t\tctx.logNode(node.id, {\n\t\t\tendpoint: this.endpointIndex,\n\t\t\tmessage: `Interviewing ${this.ccName}...`,\n\t\t\tdirection: \"none\",\n\t\t});\n\n\t\tawait this.refreshValues(ctx);\n\n\t\t// Remember that the interview is complete\n\t\tthis.setInterviewComplete(ctx, true);\n\t}\n\n\tpublic async refreshValues(\n\t\tctx: RefreshValuesContext,\n\t): Promise<void> {\n\t\tconst node = this.getNode(ctx)!;\n\t\tconst endpoint = this.getEndpoint(ctx)!;\n\t\tconst api = CCAPI.create(\n\t\t\tCommandClasses[\"Door Lock Logging\"],\n\t\t\tctx,\n\t\t\tendpoint,\n\t\t).withOptions({\n\t\t\tpriority: MessagePriority.NodeQuery,\n\t\t});\n\n\t\tctx.logNode(node.id, {\n\t\t\tendpoint: this.endpointIndex,\n\t\t\tmessage: \"querying supported number of records...\",\n\t\t\tdirection: \"outbound\",\n\t\t});\n\t\tconst recordsCount = await api.getRecordsCount();\n\n\t\tif (!recordsCount) {\n\t\t\tctx.logNode(node.id, {\n\t\t\t\tendpoint: this.endpointIndex,\n\t\t\t\tmessage:\n\t\t\t\t\t\"Door Lock Logging records count query timed out, skipping interview...\",\n\t\t\t\tlevel: \"warn\",\n\t\t\t});\n\t\t\treturn;\n\t\t}\n\n\t\tconst recordsCountLogMessage = `supports ${recordsCount} record${\n\t\t\trecordsCount === 1 ? \"\" : \"s\"\n\t\t}`;\n\t\tctx.logNode(node.id, {\n\t\t\tendpoint: this.endpointIndex,\n\t\t\tmessage: recordsCountLogMessage,\n\t\t\tdirection: \"inbound\",\n\t\t});\n\t}\n}\n\n// @publicAPI\nexport interface DoorLockLoggingCCRecordsSupportedReportOptions {\n\trecordsCount: number;\n}\n\n@CCCommand(DoorLockLoggingCommand.RecordsSupportedReport)\nexport class DoorLockLoggingCCRecordsSupportedReport extends DoorLockLoggingCC {\n\tpublic constructor(\n\t\toptions: WithAddress<DoorLockLoggingCCRecordsSupportedReportOptions>,\n\t) {\n\t\tsuper(options);\n\n\t\t// TODO: Check implementation:\n\t\tthis.recordsCount = options.recordsCount;\n\t}\n\n\tpublic static from(\n\t\traw: CCRaw,\n\t\tctx: CCParsingContext,\n\t): DoorLockLoggingCCRecordsSupportedReport {\n\t\tvalidatePayload(raw.payload.length >= 1);\n\t\tconst recordsCount = raw.payload[0];\n\n\t\treturn new DoorLockLoggingCCRecordsSupportedReport({\n\t\t\tnodeId: ctx.sourceNodeId,\n\t\t\trecordsCount,\n\t\t});\n\t}\n\n\t@ccValue(DoorLockLoggingCCValues.recordsCount)\n\tpublic readonly recordsCount: number;\n\n\tpublic toLogEntry(ctx?: GetValueDB): MessageOrCCLogEntry {\n\t\treturn {\n\t\t\t...super.toLogEntry(ctx),\n\t\t\tmessage: {\n\t\t\t\t\"supported no. of records\": this.recordsCount,\n\t\t\t},\n\t\t};\n\t}\n}\n\nfunction eventTypeToLabel(eventType: DoorLockLoggingEventType): string {\n\treturn (\n\t\t(eventTypeLabel as any)[DoorLockLoggingEventType[eventType]]\n\t\t\t?? `Unknown ${num2hex(eventType)}`\n\t);\n}\n\n@CCCommand(DoorLockLoggingCommand.RecordsSupportedGet)\n@expectedCCResponse(DoorLockLoggingCCRecordsSupportedReport)\nexport class DoorLockLoggingCCRecordsSupportedGet extends DoorLockLoggingCC {}\n\n// @publicAPI\nexport interface DoorLockLoggingCCRecordReportOptions {\n\trecordNumber: number;\n\trecord?: DoorLockLoggingRecord;\n}\n\n@CCCommand(DoorLockLoggingCommand.RecordReport)\nexport class DoorLockLoggingCCRecordReport extends DoorLockLoggingCC {\n\tpublic constructor(\n\t\toptions: WithAddress<DoorLockLoggingCCRecordReportOptions>,\n\t) {\n\t\tsuper(options);\n\n\t\t// TODO: Check implementation:\n\t\tthis.recordNumber = options.recordNumber;\n\t\tthis.record = options.record;\n\t}\n\n\tpublic static from(\n\t\traw: CCRaw,\n\t\tctx: CCParsingContext,\n\t): DoorLockLoggingCCRecordReport {\n\t\tvalidatePayload(raw.payload.length >= 11);\n\t\tconst recordNumber = raw.payload[0];\n\t\tconst recordStatus = raw.payload[5] >>> 5;\n\t\tlet record: DoorLockLoggingRecord | undefined;\n\t\tif (recordStatus !== DoorLockLoggingRecordStatus.Empty) {\n\t\t\tconst dateSegments = {\n\t\t\t\tyear: raw.payload.readUInt16BE(1),\n\t\t\t\tmonth: raw.payload[3],\n\t\t\t\tday: raw.payload[4],\n\t\t\t\thour: raw.payload[5] & 0b11111,\n\t\t\t\tminute: raw.payload[6],\n\t\t\t\tsecond: raw.payload[7],\n\t\t\t};\n\n\t\t\tconst eventType = raw.payload[8];\n\t\t\tconst recordUserID = raw.payload[9];\n\t\t\tconst userCodeLength = raw.payload[10];\n\t\t\tvalidatePayload(\n\t\t\t\tuserCodeLength <= 10,\n\t\t\t\traw.payload.length >= 11 + userCodeLength,\n\t\t\t);\n\n\t\t\tconst userCodeBuffer = raw.payload.subarray(\n\t\t\t\t11,\n\t\t\t\t11 + userCodeLength,\n\t\t\t);\n\t\t\t// See User Code CC for a detailed description. We try to parse the code as ASCII if possible\n\t\t\t// and fall back to a buffer otherwise.\n\t\t\tconst userCodeString = userCodeBuffer.toString(\"utf8\");\n\t\t\tconst userCode = isPrintableASCII(userCodeString)\n\t\t\t\t? userCodeString\n\t\t\t\t: userCodeBuffer;\n\n\t\t\trecord = {\n\t\t\t\teventType: eventType,\n\t\t\t\tlabel: eventTypeToLabel(eventType),\n\t\t\t\ttimestamp: segmentsToDate(dateSegments).toISOString(),\n\t\t\t\tuserId: recordUserID,\n\t\t\t\tuserCode,\n\t\t\t};\n\t\t}\n\n\t\treturn new DoorLockLoggingCCRecordReport({\n\t\t\tnodeId: ctx.sourceNodeId,\n\t\t\trecordNumber,\n\t\t\trecord,\n\t\t});\n\t}\n\n\tpublic readonly recordNumber: number;\n\tpublic readonly record?: DoorLockLoggingRecord;\n\n\tpublic toLogEntry(ctx?: GetValueDB): MessageOrCCLogEntry {\n\t\tlet message: MessageRecord;\n\n\t\tif (!this.record) {\n\t\t\tmessage = {\n\t\t\t\t\"record #\": `${this.recordNumber} (empty)`,\n\t\t\t};\n\t\t} else {\n\t\t\tmessage = {\n\t\t\t\t\"record #\": `${this.recordNumber}`,\n\t\t\t\t\"event type\": this.record.label,\n\t\t\t\ttimestamp: this.record.timestamp,\n\t\t\t};\n\t\t\tif (this.record.userId) {\n\t\t\t\tmessage[\"user ID\"] = this.record.userId;\n\t\t\t}\n\t\t\tif (this.record.userCode) {\n\t\t\t\tmessage[\"user code\"] = userCodeToLogString(\n\t\t\t\t\tthis.record.userCode,\n\t\t\t\t);\n\t\t\t}\n\t\t}\n\t\treturn {\n\t\t\t...super.toLogEntry(ctx),\n\t\t\tmessage,\n\t\t};\n\t}\n}\n\n// @publicAPI\nexport interface DoorLockLoggingCCRecordGetOptions {\n\trecordNumber: number;\n}\n\nfunction testResponseForDoorLockLoggingRecordGet(\n\tsent: DoorLockLoggingCCRecordGet,\n\treceived: DoorLockLoggingCCRecordReport,\n) {\n\treturn (\n\t\tsent.recordNumber === LATEST_RECORD_NUMBER_KEY\n\t\t|| sent.recordNumber === received.recordNumber\n\t);\n}\n\n@CCCommand(DoorLockLoggingCommand.RecordGet)\n@expectedCCResponse(\n\tDoorLockLoggingCCRecordReport,\n\ttestResponseForDoorLockLoggingRecordGet,\n)\nexport class DoorLockLoggingCCRecordGet extends DoorLockLoggingCC {\n\tpublic constructor(\n\t\toptions: WithAddress<DoorLockLoggingCCRecordGetOptions>,\n\t) {\n\t\tsuper(options);\n\t\tthis.recordNumber = options.recordNumber;\n\t}\n\n\tpublic static from(\n\t\t_raw: CCRaw,\n\t\t_ctx: CCParsingContext,\n\t): DoorLockLoggingCCRecordGet {\n\t\tthrow new ZWaveError(\n\t\t\t`${this.name}: deserialization not implemented`,\n\t\t\tZWaveErrorCodes.Deserialization_NotImplemented,\n\t\t);\n\n\t\t// return new DoorLockLoggingCCRecordGet({\n\t\t// \tnodeId: ctx.sourceNodeId,\n\t\t// });\n\t}\n\n\tpublic recordNumber: number;\n\n\tpublic serialize(ctx: CCEncodingContext): Bytes {\n\t\tthis.payload = Bytes.from([this.recordNumber]);\n\t\treturn super.serialize(ctx);\n\t}\n\n\tpublic toLogEntry(ctx?: GetValueDB): MessageOrCCLogEntry {\n\t\treturn {\n\t\t\t...super.toLogEntry(ctx),\n\t\t\tmessage: { \"record number\": this.recordNumber },\n\t\t};\n\t}\n}\n"],
5
- "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,kBAUO;AAMP,IAAAA,eAAsB;AACtB,IAAAA,eAA0C;AAE1C,iBAAqC;AACrC,0BAKO;AACP,oCAQO;AACP,oBAAkB;AAClB,mBAKO;AACP,wBAAoC;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAWpC,SAAS,eAAe,UAAsB;AAC7C,SAAO,IAAI;IACV,SAAS;IACT,SAAS,QAAQ;;IACjB,SAAS;IACT,SAAS;IACT,SAAS;IAC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;AAEtB,UAAM,IAAI,uBACT,GAAG,KAAK,IAAI,qCACZ,4BAAgB,8BAA8B;EAMhD;EAEO;EAEA,UAAU,KAAsB;AACtC,SAAK,UAAU,mBAAM,KAAK,CAAC,KAAK,YAAY,CAAC;AAC7C,WAAO,MAAM,UAAU,GAAG;EAC3B;EAEO,WAAW,KAAgB;AACjC,WAAO;MACN,GAAG,MAAM,WAAW,GAAG;MACvB,SAAS,EAAE,iBAAiB,KAAK,aAAY;;EAE/C;;AAlCY,6BAA0B,WAAA;MALtC,yCAAU,oCAAuB,SAAS;MAC1C,kDACA,+BACA,uCAAuC;GAE3B,0BAA0B;",
6
- "names": ["import_safe", "DoorLockLoggingCCAPI", "DoorLockLoggingCC", "DoorLockLoggingCCRecordsSupportedReport", "DoorLockLoggingCCRecordsSupportedGet", "DoorLockLoggingCCRecordReport", "DoorLockLoggingCCRecordGet"]
4
+ "sourcesContent": ["import {\n\tCommandClasses,\n\ttype MaybeNotKnown,\n\ttype MessageOrCCLogEntry,\n\tMessagePriority,\n\ttype MessageRecord,\n\ttype WithAddress,\n\tZWaveError,\n\tZWaveErrorCodes,\n\tvalidatePayload,\n} from \"@zwave-js/core/safe\";\nimport type {\n\tCCEncodingContext,\n\tCCParsingContext,\n\tGetValueDB,\n} from \"@zwave-js/host/safe\";\nimport { Bytes } from \"@zwave-js/shared/safe\";\nimport { isPrintableASCII, num2hex } from \"@zwave-js/shared/safe\";\nimport { validateArgs } from \"@zwave-js/transformers\";\nimport { CCAPI, PhysicalCCAPI } from \"../lib/API.js\";\nimport {\n\ttype CCRaw,\n\tCommandClass,\n\ttype InterviewContext,\n\ttype RefreshValuesContext,\n} from \"../lib/CommandClass.js\";\nimport {\n\tAPI,\n\tCCCommand,\n\tccValueProperty,\n\tccValues,\n\tcommandClass,\n\texpectedCCResponse,\n\timplementedVersion,\n} from \"../lib/CommandClassDecorators.js\";\nimport { V } from \"../lib/Values.js\";\nimport {\n\tDoorLockLoggingCommand,\n\tDoorLockLoggingEventType,\n\ttype DoorLockLoggingRecord,\n\tDoorLockLoggingRecordStatus,\n} from \"../lib/_Types.js\";\nimport { userCodeToLogString } from \"./UserCodeCC.js\";\n\ninterface DateSegments {\n\tyear: number;\n\tmonth: number;\n\tday: number;\n\thour: number;\n\tminute: number;\n\tsecond: number;\n}\n\nfunction segmentsToDate(segments: DateSegments): Date {\n\treturn new Date(\n\t\tsegments.year,\n\t\tsegments.month - 1, // JS months are 0-based.\n\t\tsegments.day,\n\t\tsegments.hour,\n\t\tsegments.minute,\n\t\tsegments.second,\n\t);\n}\n\nconst eventTypeLabel = {\n\tLockCode: \"Locked via Access Code\",\n\tUnlockCode: \"Unlocked via Access Code\",\n\tLockButton: \"Locked via Lock Button\",\n\tUnlockButton: \"Unlocked via Unlock Button\",\n\tLockCodeOutOfSchedule: \"Out of Schedule Lock Attempt via Access Code\",\n\tUnlockCodeOutOfSchedule: \"Out of Schedule Unlock Attempt via Access Code\",\n\tIllegalCode: \"Illegal Access Code Entered\",\n\tLockManual: \"Manually Locked\",\n\tUnlockManual: \"Manually Unlocked\",\n\tLockAuto: \"Auto Locked\",\n\tUnlockAuto: \"Auto Unlocked\",\n\tLockRemoteCode: \"Locked via Remote Access Code\",\n\tUnlockRemoteCode: \"Unlocked via Remote Access Code\",\n\tLockRemote: \"Locked via Remote\",\n\tUnlockRemote: \"Unlocked via Remote\",\n\tLockRemoteCodeOutOfSchedule:\n\t\t\"Out of Schedule Lock Attempt via Remote Access Code\",\n\tUnlockRemoteCodeOutOfSchedule:\n\t\t\"Out of Schedule Unlock Attempt via Remote Access Code\",\n\tRemoteIllegalCode: \"Illegal Remote Access Code\",\n\tLockManual2: \"Manually Locked (2)\",\n\tUnlockManual2: \"Manually Unlocked (2)\",\n\tLockSecured: \"Lock Secured\",\n\tLockUnsecured: \"Lock Unsecured\",\n\tUserCodeAdded: \"User Code Added\",\n\tUserCodeDeleted: \"User Code Deleted\",\n\tAllUserCodesDeleted: \"All User Codes Deleted\",\n\tAdminCodeChanged: \"Admin Code Changed\",\n\tUserCodeChanged: \"User Code Changed\",\n\tLockReset: \"Lock Reset\",\n\tConfigurationChanged: \"Configuration Changed\",\n\tLowBattery: \"Low Battery\",\n\tNewBattery: \"New Battery Installed\",\n\tUnknown: \"Unknown\",\n} as const;\n\nconst LATEST_RECORD_NUMBER_KEY = 0;\n\nexport const DoorLockLoggingCCValues = Object.freeze({\n\t...V.defineStaticCCValues(CommandClasses[\"Door Lock Logging\"], {\n\t\t...V.staticProperty(\"recordsCount\", undefined, { internal: true }),\n\t}),\n});\n\n@API(CommandClasses[\"Door Lock Logging\"])\nexport class DoorLockLoggingCCAPI extends PhysicalCCAPI {\n\tpublic supportsCommand(\n\t\tcmd: DoorLockLoggingCommand,\n\t): MaybeNotKnown<boolean> {\n\t\tswitch (cmd) {\n\t\t\tcase DoorLockLoggingCommand.RecordsSupportedGet:\n\t\t\tcase DoorLockLoggingCommand.RecordsSupportedReport:\n\t\t\tcase DoorLockLoggingCommand.RecordGet:\n\t\t\tcase DoorLockLoggingCommand.RecordReport:\n\t\t\t\treturn true;\n\t\t}\n\t\treturn super.supportsCommand(cmd);\n\t}\n\n\tpublic async getRecordsCount(): Promise<MaybeNotKnown<number>> {\n\t\tthis.assertSupportsCommand(\n\t\t\tDoorLockLoggingCommand,\n\t\t\tDoorLockLoggingCommand.RecordsSupportedGet,\n\t\t);\n\n\t\tconst cc = new DoorLockLoggingCCRecordsSupportedGet({\n\t\t\tnodeId: this.endpoint.nodeId,\n\t\t\tendpointIndex: this.endpoint.index,\n\t\t});\n\t\tconst response = await this.host.sendCommand<\n\t\t\tDoorLockLoggingCCRecordsSupportedReport\n\t\t>(\n\t\t\tcc,\n\t\t\tthis.commandOptions,\n\t\t);\n\t\treturn response?.recordsCount;\n\t}\n\n\t/** Retrieves the specified audit record. Defaults to the latest one. */\n\t@validateArgs()\n\tpublic async getRecord(\n\t\trecordNumber: number = LATEST_RECORD_NUMBER_KEY,\n\t): Promise<MaybeNotKnown<DoorLockLoggingRecord>> {\n\t\tthis.assertSupportsCommand(\n\t\t\tDoorLockLoggingCommand,\n\t\t\tDoorLockLoggingCommand.RecordGet,\n\t\t);\n\n\t\tconst cc = new DoorLockLoggingCCRecordGet({\n\t\t\tnodeId: this.endpoint.nodeId,\n\t\t\tendpointIndex: this.endpoint.index,\n\t\t\trecordNumber,\n\t\t});\n\t\tconst response = await this.host.sendCommand<\n\t\t\tDoorLockLoggingCCRecordReport\n\t\t>(\n\t\t\tcc,\n\t\t\tthis.commandOptions,\n\t\t);\n\t\treturn response?.record;\n\t}\n}\n\n@commandClass(CommandClasses[\"Door Lock Logging\"])\n@implementedVersion(1)\n@ccValues(DoorLockLoggingCCValues)\nexport class DoorLockLoggingCC extends CommandClass {\n\tdeclare ccCommand: DoorLockLoggingCommand;\n\n\tpublic async interview(\n\t\tctx: InterviewContext,\n\t): Promise<void> {\n\t\tconst node = this.getNode(ctx)!;\n\n\t\tctx.logNode(node.id, {\n\t\t\tendpoint: this.endpointIndex,\n\t\t\tmessage: `Interviewing ${this.ccName}...`,\n\t\t\tdirection: \"none\",\n\t\t});\n\n\t\tawait this.refreshValues(ctx);\n\n\t\t// Remember that the interview is complete\n\t\tthis.setInterviewComplete(ctx, true);\n\t}\n\n\tpublic async refreshValues(\n\t\tctx: RefreshValuesContext,\n\t): Promise<void> {\n\t\tconst node = this.getNode(ctx)!;\n\t\tconst endpoint = this.getEndpoint(ctx)!;\n\t\tconst api = CCAPI.create(\n\t\t\tCommandClasses[\"Door Lock Logging\"],\n\t\t\tctx,\n\t\t\tendpoint,\n\t\t).withOptions({\n\t\t\tpriority: MessagePriority.NodeQuery,\n\t\t});\n\n\t\tctx.logNode(node.id, {\n\t\t\tendpoint: this.endpointIndex,\n\t\t\tmessage: \"querying supported number of records...\",\n\t\t\tdirection: \"outbound\",\n\t\t});\n\t\tconst recordsCount = await api.getRecordsCount();\n\n\t\tif (!recordsCount) {\n\t\t\tctx.logNode(node.id, {\n\t\t\t\tendpoint: this.endpointIndex,\n\t\t\t\tmessage:\n\t\t\t\t\t\"Door Lock Logging records count query timed out, skipping interview...\",\n\t\t\t\tlevel: \"warn\",\n\t\t\t});\n\t\t\treturn;\n\t\t}\n\n\t\tconst recordsCountLogMessage = `supports ${recordsCount} record${\n\t\t\trecordsCount === 1 ? \"\" : \"s\"\n\t\t}`;\n\t\tctx.logNode(node.id, {\n\t\t\tendpoint: this.endpointIndex,\n\t\t\tmessage: recordsCountLogMessage,\n\t\t\tdirection: \"inbound\",\n\t\t});\n\t}\n}\n\n// @publicAPI\nexport interface DoorLockLoggingCCRecordsSupportedReportOptions {\n\trecordsCount: number;\n}\n\n@CCCommand(DoorLockLoggingCommand.RecordsSupportedReport)\n@ccValueProperty(\"recordsCount\", DoorLockLoggingCCValues.recordsCount)\nexport class DoorLockLoggingCCRecordsSupportedReport extends DoorLockLoggingCC {\n\tpublic constructor(\n\t\toptions: WithAddress<DoorLockLoggingCCRecordsSupportedReportOptions>,\n\t) {\n\t\tsuper(options);\n\n\t\t// TODO: Check implementation:\n\t\tthis.recordsCount = options.recordsCount;\n\t}\n\n\tpublic static from(\n\t\traw: CCRaw,\n\t\tctx: CCParsingContext,\n\t): DoorLockLoggingCCRecordsSupportedReport {\n\t\tvalidatePayload(raw.payload.length >= 1);\n\t\tconst recordsCount = raw.payload[0];\n\n\t\treturn new this({\n\t\t\tnodeId: ctx.sourceNodeId,\n\t\t\trecordsCount,\n\t\t});\n\t}\n\n\tpublic readonly recordsCount: number;\n\n\tpublic toLogEntry(ctx?: GetValueDB): MessageOrCCLogEntry {\n\t\treturn {\n\t\t\t...super.toLogEntry(ctx),\n\t\t\tmessage: {\n\t\t\t\t\"supported no. of records\": this.recordsCount,\n\t\t\t},\n\t\t};\n\t}\n}\n\nfunction eventTypeToLabel(eventType: DoorLockLoggingEventType): string {\n\treturn (\n\t\t(eventTypeLabel as any)[DoorLockLoggingEventType[eventType]]\n\t\t\t?? `Unknown ${num2hex(eventType)}`\n\t);\n}\n\n@CCCommand(DoorLockLoggingCommand.RecordsSupportedGet)\n@expectedCCResponse(DoorLockLoggingCCRecordsSupportedReport)\nexport class DoorLockLoggingCCRecordsSupportedGet extends DoorLockLoggingCC {}\n\n// @publicAPI\nexport interface DoorLockLoggingCCRecordReportOptions {\n\trecordNumber: number;\n\trecord?: DoorLockLoggingRecord;\n}\n\n@CCCommand(DoorLockLoggingCommand.RecordReport)\nexport class DoorLockLoggingCCRecordReport extends DoorLockLoggingCC {\n\tpublic constructor(\n\t\toptions: WithAddress<DoorLockLoggingCCRecordReportOptions>,\n\t) {\n\t\tsuper(options);\n\n\t\t// TODO: Check implementation:\n\t\tthis.recordNumber = options.recordNumber;\n\t\tthis.record = options.record;\n\t}\n\n\tpublic static from(\n\t\traw: CCRaw,\n\t\tctx: CCParsingContext,\n\t): DoorLockLoggingCCRecordReport {\n\t\tvalidatePayload(raw.payload.length >= 11);\n\t\tconst recordNumber = raw.payload[0];\n\t\tconst recordStatus = raw.payload[5] >>> 5;\n\t\tlet record: DoorLockLoggingRecord | undefined;\n\t\tif (recordStatus !== DoorLockLoggingRecordStatus.Empty) {\n\t\t\tconst dateSegments = {\n\t\t\t\tyear: raw.payload.readUInt16BE(1),\n\t\t\t\tmonth: raw.payload[3],\n\t\t\t\tday: raw.payload[4],\n\t\t\t\thour: raw.payload[5] & 0b11111,\n\t\t\t\tminute: raw.payload[6],\n\t\t\t\tsecond: raw.payload[7],\n\t\t\t};\n\n\t\t\tconst eventType = raw.payload[8];\n\t\t\tconst recordUserID = raw.payload[9];\n\t\t\tconst userCodeLength = raw.payload[10];\n\t\t\tvalidatePayload(\n\t\t\t\tuserCodeLength <= 10,\n\t\t\t\traw.payload.length >= 11 + userCodeLength,\n\t\t\t);\n\n\t\t\tconst userCodeBuffer = raw.payload.subarray(\n\t\t\t\t11,\n\t\t\t\t11 + userCodeLength,\n\t\t\t);\n\t\t\t// See User Code CC for a detailed description. We try to parse the code as ASCII if possible\n\t\t\t// and fall back to a buffer otherwise.\n\t\t\tconst userCodeString = userCodeBuffer.toString(\"utf8\");\n\t\t\tconst userCode = isPrintableASCII(userCodeString)\n\t\t\t\t? userCodeString\n\t\t\t\t: userCodeBuffer;\n\n\t\t\trecord = {\n\t\t\t\teventType: eventType,\n\t\t\t\tlabel: eventTypeToLabel(eventType),\n\t\t\t\ttimestamp: segmentsToDate(dateSegments).toISOString(),\n\t\t\t\tuserId: recordUserID,\n\t\t\t\tuserCode,\n\t\t\t};\n\t\t}\n\n\t\treturn new this({\n\t\t\tnodeId: ctx.sourceNodeId,\n\t\t\trecordNumber,\n\t\t\trecord,\n\t\t});\n\t}\n\n\tpublic readonly recordNumber: number;\n\tpublic readonly record?: DoorLockLoggingRecord;\n\n\tpublic toLogEntry(ctx?: GetValueDB): MessageOrCCLogEntry {\n\t\tlet message: MessageRecord;\n\n\t\tif (!this.record) {\n\t\t\tmessage = {\n\t\t\t\t\"record #\": `${this.recordNumber} (empty)`,\n\t\t\t};\n\t\t} else {\n\t\t\tmessage = {\n\t\t\t\t\"record #\": `${this.recordNumber}`,\n\t\t\t\t\"event type\": this.record.label,\n\t\t\t\ttimestamp: this.record.timestamp,\n\t\t\t};\n\t\t\tif (this.record.userId) {\n\t\t\t\tmessage[\"user ID\"] = this.record.userId;\n\t\t\t}\n\t\t\tif (this.record.userCode) {\n\t\t\t\tmessage[\"user code\"] = userCodeToLogString(\n\t\t\t\t\tthis.record.userCode,\n\t\t\t\t);\n\t\t\t}\n\t\t}\n\t\treturn {\n\t\t\t...super.toLogEntry(ctx),\n\t\t\tmessage,\n\t\t};\n\t}\n}\n\n// @publicAPI\nexport interface DoorLockLoggingCCRecordGetOptions {\n\trecordNumber: number;\n}\n\nfunction testResponseForDoorLockLoggingRecordGet(\n\tsent: DoorLockLoggingCCRecordGet,\n\treceived: DoorLockLoggingCCRecordReport,\n) {\n\treturn (\n\t\tsent.recordNumber === LATEST_RECORD_NUMBER_KEY\n\t\t|| sent.recordNumber === received.recordNumber\n\t);\n}\n\n@CCCommand(DoorLockLoggingCommand.RecordGet)\n@expectedCCResponse(\n\tDoorLockLoggingCCRecordReport,\n\ttestResponseForDoorLockLoggingRecordGet,\n)\nexport class DoorLockLoggingCCRecordGet extends DoorLockLoggingCC {\n\tpublic constructor(\n\t\toptions: WithAddress<DoorLockLoggingCCRecordGetOptions>,\n\t) {\n\t\tsuper(options);\n\t\tthis.recordNumber = options.recordNumber;\n\t}\n\n\tpublic static from(\n\t\t_raw: CCRaw,\n\t\t_ctx: CCParsingContext,\n\t): DoorLockLoggingCCRecordGet {\n\t\tthrow new ZWaveError(\n\t\t\t`${this.name}: deserialization not implemented`,\n\t\t\tZWaveErrorCodes.Deserialization_NotImplemented,\n\t\t);\n\n\t\t// return new DoorLockLoggingCCRecordGet({\n\t\t// \tnodeId: ctx.sourceNodeId,\n\t\t// });\n\t}\n\n\tpublic recordNumber: number;\n\n\tpublic serialize(ctx: CCEncodingContext): Bytes {\n\t\tthis.payload = Bytes.from([this.recordNumber]);\n\t\treturn super.serialize(ctx);\n\t}\n\n\tpublic toLogEntry(ctx?: GetValueDB): MessageOrCCLogEntry {\n\t\treturn {\n\t\t\t...super.toLogEntry(ctx),\n\t\t\tmessage: { \"record number\": this.recordNumber },\n\t\t};\n\t}\n}\n"],
5
+ "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,kBAUO;AAMP,IAAAA,eAAsB;AACtB,IAAAA,eAA0C;AAE1C,iBAAqC;AACrC,0BAKO;AACP,oCAQO;AACP,oBAAkB;AAClB,mBAKO;AACP,wBAAoC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAWpC,SAAS,eAAe,UAAsB;AAC7C,SAAO,IAAI;IACV,SAAS;IACT,SAAS,QAAQ;;IACjB,SAAS;IACT,SAAS;IACT,SAAS;IACT,SAAS;EAAM;AAEjB;AAEA,MAAM,iBAAiB;EACtB,UAAU;EACV,YAAY;EACZ,YAAY;EACZ,cAAc;EACd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Y,GAAG,KAAK,YAAY;UAChC,cAAc,KAAK,OAAO;UAC1B,WAAW,KAAK,OAAO;;AAExB,YAAI,KAAK,OAAO,QAAQ;AACvB,kBAAQ,SAAS,IAAI,KAAK,OAAO;QAClC;AACA,YAAI,KAAK,OAAO,UAAU;AACzB,kBAAQ,WAAW,QAAI,uCACtB,KAAK,OAAO,QAAQ;QAEtB;MACD;AACA,aAAO;QACN,GAAG,MAAM,WAAW,GAAG;QACvB;;IAEF;;;;AAQD,SAAS,wCACR,MACA,UAAuC;AAEvC,SACC,KAAK,iBAAiB,4BACnB,KAAK,iBAAiB,SAAS;AAEpC;IAOa,8BAA0B,MAAA;8BALtC,yCAAU,oCAAuB,SAAS,OAC1C,kDACA,+BACA,uCAAuC,CACvC;;;;oBAC+C;kDAAA,YAAiB;;;;;;AAAjE,mBAAA,MAAA,mBAAA,EAAA,OAAA,WAAA,GAAA,kBAAA,EAAA,MAAA,SAAA,MAAA,WAAA,MAAA,UAAA,UAAA,GAAA,MAAA,uBAAA;;;AAAa,wBAAA,YAAA,uBAAA;;IACZ,YACC,SAAuD;AAEvD,YAAM,OAAO;AACb,WAAK,eAAe,QAAQ;IAC7B;IAEO,OAAO,KACb,MACA,MAAsB;AAEtB,YAAM,IAAI,uBACT,GAAG,KAAK,IAAI,qCACZ,4BAAgB,8BAA8B;IAMhD;IAEO;IAEA,UAAU,KAAsB;AACtC,WAAK,UAAU,mBAAM,KAAK,CAAC,KAAK,YAAY,CAAC;AAC7C,aAAO,MAAM,UAAU,GAAG;IAC3B;IAEO,WAAW,KAAgB;AACjC,aAAO;QACN,GAAG,MAAM,WAAW,GAAG;QACvB,SAAS,EAAE,iBAAiB,KAAK,aAAY;;IAE/C;;;;",
6
+ "names": ["import_safe"]
7
7
  }
@@ -32,13 +32,45 @@ var import_CommandClass = require("../lib/CommandClass.js");
32
32
  var import_CommandClassDecorators = require("../lib/CommandClassDecorators.js");
33
33
  var import_Values = require("../lib/Values.js");
34
34
  var import_Types = require("../lib/_Types.js");
35
- var __decorate = function(decorators, target, key, desc) {
36
- var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
37
- if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
38
- 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;
39
- return c > 3 && r && Object.defineProperty(target, key, r), r;
35
+ var __esDecorate = function(ctor, descriptorIn, decorators, contextIn, initializers, extraInitializers) {
36
+ function accept(f) {
37
+ if (f !== void 0 && typeof f !== "function") throw new TypeError("Function expected");
38
+ return f;
39
+ }
40
+ var kind = contextIn.kind, key = kind === "getter" ? "get" : kind === "setter" ? "set" : "value";
41
+ var target = !descriptorIn && ctor ? contextIn["static"] ? ctor : ctor.prototype : null;
42
+ var descriptor = descriptorIn || (target ? Object.getOwnPropertyDescriptor(target, contextIn.name) : {});
43
+ var _, done = false;
44
+ for (var i = decorators.length - 1; i >= 0; i--) {
45
+ var context = {};
46
+ for (var p in contextIn) context[p] = p === "access" ? {} : contextIn[p];
47
+ for (var p in contextIn.access) context.access[p] = contextIn.access[p];
48
+ context.addInitializer = function(f) {
49
+ if (done) throw new TypeError("Cannot add initializers after decoration has completed");
50
+ extraInitializers.push(accept(f || null));
51
+ };
52
+ var result = (0, decorators[i])(kind === "accessor" ? { get: descriptor.get, set: descriptor.set } : descriptor[key], context);
53
+ if (kind === "accessor") {
54
+ if (result === void 0) continue;
55
+ if (result === null || typeof result !== "object") throw new TypeError("Object expected");
56
+ if (_ = accept(result.get)) descriptor.get = _;
57
+ if (_ = accept(result.set)) descriptor.set = _;
58
+ if (_ = accept(result.init)) initializers.unshift(_);
59
+ } else if (_ = accept(result)) {
60
+ if (kind === "field") initializers.unshift(_);
61
+ else descriptor[key] = _;
62
+ }
63
+ }
64
+ if (target) Object.defineProperty(target, contextIn.name, descriptor);
65
+ done = true;
66
+ };
67
+ var __runInitializers = function(thisArg, initializers, value) {
68
+ var useValue = arguments.length > 2;
69
+ for (var i = 0; i < initializers.length; i++) {
70
+ value = useValue ? initializers[i].call(thisArg, value) : initializers[i].call(thisArg);
71
+ }
72
+ return useValue ? value : void 0;
40
73
  };
41
- var EnergyProductionCCReport_1, EnergyProductionCCGet_1;
42
74
  function __assertType(argName, typeName, boundHasError) {
43
75
  const { ZWaveError, ZWaveErrorCodes } = require("@zwave-js/core");
44
76
  if (boundHasError()) {
@@ -64,171 +96,228 @@ const EnergyProductionCCValues = Object.freeze({
64
96
  }))
65
97
  })
66
98
  });
67
- let EnergyProductionCCAPI = class EnergyProductionCCAPI2 extends import_API.CCAPI {
68
- supportsCommand(cmd) {
69
- switch (cmd) {
70
- case import_Types.EnergyProductionCommand.Get:
71
- return true;
99
+ let EnergyProductionCCAPI = (() => {
100
+ let _classDecorators = [(0, import_CommandClassDecorators.API)(import_core.CommandClasses["Energy Production"])];
101
+ let _classDescriptor;
102
+ let _classExtraInitializers = [];
103
+ let _classThis;
104
+ let _classSuper = import_API.CCAPI;
105
+ var EnergyProductionCCAPI2 = class extends _classSuper {
106
+ static {
107
+ _classThis = this;
72
108
  }
73
- return super.supportsCommand(cmd);
74
- }
75
- get [import_API.POLL_VALUE]() {
76
- return async function({ property, propertyKey }) {
77
- if (EnergyProductionCCValues.value.is({
78
- commandClass: this.ccId,
79
- property,
80
- propertyKey
81
- })) {
82
- return (await this.get(property))?.value;
83
- } else {
84
- (0, import_API.throwUnsupportedProperty)(this.ccId, property);
109
+ static {
110
+ const _metadata = typeof Symbol === "function" && Symbol.metadata ? Object.create(_classSuper[Symbol.metadata] ?? null) : void 0;
111
+ __esDecorate(null, _classDescriptor = { value: _classThis }, _classDecorators, { kind: "class", name: _classThis.name, metadata: _metadata }, null, _classExtraInitializers);
112
+ EnergyProductionCCAPI2 = _classThis = _classDescriptor.value;
113
+ if (_metadata) Object.defineProperty(_classThis, Symbol.metadata, { enumerable: true, configurable: true, writable: true, value: _metadata });
114
+ __runInitializers(_classThis, _classExtraInitializers);
115
+ }
116
+ supportsCommand(cmd) {
117
+ switch (cmd) {
118
+ case import_Types.EnergyProductionCommand.Get:
119
+ return true;
85
120
  }
86
- };
87
- }
88
- async get(parameter) {
89
- __assertType("parameter", "EnergyProductionParameter", __assertType__EnergyProductionParameter.bind(void 0, parameter));
90
- this.assertSupportsCommand(import_Types.EnergyProductionCommand, import_Types.EnergyProductionCommand.Get);
91
- const cc = new EnergyProductionCCGet({
92
- nodeId: this.endpoint.nodeId,
93
- endpointIndex: this.endpoint.index,
94
- parameter
95
- });
96
- const response = await this.host.sendCommand(cc, this.commandOptions);
97
- if (response) {
98
- return (0, import_shared.pick)(response, ["value", "scale"]);
121
+ return super.supportsCommand(cmd);
99
122
  }
100
- }
101
- };
102
- EnergyProductionCCAPI = __decorate([
103
- (0, import_CommandClassDecorators.API)(import_core.CommandClasses["Energy Production"])
104
- ], EnergyProductionCCAPI);
105
- let EnergyProductionCC = class EnergyProductionCC2 extends import_CommandClass.CommandClass {
106
- async interview(ctx) {
107
- const node = this.getNode(ctx);
108
- ctx.logNode(node.id, {
109
- endpoint: this.endpointIndex,
110
- message: `Interviewing ${this.ccName}...`,
111
- direction: "none"
112
- });
113
- await this.refreshValues(ctx);
114
- this.setInterviewComplete(ctx, true);
115
- }
116
- async refreshValues(ctx) {
117
- const node = this.getNode(ctx);
118
- const endpoint = this.getEndpoint(ctx);
119
- const api = import_API.CCAPI.create(import_core.CommandClasses["Energy Production"], ctx, endpoint).withOptions({
120
- priority: import_core.MessagePriority.NodeQuery
121
- });
122
- for (const parameter of [
123
- import_Types.EnergyProductionParameter.Power,
124
- import_Types.EnergyProductionParameter["Production Total"],
125
- import_Types.EnergyProductionParameter["Production Today"],
126
- import_Types.EnergyProductionParameter["Total Time"]
127
- ]) {
123
+ get [import_API.POLL_VALUE]() {
124
+ return async function({ property, propertyKey }) {
125
+ if (EnergyProductionCCValues.value.is({
126
+ commandClass: this.ccId,
127
+ property,
128
+ propertyKey
129
+ })) {
130
+ return (await this.get(property))?.value;
131
+ } else {
132
+ (0, import_API.throwUnsupportedProperty)(this.ccId, property);
133
+ }
134
+ };
135
+ }
136
+ async get(parameter) {
137
+ __assertType("parameter", "EnergyProductionParameter", __assertType__EnergyProductionParameter.bind(void 0, parameter));
138
+ this.assertSupportsCommand(import_Types.EnergyProductionCommand, import_Types.EnergyProductionCommand.Get);
139
+ const cc = new EnergyProductionCCGet({
140
+ nodeId: this.endpoint.nodeId,
141
+ endpointIndex: this.endpoint.index,
142
+ parameter
143
+ });
144
+ const response = await this.host.sendCommand(cc, this.commandOptions);
145
+ if (response) {
146
+ return (0, import_shared.pick)(response, ["value", "scale"]);
147
+ }
148
+ }
149
+ };
150
+ return EnergyProductionCCAPI2 = _classThis;
151
+ })();
152
+ let EnergyProductionCC = (() => {
153
+ let _classDecorators = [(0, import_CommandClassDecorators.commandClass)(import_core.CommandClasses["Energy Production"]), (0, import_CommandClassDecorators.implementedVersion)(1), (0, import_CommandClassDecorators.ccValues)(EnergyProductionCCValues)];
154
+ let _classDescriptor;
155
+ let _classExtraInitializers = [];
156
+ let _classThis;
157
+ let _classSuper = import_CommandClass.CommandClass;
158
+ var EnergyProductionCC2 = class extends _classSuper {
159
+ static {
160
+ _classThis = this;
161
+ }
162
+ static {
163
+ const _metadata = typeof Symbol === "function" && Symbol.metadata ? Object.create(_classSuper[Symbol.metadata] ?? null) : void 0;
164
+ __esDecorate(null, _classDescriptor = { value: _classThis }, _classDecorators, { kind: "class", name: _classThis.name, metadata: _metadata }, null, _classExtraInitializers);
165
+ EnergyProductionCC2 = _classThis = _classDescriptor.value;
166
+ if (_metadata) Object.defineProperty(_classThis, Symbol.metadata, { enumerable: true, configurable: true, writable: true, value: _metadata });
167
+ __runInitializers(_classThis, _classExtraInitializers);
168
+ }
169
+ async interview(ctx) {
170
+ const node = this.getNode(ctx);
128
171
  ctx.logNode(node.id, {
129
172
  endpoint: this.endpointIndex,
130
- message: `querying energy production (${(0, import_shared.getEnumMemberName)(import_Types.EnergyProductionParameter, parameter)})...`,
131
- direction: "outbound"
173
+ message: `Interviewing ${this.ccName}...`,
174
+ direction: "none"
132
175
  });
133
- await api.get(parameter);
176
+ await this.refreshValues(ctx);
177
+ this.setInterviewComplete(ctx, true);
134
178
  }
135
- }
136
- };
137
- EnergyProductionCC = __decorate([
138
- (0, import_CommandClassDecorators.commandClass)(import_core.CommandClasses["Energy Production"]),
139
- (0, import_CommandClassDecorators.implementedVersion)(1),
140
- (0, import_CommandClassDecorators.ccValues)(EnergyProductionCCValues)
141
- ], EnergyProductionCC);
142
- let EnergyProductionCCReport = EnergyProductionCCReport_1 = class EnergyProductionCCReport2 extends EnergyProductionCC {
143
- constructor(options) {
144
- super(options);
145
- this.parameter = options.parameter;
146
- this.value = options.value;
147
- this.scale = options.scale;
148
- }
149
- static from(raw, ctx) {
150
- (0, import_core.validatePayload)(raw.payload.length >= 2);
151
- const parameter = raw.payload[0];
152
- const { value, scale: rawScale } = (0, import_core.parseFloatWithScale)(raw.payload.subarray(1));
153
- const scale = (0, import_Types.getEnergyProductionScale)(parameter, rawScale);
154
- return new EnergyProductionCCReport_1({
155
- nodeId: ctx.sourceNodeId,
156
- parameter,
157
- value,
158
- scale
159
- });
160
- }
161
- parameter;
162
- scale;
163
- value;
164
- persistValues(ctx) {
165
- if (!super.persistValues(ctx))
166
- return false;
167
- const valueValue = EnergyProductionCCValues.value(this.parameter);
168
- this.setMetadata(ctx, valueValue, {
169
- ...valueValue.meta,
170
- unit: this.scale.unit,
171
- ccSpecific: {
172
- parameter: this.parameter,
173
- scale: this.scale.key
174
- }
175
- });
176
- this.setValue(ctx, valueValue, this.value);
177
- return true;
178
- }
179
- serialize(ctx) {
180
- this.payload = import_shared.Bytes.concat([
181
- import_shared.Bytes.from([this.parameter]),
182
- (0, import_core.encodeFloatWithScale)(this.value, this.scale.key)
183
- ]);
184
- return super.serialize(ctx);
185
- }
186
- toLogEntry(ctx) {
187
- return {
188
- ...super.toLogEntry(ctx),
189
- message: {
190
- [(0, import_shared.getEnumMemberName)(import_Types.EnergyProductionParameter, this.parameter).toLowerCase()]: `${this.value} ${this.scale.unit}`
179
+ async refreshValues(ctx) {
180
+ const node = this.getNode(ctx);
181
+ const endpoint = this.getEndpoint(ctx);
182
+ const api = import_API.CCAPI.create(import_core.CommandClasses["Energy Production"], ctx, endpoint).withOptions({
183
+ priority: import_core.MessagePriority.NodeQuery
184
+ });
185
+ for (const parameter of [
186
+ import_Types.EnergyProductionParameter.Power,
187
+ import_Types.EnergyProductionParameter["Production Total"],
188
+ import_Types.EnergyProductionParameter["Production Today"],
189
+ import_Types.EnergyProductionParameter["Total Time"]
190
+ ]) {
191
+ ctx.logNode(node.id, {
192
+ endpoint: this.endpointIndex,
193
+ message: `querying energy production (${(0, import_shared.getEnumMemberName)(import_Types.EnergyProductionParameter, parameter)})...`,
194
+ direction: "outbound"
195
+ });
196
+ await api.get(parameter);
191
197
  }
192
- };
193
- }
194
- };
195
- EnergyProductionCCReport = EnergyProductionCCReport_1 = __decorate([
196
- (0, import_CommandClassDecorators.CCCommand)(import_Types.EnergyProductionCommand.Report)
197
- ], EnergyProductionCCReport);
198
+ }
199
+ };
200
+ return EnergyProductionCC2 = _classThis;
201
+ })();
202
+ let EnergyProductionCCReport = (() => {
203
+ let _classDecorators = [(0, import_CommandClassDecorators.CCCommand)(import_Types.EnergyProductionCommand.Report)];
204
+ let _classDescriptor;
205
+ let _classExtraInitializers = [];
206
+ let _classThis;
207
+ let _classSuper = EnergyProductionCC;
208
+ var EnergyProductionCCReport2 = class extends _classSuper {
209
+ static {
210
+ _classThis = this;
211
+ }
212
+ static {
213
+ const _metadata = typeof Symbol === "function" && Symbol.metadata ? Object.create(_classSuper[Symbol.metadata] ?? null) : void 0;
214
+ __esDecorate(null, _classDescriptor = { value: _classThis }, _classDecorators, { kind: "class", name: _classThis.name, metadata: _metadata }, null, _classExtraInitializers);
215
+ EnergyProductionCCReport2 = _classThis = _classDescriptor.value;
216
+ if (_metadata) Object.defineProperty(_classThis, Symbol.metadata, { enumerable: true, configurable: true, writable: true, value: _metadata });
217
+ __runInitializers(_classThis, _classExtraInitializers);
218
+ }
219
+ constructor(options) {
220
+ super(options);
221
+ this.parameter = options.parameter;
222
+ this.value = options.value;
223
+ this.scale = options.scale;
224
+ }
225
+ static from(raw, ctx) {
226
+ (0, import_core.validatePayload)(raw.payload.length >= 2);
227
+ const parameter = raw.payload[0];
228
+ const { value, scale: rawScale } = (0, import_core.parseFloatWithScale)(raw.payload.subarray(1));
229
+ const scale = (0, import_Types.getEnergyProductionScale)(parameter, rawScale);
230
+ return new this({
231
+ nodeId: ctx.sourceNodeId,
232
+ parameter,
233
+ value,
234
+ scale
235
+ });
236
+ }
237
+ parameter;
238
+ scale;
239
+ value;
240
+ persistValues(ctx) {
241
+ if (!super.persistValues(ctx))
242
+ return false;
243
+ const valueValue = EnergyProductionCCValues.value(this.parameter);
244
+ this.setMetadata(ctx, valueValue, {
245
+ ...valueValue.meta,
246
+ unit: this.scale.unit,
247
+ ccSpecific: {
248
+ parameter: this.parameter,
249
+ scale: this.scale.key
250
+ }
251
+ });
252
+ this.setValue(ctx, valueValue, this.value);
253
+ return true;
254
+ }
255
+ serialize(ctx) {
256
+ this.payload = import_shared.Bytes.concat([
257
+ import_shared.Bytes.from([this.parameter]),
258
+ (0, import_core.encodeFloatWithScale)(this.value, this.scale.key)
259
+ ]);
260
+ return super.serialize(ctx);
261
+ }
262
+ toLogEntry(ctx) {
263
+ return {
264
+ ...super.toLogEntry(ctx),
265
+ message: {
266
+ [(0, import_shared.getEnumMemberName)(import_Types.EnergyProductionParameter, this.parameter).toLowerCase()]: `${this.value} ${this.scale.unit}`
267
+ }
268
+ };
269
+ }
270
+ };
271
+ return EnergyProductionCCReport2 = _classThis;
272
+ })();
198
273
  function testResponseForEnergyProductionGet(sent, received) {
199
274
  return received.parameter === sent.parameter;
200
275
  }
201
- let EnergyProductionCCGet = EnergyProductionCCGet_1 = class EnergyProductionCCGet2 extends EnergyProductionCC {
202
- constructor(options) {
203
- super(options);
204
- this.parameter = options.parameter;
205
- }
206
- static from(raw, ctx) {
207
- (0, import_core.validatePayload)(raw.payload.length >= 1);
208
- const parameter = raw.payload[0];
209
- return new EnergyProductionCCGet_1({
210
- nodeId: ctx.sourceNodeId,
211
- parameter
212
- });
213
- }
214
- parameter;
215
- serialize(ctx) {
216
- this.payload = import_shared.Bytes.from([this.parameter]);
217
- return super.serialize(ctx);
218
- }
219
- toLogEntry(ctx) {
220
- return {
221
- ...super.toLogEntry(ctx),
222
- message: {
223
- parameter: (0, import_shared.getEnumMemberName)(import_Types.EnergyProductionParameter, this.parameter)
224
- }
225
- };
226
- }
227
- };
228
- EnergyProductionCCGet = EnergyProductionCCGet_1 = __decorate([
229
- (0, import_CommandClassDecorators.CCCommand)(import_Types.EnergyProductionCommand.Get),
230
- (0, import_CommandClassDecorators.expectedCCResponse)(EnergyProductionCCReport, testResponseForEnergyProductionGet)
231
- ], EnergyProductionCCGet);
276
+ let EnergyProductionCCGet = (() => {
277
+ let _classDecorators = [(0, import_CommandClassDecorators.CCCommand)(import_Types.EnergyProductionCommand.Get), (0, import_CommandClassDecorators.expectedCCResponse)(EnergyProductionCCReport, testResponseForEnergyProductionGet)];
278
+ let _classDescriptor;
279
+ let _classExtraInitializers = [];
280
+ let _classThis;
281
+ let _classSuper = EnergyProductionCC;
282
+ var EnergyProductionCCGet2 = class extends _classSuper {
283
+ static {
284
+ _classThis = this;
285
+ }
286
+ static {
287
+ const _metadata = typeof Symbol === "function" && Symbol.metadata ? Object.create(_classSuper[Symbol.metadata] ?? null) : void 0;
288
+ __esDecorate(null, _classDescriptor = { value: _classThis }, _classDecorators, { kind: "class", name: _classThis.name, metadata: _metadata }, null, _classExtraInitializers);
289
+ EnergyProductionCCGet2 = _classThis = _classDescriptor.value;
290
+ if (_metadata) Object.defineProperty(_classThis, Symbol.metadata, { enumerable: true, configurable: true, writable: true, value: _metadata });
291
+ __runInitializers(_classThis, _classExtraInitializers);
292
+ }
293
+ constructor(options) {
294
+ super(options);
295
+ this.parameter = options.parameter;
296
+ }
297
+ static from(raw, ctx) {
298
+ (0, import_core.validatePayload)(raw.payload.length >= 1);
299
+ const parameter = raw.payload[0];
300
+ return new this({
301
+ nodeId: ctx.sourceNodeId,
302
+ parameter
303
+ });
304
+ }
305
+ parameter;
306
+ serialize(ctx) {
307
+ this.payload = import_shared.Bytes.from([this.parameter]);
308
+ return super.serialize(ctx);
309
+ }
310
+ toLogEntry(ctx) {
311
+ return {
312
+ ...super.toLogEntry(ctx),
313
+ message: {
314
+ parameter: (0, import_shared.getEnumMemberName)(import_Types.EnergyProductionParameter, this.parameter)
315
+ }
316
+ };
317
+ }
318
+ };
319
+ return EnergyProductionCCGet2 = _classThis;
320
+ })();
232
321
  // Annotate the CommonJS export names for ESM import in node:
233
322
  0 && (module.exports = {
234
323
  EnergyProductionCC,
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../src/cc/EnergyProductionCC.ts"],
4
- "sourcesContent": ["import {\n\tCommandClasses,\n\ttype MessageOrCCLogEntry,\n\tMessagePriority,\n\tValueMetadata,\n\ttype WithAddress,\n\tencodeFloatWithScale,\n\tparseFloatWithScale,\n\tvalidatePayload,\n} from \"@zwave-js/core\";\nimport { type MaybeNotKnown } from \"@zwave-js/core/safe\";\nimport type {\n\tCCEncodingContext,\n\tCCParsingContext,\n\tGetValueDB,\n} from \"@zwave-js/host\";\nimport { Bytes, getEnumMemberName, pick } from \"@zwave-js/shared\";\nimport { validateArgs } from \"@zwave-js/transformers\";\nimport {\n\tCCAPI,\n\tPOLL_VALUE,\n\ttype PollValueImplementation,\n\tthrowUnsupportedProperty,\n} from \"../lib/API.js\";\nimport {\n\ttype CCRaw,\n\tCommandClass,\n\ttype InterviewContext,\n\ttype PersistValuesContext,\n\ttype RefreshValuesContext,\n} from \"../lib/CommandClass.js\";\nimport {\n\tAPI,\n\tCCCommand,\n\tccValues,\n\tcommandClass,\n\texpectedCCResponse,\n\timplementedVersion,\n} from \"../lib/CommandClassDecorators.js\";\nimport { V } from \"../lib/Values.js\";\nimport {\n\tEnergyProductionCommand,\n\tEnergyProductionParameter,\n\ttype EnergyProductionScale,\n\tgetEnergyProductionScale,\n} from \"../lib/_Types.js\";\n\nexport const EnergyProductionCCValues = Object.freeze({\n\t...V.defineStaticCCValues(CommandClasses[\"Energy Production\"], {\n\t\t// Static CC values go here\n\t}),\n\n\t...V.defineDynamicCCValues(CommandClasses[\"Energy Production\"], {\n\t\t// Dynamic CC values go here\n\t\t...V.dynamicPropertyAndKeyWithName(\n\t\t\t\"value\",\n\t\t\t\"value\",\n\t\t\t(parameter: EnergyProductionParameter) => parameter,\n\t\t\t({ property, propertyKey }) =>\n\t\t\t\tproperty === \"value\" && typeof propertyKey === \"number\",\n\t\t\t(parameter: EnergyProductionParameter) => ({\n\t\t\t\t...ValueMetadata.ReadOnlyNumber,\n\t\t\t\tlabel: getEnumMemberName(\n\t\t\t\t\tEnergyProductionParameter,\n\t\t\t\t\tparameter,\n\t\t\t\t),\n\t\t\t\t// unit and ccSpecific are set dynamically\n\t\t\t} as const),\n\t\t),\n\t}),\n});\n\n@API(CommandClasses[\"Energy Production\"])\nexport class EnergyProductionCCAPI extends CCAPI {\n\tpublic supportsCommand(\n\t\tcmd: EnergyProductionCommand,\n\t): MaybeNotKnown<boolean> {\n\t\tswitch (cmd) {\n\t\t\tcase EnergyProductionCommand.Get:\n\t\t\t\treturn true; // This is mandatory\n\t\t}\n\t\treturn super.supportsCommand(cmd);\n\t}\n\n\tprotected get [POLL_VALUE](): PollValueImplementation {\n\t\treturn async function(\n\t\t\tthis: EnergyProductionCCAPI,\n\t\t\t{ property, propertyKey },\n\t\t) {\n\t\t\tif (\n\t\t\t\tEnergyProductionCCValues.value.is({\n\t\t\t\t\tcommandClass: this.ccId,\n\t\t\t\t\tproperty,\n\t\t\t\t\tpropertyKey,\n\t\t\t\t})\n\t\t\t) {\n\t\t\t\treturn (await this.get(property as EnergyProductionParameter))\n\t\t\t\t\t?.value;\n\t\t\t} else {\n\t\t\t\tthrowUnsupportedProperty(this.ccId, property);\n\t\t\t}\n\t\t};\n\t}\n\n\t@validateArgs({ strictEnums: true })\n\tpublic async get(\n\t\tparameter: EnergyProductionParameter,\n\t): Promise<MaybeNotKnown<{ value: number; scale: EnergyProductionScale }>> {\n\t\tthis.assertSupportsCommand(\n\t\t\tEnergyProductionCommand,\n\t\t\tEnergyProductionCommand.Get,\n\t\t);\n\n\t\tconst cc = new EnergyProductionCCGet({\n\t\t\tnodeId: this.endpoint.nodeId,\n\t\t\tendpointIndex: this.endpoint.index,\n\t\t\tparameter,\n\t\t});\n\t\tconst response = await this.host.sendCommand<\n\t\t\tEnergyProductionCCReport\n\t\t>(\n\t\t\tcc,\n\t\t\tthis.commandOptions,\n\t\t);\n\t\tif (response) {\n\t\t\treturn pick(response, [\"value\", \"scale\"]);\n\t\t}\n\t}\n}\n\n@commandClass(CommandClasses[\"Energy Production\"])\n@implementedVersion(1)\n@ccValues(EnergyProductionCCValues)\nexport class EnergyProductionCC extends CommandClass {\n\tdeclare ccCommand: EnergyProductionCommand;\n\n\tpublic async interview(\n\t\tctx: InterviewContext,\n\t): Promise<void> {\n\t\tconst node = this.getNode(ctx)!;\n\n\t\tctx.logNode(node.id, {\n\t\t\tendpoint: this.endpointIndex,\n\t\t\tmessage: `Interviewing ${this.ccName}...`,\n\t\t\tdirection: \"none\",\n\t\t});\n\n\t\t// Query current values\n\t\tawait this.refreshValues(ctx);\n\n\t\t// Remember that the interview is complete\n\t\tthis.setInterviewComplete(ctx, true);\n\t}\n\n\tpublic async refreshValues(\n\t\tctx: RefreshValuesContext,\n\t): Promise<void> {\n\t\tconst node = this.getNode(ctx)!;\n\t\tconst endpoint = this.getEndpoint(ctx)!;\n\t\tconst api = CCAPI.create(\n\t\t\tCommandClasses[\"Energy Production\"],\n\t\t\tctx,\n\t\t\tendpoint,\n\t\t).withOptions({\n\t\t\tpriority: MessagePriority.NodeQuery,\n\t\t});\n\n\t\tfor (\n\t\t\tconst parameter of [\n\t\t\t\tEnergyProductionParameter.Power,\n\t\t\t\tEnergyProductionParameter[\"Production Total\"],\n\t\t\t\tEnergyProductionParameter[\"Production Today\"],\n\t\t\t\tEnergyProductionParameter[\"Total Time\"],\n\t\t\t] as const\n\t\t) {\n\t\t\tctx.logNode(node.id, {\n\t\t\t\tendpoint: this.endpointIndex,\n\t\t\t\tmessage: `querying energy production (${\n\t\t\t\t\tgetEnumMemberName(\n\t\t\t\t\t\tEnergyProductionParameter,\n\t\t\t\t\t\tparameter,\n\t\t\t\t\t)\n\t\t\t\t})...`,\n\t\t\t\tdirection: \"outbound\",\n\t\t\t});\n\n\t\t\tawait api.get(parameter);\n\t\t}\n\t}\n}\n\n// @publicAPI\nexport interface EnergyProductionCCReportOptions {\n\tparameter: EnergyProductionParameter;\n\tscale: EnergyProductionScale;\n\tvalue: number;\n}\n\n@CCCommand(EnergyProductionCommand.Report)\nexport class EnergyProductionCCReport extends EnergyProductionCC {\n\tpublic constructor(\n\t\toptions: WithAddress<EnergyProductionCCReportOptions>,\n\t) {\n\t\tsuper(options);\n\t\tthis.parameter = options.parameter;\n\t\tthis.value = options.value;\n\t\tthis.scale = options.scale;\n\t}\n\n\tpublic static from(\n\t\traw: CCRaw,\n\t\tctx: CCParsingContext,\n\t): EnergyProductionCCReport {\n\t\tvalidatePayload(raw.payload.length >= 2);\n\t\tconst parameter: EnergyProductionParameter = raw.payload[0];\n\t\tconst { value, scale: rawScale } = parseFloatWithScale(\n\t\t\traw.payload.subarray(1),\n\t\t);\n\t\tconst scale: EnergyProductionScale = getEnergyProductionScale(\n\t\t\tparameter,\n\t\t\trawScale,\n\t\t);\n\n\t\treturn new EnergyProductionCCReport({\n\t\t\tnodeId: ctx.sourceNodeId,\n\t\t\tparameter,\n\t\t\tvalue,\n\t\t\tscale,\n\t\t});\n\t}\n\n\tpublic readonly parameter: EnergyProductionParameter;\n\tpublic readonly scale: EnergyProductionScale;\n\tpublic readonly value: number;\n\n\tpublic persistValues(ctx: PersistValuesContext): boolean {\n\t\tif (!super.persistValues(ctx)) return false;\n\n\t\tconst valueValue = EnergyProductionCCValues.value(this.parameter);\n\t\tthis.setMetadata(ctx, valueValue, {\n\t\t\t...valueValue.meta,\n\t\t\tunit: this.scale.unit,\n\t\t\tccSpecific: {\n\t\t\t\tparameter: this.parameter,\n\t\t\t\tscale: this.scale.key,\n\t\t\t},\n\t\t});\n\t\tthis.setValue(ctx, valueValue, this.value);\n\n\t\treturn true;\n\t}\n\n\tpublic serialize(ctx: CCEncodingContext): Bytes {\n\t\tthis.payload = Bytes.concat([\n\t\t\tBytes.from([this.parameter]),\n\t\t\tencodeFloatWithScale(this.value, this.scale.key),\n\t\t]);\n\t\treturn super.serialize(ctx);\n\t}\n\n\tpublic toLogEntry(ctx?: GetValueDB): MessageOrCCLogEntry {\n\t\treturn {\n\t\t\t...super.toLogEntry(ctx),\n\t\t\tmessage: {\n\t\t\t\t[\n\t\t\t\t\tgetEnumMemberName(\n\t\t\t\t\t\tEnergyProductionParameter,\n\t\t\t\t\t\tthis.parameter,\n\t\t\t\t\t).toLowerCase()\n\t\t\t\t]: `${this.value} ${this.scale.unit}`,\n\t\t\t},\n\t\t};\n\t}\n}\n\n// @publicAPI\nexport interface EnergyProductionCCGetOptions {\n\tparameter: EnergyProductionParameter;\n}\n\nfunction testResponseForEnergyProductionGet(\n\tsent: EnergyProductionCCGet,\n\treceived: EnergyProductionCCReport,\n) {\n\treturn received.parameter === sent.parameter;\n}\n\n@CCCommand(EnergyProductionCommand.Get)\n@expectedCCResponse(\n\tEnergyProductionCCReport,\n\ttestResponseForEnergyProductionGet,\n)\nexport class EnergyProductionCCGet extends EnergyProductionCC {\n\tpublic constructor(\n\t\toptions: WithAddress<EnergyProductionCCGetOptions>,\n\t) {\n\t\tsuper(options);\n\t\tthis.parameter = options.parameter;\n\t}\n\n\tpublic static from(\n\t\traw: CCRaw,\n\t\tctx: CCParsingContext,\n\t): EnergyProductionCCGet {\n\t\tvalidatePayload(raw.payload.length >= 1);\n\t\tconst parameter: EnergyProductionParameter = raw.payload[0];\n\n\t\treturn new EnergyProductionCCGet({\n\t\t\tnodeId: ctx.sourceNodeId,\n\t\t\tparameter,\n\t\t});\n\t}\n\n\tpublic parameter: EnergyProductionParameter;\n\n\tpublic serialize(ctx: CCEncodingContext): Bytes {\n\t\tthis.payload = Bytes.from([this.parameter]);\n\t\treturn super.serialize(ctx);\n\t}\n\n\tpublic toLogEntry(ctx?: GetValueDB): MessageOrCCLogEntry {\n\t\treturn {\n\t\t\t...super.toLogEntry(ctx),\n\t\t\tmessage: {\n\t\t\t\tparameter: getEnumMemberName(\n\t\t\t\t\tEnergyProductionParameter,\n\t\t\t\t\tthis.parameter,\n\t\t\t\t),\n\t\t\t},\n\t\t};\n\t}\n}\n"],
5
- "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,kBASO;AAOP,oBAA+C;AAE/C,iBAKO;AACP,0BAMO;AACP,oCAOO;AACP,oBAAkB;AAClB,mBAKO;;;;;;;;;;;;;;;;;;;;AAEA,MAAM,2BAA2B,OAAO,OAAO;EACrD,GAAG,gBAAE,qBAAqB,2BAAe,mBAAmB,GAAG;;GAE9D;EAED,GAAG,gBAAE,sBAAsB,2BAAe,mBAAmB,GAAG;;IAE/D,GAAG,gBAAE,8BACJ,SACA,SACA,CAAC,cAAyC,WAC1C,CAAC,EAAE,UAAU,YAAW,MACvB,aAAa,WAAW,OAAO,gBAAgB,UAChD,CAAC,eAA0C;MAC1C,GAAG,0BAAc;MACjB,WAAO,iCACN,wCACA,SAAS;;MAGA;GAEZ;CACD;AAGM,IAAM,wBAAN,MAAMA,+BAA8B,iBAAK;EACxC,gBACN,KAA4B;AAE5B,YAAQ,KAAK;MACZ,KAAK,qCAAwB;AAC5B,eAAO;IACT;AACA,WAAO,MAAM,gBAAgB,GAAG;EACjC;EAEA,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;MACN,GAAG,MAAM,WAAW,GAAG;MACvB,SAAS;QACR,KACC,iCACC,wCACA,KAAK,SAAS,EACb,YAAW,CAAE,GACb,GAAG,KAAK,KAAK,IAAI,KAAK,MAAM,IAAI;;;EAGtC;;AAzEY,2BAAwB,6BAAA,WAAA;MADpC,yCAAU,qCAAwB,MAAM;GAC5B,wBAAwB;AAiFrC,SAAS,mCACR,MACA,UAAkC;AAElC,SAAO,SAAS,cAAc,KAAK;AACpC;AAOO,IAAM,wBAAqB,0BAA3B,MAAMC,+BAA8B,mBAAkB;EAC5D,YACC,SAAkD;AAElD,UAAM,OAAO;AACb,SAAK,YAAY,QAAQ;EAC1B;EAEO,OAAO,KACb,KACA,KAAqB;AAErB,qCAAgB,IAAI,QAAQ,UAAU,CAAC;AACvC,UAAM,YAAuC,IAAI,QAAQ,CAAC;AAE1D,WAAO,IAAI,wBAAsB;MAChC,QAAQ,IAAI;MACZ;KACA;EACF;EAEO;EAEA,UAAU,KAAsB;AACtC,SAAK,UAAU,oBAAM,KAAK,CAAC,KAAK,SAAS,CAAC;AAC1C,WAAO,MAAM,UAAU,GAAG;EAC3B;EAEO,WAAW,KAAgB;AACjC,WAAO;MACN,GAAG,MAAM,WAAW,GAAG;MACvB,SAAS;QACR,eAAW,iCACV,wCACA,KAAK,SAAS;;;EAIlB;;AAtCY,wBAAqB,0BAAA,WAAA;MALjC,yCAAU,qCAAwB,GAAG;MACrC,kDACA,0BACA,kCAAkC;GAEtB,qBAAqB;",
6
- "names": ["EnergyProductionCCAPI", "EnergyProductionCC", "EnergyProductionCCReport", "EnergyProductionCCGet"]
4
+ "sourcesContent": ["import {\n\tCommandClasses,\n\ttype MessageOrCCLogEntry,\n\tMessagePriority,\n\tValueMetadata,\n\ttype WithAddress,\n\tencodeFloatWithScale,\n\tparseFloatWithScale,\n\tvalidatePayload,\n} from \"@zwave-js/core\";\nimport { type MaybeNotKnown } from \"@zwave-js/core/safe\";\nimport type {\n\tCCEncodingContext,\n\tCCParsingContext,\n\tGetValueDB,\n} from \"@zwave-js/host\";\nimport { Bytes, getEnumMemberName, pick } from \"@zwave-js/shared\";\nimport { validateArgs } from \"@zwave-js/transformers\";\nimport {\n\tCCAPI,\n\tPOLL_VALUE,\n\ttype PollValueImplementation,\n\tthrowUnsupportedProperty,\n} from \"../lib/API.js\";\nimport {\n\ttype CCRaw,\n\tCommandClass,\n\ttype InterviewContext,\n\ttype PersistValuesContext,\n\ttype RefreshValuesContext,\n} from \"../lib/CommandClass.js\";\nimport {\n\tAPI,\n\tCCCommand,\n\tccValues,\n\tcommandClass,\n\texpectedCCResponse,\n\timplementedVersion,\n} from \"../lib/CommandClassDecorators.js\";\nimport { V } from \"../lib/Values.js\";\nimport {\n\tEnergyProductionCommand,\n\tEnergyProductionParameter,\n\ttype EnergyProductionScale,\n\tgetEnergyProductionScale,\n} from \"../lib/_Types.js\";\n\nexport const EnergyProductionCCValues = Object.freeze({\n\t...V.defineStaticCCValues(CommandClasses[\"Energy Production\"], {\n\t\t// Static CC values go here\n\t}),\n\n\t...V.defineDynamicCCValues(CommandClasses[\"Energy Production\"], {\n\t\t// Dynamic CC values go here\n\t\t...V.dynamicPropertyAndKeyWithName(\n\t\t\t\"value\",\n\t\t\t\"value\",\n\t\t\t(parameter: EnergyProductionParameter) => parameter,\n\t\t\t({ property, propertyKey }) =>\n\t\t\t\tproperty === \"value\" && typeof propertyKey === \"number\",\n\t\t\t(parameter: EnergyProductionParameter) => ({\n\t\t\t\t...ValueMetadata.ReadOnlyNumber,\n\t\t\t\tlabel: getEnumMemberName(\n\t\t\t\t\tEnergyProductionParameter,\n\t\t\t\t\tparameter,\n\t\t\t\t),\n\t\t\t\t// unit and ccSpecific are set dynamically\n\t\t\t} as const),\n\t\t),\n\t}),\n});\n\n@API(CommandClasses[\"Energy Production\"])\nexport class EnergyProductionCCAPI extends CCAPI {\n\tpublic supportsCommand(\n\t\tcmd: EnergyProductionCommand,\n\t): MaybeNotKnown<boolean> {\n\t\tswitch (cmd) {\n\t\t\tcase EnergyProductionCommand.Get:\n\t\t\t\treturn true; // This is mandatory\n\t\t}\n\t\treturn super.supportsCommand(cmd);\n\t}\n\n\tprotected get [POLL_VALUE](): PollValueImplementation {\n\t\treturn async function(\n\t\t\tthis: EnergyProductionCCAPI,\n\t\t\t{ property, propertyKey },\n\t\t) {\n\t\t\tif (\n\t\t\t\tEnergyProductionCCValues.value.is({\n\t\t\t\t\tcommandClass: this.ccId,\n\t\t\t\t\tproperty,\n\t\t\t\t\tpropertyKey,\n\t\t\t\t})\n\t\t\t) {\n\t\t\t\treturn (await this.get(property as EnergyProductionParameter))\n\t\t\t\t\t?.value;\n\t\t\t} else {\n\t\t\t\tthrowUnsupportedProperty(this.ccId, property);\n\t\t\t}\n\t\t};\n\t}\n\n\t@validateArgs({ strictEnums: true })\n\tpublic async get(\n\t\tparameter: EnergyProductionParameter,\n\t): Promise<MaybeNotKnown<{ value: number; scale: EnergyProductionScale }>> {\n\t\tthis.assertSupportsCommand(\n\t\t\tEnergyProductionCommand,\n\t\t\tEnergyProductionCommand.Get,\n\t\t);\n\n\t\tconst cc = new EnergyProductionCCGet({\n\t\t\tnodeId: this.endpoint.nodeId,\n\t\t\tendpointIndex: this.endpoint.index,\n\t\t\tparameter,\n\t\t});\n\t\tconst response = await this.host.sendCommand<\n\t\t\tEnergyProductionCCReport\n\t\t>(\n\t\t\tcc,\n\t\t\tthis.commandOptions,\n\t\t);\n\t\tif (response) {\n\t\t\treturn pick(response, [\"value\", \"scale\"]);\n\t\t}\n\t}\n}\n\n@commandClass(CommandClasses[\"Energy Production\"])\n@implementedVersion(1)\n@ccValues(EnergyProductionCCValues)\nexport class EnergyProductionCC extends CommandClass {\n\tdeclare ccCommand: EnergyProductionCommand;\n\n\tpublic async interview(\n\t\tctx: InterviewContext,\n\t): Promise<void> {\n\t\tconst node = this.getNode(ctx)!;\n\n\t\tctx.logNode(node.id, {\n\t\t\tendpoint: this.endpointIndex,\n\t\t\tmessage: `Interviewing ${this.ccName}...`,\n\t\t\tdirection: \"none\",\n\t\t});\n\n\t\t// Query current values\n\t\tawait this.refreshValues(ctx);\n\n\t\t// Remember that the interview is complete\n\t\tthis.setInterviewComplete(ctx, true);\n\t}\n\n\tpublic async refreshValues(\n\t\tctx: RefreshValuesContext,\n\t): Promise<void> {\n\t\tconst node = this.getNode(ctx)!;\n\t\tconst endpoint = this.getEndpoint(ctx)!;\n\t\tconst api = CCAPI.create(\n\t\t\tCommandClasses[\"Energy Production\"],\n\t\t\tctx,\n\t\t\tendpoint,\n\t\t).withOptions({\n\t\t\tpriority: MessagePriority.NodeQuery,\n\t\t});\n\n\t\tfor (\n\t\t\tconst parameter of [\n\t\t\t\tEnergyProductionParameter.Power,\n\t\t\t\tEnergyProductionParameter[\"Production Total\"],\n\t\t\t\tEnergyProductionParameter[\"Production Today\"],\n\t\t\t\tEnergyProductionParameter[\"Total Time\"],\n\t\t\t] as const\n\t\t) {\n\t\t\tctx.logNode(node.id, {\n\t\t\t\tendpoint: this.endpointIndex,\n\t\t\t\tmessage: `querying energy production (${\n\t\t\t\t\tgetEnumMemberName(\n\t\t\t\t\t\tEnergyProductionParameter,\n\t\t\t\t\t\tparameter,\n\t\t\t\t\t)\n\t\t\t\t})...`,\n\t\t\t\tdirection: \"outbound\",\n\t\t\t});\n\n\t\t\tawait api.get(parameter);\n\t\t}\n\t}\n}\n\n// @publicAPI\nexport interface EnergyProductionCCReportOptions {\n\tparameter: EnergyProductionParameter;\n\tscale: EnergyProductionScale;\n\tvalue: number;\n}\n\n@CCCommand(EnergyProductionCommand.Report)\nexport class EnergyProductionCCReport extends EnergyProductionCC {\n\tpublic constructor(\n\t\toptions: WithAddress<EnergyProductionCCReportOptions>,\n\t) {\n\t\tsuper(options);\n\t\tthis.parameter = options.parameter;\n\t\tthis.value = options.value;\n\t\tthis.scale = options.scale;\n\t}\n\n\tpublic static from(\n\t\traw: CCRaw,\n\t\tctx: CCParsingContext,\n\t): EnergyProductionCCReport {\n\t\tvalidatePayload(raw.payload.length >= 2);\n\t\tconst parameter: EnergyProductionParameter = raw.payload[0];\n\t\tconst { value, scale: rawScale } = parseFloatWithScale(\n\t\t\traw.payload.subarray(1),\n\t\t);\n\t\tconst scale: EnergyProductionScale = getEnergyProductionScale(\n\t\t\tparameter,\n\t\t\trawScale,\n\t\t);\n\n\t\treturn new this({\n\t\t\tnodeId: ctx.sourceNodeId,\n\t\t\tparameter,\n\t\t\tvalue,\n\t\t\tscale,\n\t\t});\n\t}\n\n\tpublic readonly parameter: EnergyProductionParameter;\n\tpublic readonly scale: EnergyProductionScale;\n\tpublic readonly value: number;\n\n\tpublic persistValues(ctx: PersistValuesContext): boolean {\n\t\tif (!super.persistValues(ctx)) return false;\n\n\t\tconst valueValue = EnergyProductionCCValues.value(this.parameter);\n\t\tthis.setMetadata(ctx, valueValue, {\n\t\t\t...valueValue.meta,\n\t\t\tunit: this.scale.unit,\n\t\t\tccSpecific: {\n\t\t\t\tparameter: this.parameter,\n\t\t\t\tscale: this.scale.key,\n\t\t\t},\n\t\t});\n\t\tthis.setValue(ctx, valueValue, this.value);\n\n\t\treturn true;\n\t}\n\n\tpublic serialize(ctx: CCEncodingContext): Bytes {\n\t\tthis.payload = Bytes.concat([\n\t\t\tBytes.from([this.parameter]),\n\t\t\tencodeFloatWithScale(this.value, this.scale.key),\n\t\t]);\n\t\treturn super.serialize(ctx);\n\t}\n\n\tpublic toLogEntry(ctx?: GetValueDB): MessageOrCCLogEntry {\n\t\treturn {\n\t\t\t...super.toLogEntry(ctx),\n\t\t\tmessage: {\n\t\t\t\t[\n\t\t\t\t\tgetEnumMemberName(\n\t\t\t\t\t\tEnergyProductionParameter,\n\t\t\t\t\t\tthis.parameter,\n\t\t\t\t\t).toLowerCase()\n\t\t\t\t]: `${this.value} ${this.scale.unit}`,\n\t\t\t},\n\t\t};\n\t}\n}\n\n// @publicAPI\nexport interface EnergyProductionCCGetOptions {\n\tparameter: EnergyProductionParameter;\n}\n\nfunction testResponseForEnergyProductionGet(\n\tsent: EnergyProductionCCGet,\n\treceived: EnergyProductionCCReport,\n) {\n\treturn received.parameter === sent.parameter;\n}\n\n@CCCommand(EnergyProductionCommand.Get)\n@expectedCCResponse(\n\tEnergyProductionCCReport,\n\ttestResponseForEnergyProductionGet,\n)\nexport class EnergyProductionCCGet extends EnergyProductionCC {\n\tpublic constructor(\n\t\toptions: WithAddress<EnergyProductionCCGetOptions>,\n\t) {\n\t\tsuper(options);\n\t\tthis.parameter = options.parameter;\n\t}\n\n\tpublic static from(\n\t\traw: CCRaw,\n\t\tctx: CCParsingContext,\n\t): EnergyProductionCCGet {\n\t\tvalidatePayload(raw.payload.length >= 1);\n\t\tconst parameter: EnergyProductionParameter = raw.payload[0];\n\n\t\treturn new this({\n\t\t\tnodeId: ctx.sourceNodeId,\n\t\t\tparameter,\n\t\t});\n\t}\n\n\tpublic parameter: EnergyProductionParameter;\n\n\tpublic serialize(ctx: CCEncodingContext): Bytes {\n\t\tthis.payload = Bytes.from([this.parameter]);\n\t\treturn super.serialize(ctx);\n\t}\n\n\tpublic toLogEntry(ctx?: GetValueDB): MessageOrCCLogEntry {\n\t\treturn {\n\t\t\t...super.toLogEntry(ctx),\n\t\t\tmessage: {\n\t\t\t\tparameter: getEnumMemberName(\n\t\t\t\t\tEnergyProductionParameter,\n\t\t\t\t\tthis.parameter,\n\t\t\t\t),\n\t\t\t},\n\t\t};\n\t}\n}\n"],
5
+ "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,kBASO;AAOP,oBAA+C;AAE/C,iBAKO;AACP,0BAMO;AACP,oCAOO;AACP,oBAAkB;AAClB,mBAKO;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAEA,MAAM,2BAA2B,OAAO,OAAO;EACrD,GAAG,gBAAE,qBAAqB,2BAAe,mBAAmB,GAAG;;GAE9D;EAED,GAAG,gBAAE,sBAAsB,2BAAe,mBAAmB,GAAG;;IAE/D,GAAG,gBAAE,8BACJ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