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

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (331) hide show
  1. package/build/cjs/cc/AlarmSensorCC.js +381 -266
  2. package/build/cjs/cc/AlarmSensorCC.js.map +3 -3
  3. package/build/cjs/cc/AssociationCC.js +669 -503
  4. package/build/cjs/cc/AssociationCC.js.map +3 -3
  5. package/build/cjs/cc/AssociationGroupInfoCC.js +633 -492
  6. package/build/cjs/cc/AssociationGroupInfoCC.js.map +3 -3
  7. package/build/cjs/cc/BarrierOperatorCC.js +595 -429
  8. package/build/cjs/cc/BarrierOperatorCC.js.map +3 -3
  9. package/build/cjs/cc/BasicCC.js +354 -260
  10. package/build/cjs/cc/BasicCC.js.map +3 -3
  11. package/build/cjs/cc/BatteryCC.js +427 -345
  12. package/build/cjs/cc/BatteryCC.js.map +3 -3
  13. package/build/cjs/cc/BinarySensorCC.js +391 -276
  14. package/build/cjs/cc/BinarySensorCC.js.map +3 -3
  15. package/build/cjs/cc/BinarySwitchCC.js +347 -253
  16. package/build/cjs/cc/BinarySwitchCC.js.map +3 -3
  17. package/build/cjs/cc/CRC16CC.js +160 -85
  18. package/build/cjs/cc/CRC16CC.js.map +3 -3
  19. package/build/cjs/cc/CentralSceneCC.js +459 -324
  20. package/build/cjs/cc/CentralSceneCC.js.map +3 -3
  21. package/build/cjs/cc/ClimateControlScheduleCC.js +459 -293
  22. package/build/cjs/cc/ClimateControlScheduleCC.js.map +3 -3
  23. package/build/cjs/cc/ClockCC.js +254 -150
  24. package/build/cjs/cc/ClockCC.js.map +3 -3
  25. package/build/cjs/cc/ColorSwitchCC.js +758 -610
  26. package/build/cjs/cc/ColorSwitchCC.js.map +3 -3
  27. package/build/cjs/cc/ConfigurationCC.js +1700 -1453
  28. package/build/cjs/cc/ConfigurationCC.js.map +3 -3
  29. package/build/cjs/cc/DeviceResetLocallyCC.js +125 -49
  30. package/build/cjs/cc/DeviceResetLocallyCC.js.map +3 -3
  31. package/build/cjs/cc/DoorLockCC.js +904 -777
  32. package/build/cjs/cc/DoorLockCC.js.map +3 -3
  33. package/build/cjs/cc/DoorLockLoggingCC.js +321 -206
  34. package/build/cjs/cc/DoorLockLoggingCC.js.map +3 -3
  35. package/build/cjs/cc/EnergyProductionCC.js +249 -160
  36. package/build/cjs/cc/EnergyProductionCC.js.map +3 -3
  37. package/build/cjs/cc/EntryControlCC.js +619 -458
  38. package/build/cjs/cc/EntryControlCC.js.map +3 -3
  39. package/build/cjs/cc/FirmwareUpdateMetaDataCC.js +898 -698
  40. package/build/cjs/cc/FirmwareUpdateMetaDataCC.js.map +3 -3
  41. package/build/cjs/cc/HailCC.js +57 -11
  42. package/build/cjs/cc/HailCC.js.map +2 -2
  43. package/build/cjs/cc/HumidityControlModeCC.js +359 -233
  44. package/build/cjs/cc/HumidityControlModeCC.js.map +3 -3
  45. package/build/cjs/cc/HumidityControlOperatingStateCC.js +189 -103
  46. package/build/cjs/cc/HumidityControlOperatingStateCC.js.map +3 -3
  47. package/build/cjs/cc/HumidityControlSetpointCC.js +682 -495
  48. package/build/cjs/cc/HumidityControlSetpointCC.js.map +3 -3
  49. package/build/cjs/cc/InclusionControllerCC.js +205 -114
  50. package/build/cjs/cc/InclusionControllerCC.js.map +3 -3
  51. package/build/cjs/cc/IndicatorCC.js +897 -736
  52. package/build/cjs/cc/IndicatorCC.js.map +3 -3
  53. package/build/cjs/cc/IrrigationCC.js +1651 -1405
  54. package/build/cjs/cc/IrrigationCC.js.map +3 -3
  55. package/build/cjs/cc/LanguageCC.js +268 -171
  56. package/build/cjs/cc/LanguageCC.js.map +3 -3
  57. package/build/cjs/cc/LockCC.js +254 -154
  58. package/build/cjs/cc/LockCC.js.map +3 -3
  59. package/build/cjs/cc/ManufacturerProprietaryCC.js +189 -129
  60. package/build/cjs/cc/ManufacturerProprietaryCC.js.map +2 -2
  61. package/build/cjs/cc/ManufacturerSpecificCC.js +319 -213
  62. package/build/cjs/cc/ManufacturerSpecificCC.js.map +3 -3
  63. package/build/cjs/cc/MeterCC.js +827 -707
  64. package/build/cjs/cc/MeterCC.js.map +3 -3
  65. package/build/cjs/cc/MultiChannelAssociationCC.js +612 -478
  66. package/build/cjs/cc/MultiChannelAssociationCC.js.map +3 -3
  67. package/build/cjs/cc/MultiChannelCC.js +1037 -819
  68. package/build/cjs/cc/MultiChannelCC.js.map +3 -3
  69. package/build/cjs/cc/MultiCommandCC.js +172 -97
  70. package/build/cjs/cc/MultiCommandCC.js.map +3 -3
  71. package/build/cjs/cc/MultilevelSensorCC.js +589 -449
  72. package/build/cjs/cc/MultilevelSensorCC.js.map +3 -3
  73. package/build/cjs/cc/MultilevelSwitchCC.js +587 -439
  74. package/build/cjs/cc/MultilevelSwitchCC.js.map +3 -3
  75. package/build/cjs/cc/NoOperationCC.js +89 -27
  76. package/build/cjs/cc/NoOperationCC.js.map +2 -2
  77. package/build/cjs/cc/NodeNamingCC.js +417 -277
  78. package/build/cjs/cc/NodeNamingCC.js.map +3 -3
  79. package/build/cjs/cc/NotificationCC.js +972 -818
  80. package/build/cjs/cc/NotificationCC.js.map +3 -3
  81. package/build/cjs/cc/PowerlevelCC.js +450 -303
  82. package/build/cjs/cc/PowerlevelCC.js.map +3 -3
  83. package/build/cjs/cc/ProtectionCC.js +686 -494
  84. package/build/cjs/cc/ProtectionCC.js.map +3 -3
  85. package/build/cjs/cc/SceneActivationCC.js +165 -97
  86. package/build/cjs/cc/SceneActivationCC.js.map +3 -3
  87. package/build/cjs/cc/SceneActuatorConfigurationCC.js +346 -243
  88. package/build/cjs/cc/SceneActuatorConfigurationCC.js.map +3 -3
  89. package/build/cjs/cc/SceneControllerConfigurationCC.js +401 -298
  90. package/build/cjs/cc/SceneControllerConfigurationCC.js.map +3 -3
  91. package/build/cjs/cc/ScheduleEntryLockCC.js +1552 -1272
  92. package/build/cjs/cc/ScheduleEntryLockCC.js.map +3 -3
  93. package/build/cjs/cc/Security2CC.js +1483 -1219
  94. package/build/cjs/cc/Security2CC.js.map +3 -3
  95. package/build/cjs/cc/SecurityCC.js +839 -619
  96. package/build/cjs/cc/SecurityCC.js.map +3 -3
  97. package/build/cjs/cc/SoundSwitchCC.js +707 -515
  98. package/build/cjs/cc/SoundSwitchCC.js.map +3 -3
  99. package/build/cjs/cc/SupervisionCC.js +327 -237
  100. package/build/cjs/cc/SupervisionCC.js.map +3 -3
  101. package/build/cjs/cc/ThermostatFanModeCC.js +386 -263
  102. package/build/cjs/cc/ThermostatFanModeCC.js.map +3 -3
  103. package/build/cjs/cc/ThermostatFanStateCC.js +192 -106
  104. package/build/cjs/cc/ThermostatFanStateCC.js.map +3 -3
  105. package/build/cjs/cc/ThermostatModeCC.js +425 -302
  106. package/build/cjs/cc/ThermostatModeCC.js.map +3 -3
  107. package/build/cjs/cc/ThermostatOperatingStateCC.js +188 -102
  108. package/build/cjs/cc/ThermostatOperatingStateCC.js.map +3 -3
  109. package/build/cjs/cc/ThermostatSetbackCC.js +277 -173
  110. package/build/cjs/cc/ThermostatSetbackCC.js.map +3 -3
  111. package/build/cjs/cc/ThermostatSetpointCC.js +645 -491
  112. package/build/cjs/cc/ThermostatSetpointCC.js.map +3 -3
  113. package/build/cjs/cc/TimeCC.js +515 -353
  114. package/build/cjs/cc/TimeCC.js.map +3 -3
  115. package/build/cjs/cc/TimeParametersCC.js +302 -202
  116. package/build/cjs/cc/TimeParametersCC.js.map +3 -3
  117. package/build/cjs/cc/TransportServiceCC.js +433 -315
  118. package/build/cjs/cc/TransportServiceCC.js.map +3 -3
  119. package/build/cjs/cc/UserCodeCC.js +1385 -1102
  120. package/build/cjs/cc/UserCodeCC.js.map +3 -3
  121. package/build/cjs/cc/VersionCC.js +696 -562
  122. package/build/cjs/cc/VersionCC.js.map +3 -3
  123. package/build/cjs/cc/WakeUpCC.js +499 -346
  124. package/build/cjs/cc/WakeUpCC.js.map +3 -3
  125. package/build/cjs/cc/WindowCoveringCC.js +626 -478
  126. package/build/cjs/cc/WindowCoveringCC.js.map +3 -3
  127. package/build/cjs/cc/ZWaveLongRangeCC.js +57 -10
  128. package/build/cjs/cc/ZWaveLongRangeCC.js.map +2 -2
  129. package/build/cjs/cc/ZWavePlusCC.js +233 -159
  130. package/build/cjs/cc/ZWavePlusCC.js.map +3 -3
  131. package/build/cjs/cc/ZWaveProtocolCC.js +1515 -948
  132. package/build/cjs/cc/ZWaveProtocolCC.js.map +3 -3
  133. package/build/cjs/cc/manufacturerProprietary/Decorators.d.ts +4 -4
  134. package/build/cjs/cc/manufacturerProprietary/Decorators.js.map +1 -1
  135. package/build/cjs/cc/manufacturerProprietary/FibaroCC.js +395 -274
  136. package/build/cjs/cc/manufacturerProprietary/FibaroCC.js.map +3 -3
  137. package/build/cjs/lib/CommandClassDecorators.d.ts +11 -15
  138. package/build/cjs/lib/CommandClassDecorators.js +19 -20
  139. package/build/cjs/lib/CommandClassDecorators.js.map +2 -2
  140. package/build/cjs/lib/Security2/Extension.d.ts +1 -1
  141. package/build/cjs/lib/Security2/Extension.js +217 -126
  142. package/build/cjs/lib/Security2/Extension.js.map +3 -3
  143. package/build/esm/cc/AlarmSensorCC.d.ts.map +1 -1
  144. package/build/esm/cc/AlarmSensorCC.js +389 -291
  145. package/build/esm/cc/AlarmSensorCC.js.map +1 -1
  146. package/build/esm/cc/AssociationCC.d.ts.map +1 -1
  147. package/build/esm/cc/AssociationCC.js +678 -537
  148. package/build/esm/cc/AssociationCC.js.map +1 -1
  149. package/build/esm/cc/AssociationGroupInfoCC.d.ts.map +1 -1
  150. package/build/esm/cc/AssociationGroupInfoCC.js +659 -539
  151. package/build/esm/cc/AssociationGroupInfoCC.js.map +1 -1
  152. package/build/esm/cc/BarrierOperatorCC.d.ts.map +1 -1
  153. package/build/esm/cc/BarrierOperatorCC.js +634 -493
  154. package/build/esm/cc/BarrierOperatorCC.js.map +1 -1
  155. package/build/esm/cc/BasicCC.d.ts.map +1 -1
  156. package/build/esm/cc/BasicCC.js +380 -302
  157. package/build/esm/cc/BasicCC.js.map +1 -1
  158. package/build/esm/cc/BatteryCC.d.ts.map +1 -1
  159. package/build/esm/cc/BatteryCC.js +449 -384
  160. package/build/esm/cc/BatteryCC.js.map +1 -1
  161. package/build/esm/cc/BinarySensorCC.d.ts.map +1 -1
  162. package/build/esm/cc/BinarySensorCC.js +395 -297
  163. package/build/esm/cc/BinarySensorCC.js.map +1 -1
  164. package/build/esm/cc/BinarySwitchCC.d.ts.map +1 -1
  165. package/build/esm/cc/BinarySwitchCC.js +353 -274
  166. package/build/esm/cc/BinarySwitchCC.js.map +1 -1
  167. package/build/esm/cc/CRC16CC.js +162 -98
  168. package/build/esm/cc/CRC16CC.js.map +1 -1
  169. package/build/esm/cc/CentralSceneCC.d.ts.map +1 -1
  170. package/build/esm/cc/CentralSceneCC.js +465 -351
  171. package/build/esm/cc/CentralSceneCC.js.map +1 -1
  172. package/build/esm/cc/ClimateControlScheduleCC.d.ts.map +1 -1
  173. package/build/esm/cc/ClimateControlScheduleCC.js +454 -313
  174. package/build/esm/cc/ClimateControlScheduleCC.js.map +1 -1
  175. package/build/esm/cc/ClockCC.js +248 -159
  176. package/build/esm/cc/ClockCC.js.map +1 -1
  177. package/build/esm/cc/ColorSwitchCC.d.ts.map +1 -1
  178. package/build/esm/cc/ColorSwitchCC.js +802 -677
  179. package/build/esm/cc/ColorSwitchCC.js.map +1 -1
  180. package/build/esm/cc/ConfigurationCC.js +1899 -1687
  181. package/build/esm/cc/ConfigurationCC.js.map +1 -1
  182. package/build/esm/cc/DeviceResetLocallyCC.js +124 -59
  183. package/build/esm/cc/DeviceResetLocallyCC.js.map +1 -1
  184. package/build/esm/cc/DoorLockCC.d.ts.map +1 -1
  185. package/build/esm/cc/DoorLockCC.js +951 -849
  186. package/build/esm/cc/DoorLockCC.js.map +1 -1
  187. package/build/esm/cc/DoorLockLoggingCC.d.ts.map +1 -1
  188. package/build/esm/cc/DoorLockLoggingCC.js +316 -218
  189. package/build/esm/cc/DoorLockLoggingCC.js.map +1 -1
  190. package/build/esm/cc/EnergyProductionCC.js +240 -164
  191. package/build/esm/cc/EnergyProductionCC.js.map +1 -1
  192. package/build/esm/cc/EntryControlCC.d.ts.map +1 -1
  193. package/build/esm/cc/EntryControlCC.js +629 -493
  194. package/build/esm/cc/EntryControlCC.js.map +1 -1
  195. package/build/esm/cc/FirmwareUpdateMetaDataCC.d.ts.map +1 -1
  196. package/build/esm/cc/FirmwareUpdateMetaDataCC.js +938 -769
  197. package/build/esm/cc/FirmwareUpdateMetaDataCC.js.map +1 -1
  198. package/build/esm/cc/HailCC.js +51 -12
  199. package/build/esm/cc/HailCC.js.map +1 -1
  200. package/build/esm/cc/HumidityControlModeCC.d.ts.map +1 -1
  201. package/build/esm/cc/HumidityControlModeCC.js +357 -250
  202. package/build/esm/cc/HumidityControlModeCC.js.map +1 -1
  203. package/build/esm/cc/HumidityControlOperatingStateCC.d.ts.map +1 -1
  204. package/build/esm/cc/HumidityControlOperatingStateCC.js +182 -109
  205. package/build/esm/cc/HumidityControlOperatingStateCC.js.map +1 -1
  206. package/build/esm/cc/HumidityControlSetpointCC.d.ts.map +1 -1
  207. package/build/esm/cc/HumidityControlSetpointCC.js +706 -546
  208. package/build/esm/cc/HumidityControlSetpointCC.js.map +1 -1
  209. package/build/esm/cc/InclusionControllerCC.js +197 -119
  210. package/build/esm/cc/InclusionControllerCC.js.map +1 -1
  211. package/build/esm/cc/IndicatorCC.js +973 -835
  212. package/build/esm/cc/IndicatorCC.js.map +1 -1
  213. package/build/esm/cc/IrrigationCC.d.ts.map +1 -1
  214. package/build/esm/cc/IrrigationCC.js +1697 -1496
  215. package/build/esm/cc/IrrigationCC.js.map +1 -1
  216. package/build/esm/cc/LanguageCC.d.ts.map +1 -1
  217. package/build/esm/cc/LanguageCC.js +266 -184
  218. package/build/esm/cc/LanguageCC.js.map +1 -1
  219. package/build/esm/cc/LockCC.d.ts.map +1 -1
  220. package/build/esm/cc/LockCC.js +247 -162
  221. package/build/esm/cc/LockCC.js.map +1 -1
  222. package/build/esm/cc/ManufacturerProprietaryCC.js +192 -141
  223. package/build/esm/cc/ManufacturerProprietaryCC.js.map +1 -1
  224. package/build/esm/cc/ManufacturerSpecificCC.d.ts.map +1 -1
  225. package/build/esm/cc/ManufacturerSpecificCC.js +312 -223
  226. package/build/esm/cc/ManufacturerSpecificCC.js.map +1 -1
  227. package/build/esm/cc/MeterCC.d.ts.map +1 -1
  228. package/build/esm/cc/MeterCC.js +896 -795
  229. package/build/esm/cc/MeterCC.js.map +1 -1
  230. package/build/esm/cc/MultiChannelAssociationCC.d.ts.map +1 -1
  231. package/build/esm/cc/MultiChannelAssociationCC.js +631 -518
  232. package/build/esm/cc/MultiChannelAssociationCC.js.map +1 -1
  233. package/build/esm/cc/MultiChannelCC.d.ts.map +1 -1
  234. package/build/esm/cc/MultiChannelCC.js +1106 -921
  235. package/build/esm/cc/MultiChannelCC.js.map +1 -1
  236. package/build/esm/cc/MultiCommandCC.js +166 -102
  237. package/build/esm/cc/MultiCommandCC.js.map +1 -1
  238. package/build/esm/cc/MultilevelSensorCC.d.ts.map +1 -1
  239. package/build/esm/cc/MultilevelSensorCC.js +616 -497
  240. package/build/esm/cc/MultilevelSensorCC.js.map +1 -1
  241. package/build/esm/cc/MultilevelSwitchCC.d.ts.map +1 -1
  242. package/build/esm/cc/MultilevelSwitchCC.js +621 -496
  243. package/build/esm/cc/MultilevelSwitchCC.js.map +1 -1
  244. package/build/esm/cc/NoOperationCC.js +82 -29
  245. package/build/esm/cc/NoOperationCC.js.map +1 -1
  246. package/build/esm/cc/NodeNamingCC.d.ts.map +1 -1
  247. package/build/esm/cc/NodeNamingCC.js +413 -294
  248. package/build/esm/cc/NodeNamingCC.js.map +1 -1
  249. package/build/esm/cc/NotificationCC.d.ts.map +1 -1
  250. package/build/esm/cc/NotificationCC.js +1097 -966
  251. package/build/esm/cc/NotificationCC.js.map +1 -1
  252. package/build/esm/cc/PowerlevelCC.js +437 -311
  253. package/build/esm/cc/PowerlevelCC.js.map +1 -1
  254. package/build/esm/cc/ProtectionCC.d.ts.map +1 -1
  255. package/build/esm/cc/ProtectionCC.js +704 -543
  256. package/build/esm/cc/ProtectionCC.js.map +1 -1
  257. package/build/esm/cc/SceneActivationCC.d.ts.map +1 -1
  258. package/build/esm/cc/SceneActivationCC.js +157 -100
  259. package/build/esm/cc/SceneActivationCC.js.map +1 -1
  260. package/build/esm/cc/SceneActuatorConfigurationCC.js +357 -269
  261. package/build/esm/cc/SceneActuatorConfigurationCC.js.map +1 -1
  262. package/build/esm/cc/SceneControllerConfigurationCC.js +434 -346
  263. package/build/esm/cc/SceneControllerConfigurationCC.js.map +1 -1
  264. package/build/esm/cc/ScheduleEntryLockCC.d.ts.map +1 -1
  265. package/build/esm/cc/ScheduleEntryLockCC.js +1596 -1357
  266. package/build/esm/cc/ScheduleEntryLockCC.js.map +1 -1
  267. package/build/esm/cc/Security2CC.js +1633 -1406
  268. package/build/esm/cc/Security2CC.js.map +1 -1
  269. package/build/esm/cc/SecurityCC.js +876 -687
  270. package/build/esm/cc/SecurityCC.js.map +1 -1
  271. package/build/esm/cc/SoundSwitchCC.d.ts.map +1 -1
  272. package/build/esm/cc/SoundSwitchCC.js +689 -526
  273. package/build/esm/cc/SoundSwitchCC.js.map +1 -1
  274. package/build/esm/cc/SupervisionCC.js +349 -272
  275. package/build/esm/cc/SupervisionCC.js.map +1 -1
  276. package/build/esm/cc/ThermostatFanModeCC.d.ts.map +1 -1
  277. package/build/esm/cc/ThermostatFanModeCC.js +388 -284
  278. package/build/esm/cc/ThermostatFanModeCC.js.map +1 -1
  279. package/build/esm/cc/ThermostatFanStateCC.d.ts.map +1 -1
  280. package/build/esm/cc/ThermostatFanStateCC.js +184 -111
  281. package/build/esm/cc/ThermostatFanStateCC.js.map +1 -1
  282. package/build/esm/cc/ThermostatModeCC.d.ts.map +1 -1
  283. package/build/esm/cc/ThermostatModeCC.js +435 -331
  284. package/build/esm/cc/ThermostatModeCC.js.map +1 -1
  285. package/build/esm/cc/ThermostatOperatingStateCC.d.ts.map +1 -1
  286. package/build/esm/cc/ThermostatOperatingStateCC.js +180 -107
  287. package/build/esm/cc/ThermostatOperatingStateCC.js.map +1 -1
  288. package/build/esm/cc/ThermostatSetbackCC.js +274 -185
  289. package/build/esm/cc/ThermostatSetbackCC.js.map +1 -1
  290. package/build/esm/cc/ThermostatSetpointCC.d.ts.map +1 -1
  291. package/build/esm/cc/ThermostatSetpointCC.js +674 -543
  292. package/build/esm/cc/ThermostatSetpointCC.js.map +1 -1
  293. package/build/esm/cc/TimeCC.js +499 -360
  294. package/build/esm/cc/TimeCC.js.map +1 -1
  295. package/build/esm/cc/TimeParametersCC.d.ts.map +1 -1
  296. package/build/esm/cc/TimeParametersCC.js +296 -211
  297. package/build/esm/cc/TimeParametersCC.js.map +1 -1
  298. package/build/esm/cc/TransportServiceCC.js +464 -363
  299. package/build/esm/cc/TransportServiceCC.js.map +1 -1
  300. package/build/esm/cc/UserCodeCC.d.ts.map +1 -1
  301. package/build/esm/cc/UserCodeCC.js +1443 -1205
  302. package/build/esm/cc/UserCodeCC.js.map +1 -1
  303. package/build/esm/cc/VersionCC.d.ts.map +1 -1
  304. package/build/esm/cc/VersionCC.js +744 -635
  305. package/build/esm/cc/VersionCC.js.map +1 -1
  306. package/build/esm/cc/WakeUpCC.d.ts.map +1 -1
  307. package/build/esm/cc/WakeUpCC.js +494 -364
  308. package/build/esm/cc/WakeUpCC.js.map +1 -1
  309. package/build/esm/cc/WindowCoveringCC.d.ts.map +1 -1
  310. package/build/esm/cc/WindowCoveringCC.js +655 -530
  311. package/build/esm/cc/WindowCoveringCC.js.map +1 -1
  312. package/build/esm/cc/ZWaveLongRangeCC.js +51 -11
  313. package/build/esm/cc/ZWaveLongRangeCC.js.map +1 -1
  314. package/build/esm/cc/ZWavePlusCC.d.ts.map +1 -1
  315. package/build/esm/cc/ZWavePlusCC.js +223 -162
  316. package/build/esm/cc/ZWavePlusCC.js.map +1 -1
  317. package/build/esm/cc/ZWaveProtocolCC.js +1443 -953
  318. package/build/esm/cc/ZWaveProtocolCC.js.map +1 -1
  319. package/build/esm/cc/manufacturerProprietary/Decorators.d.ts +4 -4
  320. package/build/esm/cc/manufacturerProprietary/Decorators.d.ts.map +1 -1
  321. package/build/esm/cc/manufacturerProprietary/FibaroCC.js +390 -286
  322. package/build/esm/cc/manufacturerProprietary/FibaroCC.js.map +1 -1
  323. package/build/esm/lib/CommandClassDecorators.d.ts +11 -15
  324. package/build/esm/lib/CommandClassDecorators.d.ts.map +1 -1
  325. package/build/esm/lib/CommandClassDecorators.js +24 -24
  326. package/build/esm/lib/CommandClassDecorators.js.map +1 -1
  327. package/build/esm/lib/Security2/Extension.d.ts +1 -1
  328. package/build/esm/lib/Security2/Extension.d.ts.map +1 -1
  329. package/build/esm/lib/Security2/Extension.js +207 -123
  330. package/build/esm/lib/Security2/Extension.js.map +1 -1
  331. package/package.json +6 -6
@@ -1,10 +1,37 @@
1
- var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
2
- var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
3
- if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
4
- 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;
5
- return c > 3 && r && Object.defineProperty(target, key, r), r;
1
+ var __esDecorate = (this && this.__esDecorate) || function (ctor, descriptorIn, decorators, contextIn, initializers, extraInitializers) {
2
+ function accept(f) { if (f !== void 0 && typeof f !== "function") throw new TypeError("Function expected"); return f; }
3
+ var kind = contextIn.kind, key = kind === "getter" ? "get" : kind === "setter" ? "set" : "value";
4
+ var target = !descriptorIn && ctor ? contextIn["static"] ? ctor : ctor.prototype : null;
5
+ var descriptor = descriptorIn || (target ? Object.getOwnPropertyDescriptor(target, contextIn.name) : {});
6
+ var _, done = false;
7
+ for (var i = decorators.length - 1; i >= 0; i--) {
8
+ var context = {};
9
+ for (var p in contextIn) context[p] = p === "access" ? {} : contextIn[p];
10
+ for (var p in contextIn.access) context.access[p] = contextIn.access[p];
11
+ context.addInitializer = function (f) { if (done) throw new TypeError("Cannot add initializers after decoration has completed"); extraInitializers.push(accept(f || null)); };
12
+ var result = (0, decorators[i])(kind === "accessor" ? { get: descriptor.get, set: descriptor.set } : descriptor[key], context);
13
+ if (kind === "accessor") {
14
+ if (result === void 0) continue;
15
+ if (result === null || typeof result !== "object") throw new TypeError("Object expected");
16
+ if (_ = accept(result.get)) descriptor.get = _;
17
+ if (_ = accept(result.set)) descriptor.set = _;
18
+ if (_ = accept(result.init)) initializers.unshift(_);
19
+ }
20
+ else if (_ = accept(result)) {
21
+ if (kind === "field") initializers.unshift(_);
22
+ else descriptor[key] = _;
23
+ }
24
+ }
25
+ if (target) Object.defineProperty(target, contextIn.name, descriptor);
26
+ done = true;
27
+ };
28
+ var __runInitializers = (this && this.__runInitializers) || function (thisArg, initializers, value) {
29
+ var useValue = arguments.length > 2;
30
+ for (var i = 0; i < initializers.length; i++) {
31
+ value = useValue ? initializers[i].call(thisArg, value) : initializers[i].call(thisArg);
32
+ }
33
+ return useValue ? value : void 0;
6
34
  };
7
- var ThermostatModeCCSet_1, ThermostatModeCCReport_1, ThermostatModeCCSupportedReport_1;
8
35
  function __assertType(argName, typeName, boundHasError) {
9
36
  const { ZWaveError, ZWaveErrorCodes } = require("@zwave-js/core");
10
37
  if (boundHasError()) {
@@ -48,7 +75,7 @@ import { Bytes } from "@zwave-js/shared/safe";
48
75
  import { buffer2hex, getEnumMemberName, pick } from "@zwave-js/shared/safe";
49
76
  import { CCAPI, POLL_VALUE, SET_VALUE, throwUnsupportedProperty, throwWrongValueType, } from "../lib/API.js";
50
77
  import { CommandClass, } from "../lib/CommandClass.js";
51
- import { API, CCCommand, ccValue, ccValues, commandClass, expectedCCResponse, implementedVersion, useSupervision, } from "../lib/CommandClassDecorators.js";
78
+ import { API, CCCommand, ccValueProperty, ccValues, commandClass, expectedCCResponse, implementedVersion, useSupervision, } from "../lib/CommandClassDecorators.js";
52
79
  import { V } from "../lib/Values.js";
53
80
  import { ThermostatMode, ThermostatModeCommand } from "../lib/_Types.js";
54
81
  export const ThermostatModeCCValues = Object.freeze({
@@ -65,362 +92,439 @@ export const ThermostatModeCCValues = Object.freeze({
65
92
  ...V.staticProperty("supportedModes", undefined, { internal: true }),
66
93
  }),
67
94
  });
68
- let ThermostatModeCCAPI = class ThermostatModeCCAPI extends CCAPI {
69
- supportsCommand(cmd) {
70
- switch (cmd) {
71
- case ThermostatModeCommand.Get:
72
- case ThermostatModeCommand.SupportedGet:
73
- return this.isSinglecast();
74
- case ThermostatModeCommand.Set:
75
- return true; // This is mandatory
76
- }
77
- return super.supportsCommand(cmd);
78
- }
79
- get [SET_VALUE]() {
80
- return async function ({ property }, value) {
81
- if (property !== "mode") {
82
- throwUnsupportedProperty(this.ccId, property);
83
- }
84
- if (typeof value !== "number") {
85
- throwWrongValueType(this.ccId, property, "number", typeof value);
86
- }
87
- const result = await this.set(value);
88
- // Verify the current value after a delay, unless the command was supervised and successful
89
- if (this.isSinglecast() && !supervisedCommandSucceeded(result)) {
90
- // TODO: Ideally this would be a short delay, but some thermostats like Remotec ZXT-600
91
- // aren't able to handle the GET this quickly.
92
- this.schedulePoll({ property }, value);
95
+ let ThermostatModeCCAPI = (() => {
96
+ let _classDecorators = [API(CommandClasses["Thermostat Mode"])];
97
+ let _classDescriptor;
98
+ let _classExtraInitializers = [];
99
+ let _classThis;
100
+ let _classSuper = CCAPI;
101
+ var ThermostatModeCCAPI = class extends _classSuper {
102
+ static { _classThis = this; }
103
+ static {
104
+ const _metadata = typeof Symbol === "function" && Symbol.metadata ? Object.create(_classSuper[Symbol.metadata] ?? null) : void 0;
105
+ __esDecorate(null, _classDescriptor = { value: _classThis }, _classDecorators, { kind: "class", name: _classThis.name, metadata: _metadata }, null, _classExtraInitializers);
106
+ ThermostatModeCCAPI = _classThis = _classDescriptor.value;
107
+ if (_metadata) Object.defineProperty(_classThis, Symbol.metadata, { enumerable: true, configurable: true, writable: true, value: _metadata });
108
+ __runInitializers(_classThis, _classExtraInitializers);
109
+ }
110
+ supportsCommand(cmd) {
111
+ switch (cmd) {
112
+ case ThermostatModeCommand.Get:
113
+ case ThermostatModeCommand.SupportedGet:
114
+ return this.isSinglecast();
115
+ case ThermostatModeCommand.Set:
116
+ return true; // This is mandatory
93
117
  }
94
- return result;
95
- };
96
- }
97
- get [POLL_VALUE]() {
98
- return async function ({ property }) {
99
- switch (property) {
100
- case "mode":
101
- return (await this.get())?.[property];
102
- default:
118
+ return super.supportsCommand(cmd);
119
+ }
120
+ get [SET_VALUE]() {
121
+ return async function ({ property }, value) {
122
+ if (property !== "mode") {
103
123
  throwUnsupportedProperty(this.ccId, property);
124
+ }
125
+ if (typeof value !== "number") {
126
+ throwWrongValueType(this.ccId, property, "number", typeof value);
127
+ }
128
+ const result = await this.set(value);
129
+ // Verify the current value after a delay, unless the command was supervised and successful
130
+ if (this.isSinglecast() && !supervisedCommandSucceeded(result)) {
131
+ // TODO: Ideally this would be a short delay, but some thermostats like Remotec ZXT-600
132
+ // aren't able to handle the GET this quickly.
133
+ this.schedulePoll({ property }, value);
134
+ }
135
+ return result;
136
+ };
137
+ }
138
+ get [POLL_VALUE]() {
139
+ return async function ({ property }) {
140
+ switch (property) {
141
+ case "mode":
142
+ return (await this.get())?.[property];
143
+ default:
144
+ throwUnsupportedProperty(this.ccId, property);
145
+ }
146
+ };
147
+ }
148
+ // eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types
149
+ async get() {
150
+ this.assertSupportsCommand(ThermostatModeCommand, ThermostatModeCommand.Get);
151
+ const cc = new ThermostatModeCCGet({
152
+ nodeId: this.endpoint.nodeId,
153
+ endpointIndex: this.endpoint.index,
154
+ });
155
+ const response = await this.host.sendCommand(cc, this.commandOptions);
156
+ if (response) {
157
+ return pick(response, ["mode", "manufacturerData"]);
104
158
  }
105
- };
106
- }
107
- // eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types
108
- async get() {
109
- this.assertSupportsCommand(ThermostatModeCommand, ThermostatModeCommand.Get);
110
- const cc = new ThermostatModeCCGet({
111
- nodeId: this.endpoint.nodeId,
112
- endpointIndex: this.endpoint.index,
113
- });
114
- const response = await this.host.sendCommand(cc, this.commandOptions);
115
- if (response) {
116
- return pick(response, ["mode", "manufacturerData"]);
117
159
  }
118
- }
119
- async set(mode, manufacturerData) {
120
- __assertType("mode", "ThermostatMode", __assertType__ThermostatMode.bind(void 0, mode));
121
- __assertType("manufacturerData", undefined, __assertType__optional_su__string__uint8array_eu.bind(void 0, manufacturerData));
122
- this.assertSupportsCommand(ThermostatModeCommand, ThermostatModeCommand.Set);
123
- if (typeof manufacturerData === "string") {
124
- // We accept the manufacturer data as a hex string. Make sure it's valid
125
- if (manufacturerData.length % 2 !== 0
126
- || !/^[0-9a-f]+$/i.test(manufacturerData)) {
127
- throw new ZWaveError(`Manufacturer data must be represented as hexadecimal when passed as a string!`, ZWaveErrorCodes.Argument_Invalid);
160
+ async set(mode, manufacturerData) {
161
+ __assertType("mode", "ThermostatMode", __assertType__ThermostatMode.bind(void 0, mode));
162
+ __assertType("manufacturerData", undefined, __assertType__optional_su__string__uint8array_eu.bind(void 0, manufacturerData));
163
+ this.assertSupportsCommand(ThermostatModeCommand, ThermostatModeCommand.Set);
164
+ if (typeof manufacturerData === "string") {
165
+ // We accept the manufacturer data as a hex string. Make sure it's valid
166
+ if (manufacturerData.length % 2 !== 0
167
+ || !/^[0-9a-f]+$/i.test(manufacturerData)) {
168
+ throw new ZWaveError(`Manufacturer data must be represented as hexadecimal when passed as a string!`, ZWaveErrorCodes.Argument_Invalid);
169
+ }
170
+ manufacturerData = Bytes.from(manufacturerData, "hex");
128
171
  }
129
- manufacturerData = Bytes.from(manufacturerData, "hex");
130
- }
131
- const cc = new ThermostatModeCCSet({
132
- nodeId: this.endpoint.nodeId,
133
- endpointIndex: this.endpoint.index,
134
- mode,
135
- manufacturerData: manufacturerData,
136
- });
137
- return this.host.sendCommand(cc, this.commandOptions);
138
- }
139
- async getSupportedModes() {
140
- this.assertSupportsCommand(ThermostatModeCommand, ThermostatModeCommand.SupportedGet);
141
- const cc = new ThermostatModeCCSupportedGet({
142
- nodeId: this.endpoint.nodeId,
143
- endpointIndex: this.endpoint.index,
144
- });
145
- const response = await this.host.sendCommand(cc, this.commandOptions);
146
- return response?.supportedModes;
147
- }
148
- };
149
- ThermostatModeCCAPI = __decorate([
150
- API(CommandClasses["Thermostat Mode"])
151
- ], ThermostatModeCCAPI);
172
+ const cc = new ThermostatModeCCSet({
173
+ nodeId: this.endpoint.nodeId,
174
+ endpointIndex: this.endpoint.index,
175
+ mode,
176
+ manufacturerData: manufacturerData,
177
+ });
178
+ return this.host.sendCommand(cc, this.commandOptions);
179
+ }
180
+ async getSupportedModes() {
181
+ this.assertSupportsCommand(ThermostatModeCommand, ThermostatModeCommand.SupportedGet);
182
+ const cc = new ThermostatModeCCSupportedGet({
183
+ nodeId: this.endpoint.nodeId,
184
+ endpointIndex: this.endpoint.index,
185
+ });
186
+ const response = await this.host.sendCommand(cc, this.commandOptions);
187
+ return response?.supportedModes;
188
+ }
189
+ };
190
+ return ThermostatModeCCAPI = _classThis;
191
+ })();
152
192
  export { ThermostatModeCCAPI };
153
- let ThermostatModeCC = class ThermostatModeCC extends CommandClass {
154
- async interview(ctx) {
155
- const node = this.getNode(ctx);
156
- const endpoint = this.getEndpoint(ctx);
157
- const api = CCAPI.create(CommandClasses["Thermostat Mode"], ctx, endpoint).withOptions({
158
- priority: MessagePriority.NodeQuery,
159
- });
160
- ctx.logNode(node.id, {
161
- endpoint: this.endpointIndex,
162
- message: `Interviewing ${this.ccName}...`,
163
- direction: "none",
164
- });
165
- // First query the possible modes to set the metadata
166
- ctx.logNode(node.id, {
167
- endpoint: this.endpointIndex,
168
- message: "querying supported thermostat modes...",
169
- direction: "outbound",
170
- });
171
- const supportedModes = await api.getSupportedModes();
172
- if (supportedModes) {
173
- const logMessage = `received supported thermostat modes:${supportedModes
174
- .map((mode) => `\n· ${getEnumMemberName(ThermostatMode, mode)}`)
175
- .join("")}`;
193
+ let ThermostatModeCC = (() => {
194
+ let _classDecorators = [commandClass(CommandClasses["Thermostat Mode"]), implementedVersion(3), ccValues(ThermostatModeCCValues)];
195
+ let _classDescriptor;
196
+ let _classExtraInitializers = [];
197
+ let _classThis;
198
+ let _classSuper = CommandClass;
199
+ var ThermostatModeCC = class extends _classSuper {
200
+ static { _classThis = this; }
201
+ static {
202
+ const _metadata = typeof Symbol === "function" && Symbol.metadata ? Object.create(_classSuper[Symbol.metadata] ?? null) : void 0;
203
+ __esDecorate(null, _classDescriptor = { value: _classThis }, _classDecorators, { kind: "class", name: _classThis.name, metadata: _metadata }, null, _classExtraInitializers);
204
+ ThermostatModeCC = _classThis = _classDescriptor.value;
205
+ if (_metadata) Object.defineProperty(_classThis, Symbol.metadata, { enumerable: true, configurable: true, writable: true, value: _metadata });
206
+ __runInitializers(_classThis, _classExtraInitializers);
207
+ }
208
+ async interview(ctx) {
209
+ const node = this.getNode(ctx);
210
+ const endpoint = this.getEndpoint(ctx);
211
+ const api = CCAPI.create(CommandClasses["Thermostat Mode"], ctx, endpoint).withOptions({
212
+ priority: MessagePriority.NodeQuery,
213
+ });
176
214
  ctx.logNode(node.id, {
177
215
  endpoint: this.endpointIndex,
178
- message: logMessage,
179
- direction: "inbound",
216
+ message: `Interviewing ${this.ccName}...`,
217
+ direction: "none",
180
218
  });
181
- }
182
- else {
219
+ // First query the possible modes to set the metadata
183
220
  ctx.logNode(node.id, {
184
221
  endpoint: this.endpointIndex,
185
- message: "Querying supported thermostat modes timed out, skipping interview...",
186
- level: "warn",
222
+ message: "querying supported thermostat modes...",
223
+ direction: "outbound",
187
224
  });
188
- return;
225
+ const supportedModes = await api.getSupportedModes();
226
+ if (supportedModes) {
227
+ const logMessage = `received supported thermostat modes:${supportedModes
228
+ .map((mode) => `\n· ${getEnumMemberName(ThermostatMode, mode)}`)
229
+ .join("")}`;
230
+ ctx.logNode(node.id, {
231
+ endpoint: this.endpointIndex,
232
+ message: logMessage,
233
+ direction: "inbound",
234
+ });
235
+ }
236
+ else {
237
+ ctx.logNode(node.id, {
238
+ endpoint: this.endpointIndex,
239
+ message: "Querying supported thermostat modes timed out, skipping interview...",
240
+ level: "warn",
241
+ });
242
+ return;
243
+ }
244
+ await this.refreshValues(ctx);
245
+ // Remember that the interview is complete
246
+ this.setInterviewComplete(ctx, true);
189
247
  }
190
- await this.refreshValues(ctx);
191
- // Remember that the interview is complete
192
- this.setInterviewComplete(ctx, true);
193
- }
194
- async refreshValues(ctx) {
195
- const node = this.getNode(ctx);
196
- const endpoint = this.getEndpoint(ctx);
197
- const api = CCAPI.create(CommandClasses["Thermostat Mode"], ctx, endpoint).withOptions({
198
- priority: MessagePriority.NodeQuery,
199
- });
200
- // Query the current status
201
- ctx.logNode(node.id, {
202
- endpoint: this.endpointIndex,
203
- message: "querying current thermostat mode...",
204
- direction: "outbound",
205
- });
206
- const currentStatus = await api.get();
207
- if (currentStatus) {
248
+ async refreshValues(ctx) {
249
+ const node = this.getNode(ctx);
250
+ const endpoint = this.getEndpoint(ctx);
251
+ const api = CCAPI.create(CommandClasses["Thermostat Mode"], ctx, endpoint).withOptions({
252
+ priority: MessagePriority.NodeQuery,
253
+ });
254
+ // Query the current status
208
255
  ctx.logNode(node.id, {
209
256
  endpoint: this.endpointIndex,
210
- message: "received current thermostat mode: "
211
- + getEnumMemberName(ThermostatMode, currentStatus.mode),
212
- direction: "inbound",
257
+ message: "querying current thermostat mode...",
258
+ direction: "outbound",
213
259
  });
260
+ const currentStatus = await api.get();
261
+ if (currentStatus) {
262
+ ctx.logNode(node.id, {
263
+ endpoint: this.endpointIndex,
264
+ message: "received current thermostat mode: "
265
+ + getEnumMemberName(ThermostatMode, currentStatus.mode),
266
+ direction: "inbound",
267
+ });
268
+ }
214
269
  }
215
- }
216
- };
217
- ThermostatModeCC = __decorate([
218
- commandClass(CommandClasses["Thermostat Mode"]),
219
- implementedVersion(3),
220
- ccValues(ThermostatModeCCValues)
221
- ], ThermostatModeCC);
270
+ };
271
+ return ThermostatModeCC = _classThis;
272
+ })();
222
273
  export { ThermostatModeCC };
223
- let ThermostatModeCCSet = ThermostatModeCCSet_1 = class ThermostatModeCCSet extends ThermostatModeCC {
224
- constructor(options) {
225
- super(options);
226
- this.mode = options.mode;
227
- if ("manufacturerData" in options) {
228
- this.manufacturerData = options.manufacturerData;
274
+ let ThermostatModeCCSet = (() => {
275
+ let _classDecorators = [CCCommand(ThermostatModeCommand.Set), useSupervision()];
276
+ let _classDescriptor;
277
+ let _classExtraInitializers = [];
278
+ let _classThis;
279
+ let _classSuper = ThermostatModeCC;
280
+ var ThermostatModeCCSet = class extends _classSuper {
281
+ static { _classThis = this; }
282
+ static {
283
+ const _metadata = typeof Symbol === "function" && Symbol.metadata ? Object.create(_classSuper[Symbol.metadata] ?? null) : void 0;
284
+ __esDecorate(null, _classDescriptor = { value: _classThis }, _classDecorators, { kind: "class", name: _classThis.name, metadata: _metadata }, null, _classExtraInitializers);
285
+ ThermostatModeCCSet = _classThis = _classDescriptor.value;
286
+ if (_metadata) Object.defineProperty(_classThis, Symbol.metadata, { enumerable: true, configurable: true, writable: true, value: _metadata });
287
+ __runInitializers(_classThis, _classExtraInitializers);
229
288
  }
230
- }
231
- static from(raw, ctx) {
232
- validatePayload(raw.payload.length >= 1);
233
- const mode = raw.payload[0] & 0b11111;
234
- if (mode !== ThermostatMode["Manufacturer specific"]) {
235
- return new ThermostatModeCCSet_1({
289
+ constructor(options) {
290
+ super(options);
291
+ this.mode = options.mode;
292
+ if ("manufacturerData" in options) {
293
+ this.manufacturerData = options.manufacturerData;
294
+ }
295
+ }
296
+ static from(raw, ctx) {
297
+ validatePayload(raw.payload.length >= 1);
298
+ const mode = raw.payload[0] & 0b11111;
299
+ if (mode !== ThermostatMode["Manufacturer specific"]) {
300
+ return new this({
301
+ nodeId: ctx.sourceNodeId,
302
+ mode,
303
+ });
304
+ }
305
+ const manufacturerDataLength = (raw.payload[0] >>> 5) & 0b111;
306
+ validatePayload(raw.payload.length >= 1 + manufacturerDataLength);
307
+ const manufacturerData = raw.payload.subarray(1, 1 + manufacturerDataLength);
308
+ return new this({
236
309
  nodeId: ctx.sourceNodeId,
237
310
  mode,
311
+ manufacturerData,
238
312
  });
239
313
  }
240
- const manufacturerDataLength = (raw.payload[0] >>> 5) & 0b111;
241
- validatePayload(raw.payload.length >= 1 + manufacturerDataLength);
242
- const manufacturerData = raw.payload.subarray(1, 1 + manufacturerDataLength);
243
- return new ThermostatModeCCSet_1({
244
- nodeId: ctx.sourceNodeId,
245
- mode,
246
- manufacturerData,
247
- });
248
- }
249
- mode;
250
- manufacturerData;
251
- serialize(ctx) {
252
- const manufacturerData = this.mode === ThermostatMode["Manufacturer specific"]
253
- && this.manufacturerData
254
- ? this.manufacturerData
255
- : new Uint8Array();
256
- const manufacturerDataLength = manufacturerData.length;
257
- this.payload = Bytes.concat([
258
- Bytes.from([
259
- ((manufacturerDataLength & 0b111) << 5) + (this.mode & 0b11111),
260
- ]),
261
- manufacturerData,
262
- ]);
263
- return super.serialize(ctx);
264
- }
265
- toLogEntry(ctx) {
266
- const message = {
267
- mode: getEnumMemberName(ThermostatMode, this.mode),
268
- };
269
- if (this.manufacturerData != undefined) {
270
- message["manufacturer data"] = buffer2hex(this.manufacturerData);
271
- }
272
- return {
273
- ...super.toLogEntry(ctx),
274
- message,
275
- };
276
- }
277
- };
278
- ThermostatModeCCSet = ThermostatModeCCSet_1 = __decorate([
279
- CCCommand(ThermostatModeCommand.Set),
280
- useSupervision()
281
- ], ThermostatModeCCSet);
314
+ mode;
315
+ manufacturerData;
316
+ serialize(ctx) {
317
+ const manufacturerData = this.mode === ThermostatMode["Manufacturer specific"]
318
+ && this.manufacturerData
319
+ ? this.manufacturerData
320
+ : new Uint8Array();
321
+ const manufacturerDataLength = manufacturerData.length;
322
+ this.payload = Bytes.concat([
323
+ Bytes.from([
324
+ ((manufacturerDataLength & 0b111) << 5) + (this.mode & 0b11111),
325
+ ]),
326
+ manufacturerData,
327
+ ]);
328
+ return super.serialize(ctx);
329
+ }
330
+ toLogEntry(ctx) {
331
+ const message = {
332
+ mode: getEnumMemberName(ThermostatMode, this.mode),
333
+ };
334
+ if (this.manufacturerData != undefined) {
335
+ message["manufacturer data"] = buffer2hex(this.manufacturerData);
336
+ }
337
+ return {
338
+ ...super.toLogEntry(ctx),
339
+ message,
340
+ };
341
+ }
342
+ };
343
+ return ThermostatModeCCSet = _classThis;
344
+ })();
282
345
  export { ThermostatModeCCSet };
283
- let ThermostatModeCCReport = ThermostatModeCCReport_1 = class ThermostatModeCCReport extends ThermostatModeCC {
284
- constructor(options) {
285
- super(options);
286
- this.mode = options.mode;
287
- this.manufacturerData = options.manufacturerData;
288
- }
289
- static from(raw, ctx) {
290
- validatePayload(raw.payload.length >= 1);
291
- const mode = raw.payload[0] & 0b11111;
292
- if (mode !== ThermostatMode["Manufacturer specific"]) {
293
- return new ThermostatModeCCReport_1({
346
+ let ThermostatModeCCReport = (() => {
347
+ let _classDecorators = [CCCommand(ThermostatModeCommand.Report), ccValueProperty("mode", ThermostatModeCCValues.thermostatMode), ccValueProperty("manufacturerData", ThermostatModeCCValues.manufacturerData)];
348
+ let _classDescriptor;
349
+ let _classExtraInitializers = [];
350
+ let _classThis;
351
+ let _classSuper = ThermostatModeCC;
352
+ var ThermostatModeCCReport = class extends _classSuper {
353
+ static { _classThis = this; }
354
+ static {
355
+ const _metadata = typeof Symbol === "function" && Symbol.metadata ? Object.create(_classSuper[Symbol.metadata] ?? null) : void 0;
356
+ __esDecorate(null, _classDescriptor = { value: _classThis }, _classDecorators, { kind: "class", name: _classThis.name, metadata: _metadata }, null, _classExtraInitializers);
357
+ ThermostatModeCCReport = _classThis = _classDescriptor.value;
358
+ if (_metadata) Object.defineProperty(_classThis, Symbol.metadata, { enumerable: true, configurable: true, writable: true, value: _metadata });
359
+ __runInitializers(_classThis, _classExtraInitializers);
360
+ }
361
+ constructor(options) {
362
+ super(options);
363
+ this.mode = options.mode;
364
+ this.manufacturerData = options.manufacturerData;
365
+ }
366
+ static from(raw, ctx) {
367
+ validatePayload(raw.payload.length >= 1);
368
+ const mode = raw.payload[0] & 0b11111;
369
+ if (mode !== ThermostatMode["Manufacturer specific"]) {
370
+ return new this({
371
+ nodeId: ctx.sourceNodeId,
372
+ mode,
373
+ });
374
+ }
375
+ // V3+
376
+ const manufacturerDataLength = raw.payload[0] >>> 5;
377
+ validatePayload(raw.payload.length >= 1 + manufacturerDataLength);
378
+ const manufacturerData = raw.payload.subarray(1, 1 + manufacturerDataLength);
379
+ return new this({
294
380
  nodeId: ctx.sourceNodeId,
295
381
  mode,
382
+ manufacturerData,
296
383
  });
297
384
  }
298
- // V3+
299
- const manufacturerDataLength = raw.payload[0] >>> 5;
300
- validatePayload(raw.payload.length >= 1 + manufacturerDataLength);
301
- const manufacturerData = raw.payload.subarray(1, 1 + manufacturerDataLength);
302
- return new ThermostatModeCCReport_1({
303
- nodeId: ctx.sourceNodeId,
304
- mode,
305
- manufacturerData,
306
- });
307
- }
308
- persistValues(ctx) {
309
- if (!super.persistValues(ctx))
310
- return false;
311
- // Update the supported modes if a mode is used that wasn't previously
312
- // reported to be supported. This shouldn't happen, but well... it does anyways
313
- const thermostatModeValue = ThermostatModeCCValues.thermostatMode;
314
- const supportedModesValue = ThermostatModeCCValues.supportedModes;
315
- const supportedModes = this.getValue(ctx, supportedModesValue);
316
- if (supportedModes
317
- && this.mode in ThermostatMode
318
- && !supportedModes.includes(this.mode)) {
319
- supportedModes.push(this.mode);
320
- supportedModes.sort();
385
+ persistValues(ctx) {
386
+ if (!super.persistValues(ctx))
387
+ return false;
388
+ // Update the supported modes if a mode is used that wasn't previously
389
+ // reported to be supported. This shouldn't happen, but well... it does anyways
390
+ const thermostatModeValue = ThermostatModeCCValues.thermostatMode;
391
+ const supportedModesValue = ThermostatModeCCValues.supportedModes;
392
+ const supportedModes = this.getValue(ctx, supportedModesValue);
393
+ if (supportedModes
394
+ && this.mode in ThermostatMode
395
+ && !supportedModes.includes(this.mode)) {
396
+ supportedModes.push(this.mode);
397
+ supportedModes.sort();
398
+ this.setMetadata(ctx, thermostatModeValue, {
399
+ ...thermostatModeValue.meta,
400
+ states: enumValuesToMetadataStates(ThermostatMode, supportedModes),
401
+ });
402
+ this.setValue(ctx, supportedModesValue, supportedModes);
403
+ }
404
+ return true;
405
+ }
406
+ mode;
407
+ manufacturerData;
408
+ serialize(ctx) {
409
+ const manufacturerDataLength = this.mode === ThermostatMode["Manufacturer specific"]
410
+ && this.manufacturerData
411
+ ? Math.min(0b111, this.manufacturerData.length)
412
+ : 0;
413
+ this.payload = new Bytes(1 + manufacturerDataLength);
414
+ this.payload[0] = (manufacturerDataLength << 5) + (this.mode & 0b11111);
415
+ if (manufacturerDataLength && this.manufacturerData) {
416
+ this.payload.set(this.manufacturerData.subarray(0, manufacturerDataLength), 1);
417
+ }
418
+ return super.serialize(ctx);
419
+ }
420
+ toLogEntry(ctx) {
421
+ const message = {
422
+ mode: getEnumMemberName(ThermostatMode, this.mode),
423
+ };
424
+ if (this.manufacturerData != undefined) {
425
+ message["manufacturer data"] = buffer2hex(this.manufacturerData);
426
+ }
427
+ return {
428
+ ...super.toLogEntry(ctx),
429
+ message,
430
+ };
431
+ }
432
+ };
433
+ return ThermostatModeCCReport = _classThis;
434
+ })();
435
+ export { ThermostatModeCCReport };
436
+ let ThermostatModeCCGet = (() => {
437
+ let _classDecorators = [CCCommand(ThermostatModeCommand.Get), expectedCCResponse(ThermostatModeCCReport)];
438
+ let _classDescriptor;
439
+ let _classExtraInitializers = [];
440
+ let _classThis;
441
+ let _classSuper = ThermostatModeCC;
442
+ var ThermostatModeCCGet = class extends _classSuper {
443
+ static { _classThis = this; }
444
+ static {
445
+ const _metadata = typeof Symbol === "function" && Symbol.metadata ? Object.create(_classSuper[Symbol.metadata] ?? null) : void 0;
446
+ __esDecorate(null, _classDescriptor = { value: _classThis }, _classDecorators, { kind: "class", name: _classThis.name, metadata: _metadata }, null, _classExtraInitializers);
447
+ ThermostatModeCCGet = _classThis = _classDescriptor.value;
448
+ if (_metadata) Object.defineProperty(_classThis, Symbol.metadata, { enumerable: true, configurable: true, writable: true, value: _metadata });
449
+ __runInitializers(_classThis, _classExtraInitializers);
450
+ }
451
+ };
452
+ return ThermostatModeCCGet = _classThis;
453
+ })();
454
+ export { ThermostatModeCCGet };
455
+ let ThermostatModeCCSupportedReport = (() => {
456
+ let _classDecorators = [CCCommand(ThermostatModeCommand.SupportedReport), ccValueProperty("supportedModes", ThermostatModeCCValues.supportedModes)];
457
+ let _classDescriptor;
458
+ let _classExtraInitializers = [];
459
+ let _classThis;
460
+ let _classSuper = ThermostatModeCC;
461
+ var ThermostatModeCCSupportedReport = class extends _classSuper {
462
+ static { _classThis = this; }
463
+ static {
464
+ const _metadata = typeof Symbol === "function" && Symbol.metadata ? Object.create(_classSuper[Symbol.metadata] ?? null) : void 0;
465
+ __esDecorate(null, _classDescriptor = { value: _classThis }, _classDecorators, { kind: "class", name: _classThis.name, metadata: _metadata }, null, _classExtraInitializers);
466
+ ThermostatModeCCSupportedReport = _classThis = _classDescriptor.value;
467
+ if (_metadata) Object.defineProperty(_classThis, Symbol.metadata, { enumerable: true, configurable: true, writable: true, value: _metadata });
468
+ __runInitializers(_classThis, _classExtraInitializers);
469
+ }
470
+ constructor(options) {
471
+ super(options);
472
+ this.supportedModes = options.supportedModes;
473
+ }
474
+ static from(raw, ctx) {
475
+ const supportedModes = parseBitMask(raw.payload, ThermostatMode.Off);
476
+ return new this({
477
+ nodeId: ctx.sourceNodeId,
478
+ supportedModes,
479
+ });
480
+ }
481
+ persistValues(ctx) {
482
+ if (!super.persistValues(ctx))
483
+ return false;
484
+ // Use this information to create the metadata for the mode property
485
+ const thermostatModeValue = ThermostatModeCCValues.thermostatMode;
321
486
  this.setMetadata(ctx, thermostatModeValue, {
322
487
  ...thermostatModeValue.meta,
323
- states: enumValuesToMetadataStates(ThermostatMode, supportedModes),
488
+ states: enumValuesToMetadataStates(ThermostatMode, this.supportedModes),
324
489
  });
325
- this.setValue(ctx, supportedModesValue, supportedModes);
490
+ return true;
326
491
  }
327
- return true;
328
- }
329
- mode;
330
- manufacturerData;
331
- serialize(ctx) {
332
- const manufacturerDataLength = this.mode === ThermostatMode["Manufacturer specific"]
333
- && this.manufacturerData
334
- ? Math.min(0b111, this.manufacturerData.length)
335
- : 0;
336
- this.payload = new Bytes(1 + manufacturerDataLength);
337
- this.payload[0] = (manufacturerDataLength << 5) + (this.mode & 0b11111);
338
- if (manufacturerDataLength && this.manufacturerData) {
339
- this.payload.set(this.manufacturerData.subarray(0, manufacturerDataLength), 1);
340
- }
341
- return super.serialize(ctx);
342
- }
343
- toLogEntry(ctx) {
344
- const message = {
345
- mode: getEnumMemberName(ThermostatMode, this.mode),
346
- };
347
- if (this.manufacturerData != undefined) {
348
- message["manufacturer data"] = buffer2hex(this.manufacturerData);
349
- }
350
- return {
351
- ...super.toLogEntry(ctx),
352
- message,
353
- };
354
- }
355
- };
356
- __decorate([
357
- ccValue(ThermostatModeCCValues.thermostatMode)
358
- ], ThermostatModeCCReport.prototype, "mode", void 0);
359
- __decorate([
360
- ccValue(ThermostatModeCCValues.manufacturerData)
361
- ], ThermostatModeCCReport.prototype, "manufacturerData", void 0);
362
- ThermostatModeCCReport = ThermostatModeCCReport_1 = __decorate([
363
- CCCommand(ThermostatModeCommand.Report)
364
- ], ThermostatModeCCReport);
365
- export { ThermostatModeCCReport };
366
- let ThermostatModeCCGet = class ThermostatModeCCGet extends ThermostatModeCC {
367
- };
368
- ThermostatModeCCGet = __decorate([
369
- CCCommand(ThermostatModeCommand.Get),
370
- expectedCCResponse(ThermostatModeCCReport)
371
- ], ThermostatModeCCGet);
372
- export { ThermostatModeCCGet };
373
- let ThermostatModeCCSupportedReport = ThermostatModeCCSupportedReport_1 = class ThermostatModeCCSupportedReport extends ThermostatModeCC {
374
- constructor(options) {
375
- super(options);
376
- this.supportedModes = options.supportedModes;
377
- }
378
- static from(raw, ctx) {
379
- const supportedModes = parseBitMask(raw.payload, ThermostatMode.Off);
380
- return new ThermostatModeCCSupportedReport_1({
381
- nodeId: ctx.sourceNodeId,
382
- supportedModes,
383
- });
384
- }
385
- persistValues(ctx) {
386
- if (!super.persistValues(ctx))
387
- return false;
388
- // Use this information to create the metadata for the mode property
389
- const thermostatModeValue = ThermostatModeCCValues.thermostatMode;
390
- this.setMetadata(ctx, thermostatModeValue, {
391
- ...thermostatModeValue.meta,
392
- states: enumValuesToMetadataStates(ThermostatMode, this.supportedModes),
393
- });
394
- return true;
395
- }
396
- supportedModes;
397
- serialize(ctx) {
398
- this.payload = encodeBitMask(this.supportedModes, ThermostatMode["Manufacturer specific"], ThermostatMode.Off);
399
- return super.serialize(ctx);
400
- }
401
- toLogEntry(ctx) {
402
- return {
403
- ...super.toLogEntry(ctx),
404
- message: {
405
- "supported modes": this.supportedModes
406
- .map((mode) => `\n· ${getEnumMemberName(ThermostatMode, mode)}`)
407
- .join(""),
408
- },
409
- };
410
- }
411
- };
412
- __decorate([
413
- ccValue(ThermostatModeCCValues.supportedModes)
414
- ], ThermostatModeCCSupportedReport.prototype, "supportedModes", void 0);
415
- ThermostatModeCCSupportedReport = ThermostatModeCCSupportedReport_1 = __decorate([
416
- CCCommand(ThermostatModeCommand.SupportedReport)
417
- ], ThermostatModeCCSupportedReport);
492
+ supportedModes;
493
+ serialize(ctx) {
494
+ this.payload = encodeBitMask(this.supportedModes, ThermostatMode["Manufacturer specific"], ThermostatMode.Off);
495
+ return super.serialize(ctx);
496
+ }
497
+ toLogEntry(ctx) {
498
+ return {
499
+ ...super.toLogEntry(ctx),
500
+ message: {
501
+ "supported modes": this.supportedModes
502
+ .map((mode) => `\n· ${getEnumMemberName(ThermostatMode, mode)}`)
503
+ .join(""),
504
+ },
505
+ };
506
+ }
507
+ };
508
+ return ThermostatModeCCSupportedReport = _classThis;
509
+ })();
418
510
  export { ThermostatModeCCSupportedReport };
419
- let ThermostatModeCCSupportedGet = class ThermostatModeCCSupportedGet extends ThermostatModeCC {
420
- };
421
- ThermostatModeCCSupportedGet = __decorate([
422
- CCCommand(ThermostatModeCommand.SupportedGet),
423
- expectedCCResponse(ThermostatModeCCSupportedReport)
424
- ], ThermostatModeCCSupportedGet);
511
+ let ThermostatModeCCSupportedGet = (() => {
512
+ let _classDecorators = [CCCommand(ThermostatModeCommand.SupportedGet), expectedCCResponse(ThermostatModeCCSupportedReport)];
513
+ let _classDescriptor;
514
+ let _classExtraInitializers = [];
515
+ let _classThis;
516
+ let _classSuper = ThermostatModeCC;
517
+ var ThermostatModeCCSupportedGet = class extends _classSuper {
518
+ static { _classThis = this; }
519
+ static {
520
+ const _metadata = typeof Symbol === "function" && Symbol.metadata ? Object.create(_classSuper[Symbol.metadata] ?? null) : void 0;
521
+ __esDecorate(null, _classDescriptor = { value: _classThis }, _classDecorators, { kind: "class", name: _classThis.name, metadata: _metadata }, null, _classExtraInitializers);
522
+ ThermostatModeCCSupportedGet = _classThis = _classDescriptor.value;
523
+ if (_metadata) Object.defineProperty(_classThis, Symbol.metadata, { enumerable: true, configurable: true, writable: true, value: _metadata });
524
+ __runInitializers(_classThis, _classExtraInitializers);
525
+ }
526
+ };
527
+ return ThermostatModeCCSupportedGet = _classThis;
528
+ })();
425
529
  export { ThermostatModeCCSupportedGet };
426
530
  //# sourceMappingURL=ThermostatModeCC.js.map