@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 ThermostatSetpointCCSet_1, ThermostatSetpointCCReport_1, ThermostatSetpointCCGet_1, ThermostatSetpointCCCapabilitiesReport_1, ThermostatSetpointCCCapabilitiesGet_1, ThermostatSetpointCCSupportedReport_1;
48
80
  function __assertType(argName, typeName, boundHasError) {
49
81
  const { ZWaveError: ZWaveError2, ZWaveErrorCodes: ZWaveErrorCodes2 } = require("@zwave-js/core");
50
82
  if (boundHasError()) {
@@ -93,202 +125,261 @@ const ThermostatSetpointCCValues = Object.freeze({
93
125
  ...import_Values.V.dynamicPropertyAndKeyWithName("setpointScale", "setpointScale", (setpointType) => setpointType, ({ property, propertyKey }) => property === "setpointScale" && typeof propertyKey === "number", void 0, { internal: true })
94
126
  })
95
127
  });
96
- let ThermostatSetpointCCAPI = class ThermostatSetpointCCAPI2 extends import_API.CCAPI {
97
- supportsCommand(cmd) {
98
- switch (cmd) {
99
- case import_Types.ThermostatSetpointCommand.Get:
100
- case import_Types.ThermostatSetpointCommand.SupportedGet:
101
- return this.isSinglecast();
102
- case import_Types.ThermostatSetpointCommand.Set:
103
- return true;
104
- // This is mandatory
105
- case import_Types.ThermostatSetpointCommand.CapabilitiesGet:
106
- return this.version >= 3 && this.isSinglecast();
107
- }
108
- return super.supportsCommand(cmd);
109
- }
110
- get [import_API.SET_VALUE]() {
111
- return async function({ property, propertyKey }, value) {
112
- if (property !== "setpoint") {
113
- (0, import_API.throwUnsupportedProperty)(this.ccId, property);
114
- }
115
- if (typeof propertyKey !== "number") {
116
- throw new import_safe.ZWaveError(`${import_safe.CommandClasses[this.ccId]}: "${property}" must be further specified by a numeric property key`, import_safe.ZWaveErrorCodes.Argument_Invalid);
117
- }
118
- if (typeof value !== "number") {
119
- (0, import_API.throwWrongValueType)(this.ccId, property, "number", typeof value);
120
- }
121
- const preferredScale = this.tryGetValueDB()?.getValue(ThermostatSetpointCCValues.setpointScale(propertyKey).endpoint(this.endpoint.index));
122
- const result = await this.set(propertyKey, value, preferredScale ?? 0);
123
- if (this.isSinglecast() && !(0, import_safe.supervisedCommandSucceeded)(result)) {
124
- this.schedulePoll({ property, propertyKey }, value);
128
+ let ThermostatSetpointCCAPI = (() => {
129
+ let _classDecorators = [(0, import_CommandClassDecorators.API)(import_safe.CommandClasses["Thermostat Setpoint"])];
130
+ let _classDescriptor;
131
+ let _classExtraInitializers = [];
132
+ let _classThis;
133
+ let _classSuper = import_API.CCAPI;
134
+ var ThermostatSetpointCCAPI2 = class extends _classSuper {
135
+ static {
136
+ _classThis = this;
137
+ }
138
+ static {
139
+ const _metadata = typeof Symbol === "function" && Symbol.metadata ? Object.create(_classSuper[Symbol.metadata] ?? null) : void 0;
140
+ __esDecorate(null, _classDescriptor = { value: _classThis }, _classDecorators, { kind: "class", name: _classThis.name, metadata: _metadata }, null, _classExtraInitializers);
141
+ ThermostatSetpointCCAPI2 = _classThis = _classDescriptor.value;
142
+ if (_metadata) Object.defineProperty(_classThis, Symbol.metadata, { enumerable: true, configurable: true, writable: true, value: _metadata });
143
+ __runInitializers(_classThis, _classExtraInitializers);
144
+ }
145
+ supportsCommand(cmd) {
146
+ switch (cmd) {
147
+ case import_Types.ThermostatSetpointCommand.Get:
148
+ case import_Types.ThermostatSetpointCommand.SupportedGet:
149
+ return this.isSinglecast();
150
+ case import_Types.ThermostatSetpointCommand.Set:
151
+ return true;
152
+ // This is mandatory
153
+ case import_Types.ThermostatSetpointCommand.CapabilitiesGet:
154
+ return this.version >= 3 && this.isSinglecast();
125
155
  }
126
- return result;
127
- };
128
- }
129
- get [import_API.POLL_VALUE]() {
130
- return async function({ property, propertyKey }) {
131
- switch (property) {
132
- case "setpoint":
133
- if (typeof propertyKey !== "number") {
134
- throw new import_safe.ZWaveError(`${import_safe.CommandClasses[this.ccId]}: "${property}" must be further specified by a numeric property key`, import_safe.ZWaveErrorCodes.Argument_Invalid);
135
- }
136
- return (await this.get(propertyKey))?.value;
137
- default:
156
+ return super.supportsCommand(cmd);
157
+ }
158
+ get [import_API.SET_VALUE]() {
159
+ return async function({ property, propertyKey }, value) {
160
+ if (property !== "setpoint") {
138
161
  (0, import_API.throwUnsupportedProperty)(this.ccId, property);
162
+ }
163
+ if (typeof propertyKey !== "number") {
164
+ throw new import_safe.ZWaveError(`${import_safe.CommandClasses[this.ccId]}: "${property}" must be further specified by a numeric property key`, import_safe.ZWaveErrorCodes.Argument_Invalid);
165
+ }
166
+ if (typeof value !== "number") {
167
+ (0, import_API.throwWrongValueType)(this.ccId, property, "number", typeof value);
168
+ }
169
+ const preferredScale = this.tryGetValueDB()?.getValue(ThermostatSetpointCCValues.setpointScale(propertyKey).endpoint(this.endpoint.index));
170
+ const result = await this.set(propertyKey, value, preferredScale ?? 0);
171
+ if (this.isSinglecast() && !(0, import_safe.supervisedCommandSucceeded)(result)) {
172
+ this.schedulePoll({ property, propertyKey }, value);
173
+ }
174
+ return result;
175
+ };
176
+ }
177
+ get [import_API.POLL_VALUE]() {
178
+ return async function({ property, propertyKey }) {
179
+ switch (property) {
180
+ case "setpoint":
181
+ if (typeof propertyKey !== "number") {
182
+ throw new import_safe.ZWaveError(`${import_safe.CommandClasses[this.ccId]}: "${property}" must be further specified by a numeric property key`, import_safe.ZWaveErrorCodes.Argument_Invalid);
183
+ }
184
+ return (await this.get(propertyKey))?.value;
185
+ default:
186
+ (0, import_API.throwUnsupportedProperty)(this.ccId, property);
187
+ }
188
+ };
189
+ }
190
+ async get(setpointType) {
191
+ __assertType("setpointType", "ThermostatSetpointType", __assertType__number.bind(void 0, setpointType));
192
+ this.assertSupportsCommand(import_Types.ThermostatSetpointCommand, import_Types.ThermostatSetpointCommand.Get);
193
+ const cc = new ThermostatSetpointCCGet({
194
+ nodeId: this.endpoint.nodeId,
195
+ endpointIndex: this.endpoint.index,
196
+ setpointType
197
+ });
198
+ const response = await this.host.sendCommand(cc, this.commandOptions);
199
+ if (!response)
200
+ return;
201
+ if (response.type !== import_Types.ThermostatSetpointType["N/A"]) {
202
+ const scale = getScale(response.scale);
203
+ return {
204
+ value: response.value,
205
+ scale
206
+ };
139
207
  }
140
- };
141
- }
142
- async get(setpointType) {
143
- __assertType("setpointType", "ThermostatSetpointType", __assertType__number.bind(void 0, setpointType));
144
- this.assertSupportsCommand(import_Types.ThermostatSetpointCommand, import_Types.ThermostatSetpointCommand.Get);
145
- const cc = new ThermostatSetpointCCGet({
146
- nodeId: this.endpoint.nodeId,
147
- endpointIndex: this.endpoint.index,
148
- setpointType
149
- });
150
- const response = await this.host.sendCommand(cc, this.commandOptions);
151
- if (!response)
152
- return;
153
- if (response.type !== import_Types.ThermostatSetpointType["N/A"]) {
154
- const scale = getScale(response.scale);
155
- return {
156
- value: response.value,
208
+ }
209
+ async set(setpointType, value, scale) {
210
+ __assertType("setpointType", "ThermostatSetpointType", __assertType__number.bind(void 0, setpointType));
211
+ __assertType("value", "number", __assertType__number.bind(void 0, value));
212
+ __assertType("scale", "number", __assertType__number.bind(void 0, scale));
213
+ this.assertSupportsCommand(import_Types.ThermostatSetpointCommand, import_Types.ThermostatSetpointCommand.Set);
214
+ const cc = new ThermostatSetpointCCSet({
215
+ nodeId: this.endpoint.nodeId,
216
+ endpointIndex: this.endpoint.index,
217
+ setpointType,
218
+ value,
157
219
  scale
158
- };
220
+ });
221
+ return this.host.sendCommand(cc, this.commandOptions);
159
222
  }
160
- }
161
- async set(setpointType, value, scale) {
162
- __assertType("setpointType", "ThermostatSetpointType", __assertType__number.bind(void 0, setpointType));
163
- __assertType("value", "number", __assertType__number.bind(void 0, value));
164
- __assertType("scale", "number", __assertType__number.bind(void 0, scale));
165
- this.assertSupportsCommand(import_Types.ThermostatSetpointCommand, import_Types.ThermostatSetpointCommand.Set);
166
- const cc = new ThermostatSetpointCCSet({
167
- nodeId: this.endpoint.nodeId,
168
- endpointIndex: this.endpoint.index,
169
- setpointType,
170
- value,
171
- scale
172
- });
173
- return this.host.sendCommand(cc, this.commandOptions);
174
- }
175
- async getCapabilities(setpointType) {
176
- __assertType("setpointType", "ThermostatSetpointType", __assertType__number.bind(void 0, setpointType));
177
- this.assertSupportsCommand(import_Types.ThermostatSetpointCommand, import_Types.ThermostatSetpointCommand.CapabilitiesGet);
178
- const cc = new ThermostatSetpointCCCapabilitiesGet({
179
- nodeId: this.endpoint.nodeId,
180
- endpointIndex: this.endpoint.index,
181
- setpointType
182
- });
183
- const response = await this.host.sendCommand(cc, this.commandOptions);
184
- if (response) {
185
- return (0, import_safe3.pick)(response, [
186
- "minValue",
187
- "maxValue",
188
- "minValueScale",
189
- "maxValueScale"
190
- ]);
223
+ async getCapabilities(setpointType) {
224
+ __assertType("setpointType", "ThermostatSetpointType", __assertType__number.bind(void 0, setpointType));
225
+ this.assertSupportsCommand(import_Types.ThermostatSetpointCommand, import_Types.ThermostatSetpointCommand.CapabilitiesGet);
226
+ const cc = new ThermostatSetpointCCCapabilitiesGet({
227
+ nodeId: this.endpoint.nodeId,
228
+ endpointIndex: this.endpoint.index,
229
+ setpointType
230
+ });
231
+ const response = await this.host.sendCommand(cc, this.commandOptions);
232
+ if (response) {
233
+ return (0, import_safe3.pick)(response, [
234
+ "minValue",
235
+ "maxValue",
236
+ "minValueScale",
237
+ "maxValueScale"
238
+ ]);
239
+ }
191
240
  }
192
- }
193
- /**
194
- * Requests the supported setpoint types from the node. Due to inconsistencies it is NOT recommended
195
- * to use this method on nodes with CC versions 1 and 2. Instead rely on the information determined
196
- * during node interview.
197
- */
198
- async getSupportedSetpointTypes() {
199
- this.assertSupportsCommand(import_Types.ThermostatSetpointCommand, import_Types.ThermostatSetpointCommand.SupportedGet);
200
- const cc = new ThermostatSetpointCCSupportedGet({
201
- nodeId: this.endpoint.nodeId,
202
- endpointIndex: this.endpoint.index
203
- });
204
- const response = await this.host.sendCommand(cc, this.commandOptions);
205
- return response?.supportedSetpointTypes;
206
- }
207
- };
208
- ThermostatSetpointCCAPI = __decorate([
209
- (0, import_CommandClassDecorators.API)(import_safe.CommandClasses["Thermostat Setpoint"])
210
- ], ThermostatSetpointCCAPI);
211
- let ThermostatSetpointCC = class ThermostatSetpointCC2 extends import_CommandClass.CommandClass {
212
- translatePropertyKey(ctx, property, propertyKey) {
213
- if (property === "setpoint") {
214
- return (0, import_safe3.getEnumMemberName)(import_Types.ThermostatSetpointType, propertyKey);
215
- } else {
216
- return super.translatePropertyKey(ctx, property, propertyKey);
241
+ /**
242
+ * Requests the supported setpoint types from the node. Due to inconsistencies it is NOT recommended
243
+ * to use this method on nodes with CC versions 1 and 2. Instead rely on the information determined
244
+ * during node interview.
245
+ */
246
+ async getSupportedSetpointTypes() {
247
+ this.assertSupportsCommand(import_Types.ThermostatSetpointCommand, import_Types.ThermostatSetpointCommand.SupportedGet);
248
+ const cc = new ThermostatSetpointCCSupportedGet({
249
+ nodeId: this.endpoint.nodeId,
250
+ endpointIndex: this.endpoint.index
251
+ });
252
+ const response = await this.host.sendCommand(cc, this.commandOptions);
253
+ return response?.supportedSetpointTypes;
217
254
  }
218
- }
219
- async interview(ctx) {
220
- const node = this.getNode(ctx);
221
- const endpoint = this.getEndpoint(ctx);
222
- const api = import_API.CCAPI.create(import_safe.CommandClasses["Thermostat Setpoint"], ctx, endpoint).withOptions({
223
- priority: import_safe.MessagePriority.NodeQuery
224
- });
225
- ctx.logNode(node.id, {
226
- endpoint: this.endpointIndex,
227
- message: `Interviewing ${this.ccName}...`,
228
- direction: "none"
229
- });
230
- if (api.version <= 2) {
231
- const supportedSetpointTypes = [];
232
- for (let type = import_Types.ThermostatSetpointType.Heating; type <= import_Types.ThermostatSetpointType["Full Power"]; type++) {
233
- const setpointName = (0, import_safe3.getEnumMemberName)(import_Types.ThermostatSetpointType, type);
234
- ctx.logNode(node.id, {
235
- endpoint: this.endpointIndex,
236
- message: `querying current value of setpoint ${setpointName}...`,
237
- direction: "outbound"
238
- });
239
- const setpoint = await api.get(type);
240
- let logMessage;
241
- if (setpoint) {
242
- supportedSetpointTypes.push(type);
243
- logMessage = `received current value of setpoint ${setpointName}: ${setpoint.value} ${setpoint.scale.unit ?? ""}`;
244
- } else {
245
- logMessage = `setpoint ${setpointName} is not supported`;
246
- }
247
- ctx.logNode(node.id, {
248
- endpoint: this.endpointIndex,
249
- message: logMessage,
250
- direction: "inbound"
251
- });
255
+ };
256
+ return ThermostatSetpointCCAPI2 = _classThis;
257
+ })();
258
+ let ThermostatSetpointCC = (() => {
259
+ let _classDecorators = [(0, import_CommandClassDecorators.commandClass)(import_safe.CommandClasses["Thermostat Setpoint"]), (0, import_CommandClassDecorators.implementedVersion)(3), (0, import_CommandClassDecorators.ccValues)(ThermostatSetpointCCValues)];
260
+ let _classDescriptor;
261
+ let _classExtraInitializers = [];
262
+ let _classThis;
263
+ let _classSuper = import_CommandClass.CommandClass;
264
+ var ThermostatSetpointCC2 = class extends _classSuper {
265
+ static {
266
+ _classThis = this;
267
+ }
268
+ static {
269
+ const _metadata = typeof Symbol === "function" && Symbol.metadata ? Object.create(_classSuper[Symbol.metadata] ?? null) : void 0;
270
+ __esDecorate(null, _classDescriptor = { value: _classThis }, _classDecorators, { kind: "class", name: _classThis.name, metadata: _metadata }, null, _classExtraInitializers);
271
+ ThermostatSetpointCC2 = _classThis = _classDescriptor.value;
272
+ if (_metadata) Object.defineProperty(_classThis, Symbol.metadata, { enumerable: true, configurable: true, writable: true, value: _metadata });
273
+ __runInitializers(_classThis, _classExtraInitializers);
274
+ }
275
+ translatePropertyKey(ctx, property, propertyKey) {
276
+ if (property === "setpoint") {
277
+ return (0, import_safe3.getEnumMemberName)(import_Types.ThermostatSetpointType, propertyKey);
278
+ } else {
279
+ return super.translatePropertyKey(ctx, property, propertyKey);
252
280
  }
253
- this.setValue(ctx, ThermostatSetpointCCValues.supportedSetpointTypes, supportedSetpointTypes);
254
- } else {
255
- let setpointTypes = [];
281
+ }
282
+ async interview(ctx) {
283
+ const node = this.getNode(ctx);
284
+ const endpoint = this.getEndpoint(ctx);
285
+ const api = import_API.CCAPI.create(import_safe.CommandClasses["Thermostat Setpoint"], ctx, endpoint).withOptions({
286
+ priority: import_safe.MessagePriority.NodeQuery
287
+ });
256
288
  ctx.logNode(node.id, {
257
289
  endpoint: this.endpointIndex,
258
- message: "retrieving supported setpoint types...",
259
- direction: "outbound"
290
+ message: `Interviewing ${this.ccName}...`,
291
+ direction: "none"
260
292
  });
261
- const resp = await api.getSupportedSetpointTypes();
262
- if (resp) {
263
- setpointTypes = [...resp];
264
- const logMessage = "received supported setpoint types:\n" + setpointTypes.map((type) => (0, import_safe3.getEnumMemberName)(import_Types.ThermostatSetpointType, type)).map((name) => `\xB7 ${name}`).join("\n");
265
- ctx.logNode(node.id, {
266
- endpoint: this.endpointIndex,
267
- message: logMessage,
268
- direction: "inbound"
269
- });
293
+ if (api.version <= 2) {
294
+ const supportedSetpointTypes = [];
295
+ for (let type = import_Types.ThermostatSetpointType.Heating; type <= import_Types.ThermostatSetpointType["Full Power"]; type++) {
296
+ const setpointName = (0, import_safe3.getEnumMemberName)(import_Types.ThermostatSetpointType, type);
297
+ ctx.logNode(node.id, {
298
+ endpoint: this.endpointIndex,
299
+ message: `querying current value of setpoint ${setpointName}...`,
300
+ direction: "outbound"
301
+ });
302
+ const setpoint = await api.get(type);
303
+ let logMessage;
304
+ if (setpoint) {
305
+ supportedSetpointTypes.push(type);
306
+ logMessage = `received current value of setpoint ${setpointName}: ${setpoint.value} ${setpoint.scale.unit ?? ""}`;
307
+ } else {
308
+ logMessage = `setpoint ${setpointName} is not supported`;
309
+ }
310
+ ctx.logNode(node.id, {
311
+ endpoint: this.endpointIndex,
312
+ message: logMessage,
313
+ direction: "inbound"
314
+ });
315
+ }
316
+ this.setValue(ctx, ThermostatSetpointCCValues.supportedSetpointTypes, supportedSetpointTypes);
270
317
  } else {
318
+ let setpointTypes = [];
271
319
  ctx.logNode(node.id, {
272
320
  endpoint: this.endpointIndex,
273
- message: "Querying supported setpoint types timed out, skipping interview...",
274
- level: "warn"
321
+ message: "retrieving supported setpoint types...",
322
+ direction: "outbound"
275
323
  });
276
- return;
324
+ const resp = await api.getSupportedSetpointTypes();
325
+ if (resp) {
326
+ setpointTypes = [...resp];
327
+ const logMessage = "received supported setpoint types:\n" + setpointTypes.map((type) => (0, import_safe3.getEnumMemberName)(import_Types.ThermostatSetpointType, type)).map((name) => `\xB7 ${name}`).join("\n");
328
+ ctx.logNode(node.id, {
329
+ endpoint: this.endpointIndex,
330
+ message: logMessage,
331
+ direction: "inbound"
332
+ });
333
+ } else {
334
+ ctx.logNode(node.id, {
335
+ endpoint: this.endpointIndex,
336
+ message: "Querying supported setpoint types timed out, skipping interview...",
337
+ level: "warn"
338
+ });
339
+ return;
340
+ }
341
+ for (const type of setpointTypes) {
342
+ const setpointName = (0, import_safe3.getEnumMemberName)(import_Types.ThermostatSetpointType, type);
343
+ ctx.logNode(node.id, {
344
+ endpoint: this.endpointIndex,
345
+ message: `retrieving capabilities for setpoint ${setpointName}...`,
346
+ direction: "outbound"
347
+ });
348
+ const setpointCaps = await api.getCapabilities(type);
349
+ if (setpointCaps) {
350
+ const minValueUnit = getSetpointUnit(setpointCaps.minValueScale);
351
+ const maxValueUnit = getSetpointUnit(setpointCaps.maxValueScale);
352
+ const logMessage = `received capabilities for setpoint ${setpointName}:
353
+ minimum value: ${setpointCaps.minValue} ${minValueUnit}
354
+ maximum value: ${setpointCaps.maxValue} ${maxValueUnit}`;
355
+ ctx.logNode(node.id, {
356
+ endpoint: this.endpointIndex,
357
+ message: logMessage,
358
+ direction: "inbound"
359
+ });
360
+ }
361
+ }
362
+ await this.refreshValues(ctx);
277
363
  }
364
+ this.setInterviewComplete(ctx, true);
365
+ }
366
+ async refreshValues(ctx) {
367
+ const node = this.getNode(ctx);
368
+ const endpoint = this.getEndpoint(ctx);
369
+ const api = import_API.CCAPI.create(import_safe.CommandClasses["Thermostat Setpoint"], ctx, endpoint).withOptions({
370
+ priority: import_safe.MessagePriority.NodeQuery
371
+ });
372
+ const setpointTypes = this.getValue(ctx, ThermostatSetpointCCValues.supportedSetpointTypes) ?? [];
278
373
  for (const type of setpointTypes) {
279
374
  const setpointName = (0, import_safe3.getEnumMemberName)(import_Types.ThermostatSetpointType, type);
280
375
  ctx.logNode(node.id, {
281
376
  endpoint: this.endpointIndex,
282
- message: `retrieving capabilities for setpoint ${setpointName}...`,
377
+ message: `querying current value of setpoint ${setpointName}...`,
283
378
  direction: "outbound"
284
379
  });
285
- const setpointCaps = await api.getCapabilities(type);
286
- if (setpointCaps) {
287
- const minValueUnit = getSetpointUnit(setpointCaps.minValueScale);
288
- const maxValueUnit = getSetpointUnit(setpointCaps.maxValueScale);
289
- const logMessage = `received capabilities for setpoint ${setpointName}:
290
- minimum value: ${setpointCaps.minValue} ${minValueUnit}
291
- maximum value: ${setpointCaps.maxValue} ${maxValueUnit}`;
380
+ const setpoint = await api.get(type);
381
+ if (setpoint) {
382
+ const logMessage = `received current value of setpoint ${setpointName}: ${setpoint.value} ${setpoint.scale.unit ?? ""}`;
292
383
  ctx.logNode(node.id, {
293
384
  endpoint: this.endpointIndex,
294
385
  message: logMessage,
@@ -296,332 +387,395 @@ maximum value: ${setpointCaps.maxValue} ${maxValueUnit}`;
296
387
  });
297
388
  }
298
389
  }
299
- await this.refreshValues(ctx);
300
390
  }
301
- this.setInterviewComplete(ctx, true);
302
- }
303
- async refreshValues(ctx) {
304
- const node = this.getNode(ctx);
305
- const endpoint = this.getEndpoint(ctx);
306
- const api = import_API.CCAPI.create(import_safe.CommandClasses["Thermostat Setpoint"], ctx, endpoint).withOptions({
307
- priority: import_safe.MessagePriority.NodeQuery
308
- });
309
- const setpointTypes = this.getValue(ctx, ThermostatSetpointCCValues.supportedSetpointTypes) ?? [];
310
- for (const type of setpointTypes) {
311
- const setpointName = (0, import_safe3.getEnumMemberName)(import_Types.ThermostatSetpointType, type);
312
- ctx.logNode(node.id, {
313
- endpoint: this.endpointIndex,
314
- message: `querying current value of setpoint ${setpointName}...`,
315
- direction: "outbound"
391
+ };
392
+ return ThermostatSetpointCC2 = _classThis;
393
+ })();
394
+ let ThermostatSetpointCCSet = (() => {
395
+ let _classDecorators = [(0, import_CommandClassDecorators.CCCommand)(import_Types.ThermostatSetpointCommand.Set), (0, import_CommandClassDecorators.useSupervision)()];
396
+ let _classDescriptor;
397
+ let _classExtraInitializers = [];
398
+ let _classThis;
399
+ let _classSuper = ThermostatSetpointCC;
400
+ var ThermostatSetpointCCSet2 = class extends _classSuper {
401
+ static {
402
+ _classThis = this;
403
+ }
404
+ static {
405
+ const _metadata = typeof Symbol === "function" && Symbol.metadata ? Object.create(_classSuper[Symbol.metadata] ?? null) : void 0;
406
+ __esDecorate(null, _classDescriptor = { value: _classThis }, _classDecorators, { kind: "class", name: _classThis.name, metadata: _metadata }, null, _classExtraInitializers);
407
+ ThermostatSetpointCCSet2 = _classThis = _classDescriptor.value;
408
+ if (_metadata) Object.defineProperty(_classThis, Symbol.metadata, { enumerable: true, configurable: true, writable: true, value: _metadata });
409
+ __runInitializers(_classThis, _classExtraInitializers);
410
+ }
411
+ constructor(options) {
412
+ super(options);
413
+ this.setpointType = options.setpointType;
414
+ this.value = options.value;
415
+ this.scale = options.scale;
416
+ }
417
+ static from(raw, ctx) {
418
+ (0, import_safe.validatePayload)(raw.payload.length >= 1);
419
+ const setpointType = raw.payload[0] & 15;
420
+ const { value, scale } = (0, import_safe.parseFloatWithScale)(raw.payload.subarray(1));
421
+ return new this({
422
+ nodeId: ctx.sourceNodeId,
423
+ setpointType,
424
+ value,
425
+ scale
316
426
  });
317
- const setpoint = await api.get(type);
318
- if (setpoint) {
319
- const logMessage = `received current value of setpoint ${setpointName}: ${setpoint.value} ${setpoint.scale.unit ?? ""}`;
320
- ctx.logNode(node.id, {
321
- endpoint: this.endpointIndex,
322
- message: logMessage,
323
- direction: "inbound"
427
+ }
428
+ setpointType;
429
+ value;
430
+ scale;
431
+ serialize(ctx) {
432
+ const override = ctx.getDeviceConfig?.(this.nodeId)?.compat?.overrideFloatEncoding;
433
+ this.payload = import_safe2.Bytes.concat([
434
+ import_safe2.Bytes.from([this.setpointType & 15]),
435
+ (0, import_safe.encodeFloatWithScale)(this.value, this.scale, override)
436
+ ]);
437
+ return super.serialize(ctx);
438
+ }
439
+ toLogEntry(ctx) {
440
+ const scale = getScale(this.scale);
441
+ return {
442
+ ...super.toLogEntry(ctx),
443
+ message: {
444
+ "setpoint type": (0, import_safe3.getEnumMemberName)(import_Types.ThermostatSetpointType, this.setpointType),
445
+ value: `${this.value} ${scale.unit}`
446
+ }
447
+ };
448
+ }
449
+ };
450
+ return ThermostatSetpointCCSet2 = _classThis;
451
+ })();
452
+ let ThermostatSetpointCCReport = (() => {
453
+ let _classDecorators = [(0, import_CommandClassDecorators.CCCommand)(import_Types.ThermostatSetpointCommand.Report)];
454
+ let _classDescriptor;
455
+ let _classExtraInitializers = [];
456
+ let _classThis;
457
+ let _classSuper = ThermostatSetpointCC;
458
+ var ThermostatSetpointCCReport2 = class extends _classSuper {
459
+ static {
460
+ _classThis = this;
461
+ }
462
+ static {
463
+ const _metadata = typeof Symbol === "function" && Symbol.metadata ? Object.create(_classSuper[Symbol.metadata] ?? null) : void 0;
464
+ __esDecorate(null, _classDescriptor = { value: _classThis }, _classDecorators, { kind: "class", name: _classThis.name, metadata: _metadata }, null, _classExtraInitializers);
465
+ ThermostatSetpointCCReport2 = _classThis = _classDescriptor.value;
466
+ if (_metadata) Object.defineProperty(_classThis, Symbol.metadata, { enumerable: true, configurable: true, writable: true, value: _metadata });
467
+ __runInitializers(_classThis, _classExtraInitializers);
468
+ }
469
+ constructor(options) {
470
+ super(options);
471
+ this.type = options.type;
472
+ this.value = options.value;
473
+ this.scale = options.scale;
474
+ }
475
+ static from(raw, ctx) {
476
+ (0, import_safe.validatePayload)(raw.payload.length >= 1);
477
+ const type = raw.payload[0] & 15;
478
+ if (type === 0) {
479
+ return new this({
480
+ nodeId: ctx.sourceNodeId,
481
+ type,
482
+ value: 0,
483
+ scale: 0
324
484
  });
325
485
  }
486
+ const { value, scale } = (0, import_safe.parseFloatWithScale)(raw.payload.subarray(1));
487
+ return new this({
488
+ nodeId: ctx.sourceNodeId,
489
+ type,
490
+ value,
491
+ scale
492
+ });
326
493
  }
327
- }
328
- };
329
- ThermostatSetpointCC = __decorate([
330
- (0, import_CommandClassDecorators.commandClass)(import_safe.CommandClasses["Thermostat Setpoint"]),
331
- (0, import_CommandClassDecorators.implementedVersion)(3),
332
- (0, import_CommandClassDecorators.ccValues)(ThermostatSetpointCCValues)
333
- ], ThermostatSetpointCC);
334
- let ThermostatSetpointCCSet = ThermostatSetpointCCSet_1 = class ThermostatSetpointCCSet2 extends ThermostatSetpointCC {
335
- constructor(options) {
336
- super(options);
337
- this.setpointType = options.setpointType;
338
- this.value = options.value;
339
- this.scale = options.scale;
340
- }
341
- static from(raw, ctx) {
342
- (0, import_safe.validatePayload)(raw.payload.length >= 1);
343
- const setpointType = raw.payload[0] & 15;
344
- const { value, scale } = (0, import_safe.parseFloatWithScale)(raw.payload.subarray(1));
345
- return new ThermostatSetpointCCSet_1({
346
- nodeId: ctx.sourceNodeId,
347
- setpointType,
348
- value,
349
- scale
350
- });
351
- }
352
- setpointType;
353
- value;
354
- scale;
355
- serialize(ctx) {
356
- const override = ctx.getDeviceConfig?.(this.nodeId)?.compat?.overrideFloatEncoding;
357
- this.payload = import_safe2.Bytes.concat([
358
- import_safe2.Bytes.from([this.setpointType & 15]),
359
- (0, import_safe.encodeFloatWithScale)(this.value, this.scale, override)
360
- ]);
361
- return super.serialize(ctx);
362
- }
363
- toLogEntry(ctx) {
364
- const scale = getScale(this.scale);
365
- return {
366
- ...super.toLogEntry(ctx),
367
- message: {
368
- "setpoint type": (0, import_safe3.getEnumMemberName)(import_Types.ThermostatSetpointType, this.setpointType),
369
- value: `${this.value} ${scale.unit}`
494
+ persistValues(ctx) {
495
+ if (!super.persistValues(ctx))
496
+ return false;
497
+ const scale = getScale(this.scale);
498
+ const setpointValue = ThermostatSetpointCCValues.setpoint(this.type);
499
+ const existingMetadata = this.getMetadata(ctx, setpointValue);
500
+ if (existingMetadata?.unit !== scale.unit) {
501
+ this.setMetadata(ctx, setpointValue, {
502
+ ...existingMetadata ?? setpointValue.meta,
503
+ unit: scale.unit
504
+ });
370
505
  }
371
- };
372
- }
373
- };
374
- ThermostatSetpointCCSet = ThermostatSetpointCCSet_1 = __decorate([
375
- (0, import_CommandClassDecorators.CCCommand)(import_Types.ThermostatSetpointCommand.Set),
376
- (0, import_CommandClassDecorators.useSupervision)()
377
- ], ThermostatSetpointCCSet);
378
- let ThermostatSetpointCCReport = ThermostatSetpointCCReport_1 = class ThermostatSetpointCCReport2 extends ThermostatSetpointCC {
379
- constructor(options) {
380
- super(options);
381
- this.type = options.type;
382
- this.value = options.value;
383
- this.scale = options.scale;
384
- }
385
- static from(raw, ctx) {
386
- (0, import_safe.validatePayload)(raw.payload.length >= 1);
387
- const type = raw.payload[0] & 15;
388
- if (type === 0) {
389
- return new ThermostatSetpointCCReport_1({
506
+ this.setValue(ctx, setpointValue, this.value);
507
+ this.setValue(ctx, ThermostatSetpointCCValues.setpointScale(this.type), scale.key);
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 & 15]),
516
+ (0, import_safe.encodeFloatWithScale)(this.value, this.scale)
517
+ ]);
518
+ return super.serialize(ctx);
519
+ }
520
+ toLogEntry(ctx) {
521
+ const scale = getScale(this.scale);
522
+ return {
523
+ ...super.toLogEntry(ctx),
524
+ message: {
525
+ "setpoint type": (0, import_safe3.getEnumMemberName)(import_Types.ThermostatSetpointType, this.type),
526
+ value: `${this.value} ${scale.unit}`
527
+ }
528
+ };
529
+ }
530
+ };
531
+ return ThermostatSetpointCCReport2 = _classThis;
532
+ })();
533
+ function testResponseForThermostatSetpointGet(sent, received) {
534
+ return received.type === sent.setpointType;
535
+ }
536
+ let ThermostatSetpointCCGet = (() => {
537
+ let _classDecorators = [(0, import_CommandClassDecorators.CCCommand)(import_Types.ThermostatSetpointCommand.Get), (0, import_CommandClassDecorators.expectedCCResponse)(ThermostatSetpointCCReport, testResponseForThermostatSetpointGet)];
538
+ let _classDescriptor;
539
+ let _classExtraInitializers = [];
540
+ let _classThis;
541
+ let _classSuper = ThermostatSetpointCC;
542
+ var ThermostatSetpointCCGet2 = class extends _classSuper {
543
+ static {
544
+ _classThis = this;
545
+ }
546
+ static {
547
+ const _metadata = typeof Symbol === "function" && Symbol.metadata ? Object.create(_classSuper[Symbol.metadata] ?? null) : void 0;
548
+ __esDecorate(null, _classDescriptor = { value: _classThis }, _classDecorators, { kind: "class", name: _classThis.name, metadata: _metadata }, null, _classExtraInitializers);
549
+ ThermostatSetpointCCGet2 = _classThis = _classDescriptor.value;
550
+ if (_metadata) Object.defineProperty(_classThis, Symbol.metadata, { enumerable: true, configurable: true, writable: true, value: _metadata });
551
+ __runInitializers(_classThis, _classExtraInitializers);
552
+ }
553
+ constructor(options) {
554
+ super(options);
555
+ this.setpointType = options.setpointType;
556
+ }
557
+ static from(raw, ctx) {
558
+ (0, import_safe.validatePayload)(raw.payload.length >= 1);
559
+ const setpointType = raw.payload[0] & 15;
560
+ return new this({
561
+ nodeId: ctx.sourceNodeId,
562
+ setpointType
563
+ });
564
+ }
565
+ setpointType;
566
+ serialize(ctx) {
567
+ this.payload = import_safe2.Bytes.from([this.setpointType & 15]);
568
+ return super.serialize(ctx);
569
+ }
570
+ toLogEntry(ctx) {
571
+ return {
572
+ ...super.toLogEntry(ctx),
573
+ message: {
574
+ "setpoint type": (0, import_safe3.getEnumMemberName)(import_Types.ThermostatSetpointType, this.setpointType)
575
+ }
576
+ };
577
+ }
578
+ };
579
+ return ThermostatSetpointCCGet2 = _classThis;
580
+ })();
581
+ let ThermostatSetpointCCCapabilitiesReport = (() => {
582
+ let _classDecorators = [(0, import_CommandClassDecorators.CCCommand)(import_Types.ThermostatSetpointCommand.CapabilitiesReport)];
583
+ let _classDescriptor;
584
+ let _classExtraInitializers = [];
585
+ let _classThis;
586
+ let _classSuper = ThermostatSetpointCC;
587
+ var ThermostatSetpointCCCapabilitiesReport2 = class extends _classSuper {
588
+ static {
589
+ _classThis = this;
590
+ }
591
+ static {
592
+ const _metadata = typeof Symbol === "function" && Symbol.metadata ? Object.create(_classSuper[Symbol.metadata] ?? null) : void 0;
593
+ __esDecorate(null, _classDescriptor = { value: _classThis }, _classDecorators, { kind: "class", name: _classThis.name, metadata: _metadata }, null, _classExtraInitializers);
594
+ ThermostatSetpointCCCapabilitiesReport2 = _classThis = _classDescriptor.value;
595
+ if (_metadata) Object.defineProperty(_classThis, Symbol.metadata, { enumerable: true, configurable: true, writable: true, value: _metadata });
596
+ __runInitializers(_classThis, _classExtraInitializers);
597
+ }
598
+ constructor(options) {
599
+ super(options);
600
+ this.type = options.type;
601
+ this.minValue = options.minValue;
602
+ this.minValueScale = options.minValueScale;
603
+ this.maxValue = options.maxValue;
604
+ this.maxValueScale = options.maxValueScale;
605
+ }
606
+ static from(raw, ctx) {
607
+ (0, import_safe.validatePayload)(raw.payload.length >= 1);
608
+ const type = raw.payload[0];
609
+ const { value: minValue, scale: minValueScale, bytesRead } = (0, import_safe.parseFloatWithScale)(raw.payload.subarray(1));
610
+ const { value: maxValue, scale: maxValueScale } = (0, import_safe.parseFloatWithScale)(raw.payload.subarray(1 + bytesRead));
611
+ return new this({
390
612
  nodeId: ctx.sourceNodeId,
391
613
  type,
392
- value: 0,
393
- scale: 0
614
+ minValue,
615
+ minValueScale,
616
+ maxValue,
617
+ maxValueScale
394
618
  });
395
619
  }
396
- const { value, scale } = (0, import_safe.parseFloatWithScale)(raw.payload.subarray(1));
397
- return new ThermostatSetpointCCReport_1({
398
- nodeId: ctx.sourceNodeId,
399
- type,
400
- value,
401
- scale
402
- });
403
- }
404
- persistValues(ctx) {
405
- if (!super.persistValues(ctx))
406
- return false;
407
- const scale = getScale(this.scale);
408
- const setpointValue = ThermostatSetpointCCValues.setpoint(this.type);
409
- const existingMetadata = this.getMetadata(ctx, setpointValue);
410
- if (existingMetadata?.unit !== scale.unit) {
620
+ persistValues(ctx) {
621
+ if (!super.persistValues(ctx))
622
+ return false;
623
+ const setpointValue = ThermostatSetpointCCValues.setpoint(this.type);
411
624
  this.setMetadata(ctx, setpointValue, {
412
- ...existingMetadata ?? setpointValue.meta,
413
- unit: scale.unit
625
+ ...setpointValue.meta,
626
+ min: this.minValue,
627
+ max: this.maxValue,
628
+ unit: getSetpointUnit(this.minValueScale) || getSetpointUnit(this.maxValueScale)
414
629
  });
630
+ return true;
415
631
  }
416
- this.setValue(ctx, setpointValue, this.value);
417
- this.setValue(ctx, ThermostatSetpointCCValues.setpointScale(this.type), scale.key);
418
- return true;
419
- }
420
- type;
421
- scale;
422
- value;
423
- serialize(ctx) {
424
- this.payload = import_safe2.Bytes.concat([
425
- import_safe2.Bytes.from([this.type & 15]),
426
- (0, import_safe.encodeFloatWithScale)(this.value, this.scale)
427
- ]);
428
- return super.serialize(ctx);
429
- }
430
- toLogEntry(ctx) {
431
- const scale = getScale(this.scale);
432
- return {
433
- ...super.toLogEntry(ctx),
434
- message: {
435
- "setpoint type": (0, import_safe3.getEnumMemberName)(import_Types.ThermostatSetpointType, this.type),
436
- value: `${this.value} ${scale.unit}`
437
- }
438
- };
439
- }
440
- };
441
- ThermostatSetpointCCReport = ThermostatSetpointCCReport_1 = __decorate([
442
- (0, import_CommandClassDecorators.CCCommand)(import_Types.ThermostatSetpointCommand.Report)
443
- ], ThermostatSetpointCCReport);
444
- function testResponseForThermostatSetpointGet(sent, received) {
445
- return received.type === sent.setpointType;
446
- }
447
- let ThermostatSetpointCCGet = ThermostatSetpointCCGet_1 = class ThermostatSetpointCCGet2 extends ThermostatSetpointCC {
448
- constructor(options) {
449
- super(options);
450
- this.setpointType = options.setpointType;
451
- }
452
- static from(raw, ctx) {
453
- (0, import_safe.validatePayload)(raw.payload.length >= 1);
454
- const setpointType = raw.payload[0] & 15;
455
- return new ThermostatSetpointCCGet_1({
456
- nodeId: ctx.sourceNodeId,
457
- setpointType
458
- });
459
- }
460
- setpointType;
461
- serialize(ctx) {
462
- this.payload = import_safe2.Bytes.from([this.setpointType & 15]);
463
- return super.serialize(ctx);
464
- }
465
- toLogEntry(ctx) {
466
- return {
467
- ...super.toLogEntry(ctx),
468
- message: {
469
- "setpoint type": (0, import_safe3.getEnumMemberName)(import_Types.ThermostatSetpointType, this.setpointType)
470
- }
471
- };
472
- }
473
- };
474
- ThermostatSetpointCCGet = ThermostatSetpointCCGet_1 = __decorate([
475
- (0, import_CommandClassDecorators.CCCommand)(import_Types.ThermostatSetpointCommand.Get),
476
- (0, import_CommandClassDecorators.expectedCCResponse)(ThermostatSetpointCCReport, testResponseForThermostatSetpointGet)
477
- ], ThermostatSetpointCCGet);
478
- let ThermostatSetpointCCCapabilitiesReport = ThermostatSetpointCCCapabilitiesReport_1 = class ThermostatSetpointCCCapabilitiesReport2 extends ThermostatSetpointCC {
479
- constructor(options) {
480
- super(options);
481
- this.type = options.type;
482
- this.minValue = options.minValue;
483
- this.minValueScale = options.minValueScale;
484
- this.maxValue = options.maxValue;
485
- this.maxValueScale = options.maxValueScale;
486
- }
487
- static from(raw, ctx) {
488
- (0, import_safe.validatePayload)(raw.payload.length >= 1);
489
- const type = raw.payload[0];
490
- const { value: minValue, scale: minValueScale, bytesRead } = (0, import_safe.parseFloatWithScale)(raw.payload.subarray(1));
491
- const { value: maxValue, scale: maxValueScale } = (0, import_safe.parseFloatWithScale)(raw.payload.subarray(1 + bytesRead));
492
- return new ThermostatSetpointCCCapabilitiesReport_1({
493
- nodeId: ctx.sourceNodeId,
494
- type,
495
- minValue,
496
- minValueScale,
497
- maxValue,
498
- maxValueScale
499
- });
500
- }
501
- persistValues(ctx) {
502
- if (!super.persistValues(ctx))
503
- return false;
504
- const setpointValue = ThermostatSetpointCCValues.setpoint(this.type);
505
- this.setMetadata(ctx, setpointValue, {
506
- ...setpointValue.meta,
507
- min: this.minValue,
508
- max: this.maxValue,
509
- unit: getSetpointUnit(this.minValueScale) || getSetpointUnit(this.maxValueScale)
510
- });
511
- return true;
512
- }
513
- type;
514
- minValue;
515
- maxValue;
516
- minValueScale;
517
- maxValueScale;
518
- serialize(ctx) {
519
- const min = (0, import_safe.encodeFloatWithScale)(this.minValue, this.minValueScale);
520
- const max = (0, import_safe.encodeFloatWithScale)(this.maxValue, this.maxValueScale);
521
- this.payload = import_safe2.Bytes.concat([import_safe2.Bytes.from([this.type]), min, max]);
522
- return super.serialize(ctx);
523
- }
524
- toLogEntry(ctx) {
525
- const minValueScale = getScale(this.minValueScale);
526
- const maxValueScale = getScale(this.maxValueScale);
527
- return {
528
- ...super.toLogEntry(ctx),
529
- message: {
530
- "setpoint type": (0, import_safe3.getEnumMemberName)(import_Types.ThermostatSetpointType, this.type),
531
- "min value": `${this.minValue} ${minValueScale.unit}`,
532
- "max value": `${this.maxValue} ${maxValueScale.unit}`
533
- }
534
- };
535
- }
536
- };
537
- ThermostatSetpointCCCapabilitiesReport = ThermostatSetpointCCCapabilitiesReport_1 = __decorate([
538
- (0, import_CommandClassDecorators.CCCommand)(import_Types.ThermostatSetpointCommand.CapabilitiesReport)
539
- ], ThermostatSetpointCCCapabilitiesReport);
540
- let ThermostatSetpointCCCapabilitiesGet = ThermostatSetpointCCCapabilitiesGet_1 = class ThermostatSetpointCCCapabilitiesGet2 extends ThermostatSetpointCC {
541
- constructor(options) {
542
- super(options);
543
- this.setpointType = options.setpointType;
544
- }
545
- static from(raw, ctx) {
546
- (0, import_safe.validatePayload)(raw.payload.length >= 1);
547
- const setpointType = raw.payload[0] & 15;
548
- return new ThermostatSetpointCCCapabilitiesGet_1({
549
- nodeId: ctx.sourceNodeId,
550
- setpointType
551
- });
552
- }
553
- setpointType;
554
- serialize(ctx) {
555
- this.payload = import_safe2.Bytes.from([this.setpointType & 15]);
556
- return super.serialize(ctx);
557
- }
558
- toLogEntry(ctx) {
559
- return {
560
- ...super.toLogEntry(ctx),
561
- message: {
562
- "setpoint type": (0, import_safe3.getEnumMemberName)(import_Types.ThermostatSetpointType, this.setpointType)
632
+ type;
633
+ minValue;
634
+ maxValue;
635
+ minValueScale;
636
+ maxValueScale;
637
+ serialize(ctx) {
638
+ const min = (0, import_safe.encodeFloatWithScale)(this.minValue, this.minValueScale);
639
+ const max = (0, import_safe.encodeFloatWithScale)(this.maxValue, this.maxValueScale);
640
+ this.payload = import_safe2.Bytes.concat([import_safe2.Bytes.from([this.type]), min, max]);
641
+ return super.serialize(ctx);
642
+ }
643
+ toLogEntry(ctx) {
644
+ const minValueScale = getScale(this.minValueScale);
645
+ const maxValueScale = getScale(this.maxValueScale);
646
+ return {
647
+ ...super.toLogEntry(ctx),
648
+ message: {
649
+ "setpoint type": (0, import_safe3.getEnumMemberName)(import_Types.ThermostatSetpointType, this.type),
650
+ "min value": `${this.minValue} ${minValueScale.unit}`,
651
+ "max value": `${this.maxValue} ${maxValueScale.unit}`
652
+ }
653
+ };
654
+ }
655
+ };
656
+ return ThermostatSetpointCCCapabilitiesReport2 = _classThis;
657
+ })();
658
+ let ThermostatSetpointCCCapabilitiesGet = (() => {
659
+ let _classDecorators = [(0, import_CommandClassDecorators.CCCommand)(import_Types.ThermostatSetpointCommand.CapabilitiesGet), (0, import_CommandClassDecorators.expectedCCResponse)(ThermostatSetpointCCCapabilitiesReport)];
660
+ let _classDescriptor;
661
+ let _classExtraInitializers = [];
662
+ let _classThis;
663
+ let _classSuper = ThermostatSetpointCC;
664
+ var ThermostatSetpointCCCapabilitiesGet2 = class extends _classSuper {
665
+ static {
666
+ _classThis = this;
667
+ }
668
+ static {
669
+ const _metadata = typeof Symbol === "function" && Symbol.metadata ? Object.create(_classSuper[Symbol.metadata] ?? null) : void 0;
670
+ __esDecorate(null, _classDescriptor = { value: _classThis }, _classDecorators, { kind: "class", name: _classThis.name, metadata: _metadata }, null, _classExtraInitializers);
671
+ ThermostatSetpointCCCapabilitiesGet2 = _classThis = _classDescriptor.value;
672
+ if (_metadata) Object.defineProperty(_classThis, Symbol.metadata, { enumerable: true, configurable: true, writable: true, value: _metadata });
673
+ __runInitializers(_classThis, _classExtraInitializers);
674
+ }
675
+ constructor(options) {
676
+ super(options);
677
+ this.setpointType = options.setpointType;
678
+ }
679
+ static from(raw, ctx) {
680
+ (0, import_safe.validatePayload)(raw.payload.length >= 1);
681
+ const setpointType = raw.payload[0] & 15;
682
+ return new this({
683
+ nodeId: ctx.sourceNodeId,
684
+ setpointType
685
+ });
686
+ }
687
+ setpointType;
688
+ serialize(ctx) {
689
+ this.payload = import_safe2.Bytes.from([this.setpointType & 15]);
690
+ return super.serialize(ctx);
691
+ }
692
+ toLogEntry(ctx) {
693
+ return {
694
+ ...super.toLogEntry(ctx),
695
+ message: {
696
+ "setpoint type": (0, import_safe3.getEnumMemberName)(import_Types.ThermostatSetpointType, this.setpointType)
697
+ }
698
+ };
699
+ }
700
+ };
701
+ return ThermostatSetpointCCCapabilitiesGet2 = _classThis;
702
+ })();
703
+ let ThermostatSetpointCCSupportedReport = (() => {
704
+ let _classDecorators = [(0, import_CommandClassDecorators.CCCommand)(import_Types.ThermostatSetpointCommand.SupportedReport), (0, import_CommandClassDecorators.ccValueProperty)("supportedSetpointTypes", ThermostatSetpointCCValues.supportedSetpointTypes)];
705
+ let _classDescriptor;
706
+ let _classExtraInitializers = [];
707
+ let _classThis;
708
+ let _classSuper = ThermostatSetpointCC;
709
+ var ThermostatSetpointCCSupportedReport2 = class extends _classSuper {
710
+ static {
711
+ _classThis = this;
712
+ }
713
+ static {
714
+ const _metadata = typeof Symbol === "function" && Symbol.metadata ? Object.create(_classSuper[Symbol.metadata] ?? null) : void 0;
715
+ __esDecorate(null, _classDescriptor = { value: _classThis }, _classDecorators, { kind: "class", name: _classThis.name, metadata: _metadata }, null, _classExtraInitializers);
716
+ ThermostatSetpointCCSupportedReport2 = _classThis = _classDescriptor.value;
717
+ if (_metadata) Object.defineProperty(_classThis, Symbol.metadata, { enumerable: true, configurable: true, writable: true, value: _metadata });
718
+ __runInitializers(_classThis, _classExtraInitializers);
719
+ }
720
+ constructor(options) {
721
+ super(options);
722
+ if (options.supportedSetpointTypes.length === 0) {
723
+ throw new import_safe.ZWaveError(`At least one setpoint type must be supported`, import_safe.ZWaveErrorCodes.Argument_Invalid);
563
724
  }
564
- };
565
- }
566
- };
567
- ThermostatSetpointCCCapabilitiesGet = ThermostatSetpointCCCapabilitiesGet_1 = __decorate([
568
- (0, import_CommandClassDecorators.CCCommand)(import_Types.ThermostatSetpointCommand.CapabilitiesGet),
569
- (0, import_CommandClassDecorators.expectedCCResponse)(ThermostatSetpointCCCapabilitiesReport)
570
- ], ThermostatSetpointCCCapabilitiesGet);
571
- let ThermostatSetpointCCSupportedReport = ThermostatSetpointCCSupportedReport_1 = class ThermostatSetpointCCSupportedReport2 extends ThermostatSetpointCC {
572
- constructor(options) {
573
- super(options);
574
- if (options.supportedSetpointTypes.length === 0) {
575
- throw new import_safe.ZWaveError(`At least one setpoint type must be supported`, import_safe.ZWaveErrorCodes.Argument_Invalid);
576
- }
577
- this.supportedSetpointTypes = options.supportedSetpointTypes;
578
- }
579
- static from(raw, ctx) {
580
- (0, import_safe.validatePayload)(raw.payload.length >= 1);
581
- const bitMask = raw.payload;
582
- const supported = (0, import_safe.parseBitMask)(bitMask, import_Types.ThermostatSetpointType["N/A"]);
583
- const supportedSetpointTypes = supported.map((i) => thermostatSetpointTypeMap[i]);
584
- return new ThermostatSetpointCCSupportedReport_1({
585
- nodeId: ctx.sourceNodeId,
586
- supportedSetpointTypes
587
- });
588
- }
589
- supportedSetpointTypes;
590
- serialize(ctx) {
591
- this.payload = (0, import_safe.encodeBitMask)(
592
- // Encode as interpretation A
593
- this.supportedSetpointTypes.map((t) => thermostatSetpointTypeMap.indexOf(t)).filter((t) => t !== -1),
594
- void 0,
595
- import_Types.ThermostatSetpointType["N/A"]
596
- );
597
- return super.serialize(ctx);
598
- }
599
- toLogEntry(ctx) {
600
- return {
601
- ...super.toLogEntry(ctx),
602
- message: {
603
- "supported setpoint types": this.supportedSetpointTypes.map((t) => `
725
+ this.supportedSetpointTypes = options.supportedSetpointTypes;
726
+ }
727
+ static from(raw, ctx) {
728
+ (0, import_safe.validatePayload)(raw.payload.length >= 1);
729
+ const bitMask = raw.payload;
730
+ const supported = (0, import_safe.parseBitMask)(bitMask, import_Types.ThermostatSetpointType["N/A"]);
731
+ const supportedSetpointTypes = supported.map((i) => thermostatSetpointTypeMap[i]);
732
+ return new this({
733
+ nodeId: ctx.sourceNodeId,
734
+ supportedSetpointTypes
735
+ });
736
+ }
737
+ supportedSetpointTypes;
738
+ serialize(ctx) {
739
+ this.payload = (0, import_safe.encodeBitMask)(
740
+ // Encode as interpretation A
741
+ this.supportedSetpointTypes.map((t) => thermostatSetpointTypeMap.indexOf(t)).filter((t) => t !== -1),
742
+ void 0,
743
+ import_Types.ThermostatSetpointType["N/A"]
744
+ );
745
+ return super.serialize(ctx);
746
+ }
747
+ toLogEntry(ctx) {
748
+ return {
749
+ ...super.toLogEntry(ctx),
750
+ message: {
751
+ "supported setpoint types": this.supportedSetpointTypes.map((t) => `
604
752
  \xB7 ${(0, import_safe3.getEnumMemberName)(import_Types.ThermostatSetpointType, t)}`).join("")
605
- }
606
- };
607
- }
608
- };
609
- __decorate([
610
- (0, import_CommandClassDecorators.ccValue)(ThermostatSetpointCCValues.supportedSetpointTypes)
611
- ], ThermostatSetpointCCSupportedReport.prototype, "supportedSetpointTypes", void 0);
612
- ThermostatSetpointCCSupportedReport = ThermostatSetpointCCSupportedReport_1 = __decorate([
613
- (0, import_CommandClassDecorators.CCCommand)(import_Types.ThermostatSetpointCommand.SupportedReport)
614
- ], ThermostatSetpointCCSupportedReport);
615
- let ThermostatSetpointCCSupportedGet = class ThermostatSetpointCCSupportedGet2 extends ThermostatSetpointCC {
616
- };
617
- ThermostatSetpointCCSupportedGet = __decorate([
618
- (0, import_CommandClassDecorators.CCCommand)(import_Types.ThermostatSetpointCommand.SupportedGet),
619
- (0, import_CommandClassDecorators.expectedCCResponse)(ThermostatSetpointCCSupportedReport)
620
- /**
621
- * Issues a SupportedGet command to the node. Due to inconsistencies in interpretation,
622
- * this command should not be used for nodes with CC versions 1 or 2
623
- */
624
- ], ThermostatSetpointCCSupportedGet);
753
+ }
754
+ };
755
+ }
756
+ };
757
+ return ThermostatSetpointCCSupportedReport2 = _classThis;
758
+ })();
759
+ let ThermostatSetpointCCSupportedGet = (() => {
760
+ let _classDecorators = [(0, import_CommandClassDecorators.CCCommand)(import_Types.ThermostatSetpointCommand.SupportedGet), (0, import_CommandClassDecorators.expectedCCResponse)(ThermostatSetpointCCSupportedReport)];
761
+ let _classDescriptor;
762
+ let _classExtraInitializers = [];
763
+ let _classThis;
764
+ let _classSuper = ThermostatSetpointCC;
765
+ var ThermostatSetpointCCSupportedGet2 = class extends _classSuper {
766
+ static {
767
+ _classThis = this;
768
+ }
769
+ static {
770
+ const _metadata = typeof Symbol === "function" && Symbol.metadata ? Object.create(_classSuper[Symbol.metadata] ?? null) : void 0;
771
+ __esDecorate(null, _classDescriptor = { value: _classThis }, _classDecorators, { kind: "class", name: _classThis.name, metadata: _metadata }, null, _classExtraInitializers);
772
+ ThermostatSetpointCCSupportedGet2 = _classThis = _classDescriptor.value;
773
+ if (_metadata) Object.defineProperty(_classThis, Symbol.metadata, { enumerable: true, configurable: true, writable: true, value: _metadata });
774
+ __runInitializers(_classThis, _classExtraInitializers);
775
+ }
776
+ };
777
+ return ThermostatSetpointCCSupportedGet2 = _classThis;
778
+ })();
625
779
  // Annotate the CommonJS export names for ESM import in node:
626
780
  0 && (module.exports = {
627
781
  ThermostatSetpointCC,