@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
@@ -38,13 +38,45 @@ var import_CommandClass = require("../lib/CommandClass.js");
38
38
  var import_CommandClassDecorators = require("../lib/CommandClassDecorators.js");
39
39
  var import_Values = require("../lib/Values.js");
40
40
  var import_Types = require("../lib/_Types.js");
41
- var __decorate = function(decorators, target, key, desc) {
42
- var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
43
- if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
44
- 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;
45
- return c > 3 && r && Object.defineProperty(target, key, r), r;
41
+ var __esDecorate = function(ctor, descriptorIn, decorators, contextIn, initializers, extraInitializers) {
42
+ function accept(f) {
43
+ if (f !== void 0 && typeof f !== "function") throw new TypeError("Function expected");
44
+ return f;
45
+ }
46
+ var kind = contextIn.kind, key = kind === "getter" ? "get" : kind === "setter" ? "set" : "value";
47
+ var target = !descriptorIn && ctor ? contextIn["static"] ? ctor : ctor.prototype : null;
48
+ var descriptor = descriptorIn || (target ? Object.getOwnPropertyDescriptor(target, contextIn.name) : {});
49
+ var _, done = false;
50
+ for (var i = decorators.length - 1; i >= 0; i--) {
51
+ var context = {};
52
+ for (var p in contextIn) context[p] = p === "access" ? {} : contextIn[p];
53
+ for (var p in contextIn.access) context.access[p] = contextIn.access[p];
54
+ context.addInitializer = function(f) {
55
+ if (done) throw new TypeError("Cannot add initializers after decoration has completed");
56
+ extraInitializers.push(accept(f || null));
57
+ };
58
+ var result = (0, decorators[i])(kind === "accessor" ? { get: descriptor.get, set: descriptor.set } : descriptor[key], context);
59
+ if (kind === "accessor") {
60
+ if (result === void 0) continue;
61
+ if (result === null || typeof result !== "object") throw new TypeError("Object expected");
62
+ if (_ = accept(result.get)) descriptor.get = _;
63
+ if (_ = accept(result.set)) descriptor.set = _;
64
+ if (_ = accept(result.init)) initializers.unshift(_);
65
+ } else if (_ = accept(result)) {
66
+ if (kind === "field") initializers.unshift(_);
67
+ else descriptor[key] = _;
68
+ }
69
+ }
70
+ if (target) Object.defineProperty(target, contextIn.name, descriptor);
71
+ done = true;
72
+ };
73
+ var __runInitializers = function(thisArg, initializers, value) {
74
+ var useValue = arguments.length > 2;
75
+ for (var i = 0; i < initializers.length; i++) {
76
+ value = useValue ? initializers[i].call(thisArg, value) : initializers[i].call(thisArg);
77
+ }
78
+ return useValue ? value : void 0;
46
79
  };
47
- var MultilevelSensorCCReport_1, MultilevelSensorCCGet_1, MultilevelSensorCCSupportedSensorReport_1, MultilevelSensorCCSupportedScaleReport_1, MultilevelSensorCCGetSupportedScale_1;
48
80
  function __assertType(argName, typeName, boundHasError) {
49
81
  const { ZWaveError, ZWaveErrorCodes } = require("@zwave-js/core");
50
82
  if (boundHasError()) {
@@ -201,154 +233,163 @@ function getPreferredSensorScale(ctx, nodeId, endpointIndex, sensorType, support
201
233
  return preferred;
202
234
  }
203
235
  }
204
- let MultilevelSensorCCAPI = class MultilevelSensorCCAPI2 extends import_API.PhysicalCCAPI {
205
- supportsCommand(cmd) {
206
- switch (cmd) {
207
- case import_Types.MultilevelSensorCommand.Get:
208
- case import_Types.MultilevelSensorCommand.Report:
209
- return true;
210
- // This is mandatory
211
- case import_Types.MultilevelSensorCommand.GetSupportedSensor:
212
- case import_Types.MultilevelSensorCommand.GetSupportedScale:
213
- return this.version >= 5;
236
+ let MultilevelSensorCCAPI = (() => {
237
+ let _classDecorators = [(0, import_CommandClassDecorators.API)(import_safe.CommandClasses["Multilevel Sensor"])];
238
+ let _classDescriptor;
239
+ let _classExtraInitializers = [];
240
+ let _classThis;
241
+ let _classSuper = import_API.PhysicalCCAPI;
242
+ var MultilevelSensorCCAPI2 = class extends _classSuper {
243
+ static {
244
+ _classThis = this;
214
245
  }
215
- return super.supportsCommand(cmd);
216
- }
217
- get [import_API.POLL_VALUE]() {
218
- return async function({ property }) {
219
- const valueId = {
220
- commandClass: import_safe.CommandClasses["Multilevel Sensor"],
221
- endpoint: this.endpoint.index,
222
- property
223
- };
224
- const ccSpecific = this.tryGetValueDB()?.getMetadata(valueId)?.ccSpecific;
225
- if (!ccSpecific) {
226
- (0, import_API.throwUnsupportedProperty)(this.ccId, property);
246
+ static {
247
+ const _metadata = typeof Symbol === "function" && Symbol.metadata ? Object.create(_classSuper[Symbol.metadata] ?? null) : void 0;
248
+ __esDecorate(null, _classDescriptor = { value: _classThis }, _classDecorators, { kind: "class", name: _classThis.name, metadata: _metadata }, null, _classExtraInitializers);
249
+ MultilevelSensorCCAPI2 = _classThis = _classDescriptor.value;
250
+ if (_metadata) Object.defineProperty(_classThis, Symbol.metadata, { enumerable: true, configurable: true, writable: true, value: _metadata });
251
+ __runInitializers(_classThis, _classExtraInitializers);
252
+ }
253
+ supportsCommand(cmd) {
254
+ switch (cmd) {
255
+ case import_Types.MultilevelSensorCommand.Get:
256
+ case import_Types.MultilevelSensorCommand.Report:
257
+ return true;
258
+ // This is mandatory
259
+ case import_Types.MultilevelSensorCommand.GetSupportedSensor:
260
+ case import_Types.MultilevelSensorCommand.GetSupportedScale:
261
+ return this.version >= 5;
227
262
  }
228
- const { sensorType, scale } = ccSpecific;
229
- return this.get(sensorType, scale);
230
- };
231
- }
232
- async get(sensorType, scale) {
233
- __assertType("sensorType", "(optional) number", __assertType__optional_number.bind(void 0, sensorType));
234
- __assertType("scale", "(optional) number", __assertType__optional_number.bind(void 0, scale));
235
- this.assertSupportsCommand(import_Types.MultilevelSensorCommand, import_Types.MultilevelSensorCommand.Get);
236
- let preferredScale;
237
- if (sensorType != void 0 && scale == void 0) {
238
- const supportedScales = this.tryGetValueDB()?.getValue({
239
- commandClass: this.ccId,
240
- endpoint: this.endpoint.index,
241
- property: "supportedScales",
242
- propertyKey: sensorType
243
- }) ?? [];
244
- preferredScale = getPreferredSensorScale(this.host, this.endpoint.nodeId, this.endpoint.index, sensorType, supportedScales);
245
- }
246
- const cc = new MultilevelSensorCCGet({
247
- nodeId: this.endpoint.nodeId,
248
- endpointIndex: this.endpoint.index,
249
- sensorType,
250
- scale: scale ?? preferredScale
251
- });
252
- const response = await this.host.sendCommand(cc, this.commandOptions);
253
- if (!response)
254
- return;
255
- const responseScale = (0, import_core.getSensorScale)(response.type, response.scale);
256
- if (sensorType == void 0) {
257
- return {
258
- type: response.type,
259
- value: response.value,
260
- scale: responseScale
261
- };
262
- } else if (scale == void 0) {
263
- return {
264
- value: response.value,
265
- scale: responseScale
263
+ return super.supportsCommand(cmd);
264
+ }
265
+ get [import_API.POLL_VALUE]() {
266
+ return async function({ property }) {
267
+ const valueId = {
268
+ commandClass: import_safe.CommandClasses["Multilevel Sensor"],
269
+ endpoint: this.endpoint.index,
270
+ property
271
+ };
272
+ const ccSpecific = this.tryGetValueDB()?.getMetadata(valueId)?.ccSpecific;
273
+ if (!ccSpecific) {
274
+ (0, import_API.throwUnsupportedProperty)(this.ccId, property);
275
+ }
276
+ const { sensorType, scale } = ccSpecific;
277
+ return this.get(sensorType, scale);
266
278
  };
267
- } else {
268
- return response.value;
269
279
  }
270
- }
271
- async getSupportedSensorTypes() {
272
- this.assertSupportsCommand(import_Types.MultilevelSensorCommand, import_Types.MultilevelSensorCommand.GetSupportedSensor);
273
- const cc = new MultilevelSensorCCGetSupportedSensor({
274
- nodeId: this.endpoint.nodeId,
275
- endpointIndex: this.endpoint.index
276
- });
277
- const response = await this.host.sendCommand(cc, this.commandOptions);
278
- return response?.supportedSensorTypes;
279
- }
280
- async getSupportedScales(sensorType) {
281
- __assertType("sensorType", "number", __assertType__number.bind(void 0, sensorType));
282
- this.assertSupportsCommand(import_Types.MultilevelSensorCommand, import_Types.MultilevelSensorCommand.GetSupportedScale);
283
- const cc = new MultilevelSensorCCGetSupportedScale({
284
- nodeId: this.endpoint.nodeId,
285
- endpointIndex: this.endpoint.index,
286
- sensorType
287
- });
288
- const response = await this.host.sendCommand(cc, this.commandOptions);
289
- return response?.supportedScales;
290
- }
291
- async sendReport(sensorType, scale, value) {
292
- __assertType("sensorType", "number", __assertType__number.bind(void 0, sensorType));
293
- __assertType("scale", void 0, __assertType__su__number__2_eu.bind(void 0, scale));
294
- __assertType("value", "number", __assertType__number.bind(void 0, value));
295
- this.assertSupportsCommand(import_Types.MultilevelSensorCommand, import_Types.MultilevelSensorCommand.Report);
296
- const cc = new MultilevelSensorCCReport({
297
- nodeId: this.endpoint.nodeId,
298
- endpointIndex: this.endpoint.index,
299
- type: sensorType,
300
- scale,
301
- value
302
- });
303
- return this.host.sendCommand(cc, this.commandOptions);
304
- }
305
- };
306
- MultilevelSensorCCAPI = __decorate([
307
- (0, import_CommandClassDecorators.API)(import_safe.CommandClasses["Multilevel Sensor"])
308
- ], MultilevelSensorCCAPI);
309
- let MultilevelSensorCC = class MultilevelSensorCC2 extends import_CommandClass.CommandClass {
310
- async interview(ctx) {
311
- const node = this.getNode(ctx);
312
- const endpoint = this.getEndpoint(ctx);
313
- const api = import_API.CCAPI.create(import_safe.CommandClasses["Multilevel Sensor"], ctx, endpoint).withOptions({
314
- priority: import_safe.MessagePriority.NodeQuery
315
- });
316
- ctx.logNode(node.id, {
317
- endpoint: this.endpointIndex,
318
- message: `Interviewing ${this.ccName}...`,
319
- direction: "none"
320
- });
321
- if (api.version >= 5) {
322
- ctx.logNode(node.id, {
323
- endpoint: this.endpointIndex,
324
- message: "retrieving supported sensor types...",
325
- direction: "outbound"
280
+ async get(sensorType, scale) {
281
+ __assertType("sensorType", "(optional) number", __assertType__optional_number.bind(void 0, sensorType));
282
+ __assertType("scale", "(optional) number", __assertType__optional_number.bind(void 0, scale));
283
+ this.assertSupportsCommand(import_Types.MultilevelSensorCommand, import_Types.MultilevelSensorCommand.Get);
284
+ let preferredScale;
285
+ if (sensorType != void 0 && scale == void 0) {
286
+ const supportedScales = this.tryGetValueDB()?.getValue({
287
+ commandClass: this.ccId,
288
+ endpoint: this.endpoint.index,
289
+ property: "supportedScales",
290
+ propertyKey: sensorType
291
+ }) ?? [];
292
+ preferredScale = getPreferredSensorScale(this.host, this.endpoint.nodeId, this.endpoint.index, sensorType, supportedScales);
293
+ }
294
+ const cc = new MultilevelSensorCCGet({
295
+ nodeId: this.endpoint.nodeId,
296
+ endpointIndex: this.endpoint.index,
297
+ sensorType,
298
+ scale: scale ?? preferredScale
326
299
  });
327
- const sensorTypes = await api.getSupportedSensorTypes();
328
- if (sensorTypes) {
329
- const logMessage = "received supported sensor types:\n" + sensorTypes.map((t) => (0, import_core.getSensorName)(t)).map((name) => `\xB7 ${name}`).join("\n");
330
- ctx.logNode(node.id, {
331
- endpoint: this.endpointIndex,
332
- message: logMessage,
333
- direction: "inbound"
334
- });
335
- } else {
336
- ctx.logNode(node.id, {
337
- endpoint: this.endpointIndex,
338
- message: "Querying supported sensor types timed out, skipping interview...",
339
- level: "warn"
340
- });
300
+ const response = await this.host.sendCommand(cc, this.commandOptions);
301
+ if (!response)
341
302
  return;
303
+ const responseScale = (0, import_core.getSensorScale)(response.type, response.scale);
304
+ if (sensorType == void 0) {
305
+ return {
306
+ type: response.type,
307
+ value: response.value,
308
+ scale: responseScale
309
+ };
310
+ } else if (scale == void 0) {
311
+ return {
312
+ value: response.value,
313
+ scale: responseScale
314
+ };
315
+ } else {
316
+ return response.value;
342
317
  }
343
- for (const type of sensorTypes) {
318
+ }
319
+ async getSupportedSensorTypes() {
320
+ this.assertSupportsCommand(import_Types.MultilevelSensorCommand, import_Types.MultilevelSensorCommand.GetSupportedSensor);
321
+ const cc = new MultilevelSensorCCGetSupportedSensor({
322
+ nodeId: this.endpoint.nodeId,
323
+ endpointIndex: this.endpoint.index
324
+ });
325
+ const response = await this.host.sendCommand(cc, this.commandOptions);
326
+ return response?.supportedSensorTypes;
327
+ }
328
+ async getSupportedScales(sensorType) {
329
+ __assertType("sensorType", "number", __assertType__number.bind(void 0, sensorType));
330
+ this.assertSupportsCommand(import_Types.MultilevelSensorCommand, import_Types.MultilevelSensorCommand.GetSupportedScale);
331
+ const cc = new MultilevelSensorCCGetSupportedScale({
332
+ nodeId: this.endpoint.nodeId,
333
+ endpointIndex: this.endpoint.index,
334
+ sensorType
335
+ });
336
+ const response = await this.host.sendCommand(cc, this.commandOptions);
337
+ return response?.supportedScales;
338
+ }
339
+ async sendReport(sensorType, scale, value) {
340
+ __assertType("sensorType", "number", __assertType__number.bind(void 0, sensorType));
341
+ __assertType("scale", void 0, __assertType__su__number__2_eu.bind(void 0, scale));
342
+ __assertType("value", "number", __assertType__number.bind(void 0, value));
343
+ this.assertSupportsCommand(import_Types.MultilevelSensorCommand, import_Types.MultilevelSensorCommand.Report);
344
+ const cc = new MultilevelSensorCCReport({
345
+ nodeId: this.endpoint.nodeId,
346
+ endpointIndex: this.endpoint.index,
347
+ type: sensorType,
348
+ scale,
349
+ value
350
+ });
351
+ return this.host.sendCommand(cc, this.commandOptions);
352
+ }
353
+ };
354
+ return MultilevelSensorCCAPI2 = _classThis;
355
+ })();
356
+ let MultilevelSensorCC = (() => {
357
+ let _classDecorators = [(0, import_CommandClassDecorators.commandClass)(import_safe.CommandClasses["Multilevel Sensor"]), (0, import_CommandClassDecorators.implementedVersion)(11), (0, import_CommandClassDecorators.ccValues)(MultilevelSensorCCValues)];
358
+ let _classDescriptor;
359
+ let _classExtraInitializers = [];
360
+ let _classThis;
361
+ let _classSuper = import_CommandClass.CommandClass;
362
+ var MultilevelSensorCC2 = class extends _classSuper {
363
+ static {
364
+ _classThis = this;
365
+ }
366
+ static {
367
+ const _metadata = typeof Symbol === "function" && Symbol.metadata ? Object.create(_classSuper[Symbol.metadata] ?? null) : void 0;
368
+ __esDecorate(null, _classDescriptor = { value: _classThis }, _classDecorators, { kind: "class", name: _classThis.name, metadata: _metadata }, null, _classExtraInitializers);
369
+ MultilevelSensorCC2 = _classThis = _classDescriptor.value;
370
+ if (_metadata) Object.defineProperty(_classThis, Symbol.metadata, { enumerable: true, configurable: true, writable: true, value: _metadata });
371
+ __runInitializers(_classThis, _classExtraInitializers);
372
+ }
373
+ async interview(ctx) {
374
+ const node = this.getNode(ctx);
375
+ const endpoint = this.getEndpoint(ctx);
376
+ const api = import_API.CCAPI.create(import_safe.CommandClasses["Multilevel Sensor"], ctx, endpoint).withOptions({
377
+ priority: import_safe.MessagePriority.NodeQuery
378
+ });
379
+ ctx.logNode(node.id, {
380
+ endpoint: this.endpointIndex,
381
+ message: `Interviewing ${this.ccName}...`,
382
+ direction: "none"
383
+ });
384
+ if (api.version >= 5) {
344
385
  ctx.logNode(node.id, {
345
386
  endpoint: this.endpointIndex,
346
- message: `querying supported scales for ${(0, import_core.getSensorName)(type)} sensor`,
387
+ message: "retrieving supported sensor types...",
347
388
  direction: "outbound"
348
389
  });
349
- const sensorScales = await api.getSupportedScales(type);
350
- if (sensorScales) {
351
- const logMessage = "received supported scales:\n" + sensorScales.map((s) => ((0, import_core.getSensorScale)(type, s) ?? (0, import_core.getUnknownScale)(s)).label).map((name) => `\xB7 ${name}`).join("\n");
390
+ const sensorTypes = await api.getSupportedSensorTypes();
391
+ if (sensorTypes) {
392
+ const logMessage = "received supported sensor types:\n" + sensorTypes.map((t) => (0, import_core.getSensorName)(t)).map((name) => `\xB7 ${name}`).join("\n");
352
393
  ctx.logNode(node.id, {
353
394
  endpoint: this.endpointIndex,
354
395
  message: logMessage,
@@ -357,350 +398,449 @@ let MultilevelSensorCC = class MultilevelSensorCC2 extends import_CommandClass.C
357
398
  } else {
358
399
  ctx.logNode(node.id, {
359
400
  endpoint: this.endpointIndex,
360
- message: "Querying supported scales timed out, skipping interview...",
401
+ message: "Querying supported sensor types timed out, skipping interview...",
361
402
  level: "warn"
362
403
  });
363
404
  return;
364
405
  }
406
+ for (const type of sensorTypes) {
407
+ ctx.logNode(node.id, {
408
+ endpoint: this.endpointIndex,
409
+ message: `querying supported scales for ${(0, import_core.getSensorName)(type)} sensor`,
410
+ direction: "outbound"
411
+ });
412
+ const sensorScales = await api.getSupportedScales(type);
413
+ if (sensorScales) {
414
+ const logMessage = "received supported scales:\n" + sensorScales.map((s) => ((0, import_core.getSensorScale)(type, s) ?? (0, import_core.getUnknownScale)(s)).label).map((name) => `\xB7 ${name}`).join("\n");
415
+ ctx.logNode(node.id, {
416
+ endpoint: this.endpointIndex,
417
+ message: logMessage,
418
+ direction: "inbound"
419
+ });
420
+ } else {
421
+ ctx.logNode(node.id, {
422
+ endpoint: this.endpointIndex,
423
+ message: "Querying supported scales timed out, skipping interview...",
424
+ level: "warn"
425
+ });
426
+ return;
427
+ }
428
+ }
365
429
  }
430
+ await this.refreshValues(ctx);
431
+ this.setInterviewComplete(ctx, true);
366
432
  }
367
- await this.refreshValues(ctx);
368
- this.setInterviewComplete(ctx, true);
369
- }
370
- async refreshValues(ctx) {
371
- const node = this.getNode(ctx);
372
- const endpoint = this.getEndpoint(ctx);
373
- const api = import_API.CCAPI.create(import_safe.CommandClasses["Multilevel Sensor"], ctx, endpoint).withOptions({
374
- priority: import_safe.MessagePriority.NodeQuery
375
- });
376
- const valueDB = this.getValueDB(ctx);
377
- if (api.version <= 4) {
378
- ctx.logNode(node.id, {
379
- endpoint: this.endpointIndex,
380
- message: "querying current sensor reading...",
381
- direction: "outbound"
433
+ async refreshValues(ctx) {
434
+ const node = this.getNode(ctx);
435
+ const endpoint = this.getEndpoint(ctx);
436
+ const api = import_API.CCAPI.create(import_safe.CommandClasses["Multilevel Sensor"], ctx, endpoint).withOptions({
437
+ priority: import_safe.MessagePriority.NodeQuery
382
438
  });
383
- const mlsResponse = await api.get();
384
- if (mlsResponse) {
385
- const sensorScale = (0, import_core.getSensorScale)(mlsResponse.type, mlsResponse.scale.key);
386
- const logMessage = `received current sensor reading:
387
- sensor type: ${(0, import_core.getSensorName)(mlsResponse.type)}
388
- value: ${mlsResponse.value}${sensorScale?.unit ? ` ${sensorScale.unit}` : ""}`;
439
+ const valueDB = this.getValueDB(ctx);
440
+ if (api.version <= 4) {
389
441
  ctx.logNode(node.id, {
390
442
  endpoint: this.endpointIndex,
391
- message: logMessage,
392
- direction: "inbound"
393
- });
394
- }
395
- } else {
396
- const sensorTypes = valueDB.getValue({
397
- commandClass: this.ccId,
398
- property: "supportedSensorTypes",
399
- endpoint: this.endpointIndex
400
- }) || [];
401
- for (const type of sensorTypes) {
402
- ctx.logNode(node.id, {
403
- endpoint: this.endpointIndex,
404
- message: `querying ${(0, import_core.getSensorName)(type)} sensor reading...`,
443
+ message: "querying current sensor reading...",
405
444
  direction: "outbound"
406
445
  });
407
- const value = await api.get(type);
408
- if (value) {
409
- const logMessage = `received current ${(0, import_core.getSensorName)(type)} sensor reading: ${value.value} ${value.scale.unit || ""}`;
446
+ const mlsResponse = await api.get();
447
+ if (mlsResponse) {
448
+ const sensorScale = (0, import_core.getSensorScale)(mlsResponse.type, mlsResponse.scale.key);
449
+ const logMessage = `received current sensor reading:
450
+ sensor type: ${(0, import_core.getSensorName)(mlsResponse.type)}
451
+ value: ${mlsResponse.value}${sensorScale?.unit ? ` ${sensorScale.unit}` : ""}`;
410
452
  ctx.logNode(node.id, {
411
453
  endpoint: this.endpointIndex,
412
454
  message: logMessage,
413
455
  direction: "inbound"
414
456
  });
415
457
  }
458
+ } else {
459
+ const sensorTypes = valueDB.getValue({
460
+ commandClass: this.ccId,
461
+ property: "supportedSensorTypes",
462
+ endpoint: this.endpointIndex
463
+ }) || [];
464
+ for (const type of sensorTypes) {
465
+ ctx.logNode(node.id, {
466
+ endpoint: this.endpointIndex,
467
+ message: `querying ${(0, import_core.getSensorName)(type)} sensor reading...`,
468
+ direction: "outbound"
469
+ });
470
+ const value = await api.get(type);
471
+ if (value) {
472
+ const logMessage = `received current ${(0, import_core.getSensorName)(type)} sensor reading: ${value.value} ${value.scale.unit || ""}`;
473
+ ctx.logNode(node.id, {
474
+ endpoint: this.endpointIndex,
475
+ message: logMessage,
476
+ direction: "inbound"
477
+ });
478
+ }
479
+ }
416
480
  }
417
481
  }
418
- }
419
- shouldRefreshValues(ctx) {
420
- const valueDB = ctx.tryGetValueDB(this.nodeId);
421
- if (!valueDB)
422
- return true;
423
- const values = this.getDefinedValueIDs(ctx).filter((v) => MultilevelSensorCCValues.value.is(v));
424
- return values.every((v) => {
425
- const lastUpdated = valueDB.getTimestamp(v);
426
- return lastUpdated == void 0 || Date.now() - lastUpdated > import_core.timespan.hours(6);
427
- });
428
- }
429
- /**
430
- * Returns which sensor types are supported.
431
- * This only works AFTER the interview process
432
- */
433
- static getSupportedSensorTypesCached(ctx, endpoint) {
434
- return ctx.getValueDB(endpoint.nodeId).getValue(MultilevelSensorCCValues.supportedSensorTypes.endpoint(endpoint.index));
435
- }
436
- /**
437
- * Returns which scales are supported for a given sensor type.
438
- * This only works AFTER the interview process
439
- */
440
- static getSupportedScalesCached(ctx, endpoint, sensorType) {
441
- return ctx.getValueDB(endpoint.nodeId).getValue(MultilevelSensorCCValues.supportedScales(sensorType).endpoint(endpoint.index));
442
- }
443
- translatePropertyKey(ctx, property, propertyKey) {
444
- if (property === "values" && typeof propertyKey === "number") {
445
- const sensor = (0, import_core.getSensor)(propertyKey);
446
- if (sensor)
447
- return sensor.label;
482
+ shouldRefreshValues(ctx) {
483
+ const valueDB = ctx.tryGetValueDB(this.nodeId);
484
+ if (!valueDB)
485
+ return true;
486
+ const values = this.getDefinedValueIDs(ctx).filter((v) => MultilevelSensorCCValues.value.is(v));
487
+ return values.every((v) => {
488
+ const lastUpdated = valueDB.getTimestamp(v);
489
+ return lastUpdated == void 0 || Date.now() - lastUpdated > import_core.timespan.hours(6);
490
+ });
448
491
  }
449
- return super.translatePropertyKey(ctx, property, propertyKey);
450
- }
451
- };
452
- MultilevelSensorCC = __decorate([
453
- (0, import_CommandClassDecorators.commandClass)(import_safe.CommandClasses["Multilevel Sensor"]),
454
- (0, import_CommandClassDecorators.implementedVersion)(11),
455
- (0, import_CommandClassDecorators.ccValues)(MultilevelSensorCCValues)
456
- ], MultilevelSensorCC);
457
- let MultilevelSensorCCReport = MultilevelSensorCCReport_1 = class MultilevelSensorCCReport2 extends MultilevelSensorCC {
458
- constructor(options) {
459
- super(options);
460
- this.type = options.type;
461
- this.value = options.value;
462
- this.scale = typeof options.scale === "number" ? options.scale : options.scale.key;
463
- }
464
- static from(raw, ctx) {
465
- (0, import_safe.validatePayload)(raw.payload.length >= 1);
466
- const type = raw.payload[0];
467
- const { value, scale } = (0, import_safe.parseFloatWithScale)(raw.payload.subarray(1));
468
- return new MultilevelSensorCCReport_1({
469
- nodeId: ctx.sourceNodeId,
470
- type,
471
- value,
472
- scale
473
- });
474
- }
475
- persistValues(ctx) {
476
- if (!super.persistValues(ctx))
477
- return false;
478
- const sensor = (0, import_core.getSensor)(this.type);
479
- const scale = (0, import_core.getSensorScale)(this.type, this.scale) ?? (0, import_core.getUnknownScale)(this.scale);
480
- const measurementValidation = !ctx.getDeviceConfig?.(this.nodeId)?.compat?.disableStrictMeasurementValidation;
481
- const ccVersion = (0, import_CommandClass.getEffectiveCCVersion)(ctx, this);
482
- if (measurementValidation) {
483
- if (ccVersion >= 5) {
484
- const supportedSensorTypes = this.getValue(ctx, MultilevelSensorCCValues.supportedSensorTypes);
485
- if (supportedSensorTypes?.length) {
486
- import_safe.validatePayload.withReason(`Unsupported sensor type ${(0, import_core.getSensorName)(this.type)} or corrupted data`)(supportedSensorTypes.includes(this.type));
492
+ /**
493
+ * Returns which sensor types are supported.
494
+ * This only works AFTER the interview process
495
+ */
496
+ static getSupportedSensorTypesCached(ctx, endpoint) {
497
+ return ctx.getValueDB(endpoint.nodeId).getValue(MultilevelSensorCCValues.supportedSensorTypes.endpoint(endpoint.index));
498
+ }
499
+ /**
500
+ * Returns which scales are supported for a given sensor type.
501
+ * This only works AFTER the interview process
502
+ */
503
+ static getSupportedScalesCached(ctx, endpoint, sensorType) {
504
+ return ctx.getValueDB(endpoint.nodeId).getValue(MultilevelSensorCCValues.supportedScales(sensorType).endpoint(endpoint.index));
505
+ }
506
+ translatePropertyKey(ctx, property, propertyKey) {
507
+ if (property === "values" && typeof propertyKey === "number") {
508
+ const sensor = (0, import_core.getSensor)(propertyKey);
509
+ if (sensor)
510
+ return sensor.label;
511
+ }
512
+ return super.translatePropertyKey(ctx, property, propertyKey);
513
+ }
514
+ };
515
+ return MultilevelSensorCC2 = _classThis;
516
+ })();
517
+ let MultilevelSensorCCReport = (() => {
518
+ let _classDecorators = [(0, import_CommandClassDecorators.CCCommand)(import_Types.MultilevelSensorCommand.Report), (0, import_CommandClassDecorators.useSupervision)()];
519
+ let _classDescriptor;
520
+ let _classExtraInitializers = [];
521
+ let _classThis;
522
+ let _classSuper = MultilevelSensorCC;
523
+ var MultilevelSensorCCReport2 = class extends _classSuper {
524
+ static {
525
+ _classThis = this;
526
+ }
527
+ static {
528
+ const _metadata = typeof Symbol === "function" && Symbol.metadata ? Object.create(_classSuper[Symbol.metadata] ?? null) : void 0;
529
+ __esDecorate(null, _classDescriptor = { value: _classThis }, _classDecorators, { kind: "class", name: _classThis.name, metadata: _metadata }, null, _classExtraInitializers);
530
+ MultilevelSensorCCReport2 = _classThis = _classDescriptor.value;
531
+ if (_metadata) Object.defineProperty(_classThis, Symbol.metadata, { enumerable: true, configurable: true, writable: true, value: _metadata });
532
+ __runInitializers(_classThis, _classExtraInitializers);
533
+ }
534
+ constructor(options) {
535
+ super(options);
536
+ this.type = options.type;
537
+ this.value = options.value;
538
+ this.scale = typeof options.scale === "number" ? options.scale : options.scale.key;
539
+ }
540
+ static from(raw, ctx) {
541
+ (0, import_safe.validatePayload)(raw.payload.length >= 1);
542
+ const type = raw.payload[0];
543
+ const { value, scale } = (0, import_safe.parseFloatWithScale)(raw.payload.subarray(1));
544
+ return new this({
545
+ nodeId: ctx.sourceNodeId,
546
+ type,
547
+ value,
548
+ scale
549
+ });
550
+ }
551
+ persistValues(ctx) {
552
+ if (!super.persistValues(ctx))
553
+ return false;
554
+ const sensor = (0, import_core.getSensor)(this.type);
555
+ const scale = (0, import_core.getSensorScale)(this.type, this.scale) ?? (0, import_core.getUnknownScale)(this.scale);
556
+ const measurementValidation = !ctx.getDeviceConfig?.(this.nodeId)?.compat?.disableStrictMeasurementValidation;
557
+ const ccVersion = (0, import_CommandClass.getEffectiveCCVersion)(ctx, this);
558
+ if (measurementValidation) {
559
+ if (ccVersion >= 5) {
560
+ const supportedSensorTypes = this.getValue(ctx, MultilevelSensorCCValues.supportedSensorTypes);
561
+ if (supportedSensorTypes?.length) {
562
+ import_safe.validatePayload.withReason(`Unsupported sensor type ${(0, import_core.getSensorName)(this.type)} or corrupted data`)(supportedSensorTypes.includes(this.type));
563
+ }
564
+ const supportedScales = this.getValue(ctx, MultilevelSensorCCValues.supportedScales(this.type));
565
+ if (supportedScales?.length) {
566
+ import_safe.validatePayload.withReason(`Unsupported scale ${scale.label} or corrupted data`)(supportedScales.includes(scale.key));
567
+ }
568
+ } else {
569
+ import_safe.validatePayload.withReason(`Unknown sensor type ${(0, import_safe3.num2hex)(this.type)} or corrupted data`)(!!sensor);
570
+ import_safe.validatePayload.withReason(`Unknown scale ${(0, import_safe3.num2hex)(this.scale)} or corrupted data`)(scale.label !== (0, import_core.getUnknownScale)(this.scale).label);
571
+ }
572
+ }
573
+ const sensorName = (0, import_core.getSensorName)(this.type);
574
+ const sensorValue = MultilevelSensorCCValues.value(sensorName);
575
+ this.setMetadata(ctx, sensorValue, {
576
+ ...sensorValue.meta,
577
+ unit: scale.unit,
578
+ ccSpecific: {
579
+ sensorType: this.type,
580
+ scale: scale.key
487
581
  }
488
- const supportedScales = this.getValue(ctx, MultilevelSensorCCValues.supportedScales(this.type));
489
- if (supportedScales?.length) {
490
- import_safe.validatePayload.withReason(`Unsupported scale ${scale.label} or corrupted data`)(supportedScales.includes(scale.key));
582
+ });
583
+ this.setValue(ctx, sensorValue, this.value);
584
+ return true;
585
+ }
586
+ type;
587
+ scale;
588
+ value;
589
+ serialize(ctx) {
590
+ this.payload = import_safe2.Bytes.concat([
591
+ import_safe2.Bytes.from([this.type]),
592
+ (0, import_safe.encodeFloatWithScale)(this.value, this.scale)
593
+ ]);
594
+ return super.serialize(ctx);
595
+ }
596
+ toLogEntry(ctx) {
597
+ return {
598
+ ...super.toLogEntry(ctx),
599
+ message: {
600
+ "sensor type": (0, import_core.getSensorName)(this.type),
601
+ scale: ((0, import_core.getSensorScale)(this.type, this.scale) ?? (0, import_core.getUnknownScale)(this.scale)).label,
602
+ value: this.value
491
603
  }
604
+ };
605
+ }
606
+ };
607
+ return MultilevelSensorCCReport2 = _classThis;
608
+ })();
609
+ const testResponseForMultilevelSensorGet = (sent, received) => {
610
+ return sent.sensorType == void 0 || received.type === sent.sensorType;
611
+ };
612
+ let MultilevelSensorCCGet = (() => {
613
+ let _classDecorators = [(0, import_CommandClassDecorators.CCCommand)(import_Types.MultilevelSensorCommand.Get), (0, import_CommandClassDecorators.expectedCCResponse)(MultilevelSensorCCReport, testResponseForMultilevelSensorGet)];
614
+ let _classDescriptor;
615
+ let _classExtraInitializers = [];
616
+ let _classThis;
617
+ let _classSuper = MultilevelSensorCC;
618
+ var MultilevelSensorCCGet2 = class extends _classSuper {
619
+ static {
620
+ _classThis = this;
621
+ }
622
+ static {
623
+ const _metadata = typeof Symbol === "function" && Symbol.metadata ? Object.create(_classSuper[Symbol.metadata] ?? null) : void 0;
624
+ __esDecorate(null, _classDescriptor = { value: _classThis }, _classDecorators, { kind: "class", name: _classThis.name, metadata: _metadata }, null, _classExtraInitializers);
625
+ MultilevelSensorCCGet2 = _classThis = _classDescriptor.value;
626
+ if (_metadata) Object.defineProperty(_classThis, Symbol.metadata, { enumerable: true, configurable: true, writable: true, value: _metadata });
627
+ __runInitializers(_classThis, _classExtraInitializers);
628
+ }
629
+ constructor(options) {
630
+ super(options);
631
+ if ("sensorType" in options) {
632
+ this.sensorType = options.sensorType;
633
+ this.scale = options.scale;
634
+ }
635
+ }
636
+ static from(raw, ctx) {
637
+ if (raw.payload.length >= 2) {
638
+ const sensorType = raw.payload[0];
639
+ const scale = raw.payload[1] >> 3 & 3;
640
+ return new this({
641
+ nodeId: ctx.sourceNodeId,
642
+ sensorType,
643
+ scale
644
+ });
492
645
  } else {
493
- import_safe.validatePayload.withReason(`Unknown sensor type ${(0, import_safe3.num2hex)(this.type)} or corrupted data`)(!!sensor);
494
- import_safe.validatePayload.withReason(`Unknown scale ${(0, import_safe3.num2hex)(this.scale)} or corrupted data`)(scale.label !== (0, import_core.getUnknownScale)(this.scale).label);
646
+ return new this({
647
+ nodeId: ctx.sourceNodeId
648
+ });
495
649
  }
496
650
  }
497
- const sensorName = (0, import_core.getSensorName)(this.type);
498
- const sensorValue = MultilevelSensorCCValues.value(sensorName);
499
- this.setMetadata(ctx, sensorValue, {
500
- ...sensorValue.meta,
501
- unit: scale.unit,
502
- ccSpecific: {
503
- sensorType: this.type,
504
- scale: scale.key
651
+ sensorType;
652
+ scale;
653
+ serialize(ctx) {
654
+ if (this.sensorType != void 0 && this.scale != void 0) {
655
+ this.payload = import_safe2.Bytes.from([
656
+ this.sensorType,
657
+ (this.scale & 3) << 3
658
+ ]);
505
659
  }
506
- });
507
- this.setValue(ctx, sensorValue, this.value);
508
- return true;
509
- }
510
- type;
511
- scale;
512
- value;
513
- serialize(ctx) {
514
- this.payload = import_safe2.Bytes.concat([
515
- import_safe2.Bytes.from([this.type]),
516
- (0, import_safe.encodeFloatWithScale)(this.value, this.scale)
517
- ]);
518
- return super.serialize(ctx);
519
- }
520
- toLogEntry(ctx) {
521
- return {
522
- ...super.toLogEntry(ctx),
523
- message: {
524
- "sensor type": (0, import_core.getSensorName)(this.type),
525
- scale: ((0, import_core.getSensorScale)(this.type, this.scale) ?? (0, import_core.getUnknownScale)(this.scale)).label,
526
- value: this.value
660
+ return super.serialize(ctx);
661
+ }
662
+ toLogEntry(ctx) {
663
+ let message = {};
664
+ if (this.sensorType != void 0 && this.scale != void 0) {
665
+ message = {
666
+ "sensor type": (0, import_core.getSensorName)(this.sensorType),
667
+ scale: ((0, import_core.getSensorScale)(this.sensorType, this.scale) ?? (0, import_core.getUnknownScale)(this.scale)).label
668
+ };
527
669
  }
528
- };
529
- }
530
- };
531
- MultilevelSensorCCReport = MultilevelSensorCCReport_1 = __decorate([
532
- (0, import_CommandClassDecorators.CCCommand)(import_Types.MultilevelSensorCommand.Report),
533
- (0, import_CommandClassDecorators.useSupervision)()
534
- ], MultilevelSensorCCReport);
535
- const testResponseForMultilevelSensorGet = (sent, received) => {
536
- return sent.sensorType == void 0 || received.type === sent.sensorType;
537
- };
538
- let MultilevelSensorCCGet = MultilevelSensorCCGet_1 = class MultilevelSensorCCGet2 extends MultilevelSensorCC {
539
- constructor(options) {
540
- super(options);
541
- if ("sensorType" in options) {
670
+ return {
671
+ ...super.toLogEntry(ctx),
672
+ message
673
+ };
674
+ }
675
+ };
676
+ return MultilevelSensorCCGet2 = _classThis;
677
+ })();
678
+ let MultilevelSensorCCSupportedSensorReport = (() => {
679
+ let _classDecorators = [(0, import_CommandClassDecorators.CCCommand)(import_Types.MultilevelSensorCommand.SupportedSensorReport), (0, import_CommandClassDecorators.ccValueProperty)("supportedSensorTypes", MultilevelSensorCCValues.supportedSensorTypes)];
680
+ let _classDescriptor;
681
+ let _classExtraInitializers = [];
682
+ let _classThis;
683
+ let _classSuper = MultilevelSensorCC;
684
+ var MultilevelSensorCCSupportedSensorReport2 = class extends _classSuper {
685
+ static {
686
+ _classThis = this;
687
+ }
688
+ static {
689
+ const _metadata = typeof Symbol === "function" && Symbol.metadata ? Object.create(_classSuper[Symbol.metadata] ?? null) : void 0;
690
+ __esDecorate(null, _classDescriptor = { value: _classThis }, _classDecorators, { kind: "class", name: _classThis.name, metadata: _metadata }, null, _classExtraInitializers);
691
+ MultilevelSensorCCSupportedSensorReport2 = _classThis = _classDescriptor.value;
692
+ if (_metadata) Object.defineProperty(_classThis, Symbol.metadata, { enumerable: true, configurable: true, writable: true, value: _metadata });
693
+ __runInitializers(_classThis, _classExtraInitializers);
694
+ }
695
+ constructor(options) {
696
+ super(options);
697
+ this.supportedSensorTypes = options.supportedSensorTypes;
698
+ }
699
+ static from(raw, ctx) {
700
+ (0, import_safe.validatePayload)(raw.payload.length >= 1);
701
+ const supportedSensorTypes = (0, import_safe.parseBitMask)(raw.payload);
702
+ return new this({
703
+ nodeId: ctx.sourceNodeId,
704
+ supportedSensorTypes
705
+ });
706
+ }
707
+ // TODO: Use this during interview to precreate values
708
+ supportedSensorTypes;
709
+ serialize(ctx) {
710
+ this.payload = (0, import_core.encodeBitMask)(this.supportedSensorTypes);
711
+ return super.serialize(ctx);
712
+ }
713
+ toLogEntry(ctx) {
714
+ return {
715
+ ...super.toLogEntry(ctx),
716
+ message: {
717
+ "supported sensor types": this.supportedSensorTypes.map((t) => `
718
+ \xB7 ${(0, import_core.getSensorName)(t)}`).join("")
719
+ }
720
+ };
721
+ }
722
+ };
723
+ return MultilevelSensorCCSupportedSensorReport2 = _classThis;
724
+ })();
725
+ let MultilevelSensorCCGetSupportedSensor = (() => {
726
+ let _classDecorators = [(0, import_CommandClassDecorators.CCCommand)(import_Types.MultilevelSensorCommand.GetSupportedSensor), (0, import_CommandClassDecorators.expectedCCResponse)(MultilevelSensorCCSupportedSensorReport)];
727
+ let _classDescriptor;
728
+ let _classExtraInitializers = [];
729
+ let _classThis;
730
+ let _classSuper = MultilevelSensorCC;
731
+ var MultilevelSensorCCGetSupportedSensor2 = class extends _classSuper {
732
+ static {
733
+ _classThis = this;
734
+ }
735
+ static {
736
+ const _metadata = typeof Symbol === "function" && Symbol.metadata ? Object.create(_classSuper[Symbol.metadata] ?? null) : void 0;
737
+ __esDecorate(null, _classDescriptor = { value: _classThis }, _classDecorators, { kind: "class", name: _classThis.name, metadata: _metadata }, null, _classExtraInitializers);
738
+ MultilevelSensorCCGetSupportedSensor2 = _classThis = _classDescriptor.value;
739
+ if (_metadata) Object.defineProperty(_classThis, Symbol.metadata, { enumerable: true, configurable: true, writable: true, value: _metadata });
740
+ __runInitializers(_classThis, _classExtraInitializers);
741
+ }
742
+ };
743
+ return MultilevelSensorCCGetSupportedSensor2 = _classThis;
744
+ })();
745
+ let MultilevelSensorCCSupportedScaleReport = (() => {
746
+ let _classDecorators = [(0, import_CommandClassDecorators.CCCommand)(import_Types.MultilevelSensorCommand.SupportedScaleReport), (0, import_CommandClassDecorators.ccValueProperty)("supportedScales", MultilevelSensorCCValues.supportedScales, (self) => [self.sensorType])];
747
+ let _classDescriptor;
748
+ let _classExtraInitializers = [];
749
+ let _classThis;
750
+ let _classSuper = MultilevelSensorCC;
751
+ var MultilevelSensorCCSupportedScaleReport2 = class extends _classSuper {
752
+ static {
753
+ _classThis = this;
754
+ }
755
+ static {
756
+ const _metadata = typeof Symbol === "function" && Symbol.metadata ? Object.create(_classSuper[Symbol.metadata] ?? null) : void 0;
757
+ __esDecorate(null, _classDescriptor = { value: _classThis }, _classDecorators, { kind: "class", name: _classThis.name, metadata: _metadata }, null, _classExtraInitializers);
758
+ MultilevelSensorCCSupportedScaleReport2 = _classThis = _classDescriptor.value;
759
+ if (_metadata) Object.defineProperty(_classThis, Symbol.metadata, { enumerable: true, configurable: true, writable: true, value: _metadata });
760
+ __runInitializers(_classThis, _classExtraInitializers);
761
+ }
762
+ constructor(options) {
763
+ super(options);
542
764
  this.sensorType = options.sensorType;
543
- this.scale = options.scale;
765
+ this.supportedScales = options.supportedScales;
544
766
  }
545
- }
546
- static from(raw, ctx) {
547
- if (raw.payload.length >= 2) {
767
+ static from(raw, ctx) {
768
+ (0, import_safe.validatePayload)(raw.payload.length >= 2);
548
769
  const sensorType = raw.payload[0];
549
- const scale = raw.payload[1] >> 3 & 3;
550
- return new MultilevelSensorCCGet_1({
770
+ const supportedScales = (0, import_safe.parseBitMask)(import_safe2.Bytes.from([raw.payload[1] & 15]), 0);
771
+ return new this({
551
772
  nodeId: ctx.sourceNodeId,
552
773
  sensorType,
553
- scale
554
- });
555
- } else {
556
- return new MultilevelSensorCCGet_1({
557
- nodeId: ctx.sourceNodeId
774
+ supportedScales
558
775
  });
559
776
  }
560
- }
561
- sensorType;
562
- scale;
563
- serialize(ctx) {
564
- if (this.sensorType != void 0 && this.scale != void 0) {
565
- this.payload = import_safe2.Bytes.from([
566
- this.sensorType,
567
- (this.scale & 3) << 3
777
+ sensorType;
778
+ supportedScales;
779
+ serialize(ctx) {
780
+ this.payload = import_safe2.Bytes.concat([
781
+ import_safe2.Bytes.from([this.sensorType]),
782
+ (0, import_core.encodeBitMask)(this.supportedScales, 4, 0)
568
783
  ]);
784
+ return super.serialize(ctx);
569
785
  }
570
- return super.serialize(ctx);
571
- }
572
- toLogEntry(ctx) {
573
- let message = {};
574
- if (this.sensorType != void 0 && this.scale != void 0) {
575
- message = {
576
- "sensor type": (0, import_core.getSensorName)(this.sensorType),
577
- scale: ((0, import_core.getSensorScale)(this.sensorType, this.scale) ?? (0, import_core.getUnknownScale)(this.scale)).label
786
+ toLogEntry(ctx) {
787
+ return {
788
+ ...super.toLogEntry(ctx),
789
+ message: {
790
+ "sensor type": (0, import_core.getSensorName)(this.sensorType),
791
+ "supported scales": this.supportedScales.map((s) => `
792
+ \xB7 ${((0, import_core.getSensorScale)(this.sensorType, s) ?? (0, import_core.getUnknownScale)(s)).label}`).join("")
793
+ }
578
794
  };
579
795
  }
580
- return {
581
- ...super.toLogEntry(ctx),
582
- message
583
- };
584
- }
585
- };
586
- MultilevelSensorCCGet = MultilevelSensorCCGet_1 = __decorate([
587
- (0, import_CommandClassDecorators.CCCommand)(import_Types.MultilevelSensorCommand.Get),
588
- (0, import_CommandClassDecorators.expectedCCResponse)(MultilevelSensorCCReport, testResponseForMultilevelSensorGet)
589
- ], MultilevelSensorCCGet);
590
- let MultilevelSensorCCSupportedSensorReport = MultilevelSensorCCSupportedSensorReport_1 = class MultilevelSensorCCSupportedSensorReport2 extends MultilevelSensorCC {
591
- constructor(options) {
592
- super(options);
593
- this.supportedSensorTypes = options.supportedSensorTypes;
594
- }
595
- static from(raw, ctx) {
596
- (0, import_safe.validatePayload)(raw.payload.length >= 1);
597
- const supportedSensorTypes = (0, import_safe.parseBitMask)(raw.payload);
598
- return new MultilevelSensorCCSupportedSensorReport_1({
599
- nodeId: ctx.sourceNodeId,
600
- supportedSensorTypes
601
- });
602
- }
603
- // TODO: Use this during interview to precreate values
604
- supportedSensorTypes;
605
- serialize(ctx) {
606
- this.payload = (0, import_core.encodeBitMask)(this.supportedSensorTypes);
607
- return super.serialize(ctx);
608
- }
609
- toLogEntry(ctx) {
610
- return {
611
- ...super.toLogEntry(ctx),
612
- message: {
613
- "supported sensor types": this.supportedSensorTypes.map((t) => `
614
- \xB7 ${(0, import_core.getSensorName)(t)}`).join("")
615
- }
616
- };
617
- }
618
- };
619
- __decorate([
620
- (0, import_CommandClassDecorators.ccValue)(MultilevelSensorCCValues.supportedSensorTypes)
621
- ], MultilevelSensorCCSupportedSensorReport.prototype, "supportedSensorTypes", void 0);
622
- MultilevelSensorCCSupportedSensorReport = MultilevelSensorCCSupportedSensorReport_1 = __decorate([
623
- (0, import_CommandClassDecorators.CCCommand)(import_Types.MultilevelSensorCommand.SupportedSensorReport)
624
- ], MultilevelSensorCCSupportedSensorReport);
625
- let MultilevelSensorCCGetSupportedSensor = class MultilevelSensorCCGetSupportedSensor2 extends MultilevelSensorCC {
626
- };
627
- MultilevelSensorCCGetSupportedSensor = __decorate([
628
- (0, import_CommandClassDecorators.CCCommand)(import_Types.MultilevelSensorCommand.GetSupportedSensor),
629
- (0, import_CommandClassDecorators.expectedCCResponse)(MultilevelSensorCCSupportedSensorReport)
630
- ], MultilevelSensorCCGetSupportedSensor);
631
- let MultilevelSensorCCSupportedScaleReport = MultilevelSensorCCSupportedScaleReport_1 = class MultilevelSensorCCSupportedScaleReport2 extends MultilevelSensorCC {
632
- constructor(options) {
633
- super(options);
634
- this.sensorType = options.sensorType;
635
- this.supportedScales = options.supportedScales;
636
- }
637
- static from(raw, ctx) {
638
- (0, import_safe.validatePayload)(raw.payload.length >= 2);
639
- const sensorType = raw.payload[0];
640
- const supportedScales = (0, import_safe.parseBitMask)(import_safe2.Bytes.from([raw.payload[1] & 15]), 0);
641
- return new MultilevelSensorCCSupportedScaleReport_1({
642
- nodeId: ctx.sourceNodeId,
643
- sensorType,
644
- supportedScales
645
- });
646
- }
647
- sensorType;
648
- supportedScales;
649
- serialize(ctx) {
650
- this.payload = import_safe2.Bytes.concat([
651
- import_safe2.Bytes.from([this.sensorType]),
652
- (0, import_core.encodeBitMask)(this.supportedScales, 4, 0)
653
- ]);
654
- return super.serialize(ctx);
655
- }
656
- toLogEntry(ctx) {
657
- return {
658
- ...super.toLogEntry(ctx),
659
- message: {
660
- "sensor type": (0, import_core.getSensorName)(this.sensorType),
661
- "supported scales": this.supportedScales.map((s) => `
662
- \xB7 ${((0, import_core.getSensorScale)(this.sensorType, s) ?? (0, import_core.getUnknownScale)(s)).label}`).join("")
663
- }
664
- };
665
- }
666
- };
667
- __decorate([
668
- (0, import_CommandClassDecorators.ccValue)(MultilevelSensorCCValues.supportedScales, (self) => [self.sensorType])
669
- ], MultilevelSensorCCSupportedScaleReport.prototype, "supportedScales", void 0);
670
- MultilevelSensorCCSupportedScaleReport = MultilevelSensorCCSupportedScaleReport_1 = __decorate([
671
- (0, import_CommandClassDecorators.CCCommand)(import_Types.MultilevelSensorCommand.SupportedScaleReport)
672
- ], MultilevelSensorCCSupportedScaleReport);
673
- let MultilevelSensorCCGetSupportedScale = MultilevelSensorCCGetSupportedScale_1 = class MultilevelSensorCCGetSupportedScale2 extends MultilevelSensorCC {
674
- constructor(options) {
675
- super(options);
676
- this.sensorType = options.sensorType;
677
- }
678
- static from(raw, ctx) {
679
- (0, import_safe.validatePayload)(raw.payload.length >= 1);
680
- const sensorType = raw.payload[0];
681
- return new MultilevelSensorCCGetSupportedScale_1({
682
- nodeId: ctx.sourceNodeId,
683
- sensorType
684
- });
685
- }
686
- sensorType;
687
- serialize(ctx) {
688
- this.payload = import_safe2.Bytes.from([this.sensorType]);
689
- return super.serialize(ctx);
690
- }
691
- toLogEntry(ctx) {
692
- return {
693
- ...super.toLogEntry(ctx),
694
- message: {
695
- "sensor type": (0, import_core.getSensorName)(this.sensorType)
696
- }
697
- };
698
- }
699
- };
700
- MultilevelSensorCCGetSupportedScale = MultilevelSensorCCGetSupportedScale_1 = __decorate([
701
- (0, import_CommandClassDecorators.CCCommand)(import_Types.MultilevelSensorCommand.GetSupportedScale),
702
- (0, import_CommandClassDecorators.expectedCCResponse)(MultilevelSensorCCSupportedScaleReport)
703
- ], MultilevelSensorCCGetSupportedScale);
796
+ };
797
+ return MultilevelSensorCCSupportedScaleReport2 = _classThis;
798
+ })();
799
+ let MultilevelSensorCCGetSupportedScale = (() => {
800
+ let _classDecorators = [(0, import_CommandClassDecorators.CCCommand)(import_Types.MultilevelSensorCommand.GetSupportedScale), (0, import_CommandClassDecorators.expectedCCResponse)(MultilevelSensorCCSupportedScaleReport)];
801
+ let _classDescriptor;
802
+ let _classExtraInitializers = [];
803
+ let _classThis;
804
+ let _classSuper = MultilevelSensorCC;
805
+ var MultilevelSensorCCGetSupportedScale2 = class extends _classSuper {
806
+ static {
807
+ _classThis = this;
808
+ }
809
+ static {
810
+ const _metadata = typeof Symbol === "function" && Symbol.metadata ? Object.create(_classSuper[Symbol.metadata] ?? null) : void 0;
811
+ __esDecorate(null, _classDescriptor = { value: _classThis }, _classDecorators, { kind: "class", name: _classThis.name, metadata: _metadata }, null, _classExtraInitializers);
812
+ MultilevelSensorCCGetSupportedScale2 = _classThis = _classDescriptor.value;
813
+ if (_metadata) Object.defineProperty(_classThis, Symbol.metadata, { enumerable: true, configurable: true, writable: true, value: _metadata });
814
+ __runInitializers(_classThis, _classExtraInitializers);
815
+ }
816
+ constructor(options) {
817
+ super(options);
818
+ this.sensorType = options.sensorType;
819
+ }
820
+ static from(raw, ctx) {
821
+ (0, import_safe.validatePayload)(raw.payload.length >= 1);
822
+ const sensorType = raw.payload[0];
823
+ return new this({
824
+ nodeId: ctx.sourceNodeId,
825
+ sensorType
826
+ });
827
+ }
828
+ sensorType;
829
+ serialize(ctx) {
830
+ this.payload = import_safe2.Bytes.from([this.sensorType]);
831
+ return super.serialize(ctx);
832
+ }
833
+ toLogEntry(ctx) {
834
+ return {
835
+ ...super.toLogEntry(ctx),
836
+ message: {
837
+ "sensor type": (0, import_core.getSensorName)(this.sensorType)
838
+ }
839
+ };
840
+ }
841
+ };
842
+ return MultilevelSensorCCGetSupportedScale2 = _classThis;
843
+ })();
704
844
  // Annotate the CommonJS export names for ESM import in node:
705
845
  0 && (module.exports = {
706
846
  MultilevelSensorCC,