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

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