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

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 (922) hide show
  1. package/build/cjs/cc/AlarmSensorCC.d.ts +194 -0
  2. package/build/cjs/cc/AlarmSensorCC.js +395 -0
  3. package/build/cjs/cc/AlarmSensorCC.js.map +7 -0
  4. package/build/cjs/cc/AssociationCC.d.ts +253 -0
  5. package/build/cjs/cc/AssociationCC.js +711 -0
  6. package/build/cjs/cc/AssociationCC.js.map +7 -0
  7. package/build/cjs/cc/AssociationGroupInfoCC.d.ts +230 -0
  8. package/build/cjs/cc/AssociationGroupInfoCC.js +746 -0
  9. package/build/cjs/cc/AssociationGroupInfoCC.js.map +7 -0
  10. package/build/cjs/cc/BarrierOperatorCC.d.ts +243 -0
  11. package/build/cjs/cc/BarrierOperatorCC.js +582 -0
  12. package/build/cjs/cc/BarrierOperatorCC.js.map +7 -0
  13. package/build/cjs/cc/BasicCC.d.ts +191 -0
  14. package/build/cjs/cc/BasicCC.js +384 -0
  15. package/build/cjs/cc/BasicCC.js.map +7 -0
  16. package/build/cjs/cc/BatteryCC.d.ts +406 -0
  17. package/build/cjs/cc/BatteryCC.js +508 -0
  18. package/build/cjs/cc/BatteryCC.js.map +7 -0
  19. package/build/cjs/cc/BinarySensorCC.d.ts +122 -0
  20. package/build/cjs/cc/BinarySensorCC.js +431 -0
  21. package/build/cjs/cc/BinarySensorCC.js.map +7 -0
  22. package/build/cjs/cc/BinarySwitchCC.d.ts +139 -0
  23. package/build/cjs/cc/BinarySwitchCC.js +378 -0
  24. package/build/cjs/cc/BinarySwitchCC.js.map +7 -0
  25. package/build/cjs/cc/CRC16CC.d.ts +29 -0
  26. package/build/cjs/cc/CRC16CC.js +133 -0
  27. package/build/cjs/cc/CRC16CC.js.map +7 -0
  28. package/build/cjs/cc/CentralSceneCC.d.ts +210 -0
  29. package/build/cjs/cc/CentralSceneCC.js +449 -0
  30. package/build/cjs/cc/CentralSceneCC.js.map +7 -0
  31. package/build/cjs/cc/ClimateControlScheduleCC.d.ts +177 -0
  32. package/build/cjs/cc/ClimateControlScheduleCC.js +480 -0
  33. package/build/cjs/cc/ClimateControlScheduleCC.js.map +7 -0
  34. package/build/cjs/cc/ClockCC.d.ts +47 -0
  35. package/build/cjs/cc/ClockCC.js +226 -0
  36. package/build/cjs/cc/ClockCC.js.map +7 -0
  37. package/build/cjs/cc/ColorSwitchCC.d.ts +339 -0
  38. package/build/cjs/cc/ColorSwitchCC.js +1117 -0
  39. package/build/cjs/cc/ColorSwitchCC.js.map +7 -0
  40. package/build/cjs/cc/ConfigurationCC.d.ts +396 -0
  41. package/build/cjs/cc/ConfigurationCC.js +2230 -0
  42. package/build/cjs/cc/ConfigurationCC.js.map +7 -0
  43. package/build/cjs/cc/DeviceResetLocallyCC.d.ts +17 -0
  44. package/build/cjs/cc/DeviceResetLocallyCC.js +92 -0
  45. package/build/cjs/cc/DeviceResetLocallyCC.js.map +7 -0
  46. package/build/cjs/cc/DoorLockCC.d.ts +837 -0
  47. package/build/cjs/cc/DoorLockCC.js +1239 -0
  48. package/build/cjs/cc/DoorLockCC.js.map +7 -0
  49. package/build/cjs/cc/DoorLockLoggingCC.d.ts +77 -0
  50. package/build/cjs/cc/DoorLockLoggingCC.js +343 -0
  51. package/build/cjs/cc/DoorLockLoggingCC.js.map +7 -0
  52. package/build/cjs/cc/EnergyProductionCC.d.ts +77 -0
  53. package/build/cjs/cc/EnergyProductionCC.js +240 -0
  54. package/build/cjs/cc/EnergyProductionCC.js.map +7 -0
  55. package/build/cjs/cc/EntryControlCC.d.ts +231 -0
  56. package/build/cjs/cc/EntryControlCC.js +593 -0
  57. package/build/cjs/cc/EntryControlCC.js.map +7 -0
  58. package/build/cjs/cc/FirmwareUpdateMetaDataCC.d.ts +359 -0
  59. package/build/cjs/cc/FirmwareUpdateMetaDataCC.js +1122 -0
  60. package/build/cjs/cc/FirmwareUpdateMetaDataCC.js.map +7 -0
  61. package/build/cjs/cc/HailCC.d.ts +6 -0
  62. package/build/cjs/cc/HailCC.js +45 -0
  63. package/build/cjs/cc/HailCC.js.map +7 -0
  64. package/build/cjs/cc/HumidityControlModeCC.d.ts +111 -0
  65. package/build/cjs/cc/HumidityControlModeCC.js +323 -0
  66. package/build/cjs/cc/HumidityControlModeCC.js.map +7 -0
  67. package/build/cjs/cc/HumidityControlOperatingStateCC.d.ts +60 -0
  68. package/build/cjs/cc/HumidityControlOperatingStateCC.js +164 -0
  69. package/build/cjs/cc/HumidityControlOperatingStateCC.js.map +7 -0
  70. package/build/cjs/cc/HumidityControlSetpointCC.d.ts +209 -0
  71. package/build/cjs/cc/HumidityControlSetpointCC.js +634 -0
  72. package/build/cjs/cc/HumidityControlSetpointCC.js.map +7 -0
  73. package/build/cjs/cc/InclusionControllerCC.d.ts +42 -0
  74. package/build/cjs/cc/InclusionControllerCC.js +160 -0
  75. package/build/cjs/cc/InclusionControllerCC.js.map +7 -0
  76. package/build/cjs/cc/IndicatorCC.d.ts +338 -0
  77. package/build/cjs/cc/IndicatorCC.js +1234 -0
  78. package/build/cjs/cc/IndicatorCC.js.map +7 -0
  79. package/build/cjs/cc/IrrigationCC.d.ts +1496 -0
  80. package/build/cjs/cc/IrrigationCC.js +1978 -0
  81. package/build/cjs/cc/IrrigationCC.js.map +7 -0
  82. package/build/cjs/cc/LanguageCC.d.ts +101 -0
  83. package/build/cjs/cc/LanguageCC.js +267 -0
  84. package/build/cjs/cc/LanguageCC.js.map +7 -0
  85. package/build/cjs/cc/LockCC.d.ts +73 -0
  86. package/build/cjs/cc/LockCC.js +222 -0
  87. package/build/cjs/cc/LockCC.js.map +7 -0
  88. package/build/cjs/cc/ManufacturerProprietaryCC.d.ts +32 -0
  89. package/build/cjs/cc/ManufacturerProprietaryCC.js +209 -0
  90. package/build/cjs/cc/ManufacturerProprietaryCC.js.map +7 -0
  91. package/build/cjs/cc/ManufacturerSpecificCC.d.ts +171 -0
  92. package/build/cjs/cc/ManufacturerSpecificCC.js +334 -0
  93. package/build/cjs/cc/ManufacturerSpecificCC.js.map +7 -0
  94. package/build/cjs/cc/MeterCC.d.ts +318 -0
  95. package/build/cjs/cc/MeterCC.js +1235 -0
  96. package/build/cjs/cc/MeterCC.js.map +7 -0
  97. package/build/cjs/cc/MultiChannelAssociationCC.d.ts +241 -0
  98. package/build/cjs/cc/MultiChannelAssociationCC.js +956 -0
  99. package/build/cjs/cc/MultiChannelAssociationCC.js.map +7 -0
  100. package/build/cjs/cc/MultiChannelCC.d.ts +394 -0
  101. package/build/cjs/cc/MultiChannelCC.js +1050 -0
  102. package/build/cjs/cc/MultiChannelCC.js.map +7 -0
  103. package/build/cjs/cc/MultiCommandCC.d.ts +27 -0
  104. package/build/cjs/cc/MultiCommandCC.js +159 -0
  105. package/build/cjs/cc/MultiCommandCC.js.map +7 -0
  106. package/build/cjs/cc/MultilevelSensorCC.d.ts +185 -0
  107. package/build/cjs/cc/MultilevelSensorCC.js +716 -0
  108. package/build/cjs/cc/MultilevelSensorCC.js.map +7 -0
  109. package/build/cjs/cc/MultilevelSwitchCC.d.ts +357 -0
  110. package/build/cjs/cc/MultilevelSwitchCC.js +780 -0
  111. package/build/cjs/cc/MultilevelSwitchCC.js.map +7 -0
  112. package/build/cjs/cc/NoOperationCC.d.ts +9 -0
  113. package/build/cjs/cc/NoOperationCC.js +64 -0
  114. package/build/cjs/cc/NoOperationCC.js.map +7 -0
  115. package/build/cjs/cc/NodeNamingCC.d.ts +118 -0
  116. package/build/cjs/cc/NodeNamingCC.js +364 -0
  117. package/build/cjs/cc/NodeNamingCC.js.map +7 -0
  118. package/build/cjs/cc/NotificationCC.d.ts +479 -0
  119. package/build/cjs/cc/NotificationCC.js +1245 -0
  120. package/build/cjs/cc/NotificationCC.js.map +7 -0
  121. package/build/cjs/cc/PowerlevelCC.d.ts +82 -0
  122. package/build/cjs/cc/PowerlevelCC.js +510 -0
  123. package/build/cjs/cc/PowerlevelCC.js.map +7 -0
  124. package/build/cjs/cc/ProtectionCC.d.ts +325 -0
  125. package/build/cjs/cc/ProtectionCC.js +667 -0
  126. package/build/cjs/cc/ProtectionCC.js.map +7 -0
  127. package/build/cjs/cc/SceneActivationCC.d.ts +89 -0
  128. package/build/cjs/cc/SceneActivationCC.js +193 -0
  129. package/build/cjs/cc/SceneActivationCC.js.map +7 -0
  130. package/build/cjs/cc/SceneActuatorConfigurationCC.d.ts +120 -0
  131. package/build/cjs/cc/SceneActuatorConfigurationCC.js +370 -0
  132. package/build/cjs/cc/SceneActuatorConfigurationCC.js.map +7 -0
  133. package/build/cjs/cc/SceneControllerConfigurationCC.d.ts +129 -0
  134. package/build/cjs/cc/SceneControllerConfigurationCC.js +423 -0
  135. package/build/cjs/cc/SceneControllerConfigurationCC.js.map +7 -0
  136. package/build/cjs/cc/ScheduleEntryLockCC.d.ts +434 -0
  137. package/build/cjs/cc/ScheduleEntryLockCC.js +1763 -0
  138. package/build/cjs/cc/ScheduleEntryLockCC.js.map +7 -0
  139. package/build/cjs/cc/Security2CC.d.ts +251 -0
  140. package/build/cjs/cc/Security2CC.js +1589 -0
  141. package/build/cjs/cc/Security2CC.js.map +7 -0
  142. package/build/cjs/cc/SecurityCC.d.ts +128 -0
  143. package/build/cjs/cc/SecurityCC.js +757 -0
  144. package/build/cjs/cc/SecurityCC.js.map +7 -0
  145. package/build/cjs/cc/SoundSwitchCC.d.ts +232 -0
  146. package/build/cjs/cc/SoundSwitchCC.js +661 -0
  147. package/build/cjs/cc/SoundSwitchCC.js.map +7 -0
  148. package/build/cjs/cc/SupervisionCC.d.ts +104 -0
  149. package/build/cjs/cc/SupervisionCC.js +308 -0
  150. package/build/cjs/cc/SupervisionCC.js.map +7 -0
  151. package/build/cjs/cc/ThermostatFanModeCC.d.ts +141 -0
  152. package/build/cjs/cc/ThermostatFanModeCC.js +372 -0
  153. package/build/cjs/cc/ThermostatFanModeCC.js.map +7 -0
  154. package/build/cjs/cc/ThermostatFanStateCC.d.ts +60 -0
  155. package/build/cjs/cc/ThermostatFanStateCC.js +166 -0
  156. package/build/cjs/cc/ThermostatFanStateCC.js.map +7 -0
  157. package/build/cjs/cc/ThermostatModeCC.d.ts +150 -0
  158. package/build/cjs/cc/ThermostatModeCC.js +436 -0
  159. package/build/cjs/cc/ThermostatModeCC.js.map +7 -0
  160. package/build/cjs/cc/ThermostatOperatingStateCC.d.ts +61 -0
  161. package/build/cjs/cc/ThermostatOperatingStateCC.js +162 -0
  162. package/build/cjs/cc/ThermostatOperatingStateCC.js.map +7 -0
  163. package/build/cjs/cc/ThermostatSetbackCC.d.ts +46 -0
  164. package/build/cjs/cc/ThermostatSetbackCC.js +262 -0
  165. package/build/cjs/cc/ThermostatSetbackCC.js.map +7 -0
  166. package/build/cjs/cc/ThermostatSetpointCC.d.ts +197 -0
  167. package/build/cjs/cc/ThermostatSetpointCC.js +638 -0
  168. package/build/cjs/cc/ThermostatSetpointCC.js.map +7 -0
  169. package/build/cjs/cc/TimeCC.d.ts +88 -0
  170. package/build/cjs/cc/TimeCC.js +473 -0
  171. package/build/cjs/cc/TimeCC.js.map +7 -0
  172. package/build/cjs/cc/TimeParametersCC.d.ts +72 -0
  173. package/build/cjs/cc/TimeParametersCC.js +313 -0
  174. package/build/cjs/cc/TimeParametersCC.js.map +7 -0
  175. package/build/cjs/cc/TransportServiceCC.d.ts +107 -0
  176. package/build/cjs/cc/TransportServiceCC.js +404 -0
  177. package/build/cjs/cc/TransportServiceCC.js.map +7 -0
  178. package/build/cjs/cc/UserCodeCC.d.ts +683 -0
  179. package/build/cjs/cc/UserCodeCC.js +1620 -0
  180. package/build/cjs/cc/UserCodeCC.js.map +7 -0
  181. package/build/cjs/cc/VersionCC.d.ts +469 -0
  182. package/build/cjs/cc/VersionCC.js +828 -0
  183. package/build/cjs/cc/VersionCC.js.map +7 -0
  184. package/build/cjs/cc/WakeUpCC.d.ts +150 -0
  185. package/build/cjs/cc/WakeUpCC.js +456 -0
  186. package/build/cjs/cc/WakeUpCC.js.map +7 -0
  187. package/build/cjs/cc/WindowCoveringCC.d.ts +315 -0
  188. package/build/cjs/cc/WindowCoveringCC.js +776 -0
  189. package/build/cjs/cc/WindowCoveringCC.js.map +7 -0
  190. package/build/cjs/cc/ZWaveLongRangeCC.d.ts +4 -0
  191. package/build/cjs/cc/ZWaveLongRangeCC.js +43 -0
  192. package/build/cjs/cc/ZWaveLongRangeCC.js.map +7 -0
  193. package/build/cjs/cc/ZWavePlusCC.d.ts +163 -0
  194. package/build/cjs/cc/ZWavePlusCC.js +288 -0
  195. package/build/cjs/cc/ZWavePlusCC.js.map +7 -0
  196. package/build/cjs/cc/ZWaveProtocolCC.d.ts +344 -0
  197. package/build/cjs/cc/ZWaveProtocolCC.js +1071 -0
  198. package/build/cjs/cc/ZWaveProtocolCC.js.map +7 -0
  199. package/build/cjs/cc/index.d.ts +132 -0
  200. package/build/cjs/cc/index.js +1180 -0
  201. package/build/cjs/cc/index.js.map +7 -0
  202. package/build/cjs/cc/manufacturerProprietary/Decorators.d.ts +64 -0
  203. package/build/cjs/cc/manufacturerProprietary/Decorators.js +76 -0
  204. package/build/cjs/cc/manufacturerProprietary/Decorators.js.map +7 -0
  205. package/build/cjs/cc/manufacturerProprietary/FibaroCC.d.ts +79 -0
  206. package/build/cjs/cc/manufacturerProprietary/FibaroCC.js +412 -0
  207. package/build/cjs/cc/manufacturerProprietary/FibaroCC.js.map +7 -0
  208. package/build/cjs/index.d.ts +15 -0
  209. package/build/cjs/index.js +77 -0
  210. package/build/cjs/index.js.map +7 -0
  211. package/build/cjs/index_safe.d.ts +3 -0
  212. package/build/cjs/index_safe.js +25 -0
  213. package/build/cjs/index_safe.js.map +7 -0
  214. package/build/cjs/lib/API.d.ts +271 -0
  215. package/build/cjs/lib/API.js +413 -0
  216. package/build/cjs/lib/API.js.map +7 -0
  217. package/build/cjs/lib/CommandClass.d.ts +234 -0
  218. package/build/cjs/lib/CommandClass.js +692 -0
  219. package/build/cjs/lib/CommandClass.js.map +7 -0
  220. package/build/cjs/lib/CommandClassDecorators.d.ts +112 -0
  221. package/build/cjs/lib/CommandClassDecorators.js +182 -0
  222. package/build/cjs/lib/CommandClassDecorators.js.map +7 -0
  223. package/build/cjs/lib/EncapsulatingCommandClass.d.ts +22 -0
  224. package/build/cjs/lib/EncapsulatingCommandClass.js +71 -0
  225. package/build/cjs/lib/EncapsulatingCommandClass.js.map +7 -0
  226. package/build/cjs/lib/ICommandClassContainer.js +17 -0
  227. package/build/cjs/lib/ICommandClassContainer.js.map +7 -0
  228. package/build/cjs/lib/NotificationEventPayload.d.ts +10 -0
  229. package/build/cjs/lib/NotificationEventPayload.js +31 -0
  230. package/build/cjs/lib/NotificationEventPayload.js.map +7 -0
  231. package/build/cjs/lib/Security2/Extension.js +333 -0
  232. package/build/cjs/lib/Security2/Extension.js.map +7 -0
  233. package/build/cjs/lib/Security2/shared.js +69 -0
  234. package/build/cjs/lib/Security2/shared.js.map +7 -0
  235. package/build/cjs/lib/SetValueResult.js +65 -0
  236. package/build/cjs/lib/SetValueResult.js.map +7 -0
  237. package/build/cjs/lib/Values.d.ts +223 -0
  238. package/build/cjs/lib/Values.js +191 -0
  239. package/build/cjs/lib/Values.js.map +7 -0
  240. package/build/cjs/lib/_Types.js +1676 -0
  241. package/build/cjs/lib/_Types.js.map +7 -0
  242. package/build/cjs/lib/serializers.d.ts +34 -0
  243. package/build/cjs/lib/serializers.js +110 -0
  244. package/build/cjs/lib/serializers.js.map +7 -0
  245. package/build/cjs/lib/utils.d.ts +17 -0
  246. package/build/cjs/lib/utils.js +678 -0
  247. package/build/cjs/lib/utils.js.map +7 -0
  248. package/build/cjs/package.json +3 -0
  249. package/build/esm/cc/AlarmSensorCC.d.ts +194 -0
  250. package/build/esm/cc/AlarmSensorCC.d.ts.map +1 -0
  251. package/build/esm/cc/AlarmSensorCC.js +392 -0
  252. package/build/esm/cc/AlarmSensorCC.js.map +1 -0
  253. package/build/esm/cc/AssociationCC.d.ts +253 -0
  254. package/build/esm/cc/AssociationCC.d.ts.map +1 -0
  255. package/build/esm/cc/AssociationCC.js +706 -0
  256. package/build/esm/cc/AssociationCC.js.map +1 -0
  257. package/build/esm/cc/AssociationGroupInfoCC.d.ts +230 -0
  258. package/build/esm/cc/AssociationGroupInfoCC.d.ts.map +1 -0
  259. package/build/esm/cc/AssociationGroupInfoCC.js +769 -0
  260. package/build/esm/cc/AssociationGroupInfoCC.js.map +1 -0
  261. package/build/esm/cc/BarrierOperatorCC.d.ts +243 -0
  262. package/build/esm/cc/BarrierOperatorCC.d.ts.map +1 -0
  263. package/build/esm/cc/BarrierOperatorCC.js +610 -0
  264. package/build/esm/cc/BarrierOperatorCC.js.map +1 -0
  265. package/build/esm/cc/BasicCC.d.ts +191 -0
  266. package/build/esm/cc/BasicCC.d.ts.map +1 -0
  267. package/build/esm/cc/BasicCC.js +390 -0
  268. package/build/esm/cc/BasicCC.js.map +1 -0
  269. package/build/esm/cc/BatteryCC.d.ts +406 -0
  270. package/build/esm/cc/BatteryCC.d.ts.map +1 -0
  271. package/build/esm/cc/BatteryCC.js +513 -0
  272. package/build/esm/cc/BatteryCC.js.map +1 -0
  273. package/build/esm/cc/BinarySensorCC.d.ts +122 -0
  274. package/build/esm/cc/BinarySensorCC.d.ts.map +1 -0
  275. package/build/esm/cc/BinarySensorCC.js +417 -0
  276. package/build/esm/cc/BinarySensorCC.js.map +1 -0
  277. package/build/esm/cc/BinarySwitchCC.d.ts +139 -0
  278. package/build/esm/cc/BinarySwitchCC.d.ts.map +1 -0
  279. package/build/esm/cc/BinarySwitchCC.js +362 -0
  280. package/build/esm/cc/BinarySwitchCC.js.map +1 -0
  281. package/build/esm/cc/CRC16CC.d.ts +29 -0
  282. package/build/esm/cc/CRC16CC.d.ts.map +1 -0
  283. package/build/esm/cc/CRC16CC.js +123 -0
  284. package/build/esm/cc/CRC16CC.js.map +1 -0
  285. package/build/esm/cc/CentralSceneCC.d.ts +210 -0
  286. package/build/esm/cc/CentralSceneCC.d.ts.map +1 -0
  287. package/build/esm/cc/CentralSceneCC.js +427 -0
  288. package/build/esm/cc/CentralSceneCC.js.map +1 -0
  289. package/build/esm/cc/ClimateControlScheduleCC.d.ts +177 -0
  290. package/build/esm/cc/ClimateControlScheduleCC.d.ts.map +1 -0
  291. package/build/esm/cc/ClimateControlScheduleCC.js +466 -0
  292. package/build/esm/cc/ClimateControlScheduleCC.js.map +1 -0
  293. package/build/esm/cc/ClockCC.d.ts +47 -0
  294. package/build/esm/cc/ClockCC.d.ts.map +1 -0
  295. package/build/esm/cc/ClockCC.js +205 -0
  296. package/build/esm/cc/ClockCC.js.map +1 -0
  297. package/build/esm/cc/ColorSwitchCC.d.ts +339 -0
  298. package/build/esm/cc/ColorSwitchCC.d.ts.map +1 -0
  299. package/build/esm/cc/ColorSwitchCC.js +1149 -0
  300. package/build/esm/cc/ColorSwitchCC.js.map +1 -0
  301. package/build/esm/cc/ConfigurationCC.d.ts +396 -0
  302. package/build/esm/cc/ConfigurationCC.d.ts.map +1 -0
  303. package/build/esm/cc/ConfigurationCC.js +2454 -0
  304. package/build/esm/cc/ConfigurationCC.js.map +1 -0
  305. package/build/esm/cc/DeviceResetLocallyCC.d.ts +17 -0
  306. package/build/esm/cc/DeviceResetLocallyCC.d.ts.map +1 -0
  307. package/build/esm/cc/DeviceResetLocallyCC.js +73 -0
  308. package/build/esm/cc/DeviceResetLocallyCC.js.map +1 -0
  309. package/build/esm/cc/DoorLockCC.d.ts +837 -0
  310. package/build/esm/cc/DoorLockCC.d.ts.map +1 -0
  311. package/build/esm/cc/DoorLockCC.js +1270 -0
  312. package/build/esm/cc/DoorLockCC.js.map +1 -0
  313. package/build/esm/cc/DoorLockLoggingCC.d.ts +77 -0
  314. package/build/esm/cc/DoorLockLoggingCC.d.ts.map +1 -0
  315. package/build/esm/cc/DoorLockLoggingCC.js +316 -0
  316. package/build/esm/cc/DoorLockLoggingCC.js.map +1 -0
  317. package/build/esm/cc/EnergyProductionCC.d.ts +77 -0
  318. package/build/esm/cc/EnergyProductionCC.d.ts.map +1 -0
  319. package/build/esm/cc/EnergyProductionCC.js +213 -0
  320. package/build/esm/cc/EnergyProductionCC.js.map +1 -0
  321. package/build/esm/cc/EntryControlCC.d.ts +231 -0
  322. package/build/esm/cc/EntryControlCC.d.ts.map +1 -0
  323. package/build/esm/cc/EntryControlCC.js +581 -0
  324. package/build/esm/cc/EntryControlCC.js.map +1 -0
  325. package/build/esm/cc/FirmwareUpdateMetaDataCC.d.ts +359 -0
  326. package/build/esm/cc/FirmwareUpdateMetaDataCC.d.ts.map +1 -0
  327. package/build/esm/cc/FirmwareUpdateMetaDataCC.js +1142 -0
  328. package/build/esm/cc/FirmwareUpdateMetaDataCC.js.map +1 -0
  329. package/build/esm/cc/HailCC.d.ts +6 -0
  330. package/build/esm/cc/HailCC.d.ts.map +1 -0
  331. package/build/esm/cc/HailCC.js +21 -0
  332. package/build/esm/cc/HailCC.js.map +1 -0
  333. package/build/esm/cc/HumidityControlModeCC.d.ts +111 -0
  334. package/build/esm/cc/HumidityControlModeCC.d.ts.map +1 -0
  335. package/build/esm/cc/HumidityControlModeCC.js +305 -0
  336. package/build/esm/cc/HumidityControlModeCC.js.map +1 -0
  337. package/build/esm/cc/HumidityControlOperatingStateCC.d.ts +60 -0
  338. package/build/esm/cc/HumidityControlOperatingStateCC.d.ts.map +1 -0
  339. package/build/esm/cc/HumidityControlOperatingStateCC.js +137 -0
  340. package/build/esm/cc/HumidityControlOperatingStateCC.js.map +1 -0
  341. package/build/esm/cc/HumidityControlSetpointCC.d.ts +209 -0
  342. package/build/esm/cc/HumidityControlSetpointCC.d.ts.map +1 -0
  343. package/build/esm/cc/HumidityControlSetpointCC.js +645 -0
  344. package/build/esm/cc/HumidityControlSetpointCC.js.map +1 -0
  345. package/build/esm/cc/InclusionControllerCC.d.ts +42 -0
  346. package/build/esm/cc/InclusionControllerCC.d.ts.map +1 -0
  347. package/build/esm/cc/InclusionControllerCC.js +133 -0
  348. package/build/esm/cc/InclusionControllerCC.js.map +1 -0
  349. package/build/esm/cc/IndicatorCC.d.ts +338 -0
  350. package/build/esm/cc/IndicatorCC.d.ts.map +1 -0
  351. package/build/esm/cc/IndicatorCC.js +1317 -0
  352. package/build/esm/cc/IndicatorCC.js.map +1 -0
  353. package/build/esm/cc/IrrigationCC.d.ts +1496 -0
  354. package/build/esm/cc/IrrigationCC.d.ts.map +1 -0
  355. package/build/esm/cc/IrrigationCC.js +2038 -0
  356. package/build/esm/cc/IrrigationCC.js.map +1 -0
  357. package/build/esm/cc/LanguageCC.d.ts +101 -0
  358. package/build/esm/cc/LanguageCC.d.ts.map +1 -0
  359. package/build/esm/cc/LanguageCC.js +243 -0
  360. package/build/esm/cc/LanguageCC.js.map +1 -0
  361. package/build/esm/cc/LockCC.d.ts +73 -0
  362. package/build/esm/cc/LockCC.d.ts.map +1 -0
  363. package/build/esm/cc/LockCC.js +197 -0
  364. package/build/esm/cc/LockCC.js.map +1 -0
  365. package/build/esm/cc/ManufacturerProprietaryCC.d.ts +32 -0
  366. package/build/esm/cc/ManufacturerProprietaryCC.d.ts.map +1 -0
  367. package/build/esm/cc/ManufacturerProprietaryCC.js +201 -0
  368. package/build/esm/cc/ManufacturerProprietaryCC.js.map +1 -0
  369. package/build/esm/cc/ManufacturerSpecificCC.d.ts +171 -0
  370. package/build/esm/cc/ManufacturerSpecificCC.d.ts.map +1 -0
  371. package/build/esm/cc/ManufacturerSpecificCC.js +315 -0
  372. package/build/esm/cc/ManufacturerSpecificCC.js.map +1 -0
  373. package/build/esm/cc/MeterCC.d.ts +318 -0
  374. package/build/esm/cc/MeterCC.d.ts.map +1 -0
  375. package/build/esm/cc/MeterCC.js +1308 -0
  376. package/build/esm/cc/MeterCC.js.map +1 -0
  377. package/build/esm/cc/MultiChannelAssociationCC.d.ts +241 -0
  378. package/build/esm/cc/MultiChannelAssociationCC.d.ts.map +1 -0
  379. package/build/esm/cc/MultiChannelAssociationCC.js +981 -0
  380. package/build/esm/cc/MultiChannelAssociationCC.js.map +1 -0
  381. package/build/esm/cc/MultiChannelCC.d.ts +394 -0
  382. package/build/esm/cc/MultiChannelCC.d.ts.map +1 -0
  383. package/build/esm/cc/MultiChannelCC.js +1127 -0
  384. package/build/esm/cc/MultiChannelCC.js.map +1 -0
  385. package/build/esm/cc/MultiCommandCC.d.ts +27 -0
  386. package/build/esm/cc/MultiCommandCC.d.ts.map +1 -0
  387. package/build/esm/cc/MultiCommandCC.js +142 -0
  388. package/build/esm/cc/MultiCommandCC.js.map +1 -0
  389. package/build/esm/cc/MultilevelSensorCC.d.ts +185 -0
  390. package/build/esm/cc/MultilevelSensorCC.d.ts.map +1 -0
  391. package/build/esm/cc/MultilevelSensorCC.js +753 -0
  392. package/build/esm/cc/MultilevelSensorCC.js.map +1 -0
  393. package/build/esm/cc/MultilevelSwitchCC.d.ts +357 -0
  394. package/build/esm/cc/MultilevelSwitchCC.d.ts.map +1 -0
  395. package/build/esm/cc/MultilevelSwitchCC.js +810 -0
  396. package/build/esm/cc/MultilevelSwitchCC.js.map +1 -0
  397. package/build/esm/cc/NoOperationCC.d.ts +9 -0
  398. package/build/esm/cc/NoOperationCC.d.ts.map +1 -0
  399. package/build/esm/cc/NoOperationCC.js +39 -0
  400. package/build/esm/cc/NoOperationCC.js.map +1 -0
  401. package/build/esm/cc/NodeNamingCC.d.ts +118 -0
  402. package/build/esm/cc/NodeNamingCC.d.ts.map +1 -0
  403. package/build/esm/cc/NodeNamingCC.js +345 -0
  404. package/build/esm/cc/NodeNamingCC.js.map +1 -0
  405. package/build/esm/cc/NotificationCC.d.ts +479 -0
  406. package/build/esm/cc/NotificationCC.d.ts.map +1 -0
  407. package/build/esm/cc/NotificationCC.js +1350 -0
  408. package/build/esm/cc/NotificationCC.js.map +1 -0
  409. package/build/esm/cc/PowerlevelCC.d.ts +82 -0
  410. package/build/esm/cc/PowerlevelCC.d.ts.map +1 -0
  411. package/build/esm/cc/PowerlevelCC.js +485 -0
  412. package/build/esm/cc/PowerlevelCC.js.map +1 -0
  413. package/build/esm/cc/ProtectionCC.d.ts +325 -0
  414. package/build/esm/cc/ProtectionCC.d.ts.map +1 -0
  415. package/build/esm/cc/ProtectionCC.js +669 -0
  416. package/build/esm/cc/ProtectionCC.js.map +1 -0
  417. package/build/esm/cc/SceneActivationCC.d.ts +89 -0
  418. package/build/esm/cc/SceneActivationCC.d.ts.map +1 -0
  419. package/build/esm/cc/SceneActivationCC.js +166 -0
  420. package/build/esm/cc/SceneActivationCC.js.map +1 -0
  421. package/build/esm/cc/SceneActuatorConfigurationCC.d.ts +120 -0
  422. package/build/esm/cc/SceneActuatorConfigurationCC.d.ts.map +1 -0
  423. package/build/esm/cc/SceneActuatorConfigurationCC.js +374 -0
  424. package/build/esm/cc/SceneActuatorConfigurationCC.js.map +1 -0
  425. package/build/esm/cc/SceneControllerConfigurationCC.d.ts +129 -0
  426. package/build/esm/cc/SceneControllerConfigurationCC.d.ts.map +1 -0
  427. package/build/esm/cc/SceneControllerConfigurationCC.js +446 -0
  428. package/build/esm/cc/SceneControllerConfigurationCC.js.map +1 -0
  429. package/build/esm/cc/ScheduleEntryLockCC.d.ts +434 -0
  430. package/build/esm/cc/ScheduleEntryLockCC.d.ts.map +1 -0
  431. package/build/esm/cc/ScheduleEntryLockCC.js +1826 -0
  432. package/build/esm/cc/ScheduleEntryLockCC.js.map +1 -0
  433. package/build/esm/cc/Security2CC.d.ts +251 -0
  434. package/build/esm/cc/Security2CC.d.ts.map +1 -0
  435. package/build/esm/cc/Security2CC.js +1814 -0
  436. package/build/esm/cc/Security2CC.js.map +1 -0
  437. package/build/esm/cc/SecurityCC.d.ts +128 -0
  438. package/build/esm/cc/SecurityCC.d.ts.map +1 -0
  439. package/build/esm/cc/SecurityCC.js +800 -0
  440. package/build/esm/cc/SecurityCC.js.map +1 -0
  441. package/build/esm/cc/SoundSwitchCC.d.ts +232 -0
  442. package/build/esm/cc/SoundSwitchCC.d.ts.map +1 -0
  443. package/build/esm/cc/SoundSwitchCC.js +633 -0
  444. package/build/esm/cc/SoundSwitchCC.js.map +1 -0
  445. package/build/esm/cc/SupervisionCC.d.ts +104 -0
  446. package/build/esm/cc/SupervisionCC.d.ts.map +1 -0
  447. package/build/esm/cc/SupervisionCC.js +319 -0
  448. package/build/esm/cc/SupervisionCC.js.map +1 -0
  449. package/build/esm/cc/ThermostatFanModeCC.d.ts +141 -0
  450. package/build/esm/cc/ThermostatFanModeCC.d.ts.map +1 -0
  451. package/build/esm/cc/ThermostatFanModeCC.js +359 -0
  452. package/build/esm/cc/ThermostatFanModeCC.js.map +1 -0
  453. package/build/esm/cc/ThermostatFanStateCC.d.ts +60 -0
  454. package/build/esm/cc/ThermostatFanStateCC.d.ts.map +1 -0
  455. package/build/esm/cc/ThermostatFanStateCC.js +139 -0
  456. package/build/esm/cc/ThermostatFanStateCC.js.map +1 -0
  457. package/build/esm/cc/ThermostatModeCC.d.ts +150 -0
  458. package/build/esm/cc/ThermostatModeCC.d.ts.map +1 -0
  459. package/build/esm/cc/ThermostatModeCC.js +426 -0
  460. package/build/esm/cc/ThermostatModeCC.js.map +1 -0
  461. package/build/esm/cc/ThermostatOperatingStateCC.d.ts +61 -0
  462. package/build/esm/cc/ThermostatOperatingStateCC.d.ts.map +1 -0
  463. package/build/esm/cc/ThermostatOperatingStateCC.js +135 -0
  464. package/build/esm/cc/ThermostatOperatingStateCC.js.map +1 -0
  465. package/build/esm/cc/ThermostatSetbackCC.d.ts +46 -0
  466. package/build/esm/cc/ThermostatSetbackCC.d.ts.map +1 -0
  467. package/build/esm/cc/ThermostatSetbackCC.js +244 -0
  468. package/build/esm/cc/ThermostatSetbackCC.js.map +1 -0
  469. package/build/esm/cc/ThermostatSetpointCC.d.ts +197 -0
  470. package/build/esm/cc/ThermostatSetpointCC.d.ts.map +1 -0
  471. package/build/esm/cc/ThermostatSetpointCC.js +655 -0
  472. package/build/esm/cc/ThermostatSetpointCC.js.map +1 -0
  473. package/build/esm/cc/TimeCC.d.ts +88 -0
  474. package/build/esm/cc/TimeCC.d.ts.map +1 -0
  475. package/build/esm/cc/TimeCC.js +451 -0
  476. package/build/esm/cc/TimeCC.js.map +1 -0
  477. package/build/esm/cc/TimeParametersCC.d.ts +72 -0
  478. package/build/esm/cc/TimeParametersCC.d.ts.map +1 -0
  479. package/build/esm/cc/TimeParametersCC.js +300 -0
  480. package/build/esm/cc/TimeParametersCC.js.map +1 -0
  481. package/build/esm/cc/TransportServiceCC.d.ts +107 -0
  482. package/build/esm/cc/TransportServiceCC.d.ts.map +1 -0
  483. package/build/esm/cc/TransportServiceCC.js +422 -0
  484. package/build/esm/cc/TransportServiceCC.js.map +1 -0
  485. package/build/esm/cc/UserCodeCC.d.ts +683 -0
  486. package/build/esm/cc/UserCodeCC.d.ts.map +1 -0
  487. package/build/esm/cc/UserCodeCC.js +1695 -0
  488. package/build/esm/cc/UserCodeCC.js.map +1 -0
  489. package/build/esm/cc/VersionCC.d.ts +469 -0
  490. package/build/esm/cc/VersionCC.d.ts.map +1 -0
  491. package/build/esm/cc/VersionCC.js +862 -0
  492. package/build/esm/cc/VersionCC.js.map +1 -0
  493. package/build/esm/cc/WakeUpCC.d.ts +150 -0
  494. package/build/esm/cc/WakeUpCC.d.ts.map +1 -0
  495. package/build/esm/cc/WakeUpCC.js +438 -0
  496. package/build/esm/cc/WakeUpCC.js.map +1 -0
  497. package/build/esm/cc/WindowCoveringCC.d.ts +315 -0
  498. package/build/esm/cc/WindowCoveringCC.d.ts.map +1 -0
  499. package/build/esm/cc/WindowCoveringCC.js +780 -0
  500. package/build/esm/cc/WindowCoveringCC.js.map +1 -0
  501. package/build/esm/cc/ZWaveLongRangeCC.d.ts +4 -0
  502. package/build/esm/cc/ZWaveLongRangeCC.d.ts.map +1 -0
  503. package/build/esm/cc/ZWaveLongRangeCC.js +17 -0
  504. package/build/esm/cc/ZWaveLongRangeCC.js.map +1 -0
  505. package/build/esm/cc/ZWavePlusCC.d.ts +163 -0
  506. package/build/esm/cc/ZWavePlusCC.d.ts.map +1 -0
  507. package/build/esm/cc/ZWavePlusCC.js +267 -0
  508. package/build/esm/cc/ZWavePlusCC.js.map +1 -0
  509. package/build/esm/cc/ZWaveProtocolCC.d.ts +344 -0
  510. package/build/esm/cc/ZWaveProtocolCC.d.ts.map +1 -0
  511. package/build/esm/cc/ZWaveProtocolCC.js +1030 -0
  512. package/build/esm/cc/ZWaveProtocolCC.js.map +1 -0
  513. package/build/esm/cc/index.d.ts +132 -0
  514. package/build/esm/cc/index.d.ts.map +1 -0
  515. package/build/esm/cc/index.js +71 -0
  516. package/build/esm/cc/index.js.map +1 -0
  517. package/build/esm/cc/manufacturerProprietary/Decorators.d.ts +64 -0
  518. package/build/esm/cc/manufacturerProprietary/Decorators.d.ts.map +1 -0
  519. package/build/esm/cc/manufacturerProprietary/Decorators.js +79 -0
  520. package/build/esm/cc/manufacturerProprietary/Decorators.js.map +1 -0
  521. package/build/esm/cc/manufacturerProprietary/FibaroCC.d.ts +79 -0
  522. package/build/esm/cc/manufacturerProprietary/FibaroCC.d.ts.map +1 -0
  523. package/build/esm/cc/manufacturerProprietary/FibaroCC.js +385 -0
  524. package/build/esm/cc/manufacturerProprietary/FibaroCC.js.map +1 -0
  525. package/build/esm/index.d.ts +15 -0
  526. package/build/esm/index.d.ts.map +1 -0
  527. package/build/esm/index.js +14 -0
  528. package/build/esm/index.js.map +1 -0
  529. package/build/esm/index_safe.d.ts +3 -0
  530. package/build/esm/index_safe.d.ts.map +1 -0
  531. package/build/esm/index_safe.js +4 -0
  532. package/build/esm/index_safe.js.map +1 -0
  533. package/build/esm/lib/API.d.ts +271 -0
  534. package/build/esm/lib/API.d.ts.map +1 -0
  535. package/build/esm/lib/API.js +448 -0
  536. package/build/esm/lib/API.js.map +1 -0
  537. package/build/esm/lib/CommandClass.d.ts +234 -0
  538. package/build/esm/lib/CommandClass.d.ts.map +1 -0
  539. package/build/esm/lib/CommandClass.js +781 -0
  540. package/build/esm/lib/CommandClass.js.map +1 -0
  541. package/build/esm/lib/CommandClassDecorators.d.ts +112 -0
  542. package/build/esm/lib/CommandClassDecorators.d.ts.map +1 -0
  543. package/build/esm/lib/CommandClassDecorators.js +229 -0
  544. package/build/esm/lib/CommandClassDecorators.js.map +1 -0
  545. package/build/esm/lib/EncapsulatingCommandClass.d.ts +22 -0
  546. package/build/esm/lib/EncapsulatingCommandClass.d.ts.map +1 -0
  547. package/build/esm/lib/EncapsulatingCommandClass.js +56 -0
  548. package/build/esm/lib/EncapsulatingCommandClass.js.map +1 -0
  549. package/build/esm/lib/ICommandClassContainer.d.ts +2 -0
  550. package/build/esm/lib/ICommandClassContainer.d.ts.map +1 -0
  551. package/build/esm/lib/ICommandClassContainer.js +2 -0
  552. package/build/esm/lib/ICommandClassContainer.js.map +1 -0
  553. package/build/esm/lib/NotificationEventPayload.d.ts +10 -0
  554. package/build/esm/lib/NotificationEventPayload.d.ts.map +1 -0
  555. package/build/esm/lib/NotificationEventPayload.js +7 -0
  556. package/build/esm/lib/NotificationEventPayload.js.map +1 -0
  557. package/build/esm/lib/Security2/Extension.d.ts +106 -0
  558. package/build/esm/lib/Security2/Extension.d.ts.map +1 -0
  559. package/build/esm/lib/Security2/Extension.js +296 -0
  560. package/build/esm/lib/Security2/Extension.js.map +1 -0
  561. package/build/esm/lib/Security2/shared.d.ts +37 -0
  562. package/build/esm/lib/Security2/shared.d.ts.map +1 -0
  563. package/build/esm/lib/Security2/shared.js +40 -0
  564. package/build/esm/lib/Security2/shared.js.map +1 -0
  565. package/build/esm/lib/SetValueResult.d.ts +55 -0
  566. package/build/esm/lib/SetValueResult.d.ts.map +1 -0
  567. package/build/esm/lib/SetValueResult.js +53 -0
  568. package/build/esm/lib/SetValueResult.js.map +1 -0
  569. package/build/esm/lib/Values.d.ts +223 -0
  570. package/build/esm/lib/Values.d.ts.map +1 -0
  571. package/build/esm/lib/Values.js +169 -0
  572. package/build/esm/lib/Values.js.map +1 -0
  573. package/build/esm/lib/_Types.d.ts +1461 -0
  574. package/build/esm/lib/_Types.d.ts.map +1 -0
  575. package/build/esm/lib/_Types.js +1432 -0
  576. package/build/esm/lib/_Types.js.map +1 -0
  577. package/build/esm/lib/serializers.d.ts +34 -0
  578. package/build/esm/lib/serializers.d.ts.map +1 -0
  579. package/build/esm/lib/serializers.js +98 -0
  580. package/build/esm/lib/serializers.js.map +1 -0
  581. package/build/esm/lib/utils.d.ts +17 -0
  582. package/build/esm/lib/utils.d.ts.map +1 -0
  583. package/build/esm/lib/utils.js +847 -0
  584. package/build/esm/lib/utils.js.map +1 -0
  585. package/build/esm/package.json +3 -0
  586. package/package.json +28 -23
  587. package/build/cc/AlarmSensorCC.d.ts +0 -194
  588. package/build/cc/AlarmSensorCC.d.ts.map +0 -1
  589. package/build/cc/AlarmSensorCC.js +0 -395
  590. package/build/cc/AlarmSensorCC.js.map +0 -1
  591. package/build/cc/AssociationCC.d.ts +0 -253
  592. package/build/cc/AssociationCC.d.ts.map +0 -1
  593. package/build/cc/AssociationCC.js +0 -732
  594. package/build/cc/AssociationCC.js.map +0 -1
  595. package/build/cc/AssociationGroupInfoCC.d.ts +0 -230
  596. package/build/cc/AssociationGroupInfoCC.d.ts.map +0 -1
  597. package/build/cc/AssociationGroupInfoCC.js +0 -772
  598. package/build/cc/AssociationGroupInfoCC.js.map +0 -1
  599. package/build/cc/BarrierOperatorCC.d.ts +0 -243
  600. package/build/cc/BarrierOperatorCC.d.ts.map +0 -1
  601. package/build/cc/BarrierOperatorCC.js +0 -613
  602. package/build/cc/BarrierOperatorCC.js.map +0 -1
  603. package/build/cc/BasicCC.d.ts +0 -191
  604. package/build/cc/BasicCC.d.ts.map +0 -1
  605. package/build/cc/BasicCC.js +0 -393
  606. package/build/cc/BasicCC.js.map +0 -1
  607. package/build/cc/BatteryCC.d.ts +0 -406
  608. package/build/cc/BatteryCC.d.ts.map +0 -1
  609. package/build/cc/BatteryCC.js +0 -516
  610. package/build/cc/BatteryCC.js.map +0 -1
  611. package/build/cc/BinarySensorCC.d.ts +0 -122
  612. package/build/cc/BinarySensorCC.d.ts.map +0 -1
  613. package/build/cc/BinarySensorCC.js +0 -420
  614. package/build/cc/BinarySensorCC.js.map +0 -1
  615. package/build/cc/BinarySwitchCC.d.ts +0 -139
  616. package/build/cc/BinarySwitchCC.d.ts.map +0 -1
  617. package/build/cc/BinarySwitchCC.js +0 -365
  618. package/build/cc/BinarySwitchCC.js.map +0 -1
  619. package/build/cc/CRC16CC.d.ts +0 -29
  620. package/build/cc/CRC16CC.d.ts.map +0 -1
  621. package/build/cc/CRC16CC.js +0 -126
  622. package/build/cc/CRC16CC.js.map +0 -1
  623. package/build/cc/CentralSceneCC.d.ts +0 -210
  624. package/build/cc/CentralSceneCC.d.ts.map +0 -1
  625. package/build/cc/CentralSceneCC.js +0 -453
  626. package/build/cc/CentralSceneCC.js.map +0 -1
  627. package/build/cc/ClimateControlScheduleCC.d.ts +0 -177
  628. package/build/cc/ClimateControlScheduleCC.d.ts.map +0 -1
  629. package/build/cc/ClimateControlScheduleCC.js +0 -469
  630. package/build/cc/ClimateControlScheduleCC.js.map +0 -1
  631. package/build/cc/ClockCC.d.ts +0 -47
  632. package/build/cc/ClockCC.d.ts.map +0 -1
  633. package/build/cc/ClockCC.js +0 -208
  634. package/build/cc/ClockCC.js.map +0 -1
  635. package/build/cc/ColorSwitchCC.d.ts +0 -339
  636. package/build/cc/ColorSwitchCC.d.ts.map +0 -1
  637. package/build/cc/ColorSwitchCC.js +0 -1152
  638. package/build/cc/ColorSwitchCC.js.map +0 -1
  639. package/build/cc/ConfigurationCC.d.ts +0 -396
  640. package/build/cc/ConfigurationCC.d.ts.map +0 -1
  641. package/build/cc/ConfigurationCC.js +0 -2458
  642. package/build/cc/ConfigurationCC.js.map +0 -1
  643. package/build/cc/DeviceResetLocallyCC.d.ts +0 -17
  644. package/build/cc/DeviceResetLocallyCC.d.ts.map +0 -1
  645. package/build/cc/DeviceResetLocallyCC.js +0 -76
  646. package/build/cc/DeviceResetLocallyCC.js.map +0 -1
  647. package/build/cc/DoorLockCC.d.ts +0 -837
  648. package/build/cc/DoorLockCC.d.ts.map +0 -1
  649. package/build/cc/DoorLockCC.js +0 -1273
  650. package/build/cc/DoorLockCC.js.map +0 -1
  651. package/build/cc/DoorLockLoggingCC.d.ts +0 -77
  652. package/build/cc/DoorLockLoggingCC.d.ts.map +0 -1
  653. package/build/cc/DoorLockLoggingCC.js +0 -319
  654. package/build/cc/DoorLockLoggingCC.js.map +0 -1
  655. package/build/cc/EnergyProductionCC.d.ts +0 -77
  656. package/build/cc/EnergyProductionCC.d.ts.map +0 -1
  657. package/build/cc/EnergyProductionCC.js +0 -216
  658. package/build/cc/EnergyProductionCC.js.map +0 -1
  659. package/build/cc/EntryControlCC.d.ts +0 -231
  660. package/build/cc/EntryControlCC.d.ts.map +0 -1
  661. package/build/cc/EntryControlCC.js +0 -607
  662. package/build/cc/EntryControlCC.js.map +0 -1
  663. package/build/cc/FirmwareUpdateMetaDataCC.d.ts +0 -359
  664. package/build/cc/FirmwareUpdateMetaDataCC.d.ts.map +0 -1
  665. package/build/cc/FirmwareUpdateMetaDataCC.js +0 -1145
  666. package/build/cc/FirmwareUpdateMetaDataCC.js.map +0 -1
  667. package/build/cc/HailCC.d.ts +0 -6
  668. package/build/cc/HailCC.d.ts.map +0 -1
  669. package/build/cc/HailCC.js +0 -24
  670. package/build/cc/HailCC.js.map +0 -1
  671. package/build/cc/HumidityControlModeCC.d.ts +0 -111
  672. package/build/cc/HumidityControlModeCC.d.ts.map +0 -1
  673. package/build/cc/HumidityControlModeCC.js +0 -308
  674. package/build/cc/HumidityControlModeCC.js.map +0 -1
  675. package/build/cc/HumidityControlOperatingStateCC.d.ts +0 -60
  676. package/build/cc/HumidityControlOperatingStateCC.d.ts.map +0 -1
  677. package/build/cc/HumidityControlOperatingStateCC.js +0 -140
  678. package/build/cc/HumidityControlOperatingStateCC.js.map +0 -1
  679. package/build/cc/HumidityControlSetpointCC.d.ts +0 -209
  680. package/build/cc/HumidityControlSetpointCC.d.ts.map +0 -1
  681. package/build/cc/HumidityControlSetpointCC.js +0 -648
  682. package/build/cc/HumidityControlSetpointCC.js.map +0 -1
  683. package/build/cc/InclusionControllerCC.d.ts +0 -42
  684. package/build/cc/InclusionControllerCC.d.ts.map +0 -1
  685. package/build/cc/InclusionControllerCC.js +0 -136
  686. package/build/cc/InclusionControllerCC.js.map +0 -1
  687. package/build/cc/IndicatorCC.d.ts +0 -338
  688. package/build/cc/IndicatorCC.d.ts.map +0 -1
  689. package/build/cc/IndicatorCC.js +0 -1320
  690. package/build/cc/IndicatorCC.js.map +0 -1
  691. package/build/cc/IrrigationCC.d.ts +0 -1496
  692. package/build/cc/IrrigationCC.d.ts.map +0 -1
  693. package/build/cc/IrrigationCC.js +0 -2041
  694. package/build/cc/IrrigationCC.js.map +0 -1
  695. package/build/cc/LanguageCC.d.ts +0 -101
  696. package/build/cc/LanguageCC.d.ts.map +0 -1
  697. package/build/cc/LanguageCC.js +0 -246
  698. package/build/cc/LanguageCC.js.map +0 -1
  699. package/build/cc/LockCC.d.ts +0 -73
  700. package/build/cc/LockCC.d.ts.map +0 -1
  701. package/build/cc/LockCC.js +0 -200
  702. package/build/cc/LockCC.js.map +0 -1
  703. package/build/cc/ManufacturerProprietaryCC.d.ts +0 -32
  704. package/build/cc/ManufacturerProprietaryCC.d.ts.map +0 -1
  705. package/build/cc/ManufacturerProprietaryCC.js +0 -204
  706. package/build/cc/ManufacturerProprietaryCC.js.map +0 -1
  707. package/build/cc/ManufacturerSpecificCC.d.ts +0 -171
  708. package/build/cc/ManufacturerSpecificCC.d.ts.map +0 -1
  709. package/build/cc/ManufacturerSpecificCC.js +0 -318
  710. package/build/cc/ManufacturerSpecificCC.js.map +0 -1
  711. package/build/cc/MeterCC.d.ts +0 -318
  712. package/build/cc/MeterCC.d.ts.map +0 -1
  713. package/build/cc/MeterCC.js +0 -1312
  714. package/build/cc/MeterCC.js.map +0 -1
  715. package/build/cc/MultiChannelAssociationCC.d.ts +0 -241
  716. package/build/cc/MultiChannelAssociationCC.d.ts.map +0 -1
  717. package/build/cc/MultiChannelAssociationCC.js +0 -1007
  718. package/build/cc/MultiChannelAssociationCC.js.map +0 -1
  719. package/build/cc/MultiChannelCC.d.ts +0 -394
  720. package/build/cc/MultiChannelCC.d.ts.map +0 -1
  721. package/build/cc/MultiChannelCC.js +0 -1130
  722. package/build/cc/MultiChannelCC.js.map +0 -1
  723. package/build/cc/MultiCommandCC.d.ts +0 -27
  724. package/build/cc/MultiCommandCC.d.ts.map +0 -1
  725. package/build/cc/MultiCommandCC.js +0 -145
  726. package/build/cc/MultiCommandCC.js.map +0 -1
  727. package/build/cc/MultilevelSensorCC.d.ts +0 -185
  728. package/build/cc/MultilevelSensorCC.d.ts.map +0 -1
  729. package/build/cc/MultilevelSensorCC.js +0 -756
  730. package/build/cc/MultilevelSensorCC.js.map +0 -1
  731. package/build/cc/MultilevelSwitchCC.d.ts +0 -357
  732. package/build/cc/MultilevelSwitchCC.d.ts.map +0 -1
  733. package/build/cc/MultilevelSwitchCC.js +0 -813
  734. package/build/cc/MultilevelSwitchCC.js.map +0 -1
  735. package/build/cc/NoOperationCC.d.ts +0 -9
  736. package/build/cc/NoOperationCC.d.ts.map +0 -1
  737. package/build/cc/NoOperationCC.js +0 -42
  738. package/build/cc/NoOperationCC.js.map +0 -1
  739. package/build/cc/NodeNamingCC.d.ts +0 -118
  740. package/build/cc/NodeNamingCC.d.ts.map +0 -1
  741. package/build/cc/NodeNamingCC.js +0 -348
  742. package/build/cc/NodeNamingCC.js.map +0 -1
  743. package/build/cc/NotificationCC.d.ts +0 -479
  744. package/build/cc/NotificationCC.d.ts.map +0 -1
  745. package/build/cc/NotificationCC.js +0 -1379
  746. package/build/cc/NotificationCC.js.map +0 -1
  747. package/build/cc/PowerlevelCC.d.ts +0 -82
  748. package/build/cc/PowerlevelCC.d.ts.map +0 -1
  749. package/build/cc/PowerlevelCC.js +0 -488
  750. package/build/cc/PowerlevelCC.js.map +0 -1
  751. package/build/cc/ProtectionCC.d.ts +0 -325
  752. package/build/cc/ProtectionCC.d.ts.map +0 -1
  753. package/build/cc/ProtectionCC.js +0 -672
  754. package/build/cc/ProtectionCC.js.map +0 -1
  755. package/build/cc/SceneActivationCC.d.ts +0 -89
  756. package/build/cc/SceneActivationCC.d.ts.map +0 -1
  757. package/build/cc/SceneActivationCC.js +0 -169
  758. package/build/cc/SceneActivationCC.js.map +0 -1
  759. package/build/cc/SceneActuatorConfigurationCC.d.ts +0 -120
  760. package/build/cc/SceneActuatorConfigurationCC.d.ts.map +0 -1
  761. package/build/cc/SceneActuatorConfigurationCC.js +0 -377
  762. package/build/cc/SceneActuatorConfigurationCC.js.map +0 -1
  763. package/build/cc/SceneControllerConfigurationCC.d.ts +0 -129
  764. package/build/cc/SceneControllerConfigurationCC.d.ts.map +0 -1
  765. package/build/cc/SceneControllerConfigurationCC.js +0 -449
  766. package/build/cc/SceneControllerConfigurationCC.js.map +0 -1
  767. package/build/cc/ScheduleEntryLockCC.d.ts +0 -434
  768. package/build/cc/ScheduleEntryLockCC.d.ts.map +0 -1
  769. package/build/cc/ScheduleEntryLockCC.js +0 -1829
  770. package/build/cc/ScheduleEntryLockCC.js.map +0 -1
  771. package/build/cc/Security2CC.d.ts +0 -251
  772. package/build/cc/Security2CC.d.ts.map +0 -1
  773. package/build/cc/Security2CC.js +0 -1817
  774. package/build/cc/Security2CC.js.map +0 -1
  775. package/build/cc/SecurityCC.d.ts +0 -128
  776. package/build/cc/SecurityCC.d.ts.map +0 -1
  777. package/build/cc/SecurityCC.js +0 -803
  778. package/build/cc/SecurityCC.js.map +0 -1
  779. package/build/cc/SoundSwitchCC.d.ts +0 -232
  780. package/build/cc/SoundSwitchCC.d.ts.map +0 -1
  781. package/build/cc/SoundSwitchCC.js +0 -636
  782. package/build/cc/SoundSwitchCC.js.map +0 -1
  783. package/build/cc/SupervisionCC.d.ts +0 -104
  784. package/build/cc/SupervisionCC.d.ts.map +0 -1
  785. package/build/cc/SupervisionCC.js +0 -322
  786. package/build/cc/SupervisionCC.js.map +0 -1
  787. package/build/cc/ThermostatFanModeCC.d.ts +0 -141
  788. package/build/cc/ThermostatFanModeCC.d.ts.map +0 -1
  789. package/build/cc/ThermostatFanModeCC.js +0 -362
  790. package/build/cc/ThermostatFanModeCC.js.map +0 -1
  791. package/build/cc/ThermostatFanStateCC.d.ts +0 -60
  792. package/build/cc/ThermostatFanStateCC.d.ts.map +0 -1
  793. package/build/cc/ThermostatFanStateCC.js +0 -142
  794. package/build/cc/ThermostatFanStateCC.js.map +0 -1
  795. package/build/cc/ThermostatModeCC.d.ts +0 -150
  796. package/build/cc/ThermostatModeCC.d.ts.map +0 -1
  797. package/build/cc/ThermostatModeCC.js +0 -429
  798. package/build/cc/ThermostatModeCC.js.map +0 -1
  799. package/build/cc/ThermostatOperatingStateCC.d.ts +0 -61
  800. package/build/cc/ThermostatOperatingStateCC.d.ts.map +0 -1
  801. package/build/cc/ThermostatOperatingStateCC.js +0 -138
  802. package/build/cc/ThermostatOperatingStateCC.js.map +0 -1
  803. package/build/cc/ThermostatSetbackCC.d.ts +0 -46
  804. package/build/cc/ThermostatSetbackCC.d.ts.map +0 -1
  805. package/build/cc/ThermostatSetbackCC.js +0 -247
  806. package/build/cc/ThermostatSetbackCC.js.map +0 -1
  807. package/build/cc/ThermostatSetpointCC.d.ts +0 -197
  808. package/build/cc/ThermostatSetpointCC.d.ts.map +0 -1
  809. package/build/cc/ThermostatSetpointCC.js +0 -658
  810. package/build/cc/ThermostatSetpointCC.js.map +0 -1
  811. package/build/cc/TimeCC.d.ts +0 -88
  812. package/build/cc/TimeCC.d.ts.map +0 -1
  813. package/build/cc/TimeCC.js +0 -454
  814. package/build/cc/TimeCC.js.map +0 -1
  815. package/build/cc/TimeParametersCC.d.ts +0 -72
  816. package/build/cc/TimeParametersCC.d.ts.map +0 -1
  817. package/build/cc/TimeParametersCC.js +0 -303
  818. package/build/cc/TimeParametersCC.js.map +0 -1
  819. package/build/cc/TransportServiceCC.d.ts +0 -107
  820. package/build/cc/TransportServiceCC.d.ts.map +0 -1
  821. package/build/cc/TransportServiceCC.js +0 -426
  822. package/build/cc/TransportServiceCC.js.map +0 -1
  823. package/build/cc/UserCodeCC.d.ts +0 -683
  824. package/build/cc/UserCodeCC.d.ts.map +0 -1
  825. package/build/cc/UserCodeCC.js +0 -1699
  826. package/build/cc/UserCodeCC.js.map +0 -1
  827. package/build/cc/VersionCC.d.ts +0 -469
  828. package/build/cc/VersionCC.d.ts.map +0 -1
  829. package/build/cc/VersionCC.js +0 -865
  830. package/build/cc/VersionCC.js.map +0 -1
  831. package/build/cc/WakeUpCC.d.ts +0 -150
  832. package/build/cc/WakeUpCC.d.ts.map +0 -1
  833. package/build/cc/WakeUpCC.js +0 -441
  834. package/build/cc/WakeUpCC.js.map +0 -1
  835. package/build/cc/WindowCoveringCC.d.ts +0 -315
  836. package/build/cc/WindowCoveringCC.d.ts.map +0 -1
  837. package/build/cc/WindowCoveringCC.js +0 -783
  838. package/build/cc/WindowCoveringCC.js.map +0 -1
  839. package/build/cc/ZWaveLongRangeCC.d.ts +0 -4
  840. package/build/cc/ZWaveLongRangeCC.d.ts.map +0 -1
  841. package/build/cc/ZWaveLongRangeCC.js +0 -20
  842. package/build/cc/ZWaveLongRangeCC.js.map +0 -1
  843. package/build/cc/ZWavePlusCC.d.ts +0 -163
  844. package/build/cc/ZWavePlusCC.d.ts.map +0 -1
  845. package/build/cc/ZWavePlusCC.js +0 -270
  846. package/build/cc/ZWavePlusCC.js.map +0 -1
  847. package/build/cc/ZWaveProtocolCC.d.ts +0 -344
  848. package/build/cc/ZWaveProtocolCC.d.ts.map +0 -1
  849. package/build/cc/ZWaveProtocolCC.js +0 -1033
  850. package/build/cc/ZWaveProtocolCC.js.map +0 -1
  851. package/build/cc/index.d.ts +0 -132
  852. package/build/cc/index.d.ts.map +0 -1
  853. package/build/cc/index.js +0 -627
  854. package/build/cc/index.js.map +0 -1
  855. package/build/cc/manufacturerProprietary/Decorators.d.ts +0 -64
  856. package/build/cc/manufacturerProprietary/Decorators.d.ts.map +0 -1
  857. package/build/cc/manufacturerProprietary/Decorators.js +0 -83
  858. package/build/cc/manufacturerProprietary/Decorators.js.map +0 -1
  859. package/build/cc/manufacturerProprietary/FibaroCC.d.ts +0 -79
  860. package/build/cc/manufacturerProprietary/FibaroCC.d.ts.map +0 -1
  861. package/build/cc/manufacturerProprietary/FibaroCC.js +0 -392
  862. package/build/cc/manufacturerProprietary/FibaroCC.js.map +0 -1
  863. package/build/index.d.ts +0 -15
  864. package/build/index.d.ts.map +0 -1
  865. package/build/index.js +0 -52
  866. package/build/index.js.map +0 -1
  867. package/build/index_safe.d.ts +0 -3
  868. package/build/index_safe.d.ts.map +0 -1
  869. package/build/index_safe.js +0 -20
  870. package/build/index_safe.js.map +0 -1
  871. package/build/lib/API.d.ts +0 -271
  872. package/build/lib/API.d.ts.map +0 -1
  873. package/build/lib/API.js +0 -458
  874. package/build/lib/API.js.map +0 -1
  875. package/build/lib/CommandClass.d.ts +0 -234
  876. package/build/lib/CommandClass.d.ts.map +0 -1
  877. package/build/lib/CommandClass.js +0 -788
  878. package/build/lib/CommandClass.js.map +0 -1
  879. package/build/lib/CommandClassDecorators.d.ts +0 -112
  880. package/build/lib/CommandClassDecorators.d.ts.map +0 -1
  881. package/build/lib/CommandClassDecorators.js +0 -243
  882. package/build/lib/CommandClassDecorators.js.map +0 -1
  883. package/build/lib/EncapsulatingCommandClass.d.ts +0 -22
  884. package/build/lib/EncapsulatingCommandClass.d.ts.map +0 -1
  885. package/build/lib/EncapsulatingCommandClass.js +0 -61
  886. package/build/lib/EncapsulatingCommandClass.js.map +0 -1
  887. package/build/lib/ICommandClassContainer.d.ts.map +0 -1
  888. package/build/lib/ICommandClassContainer.js +0 -3
  889. package/build/lib/ICommandClassContainer.js.map +0 -1
  890. package/build/lib/NotificationEventPayload.d.ts +0 -10
  891. package/build/lib/NotificationEventPayload.d.ts.map +0 -1
  892. package/build/lib/NotificationEventPayload.js +0 -10
  893. package/build/lib/NotificationEventPayload.js.map +0 -1
  894. package/build/lib/Security2/Extension.d.ts.map +0 -1
  895. package/build/lib/Security2/Extension.js +0 -303
  896. package/build/lib/Security2/Extension.js.map +0 -1
  897. package/build/lib/Security2/shared.d.ts.map +0 -1
  898. package/build/lib/Security2/shared.js +0 -43
  899. package/build/lib/Security2/shared.js.map +0 -1
  900. package/build/lib/SetValueResult.d.ts.map +0 -1
  901. package/build/lib/SetValueResult.js +0 -60
  902. package/build/lib/SetValueResult.js.map +0 -1
  903. package/build/lib/Values.d.ts +0 -223
  904. package/build/lib/Values.d.ts.map +0 -1
  905. package/build/lib/Values.js +0 -172
  906. package/build/lib/Values.js.map +0 -1
  907. package/build/lib/_Types.d.ts.map +0 -1
  908. package/build/lib/_Types.js +0 -1443
  909. package/build/lib/_Types.js.map +0 -1
  910. package/build/lib/serializers.d.ts +0 -34
  911. package/build/lib/serializers.d.ts.map +0 -1
  912. package/build/lib/serializers.js +0 -107
  913. package/build/lib/serializers.js.map +0 -1
  914. package/build/lib/utils.d.ts +0 -17
  915. package/build/lib/utils.d.ts.map +0 -1
  916. package/build/lib/utils.js +0 -860
  917. package/build/lib/utils.js.map +0 -1
  918. /package/build/{lib → cjs/lib}/ICommandClassContainer.d.ts +0 -0
  919. /package/build/{lib → cjs/lib}/Security2/Extension.d.ts +0 -0
  920. /package/build/{lib → cjs/lib}/Security2/shared.d.ts +0 -0
  921. /package/build/{lib → cjs/lib}/SetValueResult.d.ts +0 -0
  922. /package/build/{lib → cjs/lib}/_Types.d.ts +0 -0
@@ -0,0 +1,2454 @@
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;
6
+ };
7
+ var ConfigurationCCReport_1, ConfigurationCCGet_1, ConfigurationCCSet_1, ConfigurationCCBulkReport_1, ConfigurationCCNameReport_1, ConfigurationCCNameGet_1, ConfigurationCCInfoReport_1, ConfigurationCCInfoGet_1, ConfigurationCCPropertiesReport_1, ConfigurationCCPropertiesGet_1;
8
+ function __assertType(argName, typeName, boundHasError) {
9
+ const { ZWaveError, ZWaveErrorCodes } = require("@zwave-js/core");
10
+ if (boundHasError()) {
11
+ throw new ZWaveError(typeName ? `${argName} is not a ${typeName}` : `${argName} has the wrong type`, ZWaveErrorCodes.Argument_Invalid);
12
+ }
13
+ }
14
+ const __assertType__number = $o => {
15
+ function _number($o) {
16
+ return typeof $o !== "number" ? {} : null;
17
+ }
18
+ return _number($o);
19
+ };
20
+ const __assertType__optional__0 = $o => {
21
+ function _number($o) {
22
+ return typeof $o !== "number" ? {} : null;
23
+ }
24
+ function _boolean($o) {
25
+ return typeof $o !== "boolean" ? {} : null;
26
+ }
27
+ function _0($o) {
28
+ if (typeof $o !== "object" || $o === null || Array.isArray($o))
29
+ return {};
30
+ if ("valueBitMask" in $o && $o["valueBitMask"] !== undefined) {
31
+ const error = _number($o["valueBitMask"]);
32
+ if (error)
33
+ return error;
34
+ }
35
+ if ("allowUnexpectedResponse" in $o && $o["allowUnexpectedResponse"] !== undefined) {
36
+ const error = _boolean($o["allowUnexpectedResponse"]);
37
+ if (error)
38
+ return error;
39
+ }
40
+ return null;
41
+ }
42
+ function optional__0($o) {
43
+ if ($o !== undefined) {
44
+ const error = _0($o);
45
+ if (error)
46
+ return error;
47
+ }
48
+ return null;
49
+ }
50
+ return optional__0($o);
51
+ };
52
+ const __assertType__sa__2_ea_2 = $o => {
53
+ function _number($o) {
54
+ return typeof $o !== "number" ? {} : null;
55
+ }
56
+ function _2($o) {
57
+ if (typeof $o !== "object" || $o === null || Array.isArray($o))
58
+ return {};
59
+ if ("parameter" in $o && $o["parameter"] !== undefined) {
60
+ const error = _number($o["parameter"]);
61
+ if (error)
62
+ return error;
63
+ }
64
+ else
65
+ return {};
66
+ if ("bitMask" in $o && $o["bitMask"] !== undefined) {
67
+ const error = _number($o["bitMask"]);
68
+ if (error)
69
+ return error;
70
+ }
71
+ return null;
72
+ }
73
+ function sa__2_ea_2($o) {
74
+ if (!Array.isArray($o))
75
+ return {};
76
+ for (let i = 0; i < $o.length; i++) {
77
+ const error = _2($o[i]);
78
+ if (error)
79
+ return error;
80
+ }
81
+ return null;
82
+ }
83
+ return sa__2_ea_2($o);
84
+ };
85
+ const __assertType__ConfigurationCCAPISetOptions = $o => {
86
+ function _number($o) {
87
+ return typeof $o !== "number" ? {} : null;
88
+ }
89
+ function _2($o) {
90
+ if (typeof $o !== "object" || $o === null || Array.isArray($o))
91
+ return {};
92
+ if ("parameter" in $o && $o["parameter"] !== undefined) {
93
+ const error = _number($o["parameter"]);
94
+ if (error)
95
+ return error;
96
+ }
97
+ else
98
+ return {};
99
+ return null;
100
+ }
101
+ function _undefined($o) {
102
+ return $o !== undefined ? {} : null;
103
+ }
104
+ function _3($o) {
105
+ if (typeof $o !== "object" || $o === null || Array.isArray($o))
106
+ return {};
107
+ if ("bitMask" in $o && $o["bitMask"] !== undefined) {
108
+ const error = _undefined($o["bitMask"]);
109
+ if (error)
110
+ return error;
111
+ }
112
+ if ("value" in $o && $o["value"] !== undefined) {
113
+ const error = _number($o["value"]);
114
+ if (error)
115
+ return error;
116
+ }
117
+ else
118
+ return {};
119
+ return null;
120
+ }
121
+ function si__2__3_ei($o) {
122
+ const conditions = [_2, _3];
123
+ for (const condition of conditions) {
124
+ const error = condition($o);
125
+ if (error)
126
+ return error;
127
+ }
128
+ return null;
129
+ }
130
+ function _9($o) {
131
+ return $o !== 1 ? {} : null;
132
+ }
133
+ function _10($o) {
134
+ return $o !== 2 ? {} : null;
135
+ }
136
+ function _11($o) {
137
+ return $o !== 4 ? {} : null;
138
+ }
139
+ function su__9__10__11_eu($o) {
140
+ const conditions = [_9, _10, _11];
141
+ for (const condition of conditions) {
142
+ const error = condition($o);
143
+ if (!error)
144
+ return null;
145
+ }
146
+ return {};
147
+ }
148
+ function su__13__14__15__16_eu($o) {
149
+ return ![0, 1, 2, 3].includes($o) ? {} : null;
150
+ }
151
+ function _5($o) {
152
+ if (typeof $o !== "object" || $o === null || Array.isArray($o))
153
+ return {};
154
+ if ("bitMask" in $o && $o["bitMask"] !== undefined) {
155
+ const error = _undefined($o["bitMask"]);
156
+ if (error)
157
+ return error;
158
+ }
159
+ if ("value" in $o && $o["value"] !== undefined) {
160
+ const error = _number($o["value"]);
161
+ if (error)
162
+ return error;
163
+ }
164
+ else
165
+ return {};
166
+ if ("valueSize" in $o && $o["valueSize"] !== undefined) {
167
+ const error = su__9__10__11_eu($o["valueSize"]);
168
+ if (error)
169
+ return error;
170
+ }
171
+ else
172
+ return {};
173
+ if ("valueFormat" in $o && $o["valueFormat"] !== undefined) {
174
+ const error = su__13__14__15__16_eu($o["valueFormat"]);
175
+ if (error)
176
+ return error;
177
+ }
178
+ else
179
+ return {};
180
+ return null;
181
+ }
182
+ function si__2__5_ei($o) {
183
+ const conditions = [_2, _5];
184
+ for (const condition of conditions) {
185
+ const error = condition($o);
186
+ if (error)
187
+ return error;
188
+ }
189
+ return null;
190
+ }
191
+ function _7($o) {
192
+ if (typeof $o !== "object" || $o === null || Array.isArray($o))
193
+ return {};
194
+ if ("bitMask" in $o && $o["bitMask"] !== undefined) {
195
+ const error = _number($o["bitMask"]);
196
+ if (error)
197
+ return error;
198
+ }
199
+ else
200
+ return {};
201
+ if ("value" in $o && $o["value"] !== undefined) {
202
+ const error = _number($o["value"]);
203
+ if (error)
204
+ return error;
205
+ }
206
+ else
207
+ return {};
208
+ return null;
209
+ }
210
+ function si__2__7_ei($o) {
211
+ const conditions = [_2, _7];
212
+ for (const condition of conditions) {
213
+ const error = condition($o);
214
+ if (error)
215
+ return error;
216
+ }
217
+ return null;
218
+ }
219
+ function su_si__2__3_ei_si__2__5_ei_si__2__7_ei_eu($o) {
220
+ const conditions = [si__2__3_ei, si__2__5_ei, si__2__7_ei];
221
+ for (const condition of conditions) {
222
+ const error = condition($o);
223
+ if (!error)
224
+ return null;
225
+ }
226
+ return {};
227
+ }
228
+ return su_si__2__3_ei_si__2__5_ei_si__2__7_ei_eu($o);
229
+ };
230
+ const __assertType__sa_su_si__4__5_ei_si__4__7_ei_si__4__9_ei_eu_ea_2 = $o => {
231
+ function _number($o) {
232
+ return typeof $o !== "number" ? {} : null;
233
+ }
234
+ function _4($o) {
235
+ if (typeof $o !== "object" || $o === null || Array.isArray($o))
236
+ return {};
237
+ if ("parameter" in $o && $o["parameter"] !== undefined) {
238
+ const error = _number($o["parameter"]);
239
+ if (error)
240
+ return error;
241
+ }
242
+ else
243
+ return {};
244
+ return null;
245
+ }
246
+ function _undefined($o) {
247
+ return $o !== undefined ? {} : null;
248
+ }
249
+ function _5($o) {
250
+ if (typeof $o !== "object" || $o === null || Array.isArray($o))
251
+ return {};
252
+ if ("bitMask" in $o && $o["bitMask"] !== undefined) {
253
+ const error = _undefined($o["bitMask"]);
254
+ if (error)
255
+ return error;
256
+ }
257
+ if ("value" in $o && $o["value"] !== undefined) {
258
+ const error = _number($o["value"]);
259
+ if (error)
260
+ return error;
261
+ }
262
+ else
263
+ return {};
264
+ return null;
265
+ }
266
+ function si__4__5_ei($o) {
267
+ const conditions = [_4, _5];
268
+ for (const condition of conditions) {
269
+ const error = condition($o);
270
+ if (error)
271
+ return error;
272
+ }
273
+ return null;
274
+ }
275
+ function _11($o) {
276
+ return $o !== 1 ? {} : null;
277
+ }
278
+ function _12($o) {
279
+ return $o !== 2 ? {} : null;
280
+ }
281
+ function _13($o) {
282
+ return $o !== 4 ? {} : null;
283
+ }
284
+ function su__11__12__13_eu($o) {
285
+ const conditions = [_11, _12, _13];
286
+ for (const condition of conditions) {
287
+ const error = condition($o);
288
+ if (!error)
289
+ return null;
290
+ }
291
+ return {};
292
+ }
293
+ function su__15__16__17__18_eu($o) {
294
+ return ![0, 1, 2, 3].includes($o) ? {} : null;
295
+ }
296
+ function _7($o) {
297
+ if (typeof $o !== "object" || $o === null || Array.isArray($o))
298
+ return {};
299
+ if ("bitMask" in $o && $o["bitMask"] !== undefined) {
300
+ const error = _undefined($o["bitMask"]);
301
+ if (error)
302
+ return error;
303
+ }
304
+ if ("value" in $o && $o["value"] !== undefined) {
305
+ const error = _number($o["value"]);
306
+ if (error)
307
+ return error;
308
+ }
309
+ else
310
+ return {};
311
+ if ("valueSize" in $o && $o["valueSize"] !== undefined) {
312
+ const error = su__11__12__13_eu($o["valueSize"]);
313
+ if (error)
314
+ return error;
315
+ }
316
+ else
317
+ return {};
318
+ if ("valueFormat" in $o && $o["valueFormat"] !== undefined) {
319
+ const error = su__15__16__17__18_eu($o["valueFormat"]);
320
+ if (error)
321
+ return error;
322
+ }
323
+ else
324
+ return {};
325
+ return null;
326
+ }
327
+ function si__4__7_ei($o) {
328
+ const conditions = [_4, _7];
329
+ for (const condition of conditions) {
330
+ const error = condition($o);
331
+ if (error)
332
+ return error;
333
+ }
334
+ return null;
335
+ }
336
+ function _9($o) {
337
+ if (typeof $o !== "object" || $o === null || Array.isArray($o))
338
+ return {};
339
+ if ("bitMask" in $o && $o["bitMask"] !== undefined) {
340
+ const error = _number($o["bitMask"]);
341
+ if (error)
342
+ return error;
343
+ }
344
+ else
345
+ return {};
346
+ if ("value" in $o && $o["value"] !== undefined) {
347
+ const error = _number($o["value"]);
348
+ if (error)
349
+ return error;
350
+ }
351
+ else
352
+ return {};
353
+ return null;
354
+ }
355
+ function si__4__9_ei($o) {
356
+ const conditions = [_4, _9];
357
+ for (const condition of conditions) {
358
+ const error = condition($o);
359
+ if (error)
360
+ return error;
361
+ }
362
+ return null;
363
+ }
364
+ function su_si__4__5_ei_si__4__7_ei_si__4__9_ei_eu($o) {
365
+ const conditions = [si__4__5_ei, si__4__7_ei, si__4__9_ei];
366
+ for (const condition of conditions) {
367
+ const error = condition($o);
368
+ if (!error)
369
+ return null;
370
+ }
371
+ return {};
372
+ }
373
+ function sa_su_si__4__5_ei_si__4__7_ei_si__4__9_ei_eu_ea_2($o) {
374
+ if (!Array.isArray($o))
375
+ return {};
376
+ for (let i = 0; i < $o.length; i++) {
377
+ const error = su_si__4__5_ei_si__4__7_ei_si__4__9_ei_eu($o[i]);
378
+ if (error)
379
+ return error;
380
+ }
381
+ return null;
382
+ }
383
+ return sa_su_si__4__5_ei_si__4__7_ei_si__4__9_ei_eu_ea_2($o);
384
+ };
385
+ const __assertType__sa__number_ea_2 = $o => {
386
+ function _number($o) {
387
+ return typeof $o !== "number" ? {} : null;
388
+ }
389
+ function sa__number_ea_2($o) {
390
+ if (!Array.isArray($o))
391
+ return {};
392
+ for (let i = 0; i < $o.length; i++) {
393
+ const error = _number($o[i]);
394
+ if (error)
395
+ return error;
396
+ }
397
+ return null;
398
+ }
399
+ return sa__number_ea_2($o);
400
+ };
401
+ import { CommandClasses, ConfigValueFormat, MessagePriority, SupervisionStatus, ValueMetadata, ZWaveError, ZWaveErrorCodes, encodePartial, getBitMaskWidth, getIntegerLimits, getMinIntegerSize, isConsecutiveArray, mergeSupervisionResults, parsePartial, stripUndefined, supervisedCommandSucceeded, validatePayload, } from "@zwave-js/core/safe";
402
+ import { Bytes } from "@zwave-js/shared/safe";
403
+ import { getEnumMemberName, pick } from "@zwave-js/shared/safe";
404
+ import { distinct } from "alcalzone-shared/arrays/index.js";
405
+ import { composeObject } from "alcalzone-shared/objects/index.js";
406
+ import { padStart } from "alcalzone-shared/strings/index.js";
407
+ import { CCAPI, POLL_VALUE, SET_VALUE, throwUnsupportedProperty, throwUnsupportedPropertyKey, throwWrongValueType, } from "../lib/API.js";
408
+ import { CommandClass, getEffectiveCCVersion, } from "../lib/CommandClass.js";
409
+ import { API, CCCommand, ccValues, commandClass, expectedCCResponse, implementedVersion, useSupervision, } from "../lib/CommandClassDecorators.js";
410
+ import { V } from "../lib/Values.js";
411
+ import { ConfigurationCommand } from "../lib/_Types.js";
412
+ function configValueToString(value) {
413
+ if (typeof value === "number")
414
+ return value.toString();
415
+ else
416
+ return [...value].join(", ");
417
+ }
418
+ export class ConfigurationCCError extends ZWaveError {
419
+ message;
420
+ code;
421
+ argument;
422
+ constructor(message, code, argument) {
423
+ super(message, code);
424
+ this.message = message;
425
+ this.code = code;
426
+ this.argument = argument;
427
+ // We need to set the prototype explicitly
428
+ Object.setPrototypeOf(this, ConfigurationCCError.prototype);
429
+ }
430
+ }
431
+ export const ConfigurationCCValues = Object.freeze({
432
+ ...V.defineStaticCCValues(CommandClasses.Configuration, {
433
+ ...V.staticProperty("isParamInformationFromConfig", undefined, // meta
434
+ { internal: true, supportsEndpoints: false }),
435
+ }),
436
+ ...V.defineDynamicCCValues(CommandClasses.Configuration, {
437
+ ...V.dynamicPropertyAndKeyWithName("paramInformation",
438
+ // eslint-disable-next-line @typescript-eslint/no-unused-vars
439
+ (parameter, bitMask) => parameter, (parameter, bitMask) => bitMask, ({ property, propertyKey }) => typeof property === "number"
440
+ && (typeof propertyKey === "number"
441
+ || propertyKey == undefined),
442
+ // Metadata is determined dynamically depending on other factors
443
+ undefined),
444
+ }),
445
+ });
446
+ function createConfigurationCCInstance(endpoint) {
447
+ return CommandClass.createInstanceUnchecked(endpoint.virtual ? endpoint.node.physicalNodes[0] : endpoint, ConfigurationCC);
448
+ }
449
+ function normalizeConfigurationCCAPISetOptions(ctx, endpoint, options) {
450
+ if ("bitMask" in options && options.bitMask) {
451
+ // Variant 3: Partial param, look it up in the device config
452
+ const ccc = createConfigurationCCInstance(endpoint);
453
+ const paramInfo = ccc.getParamInformation(ctx, options.parameter, options.bitMask);
454
+ if (!paramInfo.isFromConfig) {
455
+ throw new ZWaveError("Setting a partial configuration parameter requires it to be defined in a device config file!", ZWaveErrorCodes.Argument_Invalid);
456
+ }
457
+ return {
458
+ parameter: options.parameter,
459
+ bitMask: options.bitMask,
460
+ value: options.value,
461
+ valueSize: paramInfo.valueSize,
462
+ valueFormat: paramInfo.format,
463
+ };
464
+ }
465
+ else if ("valueSize" in options) {
466
+ // Variant 2: Normal parameter, not defined in a config file
467
+ return pick(options, [
468
+ "parameter",
469
+ "value",
470
+ "valueSize",
471
+ "valueFormat",
472
+ ]);
473
+ }
474
+ else {
475
+ // Variant 1: Normal parameter, defined in a config file
476
+ const ccc = createConfigurationCCInstance(endpoint);
477
+ const paramInfo = ccc.getParamInformation(ctx, options.parameter, options.bitMask);
478
+ if (!paramInfo.isFromConfig) {
479
+ throw new ZWaveError("Setting a configuration parameter without specifying a value size and format requires it to be defined in a device config file!", ZWaveErrorCodes.Argument_Invalid);
480
+ }
481
+ return {
482
+ parameter: options.parameter,
483
+ value: options.value,
484
+ valueSize: paramInfo.valueSize,
485
+ valueFormat: paramInfo.format,
486
+ };
487
+ }
488
+ }
489
+ function bulkMergePartialParamValues(ctx, endpoint, options) {
490
+ // Merge partial parameters before doing anything else. Therefore, take the non-partials, ...
491
+ const allParams = options.filter((o) => o.bitMask == undefined);
492
+ // ... group the partials by parameter
493
+ const unmergedPartials = new Map();
494
+ for (const partial of options.filter((o) => o.bitMask != undefined)) {
495
+ if (!unmergedPartials.has(partial.parameter)) {
496
+ unmergedPartials.set(partial.parameter, []);
497
+ }
498
+ unmergedPartials.get(partial.parameter).push(partial);
499
+ }
500
+ // and push the merged result into the array we'll be working with
501
+ if (unmergedPartials.size) {
502
+ const ccc = createConfigurationCCInstance(endpoint);
503
+ for (const [parameter, partials] of unmergedPartials) {
504
+ allParams.push({
505
+ parameter,
506
+ value: ccc.composePartialParamValues(ctx, parameter, partials.map((p) => ({
507
+ bitMask: p.bitMask,
508
+ partialValue: p.value,
509
+ }))),
510
+ valueSize: partials[0].valueSize,
511
+ valueFormat: partials[0].valueFormat,
512
+ });
513
+ }
514
+ }
515
+ return allParams;
516
+ }
517
+ /** Determines whether a partial parameter needs to be interpreted as signed */
518
+ function isSignedPartial(bitMask, format) {
519
+ // Only treat partial params as signed if they span more than 1 bit.
520
+ // Otherwise we cannot model 0/1 properly.
521
+ return (getBitMaskWidth(bitMask) > 1
522
+ && (format ?? ConfigValueFormat.SignedInteger)
523
+ === ConfigValueFormat.SignedInteger);
524
+ }
525
+ function reInterpretSignedValue(value, valueSize, targetFormat) {
526
+ // Re-interpret the value with the new format
527
+ const raw = new Bytes(valueSize);
528
+ serializeValue(raw, 0, valueSize, ConfigValueFormat.SignedInteger, value);
529
+ return parseValue(raw, valueSize, targetFormat);
530
+ }
531
+ function getParamInformationFromConfigFile(ctx, nodeId, endpointIndex) {
532
+ const deviceConfig = ctx.getDeviceConfig?.(nodeId);
533
+ if (endpointIndex === 0) {
534
+ return (deviceConfig?.paramInformation
535
+ ?? deviceConfig?.endpoints?.get(0)?.paramInformation);
536
+ }
537
+ else {
538
+ return deviceConfig?.endpoints?.get(endpointIndex)?.paramInformation;
539
+ }
540
+ }
541
+ let ConfigurationCCAPI = class ConfigurationCCAPI extends CCAPI {
542
+ supportsCommand(cmd) {
543
+ switch (cmd) {
544
+ case ConfigurationCommand.Get:
545
+ case ConfigurationCommand.Set:
546
+ return true; // This is mandatory
547
+ case ConfigurationCommand.BulkGet:
548
+ case ConfigurationCommand.BulkSet:
549
+ return this.version >= 2;
550
+ case ConfigurationCommand.NameGet:
551
+ case ConfigurationCommand.InfoGet:
552
+ case ConfigurationCommand.PropertiesGet:
553
+ return this.version >= 3;
554
+ case ConfigurationCommand.DefaultReset:
555
+ return this.version >= 4;
556
+ }
557
+ return super.supportsCommand(cmd);
558
+ }
559
+ get [SET_VALUE]() {
560
+ return async function ({ property, propertyKey }, value) {
561
+ // Config parameters are addressed with numeric properties/keys
562
+ if (typeof property !== "number") {
563
+ throwUnsupportedProperty(this.ccId, property);
564
+ }
565
+ if (propertyKey != undefined && typeof propertyKey !== "number") {
566
+ throwUnsupportedPropertyKey(this.ccId, property, propertyKey);
567
+ }
568
+ if (typeof value !== "number") {
569
+ throwWrongValueType(this.ccId, property, "number", typeof value);
570
+ }
571
+ let ccInstance;
572
+ const applHost = this.host;
573
+ if (this.isSinglecast()) {
574
+ ccInstance = createConfigurationCCInstance(this.endpoint);
575
+ }
576
+ else if (this.isMulticast()) {
577
+ // Multicast is only possible if the parameter definition is the same on all target nodes
578
+ const nodes = this.endpoint.node.physicalNodes;
579
+ if (!nodes.every((node) => node
580
+ .getEndpoint(this.endpoint.index)
581
+ ?.supportsCC(CommandClasses.Configuration))) {
582
+ throw new ZWaveError(`The multicast setValue API for Configuration CC requires all virtual target endpoints to support Configuration CC!`, ZWaveErrorCodes.CC_Invalid);
583
+ }
584
+ // Figure out if all the relevant info is the same
585
+ const paramInfos = this.endpoint.node.physicalNodes.map((node) => createConfigurationCCInstance(node.getEndpoint(this.endpoint.index)).getParamInformation(this.host, property, propertyKey));
586
+ if (!paramInfos.length
587
+ || !paramInfos.every((info, index) => {
588
+ if (index === 0)
589
+ return true;
590
+ return (info.valueSize === paramInfos[0].valueSize
591
+ && info.format === paramInfos[0].format);
592
+ })) {
593
+ throw new ZWaveError(`The multicast setValue API for Configuration CC requires all virtual target nodes to have the same parameter definition!`, ZWaveErrorCodes.CC_Invalid);
594
+ }
595
+ // If it is, just use the first node to create the CC instance
596
+ ccInstance = createConfigurationCCInstance(this.endpoint);
597
+ }
598
+ else {
599
+ throw new ZWaveError(`The setValue API for Configuration CC is not supported via broadcast!`, ZWaveErrorCodes.CC_NotSupported);
600
+ }
601
+ let { valueSize, format: valueFormat = ConfigValueFormat.SignedInteger, } = ccInstance.getParamInformation(applHost, property);
602
+ let targetValue;
603
+ if (propertyKey) {
604
+ // This is a partial value, we need to update some bits only
605
+ // Find out the correct value size
606
+ if (!valueSize) {
607
+ valueSize = ccInstance.getParamInformation(applHost, property, propertyKey).valueSize;
608
+ }
609
+ // Add the target value to the remaining partial values
610
+ targetValue = ccInstance.composePartialParamValue(applHost, property, propertyKey, value);
611
+ // Partial parameters are internally converted to unsigned values - update the valueFormat accordingly
612
+ valueFormat = ConfigValueFormat.UnsignedInteger;
613
+ }
614
+ else {
615
+ targetValue = value;
616
+ }
617
+ if (!valueSize) {
618
+ // If there's no value size configured, figure out a matching value size
619
+ valueSize = getMinIntegerSize(targetValue, valueFormat === ConfigValueFormat.SignedInteger);
620
+ // Throw if the value is too large or too small
621
+ if (!valueSize) {
622
+ throw new ZWaveError(`The value ${targetValue} is not valid for configuration parameters!`, ZWaveErrorCodes.Argument_Invalid);
623
+ }
624
+ }
625
+ // Make sure that the given value fits into the value size
626
+ if (!isSafeValue(targetValue, valueSize, valueFormat)) {
627
+ // If there is a value size configured, check that the given value is compatible
628
+ throwInvalidValueError(targetValue, property, valueSize, valueFormat);
629
+ }
630
+ const result = await this.set({
631
+ parameter: property,
632
+ value: targetValue,
633
+ valueSize: valueSize,
634
+ valueFormat,
635
+ });
636
+ if (!supervisedCommandSucceeded(result)
637
+ && this.isSinglecast()) {
638
+ // Verify the current value after a delay, unless the command was supervised and successful
639
+ this.schedulePoll({ property, propertyKey }, targetValue,
640
+ // Configuration changes are instant
641
+ { transition: "fast" });
642
+ }
643
+ return result;
644
+ };
645
+ }
646
+ get [POLL_VALUE]() {
647
+ return async function ({ property, propertyKey }) {
648
+ // Config parameters are addressed with numeric properties/keys
649
+ if (typeof property !== "number") {
650
+ throwUnsupportedProperty(this.ccId, property);
651
+ }
652
+ if (propertyKey != undefined && typeof propertyKey !== "number") {
653
+ throwUnsupportedPropertyKey(this.ccId, property, propertyKey);
654
+ }
655
+ return this.get(property, { valueBitMask: propertyKey });
656
+ };
657
+ }
658
+ /**
659
+ * Requests the current value of a given config parameter from the device.
660
+ * This may timeout and return `undefined` if the node does not respond.
661
+ * If the node replied with a different parameter number, a `ConfigurationCCError`
662
+ * is thrown with the `argument` property set to the reported parameter number.
663
+ */
664
+ async get(parameter, options) {
665
+ __assertType("parameter", "number", __assertType__number.bind(void 0, parameter));
666
+ __assertType("options", undefined, __assertType__optional__0.bind(void 0, options));
667
+ // Get-type commands are only possible in singlecast
668
+ this.assertPhysicalEndpoint(this.endpoint);
669
+ // Two-byte parameter numbers can only be read using the BulkGet command
670
+ if (parameter > 255) {
671
+ const result = await this.getBulk([
672
+ {
673
+ parameter,
674
+ bitMask: options?.valueBitMask,
675
+ },
676
+ ]);
677
+ return result.find((r) => r.parameter === parameter)?.value;
678
+ }
679
+ this.assertSupportsCommand(ConfigurationCommand, ConfigurationCommand.Get);
680
+ const { valueBitMask, allowUnexpectedResponse } = options ?? {};
681
+ const cc = new ConfigurationCCGet({
682
+ nodeId: this.endpoint.nodeId,
683
+ endpointIndex: this.endpoint.index,
684
+ parameter,
685
+ allowUnexpectedResponse,
686
+ });
687
+ const response = await this.host.sendCommand(cc, this.commandOptions);
688
+ if (!response)
689
+ return;
690
+ // Nodes may respond with a different parameter, e.g. if we
691
+ // requested a non-existing one
692
+ if (response.parameter === parameter) {
693
+ if (!valueBitMask)
694
+ return response.value;
695
+ // If a partial parameter was requested, extract that value
696
+ const paramInfo = cc.getParamInformation(this.host, response.parameter, valueBitMask);
697
+ return parsePartial(response.value, valueBitMask, isSignedPartial(valueBitMask, paramInfo.format));
698
+ }
699
+ this.host.logNode(this.endpoint.nodeId, {
700
+ endpoint: this.endpoint.index,
701
+ message: `Received unexpected ConfigurationReport (param = ${response.parameter}, value = ${response.value.toString()})`,
702
+ direction: "inbound",
703
+ level: "error",
704
+ });
705
+ throw new ConfigurationCCError(`The first existing parameter on this node is ${response.parameter}`, ZWaveErrorCodes.ConfigurationCC_FirstParameterNumber, response.parameter);
706
+ }
707
+ /**
708
+ * Requests the current value of the config parameters from the device.
709
+ * When the node does not respond due to a timeout, the `value` in the returned array will be `undefined`.
710
+ */
711
+ async getBulk(options) {
712
+ __assertType("options", undefined, __assertType__sa__2_ea_2.bind(void 0, options));
713
+ // Get-type commands are only possible in singlecast
714
+ this.assertPhysicalEndpoint(this.endpoint);
715
+ let values;
716
+ // If the parameters are consecutive, we may use BulkGet
717
+ const distinctParameters = distinct(options.map((o) => o.parameter));
718
+ if (this.supportsCommand(ConfigurationCommand.BulkGet)
719
+ && isConsecutiveArray(distinctParameters)) {
720
+ const cc = new ConfigurationCCBulkGet({
721
+ nodeId: this.endpoint.nodeId,
722
+ endpointIndex: this.endpoint.index,
723
+ parameters: distinctParameters,
724
+ });
725
+ const response = await this.host.sendCommand(cc, this.commandOptions);
726
+ if (response)
727
+ values = response.values;
728
+ }
729
+ else {
730
+ this.assertSupportsCommand(ConfigurationCommand, ConfigurationCommand.Get);
731
+ const _values = new Map();
732
+ for (const parameter of distinctParameters) {
733
+ const cc = new ConfigurationCCGet({
734
+ nodeId: this.endpoint.nodeId,
735
+ endpointIndex: this.endpoint.index,
736
+ parameter,
737
+ });
738
+ const response = await this.host.sendCommand(cc, this.commandOptions);
739
+ if (response) {
740
+ _values.set(response.parameter, response.value);
741
+ }
742
+ }
743
+ values = _values;
744
+ }
745
+ // Combine the returned values with the requested ones
746
+ const cc = createConfigurationCCInstance(this.endpoint);
747
+ return options.map((o) => {
748
+ let value = values?.get(o.parameter);
749
+ if (typeof value === "number" && o.bitMask) {
750
+ const paramInfo = cc.getParamInformation(this.host, o.parameter, o.bitMask);
751
+ value = parsePartial(value, o.bitMask, isSignedPartial(o.bitMask, paramInfo.format));
752
+ }
753
+ return { ...o, value };
754
+ });
755
+ }
756
+ /**
757
+ * Sets a new value for a given config parameter of the device.
758
+ */
759
+ async set(options) {
760
+ __assertType("options", "ConfigurationCCAPISetOptions", __assertType__ConfigurationCCAPISetOptions.bind(void 0, options));
761
+ // Two-byte parameter numbers can only be set using the BulkSet command
762
+ if (options.parameter > 255) {
763
+ return this.setBulk([options]);
764
+ }
765
+ this.assertSupportsCommand(ConfigurationCommand, ConfigurationCommand.Set);
766
+ const normalized = normalizeConfigurationCCAPISetOptions(this.host, this.endpoint, options);
767
+ let value = normalized.value;
768
+ if (normalized.bitMask) {
769
+ const ccc = createConfigurationCCInstance(this.endpoint);
770
+ value = ccc.composePartialParamValue(this.host, normalized.parameter, normalized.bitMask, normalized.value);
771
+ }
772
+ const cc = new ConfigurationCCSet({
773
+ nodeId: this.endpoint.nodeId,
774
+ endpointIndex: this.endpoint.index,
775
+ resetToDefault: false,
776
+ parameter: normalized.parameter,
777
+ value,
778
+ valueSize: normalized.valueSize,
779
+ valueFormat: normalized.valueFormat,
780
+ });
781
+ return this.host.sendCommand(cc, this.commandOptions);
782
+ }
783
+ /**
784
+ * Sets new values for multiple config parameters of the device. Uses the `BulkSet` command if supported, otherwise falls back to individual `Set` commands.
785
+ */
786
+ async setBulk(values) {
787
+ __assertType("values", undefined, __assertType__sa_su_si__4__5_ei_si__4__7_ei_si__4__9_ei_eu_ea_2.bind(void 0, values));
788
+ // Normalize the values so we can better work with them
789
+ const normalized = values.map((v) => normalizeConfigurationCCAPISetOptions(this.host, this.endpoint, v));
790
+ // And merge multiple partials that belong the same "full" value
791
+ const allParams = bulkMergePartialParamValues(this.host, this.endpoint, normalized);
792
+ const canUseBulkSet = this.supportsCommand(ConfigurationCommand.BulkSet)
793
+ // For Bulk Set we need consecutive parameters
794
+ && isConsecutiveArray(allParams.map((v) => v.parameter))
795
+ // and identical format
796
+ && new Set(allParams.map((v) => v.valueFormat)).size === 1
797
+ // and identical size
798
+ && new Set(allParams.map((v) => v.valueSize)).size === 1;
799
+ if (canUseBulkSet) {
800
+ const cc = new ConfigurationCCBulkSet({
801
+ nodeId: this.endpoint.nodeId,
802
+ endpointIndex: this.endpoint.index,
803
+ parameters: allParams.map((v) => v.parameter),
804
+ valueSize: allParams[0].valueSize,
805
+ valueFormat: allParams[0].valueFormat,
806
+ values: allParams.map((v) => v.value),
807
+ handshake: true,
808
+ });
809
+ // The handshake flag is set, so we expect a BulkReport in response
810
+ const result = await this.host.sendCommand(cc, this.commandOptions);
811
+ // If we did receive a response, we also received the updated parameters,
812
+ // so if any one was not accepted, we know by looking at the values.
813
+ // Translate the result into a SupervisionResult by comparing the values
814
+ if (result) {
815
+ const sentValues = cc.values;
816
+ const receivedValues = [...result.values.values()];
817
+ const success = sentValues.length === receivedValues.length
818
+ && sentValues.every((v, i) => v === receivedValues[i]);
819
+ return {
820
+ status: success
821
+ ? SupervisionStatus.Success
822
+ : SupervisionStatus.Fail,
823
+ };
824
+ }
825
+ else {
826
+ return undefined;
827
+ }
828
+ }
829
+ else {
830
+ this.assertSupportsCommand(ConfigurationCommand, ConfigurationCommand.Set);
831
+ const supervisionResults = [];
832
+ for (const { parameter, value, valueSize, valueFormat, } of allParams) {
833
+ const cc = new ConfigurationCCSet({
834
+ nodeId: this.endpoint.nodeId,
835
+ endpointIndex: this.endpoint.index,
836
+ parameter,
837
+ value,
838
+ valueSize,
839
+ valueFormat,
840
+ });
841
+ supervisionResults.push(await this.host.sendCommand(cc, this.commandOptions));
842
+ }
843
+ return mergeSupervisionResults(supervisionResults);
844
+ }
845
+ }
846
+ /**
847
+ * Resets a configuration parameter to its default value.
848
+ *
849
+ * WARNING: This will throw on legacy devices (ConfigurationCC v3 and below)
850
+ */
851
+ async reset(parameter) {
852
+ __assertType("parameter", "number", __assertType__number.bind(void 0, parameter));
853
+ // Two-byte parameter numbers can only be reset using the BulkSet command
854
+ if (parameter > 255) {
855
+ return this.resetBulk([parameter]);
856
+ }
857
+ // According to SDS14223 this flag SHOULD NOT be set
858
+ // Because we don't want to test the behavior, we enforce that it MUST not be set
859
+ // on legacy nodes
860
+ if (this.version <= 3) {
861
+ throw new ZWaveError(`Resetting configuration parameters to default MUST not be done on nodes implementing ConfigurationCC V3 or below!`, ZWaveErrorCodes
862
+ .ConfigurationCC_NoResetToDefaultOnLegacyDevices);
863
+ }
864
+ this.assertSupportsCommand(ConfigurationCommand, ConfigurationCommand.Set);
865
+ const cc = new ConfigurationCCSet({
866
+ nodeId: this.endpoint.nodeId,
867
+ endpointIndex: this.endpoint.index,
868
+ parameter,
869
+ resetToDefault: true,
870
+ });
871
+ return this.host.sendCommand(cc, this.commandOptions);
872
+ }
873
+ /**
874
+ * Resets multiple configuration parameters to their default value. Uses BulkSet if supported, otherwise falls back to individual Set commands.
875
+ *
876
+ * WARNING: This will throw on legacy devices (ConfigurationCC v3 and below)
877
+ */
878
+ async resetBulk(parameters) {
879
+ __assertType("parameters", undefined, __assertType__sa__number_ea_2.bind(void 0, parameters));
880
+ if (isConsecutiveArray(parameters)
881
+ && this.supportsCommand(ConfigurationCommand.BulkSet)) {
882
+ const cc = new ConfigurationCCBulkSet({
883
+ nodeId: this.endpoint.nodeId,
884
+ endpointIndex: this.endpoint.index,
885
+ parameters,
886
+ resetToDefault: true,
887
+ });
888
+ return this.host.sendCommand(cc, this.commandOptions);
889
+ }
890
+ else {
891
+ this.assertSupportsCommand(ConfigurationCommand, ConfigurationCommand.Set);
892
+ const CCs = distinct(parameters).map((parameter) => new ConfigurationCCSet({
893
+ nodeId: this.endpoint.nodeId,
894
+ endpointIndex: this.endpoint.index,
895
+ parameter,
896
+ resetToDefault: true,
897
+ }));
898
+ for (const cc of CCs) {
899
+ await this.host.sendCommand(cc, this.commandOptions);
900
+ }
901
+ }
902
+ }
903
+ /** Resets all configuration parameters to their default value */
904
+ async resetAll() {
905
+ // This is dangerous - don't allow resetting all parameters via multicast
906
+ this.assertPhysicalEndpoint(this.endpoint);
907
+ this.assertSupportsCommand(ConfigurationCommand, ConfigurationCommand.DefaultReset);
908
+ const cc = new ConfigurationCCDefaultReset({
909
+ nodeId: this.endpoint.nodeId,
910
+ endpointIndex: this.endpoint.index,
911
+ });
912
+ await this.host.sendCommand(cc, this.commandOptions);
913
+ }
914
+ async getProperties(parameter) {
915
+ __assertType("parameter", "number", __assertType__number.bind(void 0, parameter));
916
+ // Get-type commands are only possible in singlecast
917
+ this.assertPhysicalEndpoint(this.endpoint);
918
+ const cc = new ConfigurationCCPropertiesGet({
919
+ nodeId: this.endpoint.nodeId,
920
+ endpointIndex: this.endpoint.index,
921
+ parameter,
922
+ });
923
+ const response = await this.host.sendCommand(cc, this.commandOptions);
924
+ if (response) {
925
+ return pick(response, [
926
+ "valueSize",
927
+ "valueFormat",
928
+ "minValue",
929
+ "maxValue",
930
+ "defaultValue",
931
+ "nextParameter",
932
+ "altersCapabilities",
933
+ "isReadonly",
934
+ "isAdvanced",
935
+ "noBulkSupport",
936
+ ]);
937
+ }
938
+ }
939
+ /** Requests the name of a configuration parameter from the node */
940
+ async getName(parameter) {
941
+ __assertType("parameter", "number", __assertType__number.bind(void 0, parameter));
942
+ // Get-type commands are only possible in singlecast
943
+ this.assertPhysicalEndpoint(this.endpoint);
944
+ const cc = new ConfigurationCCNameGet({
945
+ nodeId: this.endpoint.nodeId,
946
+ endpointIndex: this.endpoint.index,
947
+ parameter,
948
+ });
949
+ const response = await this.host.sendCommand(cc, this.commandOptions);
950
+ return response?.name;
951
+ }
952
+ /** Requests usage info for a configuration parameter from the node */
953
+ async getInfo(parameter) {
954
+ __assertType("parameter", "number", __assertType__number.bind(void 0, parameter));
955
+ // Get-type commands are only possible in singlecast
956
+ this.assertPhysicalEndpoint(this.endpoint);
957
+ const cc = new ConfigurationCCInfoGet({
958
+ nodeId: this.endpoint.nodeId,
959
+ endpointIndex: this.endpoint.index,
960
+ parameter,
961
+ });
962
+ const response = await this.host.sendCommand(cc, this.commandOptions);
963
+ return response?.info;
964
+ }
965
+ /**
966
+ * This scans the node for the existing parameters. Found parameters will be reported
967
+ * through the `value added` and `value updated` events.
968
+ *
969
+ * WARNING: This method throws for newer devices.
970
+ *
971
+ * WARNING: On nodes implementing V1 and V2, this process may take
972
+ * **up to an hour**, depending on the configured timeout.
973
+ *
974
+ * WARNING: On nodes implementing V2, all parameters after 255 will be ignored.
975
+ */
976
+ async scanParametersLegacy() {
977
+ if (this.version >= 3) {
978
+ throw new ZWaveError("Use ConfigurationCC.interview instead of scanning parameters for versions 3 and above.", ZWaveErrorCodes.ConfigurationCC_NoLegacyScanOnNewDevices);
979
+ }
980
+ // Get-type commands are only possible in singlecast
981
+ this.assertPhysicalEndpoint(this.endpoint);
982
+ // TODO: Reduce the priority of the messages
983
+ this.host.logNode(this.endpoint.nodeId, {
984
+ endpoint: this.endpoint.index,
985
+ message: `Scanning available parameters...`,
986
+ });
987
+ const ccInstance = createConfigurationCCInstance(this.endpoint);
988
+ for (let param = 1; param <= 255; param++) {
989
+ // Check if the parameter is readable
990
+ let originalValue;
991
+ this.host.logNode(this.endpoint.nodeId, {
992
+ endpoint: this.endpoint.index,
993
+ message: ` trying param ${param}...`,
994
+ direction: "outbound",
995
+ });
996
+ try {
997
+ originalValue = await this.get(param, {
998
+ // When requesting a non-existing parameter, a node SHOULD respond with the
999
+ // first available parameter. We use this for the first param only,
1000
+ // because delayed responses might otherwise confuse the interview process
1001
+ allowUnexpectedResponse: param === 1,
1002
+ });
1003
+ if (originalValue != undefined) {
1004
+ const logMessage = ` Param ${param}:
1005
+ readable = true
1006
+ valueSize = ${ccInstance.getParamInformation(this.host, param)
1007
+ .valueSize}
1008
+ value = ${originalValue.toString()}`;
1009
+ this.host.logNode(this.endpoint.nodeId, {
1010
+ endpoint: this.endpoint.index,
1011
+ message: logMessage,
1012
+ direction: "inbound",
1013
+ });
1014
+ }
1015
+ }
1016
+ catch (e) {
1017
+ if (e instanceof ConfigurationCCError
1018
+ && e.code
1019
+ === ZWaveErrorCodes.ConfigurationCC_FirstParameterNumber) {
1020
+ // Continue iterating with the next param
1021
+ if (e.argument - 1 > param)
1022
+ param = e.argument - 1;
1023
+ continue;
1024
+ }
1025
+ throw e;
1026
+ }
1027
+ }
1028
+ }
1029
+ };
1030
+ ConfigurationCCAPI = __decorate([
1031
+ API(CommandClasses.Configuration)
1032
+ ], ConfigurationCCAPI);
1033
+ export { ConfigurationCCAPI };
1034
+ let ConfigurationCC = class ConfigurationCC extends CommandClass {
1035
+ async interview(ctx) {
1036
+ const node = this.getNode(ctx);
1037
+ const endpoint = this.getEndpoint(ctx);
1038
+ const api = CCAPI.create(CommandClasses.Configuration, ctx, endpoint).withOptions({
1039
+ priority: MessagePriority.NodeQuery,
1040
+ });
1041
+ ctx.logNode(node.id, {
1042
+ endpoint: this.endpointIndex,
1043
+ message: `Interviewing ${this.ccName}...`,
1044
+ direction: "none",
1045
+ });
1046
+ const deviceConfig = ctx.getDeviceConfig?.(node.id);
1047
+ const paramInfo = getParamInformationFromConfigFile(ctx, node.id, this.endpointIndex);
1048
+ if (paramInfo) {
1049
+ ctx.logNode(node.id, {
1050
+ endpoint: this.endpointIndex,
1051
+ message: `${this.constructor.name}: Loading configuration parameters from device config`,
1052
+ direction: "none",
1053
+ });
1054
+ this.deserializeParamInformationFromConfig(ctx, paramInfo);
1055
+ }
1056
+ const documentedParamNumbers = new Set(Array.from(paramInfo?.keys() ?? []).map((k) => k.parameter));
1057
+ if (api.version >= 3) {
1058
+ ctx.logNode(node.id, {
1059
+ endpoint: this.endpointIndex,
1060
+ message: "finding first configuration parameter...",
1061
+ direction: "outbound",
1062
+ });
1063
+ const param0props = await api.getProperties(0);
1064
+ let param;
1065
+ if (param0props) {
1066
+ param = param0props.nextParameter;
1067
+ if (param === 0) {
1068
+ ctx.logNode(node.id, {
1069
+ endpoint: this.endpointIndex,
1070
+ message: `didn't report any config params, trying #1 just to be sure...`,
1071
+ direction: "inbound",
1072
+ });
1073
+ param = 1;
1074
+ }
1075
+ }
1076
+ else {
1077
+ ctx.logNode(node.id, {
1078
+ endpoint: this.endpointIndex,
1079
+ message: "Finding first configuration parameter timed out, skipping interview...",
1080
+ level: "warn",
1081
+ });
1082
+ return;
1083
+ }
1084
+ while (param > 0) {
1085
+ ctx.logNode(node.id, {
1086
+ endpoint: this.endpointIndex,
1087
+ message: `querying parameter #${param} information...`,
1088
+ direction: "outbound",
1089
+ });
1090
+ // Query properties and the next param
1091
+ const props = await api.getProperties(param).catch(
1092
+ // If querying the properties fails, don't abort the entire interview
1093
+ () => undefined);
1094
+ if (!props) {
1095
+ ctx.logNode(node.id, {
1096
+ endpoint: this.endpointIndex,
1097
+ message: `Querying parameter #${param} information timed out, skipping scan...`,
1098
+ level: "warn",
1099
+ });
1100
+ break;
1101
+ }
1102
+ const { nextParameter, ...properties } = props;
1103
+ let logMessage;
1104
+ if (properties.valueSize === 0) {
1105
+ logMessage =
1106
+ `Parameter #${param} is unsupported. Next parameter: ${nextParameter}`;
1107
+ }
1108
+ else {
1109
+ let name;
1110
+ // Query the name and info for parameters that are NOT defined in a config file
1111
+ if (!documentedParamNumbers.has(param)) {
1112
+ // Skip the name query for bugged devices
1113
+ if (!deviceConfig?.compat?.skipConfigurationNameQuery) {
1114
+ name = await api.getName(param).catch(
1115
+ // If querying the name fails, don't abort the entire interview
1116
+ () => undefined);
1117
+ }
1118
+ // Skip the info query for bugged devices
1119
+ if (!deviceConfig?.compat?.skipConfigurationInfoQuery) {
1120
+ await api.getInfo(param).catch(
1121
+ // If querying the info fails, don't abort the entire interview
1122
+ () => undefined);
1123
+ }
1124
+ }
1125
+ logMessage =
1126
+ `received information for parameter #${param}:`;
1127
+ if (name) {
1128
+ logMessage += `
1129
+ parameter name: ${name}`;
1130
+ }
1131
+ logMessage += `
1132
+ value format: ${getEnumMemberName(ConfigValueFormat, properties.valueFormat)}
1133
+ value size: ${properties.valueSize} bytes
1134
+ min value: ${properties.minValue?.toString() ?? "undefined"}
1135
+ max value: ${properties.maxValue?.toString() ?? "undefined"}
1136
+ default value: ${properties.defaultValue?.toString() ?? "undefined"}
1137
+ is read-only: ${!!properties.isReadonly}
1138
+ is advanced (UI): ${!!properties.isAdvanced}
1139
+ has bulk support: ${!properties.noBulkSupport}
1140
+ alters capabilities: ${!!properties.altersCapabilities}`;
1141
+ }
1142
+ ctx.logNode(node.id, {
1143
+ endpoint: this.endpointIndex,
1144
+ message: logMessage,
1145
+ direction: "inbound",
1146
+ });
1147
+ // Some devices report their parameter 1 instead of 0 as the next one
1148
+ // when reaching the end. To avoid infinite loops, stop scanning
1149
+ // once the next parameter is lower than the current one
1150
+ if (nextParameter > param) {
1151
+ param = nextParameter;
1152
+ }
1153
+ else {
1154
+ break;
1155
+ }
1156
+ }
1157
+ }
1158
+ await this.refreshValues(ctx);
1159
+ // Remember that the interview is complete
1160
+ this.setInterviewComplete(ctx, true);
1161
+ }
1162
+ async refreshValues(ctx) {
1163
+ const node = this.getNode(ctx);
1164
+ const endpoint = this.getEndpoint(ctx);
1165
+ const api = CCAPI.create(CommandClasses.Configuration, ctx, endpoint).withOptions({
1166
+ priority: MessagePriority.NodeQuery,
1167
+ });
1168
+ if (api.version < 3) {
1169
+ // V1/V2: Query all values defined in the config file
1170
+ const paramInfo = getParamInformationFromConfigFile(ctx, node.id, this.endpointIndex);
1171
+ if (paramInfo?.size) {
1172
+ // Because partial params share the same parameter number,
1173
+ // we need to remember which ones we have already queried.
1174
+ const alreadyQueried = new Set();
1175
+ for (const param of paramInfo.keys()) {
1176
+ // No need to query writeonly params
1177
+ if (paramInfo.get(param)?.writeOnly)
1178
+ continue;
1179
+ // Don't double-query params
1180
+ if (alreadyQueried.has(param.parameter))
1181
+ continue;
1182
+ alreadyQueried.add(param.parameter);
1183
+ // Query the current value
1184
+ ctx.logNode(node.id, {
1185
+ endpoint: this.endpointIndex,
1186
+ message: `querying parameter #${param.parameter} value...`,
1187
+ direction: "outbound",
1188
+ });
1189
+ // ... at least try to
1190
+ const paramValue = await api.get(param.parameter);
1191
+ if (typeof paramValue === "number") {
1192
+ ctx.logNode(node.id, {
1193
+ endpoint: this.endpointIndex,
1194
+ message: `parameter #${param.parameter} has value: ${paramValue}`,
1195
+ direction: "inbound",
1196
+ });
1197
+ }
1198
+ else if (!paramValue) {
1199
+ ctx.logNode(node.id, {
1200
+ endpoint: this.endpointIndex,
1201
+ message: `received no value for parameter #${param.parameter}`,
1202
+ direction: "inbound",
1203
+ level: "warn",
1204
+ });
1205
+ }
1206
+ }
1207
+ }
1208
+ else {
1209
+ ctx.logNode(node.id, {
1210
+ endpoint: this.endpointIndex,
1211
+ message: `${this.constructor.name}: skipping interview because CC version is < 3 and there is no config file`,
1212
+ direction: "none",
1213
+ });
1214
+ }
1215
+ }
1216
+ else {
1217
+ // V3+: Query the values of discovered parameters
1218
+ const parameters = distinct(this.getDefinedValueIDs(ctx)
1219
+ .map((v) => v.property)
1220
+ .filter((p) => typeof p === "number"));
1221
+ for (const param of parameters) {
1222
+ if (this.getParamInformation(ctx, param).readable !== false) {
1223
+ ctx.logNode(node.id, {
1224
+ endpoint: this.endpointIndex,
1225
+ message: `querying parameter #${param} value...`,
1226
+ direction: "outbound",
1227
+ });
1228
+ await api.get(param);
1229
+ }
1230
+ else {
1231
+ ctx.logNode(node.id, {
1232
+ endpoint: this.endpointIndex,
1233
+ message: `not querying parameter #${param} value, because it is writeonly`,
1234
+ direction: "none",
1235
+ });
1236
+ }
1237
+ }
1238
+ }
1239
+ }
1240
+ /**
1241
+ * Whether this node's param information was loaded from a config file.
1242
+ * If this is true, we don't trust what the node reports
1243
+ */
1244
+ paramExistsInConfigFile(ctx, parameter, valueBitMask) {
1245
+ if (this.getValue(ctx, ConfigurationCCValues.isParamInformationFromConfig) !== true) {
1246
+ return false;
1247
+ }
1248
+ const paramInformation = getParamInformationFromConfigFile(ctx, this.nodeId, this.endpointIndex);
1249
+ if (!paramInformation)
1250
+ return false;
1251
+ // Check if the param is defined in the config file, either as a normal param or a partial
1252
+ if (paramInformation.has({ parameter, valueBitMask })) {
1253
+ return true;
1254
+ }
1255
+ else if (valueBitMask == undefined) {
1256
+ // Also consider partials when looking for plain params
1257
+ for (const key of paramInformation.keys()) {
1258
+ if (key.parameter === parameter)
1259
+ return true;
1260
+ }
1261
+ }
1262
+ return false;
1263
+ }
1264
+ /**
1265
+ * @internal
1266
+ * Stores config parameter metadata for this CC's node
1267
+ */
1268
+ extendParamInformation(ctx, parameter, valueBitMask, info) {
1269
+ // Don't trust param information that a node reports if we have already loaded it from a config file
1270
+ if (valueBitMask === undefined
1271
+ && this.paramExistsInConfigFile(ctx, parameter)) {
1272
+ return;
1273
+ }
1274
+ // Retrieve the base metadata
1275
+ const metadata = this.getParamInformation(ctx, parameter, valueBitMask);
1276
+ // Override it with new data
1277
+ Object.assign(metadata, info);
1278
+ // And store it back
1279
+ this.setMetadata(ctx, ConfigurationCCValues.paramInformation(parameter, valueBitMask), metadata);
1280
+ }
1281
+ /**
1282
+ * @internal
1283
+ * Returns stored config parameter metadata for this CC's node
1284
+ */
1285
+ getParamInformation(ctx, parameter, valueBitMask) {
1286
+ return (this.getMetadata(ctx, ConfigurationCCValues.paramInformation(parameter, valueBitMask)) ?? {
1287
+ ...ValueMetadata.Any,
1288
+ });
1289
+ }
1290
+ /**
1291
+ * **INTERNAL:** Returns the param info that was queried for this node. This returns the information that was returned by the node
1292
+ * and does not include partial parameters.
1293
+ */
1294
+ getQueriedParamInfos(ctx) {
1295
+ const parameters = distinct(this.getDefinedValueIDs(ctx)
1296
+ .map((v) => v.property)
1297
+ .filter((p) => typeof p === "number"));
1298
+ return composeObject(parameters.map((p) => [
1299
+ p,
1300
+ this.getParamInformation(ctx, p),
1301
+ ]));
1302
+ }
1303
+ /**
1304
+ * Returns stored config parameter metadata for all partial config params addressed with the given parameter number
1305
+ */
1306
+ getPartialParamInfos(ctx, parameter) {
1307
+ const valueDB = this.getValueDB(ctx);
1308
+ return valueDB.findMetadata((id) => id.commandClass === this.ccId
1309
+ && (id.endpoint ?? 0) === this.endpointIndex
1310
+ && id.property === parameter
1311
+ && id.propertyKey != undefined);
1312
+ }
1313
+ /**
1314
+ * Computes the full value of a parameter after applying a partial param value
1315
+ */
1316
+ composePartialParamValue(ctx, parameter, bitMask, partialValue) {
1317
+ return this.composePartialParamValues(ctx, parameter, [
1318
+ { bitMask, partialValue },
1319
+ ]);
1320
+ }
1321
+ /**
1322
+ * Computes the full value of a parameter after applying multiple partial param values
1323
+ */
1324
+ composePartialParamValues(ctx, parameter, partials) {
1325
+ const valueDB = this.getValueDB(ctx);
1326
+ // Add the other values together
1327
+ const otherValues = valueDB.findValues((id) => id.commandClass === this.ccId
1328
+ && (id.endpoint ?? 0) === this.endpointIndex
1329
+ && id.property === parameter
1330
+ && id.propertyKey != undefined
1331
+ && !partials.some((p) => id.propertyKey === p.bitMask));
1332
+ let ret = 0;
1333
+ for (const { propertyKey: bitMask, value: partialValue, } of otherValues) {
1334
+ ret = encodePartial(ret, partialValue, bitMask);
1335
+ }
1336
+ for (const { bitMask, partialValue } of partials) {
1337
+ ret = encodePartial(ret, partialValue, bitMask);
1338
+ }
1339
+ return ret;
1340
+ }
1341
+ /** Deserializes the config parameter info from a config file */
1342
+ deserializeParamInformationFromConfig(ctx, config) {
1343
+ const valueDB = this.getValueDB(ctx);
1344
+ // Clear old param information
1345
+ for (const meta of valueDB.getAllMetadata(this.ccId)) {
1346
+ if (typeof meta.property === "number"
1347
+ && (meta.endpoint ?? 0) === this.endpointIndex) {
1348
+ // this is a param information, delete it
1349
+ valueDB.setMetadata(meta, undefined,
1350
+ // Don't emit the added/updated events, as this will spam applications with untranslated events
1351
+ { noEvent: true });
1352
+ }
1353
+ }
1354
+ // Allow overwriting the param info (mark it as unloaded)
1355
+ this.setValue(ctx, ConfigurationCCValues.isParamInformationFromConfig, false);
1356
+ for (const [param, info] of config.entries()) {
1357
+ // We need to make the config information compatible with the
1358
+ // format that ConfigurationCC reports
1359
+ const paramInfo = stripUndefined({
1360
+ // TODO: Make this smarter! (0...1 ==> boolean)
1361
+ type: "number",
1362
+ valueSize: info.valueSize,
1363
+ min: info.minValue,
1364
+ max: info.maxValue,
1365
+ default: info.defaultValue,
1366
+ unit: info.unit,
1367
+ format: info.unsigned
1368
+ ? ConfigValueFormat.UnsignedInteger
1369
+ : ConfigValueFormat.SignedInteger,
1370
+ readable: !info.writeOnly,
1371
+ writeable: !info.readOnly,
1372
+ allowManualEntry: info.allowManualEntry,
1373
+ states: info.options.length > 0
1374
+ ? composeObject(info.options.map(({ label, value }) => [
1375
+ value.toString(),
1376
+ label,
1377
+ ]))
1378
+ : undefined,
1379
+ label: info.label,
1380
+ description: info.description,
1381
+ isFromConfig: true,
1382
+ });
1383
+ this.extendParamInformation(ctx, param.parameter, param.valueBitMask, paramInfo);
1384
+ }
1385
+ // Remember that we loaded the param information from a config file
1386
+ this.setValue(ctx, ConfigurationCCValues.isParamInformationFromConfig, true);
1387
+ }
1388
+ translatePropertyKey(ctx, property, propertyKey) {
1389
+ if (typeof property === "number"
1390
+ && (propertyKey == undefined || typeof propertyKey === "number")) {
1391
+ // This CC names all configuration parameters differently,
1392
+ // so no name for the property key is required
1393
+ return undefined;
1394
+ }
1395
+ return super.translateProperty(ctx, property, propertyKey);
1396
+ }
1397
+ translateProperty(ctx, property, propertyKey) {
1398
+ // Try to retrieve the configured param label
1399
+ if (typeof property === "number"
1400
+ && (propertyKey == undefined || typeof propertyKey === "number")) {
1401
+ const paramInfo = this.getParamInformation(ctx, property, propertyKey);
1402
+ if (paramInfo.label)
1403
+ return paramInfo.label;
1404
+ // fall back to paramXYZ[_key] if none is defined
1405
+ let ret = `param${padStart(property.toString(), 3, "0")}`;
1406
+ if (propertyKey != undefined) {
1407
+ ret += "_" + propertyKey.toString();
1408
+ }
1409
+ return ret;
1410
+ }
1411
+ return super.translateProperty(ctx, property, propertyKey);
1412
+ }
1413
+ };
1414
+ ConfigurationCC = __decorate([
1415
+ commandClass(CommandClasses.Configuration),
1416
+ implementedVersion(4),
1417
+ ccValues(ConfigurationCCValues)
1418
+ ], ConfigurationCC);
1419
+ export { ConfigurationCC };
1420
+ let ConfigurationCCReport = ConfigurationCCReport_1 = class ConfigurationCCReport extends ConfigurationCC {
1421
+ constructor(options) {
1422
+ super(options);
1423
+ this.parameter = options.parameter;
1424
+ this.value = options.value;
1425
+ this.valueSize = options.valueSize;
1426
+ this.valueFormat = options.valueFormat;
1427
+ }
1428
+ static from(raw, ctx) {
1429
+ // All fields must be present
1430
+ validatePayload(raw.payload.length > 2);
1431
+ const parameter = raw.payload[0];
1432
+ const valueSize = raw.payload[1] & 0b111;
1433
+ // Ensure we received a valid report
1434
+ validatePayload(valueSize >= 1, valueSize <= 4, raw.payload.length >= 2 + valueSize);
1435
+ // Default to parsing the value as SignedInteger, like the specs say.
1436
+ // We try to re-interpret the value in persistValues()
1437
+ const value = parseValue(raw.payload.subarray(2), valueSize, ConfigValueFormat.SignedInteger);
1438
+ return new ConfigurationCCReport_1({
1439
+ nodeId: ctx.sourceNodeId,
1440
+ parameter,
1441
+ valueSize,
1442
+ value,
1443
+ });
1444
+ }
1445
+ parameter;
1446
+ value;
1447
+ valueSize;
1448
+ valueFormat; // only used for serialization
1449
+ persistValues(ctx) {
1450
+ if (!super.persistValues(ctx))
1451
+ return false;
1452
+ const ccVersion = getEffectiveCCVersion(ctx, this);
1453
+ // This parameter may be a partial param in the following cases:
1454
+ // * a config file defines it as such
1455
+ // * it was reported by the device as a bit field
1456
+ const partialParams = this.getPartialParamInfos(ctx, this.parameter);
1457
+ let cachedValueFormat;
1458
+ if (partialParams.length > 0) {
1459
+ // This is a partial param. All definitions should have the same format, so we just take the first one
1460
+ cachedValueFormat = partialParams[0].metadata.format;
1461
+ }
1462
+ else {
1463
+ // Check if the initial assumption of SignedInteger holds true
1464
+ const oldParamInformation = this.getParamInformation(ctx, this.parameter);
1465
+ cachedValueFormat = oldParamInformation.format;
1466
+ // On older CC versions, these reports may be the only way we can retrieve the value size
1467
+ // Therefore we store it here
1468
+ this.extendParamInformation(ctx, this.parameter, undefined, {
1469
+ valueSize: this.valueSize,
1470
+ });
1471
+ if (ccVersion < 3
1472
+ && !this.paramExistsInConfigFile(ctx, this.parameter)
1473
+ && oldParamInformation.min == undefined
1474
+ && oldParamInformation.max == undefined) {
1475
+ const isSigned = oldParamInformation.format == undefined
1476
+ || oldParamInformation.format
1477
+ === ConfigValueFormat.SignedInteger;
1478
+ this.extendParamInformation(ctx, this.parameter, undefined, getIntegerLimits(this.valueSize, isSigned));
1479
+ }
1480
+ }
1481
+ // We may have to re-interpret the value as unsigned, depending on the cached value format
1482
+ if (cachedValueFormat != undefined
1483
+ && cachedValueFormat !== ConfigValueFormat.SignedInteger) {
1484
+ // Re-interpret the value with the new format
1485
+ this.value = reInterpretSignedValue(this.value, this.valueSize, cachedValueFormat);
1486
+ }
1487
+ // And store the value itself
1488
+ // If we have partial config params defined, we need to split the value
1489
+ if (partialParams.length > 0) {
1490
+ for (const param of partialParams) {
1491
+ if (typeof param.propertyKey === "number") {
1492
+ this.setValue(ctx, ConfigurationCCValues.paramInformation(this.parameter, param.propertyKey), parsePartial(this.value, param.propertyKey, isSignedPartial(param.propertyKey, param.metadata.format)));
1493
+ }
1494
+ }
1495
+ }
1496
+ else {
1497
+ // This is a single param
1498
+ this.setValue(ctx, ConfigurationCCValues.paramInformation(this.parameter), this.value);
1499
+ }
1500
+ return true;
1501
+ }
1502
+ serialize(ctx) {
1503
+ this.payload = Bytes.concat([
1504
+ Bytes.from([this.parameter, this.valueSize & 0b111]),
1505
+ new Bytes(this.valueSize),
1506
+ ]);
1507
+ serializeValue(this.payload, 2, this.valueSize, this.valueFormat ?? ConfigValueFormat.SignedInteger, this.value);
1508
+ return super.serialize(ctx);
1509
+ }
1510
+ toLogEntry(ctx) {
1511
+ return {
1512
+ ...super.toLogEntry(ctx),
1513
+ message: {
1514
+ "parameter #": this.parameter,
1515
+ "value size": this.valueSize,
1516
+ value: configValueToString(this.value),
1517
+ },
1518
+ };
1519
+ }
1520
+ };
1521
+ ConfigurationCCReport = ConfigurationCCReport_1 = __decorate([
1522
+ CCCommand(ConfigurationCommand.Report)
1523
+ ], ConfigurationCCReport);
1524
+ export { ConfigurationCCReport };
1525
+ function testResponseForConfigurationGet(sent, received) {
1526
+ // We expect a Configuration Report that matches the requested parameter
1527
+ return (sent.parameter === received.parameter || sent.allowUnexpectedResponse);
1528
+ }
1529
+ let ConfigurationCCGet = ConfigurationCCGet_1 = class ConfigurationCCGet extends ConfigurationCC {
1530
+ constructor(options) {
1531
+ super(options);
1532
+ this.parameter = options.parameter;
1533
+ this.allowUnexpectedResponse = options.allowUnexpectedResponse
1534
+ ?? false;
1535
+ }
1536
+ static from(raw, ctx) {
1537
+ validatePayload(raw.payload.length >= 1);
1538
+ const parameter = raw.payload[0];
1539
+ return new ConfigurationCCGet_1({
1540
+ nodeId: ctx.sourceNodeId,
1541
+ parameter,
1542
+ });
1543
+ }
1544
+ parameter;
1545
+ allowUnexpectedResponse;
1546
+ serialize(ctx) {
1547
+ this.payload = Bytes.from([this.parameter]);
1548
+ return super.serialize(ctx);
1549
+ }
1550
+ toLogEntry(ctx) {
1551
+ return {
1552
+ ...super.toLogEntry(ctx),
1553
+ message: { "parameter #": this.parameter },
1554
+ };
1555
+ }
1556
+ };
1557
+ ConfigurationCCGet = ConfigurationCCGet_1 = __decorate([
1558
+ CCCommand(ConfigurationCommand.Get),
1559
+ expectedCCResponse(ConfigurationCCReport, testResponseForConfigurationGet)
1560
+ ], ConfigurationCCGet);
1561
+ export { ConfigurationCCGet };
1562
+ let ConfigurationCCSet = ConfigurationCCSet_1 = class ConfigurationCCSet extends ConfigurationCC {
1563
+ constructor(options) {
1564
+ super(options);
1565
+ this.parameter = options.parameter;
1566
+ this.resetToDefault = !!options.resetToDefault;
1567
+ if (!options.resetToDefault) {
1568
+ // TODO: Default to the stored value size
1569
+ this.valueSize = options.valueSize;
1570
+ this.valueFormat = options.valueFormat
1571
+ ?? ConfigValueFormat.SignedInteger;
1572
+ this.value = options.value;
1573
+ }
1574
+ }
1575
+ static from(raw, ctx) {
1576
+ validatePayload(raw.payload.length >= 2);
1577
+ const parameter = raw.payload[0];
1578
+ const resetToDefault = !!(raw.payload[1] & 0b1000_0000);
1579
+ const valueSize = raw.payload[1] & 0b111;
1580
+ // Ensure we received a valid report
1581
+ validatePayload(valueSize >= 1, valueSize <= 4, raw.payload.length >= 2 + valueSize);
1582
+ // Parse the value as signed integer. We don't know the format here.
1583
+ const value = parseValue(raw.payload.subarray(2), valueSize, ConfigValueFormat.SignedInteger);
1584
+ return new ConfigurationCCSet_1({
1585
+ nodeId: ctx.sourceNodeId,
1586
+ parameter,
1587
+ resetToDefault,
1588
+ valueSize,
1589
+ value,
1590
+ });
1591
+ }
1592
+ resetToDefault;
1593
+ parameter;
1594
+ valueSize;
1595
+ valueFormat;
1596
+ value;
1597
+ serialize(ctx) {
1598
+ const valueSize = this.resetToDefault ? 1 : this.valueSize;
1599
+ const payloadLength = 2 + valueSize;
1600
+ this.payload = Bytes.alloc(payloadLength, 0);
1601
+ this.payload[0] = this.parameter;
1602
+ this.payload[1] = (this.resetToDefault ? 0b1000_0000 : 0)
1603
+ | (valueSize & 0b111);
1604
+ if (!this.resetToDefault) {
1605
+ // Make sure that the given value fits into the value size
1606
+ if (typeof this.value === "number"
1607
+ && !isSafeValue(this.value, valueSize, this.valueFormat)) {
1608
+ // If there is a value size configured, check that the given value is compatible
1609
+ throwInvalidValueError(this.value, this.parameter, valueSize, this.valueFormat);
1610
+ }
1611
+ try {
1612
+ serializeValue(this.payload, 2, valueSize, this.valueFormat, this.value);
1613
+ }
1614
+ catch (e) {
1615
+ tryCatchOutOfBoundsError(e, this.value, this.parameter, valueSize, this.valueFormat);
1616
+ }
1617
+ }
1618
+ return super.serialize(ctx);
1619
+ }
1620
+ toLogEntry(ctx) {
1621
+ const message = {
1622
+ "parameter #": this.parameter,
1623
+ "reset to default": this.resetToDefault,
1624
+ };
1625
+ if (this.valueSize != undefined) {
1626
+ message["value size"] = this.valueSize;
1627
+ }
1628
+ if (this.valueFormat != undefined) {
1629
+ message["value format"] = getEnumMemberName(ConfigValueFormat, this.valueFormat);
1630
+ }
1631
+ if (this.value != undefined) {
1632
+ message.value = configValueToString(this.value);
1633
+ }
1634
+ return {
1635
+ ...super.toLogEntry(ctx),
1636
+ message,
1637
+ };
1638
+ }
1639
+ };
1640
+ ConfigurationCCSet = ConfigurationCCSet_1 = __decorate([
1641
+ CCCommand(ConfigurationCommand.Set),
1642
+ useSupervision()
1643
+ ], ConfigurationCCSet);
1644
+ export { ConfigurationCCSet };
1645
+ function getResponseForBulkSet(cc) {
1646
+ return cc.handshake ? ConfigurationCCBulkReport : undefined;
1647
+ }
1648
+ let ConfigurationCCBulkSet = class ConfigurationCCBulkSet extends ConfigurationCC {
1649
+ constructor(options) {
1650
+ super(options);
1651
+ this._parameters = options.parameters;
1652
+ if (this._parameters.length < 1) {
1653
+ throw new ZWaveError(`In a ConfigurationCC.BulkSet, parameters must be a non-empty array`, ZWaveErrorCodes.CC_Invalid);
1654
+ }
1655
+ else if (!isConsecutiveArray(this._parameters)) {
1656
+ throw new ZWaveError(`A ConfigurationCC.BulkSet can only be used for consecutive parameters`, ZWaveErrorCodes.CC_Invalid);
1657
+ }
1658
+ this._handshake = !!options.handshake;
1659
+ this._resetToDefault = !!options.resetToDefault;
1660
+ if (!!options.resetToDefault) {
1661
+ this._valueSize = 1;
1662
+ this._valueFormat = ConfigValueFormat.SignedInteger;
1663
+ this._values = this._parameters.map(() => 0);
1664
+ }
1665
+ else {
1666
+ this._valueSize = options.valueSize;
1667
+ this._valueFormat = options.valueFormat
1668
+ ?? ConfigValueFormat.SignedInteger;
1669
+ this._values = options.values;
1670
+ }
1671
+ }
1672
+ static from(_raw, _ctx) {
1673
+ // TODO: Deserialize payload
1674
+ throw new ZWaveError(`${this.name}: deserialization not implemented`, ZWaveErrorCodes.Deserialization_NotImplemented);
1675
+ // return new ConfigurationCCBulkSet({
1676
+ // nodeId: ctx.sourceNodeId,
1677
+ // });
1678
+ }
1679
+ _parameters;
1680
+ get parameters() {
1681
+ return this._parameters;
1682
+ }
1683
+ _resetToDefault;
1684
+ get resetToDefault() {
1685
+ return this._resetToDefault;
1686
+ }
1687
+ _valueSize;
1688
+ get valueSize() {
1689
+ return this._valueSize;
1690
+ }
1691
+ _valueFormat;
1692
+ get valueFormat() {
1693
+ return this._valueFormat;
1694
+ }
1695
+ _values;
1696
+ get values() {
1697
+ return this._values;
1698
+ }
1699
+ _handshake;
1700
+ get handshake() {
1701
+ return this._handshake;
1702
+ }
1703
+ serialize(ctx) {
1704
+ const valueSize = this._resetToDefault ? 1 : this.valueSize;
1705
+ const payloadLength = 4 + valueSize * this.parameters.length;
1706
+ this.payload = Bytes.alloc(payloadLength, 0);
1707
+ this.payload.writeUInt16BE(this.parameters[0], 0);
1708
+ this.payload[2] = this.parameters.length;
1709
+ this.payload[3] = (this._resetToDefault ? 0b1000_0000 : 0)
1710
+ | (this.handshake ? 0b0100_0000 : 0)
1711
+ | (valueSize & 0b111);
1712
+ if (!this._resetToDefault) {
1713
+ for (let i = 0; i < this.parameters.length; i++) {
1714
+ const value = this._values[i];
1715
+ const param = this._parameters[i];
1716
+ // Make sure that the given value fits into the value size
1717
+ if (!isSafeValue(value, valueSize, this._valueFormat)) {
1718
+ // If there is a value size configured, check that the given value is compatible
1719
+ throwInvalidValueError(value, param, valueSize, this._valueFormat);
1720
+ }
1721
+ try {
1722
+ serializeValue(this.payload, 4 + i * valueSize, valueSize, this._valueFormat, value);
1723
+ }
1724
+ catch (e) {
1725
+ tryCatchOutOfBoundsError(e, value, param, valueSize, this._valueFormat);
1726
+ }
1727
+ }
1728
+ }
1729
+ return super.serialize(ctx);
1730
+ }
1731
+ toLogEntry(ctx) {
1732
+ const message = {
1733
+ handshake: this.handshake,
1734
+ "reset to default": this.resetToDefault,
1735
+ "value size": this.valueSize,
1736
+ };
1737
+ if (this._values.length > 0) {
1738
+ message.values = this._values
1739
+ .map((value, i) => `\n· #${this._parameters[i]}: ${configValueToString(value)}`)
1740
+ .join("");
1741
+ }
1742
+ return {
1743
+ ...super.toLogEntry(ctx),
1744
+ message,
1745
+ };
1746
+ }
1747
+ };
1748
+ ConfigurationCCBulkSet = __decorate([
1749
+ CCCommand(ConfigurationCommand.BulkSet),
1750
+ expectedCCResponse(getResponseForBulkSet),
1751
+ useSupervision()
1752
+ ], ConfigurationCCBulkSet);
1753
+ export { ConfigurationCCBulkSet };
1754
+ let ConfigurationCCBulkReport = ConfigurationCCBulkReport_1 = class ConfigurationCCBulkReport extends ConfigurationCC {
1755
+ constructor(options) {
1756
+ super(options);
1757
+ // TODO: Check implementation:
1758
+ this.reportsToFollow = options.reportsToFollow;
1759
+ this.defaultValues = options.defaultValues;
1760
+ this.isHandshakeResponse = options.isHandshakeResponse;
1761
+ this.valueSize = options.valueSize;
1762
+ for (const [param, value] of Object.entries(options.values)) {
1763
+ this._values.set(parseInt(param), value);
1764
+ }
1765
+ }
1766
+ static from(raw, ctx) {
1767
+ // Ensure we received enough bytes for the preamble
1768
+ validatePayload(raw.payload.length >= 5);
1769
+ const firstParameter = raw.payload.readUInt16BE(0);
1770
+ const numParams = raw.payload[2];
1771
+ const reportsToFollow = raw.payload[3];
1772
+ const defaultValues = !!(raw.payload[4] & 0b1000_0000);
1773
+ const isHandshakeResponse = !!(raw.payload[4] & 0b0100_0000);
1774
+ const valueSize = raw.payload[4] & 0b111;
1775
+ // Ensure the payload is long enough for all reported values
1776
+ validatePayload(raw.payload.length >= 5 + numParams * valueSize);
1777
+ const values = {};
1778
+ for (let i = 0; i < numParams; i++) {
1779
+ const param = firstParameter + i;
1780
+ // Default to parsing the value as SignedInteger, like the specs say.
1781
+ // We try to re-interpret the value in persistValues()
1782
+ values[param] = parseValue(raw.payload.subarray(5 + i * valueSize), valueSize, ConfigValueFormat.SignedInteger);
1783
+ }
1784
+ return new ConfigurationCCBulkReport_1({
1785
+ nodeId: ctx.sourceNodeId,
1786
+ reportsToFollow,
1787
+ defaultValues,
1788
+ isHandshakeResponse,
1789
+ valueSize,
1790
+ values,
1791
+ });
1792
+ }
1793
+ persistValues(ctx) {
1794
+ if (!super.persistValues(ctx))
1795
+ return false;
1796
+ // Store every received parameter
1797
+ // eslint-disable-next-line prefer-const
1798
+ for (let [parameter, value] of this._values.entries()) {
1799
+ // Check if the initial assumption of SignedInteger holds true
1800
+ const oldParamInformation = this.getParamInformation(ctx, parameter);
1801
+ if (oldParamInformation.format != undefined
1802
+ && oldParamInformation.format
1803
+ !== ConfigValueFormat.SignedInteger) {
1804
+ // Re-interpret the value with the new format
1805
+ value = reInterpretSignedValue(value, this.valueSize, oldParamInformation.format);
1806
+ this._values.set(parameter, value);
1807
+ }
1808
+ this.setValue(ctx, ConfigurationCCValues.paramInformation(parameter), value);
1809
+ }
1810
+ return true;
1811
+ }
1812
+ reportsToFollow;
1813
+ defaultValues;
1814
+ isHandshakeResponse;
1815
+ valueSize;
1816
+ _values = new Map();
1817
+ get values() {
1818
+ return this._values;
1819
+ }
1820
+ getPartialCCSessionId() {
1821
+ // We don't expect the applHost to merge CCs but we want to wait until all reports have been received
1822
+ return {};
1823
+ }
1824
+ expectMoreMessages() {
1825
+ return this.reportsToFollow > 0;
1826
+ }
1827
+ toLogEntry(ctx) {
1828
+ const message = {
1829
+ "handshake response": this.isHandshakeResponse,
1830
+ "default values": this.defaultValues,
1831
+ "value size": this.valueSize,
1832
+ "reports to follow": this.reportsToFollow,
1833
+ };
1834
+ if (this._values.size > 0) {
1835
+ message.values = [...this._values]
1836
+ .map(([param, value]) => `
1837
+ · #${param}: ${configValueToString(value)}`)
1838
+ .join("");
1839
+ }
1840
+ return {
1841
+ ...super.toLogEntry(ctx),
1842
+ message,
1843
+ };
1844
+ }
1845
+ };
1846
+ ConfigurationCCBulkReport = ConfigurationCCBulkReport_1 = __decorate([
1847
+ CCCommand(ConfigurationCommand.BulkReport)
1848
+ ], ConfigurationCCBulkReport);
1849
+ export { ConfigurationCCBulkReport };
1850
+ let ConfigurationCCBulkGet = class ConfigurationCCBulkGet extends ConfigurationCC {
1851
+ constructor(options) {
1852
+ super(options);
1853
+ this._parameters = options.parameters.sort();
1854
+ if (!isConsecutiveArray(this.parameters)) {
1855
+ throw new ZWaveError(`A ConfigurationCC.BulkGet can only be used for consecutive parameters`, ZWaveErrorCodes.CC_Invalid);
1856
+ }
1857
+ }
1858
+ static from(_raw, _ctx) {
1859
+ // TODO: Deserialize payload
1860
+ throw new ZWaveError(`${this.name}: deserialization not implemented`, ZWaveErrorCodes.Deserialization_NotImplemented);
1861
+ // return new ConfigurationCCBulkGet({
1862
+ // nodeId: ctx.sourceNodeId,
1863
+ // });
1864
+ }
1865
+ _parameters;
1866
+ get parameters() {
1867
+ return this._parameters;
1868
+ }
1869
+ serialize(ctx) {
1870
+ this.payload = new Bytes(3);
1871
+ this.payload.writeUInt16BE(this.parameters[0], 0);
1872
+ this.payload[2] = this.parameters.length;
1873
+ return super.serialize(ctx);
1874
+ }
1875
+ toLogEntry(ctx) {
1876
+ return {
1877
+ ...super.toLogEntry(ctx),
1878
+ message: { parameters: this.parameters.join(", ") },
1879
+ };
1880
+ }
1881
+ };
1882
+ ConfigurationCCBulkGet = __decorate([
1883
+ CCCommand(ConfigurationCommand.BulkGet),
1884
+ expectedCCResponse(ConfigurationCCBulkReport)
1885
+ ], ConfigurationCCBulkGet);
1886
+ export { ConfigurationCCBulkGet };
1887
+ let ConfigurationCCNameReport = ConfigurationCCNameReport_1 = class ConfigurationCCNameReport extends ConfigurationCC {
1888
+ constructor(options) {
1889
+ super(options);
1890
+ this.parameter = options.parameter;
1891
+ this.name = options.name;
1892
+ this.reportsToFollow = options.reportsToFollow;
1893
+ }
1894
+ static from(raw, ctx) {
1895
+ // Parameter and # of reports must be present
1896
+ validatePayload(raw.payload.length >= 3);
1897
+ const parameter = raw.payload.readUInt16BE(0);
1898
+ const reportsToFollow = raw.payload[2];
1899
+ if (reportsToFollow > 0) {
1900
+ // If more reports follow, the info must at least be one byte
1901
+ validatePayload(raw.payload.length >= 4);
1902
+ }
1903
+ const name = raw.payload.subarray(3).toString("utf8");
1904
+ return new ConfigurationCCNameReport_1({
1905
+ nodeId: ctx.sourceNodeId,
1906
+ parameter,
1907
+ reportsToFollow,
1908
+ name,
1909
+ });
1910
+ }
1911
+ parameter;
1912
+ name;
1913
+ reportsToFollow;
1914
+ persistValues(ctx) {
1915
+ if (!super.persistValues(ctx))
1916
+ return false;
1917
+ // Bitfield parameters that are not documented in a config file
1918
+ // are split into multiple partial parameters. We need to set the name for
1919
+ // all of them.
1920
+ const partialParams = this.getPartialParamInfos(ctx, this.parameter);
1921
+ if (partialParams.length === 0) {
1922
+ this.extendParamInformation(ctx, this.parameter, undefined, {
1923
+ label: this.name,
1924
+ });
1925
+ }
1926
+ else {
1927
+ for (const param of partialParams) {
1928
+ const paramNumber = param.property;
1929
+ const bitMask = param.propertyKey;
1930
+ const bitNumber = Math.log2(bitMask) % 1 === 0
1931
+ ? Math.log2(bitMask)
1932
+ : undefined;
1933
+ let label = `${this.name} - ${bitMask}`;
1934
+ if (bitNumber != undefined) {
1935
+ label += ` (bit ${bitNumber})`;
1936
+ }
1937
+ this.extendParamInformation(ctx, paramNumber, bitMask, {
1938
+ label,
1939
+ });
1940
+ }
1941
+ }
1942
+ return true;
1943
+ }
1944
+ serialize(ctx) {
1945
+ const nameBuffer = Bytes.from(this.name, "utf8");
1946
+ this.payload = new Bytes(3 + nameBuffer.length);
1947
+ this.payload.writeUInt16BE(this.parameter, 0);
1948
+ this.payload[2] = this.reportsToFollow;
1949
+ this.payload.set(nameBuffer, 3);
1950
+ return super.serialize(ctx);
1951
+ }
1952
+ getPartialCCSessionId() {
1953
+ // Distinguish sessions by the parameter number
1954
+ return { parameter: this.parameter };
1955
+ }
1956
+ expectMoreMessages() {
1957
+ return this.reportsToFollow > 0;
1958
+ }
1959
+ mergePartialCCs(partials, _ctx) {
1960
+ // Concat the name
1961
+ this.name = [...partials, this]
1962
+ .map((report) => report.name)
1963
+ .reduce((prev, cur) => prev + cur, "");
1964
+ }
1965
+ toLogEntry(ctx) {
1966
+ return {
1967
+ ...super.toLogEntry(ctx),
1968
+ message: {
1969
+ "parameter #": this.parameter,
1970
+ name: this.name,
1971
+ "reports to follow": this.reportsToFollow,
1972
+ },
1973
+ };
1974
+ }
1975
+ };
1976
+ ConfigurationCCNameReport = ConfigurationCCNameReport_1 = __decorate([
1977
+ CCCommand(ConfigurationCommand.NameReport)
1978
+ ], ConfigurationCCNameReport);
1979
+ export { ConfigurationCCNameReport };
1980
+ let ConfigurationCCNameGet = ConfigurationCCNameGet_1 = class ConfigurationCCNameGet extends ConfigurationCC {
1981
+ constructor(options) {
1982
+ super(options);
1983
+ this.parameter = options.parameter;
1984
+ }
1985
+ static from(raw, ctx) {
1986
+ validatePayload(raw.payload.length >= 2);
1987
+ const parameter = raw.payload.readUInt16BE(0);
1988
+ return new ConfigurationCCNameGet_1({
1989
+ nodeId: ctx.sourceNodeId,
1990
+ parameter,
1991
+ });
1992
+ }
1993
+ parameter;
1994
+ serialize(ctx) {
1995
+ this.payload = new Bytes(2);
1996
+ this.payload.writeUInt16BE(this.parameter, 0);
1997
+ return super.serialize(ctx);
1998
+ }
1999
+ toLogEntry(ctx) {
2000
+ return {
2001
+ ...super.toLogEntry(ctx),
2002
+ message: { "parameter #": this.parameter },
2003
+ };
2004
+ }
2005
+ };
2006
+ ConfigurationCCNameGet = ConfigurationCCNameGet_1 = __decorate([
2007
+ CCCommand(ConfigurationCommand.NameGet),
2008
+ expectedCCResponse(ConfigurationCCNameReport)
2009
+ ], ConfigurationCCNameGet);
2010
+ export { ConfigurationCCNameGet };
2011
+ let ConfigurationCCInfoReport = ConfigurationCCInfoReport_1 = class ConfigurationCCInfoReport extends ConfigurationCC {
2012
+ constructor(options) {
2013
+ super(options);
2014
+ this.parameter = options.parameter;
2015
+ this.info = options.info;
2016
+ this.reportsToFollow = options.reportsToFollow;
2017
+ }
2018
+ static from(raw, ctx) {
2019
+ // Parameter and # of reports must be present
2020
+ validatePayload(raw.payload.length >= 3);
2021
+ const parameter = raw.payload.readUInt16BE(0);
2022
+ const reportsToFollow = raw.payload[2];
2023
+ if (reportsToFollow > 0) {
2024
+ // If more reports follow, the info must at least be one byte
2025
+ validatePayload(raw.payload.length >= 4);
2026
+ }
2027
+ const info = raw.payload.subarray(3).toString("utf8");
2028
+ return new ConfigurationCCInfoReport_1({
2029
+ nodeId: ctx.sourceNodeId,
2030
+ parameter,
2031
+ reportsToFollow,
2032
+ info,
2033
+ });
2034
+ }
2035
+ parameter;
2036
+ info;
2037
+ reportsToFollow;
2038
+ persistValues(ctx) {
2039
+ if (!super.persistValues(ctx))
2040
+ return false;
2041
+ // Bitfield parameters that are not documented in a config file
2042
+ // are split into multiple partial parameters. We need to set the description for
2043
+ // all of them. However, these can get very long, so we put the reported
2044
+ // description on the first partial param, and refer to it from the others
2045
+ const partialParams = this.getPartialParamInfos(ctx, this.parameter).sort((a, b) => (a.propertyKey ?? 0)
2046
+ - (b.propertyKey ?? 0));
2047
+ if (partialParams.length === 0) {
2048
+ this.extendParamInformation(ctx, this.parameter, undefined, {
2049
+ description: this.info,
2050
+ });
2051
+ }
2052
+ else {
2053
+ let firstParamLabel;
2054
+ for (const param of partialParams) {
2055
+ const paramNumber = param.property;
2056
+ const bitMask = param.propertyKey;
2057
+ // We put the description on the first partial param
2058
+ const description = firstParamLabel
2059
+ ? `Refer to ${firstParamLabel}`
2060
+ : this.info;
2061
+ this.extendParamInformation(ctx, paramNumber, bitMask, {
2062
+ description,
2063
+ });
2064
+ // Then we store the name of the first param to refer to it on the
2065
+ // following partial params
2066
+ if (firstParamLabel == undefined) {
2067
+ firstParamLabel =
2068
+ this.getParamInformation(ctx, paramNumber, bitMask)
2069
+ .label ?? `parameter ${paramNumber} - ${bitMask}`;
2070
+ }
2071
+ }
2072
+ }
2073
+ return true;
2074
+ }
2075
+ serialize(ctx) {
2076
+ const infoBuffer = Bytes.from(this.info, "utf8");
2077
+ this.payload = new Bytes(3 + infoBuffer.length);
2078
+ this.payload.writeUInt16BE(this.parameter, 0);
2079
+ this.payload[2] = this.reportsToFollow;
2080
+ this.payload.set(infoBuffer, 3);
2081
+ return super.serialize(ctx);
2082
+ }
2083
+ getPartialCCSessionId() {
2084
+ // Distinguish sessions by the parameter number
2085
+ return { parameter: this.parameter };
2086
+ }
2087
+ expectMoreMessages() {
2088
+ return this.reportsToFollow > 0;
2089
+ }
2090
+ mergePartialCCs(partials, _ctx) {
2091
+ // Concat the info
2092
+ this.info = [...partials, this]
2093
+ .map((report) => report.info)
2094
+ .reduce((prev, cur) => prev + cur, "");
2095
+ }
2096
+ toLogEntry(ctx) {
2097
+ return {
2098
+ ...super.toLogEntry(ctx),
2099
+ message: {
2100
+ "parameter #": this.parameter,
2101
+ info: this.info,
2102
+ "reports to follow": this.reportsToFollow,
2103
+ },
2104
+ };
2105
+ }
2106
+ };
2107
+ ConfigurationCCInfoReport = ConfigurationCCInfoReport_1 = __decorate([
2108
+ CCCommand(ConfigurationCommand.InfoReport)
2109
+ ], ConfigurationCCInfoReport);
2110
+ export { ConfigurationCCInfoReport };
2111
+ let ConfigurationCCInfoGet = ConfigurationCCInfoGet_1 = class ConfigurationCCInfoGet extends ConfigurationCC {
2112
+ constructor(options) {
2113
+ super(options);
2114
+ this.parameter = options.parameter;
2115
+ }
2116
+ static from(raw, ctx) {
2117
+ validatePayload(raw.payload.length >= 2);
2118
+ const parameter = raw.payload.readUInt16BE(0);
2119
+ return new ConfigurationCCInfoGet_1({
2120
+ nodeId: ctx.sourceNodeId,
2121
+ parameter,
2122
+ });
2123
+ }
2124
+ parameter;
2125
+ serialize(ctx) {
2126
+ this.payload = new Bytes(2);
2127
+ this.payload.writeUInt16BE(this.parameter, 0);
2128
+ return super.serialize(ctx);
2129
+ }
2130
+ toLogEntry(ctx) {
2131
+ return {
2132
+ ...super.toLogEntry(ctx),
2133
+ message: { "parameter #": this.parameter },
2134
+ };
2135
+ }
2136
+ };
2137
+ ConfigurationCCInfoGet = ConfigurationCCInfoGet_1 = __decorate([
2138
+ CCCommand(ConfigurationCommand.InfoGet),
2139
+ expectedCCResponse(ConfigurationCCInfoReport)
2140
+ ], ConfigurationCCInfoGet);
2141
+ export { ConfigurationCCInfoGet };
2142
+ let ConfigurationCCPropertiesReport = ConfigurationCCPropertiesReport_1 = class ConfigurationCCPropertiesReport extends ConfigurationCC {
2143
+ constructor(options) {
2144
+ super(options);
2145
+ this.parameter = options.parameter;
2146
+ this.valueSize = options.valueSize;
2147
+ this.valueFormat = options.valueFormat;
2148
+ if (this.valueSize > 0) {
2149
+ if (options.minValue == undefined) {
2150
+ throw new ZWaveError("The minimum value must be set when the value size is non-zero", ZWaveErrorCodes.Argument_Invalid);
2151
+ }
2152
+ else if (options.maxValue == undefined) {
2153
+ throw new ZWaveError("The maximum value must be set when the value size is non-zero", ZWaveErrorCodes.Argument_Invalid);
2154
+ }
2155
+ else if (options.defaultValue == undefined) {
2156
+ throw new ZWaveError("The default value must be set when the value size is non-zero", ZWaveErrorCodes.Argument_Invalid);
2157
+ }
2158
+ this.minValue = options.minValue;
2159
+ this.maxValue = options.maxValue;
2160
+ this.defaultValue = options.defaultValue;
2161
+ }
2162
+ this.nextParameter = options.nextParameter;
2163
+ this.altersCapabilities = options.altersCapabilities;
2164
+ this.isReadonly = options.isReadonly;
2165
+ this.isAdvanced = options.isAdvanced;
2166
+ this.noBulkSupport = options.noBulkSupport;
2167
+ }
2168
+ static from(raw, ctx) {
2169
+ validatePayload(raw.payload.length >= 3);
2170
+ const parameter = raw.payload.readUInt16BE(0);
2171
+ const valueFormat = (raw.payload[2] & 0b111000)
2172
+ >>> 3;
2173
+ const valueSize = raw.payload[2] & 0b111;
2174
+ // GH#1309 Some devices don't tell us the first parameter if we query #0
2175
+ // Instead, they contain 0x000000
2176
+ let nextParameter;
2177
+ if (valueSize === 0 && raw.payload.length < 5) {
2178
+ nextParameter = 0;
2179
+ return new ConfigurationCCPropertiesReport_1({
2180
+ nodeId: ctx.sourceNodeId,
2181
+ parameter,
2182
+ valueFormat,
2183
+ valueSize,
2184
+ nextParameter,
2185
+ });
2186
+ }
2187
+ // Ensure the payload contains the two bytes for next parameter
2188
+ const nextParameterOffset = 3 + 3 * valueSize;
2189
+ validatePayload(raw.payload.length >= nextParameterOffset + 2);
2190
+ let minValue;
2191
+ let maxValue;
2192
+ let defaultValue;
2193
+ if (valueSize > 0) {
2194
+ if (valueFormat === ConfigValueFormat.BitField) {
2195
+ minValue = 0;
2196
+ }
2197
+ else {
2198
+ minValue = parseValue(raw.payload.subarray(3), valueSize, valueFormat);
2199
+ }
2200
+ maxValue = parseValue(raw.payload.subarray(3 + valueSize), valueSize, valueFormat);
2201
+ defaultValue = parseValue(raw.payload.subarray(3 + 2 * valueSize), valueSize, valueFormat);
2202
+ }
2203
+ nextParameter = raw.payload.readUInt16BE(nextParameterOffset);
2204
+ let altersCapabilities;
2205
+ let isReadonly;
2206
+ let isAdvanced;
2207
+ let noBulkSupport;
2208
+ if (raw.payload.length >= nextParameterOffset + 3) {
2209
+ // V4 adds an options byte after the next parameter and two bits in byte 2
2210
+ const options1 = raw.payload[2];
2211
+ const options2 = raw.payload[3 + 3 * valueSize + 2];
2212
+ altersCapabilities = !!(options1 & 0b1000_0000);
2213
+ isReadonly = !!(options1 & 0b0100_0000);
2214
+ isAdvanced = !!(options2 & 0b1);
2215
+ noBulkSupport = !!(options2 & 0b10);
2216
+ }
2217
+ return new ConfigurationCCPropertiesReport_1({
2218
+ nodeId: ctx.sourceNodeId,
2219
+ parameter,
2220
+ valueFormat,
2221
+ valueSize,
2222
+ nextParameter,
2223
+ minValue,
2224
+ maxValue,
2225
+ defaultValue,
2226
+ altersCapabilities,
2227
+ isReadonly,
2228
+ isAdvanced,
2229
+ noBulkSupport,
2230
+ });
2231
+ }
2232
+ persistValues(ctx) {
2233
+ if (!super.persistValues(ctx))
2234
+ return false;
2235
+ // If we actually received parameter info, store it
2236
+ if (this.valueSize > 0) {
2237
+ const baseInfo = {
2238
+ type: "number",
2239
+ format: this.valueFormat,
2240
+ valueSize: this.valueSize,
2241
+ requiresReInclusion: this.altersCapabilities,
2242
+ readable: true,
2243
+ writeable: !this.isReadonly,
2244
+ allowManualEntry: true,
2245
+ isAdvanced: this.isAdvanced,
2246
+ noBulkSupport: this.noBulkSupport,
2247
+ isFromConfig: false,
2248
+ };
2249
+ if (this.valueFormat !== ConfigValueFormat.BitField) {
2250
+ // Do not override param information from a config file
2251
+ if (!this.paramExistsInConfigFile(ctx, this.parameter)) {
2252
+ const paramInfo = stripUndefined({
2253
+ ...baseInfo,
2254
+ min: this.minValue,
2255
+ max: this.maxValue,
2256
+ default: this.defaultValue,
2257
+ });
2258
+ this.extendParamInformation(ctx, this.parameter, undefined, paramInfo);
2259
+ }
2260
+ }
2261
+ else {
2262
+ // Bit fields are split into multiple single-bit partial parameters
2263
+ const bits = this.maxValue;
2264
+ let mask = 1;
2265
+ while (mask <= bits) {
2266
+ if (
2267
+ // Only create partials that exist
2268
+ !!(mask & bits)
2269
+ // Do not override param information from a config file
2270
+ && !this.paramExistsInConfigFile(ctx, this.parameter, mask)) {
2271
+ const paramInfo = stripUndefined({
2272
+ ...baseInfo,
2273
+ min: 0,
2274
+ max: 1,
2275
+ default: this.defaultValue & mask ? 1 : 0,
2276
+ });
2277
+ this.extendParamInformation(ctx, this.parameter, mask, paramInfo);
2278
+ }
2279
+ // We must use multiplication here, as bitwise shifting works on signed 32-bit integers in JS
2280
+ // which would create an infinite loop if maxValue === 0xffff_ffff
2281
+ mask *= 2;
2282
+ }
2283
+ }
2284
+ }
2285
+ return true;
2286
+ }
2287
+ parameter;
2288
+ valueSize;
2289
+ valueFormat;
2290
+ minValue;
2291
+ maxValue;
2292
+ defaultValue;
2293
+ nextParameter;
2294
+ altersCapabilities;
2295
+ isReadonly;
2296
+ isAdvanced;
2297
+ noBulkSupport;
2298
+ serialize(ctx) {
2299
+ this.payload = new Bytes(3 // preamble
2300
+ + 3 * this.valueSize // min, max, default value
2301
+ + 2 // next parameter
2302
+ + 1);
2303
+ this.payload.writeUInt16BE(this.parameter, 0);
2304
+ const options1 = (this.altersCapabilities ? 0b1000_0000 : 0)
2305
+ | (this.isReadonly ? 0b0100_0000 : 0)
2306
+ | ((this.valueFormat & 0b111) << 3)
2307
+ | (this.valueSize & 0b111);
2308
+ this.payload[2] = options1;
2309
+ let offset = 3;
2310
+ if (this.valueSize > 0) {
2311
+ serializeValue(this.payload, offset, this.valueSize, this.valueFormat, this.minValue);
2312
+ offset += this.valueSize;
2313
+ serializeValue(this.payload, offset, this.valueSize, this.valueFormat, this.maxValue);
2314
+ offset += this.valueSize;
2315
+ serializeValue(this.payload, offset, this.valueSize, this.valueFormat, this.defaultValue);
2316
+ offset += this.valueSize;
2317
+ }
2318
+ this.payload.writeUInt16BE(this.nextParameter, offset);
2319
+ offset += 2;
2320
+ const options2 = (this.isAdvanced ? 0b1 : 0)
2321
+ | (this.noBulkSupport ? 0b10 : 0);
2322
+ this.payload[offset] = options2;
2323
+ return super.serialize(ctx);
2324
+ }
2325
+ toLogEntry(ctx) {
2326
+ const message = {
2327
+ "parameter #": this.parameter,
2328
+ "next param #": this.nextParameter,
2329
+ "value size": this.valueSize,
2330
+ "value format": getEnumMemberName(ConfigValueFormat, this.valueFormat),
2331
+ };
2332
+ if (this.minValue != undefined) {
2333
+ message["min value"] = configValueToString(this.minValue);
2334
+ }
2335
+ if (this.maxValue != undefined) {
2336
+ message["max value"] = configValueToString(this.maxValue);
2337
+ }
2338
+ if (this.defaultValue != undefined) {
2339
+ message["default value"] = configValueToString(this.defaultValue);
2340
+ }
2341
+ if (this.altersCapabilities != undefined) {
2342
+ message["alters capabilities"] = this.altersCapabilities;
2343
+ }
2344
+ if (this.isReadonly != undefined) {
2345
+ message.readonly = this.isReadonly;
2346
+ }
2347
+ if (this.isAdvanced != undefined) {
2348
+ message.advanced = this.isAdvanced;
2349
+ }
2350
+ if (this.noBulkSupport != undefined) {
2351
+ message["bulk support"] = !this.noBulkSupport;
2352
+ }
2353
+ return {
2354
+ ...super.toLogEntry(ctx),
2355
+ message,
2356
+ };
2357
+ }
2358
+ };
2359
+ ConfigurationCCPropertiesReport = ConfigurationCCPropertiesReport_1 = __decorate([
2360
+ CCCommand(ConfigurationCommand.PropertiesReport)
2361
+ ], ConfigurationCCPropertiesReport);
2362
+ export { ConfigurationCCPropertiesReport };
2363
+ let ConfigurationCCPropertiesGet = ConfigurationCCPropertiesGet_1 = class ConfigurationCCPropertiesGet extends ConfigurationCC {
2364
+ constructor(options) {
2365
+ super(options);
2366
+ this.parameter = options.parameter;
2367
+ }
2368
+ static from(raw, ctx) {
2369
+ validatePayload(raw.payload.length >= 2);
2370
+ const parameter = raw.payload.readUInt16BE(0);
2371
+ return new ConfigurationCCPropertiesGet_1({
2372
+ nodeId: ctx.sourceNodeId,
2373
+ parameter,
2374
+ });
2375
+ }
2376
+ parameter;
2377
+ serialize(ctx) {
2378
+ this.payload = new Bytes(2);
2379
+ this.payload.writeUInt16BE(this.parameter, 0);
2380
+ return super.serialize(ctx);
2381
+ }
2382
+ toLogEntry(ctx) {
2383
+ return {
2384
+ ...super.toLogEntry(ctx),
2385
+ message: { "parameter #": this.parameter },
2386
+ };
2387
+ }
2388
+ };
2389
+ ConfigurationCCPropertiesGet = ConfigurationCCPropertiesGet_1 = __decorate([
2390
+ CCCommand(ConfigurationCommand.PropertiesGet),
2391
+ expectedCCResponse(ConfigurationCCPropertiesReport)
2392
+ ], ConfigurationCCPropertiesGet);
2393
+ export { ConfigurationCCPropertiesGet };
2394
+ let ConfigurationCCDefaultReset = class ConfigurationCCDefaultReset extends ConfigurationCC {
2395
+ };
2396
+ ConfigurationCCDefaultReset = __decorate([
2397
+ CCCommand(ConfigurationCommand.DefaultReset)
2398
+ ], ConfigurationCCDefaultReset);
2399
+ export { ConfigurationCCDefaultReset };
2400
+ function isSafeValue(value, size, format) {
2401
+ let minValue;
2402
+ let maxValue;
2403
+ switch (format) {
2404
+ case ConfigValueFormat.SignedInteger:
2405
+ minValue = -Math.pow(2, 8 * size - 1);
2406
+ maxValue = Math.pow(2, 8 * size - 1) - 1;
2407
+ break;
2408
+ case ConfigValueFormat.UnsignedInteger:
2409
+ case ConfigValueFormat.Enumerated:
2410
+ case ConfigValueFormat.BitField:
2411
+ minValue = 0;
2412
+ maxValue = Math.pow(2, 8 * size);
2413
+ break;
2414
+ default:
2415
+ throw new Error("not implemented");
2416
+ }
2417
+ return minValue <= value && value <= maxValue;
2418
+ }
2419
+ /** Interprets values from the payload depending on the value format */
2420
+ function parseValue(raw, size, format) {
2421
+ switch (format) {
2422
+ case ConfigValueFormat.SignedInteger:
2423
+ return raw.readIntBE(0, size);
2424
+ case ConfigValueFormat.UnsignedInteger:
2425
+ case ConfigValueFormat.Enumerated:
2426
+ case ConfigValueFormat.BitField:
2427
+ return raw.readUIntBE(0, size);
2428
+ }
2429
+ }
2430
+ function throwInvalidValueError(value, parameter, valueSize, valueFormat) {
2431
+ throw new ZWaveError(`The value ${value} is invalid for configuration parameter ${parameter} (size = ${valueSize}, format = ${getEnumMemberName(ConfigValueFormat, valueFormat)})!`, ZWaveErrorCodes.Argument_Invalid);
2432
+ }
2433
+ function tryCatchOutOfBoundsError(e, value, parameter, valueSize, valueFormat) {
2434
+ if (e.message.includes("out of bounds")) {
2435
+ throwInvalidValueError(value, parameter, valueSize, valueFormat);
2436
+ }
2437
+ else {
2438
+ throw e;
2439
+ }
2440
+ }
2441
+ /** Serializes values into the payload according to the value format */
2442
+ function serializeValue(payload, offset, size, format, value) {
2443
+ switch (format) {
2444
+ case ConfigValueFormat.SignedInteger:
2445
+ payload.writeIntBE(value, offset, size);
2446
+ return;
2447
+ case ConfigValueFormat.UnsignedInteger:
2448
+ case ConfigValueFormat.Enumerated:
2449
+ case ConfigValueFormat.BitField:
2450
+ payload.writeUIntBE(value, offset, size);
2451
+ return;
2452
+ }
2453
+ }
2454
+ //# sourceMappingURL=ConfigurationCC.js.map