@zwave-js/cc 14.3.10 → 15.0.0-beta.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (461) hide show
  1. package/build/cjs/cc/AlarmSensorCC.d.ts +139 -57
  2. package/build/cjs/cc/AlarmSensorCC.js.map +2 -2
  3. package/build/cjs/cc/AssociationCC.d.ts +178 -43
  4. package/build/cjs/cc/AssociationCC.js +0 -4
  5. package/build/cjs/cc/AssociationCC.js.map +2 -2
  6. package/build/cjs/cc/AssociationGroupInfoCC.d.ts +138 -38
  7. package/build/cjs/cc/AssociationGroupInfoCC.js.map +2 -2
  8. package/build/cjs/cc/BarrierOperatorCC.d.ts +275 -73
  9. package/build/cjs/cc/BarrierOperatorCC.js.map +2 -2
  10. package/build/cjs/cc/BasicCC.d.ts +316 -71
  11. package/build/cjs/cc/BasicCC.js.map +2 -2
  12. package/build/cjs/cc/BatteryCC.d.ts +759 -164
  13. package/build/cjs/cc/BatteryCC.js.map +2 -2
  14. package/build/cjs/cc/BinarySensorCC.d.ts +91 -26
  15. package/build/cjs/cc/BinarySensorCC.js.map +2 -2
  16. package/build/cjs/cc/BinarySwitchCC.d.ts +190 -38
  17. package/build/cjs/cc/BinarySwitchCC.js.map +2 -2
  18. package/build/cjs/cc/CRC16CC.d.ts +4 -8
  19. package/build/cjs/cc/CRC16CC.js +4 -27
  20. package/build/cjs/cc/CRC16CC.js.map +2 -2
  21. package/build/cjs/cc/CentralSceneCC.d.ts +272 -53
  22. package/build/cjs/cc/CentralSceneCC.js.map +2 -2
  23. package/build/cjs/cc/ClimateControlScheduleCC.d.ts +150 -37
  24. package/build/cjs/cc/ClimateControlScheduleCC.js.map +2 -2
  25. package/build/cjs/cc/ClockCC.d.ts +3 -3
  26. package/build/cjs/cc/ClockCC.js.map +2 -2
  27. package/build/cjs/cc/ColorSwitchCC.d.ts +423 -96
  28. package/build/cjs/cc/ColorSwitchCC.js.map +2 -2
  29. package/build/cjs/cc/ConfigurationCC._validateArgs.js +1 -1
  30. package/build/cjs/cc/ConfigurationCC._validateArgs.js.map +1 -1
  31. package/build/cjs/cc/ConfigurationCC.d.ts +101 -37
  32. package/build/cjs/cc/ConfigurationCC.js +0 -8
  33. package/build/cjs/cc/ConfigurationCC.js.map +2 -2
  34. package/build/cjs/cc/DeviceResetLocallyCC.d.ts +1 -1
  35. package/build/cjs/cc/DeviceResetLocallyCC.js.map +2 -2
  36. package/build/cjs/cc/DoorLockCC._validateArgs.js +1 -1
  37. package/build/cjs/cc/DoorLockCC._validateArgs.js.map +1 -1
  38. package/build/cjs/cc/DoorLockCC.d.ts +1731 -419
  39. package/build/cjs/cc/DoorLockCC.js.map +2 -2
  40. package/build/cjs/cc/DoorLockLoggingCC.d.ts +64 -12
  41. package/build/cjs/cc/DoorLockLoggingCC.js.map +2 -2
  42. package/build/cjs/cc/EnergyProductionCC.d.ts +29 -14
  43. package/build/cjs/cc/EnergyProductionCC.js.map +2 -2
  44. package/build/cjs/cc/EntryControlCC.d.ts +308 -57
  45. package/build/cjs/cc/EntryControlCC.js.map +2 -2
  46. package/build/cjs/cc/FirmwareUpdateMetaDataCC._validateArgs.d.ts +2 -0
  47. package/build/cjs/cc/FirmwareUpdateMetaDataCC._validateArgs.js +26 -0
  48. package/build/cjs/cc/FirmwareUpdateMetaDataCC._validateArgs.js.map +1 -1
  49. package/build/cjs/cc/FirmwareUpdateMetaDataCC.d.ts +389 -64
  50. package/build/cjs/cc/FirmwareUpdateMetaDataCC.js +154 -8
  51. package/build/cjs/cc/FirmwareUpdateMetaDataCC.js.map +2 -2
  52. package/build/cjs/cc/HumidityControlModeCC.d.ts +125 -27
  53. package/build/cjs/cc/HumidityControlModeCC.js.map +2 -2
  54. package/build/cjs/cc/HumidityControlOperatingStateCC.d.ts +64 -18
  55. package/build/cjs/cc/HumidityControlOperatingStateCC.js.map +2 -2
  56. package/build/cjs/cc/HumidityControlSetpointCC.d.ts +116 -39
  57. package/build/cjs/cc/HumidityControlSetpointCC.js.map +2 -2
  58. package/build/cjs/cc/InclusionControllerCC.d.ts +4 -4
  59. package/build/cjs/cc/InclusionControllerCC.js.map +2 -2
  60. package/build/cjs/cc/IndicatorCC.d.ts +325 -83
  61. package/build/cjs/cc/IndicatorCC.js.map +2 -2
  62. package/build/cjs/cc/IrrigationCC.d.ts +2170 -683
  63. package/build/cjs/cc/IrrigationCC.js.map +2 -2
  64. package/build/cjs/cc/LanguageCC.d.ts +128 -26
  65. package/build/cjs/cc/LanguageCC.js.map +2 -2
  66. package/build/cjs/cc/LockCC.d.ts +64 -14
  67. package/build/cjs/cc/LockCC.js.map +2 -2
  68. package/build/cjs/cc/ManufacturerProprietaryCC.d.ts +2 -2
  69. package/build/cjs/cc/ManufacturerProprietaryCC.js.map +2 -2
  70. package/build/cjs/cc/ManufacturerSpecificCC.d.ts +219 -57
  71. package/build/cjs/cc/ManufacturerSpecificCC.js.map +2 -2
  72. package/build/cjs/cc/MeterCC.d.ts +364 -89
  73. package/build/cjs/cc/MeterCC.js.map +2 -2
  74. package/build/cjs/cc/MultiChannelAssociationCC.d.ts +138 -40
  75. package/build/cjs/cc/MultiChannelAssociationCC.js +0 -5
  76. package/build/cjs/cc/MultiChannelAssociationCC.js.map +2 -2
  77. package/build/cjs/cc/MultiChannelCC.d.ts +469 -99
  78. package/build/cjs/cc/MultiChannelCC.js +8 -72
  79. package/build/cjs/cc/MultiChannelCC.js.map +2 -2
  80. package/build/cjs/cc/MultiCommandCC.d.ts +4 -8
  81. package/build/cjs/cc/MultiCommandCC.js +4 -37
  82. package/build/cjs/cc/MultiCommandCC.js.map +2 -2
  83. package/build/cjs/cc/MultilevelSensorCC.d.ts +118 -33
  84. package/build/cjs/cc/MultilevelSensorCC.js.map +2 -2
  85. package/build/cjs/cc/MultilevelSwitchCC.d.ts +490 -125
  86. package/build/cjs/cc/MultilevelSwitchCC.js.map +2 -2
  87. package/build/cjs/cc/NodeNamingCC.d.ts +128 -26
  88. package/build/cjs/cc/NodeNamingCC.js.map +2 -2
  89. package/build/cjs/cc/NotificationCC.d.ts +603 -161
  90. package/build/cjs/cc/NotificationCC.js +12 -1
  91. package/build/cjs/cc/NotificationCC.js.map +2 -2
  92. package/build/cjs/cc/PowerlevelCC.d.ts +6 -6
  93. package/build/cjs/cc/PowerlevelCC.js.map +2 -2
  94. package/build/cjs/cc/ProtectionCC.d.ts +496 -94
  95. package/build/cjs/cc/ProtectionCC.js.map +2 -2
  96. package/build/cjs/cc/SceneActivationCC.d.ts +127 -28
  97. package/build/cjs/cc/SceneActivationCC.js.map +2 -2
  98. package/build/cjs/cc/SceneActuatorConfigurationCC.d.ts +52 -25
  99. package/build/cjs/cc/SceneActuatorConfigurationCC.js.map +2 -2
  100. package/build/cjs/cc/SceneControllerConfigurationCC.d.ts +53 -25
  101. package/build/cjs/cc/SceneControllerConfigurationCC.js.map +2 -2
  102. package/build/cjs/cc/ScheduleEntryLockCC.d.ts +268 -64
  103. package/build/cjs/cc/ScheduleEntryLockCC.js.map +2 -2
  104. package/build/cjs/cc/Security2CC.d.ts +15 -21
  105. package/build/cjs/cc/Security2CC.js +32 -347
  106. package/build/cjs/cc/Security2CC.js.map +3 -3
  107. package/build/cjs/cc/SecurityCC.d.ts +12 -19
  108. package/build/cjs/cc/SecurityCC.js +12 -106
  109. package/build/cjs/cc/SecurityCC.js.map +2 -2
  110. package/build/cjs/cc/SoundSwitchCC.d.ts +253 -64
  111. package/build/cjs/cc/SoundSwitchCC.js.map +2 -2
  112. package/build/cjs/cc/SupervisionCC.d.ts +28 -16
  113. package/build/cjs/cc/SupervisionCC.js +4 -29
  114. package/build/cjs/cc/SupervisionCC.js.map +2 -2
  115. package/build/cjs/cc/ThermostatFanModeCC.d.ts +187 -38
  116. package/build/cjs/cc/ThermostatFanModeCC.js.map +2 -2
  117. package/build/cjs/cc/ThermostatFanStateCC.d.ts +64 -18
  118. package/build/cjs/cc/ThermostatFanStateCC.js.map +2 -2
  119. package/build/cjs/cc/ThermostatModeCC.d.ts +189 -40
  120. package/build/cjs/cc/ThermostatModeCC.js.map +2 -2
  121. package/build/cjs/cc/ThermostatOperatingStateCC.d.ts +65 -19
  122. package/build/cjs/cc/ThermostatOperatingStateCC.js.map +2 -2
  123. package/build/cjs/cc/ThermostatSetbackCC.d.ts +4 -4
  124. package/build/cjs/cc/ThermostatSetbackCC.js.map +2 -2
  125. package/build/cjs/cc/ThermostatSetpointCC.d.ts +116 -36
  126. package/build/cjs/cc/ThermostatSetpointCC.js.map +2 -2
  127. package/build/cjs/cc/TimeCC.d.ts +6 -6
  128. package/build/cjs/cc/TimeCC.js.map +2 -2
  129. package/build/cjs/cc/TimeParametersCC.d.ts +63 -12
  130. package/build/cjs/cc/TimeParametersCC.js.map +2 -2
  131. package/build/cjs/cc/TransportServiceCC.d.ts +7 -12
  132. package/build/cjs/cc/TransportServiceCC.js +3 -20
  133. package/build/cjs/cc/TransportServiceCC.js.map +2 -2
  134. package/build/cjs/cc/UserCodeCC._validateArgs.js +1 -1
  135. package/build/cjs/cc/UserCodeCC._validateArgs.js.map +1 -1
  136. package/build/cjs/cc/UserCodeCC.d.ts +931 -176
  137. package/build/cjs/cc/UserCodeCC.js.map +2 -2
  138. package/build/cjs/cc/VersionCC.d.ts +897 -185
  139. package/build/cjs/cc/VersionCC.js.map +2 -2
  140. package/build/cjs/cc/WakeUpCC.d.ts +190 -38
  141. package/build/cjs/cc/WakeUpCC.js.map +2 -2
  142. package/build/cjs/cc/WindowCoveringCC.d.ts +193 -103
  143. package/build/cjs/cc/WindowCoveringCC.js.map +2 -2
  144. package/build/cjs/cc/ZWavePlusCC.d.ts +311 -51
  145. package/build/cjs/cc/ZWavePlusCC.js.map +2 -2
  146. package/build/cjs/cc/ZWaveProtocolCC.d.ts +28 -28
  147. package/build/cjs/cc/ZWaveProtocolCC.js.map +2 -2
  148. package/build/cjs/cc/manufacturerProprietary/FibaroCC.d.ts +4 -4
  149. package/build/cjs/cc/manufacturerProprietary/FibaroCC.js.map +2 -2
  150. package/build/cjs/index.d.ts +1 -0
  151. package/build/cjs/index.js.map +1 -1
  152. package/build/cjs/index_browser.d.ts +9 -0
  153. package/build/cjs/index_browser.js +41 -1
  154. package/build/cjs/index_browser.js.map +2 -2
  155. package/build/cjs/lib/API.d.ts +7 -5
  156. package/build/cjs/lib/API.js +1 -1
  157. package/build/cjs/lib/API.js.map +2 -2
  158. package/build/cjs/lib/CommandClass.d.ts +10 -21
  159. package/build/cjs/lib/CommandClass.js +51 -106
  160. package/build/cjs/lib/CommandClass.js.map +3 -3
  161. package/build/cjs/lib/CommandClassDecorators.d.ts +1 -1
  162. package/build/cjs/lib/CommandClassDecorators.js +3 -3
  163. package/build/cjs/lib/CommandClassDecorators.js.map +2 -2
  164. package/build/cjs/lib/Values.d.ts +2 -2
  165. package/build/cjs/lib/Values.js.map +2 -2
  166. package/build/cjs/lib/traits.d.ts +94 -0
  167. package/build/cjs/lib/traits.js +17 -0
  168. package/build/cjs/lib/traits.js.map +7 -0
  169. package/build/cjs/lib/utils.d.ts +2 -2
  170. package/build/cjs/lib/utils.js.map +2 -2
  171. package/build/esm/cc/AlarmSensorCC.d.ts +139 -57
  172. package/build/esm/cc/AlarmSensorCC.d.ts.map +1 -1
  173. package/build/esm/cc/AlarmSensorCC.js +0 -1
  174. package/build/esm/cc/AlarmSensorCC.js.map +1 -1
  175. package/build/esm/cc/AssociationCC.d.ts +178 -43
  176. package/build/esm/cc/AssociationCC.d.ts.map +1 -1
  177. package/build/esm/cc/AssociationCC.js +0 -13
  178. package/build/esm/cc/AssociationCC.js.map +1 -1
  179. package/build/esm/cc/AssociationGroupInfoCC.d.ts +138 -38
  180. package/build/esm/cc/AssociationGroupInfoCC.d.ts.map +1 -1
  181. package/build/esm/cc/AssociationGroupInfoCC.js +0 -6
  182. package/build/esm/cc/AssociationGroupInfoCC.js.map +1 -1
  183. package/build/esm/cc/BarrierOperatorCC.d.ts +275 -73
  184. package/build/esm/cc/BarrierOperatorCC.d.ts.map +1 -1
  185. package/build/esm/cc/BarrierOperatorCC.js +0 -3
  186. package/build/esm/cc/BarrierOperatorCC.js.map +1 -1
  187. package/build/esm/cc/BasicCC.d.ts +316 -71
  188. package/build/esm/cc/BasicCC.d.ts.map +1 -1
  189. package/build/esm/cc/BasicCC.js +0 -2
  190. package/build/esm/cc/BasicCC.js.map +1 -1
  191. package/build/esm/cc/BatteryCC.d.ts +759 -164
  192. package/build/esm/cc/BatteryCC.d.ts.map +1 -1
  193. package/build/esm/cc/BatteryCC.js +1 -2
  194. package/build/esm/cc/BatteryCC.js.map +1 -1
  195. package/build/esm/cc/BinarySensorCC.d.ts +91 -26
  196. package/build/esm/cc/BinarySensorCC.d.ts.map +1 -1
  197. package/build/esm/cc/BinarySensorCC.js +0 -3
  198. package/build/esm/cc/BinarySensorCC.js.map +1 -1
  199. package/build/esm/cc/BinarySwitchCC.d.ts +190 -38
  200. package/build/esm/cc/BinarySwitchCC.d.ts.map +1 -1
  201. package/build/esm/cc/BinarySwitchCC.js +0 -2
  202. package/build/esm/cc/BinarySwitchCC.js.map +1 -1
  203. package/build/esm/cc/CRC16CC.d.ts +4 -8
  204. package/build/esm/cc/CRC16CC.d.ts.map +1 -1
  205. package/build/esm/cc/CRC16CC.js +4 -34
  206. package/build/esm/cc/CRC16CC.js.map +1 -1
  207. package/build/esm/cc/CentralSceneCC.d.ts +272 -53
  208. package/build/esm/cc/CentralSceneCC.d.ts.map +1 -1
  209. package/build/esm/cc/CentralSceneCC.js +0 -1
  210. package/build/esm/cc/CentralSceneCC.js.map +1 -1
  211. package/build/esm/cc/ClimateControlScheduleCC.d.ts +150 -37
  212. package/build/esm/cc/ClimateControlScheduleCC.d.ts.map +1 -1
  213. package/build/esm/cc/ClimateControlScheduleCC.js +0 -3
  214. package/build/esm/cc/ClimateControlScheduleCC.js.map +1 -1
  215. package/build/esm/cc/ClockCC.d.ts +3 -3
  216. package/build/esm/cc/ClockCC.d.ts.map +1 -1
  217. package/build/esm/cc/ClockCC.js +0 -1
  218. package/build/esm/cc/ClockCC.js.map +1 -1
  219. package/build/esm/cc/ColorSwitchCC.d.ts +423 -96
  220. package/build/esm/cc/ColorSwitchCC.d.ts.map +1 -1
  221. package/build/esm/cc/ColorSwitchCC.js +0 -6
  222. package/build/esm/cc/ColorSwitchCC.js.map +1 -1
  223. package/build/esm/cc/ConfigurationCC._validateArgs.js +1 -1
  224. package/build/esm/cc/ConfigurationCC._validateArgs.js.map +1 -1
  225. package/build/esm/cc/ConfigurationCC.d.ts +101 -37
  226. package/build/esm/cc/ConfigurationCC.d.ts.map +1 -1
  227. package/build/esm/cc/ConfigurationCC.js +0 -25
  228. package/build/esm/cc/ConfigurationCC.js.map +1 -1
  229. package/build/esm/cc/DeviceResetLocallyCC.d.ts +1 -1
  230. package/build/esm/cc/DeviceResetLocallyCC.d.ts.map +1 -1
  231. package/build/esm/cc/DeviceResetLocallyCC.js.map +1 -1
  232. package/build/esm/cc/DoorLockCC._validateArgs.js +1 -1
  233. package/build/esm/cc/DoorLockCC._validateArgs.js.map +1 -1
  234. package/build/esm/cc/DoorLockCC.d.ts +1731 -419
  235. package/build/esm/cc/DoorLockCC.d.ts.map +1 -1
  236. package/build/esm/cc/DoorLockCC.js +0 -2
  237. package/build/esm/cc/DoorLockCC.js.map +1 -1
  238. package/build/esm/cc/DoorLockLoggingCC.d.ts +64 -12
  239. package/build/esm/cc/DoorLockLoggingCC.d.ts.map +1 -1
  240. package/build/esm/cc/DoorLockLoggingCC.js +0 -1
  241. package/build/esm/cc/DoorLockLoggingCC.js.map +1 -1
  242. package/build/esm/cc/EnergyProductionCC.d.ts +29 -14
  243. package/build/esm/cc/EnergyProductionCC.d.ts.map +1 -1
  244. package/build/esm/cc/EnergyProductionCC.js +0 -2
  245. package/build/esm/cc/EnergyProductionCC.js.map +1 -1
  246. package/build/esm/cc/EntryControlCC.d.ts +308 -57
  247. package/build/esm/cc/EntryControlCC.d.ts.map +1 -1
  248. package/build/esm/cc/EntryControlCC.js +0 -1
  249. package/build/esm/cc/EntryControlCC.js.map +1 -1
  250. package/build/esm/cc/FirmwareUpdateMetaDataCC._validateArgs.d.ts +2 -0
  251. package/build/esm/cc/FirmwareUpdateMetaDataCC._validateArgs.d.ts.map +1 -1
  252. package/build/esm/cc/FirmwareUpdateMetaDataCC._validateArgs.js +20 -0
  253. package/build/esm/cc/FirmwareUpdateMetaDataCC._validateArgs.js.map +1 -1
  254. package/build/esm/cc/FirmwareUpdateMetaDataCC.d.ts +389 -64
  255. package/build/esm/cc/FirmwareUpdateMetaDataCC.d.ts.map +1 -1
  256. package/build/esm/cc/FirmwareUpdateMetaDataCC.js +158 -30
  257. package/build/esm/cc/FirmwareUpdateMetaDataCC.js.map +1 -1
  258. package/build/esm/cc/HumidityControlModeCC.d.ts +125 -27
  259. package/build/esm/cc/HumidityControlModeCC.d.ts.map +1 -1
  260. package/build/esm/cc/HumidityControlModeCC.js +0 -1
  261. package/build/esm/cc/HumidityControlModeCC.js.map +1 -1
  262. package/build/esm/cc/HumidityControlOperatingStateCC.d.ts +64 -18
  263. package/build/esm/cc/HumidityControlOperatingStateCC.d.ts.map +1 -1
  264. package/build/esm/cc/HumidityControlOperatingStateCC.js.map +1 -1
  265. package/build/esm/cc/HumidityControlSetpointCC.d.ts +116 -39
  266. package/build/esm/cc/HumidityControlSetpointCC.d.ts.map +1 -1
  267. package/build/esm/cc/HumidityControlSetpointCC.js +0 -4
  268. package/build/esm/cc/HumidityControlSetpointCC.js.map +1 -1
  269. package/build/esm/cc/InclusionControllerCC.d.ts +4 -4
  270. package/build/esm/cc/InclusionControllerCC.d.ts.map +1 -1
  271. package/build/esm/cc/InclusionControllerCC.js +0 -2
  272. package/build/esm/cc/InclusionControllerCC.js.map +1 -1
  273. package/build/esm/cc/IndicatorCC.d.ts +325 -83
  274. package/build/esm/cc/IndicatorCC.d.ts.map +1 -1
  275. package/build/esm/cc/IndicatorCC.js +0 -7
  276. package/build/esm/cc/IndicatorCC.js.map +1 -1
  277. package/build/esm/cc/IrrigationCC.d.ts +2170 -683
  278. package/build/esm/cc/IrrigationCC.d.ts.map +1 -1
  279. package/build/esm/cc/IrrigationCC.js +0 -9
  280. package/build/esm/cc/IrrigationCC.js.map +1 -1
  281. package/build/esm/cc/LanguageCC.d.ts +128 -26
  282. package/build/esm/cc/LanguageCC.d.ts.map +1 -1
  283. package/build/esm/cc/LanguageCC.js +0 -1
  284. package/build/esm/cc/LanguageCC.js.map +1 -1
  285. package/build/esm/cc/LockCC.d.ts +64 -14
  286. package/build/esm/cc/LockCC.d.ts.map +1 -1
  287. package/build/esm/cc/LockCC.js +0 -1
  288. package/build/esm/cc/LockCC.js.map +1 -1
  289. package/build/esm/cc/ManufacturerProprietaryCC.d.ts +2 -2
  290. package/build/esm/cc/ManufacturerProprietaryCC.d.ts.map +1 -1
  291. package/build/esm/cc/ManufacturerProprietaryCC.js +0 -1
  292. package/build/esm/cc/ManufacturerProprietaryCC.js.map +1 -1
  293. package/build/esm/cc/ManufacturerSpecificCC.d.ts +219 -57
  294. package/build/esm/cc/ManufacturerSpecificCC.d.ts.map +1 -1
  295. package/build/esm/cc/ManufacturerSpecificCC.js +0 -2
  296. package/build/esm/cc/ManufacturerSpecificCC.js.map +1 -1
  297. package/build/esm/cc/MeterCC.d.ts +364 -89
  298. package/build/esm/cc/MeterCC.d.ts.map +1 -1
  299. package/build/esm/cc/MeterCC.js +0 -4
  300. package/build/esm/cc/MeterCC.js.map +1 -1
  301. package/build/esm/cc/MultiChannelAssociationCC.d.ts +138 -40
  302. package/build/esm/cc/MultiChannelAssociationCC.d.ts.map +1 -1
  303. package/build/esm/cc/MultiChannelAssociationCC.js +0 -16
  304. package/build/esm/cc/MultiChannelAssociationCC.js.map +1 -1
  305. package/build/esm/cc/MultiChannelCC.d.ts +469 -99
  306. package/build/esm/cc/MultiChannelCC.d.ts.map +1 -1
  307. package/build/esm/cc/MultiChannelCC.js +8 -101
  308. package/build/esm/cc/MultiChannelCC.js.map +1 -1
  309. package/build/esm/cc/MultiCommandCC.d.ts +4 -8
  310. package/build/esm/cc/MultiCommandCC.d.ts.map +1 -1
  311. package/build/esm/cc/MultiCommandCC.js +4 -38
  312. package/build/esm/cc/MultiCommandCC.js.map +1 -1
  313. package/build/esm/cc/MultilevelSensorCC.d.ts +118 -33
  314. package/build/esm/cc/MultilevelSensorCC.d.ts.map +1 -1
  315. package/build/esm/cc/MultilevelSensorCC.js +0 -5
  316. package/build/esm/cc/MultilevelSensorCC.js.map +1 -1
  317. package/build/esm/cc/MultilevelSwitchCC.d.ts +490 -125
  318. package/build/esm/cc/MultilevelSwitchCC.d.ts.map +1 -1
  319. package/build/esm/cc/MultilevelSwitchCC.js +0 -4
  320. package/build/esm/cc/MultilevelSwitchCC.js.map +1 -1
  321. package/build/esm/cc/NodeNamingCC.d.ts +128 -26
  322. package/build/esm/cc/NodeNamingCC.d.ts.map +1 -1
  323. package/build/esm/cc/NodeNamingCC.js +0 -2
  324. package/build/esm/cc/NodeNamingCC.js.map +1 -1
  325. package/build/esm/cc/NotificationCC.d.ts +603 -161
  326. package/build/esm/cc/NotificationCC.d.ts.map +1 -1
  327. package/build/esm/cc/NotificationCC.js +18 -12
  328. package/build/esm/cc/NotificationCC.js.map +1 -1
  329. package/build/esm/cc/PowerlevelCC.d.ts +6 -6
  330. package/build/esm/cc/PowerlevelCC.d.ts.map +1 -1
  331. package/build/esm/cc/PowerlevelCC.js +0 -4
  332. package/build/esm/cc/PowerlevelCC.js.map +1 -1
  333. package/build/esm/cc/ProtectionCC.d.ts +496 -94
  334. package/build/esm/cc/ProtectionCC.d.ts.map +1 -1
  335. package/build/esm/cc/ProtectionCC.js +0 -3
  336. package/build/esm/cc/ProtectionCC.js.map +1 -1
  337. package/build/esm/cc/SceneActivationCC.d.ts +127 -28
  338. package/build/esm/cc/SceneActivationCC.d.ts.map +1 -1
  339. package/build/esm/cc/SceneActivationCC.js +0 -1
  340. package/build/esm/cc/SceneActivationCC.js.map +1 -1
  341. package/build/esm/cc/SceneActuatorConfigurationCC.d.ts +52 -25
  342. package/build/esm/cc/SceneActuatorConfigurationCC.d.ts.map +1 -1
  343. package/build/esm/cc/SceneActuatorConfigurationCC.js +0 -2
  344. package/build/esm/cc/SceneActuatorConfigurationCC.js.map +1 -1
  345. package/build/esm/cc/SceneControllerConfigurationCC.d.ts +53 -25
  346. package/build/esm/cc/SceneControllerConfigurationCC.d.ts.map +1 -1
  347. package/build/esm/cc/SceneControllerConfigurationCC.js +0 -2
  348. package/build/esm/cc/SceneControllerConfigurationCC.js.map +1 -1
  349. package/build/esm/cc/ScheduleEntryLockCC.d.ts +268 -64
  350. package/build/esm/cc/ScheduleEntryLockCC.d.ts.map +1 -1
  351. package/build/esm/cc/ScheduleEntryLockCC.js +0 -14
  352. package/build/esm/cc/ScheduleEntryLockCC.js.map +1 -1
  353. package/build/esm/cc/Security2CC.d.ts +15 -21
  354. package/build/esm/cc/Security2CC.d.ts.map +1 -1
  355. package/build/esm/cc/Security2CC.js +27 -475
  356. package/build/esm/cc/Security2CC.js.map +1 -1
  357. package/build/esm/cc/SecurityCC.d.ts +12 -19
  358. package/build/esm/cc/SecurityCC.d.ts.map +1 -1
  359. package/build/esm/cc/SecurityCC.js +13 -138
  360. package/build/esm/cc/SecurityCC.js.map +1 -1
  361. package/build/esm/cc/SoundSwitchCC.d.ts +253 -64
  362. package/build/esm/cc/SoundSwitchCC.d.ts.map +1 -1
  363. package/build/esm/cc/SoundSwitchCC.js +0 -7
  364. package/build/esm/cc/SoundSwitchCC.js.map +1 -1
  365. package/build/esm/cc/SupervisionCC.d.ts +28 -16
  366. package/build/esm/cc/SupervisionCC.d.ts.map +1 -1
  367. package/build/esm/cc/SupervisionCC.js +4 -34
  368. package/build/esm/cc/SupervisionCC.js.map +1 -1
  369. package/build/esm/cc/ThermostatFanModeCC.d.ts +187 -38
  370. package/build/esm/cc/ThermostatFanModeCC.d.ts.map +1 -1
  371. package/build/esm/cc/ThermostatFanModeCC.js +0 -1
  372. package/build/esm/cc/ThermostatFanModeCC.js.map +1 -1
  373. package/build/esm/cc/ThermostatFanStateCC.d.ts +64 -18
  374. package/build/esm/cc/ThermostatFanStateCC.d.ts.map +1 -1
  375. package/build/esm/cc/ThermostatFanStateCC.js.map +1 -1
  376. package/build/esm/cc/ThermostatModeCC.d.ts +189 -40
  377. package/build/esm/cc/ThermostatModeCC.d.ts.map +1 -1
  378. package/build/esm/cc/ThermostatModeCC.js +0 -3
  379. package/build/esm/cc/ThermostatModeCC.js.map +1 -1
  380. package/build/esm/cc/ThermostatOperatingStateCC.d.ts +65 -19
  381. package/build/esm/cc/ThermostatOperatingStateCC.d.ts.map +1 -1
  382. package/build/esm/cc/ThermostatOperatingStateCC.js.map +1 -1
  383. package/build/esm/cc/ThermostatSetbackCC.d.ts +4 -4
  384. package/build/esm/cc/ThermostatSetbackCC.d.ts.map +1 -1
  385. package/build/esm/cc/ThermostatSetbackCC.js +0 -2
  386. package/build/esm/cc/ThermostatSetbackCC.js.map +1 -1
  387. package/build/esm/cc/ThermostatSetpointCC.d.ts +116 -36
  388. package/build/esm/cc/ThermostatSetpointCC.d.ts.map +1 -1
  389. package/build/esm/cc/ThermostatSetpointCC.js +0 -6
  390. package/build/esm/cc/ThermostatSetpointCC.js.map +1 -1
  391. package/build/esm/cc/TimeCC.d.ts +6 -6
  392. package/build/esm/cc/TimeCC.d.ts.map +1 -1
  393. package/build/esm/cc/TimeCC.js +0 -4
  394. package/build/esm/cc/TimeCC.js.map +1 -1
  395. package/build/esm/cc/TimeParametersCC.d.ts +63 -12
  396. package/build/esm/cc/TimeParametersCC.d.ts.map +1 -1
  397. package/build/esm/cc/TimeParametersCC.js +0 -1
  398. package/build/esm/cc/TimeParametersCC.js.map +1 -1
  399. package/build/esm/cc/TransportServiceCC.d.ts +7 -12
  400. package/build/esm/cc/TransportServiceCC.d.ts.map +1 -1
  401. package/build/esm/cc/TransportServiceCC.js +5 -38
  402. package/build/esm/cc/TransportServiceCC.js.map +1 -1
  403. package/build/esm/cc/UserCodeCC._validateArgs.js +1 -1
  404. package/build/esm/cc/UserCodeCC._validateArgs.js.map +1 -1
  405. package/build/esm/cc/UserCodeCC.d.ts +931 -176
  406. package/build/esm/cc/UserCodeCC.d.ts.map +1 -1
  407. package/build/esm/cc/UserCodeCC.js +0 -12
  408. package/build/esm/cc/UserCodeCC.js.map +1 -1
  409. package/build/esm/cc/VersionCC.d.ts +897 -185
  410. package/build/esm/cc/VersionCC.d.ts.map +1 -1
  411. package/build/esm/cc/VersionCC.js +0 -4
  412. package/build/esm/cc/VersionCC.js.map +1 -1
  413. package/build/esm/cc/WakeUpCC.d.ts +190 -38
  414. package/build/esm/cc/WakeUpCC.d.ts.map +1 -1
  415. package/build/esm/cc/WakeUpCC.js +0 -1
  416. package/build/esm/cc/WakeUpCC.js.map +1 -1
  417. package/build/esm/cc/WindowCoveringCC.d.ts +193 -103
  418. package/build/esm/cc/WindowCoveringCC.d.ts.map +1 -1
  419. package/build/esm/cc/WindowCoveringCC.js +0 -5
  420. package/build/esm/cc/WindowCoveringCC.js.map +1 -1
  421. package/build/esm/cc/ZWavePlusCC.d.ts +311 -51
  422. package/build/esm/cc/ZWavePlusCC.d.ts.map +1 -1
  423. package/build/esm/cc/ZWavePlusCC.js +0 -1
  424. package/build/esm/cc/ZWavePlusCC.js.map +1 -1
  425. package/build/esm/cc/ZWaveProtocolCC.d.ts +28 -28
  426. package/build/esm/cc/ZWaveProtocolCC.d.ts.map +1 -1
  427. package/build/esm/cc/ZWaveProtocolCC.js +0 -27
  428. package/build/esm/cc/ZWaveProtocolCC.js.map +1 -1
  429. package/build/esm/cc/manufacturerProprietary/FibaroCC.d.ts +4 -4
  430. package/build/esm/cc/manufacturerProprietary/FibaroCC.d.ts.map +1 -1
  431. package/build/esm/cc/manufacturerProprietary/FibaroCC.js +0 -3
  432. package/build/esm/cc/manufacturerProprietary/FibaroCC.js.map +1 -1
  433. package/build/esm/index.d.ts +1 -0
  434. package/build/esm/index.d.ts.map +1 -1
  435. package/build/esm/index_browser.d.ts +9 -0
  436. package/build/esm/index_browser.d.ts.map +1 -1
  437. package/build/esm/index_browser.js +8 -1
  438. package/build/esm/index_browser.js.map +1 -1
  439. package/build/esm/lib/API.d.ts +7 -5
  440. package/build/esm/lib/API.d.ts.map +1 -1
  441. package/build/esm/lib/API.js +1 -1
  442. package/build/esm/lib/API.js.map +1 -1
  443. package/build/esm/lib/CommandClass.d.ts +10 -21
  444. package/build/esm/lib/CommandClass.d.ts.map +1 -1
  445. package/build/esm/lib/CommandClass.js +8 -101
  446. package/build/esm/lib/CommandClass.js.map +1 -1
  447. package/build/esm/lib/CommandClassDecorators.d.ts +1 -1
  448. package/build/esm/lib/CommandClassDecorators.d.ts.map +1 -1
  449. package/build/esm/lib/CommandClassDecorators.js +1 -1
  450. package/build/esm/lib/CommandClassDecorators.js.map +1 -1
  451. package/build/esm/lib/Values.d.ts +2 -2
  452. package/build/esm/lib/Values.d.ts.map +1 -1
  453. package/build/esm/lib/Values.js.map +1 -1
  454. package/build/esm/lib/traits.d.ts +94 -0
  455. package/build/esm/lib/traits.d.ts.map +1 -0
  456. package/build/esm/lib/traits.js +2 -0
  457. package/build/esm/lib/traits.js.map +1 -0
  458. package/build/esm/lib/utils.d.ts +2 -2
  459. package/build/esm/lib/utils.d.ts.map +1 -1
  460. package/build/esm/lib/utils.js.map +1 -1
  461. package/package.json +13 -13
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../../src/cc/manufacturerProprietary/FibaroCC.ts"],
4
- "sourcesContent": ["import {\n\tCommandClasses,\n\ttype MaybeUnknown,\n\ttype MessageOrCCLogEntry,\n\ttype MessageRecord,\n\ttype ValueID,\n\tValueMetadata,\n\ttype WithAddress,\n\tZWaveError,\n\tZWaveErrorCodes,\n\tparseMaybeNumber,\n\tvalidatePayload,\n} from \"@zwave-js/core/safe\";\nimport type {\n\tCCEncodingContext,\n\tCCParsingContext,\n\tGetDeviceConfig,\n\tGetValueDB,\n} from \"@zwave-js/host/safe\";\nimport { Bytes, pick } from \"@zwave-js/shared\";\nimport { validateArgs } from \"@zwave-js/transformers\";\nimport { isArray } from \"alcalzone-shared/typeguards\";\nimport {\n\tPOLL_VALUE,\n\ttype PollValueImplementation,\n\tSET_VALUE,\n\ttype SetValueImplementation,\n\tthrowMissingPropertyKey,\n\tthrowUnsupportedProperty,\n\tthrowUnsupportedPropertyKey,\n\tthrowWrongValueType,\n} from \"../../lib/API.js\";\nimport {\n\ttype CCRaw,\n\ttype CommandClassOptions,\n\ttype InterviewContext,\n\ttype PersistValuesContext,\n\ttype RefreshValuesContext,\n} from \"../../lib/CommandClass.js\";\nimport { expectedCCResponse } from \"../../lib/CommandClassDecorators.js\";\nimport {\n\tManufacturerProprietaryCC,\n\tManufacturerProprietaryCCAPI,\n} from \"../ManufacturerProprietaryCC.js\";\nimport {\n\tfibaroCC,\n\tfibaroCCCommand,\n\tgetFibaroCCCommand,\n\tgetFibaroCCCommandConstructor,\n\tgetFibaroCCConstructor,\n\tgetFibaroCCId,\n\tmanufacturerId,\n\tmanufacturerProprietaryAPI,\n} from \"./Decorators.js\";\n\nexport const MANUFACTURERID_FIBARO = 0x10f;\n\n/** Returns the ValueID used to store the current venetian blind position */\nexport function getFibaroVenetianBlindPositionValueId(\n\tendpoint: number,\n): ValueID {\n\treturn {\n\t\tcommandClass: CommandClasses[\"Manufacturer Proprietary\"],\n\t\tendpoint,\n\t\tproperty: \"fibaro\",\n\t\tpropertyKey: \"venetianBlindsPosition\",\n\t};\n}\n\n/** Returns the value metadata for venetian blind position */\nexport function getFibaroVenetianBlindPositionMetadata(): ValueMetadata {\n\treturn {\n\t\t...ValueMetadata.Level,\n\t\tlabel: \"Venetian blinds position\",\n\t};\n}\n\n/** Returns the ValueID used to store the current venetian blind tilt */\nexport function getFibaroVenetianBlindTiltValueId(endpoint: number): ValueID {\n\treturn {\n\t\tcommandClass: CommandClasses[\"Manufacturer Proprietary\"],\n\t\tendpoint,\n\t\tproperty: \"fibaro\",\n\t\tpropertyKey: \"venetianBlindsTilt\",\n\t};\n}\n\n/** Returns the value metadata for venetian blind tilt */\nexport function getFibaroVenetianBlindTiltMetadata(): ValueMetadata {\n\treturn {\n\t\t...ValueMetadata.Level,\n\t\tlabel: \"Venetian blinds tilt\",\n\t};\n}\n\nfunction getSupportedFibaroCCIDs(\n\tctx: GetDeviceConfig,\n\tnodeId: number,\n): FibaroCCIDs[] {\n\tconst proprietaryConfig = ctx.getDeviceConfig?.(\n\t\tnodeId,\n\t)?.proprietary;\n\tif (proprietaryConfig && isArray(proprietaryConfig.fibaroCCs)) {\n\t\treturn proprietaryConfig.fibaroCCs as FibaroCCIDs[];\n\t}\n\n\treturn [];\n}\n\nexport enum FibaroCCIDs {\n\tVenetianBlind = 0x26,\n}\n\n@manufacturerProprietaryAPI(MANUFACTURERID_FIBARO)\nexport class FibaroCCAPI extends ManufacturerProprietaryCCAPI {\n\t// eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types\n\tpublic async fibaroVenetianBlindsGet() {\n\t\tconst cc = new FibaroVenetianBlindCCGet({\n\t\t\tnodeId: this.endpoint.nodeId,\n\t\t\tendpointIndex: this.endpoint.index,\n\t\t});\n\t\tconst response = await this.host.sendCommand<\n\t\t\tFibaroVenetianBlindCCReport\n\t\t>(\n\t\t\tcc,\n\t\t\tthis.commandOptions,\n\t\t);\n\t\tif (response) {\n\t\t\treturn pick(response, [\"position\", \"tilt\"]);\n\t\t}\n\t}\n\n\t@validateArgs()\n\tpublic async fibaroVenetianBlindsSetPosition(value: number): Promise<void> {\n\t\tconst cc = new FibaroVenetianBlindCCSet({\n\t\t\tnodeId: this.endpoint.nodeId,\n\t\t\tendpointIndex: this.endpoint.index,\n\t\t\tposition: value,\n\t\t});\n\t\tawait this.host.sendCommand(cc, this.commandOptions);\n\t}\n\n\t@validateArgs()\n\tpublic async fibaroVenetianBlindsSetTilt(value: number): Promise<void> {\n\t\tconst cc = new FibaroVenetianBlindCCSet({\n\t\t\tnodeId: this.endpoint.nodeId,\n\t\t\tendpointIndex: this.endpoint.index,\n\t\t\ttilt: value,\n\t\t});\n\t\tawait this.host.sendCommand(cc, this.commandOptions);\n\t}\n\n\tprotected override get [SET_VALUE](): SetValueImplementation {\n\t\treturn async function(\n\t\t\tthis: FibaroCCAPI,\n\t\t\t{ property, propertyKey },\n\t\t\tvalue,\n\t\t) {\n\t\t\tif (property !== \"fibaro\") {\n\t\t\t\tthrowUnsupportedProperty(this.ccId, property);\n\t\t\t}\n\n\t\t\tif (propertyKey === \"venetianBlindsPosition\") {\n\t\t\t\tif (typeof value !== \"number\") {\n\t\t\t\t\tthrowWrongValueType(\n\t\t\t\t\t\tthis.ccId,\n\t\t\t\t\t\tproperty,\n\t\t\t\t\t\t\"number\",\n\t\t\t\t\t\ttypeof value,\n\t\t\t\t\t);\n\t\t\t\t}\n\t\t\t\tawait this.fibaroVenetianBlindsSetPosition(value);\n\t\t\t} else if (propertyKey === \"venetianBlindsTilt\") {\n\t\t\t\tif (typeof value !== \"number\") {\n\t\t\t\t\tthrowWrongValueType(\n\t\t\t\t\t\tthis.ccId,\n\t\t\t\t\t\tproperty,\n\t\t\t\t\t\t\"number\",\n\t\t\t\t\t\ttypeof value,\n\t\t\t\t\t);\n\t\t\t\t}\n\t\t\t\tawait this.fibaroVenetianBlindsSetTilt(value);\n\t\t\t} else {\n\t\t\t\t// unsupported property key, ignore...\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\t// Verify the current value after a delay\n\t\t\tthis.schedulePoll({ property, propertyKey }, value);\n\n\t\t\treturn undefined;\n\t\t};\n\t}\n\n\tprotected get [POLL_VALUE](): PollValueImplementation {\n\t\treturn async function(this: FibaroCCAPI, { property, propertyKey }) {\n\t\t\tif (property !== \"fibaro\") {\n\t\t\t\tthrowUnsupportedProperty(this.ccId, property);\n\t\t\t} else if (propertyKey == undefined) {\n\t\t\t\tthrowMissingPropertyKey(this.ccId, property);\n\t\t\t}\n\n\t\t\tswitch (propertyKey) {\n\t\t\t\tcase \"venetianBlindsPosition\":\n\t\t\t\t\treturn (await this.fibaroVenetianBlindsGet())?.position;\n\t\t\t\tcase \"venetianBlindsTilt\":\n\t\t\t\t\treturn (await this.fibaroVenetianBlindsGet())?.tilt;\n\t\t\t\tdefault:\n\t\t\t\t\tthrowUnsupportedPropertyKey(\n\t\t\t\t\t\tthis.ccId,\n\t\t\t\t\t\tproperty,\n\t\t\t\t\t\tpropertyKey,\n\t\t\t\t\t);\n\t\t\t}\n\t\t};\n\t}\n}\n\n@manufacturerId(MANUFACTURERID_FIBARO)\nexport class FibaroCC extends ManufacturerProprietaryCC {\n\tpublic constructor(\n\t\toptions: CommandClassOptions,\n\t) {\n\t\tsuper(options);\n\n\t\tthis.fibaroCCId = getFibaroCCId(this);\n\t\tthis.fibaroCCCommand = getFibaroCCCommand(this);\n\t}\n\n\tpublic static from(raw: CCRaw, ctx: CCParsingContext): FibaroCC {\n\t\tvalidatePayload(raw.payload.length >= 2);\n\t\tconst fibaroCCId = raw.payload[0];\n\t\tconst fibaroCCCommand = raw.payload[1];\n\n\t\tconst FibaroConstructor = getFibaroCCCommandConstructor(\n\t\t\tfibaroCCId,\n\t\t\tfibaroCCCommand,\n\t\t);\n\t\tif (FibaroConstructor) {\n\t\t\t// eslint-disable-next-line @typescript-eslint/no-deprecated\n\t\t\treturn FibaroConstructor.from(\n\t\t\t\traw.withPayload(raw.payload.subarray(2)),\n\t\t\t\tctx,\n\t\t\t);\n\t\t}\n\n\t\treturn new FibaroCC({\n\t\t\tnodeId: ctx.sourceNodeId,\n\t\t});\n\t}\n\n\tpublic fibaroCCId?: number;\n\tpublic fibaroCCCommand?: number;\n\n\tpublic async interview(\n\t\tctx: InterviewContext,\n\t): Promise<void> {\n\t\tconst node = this.getNode(ctx)!;\n\n\t\t// Iterate through all supported Fibaro CCs and interview them\n\t\tconst supportedFibaroCCIDs = getSupportedFibaroCCIDs(ctx, node.id);\n\t\tfor (const ccId of supportedFibaroCCIDs) {\n\t\t\tconst SubConstructor = getFibaroCCConstructor(ccId);\n\t\t\tif (SubConstructor) {\n\t\t\t\tconst instance = new SubConstructor({ nodeId: node.id });\n\t\t\t\tawait instance.interview(ctx);\n\t\t\t}\n\t\t}\n\t}\n\n\tpublic async refreshValues(\n\t\tctx: RefreshValuesContext,\n\t): Promise<void> {\n\t\tconst node = this.getNode(ctx)!;\n\n\t\t// Iterate through all supported Fibaro CCs and let them refresh their values\n\t\tconst supportedFibaroCCIDs = getSupportedFibaroCCIDs(ctx, node.id);\n\t\tfor (const ccId of supportedFibaroCCIDs) {\n\t\t\tconst SubConstructor = getFibaroCCConstructor(ccId);\n\t\t\tif (SubConstructor) {\n\t\t\t\tconst instance = new SubConstructor({ nodeId: node.id });\n\t\t\t\tawait instance.refreshValues(ctx);\n\t\t\t}\n\t\t}\n\t}\n\n\tpublic serialize(ctx: CCEncodingContext): Bytes {\n\t\tif (this.fibaroCCId == undefined) {\n\t\t\tthrow new ZWaveError(\n\t\t\t\t\"Cannot serialize a Fibaro CC without a Fibaro CC ID\",\n\t\t\t\tZWaveErrorCodes.CC_Invalid,\n\t\t\t);\n\t\t} else if (this.fibaroCCCommand == undefined) {\n\t\t\tthrow new ZWaveError(\n\t\t\t\t\"Cannot serialize a Fibaro CC without a Fibaro CC Command\",\n\t\t\t\tZWaveErrorCodes.CC_Invalid,\n\t\t\t);\n\t\t}\n\t\tthis.payload = Bytes.concat([\n\t\t\tBytes.from([this.fibaroCCId, this.fibaroCCCommand]),\n\t\t\tthis.payload,\n\t\t]);\n\t\t// eslint-disable-next-line @typescript-eslint/no-deprecated\n\t\treturn super.serialize(ctx);\n\t}\n}\n\nexport enum FibaroVenetianBlindCCCommand {\n\tSet = 0x01,\n\tGet = 0x02,\n\tReport = 0x03,\n}\n\n@fibaroCC(FibaroCCIDs.VenetianBlind)\nexport class FibaroVenetianBlindCC extends FibaroCC {\n\tdeclare fibaroCCId: FibaroCCIDs.VenetianBlind;\n\tdeclare fibaroCCCommand: FibaroVenetianBlindCCCommand;\n\n\tpublic constructor(\n\t\toptions: CommandClassOptions,\n\t) {\n\t\tsuper(options);\n\t\tthis.fibaroCCId = FibaroCCIDs.VenetianBlind;\n\t}\n\n\tpublic async interview(ctx: InterviewContext): Promise<void> {\n\t\tconst node = this.getNode(ctx)!;\n\n\t\tctx.logNode(node.id, {\n\t\t\tendpoint: this.endpointIndex,\n\t\t\tmessage: `Interviewing Fibaro Venetian Blind CC...`,\n\t\t\tdirection: \"none\",\n\t\t});\n\n\t\t// Nothing special, just get the values\n\t\tawait this.refreshValues(ctx);\n\t}\n\n\tpublic async refreshValues(ctx: RefreshValuesContext): Promise<void> {\n\t\tconst node = this.getNode(ctx)!;\n\n\t\tctx.logNode(node.id, {\n\t\t\tmessage: \"Requesting venetian blind position and tilt...\",\n\t\t\tdirection: \"outbound\",\n\t\t});\n\t\tconst resp = await ctx.sendCommand<FibaroVenetianBlindCCReport>(\n\t\t\tnew FibaroVenetianBlindCCGet({\n\t\t\t\tnodeId: this.nodeId,\n\t\t\t\tendpointIndex: this.endpointIndex,\n\t\t\t}),\n\t\t);\n\t\tif (resp) {\n\t\t\tconst logMessage = `received venetian blind state:\nposition: ${resp.position}\ntilt: ${resp.tilt}`;\n\t\t\tctx.logNode(node.id, {\n\t\t\t\tmessage: logMessage,\n\t\t\t\tdirection: \"inbound\",\n\t\t\t});\n\t\t}\n\t}\n}\n\n// @publicAPI\nexport type FibaroVenetianBlindCCSetOptions =\n\t| {\n\t\tposition: number;\n\t}\n\t| {\n\t\ttilt: number;\n\t}\n\t| {\n\t\tposition: number;\n\t\ttilt: number;\n\t};\n\n@fibaroCCCommand(FibaroVenetianBlindCCCommand.Set)\nexport class FibaroVenetianBlindCCSet extends FibaroVenetianBlindCC {\n\tpublic constructor(\n\t\toptions: WithAddress<FibaroVenetianBlindCCSetOptions>,\n\t) {\n\t\tsuper(options);\n\t\tthis.fibaroCCCommand = FibaroVenetianBlindCCCommand.Set;\n\n\t\tif (\"position\" in options) this.position = options.position;\n\t\tif (\"tilt\" in options) this.tilt = options.tilt;\n\t}\n\n\tpublic static from(\n\t\t_raw: CCRaw,\n\t\t_ctx: CCParsingContext,\n\t): FibaroVenetianBlindCCSet {\n\t\t// TODO: Deserialize payload\n\t\tthrow new ZWaveError(\n\t\t\t`${this.name}: deserialization not implemented`,\n\t\t\tZWaveErrorCodes.Deserialization_NotImplemented,\n\t\t);\n\t}\n\n\tpublic position: number | undefined;\n\tpublic tilt: number | undefined;\n\n\tpublic serialize(ctx: CCEncodingContext): Bytes {\n\t\tconst controlByte = (this.position != undefined ? 0b10 : 0)\n\t\t\t| (this.tilt != undefined ? 0b01 : 0);\n\t\tthis.payload = Bytes.from([\n\t\t\tcontrolByte,\n\t\t\tthis.position ?? 0,\n\t\t\tthis.tilt ?? 0,\n\t\t]);\n\t\t// eslint-disable-next-line @typescript-eslint/no-deprecated\n\t\treturn super.serialize(ctx);\n\t}\n\n\tpublic toLogEntry(ctx?: GetValueDB): MessageOrCCLogEntry {\n\t\tconst message: MessageRecord = {};\n\t\tif (this.position != undefined) {\n\t\t\tmessage.position = this.position;\n\t\t}\n\t\tif (this.tilt != undefined) {\n\t\t\tmessage.tilt = this.tilt;\n\t\t}\n\t\treturn {\n\t\t\t...super.toLogEntry(ctx),\n\t\t\tmessage,\n\t\t};\n\t}\n}\n\n// @publicAPI\nexport interface FibaroVenetianBlindCCReportOptions {\n\tposition?: MaybeUnknown<number>;\n\ttilt?: MaybeUnknown<number>;\n}\n\n@fibaroCCCommand(FibaroVenetianBlindCCCommand.Report)\nexport class FibaroVenetianBlindCCReport extends FibaroVenetianBlindCC {\n\tpublic constructor(\n\t\toptions: WithAddress<FibaroVenetianBlindCCReportOptions>,\n\t) {\n\t\tsuper(options);\n\t\tthis.fibaroCCCommand = FibaroVenetianBlindCCCommand.Report;\n\n\t\t// TODO: Check implementation:\n\t\tthis.position = options.position;\n\t\tthis.tilt = options.tilt;\n\t}\n\n\tpublic static from(\n\t\traw: CCRaw,\n\t\tctx: CCParsingContext,\n\t): FibaroVenetianBlindCCReport {\n\t\tvalidatePayload(raw.payload.length >= 3);\n\t\t// When the node sends a report, payload[0] === 0b11. This is probably a\n\t\t// bit mask for position and tilt\n\t\tlet position: MaybeUnknown<number> | undefined;\n\t\tif (!!(raw.payload[0] & 0b10)) {\n\t\t\tposition = parseMaybeNumber(raw.payload[1]);\n\t\t}\n\n\t\tlet tilt: MaybeUnknown<number> | undefined;\n\t\tif (!!(raw.payload[0] & 0b01)) {\n\t\t\ttilt = parseMaybeNumber(raw.payload[2]);\n\t\t}\n\n\t\treturn new this({\n\t\t\tnodeId: ctx.sourceNodeId,\n\t\t\tposition,\n\t\t\ttilt,\n\t\t});\n\t}\n\n\tpublic persistValues(ctx: PersistValuesContext): boolean {\n\t\tif (!super.persistValues(ctx)) return false;\n\t\tconst valueDB = this.getValueDB(ctx);\n\n\t\tif (this.position != undefined) {\n\t\t\tconst positionValueId = getFibaroVenetianBlindPositionValueId(\n\t\t\t\tthis.endpointIndex,\n\t\t\t);\n\t\t\tvalueDB.setMetadata(positionValueId, {\n\t\t\t\t...ValueMetadata.Level,\n\t\t\t\tlabel: \"Venetian blinds position\",\n\t\t\t});\n\t\t\tvalueDB.setValue(positionValueId, this.position);\n\t\t}\n\t\tif (this.tilt != undefined) {\n\t\t\tconst tiltValueId = getFibaroVenetianBlindTiltValueId(\n\t\t\t\tthis.endpointIndex,\n\t\t\t);\n\t\t\tvalueDB.setMetadata(tiltValueId, {\n\t\t\t\t...ValueMetadata.Level,\n\t\t\t\tlabel: \"Venetian blinds tilt\",\n\t\t\t});\n\t\t\tvalueDB.setValue(tiltValueId, this.tilt);\n\t\t}\n\n\t\treturn true;\n\t}\n\n\tpublic position: MaybeUnknown<number> | undefined;\n\tpublic tilt: MaybeUnknown<number> | undefined;\n\n\tpublic toLogEntry(ctx?: GetValueDB): MessageOrCCLogEntry {\n\t\tconst message: MessageRecord = {};\n\t\tif (this.position != undefined) {\n\t\t\tmessage.position = this.position;\n\t\t}\n\t\tif (this.tilt != undefined) {\n\t\t\tmessage.tilt = this.tilt;\n\t\t}\n\t\treturn {\n\t\t\t...super.toLogEntry(ctx),\n\t\t\tmessage,\n\t\t};\n\t}\n}\n\n@fibaroCCCommand(FibaroVenetianBlindCCCommand.Get)\n@expectedCCResponse(FibaroVenetianBlindCCReport)\nexport class FibaroVenetianBlindCCGet extends FibaroVenetianBlindCC {\n\tpublic constructor(\n\t\toptions: CommandClassOptions,\n\t) {\n\t\tsuper(options);\n\t\tthis.fibaroCCCommand = FibaroVenetianBlindCCCommand.Get;\n\t}\n\n\tpublic static from(\n\t\traw: CCRaw,\n\t\tctx: CCParsingContext,\n\t): FibaroVenetianBlindCCGet {\n\t\treturn new this({\n\t\t\tnodeId: ctx.sourceNodeId,\n\t\t});\n\t}\n}\n"],
5
- "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,kBAYO;AAOP,oBAA4B;AAE5B,wBAAwB;AACxB,iBASO;AAQP,oCAAmC;AACnC,uCAGO;AACP,wBASO;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAEA,MAAM,wBAAwB;AAG/B,SAAU,sCACf,UAAgB;AAEhB,SAAO;IACN,cAAc,2BAAe,0BAA0B;IACvD;IACA,UAAU;IACV,aAAa;;AAEf;AATgB;AAYV,SAAU,yCAAsC;AACrD,SAAO;IACN,GAAG,0BAAc;IACjB,OAAO;;AAET;AALgB;AAQV,SAAU,kCAAkC,UAAgB;AACjE,SAAO;IACN,cAAc,2BAAe,0BAA0B;IACvD;IACA,UAAU;IACV,aAAa;;AAEf;AAPgB;AAUV,SAAU,qCAAkC;AACjD,SAAO;IACN,GAAG,0BAAc;IACjB,OAAO;;AAET;AALgB;AAOhB,SAAS,wBACR,KACA,QAAc;AAEd,QAAM,oBAAoB,IAAI,kBAC7B,MAAM,GACJ;AACH,MAAI,yBAAqB,2BAAQ,kBAAkB,SAAS,GAAG;AAC9D,WAAO,kBAAkB;EAC1B;AAEA,SAAO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B,CAAA;AAC/B,UAAI,KAAK,YAAY,QAAW;AAC/B,gBAAQ,WAAW,KAAK;MACzB;AACA,UAAI,KAAK,QAAQ,QAAW;AAC3B,gBAAQ,OAAO,KAAK;MACrB;AACA,aAAO;QACN,GAAG,MAAM,WAAW,GAAG;QACvB;;IAEF;;;;IAKY,4BAAwB,MAAA;8BAFpC,mCAAgB,6BAA6B,GAAG,OAChD,kDAAmB,2BAA2B,CAAC;;;;oBACF;gDAAA,YAAqB;WAAA;;;;;;;;AAAnE,mBAAA,MAAA,mBAAA,EAAA,OAAA,WAAA,GAAA,kBAAA,EAAA,MAAA,SAAA,MAAA,WAAA,MAAA,UAAA,UAAA,GAAA,MAAA,uBAAA;;;AAAa,wBAAA,YAAA,uBAAA;;IACZ,YACC,SAA4B;AAE5B,YAAM,OAAO;AACb,WAAK,kBAAkB,6BAA6B;IACrD;IAEO,OAAO,KACb,KACA,KAAqB;AAErB,aAAO,IAAI,KAAK;QACf,QAAQ,IAAI;OACZ;IACF;;;;",
4
+ "sourcesContent": ["import { type CCEncodingContext, type CCParsingContext } from \"@zwave-js/cc\";\nimport { type GetDeviceConfig } from \"@zwave-js/config\";\nimport {\n\tCommandClasses,\n\ttype GetValueDB,\n\ttype MaybeUnknown,\n\ttype MessageOrCCLogEntry,\n\ttype MessageRecord,\n\ttype ValueID,\n\tValueMetadata,\n\ttype WithAddress,\n\tZWaveError,\n\tZWaveErrorCodes,\n\tparseMaybeNumber,\n\tvalidatePayload,\n} from \"@zwave-js/core/safe\";\nimport { Bytes, pick } from \"@zwave-js/shared\";\nimport { validateArgs } from \"@zwave-js/transformers\";\nimport { isArray } from \"alcalzone-shared/typeguards\";\nimport {\n\tPOLL_VALUE,\n\ttype PollValueImplementation,\n\tSET_VALUE,\n\ttype SetValueImplementation,\n\tthrowMissingPropertyKey,\n\tthrowUnsupportedProperty,\n\tthrowUnsupportedPropertyKey,\n\tthrowWrongValueType,\n} from \"../../lib/API.js\";\nimport {\n\ttype CCRaw,\n\ttype CommandClassOptions,\n\ttype InterviewContext,\n\ttype PersistValuesContext,\n\ttype RefreshValuesContext,\n} from \"../../lib/CommandClass.js\";\nimport { expectedCCResponse } from \"../../lib/CommandClassDecorators.js\";\nimport {\n\tManufacturerProprietaryCC,\n\tManufacturerProprietaryCCAPI,\n} from \"../ManufacturerProprietaryCC.js\";\nimport {\n\tfibaroCC,\n\tfibaroCCCommand,\n\tgetFibaroCCCommand,\n\tgetFibaroCCCommandConstructor,\n\tgetFibaroCCConstructor,\n\tgetFibaroCCId,\n\tmanufacturerId,\n\tmanufacturerProprietaryAPI,\n} from \"./Decorators.js\";\n\nexport const MANUFACTURERID_FIBARO = 0x10f;\n\n/** Returns the ValueID used to store the current venetian blind position */\nexport function getFibaroVenetianBlindPositionValueId(\n\tendpoint: number,\n): ValueID {\n\treturn {\n\t\tcommandClass: CommandClasses[\"Manufacturer Proprietary\"],\n\t\tendpoint,\n\t\tproperty: \"fibaro\",\n\t\tpropertyKey: \"venetianBlindsPosition\",\n\t};\n}\n\n/** Returns the value metadata for venetian blind position */\nexport function getFibaroVenetianBlindPositionMetadata(): ValueMetadata {\n\treturn {\n\t\t...ValueMetadata.Level,\n\t\tlabel: \"Venetian blinds position\",\n\t};\n}\n\n/** Returns the ValueID used to store the current venetian blind tilt */\nexport function getFibaroVenetianBlindTiltValueId(endpoint: number): ValueID {\n\treturn {\n\t\tcommandClass: CommandClasses[\"Manufacturer Proprietary\"],\n\t\tendpoint,\n\t\tproperty: \"fibaro\",\n\t\tpropertyKey: \"venetianBlindsTilt\",\n\t};\n}\n\n/** Returns the value metadata for venetian blind tilt */\nexport function getFibaroVenetianBlindTiltMetadata(): ValueMetadata {\n\treturn {\n\t\t...ValueMetadata.Level,\n\t\tlabel: \"Venetian blinds tilt\",\n\t};\n}\n\nfunction getSupportedFibaroCCIDs(\n\tctx: GetDeviceConfig,\n\tnodeId: number,\n): FibaroCCIDs[] {\n\tconst proprietaryConfig = ctx.getDeviceConfig?.(\n\t\tnodeId,\n\t)?.proprietary;\n\tif (proprietaryConfig && isArray(proprietaryConfig.fibaroCCs)) {\n\t\treturn proprietaryConfig.fibaroCCs as FibaroCCIDs[];\n\t}\n\n\treturn [];\n}\n\nexport enum FibaroCCIDs {\n\tVenetianBlind = 0x26,\n}\n\n@manufacturerProprietaryAPI(MANUFACTURERID_FIBARO)\nexport class FibaroCCAPI extends ManufacturerProprietaryCCAPI {\n\t// eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types\n\tpublic async fibaroVenetianBlindsGet() {\n\t\tconst cc = new FibaroVenetianBlindCCGet({\n\t\t\tnodeId: this.endpoint.nodeId,\n\t\t\tendpointIndex: this.endpoint.index,\n\t\t});\n\t\tconst response = await this.host.sendCommand<\n\t\t\tFibaroVenetianBlindCCReport\n\t\t>(\n\t\t\tcc,\n\t\t\tthis.commandOptions,\n\t\t);\n\t\tif (response) {\n\t\t\treturn pick(response, [\"position\", \"tilt\"]);\n\t\t}\n\t}\n\n\t@validateArgs()\n\tpublic async fibaroVenetianBlindsSetPosition(value: number): Promise<void> {\n\t\tconst cc = new FibaroVenetianBlindCCSet({\n\t\t\tnodeId: this.endpoint.nodeId,\n\t\t\tendpointIndex: this.endpoint.index,\n\t\t\tposition: value,\n\t\t});\n\t\tawait this.host.sendCommand(cc, this.commandOptions);\n\t}\n\n\t@validateArgs()\n\tpublic async fibaroVenetianBlindsSetTilt(value: number): Promise<void> {\n\t\tconst cc = new FibaroVenetianBlindCCSet({\n\t\t\tnodeId: this.endpoint.nodeId,\n\t\t\tendpointIndex: this.endpoint.index,\n\t\t\ttilt: value,\n\t\t});\n\t\tawait this.host.sendCommand(cc, this.commandOptions);\n\t}\n\n\tprotected override get [SET_VALUE](): SetValueImplementation {\n\t\treturn async function(\n\t\t\tthis: FibaroCCAPI,\n\t\t\t{ property, propertyKey },\n\t\t\tvalue,\n\t\t) {\n\t\t\tif (property !== \"fibaro\") {\n\t\t\t\tthrowUnsupportedProperty(this.ccId, property);\n\t\t\t}\n\n\t\t\tif (propertyKey === \"venetianBlindsPosition\") {\n\t\t\t\tif (typeof value !== \"number\") {\n\t\t\t\t\tthrowWrongValueType(\n\t\t\t\t\t\tthis.ccId,\n\t\t\t\t\t\tproperty,\n\t\t\t\t\t\t\"number\",\n\t\t\t\t\t\ttypeof value,\n\t\t\t\t\t);\n\t\t\t\t}\n\t\t\t\tawait this.fibaroVenetianBlindsSetPosition(value);\n\t\t\t} else if (propertyKey === \"venetianBlindsTilt\") {\n\t\t\t\tif (typeof value !== \"number\") {\n\t\t\t\t\tthrowWrongValueType(\n\t\t\t\t\t\tthis.ccId,\n\t\t\t\t\t\tproperty,\n\t\t\t\t\t\t\"number\",\n\t\t\t\t\t\ttypeof value,\n\t\t\t\t\t);\n\t\t\t\t}\n\t\t\t\tawait this.fibaroVenetianBlindsSetTilt(value);\n\t\t\t} else {\n\t\t\t\t// unsupported property key, ignore...\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\t// Verify the current value after a delay\n\t\t\tthis.schedulePoll({ property, propertyKey }, value);\n\n\t\t\treturn undefined;\n\t\t};\n\t}\n\n\tprotected get [POLL_VALUE](): PollValueImplementation {\n\t\treturn async function(this: FibaroCCAPI, { property, propertyKey }) {\n\t\t\tif (property !== \"fibaro\") {\n\t\t\t\tthrowUnsupportedProperty(this.ccId, property);\n\t\t\t} else if (propertyKey == undefined) {\n\t\t\t\tthrowMissingPropertyKey(this.ccId, property);\n\t\t\t}\n\n\t\t\tswitch (propertyKey) {\n\t\t\t\tcase \"venetianBlindsPosition\":\n\t\t\t\t\treturn (await this.fibaroVenetianBlindsGet())?.position;\n\t\t\t\tcase \"venetianBlindsTilt\":\n\t\t\t\t\treturn (await this.fibaroVenetianBlindsGet())?.tilt;\n\t\t\t\tdefault:\n\t\t\t\t\tthrowUnsupportedPropertyKey(\n\t\t\t\t\t\tthis.ccId,\n\t\t\t\t\t\tproperty,\n\t\t\t\t\t\tpropertyKey,\n\t\t\t\t\t);\n\t\t\t}\n\t\t};\n\t}\n}\n\n@manufacturerId(MANUFACTURERID_FIBARO)\nexport class FibaroCC extends ManufacturerProprietaryCC {\n\tpublic constructor(\n\t\toptions: CommandClassOptions,\n\t) {\n\t\tsuper(options);\n\n\t\tthis.fibaroCCId = getFibaroCCId(this);\n\t\tthis.fibaroCCCommand = getFibaroCCCommand(this);\n\t}\n\n\tpublic static from(raw: CCRaw, ctx: CCParsingContext): FibaroCC {\n\t\tvalidatePayload(raw.payload.length >= 2);\n\t\tconst fibaroCCId = raw.payload[0];\n\t\tconst fibaroCCCommand = raw.payload[1];\n\n\t\tconst FibaroConstructor = getFibaroCCCommandConstructor(\n\t\t\tfibaroCCId,\n\t\t\tfibaroCCCommand,\n\t\t);\n\t\tif (FibaroConstructor) {\n\t\t\treturn FibaroConstructor.from(\n\t\t\t\traw.withPayload(raw.payload.subarray(2)),\n\t\t\t\tctx,\n\t\t\t);\n\t\t}\n\n\t\treturn new FibaroCC({\n\t\t\tnodeId: ctx.sourceNodeId,\n\t\t});\n\t}\n\n\tpublic fibaroCCId?: number;\n\tpublic fibaroCCCommand?: number;\n\n\tpublic async interview(\n\t\tctx: InterviewContext,\n\t): Promise<void> {\n\t\tconst node = this.getNode(ctx)!;\n\n\t\t// Iterate through all supported Fibaro CCs and interview them\n\t\tconst supportedFibaroCCIDs = getSupportedFibaroCCIDs(ctx, node.id);\n\t\tfor (const ccId of supportedFibaroCCIDs) {\n\t\t\tconst SubConstructor = getFibaroCCConstructor(ccId);\n\t\t\tif (SubConstructor) {\n\t\t\t\tconst instance = new SubConstructor({ nodeId: node.id });\n\t\t\t\tawait instance.interview(ctx);\n\t\t\t}\n\t\t}\n\t}\n\n\tpublic async refreshValues(\n\t\tctx: RefreshValuesContext,\n\t): Promise<void> {\n\t\tconst node = this.getNode(ctx)!;\n\n\t\t// Iterate through all supported Fibaro CCs and let them refresh their values\n\t\tconst supportedFibaroCCIDs = getSupportedFibaroCCIDs(ctx, node.id);\n\t\tfor (const ccId of supportedFibaroCCIDs) {\n\t\t\tconst SubConstructor = getFibaroCCConstructor(ccId);\n\t\t\tif (SubConstructor) {\n\t\t\t\tconst instance = new SubConstructor({ nodeId: node.id });\n\t\t\t\tawait instance.refreshValues(ctx);\n\t\t\t}\n\t\t}\n\t}\n\n\tpublic serialize(ctx: CCEncodingContext): Promise<Bytes> {\n\t\tif (this.fibaroCCId == undefined) {\n\t\t\tthrow new ZWaveError(\n\t\t\t\t\"Cannot serialize a Fibaro CC without a Fibaro CC ID\",\n\t\t\t\tZWaveErrorCodes.CC_Invalid,\n\t\t\t);\n\t\t} else if (this.fibaroCCCommand == undefined) {\n\t\t\tthrow new ZWaveError(\n\t\t\t\t\"Cannot serialize a Fibaro CC without a Fibaro CC Command\",\n\t\t\t\tZWaveErrorCodes.CC_Invalid,\n\t\t\t);\n\t\t}\n\t\tthis.payload = Bytes.concat([\n\t\t\tBytes.from([this.fibaroCCId, this.fibaroCCCommand]),\n\t\t\tthis.payload,\n\t\t]);\n\t\treturn super.serialize(ctx);\n\t}\n}\n\nexport enum FibaroVenetianBlindCCCommand {\n\tSet = 0x01,\n\tGet = 0x02,\n\tReport = 0x03,\n}\n\n@fibaroCC(FibaroCCIDs.VenetianBlind)\nexport class FibaroVenetianBlindCC extends FibaroCC {\n\tdeclare fibaroCCId: FibaroCCIDs.VenetianBlind;\n\tdeclare fibaroCCCommand: FibaroVenetianBlindCCCommand;\n\n\tpublic constructor(\n\t\toptions: CommandClassOptions,\n\t) {\n\t\tsuper(options);\n\t\tthis.fibaroCCId = FibaroCCIDs.VenetianBlind;\n\t}\n\n\tpublic async interview(ctx: InterviewContext): Promise<void> {\n\t\tconst node = this.getNode(ctx)!;\n\n\t\tctx.logNode(node.id, {\n\t\t\tendpoint: this.endpointIndex,\n\t\t\tmessage: `Interviewing Fibaro Venetian Blind CC...`,\n\t\t\tdirection: \"none\",\n\t\t});\n\n\t\t// Nothing special, just get the values\n\t\tawait this.refreshValues(ctx);\n\t}\n\n\tpublic async refreshValues(ctx: RefreshValuesContext): Promise<void> {\n\t\tconst node = this.getNode(ctx)!;\n\n\t\tctx.logNode(node.id, {\n\t\t\tmessage: \"Requesting venetian blind position and tilt...\",\n\t\t\tdirection: \"outbound\",\n\t\t});\n\t\tconst resp = await ctx.sendCommand<FibaroVenetianBlindCCReport>(\n\t\t\tnew FibaroVenetianBlindCCGet({\n\t\t\t\tnodeId: this.nodeId,\n\t\t\t\tendpointIndex: this.endpointIndex,\n\t\t\t}),\n\t\t);\n\t\tif (resp) {\n\t\t\tconst logMessage = `received venetian blind state:\nposition: ${resp.position}\ntilt: ${resp.tilt}`;\n\t\t\tctx.logNode(node.id, {\n\t\t\t\tmessage: logMessage,\n\t\t\t\tdirection: \"inbound\",\n\t\t\t});\n\t\t}\n\t}\n}\n\n// @publicAPI\nexport type FibaroVenetianBlindCCSetOptions =\n\t| {\n\t\tposition: number;\n\t}\n\t| {\n\t\ttilt: number;\n\t}\n\t| {\n\t\tposition: number;\n\t\ttilt: number;\n\t};\n\n@fibaroCCCommand(FibaroVenetianBlindCCCommand.Set)\nexport class FibaroVenetianBlindCCSet extends FibaroVenetianBlindCC {\n\tpublic constructor(\n\t\toptions: WithAddress<FibaroVenetianBlindCCSetOptions>,\n\t) {\n\t\tsuper(options);\n\t\tthis.fibaroCCCommand = FibaroVenetianBlindCCCommand.Set;\n\n\t\tif (\"position\" in options) this.position = options.position;\n\t\tif (\"tilt\" in options) this.tilt = options.tilt;\n\t}\n\n\tpublic static from(\n\t\t_raw: CCRaw,\n\t\t_ctx: CCParsingContext,\n\t): FibaroVenetianBlindCCSet {\n\t\t// TODO: Deserialize payload\n\t\tthrow new ZWaveError(\n\t\t\t`${this.name}: deserialization not implemented`,\n\t\t\tZWaveErrorCodes.Deserialization_NotImplemented,\n\t\t);\n\t}\n\n\tpublic position: number | undefined;\n\tpublic tilt: number | undefined;\n\n\tpublic serialize(ctx: CCEncodingContext): Promise<Bytes> {\n\t\tconst controlByte = (this.position != undefined ? 0b10 : 0)\n\t\t\t| (this.tilt != undefined ? 0b01 : 0);\n\t\tthis.payload = Bytes.from([\n\t\t\tcontrolByte,\n\t\t\tthis.position ?? 0,\n\t\t\tthis.tilt ?? 0,\n\t\t]);\n\t\treturn super.serialize(ctx);\n\t}\n\n\tpublic toLogEntry(ctx?: GetValueDB): MessageOrCCLogEntry {\n\t\tconst message: MessageRecord = {};\n\t\tif (this.position != undefined) {\n\t\t\tmessage.position = this.position;\n\t\t}\n\t\tif (this.tilt != undefined) {\n\t\t\tmessage.tilt = this.tilt;\n\t\t}\n\t\treturn {\n\t\t\t...super.toLogEntry(ctx),\n\t\t\tmessage,\n\t\t};\n\t}\n}\n\n// @publicAPI\nexport interface FibaroVenetianBlindCCReportOptions {\n\tposition?: MaybeUnknown<number>;\n\ttilt?: MaybeUnknown<number>;\n}\n\n@fibaroCCCommand(FibaroVenetianBlindCCCommand.Report)\nexport class FibaroVenetianBlindCCReport extends FibaroVenetianBlindCC {\n\tpublic constructor(\n\t\toptions: WithAddress<FibaroVenetianBlindCCReportOptions>,\n\t) {\n\t\tsuper(options);\n\t\tthis.fibaroCCCommand = FibaroVenetianBlindCCCommand.Report;\n\n\t\t// TODO: Check implementation:\n\t\tthis.position = options.position;\n\t\tthis.tilt = options.tilt;\n\t}\n\n\tpublic static from(\n\t\traw: CCRaw,\n\t\tctx: CCParsingContext,\n\t): FibaroVenetianBlindCCReport {\n\t\tvalidatePayload(raw.payload.length >= 3);\n\t\t// When the node sends a report, payload[0] === 0b11. This is probably a\n\t\t// bit mask for position and tilt\n\t\tlet position: MaybeUnknown<number> | undefined;\n\t\tif (!!(raw.payload[0] & 0b10)) {\n\t\t\tposition = parseMaybeNumber(raw.payload[1]);\n\t\t}\n\n\t\tlet tilt: MaybeUnknown<number> | undefined;\n\t\tif (!!(raw.payload[0] & 0b01)) {\n\t\t\ttilt = parseMaybeNumber(raw.payload[2]);\n\t\t}\n\n\t\treturn new this({\n\t\t\tnodeId: ctx.sourceNodeId,\n\t\t\tposition,\n\t\t\ttilt,\n\t\t});\n\t}\n\n\tpublic persistValues(ctx: PersistValuesContext): boolean {\n\t\tif (!super.persistValues(ctx)) return false;\n\t\tconst valueDB = this.getValueDB(ctx);\n\n\t\tif (this.position != undefined) {\n\t\t\tconst positionValueId = getFibaroVenetianBlindPositionValueId(\n\t\t\t\tthis.endpointIndex,\n\t\t\t);\n\t\t\tvalueDB.setMetadata(positionValueId, {\n\t\t\t\t...ValueMetadata.Level,\n\t\t\t\tlabel: \"Venetian blinds position\",\n\t\t\t});\n\t\t\tvalueDB.setValue(positionValueId, this.position);\n\t\t}\n\t\tif (this.tilt != undefined) {\n\t\t\tconst tiltValueId = getFibaroVenetianBlindTiltValueId(\n\t\t\t\tthis.endpointIndex,\n\t\t\t);\n\t\t\tvalueDB.setMetadata(tiltValueId, {\n\t\t\t\t...ValueMetadata.Level,\n\t\t\t\tlabel: \"Venetian blinds tilt\",\n\t\t\t});\n\t\t\tvalueDB.setValue(tiltValueId, this.tilt);\n\t\t}\n\n\t\treturn true;\n\t}\n\n\tpublic position: MaybeUnknown<number> | undefined;\n\tpublic tilt: MaybeUnknown<number> | undefined;\n\n\tpublic toLogEntry(ctx?: GetValueDB): MessageOrCCLogEntry {\n\t\tconst message: MessageRecord = {};\n\t\tif (this.position != undefined) {\n\t\t\tmessage.position = this.position;\n\t\t}\n\t\tif (this.tilt != undefined) {\n\t\t\tmessage.tilt = this.tilt;\n\t\t}\n\t\treturn {\n\t\t\t...super.toLogEntry(ctx),\n\t\t\tmessage,\n\t\t};\n\t}\n}\n\n@fibaroCCCommand(FibaroVenetianBlindCCCommand.Get)\n@expectedCCResponse(FibaroVenetianBlindCCReport)\nexport class FibaroVenetianBlindCCGet extends FibaroVenetianBlindCC {\n\tpublic constructor(\n\t\toptions: CommandClassOptions,\n\t) {\n\t\tsuper(options);\n\t\tthis.fibaroCCCommand = FibaroVenetianBlindCCCommand.Get;\n\t}\n\n\tpublic static from(\n\t\traw: CCRaw,\n\t\tctx: CCParsingContext,\n\t): Fiba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MAAA,WAAA,MAAA,UAAA,UAAA,GAAA,MAAA,uBAAA;;;AAAa,wBAAA,YAAA,uBAAA;;IACZ,YACC,SAA4B;AAE5B,YAAM,OAAO;AACb,WAAK,kBAAkB,6BAA6B;IACrD;IAEO,OAAO,KACb,KACA,KAAqB;AAErB,aAAO,IAAI,KAAK;QACf,QAAQ,IAAI;OACZ;IACF;;;;",
6
6
  "names": ["FibaroCCIDs", "fibaroCCCommand", "FibaroCC", "FibaroVenetianBlindCCCommand"]
7
7
  }
@@ -12,4 +12,5 @@ export { defaultCCValueOptions } from "./lib/Values.js";
12
12
  export type { CCValueOptions, CCValuePredicate, PartialCCValuePredicate, } from "./lib/Values.js";
13
13
  export * from "./lib/_Types.js";
14
14
  export { utils };
15
+ export type * from "./lib/traits.js";
15
16
  //# sourceMappingURL=index.d.ts.map
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../src/index.ts"],
4
- "sourcesContent": ["import \"reflect-metadata\";\nimport * as utils from \"./lib/utils.js\";\n\nexport * from \"./cc/index.js\";\nexport * from \"./lib/API.js\";\nexport * from \"./lib/CommandClass.js\";\nexport * from \"./lib/CommandClassDecorators.js\";\nexport * from \"./lib/EncapsulatingCommandClass.js\";\nexport {\n\tMGRPExtension,\n\tMOSExtension,\n\tMPANExtension,\n\tSPANExtension,\n\tSecurity2Extension,\n\textensionType,\n\tgetExtensionType,\n\tgetS2ExtensionConstructor,\n} from \"./lib/Security2/Extension.js\";\nexport * from \"./lib/Security2/shared.js\";\nexport * from \"./lib/SetValueResult.js\";\nexport { defaultCCValueOptions } from \"./lib/Values.js\";\nexport type {\n\tCCValueOptions,\n\tCCValuePredicate,\n\tPartialCCValuePredicate,\n} from \"./lib/Values.js\";\nexport * from \"./lib/_Types.js\";\nexport { utils };\n"],
4
+ "sourcesContent": ["import \"reflect-metadata\";\nimport * as utils from \"./lib/utils.js\";\n\nexport * from \"./cc/index.js\";\nexport * from \"./lib/API.js\";\nexport * from \"./lib/CommandClass.js\";\nexport * from \"./lib/CommandClassDecorators.js\";\nexport * from \"./lib/EncapsulatingCommandClass.js\";\nexport {\n\tMGRPExtension,\n\tMOSExtension,\n\tMPANExtension,\n\tSPANExtension,\n\tSecurity2Extension,\n\textensionType,\n\tgetExtensionType,\n\tgetS2ExtensionConstructor,\n} from \"./lib/Security2/Extension.js\";\nexport * from \"./lib/Security2/shared.js\";\nexport * from \"./lib/SetValueResult.js\";\nexport { defaultCCValueOptions } from \"./lib/Values.js\";\nexport type {\n\tCCValueOptions,\n\tCCValuePredicate,\n\tPartialCCValuePredicate,\n} from \"./lib/Values.js\";\nexport * from \"./lib/_Types.js\";\nexport { utils };\nexport type * from \"./lib/traits.js\";\n"],
5
5
  "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;;;;;;;;;;;;;;AAAA,8BAAO;AACP,YAAuB;AAEvB,wBAAc,0BAHd;AAIA,wBAAc,yBAJd;AAKA,wBAAc,kCALd;AAMA,wBAAc,4CANd;AAOA,wBAAc,+CAPd;AAQA,uBASO;AACP,wBAAc,sCAlBd;AAmBA,wBAAc,oCAnBd;AAoBA,oBAAsC;AAMtC,wBAAc,4BA1Bd;",
6
6
  "names": []
7
7
  }
@@ -1,6 +1,15 @@
1
+ import * as utils from "./lib/utils.js";
2
+ export * from "./cc/index.js";
3
+ export * from "./lib/API.js";
4
+ export * from "./lib/CommandClass.js";
5
+ export * from "./lib/CommandClassDecorators.js";
6
+ export * from "./lib/EncapsulatingCommandClass.js";
7
+ export { MGRPExtension, MOSExtension, MPANExtension, SPANExtension, Security2Extension, extensionType, getExtensionType, getS2ExtensionConstructor, } from "./lib/Security2/Extension.js";
1
8
  export * from "./lib/Security2/shared.js";
2
9
  export * from "./lib/SetValueResult.js";
3
10
  export { defaultCCValueOptions } from "./lib/Values.js";
4
11
  export type { CCValueOptions, CCValuePredicate, PartialCCValuePredicate, } from "./lib/Values.js";
5
12
  export * from "./lib/_Types.js";
13
+ export type * from "./lib/traits.js";
14
+ export { utils };
6
15
  //# sourceMappingURL=index_browser.d.ts.map
@@ -1,7 +1,9 @@
1
1
  "use strict";
2
+ var __create = Object.create;
2
3
  var __defProp = Object.defineProperty;
3
4
  var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
5
  var __getOwnPropNames = Object.getOwnPropertyNames;
6
+ var __getProtoOf = Object.getPrototypeOf;
5
7
  var __hasOwnProp = Object.prototype.hasOwnProperty;
6
8
  var __export = (target, all) => {
7
9
  for (var name in all)
@@ -16,19 +18,57 @@ var __copyProps = (to, from, except, desc) => {
16
18
  return to;
17
19
  };
18
20
  var __reExport = (target, mod, secondTarget) => (__copyProps(target, mod, "default"), secondTarget && __copyProps(secondTarget, mod, "default"));
21
+ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
22
+ // If the importer is in node compatibility mode or this is not an ESM
23
+ // file that has been converted to a CommonJS file using a Babel-
24
+ // compatible transform (i.e. "__esModule" has not been set), then set
25
+ // "default" to the CommonJS "module.exports" for node compatibility.
26
+ isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
27
+ mod
28
+ ));
19
29
  var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
20
30
  var index_browser_exports = {};
21
31
  __export(index_browser_exports, {
22
- defaultCCValueOptions: () => import_Values.defaultCCValueOptions
32
+ MGRPExtension: () => import_Extension.MGRPExtension,
33
+ MOSExtension: () => import_Extension.MOSExtension,
34
+ MPANExtension: () => import_Extension.MPANExtension,
35
+ SPANExtension: () => import_Extension.SPANExtension,
36
+ Security2Extension: () => import_Extension.Security2Extension,
37
+ defaultCCValueOptions: () => import_Values.defaultCCValueOptions,
38
+ extensionType: () => import_Extension.extensionType,
39
+ getExtensionType: () => import_Extension.getExtensionType,
40
+ getS2ExtensionConstructor: () => import_Extension.getS2ExtensionConstructor,
41
+ utils: () => utils
23
42
  });
24
43
  module.exports = __toCommonJS(index_browser_exports);
44
+ var utils = __toESM(require("./lib/utils.js"), 1);
45
+ __reExport(index_browser_exports, require("./cc/index.js"), module.exports);
46
+ __reExport(index_browser_exports, require("./lib/API.js"), module.exports);
47
+ __reExport(index_browser_exports, require("./lib/CommandClass.js"), module.exports);
48
+ __reExport(index_browser_exports, require("./lib/CommandClassDecorators.js"), module.exports);
49
+ __reExport(index_browser_exports, require("./lib/EncapsulatingCommandClass.js"), module.exports);
50
+ var import_Extension = require("./lib/Security2/Extension.js");
25
51
  __reExport(index_browser_exports, require("./lib/Security2/shared.js"), module.exports);
26
52
  __reExport(index_browser_exports, require("./lib/SetValueResult.js"), module.exports);
27
53
  var import_Values = require("./lib/Values.js");
28
54
  __reExport(index_browser_exports, require("./lib/_Types.js"), module.exports);
29
55
  // Annotate the CommonJS export names for ESM import in node:
30
56
  0 && (module.exports = {
57
+ MGRPExtension,
58
+ MOSExtension,
59
+ MPANExtension,
60
+ SPANExtension,
61
+ Security2Extension,
31
62
  defaultCCValueOptions,
63
+ extensionType,
64
+ getExtensionType,
65
+ getS2ExtensionConstructor,
66
+ utils,
67
+ ...require("./cc/index.js"),
68
+ ...require("./lib/API.js"),
69
+ ...require("./lib/CommandClass.js"),
70
+ ...require("./lib/CommandClassDecorators.js"),
71
+ ...require("./lib/EncapsulatingCommandClass.js"),
32
72
  ...require("./lib/Security2/shared.js"),
33
73
  ...require("./lib/SetValueResult.js"),
34
74
  ...require("./lib/_Types.js")
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../src/index_browser.ts"],
4
- "sourcesContent": ["/* @forbiddenImports external */\n\nexport * from \"./lib/Security2/shared.js\";\nexport * from \"./lib/SetValueResult.js\";\n// eslint-disable-next-line @zwave-js/no-forbidden-imports -- FIXME: This is actually wrong, but I need to get the release done\nexport { defaultCCValueOptions } from \"./lib/Values.js\";\nexport type {\n\tCCValueOptions,\n\tCCValuePredicate,\n\tPartialCCValuePredicate,\n} from \"./lib/Values.js\";\nexport * from \"./lib/_Types.js\";\n"],
5
- "mappings": ";;;;;;;;;;;;;;;;;;;AAAA;;;;;AAEA,kCAAc,sCAFd;AAGA,kCAAc,oCAHd;AAKA,oBAAsC;AAMtC,kCAAc,4BAXd;",
4
+ "sourcesContent": ["/* @forbiddenImports external */\nimport * as utils from \"./lib/utils.js\";\n\nexport * from \"./cc/index.js\";\nexport * from \"./lib/API.js\";\nexport * from \"./lib/CommandClass.js\";\nexport * from \"./lib/CommandClassDecorators.js\";\nexport * from \"./lib/EncapsulatingCommandClass.js\";\nexport {\n\tMGRPExtension,\n\tMOSExtension,\n\tMPANExtension,\n\tSPANExtension,\n\tSecurity2Extension,\n\textensionType,\n\tgetExtensionType,\n\tgetS2ExtensionConstructor,\n} from \"./lib/Security2/Extension.js\";\nexport * from \"./lib/Security2/shared.js\";\nexport * from \"./lib/SetValueResult.js\";\nexport { defaultCCValueOptions } from \"./lib/Values.js\";\nexport type {\n\tCCValueOptions,\n\tCCValuePredicate,\n\tPartialCCValuePredicate,\n} from \"./lib/Values.js\";\nexport * from \"./lib/_Types.js\";\nexport type * from \"./lib/traits.js\";\nexport { utils };\n"],
5
+ "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;;;;;;;;;;;;;;AACA,YAAuB;AAEvB,kCAAc,0BAHd;AAIA,kCAAc,yBAJd;AAKA,kCAAc,kCALd;AAMA,kCAAc,4CANd;AAOA,kCAAc,+CAPd;AAQA,uBASO;AACP,kCAAc,sCAlBd;AAmBA,kCAAc,oCAnBd;AAoBA,oBAAsC;AAMtC,kCAAc,4BA1Bd;",
6
6
  "names": []
7
7
  }
@@ -1,6 +1,8 @@
1
- import { CommandClasses, type ControlsCC, type Duration, type EndpointId, type GetEndpoint, type ListenBehavior, type MaybeNotKnown, NODE_ID_BROADCAST, NODE_ID_BROADCAST_LR, type NodeId, type PhysicalNodes, type QueryNodeStatus, type SecurityManagers, type SendCommandOptions, type SupervisionResult, type SupportsCC, type TXReport, type ValueChangeOptions, type ValueDB, type ValueID, type VirtualEndpointId } from "@zwave-js/core";
2
- import type { GetCommunicationTimeouts, GetDeviceConfig, GetNode, GetSafeCCVersion, GetSupportedCCVersion, GetUserPreferences, GetValueDB, HostIDs, LogNode, SchedulePoll, SendCommand } from "@zwave-js/host";
1
+ import { type SendCommand } from "@zwave-js/cc";
2
+ import { type GetDeviceConfig } from "@zwave-js/config";
3
+ import { CommandClasses, type ControlsCC, type Duration, type EndpointId, type GetEndpoint, type GetNode, type GetSafeCCVersion, type GetSupportedCCVersion, type GetValueDB, type HostIDs, type ListenBehavior, type LogNode, type MaybeNotKnown, NODE_ID_BROADCAST, NODE_ID_BROADCAST_LR, type NodeId, type PhysicalNodes, type QueryNodeStatus, type SecurityManagers, type SendCommandOptions, type SupervisionResult, type SupportsCC, type TXReport, type ValueChangeOptions, type ValueDB, type ValueID, type VirtualEndpointId } from "@zwave-js/core";
3
4
  import { type AllOrNone, type OnlyMethods } from "@zwave-js/shared";
5
+ import { type GetRefreshValueTimeouts, type GetUserPreferences, type SchedulePoll } from "./traits.js";
4
6
  export type ValueIDProperties = Pick<ValueID, "property" | "propertyKey">;
5
7
  /** Used to identify the method on the CC API class that handles setting values on nodes directly */
6
8
  export declare const SET_VALUE: unique symbol;
@@ -29,11 +31,11 @@ export declare function throwUnsupportedProperty(cc: CommandClasses, property: s
29
31
  export declare function throwUnsupportedPropertyKey(cc: CommandClasses, property: string | number, propertyKey: string | number): never;
30
32
  export declare function throwMissingPropertyKey(cc: CommandClasses, property: string | number): never;
31
33
  export declare function throwWrongValueType(cc: CommandClasses, property: string | number, expectedType: string, receivedType: string): never;
32
- export interface SchedulePollOptions {
34
+ export interface CCAPISchedulePollOptions {
33
35
  duration?: Duration;
34
36
  transition?: "fast" | "slow";
35
37
  }
36
- export type CCAPIHost<TNode extends CCAPINode = CCAPINode> = HostIDs & GetNode<TNode> & GetValueDB & GetSupportedCCVersion & GetSafeCCVersion & SecurityManagers & GetDeviceConfig & SendCommand & GetCommunicationTimeouts & GetUserPreferences & SchedulePoll & LogNode;
38
+ export type CCAPIHost<TNode extends CCAPINode = CCAPINode> = HostIDs & GetNode<TNode> & GetValueDB & GetSupportedCCVersion & GetSafeCCVersion & SecurityManagers & GetDeviceConfig & SendCommand & GetRefreshValueTimeouts & GetUserPreferences & SchedulePoll & LogNode;
37
39
  export type CCAPINode = NodeId & ListenBehavior & QueryNodeStatus;
38
40
  export type CCAPIEndpoint = ((EndpointId & ControlsCC) | (VirtualEndpointId & {
39
41
  node: PhysicalNodes<NodeId & SupportsCC & ControlsCC & GetEndpoint<EndpointId & SupportsCC & ControlsCC>>;
@@ -76,7 +78,7 @@ export declare class CCAPI {
76
78
  * Schedules a value to be polled after a given time. Schedules are deduplicated on a per-property basis.
77
79
  * @returns `true` if the poll was scheduled, `false` otherwise
78
80
  */
79
- protected schedulePoll({ property, propertyKey }: ValueIDProperties, expectedValue: unknown, { duration, transition }?: SchedulePollOptions): boolean;
81
+ protected schedulePoll({ property, propertyKey }: ValueIDProperties, expectedValue: unknown, { duration, transition }?: CCAPISchedulePollOptions): boolean;
80
82
  /**
81
83
  * Retrieves the version of the given CommandClass this endpoint implements
82
84
  */
@@ -142,7 +142,7 @@ class CCAPI {
142
142
  */
143
143
  schedulePoll({ property, propertyKey }, expectedValue, { duration, transition = "slow" } = {}) {
144
144
  const durationMs = duration?.toMilliseconds() ?? 0;
145
- const timeouts = this.host.getCommunicationTimeouts();
145
+ const timeouts = this.host.getRefreshValueTimeouts();
146
146
  const additionalDelay = !!durationMs || transition === "fast" ? timeouts.refreshValueAfterTransition : timeouts.refreshValue;
147
147
  const timeoutMs = durationMs + additionalDelay;
148
148
  if (this.isSinglecast()) {
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../src/lib/API.ts"],
4
- "sourcesContent": ["import { type CompatOverrideQueries } from \"@zwave-js/config\";\nimport {\n\tCommandClasses,\n\ttype ControlsCC,\n\ttype Duration,\n\ttype EndpointId,\n\ttype GetEndpoint,\n\ttype ListenBehavior,\n\ttype MaybeNotKnown,\n\tNODE_ID_BROADCAST,\n\tNODE_ID_BROADCAST_LR,\n\tNOT_KNOWN,\n\ttype NodeId,\n\ttype PhysicalNodes,\n\ttype QueryNodeStatus,\n\ttype SecurityManagers,\n\ttype SendCommandOptions,\n\ttype SupervisionResult,\n\ttype SupportsCC,\n\ttype TXReport,\n\ttype ValueChangeOptions,\n\ttype ValueDB,\n\ttype ValueID,\n\ttype VirtualEndpointId,\n\tZWaveError,\n\tZWaveErrorCodes,\n\tgetCCName,\n\tstripUndefined,\n} from \"@zwave-js/core\";\nimport type {\n\tGetCommunicationTimeouts,\n\tGetDeviceConfig,\n\tGetNode,\n\tGetSafeCCVersion,\n\tGetSupportedCCVersion,\n\tGetUserPreferences,\n\tGetValueDB,\n\tHostIDs,\n\tLogNode,\n\tSchedulePoll,\n\tSendCommand,\n} from \"@zwave-js/host\";\nimport {\n\ttype AllOrNone,\n\ttype OnlyMethods,\n\tgetEnumMemberName,\n\tgetErrorMessage,\n\tnum2hex,\n} from \"@zwave-js/shared\";\nimport { isArray } from \"alcalzone-shared/typeguards\";\nimport {\n\tgetAPI,\n\tgetCCValues,\n\tgetCommandClass,\n\tgetImplementedVersion,\n} from \"./CommandClassDecorators.js\";\nimport { type CCValue, type StaticCCValue } from \"./Values.js\";\n\nexport type ValueIDProperties = Pick<ValueID, \"property\" | \"propertyKey\">;\n\n/** Used to identify the method on the CC API class that handles setting values on nodes directly */\nexport const SET_VALUE: unique symbol = Symbol.for(\"CCAPI_SET_VALUE\");\n\nexport type SetValueImplementation = (\n\tproperty: ValueIDProperties,\n\tvalue: unknown,\n\toptions?: SetValueAPIOptions,\n) => Promise<SupervisionResult | undefined>;\n\nexport const SET_VALUE_HOOKS: unique symbol = Symbol.for(\n\t\"CCAPI_SET_VALUE_HOOKS\",\n);\n\nexport type SetValueImplementationHooks =\n\t& AllOrNone<{\n\t\t// Opt-in to and handle delayed supervision updates\n\t\tsupervisionDelayedUpdates: boolean;\n\t\tsupervisionOnSuccess: () => void | Promise<void>;\n\t\tsupervisionOnFailure: () => void | Promise<void>;\n\t}>\n\t& {\n\t\t// Optimistically update related cached values (if allowed)\n\t\toptimisticallyUpdateRelatedValues?: (\n\t\t\tsupervisedAndSuccessful: boolean,\n\t\t) => void;\n\t\t// Check if a verification of the set value is required, even if the API response suggests otherwise\n\t\tforceVerifyChanges?: () => boolean;\n\t\t// Verify the changes\n\t\tverifyChanges?: () => void | Promise<void>;\n\t};\n\nexport type SetValueImplementationHooksFactory = (\n\tproperty: ValueIDProperties,\n\tvalue: unknown,\n\toptions?: SetValueAPIOptions,\n) => SetValueImplementationHooks | undefined;\n\n/**\n * A generic options bag for the `setValue` API.\n * Each implementation will choose the options that are relevant for it, so you can use the same options everywhere.\n * @publicAPI\n */\nexport type SetValueAPIOptions =\n\t& Partial<ValueChangeOptions>\n\t& Pick<SendCommandOptions, \"onProgress\">;\n\n/** Used to identify the method on the CC API class that handles polling values from nodes */\nexport const POLL_VALUE: unique symbol = Symbol.for(\"CCAPI_POLL_VALUE\");\nexport type PollValueImplementation<T = unknown> = (\n\tproperty: ValueIDProperties,\n) => Promise<T | undefined>;\n\n// Since the setValue API is called from a point with very generic parameters,\n// we must do narrowing inside the API calls. These three methods are for convenience\nexport function throwUnsupportedProperty(\n\tcc: CommandClasses,\n\tproperty: string | number,\n): never {\n\tthrow new ZWaveError(\n\t\t`${CommandClasses[cc]}: \"${property}\" is not a supported property`,\n\t\tZWaveErrorCodes.Argument_Invalid,\n\t);\n}\n\nexport function throwUnsupportedPropertyKey(\n\tcc: CommandClasses,\n\tproperty: string | number,\n\tpropertyKey: string | number,\n): never {\n\tthrow new ZWaveError(\n\t\t`${\n\t\t\tCommandClasses[cc]\n\t\t}: \"${propertyKey}\" is not a supported property key for property \"${property}\"`,\n\t\tZWaveErrorCodes.Argument_Invalid,\n\t);\n}\n\nexport function throwMissingPropertyKey(\n\tcc: CommandClasses,\n\tproperty: string | number,\n): never {\n\tthrow new ZWaveError(\n\t\t`${\n\t\t\tCommandClasses[cc]\n\t\t}: property \"${property}\" requires a property key, but none was given`,\n\t\tZWaveErrorCodes.Argument_Invalid,\n\t);\n}\n\nexport function throwWrongValueType(\n\tcc: CommandClasses,\n\tproperty: string | number,\n\texpectedType: string,\n\treceivedType: string,\n): never {\n\tthrow new ZWaveError(\n\t\t`${\n\t\t\tCommandClasses[cc]\n\t\t}: \"${property}\" must be of type \"${expectedType}\", received \"${receivedType}\"`,\n\t\tZWaveErrorCodes.Argument_Invalid,\n\t);\n}\n\nexport interface SchedulePollOptions {\n\tduration?: Duration;\n\ttransition?: \"fast\" | \"slow\";\n}\n\n// Defines the necessary traits the host passed to a CC API must have\nexport type CCAPIHost<TNode extends CCAPINode = CCAPINode> =\n\t& HostIDs\n\t& GetNode<TNode>\n\t& GetValueDB\n\t& GetSupportedCCVersion\n\t& GetSafeCCVersion\n\t& SecurityManagers\n\t& GetDeviceConfig\n\t& SendCommand\n\t& GetCommunicationTimeouts\n\t& GetUserPreferences\n\t& SchedulePoll\n\t& LogNode;\n\n// Defines the necessary traits a node passed to a CC API must have\nexport type CCAPINode = NodeId & ListenBehavior & QueryNodeStatus;\n\n// Defines the necessary traits an endpoint passed to a CC API must have\nexport type CCAPIEndpoint =\n\t& (\n\t\t| (\n\t\t\t// Physical endpoints must let us query their controlled CCs\n\t\t\tEndpointId & ControlsCC\n\t\t)\n\t\t| (\n\t\t\t// Virtual endpoints must let us query their physical nodes,\n\t\t\t// the CCs those nodes implement, and access the endpoints of those\n\t\t\t// physical nodes\n\t\t\tVirtualEndpointId & {\n\t\t\t\tnode: PhysicalNodes<\n\t\t\t\t\t& NodeId\n\t\t\t\t\t& SupportsCC\n\t\t\t\t\t& ControlsCC\n\t\t\t\t\t& GetEndpoint<EndpointId & SupportsCC & ControlsCC>\n\t\t\t\t>;\n\t\t\t}\n\t\t)\n\t)\n\t& SupportsCC;\n\nexport type PhysicalCCAPIEndpoint = CCAPIEndpoint & EndpointId;\nexport type VirtualCCAPIEndpoint = CCAPIEndpoint & VirtualEndpointId;\n\n/**\n * The base class for all CC APIs exposed via `Node.commandClasses.<CCName>`\n * @publicAPI\n */\nexport class CCAPI {\n\tpublic constructor(\n\t\tprotected readonly host: CCAPIHost,\n\t\tprotected readonly endpoint: CCAPIEndpoint,\n\t) {\n\t\tthis.ccId = getCommandClass(this);\n\t}\n\n\tpublic static create<T extends CommandClasses>(\n\t\tccId: T,\n\t\thost: CCAPIHost,\n\t\tendpoint: CCAPIEndpoint,\n\t\trequireSupport?: boolean,\n\t): CommandClasses extends T ? CCAPI : CCToAPI<T> {\n\t\tconst APIConstructor = getAPI(ccId);\n\t\tconst ccName = CommandClasses[ccId];\n\t\tif (APIConstructor == undefined) {\n\t\t\tthrow new ZWaveError(\n\t\t\t\t`Command Class ${ccName} (${\n\t\t\t\t\tnum2hex(\n\t\t\t\t\t\tccId,\n\t\t\t\t\t)\n\t\t\t\t}) has no associated API!`,\n\t\t\t\tZWaveErrorCodes.CC_NoAPI,\n\t\t\t);\n\t\t}\n\t\tconst apiInstance = new APIConstructor(host, endpoint);\n\n\t\t// Only require support for physical endpoints by default\n\t\trequireSupport ??= !endpoint.virtual;\n\n\t\tif (requireSupport) {\n\t\t\t// @ts-expect-error TS doesn't like assigning to conditional types\n\t\t\treturn new Proxy(apiInstance, {\n\t\t\t\tget: (target, property) => {\n\t\t\t\t\t// Forbid access to the API if it is not supported by the node\n\t\t\t\t\tif (\n\t\t\t\t\t\tproperty !== \"ccId\"\n\t\t\t\t\t\t&& property !== \"endpoint\"\n\t\t\t\t\t\t&& property !== \"isSupported\"\n\t\t\t\t\t\t&& property !== \"withOptions\"\n\t\t\t\t\t\t&& property !== \"commandOptions\"\n\t\t\t\t\t\t&& !target.isSupported()\n\t\t\t\t\t) {\n\t\t\t\t\t\tlet messageStart: string;\n\t\t\t\t\t\tif (endpoint.virtual) {\n\t\t\t\t\t\t\tconst hasNodeId =\n\t\t\t\t\t\t\t\ttypeof endpoint.nodeId === \"number\"\n\t\t\t\t\t\t\t\t&& endpoint.nodeId !== NODE_ID_BROADCAST\n\t\t\t\t\t\t\t\t&& endpoint.nodeId !== NODE_ID_BROADCAST_LR;\n\t\t\t\t\t\t\tmessageStart = `${\n\t\t\t\t\t\t\t\thasNodeId ? \"The\" : \"This\"\n\t\t\t\t\t\t\t} virtual node${\n\t\t\t\t\t\t\t\thasNodeId ? ` ${endpoint.nodeId}` : \"\"\n\t\t\t\t\t\t\t}`;\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tmessageStart = `Node ${endpoint.nodeId}`;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tthrow new ZWaveError(\n\t\t\t\t\t\t\t`${messageStart}${\n\t\t\t\t\t\t\t\tendpoint.index === 0\n\t\t\t\t\t\t\t\t\t? \"\"\n\t\t\t\t\t\t\t\t\t: ` (endpoint ${endpoint.index})`\n\t\t\t\t\t\t\t} does not support the Command Class ${ccName}!`,\n\t\t\t\t\t\t\tZWaveErrorCodes.CC_NotSupported,\n\t\t\t\t\t\t);\n\t\t\t\t\t}\n\n\t\t\t\t\t// If a device config defines overrides for an API call, return a wrapper method that applies them first before calling the actual method\n\t\t\t\t\tconst fallback = target[property as keyof CCAPI];\n\t\t\t\t\tif (\n\t\t\t\t\t\ttypeof property === \"string\"\n\t\t\t\t\t\t&& !endpoint.virtual\n\t\t\t\t\t\t&& typeof fallback === \"function\"\n\t\t\t\t\t) {\n\t\t\t\t\t\tconst overrides = host.getDeviceConfig?.(\n\t\t\t\t\t\t\tendpoint.nodeId,\n\t\t\t\t\t\t)?.compat?.overrideQueries;\n\t\t\t\t\t\tif (overrides?.hasOverride(ccId)) {\n\t\t\t\t\t\t\treturn overrideQueriesWrapper(\n\t\t\t\t\t\t\t\thost,\n\t\t\t\t\t\t\t\tendpoint,\n\t\t\t\t\t\t\t\tccId,\n\t\t\t\t\t\t\t\tproperty,\n\t\t\t\t\t\t\t\toverrides,\n\t\t\t\t\t\t\t\tfallback,\n\t\t\t\t\t\t\t);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\n\t\t\t\t\t// Else just access the property\n\t\t\t\t\treturn fallback;\n\t\t\t\t},\n\t\t\t});\n\t\t} else {\n\t\t\t// @ts-expect-error TS doesn't like assigning to conditional types\n\t\t\treturn apiInstance;\n\t\t}\n\t}\n\n\t/**\n\t * The identifier of the Command Class this API is for\n\t */\n\tpublic readonly ccId: CommandClasses;\n\n\tprotected get [SET_VALUE](): SetValueImplementation | undefined {\n\t\treturn undefined;\n\t}\n\n\t/**\n\t * Can be used on supported CC APIs to set a CC value by property name (and optionally the property key).\n\t * **WARNING:** This function is NOT bound to an API instance. It must be called with the correct `this` context!\n\t */\n\tpublic get setValue(): SetValueImplementation | undefined {\n\t\treturn this[SET_VALUE];\n\t}\n\n\tprotected [SET_VALUE_HOOKS]: SetValueImplementationHooksFactory | undefined;\n\t/**\n\t * Can be implemented by CC APIs to influence the behavior of the setValue API in regards to Supervision and verifying values.\n\t */\n\tpublic get setValueHooks(): SetValueImplementationHooksFactory | undefined {\n\t\treturn this[SET_VALUE_HOOKS];\n\t}\n\n\t/** Whether a successful setValue call should imply that the value was successfully updated */\n\t// eslint-disable-next-line @typescript-eslint/no-unused-vars\n\tpublic isSetValueOptimistic(valueId: ValueID): boolean {\n\t\treturn true;\n\t}\n\n\tprotected get [POLL_VALUE](): PollValueImplementation | undefined {\n\t\treturn undefined;\n\t}\n\t/**\n\t * Can be used on supported CC APIs to poll a CC value by property name (and optionally the property key)\n\t * **WARNING:** This function is NOT bound to an API instance. It must be called with the correct `this` context!\n\t */\n\tpublic get pollValue(): PollValueImplementation | undefined {\n\t\treturn this[POLL_VALUE];\n\t}\n\n\t/**\n\t * Schedules a value to be polled after a given time. Schedules are deduplicated on a per-property basis.\n\t * @returns `true` if the poll was scheduled, `false` otherwise\n\t */\n\tprotected schedulePoll(\n\t\t{ property, propertyKey }: ValueIDProperties,\n\t\texpectedValue: unknown,\n\t\t{ duration, transition = \"slow\" }: SchedulePollOptions = {},\n\t): boolean {\n\t\t// Figure out the delay. If a non-zero duration was given or this is a \"fast\" transition,\n\t\t// use/add the short delay. Otherwise, default to the long delay.\n\t\tconst durationMs = duration?.toMilliseconds() ?? 0;\n\t\tconst timeouts = this.host.getCommunicationTimeouts();\n\t\tconst additionalDelay = !!durationMs || transition === \"fast\"\n\t\t\t? timeouts.refreshValueAfterTransition\n\t\t\t: timeouts.refreshValue;\n\t\tconst timeoutMs = durationMs + additionalDelay;\n\n\t\tif (this.isSinglecast()) {\n\t\t\tconst node = this.host.getNode(this.endpoint.nodeId);\n\t\t\tif (!node) return false;\n\n\t\t\treturn this.host.schedulePoll(\n\t\t\t\tnode.id,\n\t\t\t\t{\n\t\t\t\t\tcommandClass: this.ccId,\n\t\t\t\t\tendpoint: this.endpoint.index,\n\t\t\t\t\tproperty,\n\t\t\t\t\tpropertyKey,\n\t\t\t\t},\n\t\t\t\t{ timeoutMs, expectedValue },\n\t\t\t);\n\t\t} else if (this.isMulticast()) {\n\t\t\t// Only poll supporting nodes in multicast\n\t\t\tconst supportingNodes = this.endpoint.node.physicalNodes.filter(\n\t\t\t\t(node) =>\n\t\t\t\t\tnode\n\t\t\t\t\t\t.getEndpoint(this.endpoint.index)\n\t\t\t\t\t\t?.supportsCC(this.ccId),\n\t\t\t);\n\t\t\tlet ret = false;\n\t\t\tfor (const node of supportingNodes) {\n\t\t\t\tret ||= this.host.schedulePoll(\n\t\t\t\t\tnode.id,\n\t\t\t\t\t{\n\t\t\t\t\t\tcommandClass: this.ccId,\n\t\t\t\t\t\tendpoint: this.endpoint.index,\n\t\t\t\t\t\tproperty,\n\t\t\t\t\t\tpropertyKey,\n\t\t\t\t\t},\n\t\t\t\t\t{ timeoutMs, expectedValue },\n\t\t\t\t);\n\t\t\t}\n\t\t\treturn ret;\n\t\t} else {\n\t\t\t// Don't poll the broadcast node\n\t\t\treturn false;\n\t\t}\n\t}\n\n\t/**\n\t * Retrieves the version of the given CommandClass this endpoint implements\n\t */\n\tpublic get version(): number {\n\t\tif (this.isSinglecast()) {\n\t\t\treturn this.host.getSafeCCVersion(\n\t\t\t\tthis.ccId,\n\t\t\t\tthis.endpoint.nodeId,\n\t\t\t\tthis.endpoint.index,\n\t\t\t) ?? 0;\n\t\t} else {\n\t\t\treturn getImplementedVersion(this.ccId);\n\t\t}\n\t}\n\n\t/** Determines if this simplified API instance may be used. */\n\tpublic isSupported(): boolean {\n\t\treturn (\n\t\t\t// NoOperation is always supported\n\t\t\tthis.ccId === CommandClasses[\"No Operation\"]\n\t\t\t// Basic should always be supported. Since we are trying to hide it from library consumers\n\t\t\t// we cannot trust supportsCC to test it\n\t\t\t|| this.ccId === CommandClasses.Basic\n\t\t\t|| this.endpoint.supportsCC(this.ccId)\n\t\t);\n\t}\n\n\t/**\n\t * Determine whether the linked node supports a specific command of this command class.\n\t * {@link NOT_KNOWN} (`undefined`) means that the information has not been received yet\n\t */\n\t// eslint-disable-next-line @typescript-eslint/no-unused-vars\n\tpublic supportsCommand(command: number): MaybeNotKnown<boolean> {\n\t\t// This needs to be overwritten per command class. In the default implementation, we don't know anything!\n\t\treturn NOT_KNOWN;\n\t}\n\n\tprotected assertSupportsCommand(\n\t\tcommandEnum: unknown,\n\t\tcommand: number,\n\t): void {\n\t\tif (this.supportsCommand(command) !== true) {\n\t\t\tthrow new ZWaveError(\n\t\t\t\t`${\n\t\t\t\t\tthis.isSinglecast()\n\t\t\t\t\t\t? `Node #${this.endpoint.nodeId}`\n\t\t\t\t\t\t: \"This virtual node\"\n\t\t\t\t}${\n\t\t\t\t\tthis.endpoint.index > 0\n\t\t\t\t\t\t? ` (Endpoint ${this.endpoint.index})`\n\t\t\t\t\t\t: \"\"\n\t\t\t\t} does not support the command ${\n\t\t\t\t\tgetEnumMemberName(\n\t\t\t\t\t\tcommandEnum,\n\t\t\t\t\t\tcommand,\n\t\t\t\t\t)\n\t\t\t\t}!`,\n\t\t\t\tZWaveErrorCodes.CC_NotSupported,\n\t\t\t);\n\t\t}\n\t}\n\n\tprotected assertPhysicalEndpoint(\n\t\tendpoint: EndpointId | VirtualEndpointId,\n\t): asserts endpoint is EndpointId {\n\t\tif (endpoint.virtual) {\n\t\t\tthrow new ZWaveError(\n\t\t\t\t`This method is not supported for virtual nodes!`,\n\t\t\t\tZWaveErrorCodes.CC_NotSupported,\n\t\t\t);\n\t\t}\n\t}\n\n\t/** Returns the command options to use for sendCommand calls */\n\tprotected get commandOptions(): SendCommandOptions {\n\t\t// No default options\n\t\treturn {};\n\t}\n\n\t/** Creates an instance of this API, scoped to use the given options */\n\tpublic withOptions(options: SendCommandOptions): this {\n\t\tconst mergedOptions = {\n\t\t\t...this.commandOptions,\n\t\t\t...options,\n\t\t};\n\t\treturn new Proxy(this, {\n\t\t\tget: (target, property) => {\n\t\t\t\tif (property === \"commandOptions\") {\n\t\t\t\t\treturn mergedOptions;\n\t\t\t\t} else {\n\t\t\t\t\treturn (target as any)[property];\n\t\t\t\t}\n\t\t\t},\n\t\t});\n\t}\n\n\t/** Creates an instance of this API which (if supported) will return TX reports along with the result. */\n\tpublic withTXReport<T extends this>(): WithTXReport<T> {\n\t\tif (this.constructor === CCAPI) {\n\t\t\tthrow new ZWaveError(\n\t\t\t\t\"The withTXReport method may only be called on specific CC API implementations.\",\n\t\t\t\tZWaveErrorCodes.Driver_NotSupported,\n\t\t\t);\n\t\t}\n\n\t\t// Remember which properties need to be proxied\n\t\tconst proxiedProps = new Set([\n\t\t\t// These are the CC-specific methods\n\t\t\t...Object.getOwnPropertyNames(this.constructor.prototype),\n\t\t\t// as well as setValue and pollValue\n\t\t\t\"setValue\",\n\t\t\t\"pollValue\",\n\t\t]);\n\t\tproxiedProps.delete(\"constructor\");\n\n\t\tfunction wrapResult<T>(result: T, txReport: TXReport): any {\n\t\t\t// Both the result and the TX report may be undefined (no response, no support)\n\t\t\treturn stripUndefined({\n\t\t\t\tresult,\n\t\t\t\ttxReport,\n\t\t\t});\n\t\t}\n\n\t\treturn new Proxy(this, {\n\t\t\tget: (target, prop) => {\n\t\t\t\tif (prop === \"withTXReport\") return undefined;\n\n\t\t\t\tlet original: any = (target as any)[prop];\n\t\t\t\tif (\n\t\t\t\t\tproxiedProps.has(prop as string)\n\t\t\t\t\t&& typeof original === \"function\"\n\t\t\t\t) {\n\t\t\t\t\t// This is a method that only exists in the specific implementation\n\n\t\t\t\t\t// Wrap each call with its own API proxy, so we don't mix up TX reports\n\t\t\t\t\tlet txReport: TXReport;\n\t\t\t\t\tconst api = target.withOptions({\n\t\t\t\t\t\tonTXReport: (report) => {\n\t\t\t\t\t\t\t// Remember the last status report\n\t\t\t\t\t\t\ttxReport = report;\n\t\t\t\t\t\t},\n\t\t\t\t\t});\n\t\t\t\t\toriginal = (api as any)[prop].bind(api);\n\n\t\t\t\t\t// Return a wrapper function that will add the status report after the call is complete\n\t\t\t\t\treturn (...args: any) => {\n\t\t\t\t\t\tlet result = original(...args);\n\t\t\t\t\t\tif (result instanceof Promise) {\n\t\t\t\t\t\t\tresult = result.then((res) =>\n\t\t\t\t\t\t\t\twrapResult(res, txReport)\n\t\t\t\t\t\t\t);\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tresult = wrapResult(result, txReport);\n\t\t\t\t\t\t}\n\t\t\t\t\t\treturn result;\n\t\t\t\t\t};\n\t\t\t\t} else {\n\t\t\t\t\treturn original;\n\t\t\t\t}\n\t\t\t},\n\t\t}) as any;\n\t}\n\n\tprotected isSinglecast(): this is this & {\n\t\tendpoint: PhysicalCCAPIEndpoint;\n\t} {\n\t\treturn (\n\t\t\t!this.endpoint.virtual\n\t\t\t&& typeof this.endpoint.nodeId === \"number\"\n\t\t\t&& this.endpoint.nodeId !== NODE_ID_BROADCAST\n\t\t\t&& this.endpoint.nodeId !== NODE_ID_BROADCAST_LR\n\t\t);\n\t}\n\n\tprotected isMulticast(): this is this & {\n\t\tendpoint: VirtualCCAPIEndpoint & {\n\t\t\tnodeId: number[];\n\t\t};\n\t} {\n\t\treturn this.endpoint.virtual && isArray(this.endpoint.nodeId);\n\t}\n\n\tprotected isBroadcast(): this is this & {\n\t\tendpoint: VirtualCCAPIEndpoint & {\n\t\t\tnodeId: typeof NODE_ID_BROADCAST | typeof NODE_ID_BROADCAST_LR;\n\t\t};\n\t} {\n\t\treturn (\n\t\t\tthis.endpoint.virtual\n\t\t\t&& (this.endpoint.nodeId === NODE_ID_BROADCAST\n\t\t\t\t|| this.endpoint.nodeId === NODE_ID_BROADCAST_LR)\n\t\t);\n\t}\n\n\t/** Returns the value DB for this CC API's node (if it can be safely accessed) */\n\tprotected tryGetValueDB(): ValueDB | undefined {\n\t\tif (!this.isSinglecast()) return;\n\t\ttry {\n\t\t\treturn this.host.getValueDB(this.endpoint.nodeId);\n\t\t} catch {\n\t\t\treturn;\n\t\t}\n\t}\n\n\t/** Returns the value DB for this CC's node (or throws if it cannot be accessed) */\n\tprotected getValueDB(): ValueDB {\n\t\tif (this.isSinglecast()) {\n\t\t\ttry {\n\t\t\t\treturn this.host.getValueDB(this.endpoint.nodeId);\n\t\t\t} catch {\n\t\t\t\tthrow new ZWaveError(\n\t\t\t\t\t\"The node for this CC does not exist or the driver is not ready yet\",\n\t\t\t\t\tZWaveErrorCodes.Driver_NotReady,\n\t\t\t\t);\n\t\t\t}\n\t\t}\n\t\tthrow new ZWaveError(\n\t\t\t\"Cannot retrieve the value DB for non-singlecast CCs\",\n\t\t\tZWaveErrorCodes.CC_NoNodeID,\n\t\t);\n\t}\n}\n\nfunction overrideQueriesWrapper(\n\tctx: GetValueDB & LogNode,\n\tendpoint: PhysicalCCAPIEndpoint,\n\tccId: CommandClasses,\n\tmethod: string,\n\toverrides: CompatOverrideQueries,\n\tfallback: (...args: any[]) => any,\n): (...args: any[]) => any {\n\t// We must not capture the `this` context here, because the API methods are bound on use\n\treturn function(this: any, ...args: any[]) {\n\t\tconst match = overrides.matchOverride(\n\t\t\tccId,\n\t\t\tendpoint.index,\n\t\t\tmethod,\n\t\t\targs,\n\t\t);\n\t\tif (!match) return fallback.call(this, ...args);\n\n\t\tctx.logNode(endpoint.nodeId, {\n\t\t\tmessage: `API call ${method} for ${\n\t\t\t\tgetCCName(\n\t\t\t\t\tccId,\n\t\t\t\t)\n\t\t\t} CC overridden by a compat flag.`,\n\t\t\tlevel: \"debug\",\n\t\t\tdirection: \"none\",\n\t\t});\n\n\t\tconst ccValues = getCCValues(ccId);\n\t\tif (ccValues) {\n\t\t\tconst valueDB = ctx.getValueDB(endpoint.nodeId);\n\n\t\t\tconst prop2value = (prop: string): CCValue | undefined => {\n\t\t\t\t// We use a simplistic parser to support dynamic value IDs:\n\t\t\t\t// If end with round brackets with something inside, they are considered dynamic\n\t\t\t\t// Otherwise static\n\t\t\t\tconst argsMatch = prop.match(/^(.*)\\((.*)\\)$/);\n\t\t\t\tif (argsMatch) {\n\t\t\t\t\tconst methodName = argsMatch[1];\n\t\t\t\t\tconst methodArgs = JSON.parse(`[${argsMatch[2]}]`);\n\n\t\t\t\t\tconst dynValue = ccValues[methodName];\n\t\t\t\t\tif (typeof dynValue === \"function\") {\n\t\t\t\t\t\treturn dynValue(...methodArgs);\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\tconst staticValue = ccValues[prop] as\n\t\t\t\t\t\t| StaticCCValue\n\t\t\t\t\t\t| undefined;\n\t\t\t\t\tif (typeof staticValue?.endpoint === \"function\") {\n\t\t\t\t\t\treturn staticValue;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t};\n\n\t\t\t// Persist values if necessary\n\t\t\tif (match.persistValues) {\n\t\t\t\tfor (\n\t\t\t\t\tconst [prop, value] of Object.entries(\n\t\t\t\t\t\tmatch.persistValues,\n\t\t\t\t\t)\n\t\t\t\t) {\n\t\t\t\t\ttry {\n\t\t\t\t\t\tconst ccValue = prop2value(prop);\n\t\t\t\t\t\tif (ccValue) {\n\t\t\t\t\t\t\tvalueDB.setValue(\n\t\t\t\t\t\t\t\tccValue.endpoint(endpoint.index),\n\t\t\t\t\t\t\t\tvalue,\n\t\t\t\t\t\t\t);\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tctx.logNode(endpoint.nodeId, {\n\t\t\t\t\t\t\t\tmessage:\n\t\t\t\t\t\t\t\t\t`Failed to persist value ${prop} during overridden API call: value does not exist`,\n\t\t\t\t\t\t\t\tlevel: \"error\",\n\t\t\t\t\t\t\t\tdirection: \"none\",\n\t\t\t\t\t\t\t});\n\t\t\t\t\t\t}\n\t\t\t\t\t} catch (e) {\n\t\t\t\t\t\tctx.logNode(endpoint.nodeId, {\n\t\t\t\t\t\t\tmessage:\n\t\t\t\t\t\t\t\t`Failed to persist value ${prop} during overridden API call: ${\n\t\t\t\t\t\t\t\t\tgetErrorMessage(\n\t\t\t\t\t\t\t\t\t\te,\n\t\t\t\t\t\t\t\t\t)\n\t\t\t\t\t\t\t\t}`,\n\t\t\t\t\t\t\tlevel: \"error\",\n\t\t\t\t\t\t\tdirection: \"none\",\n\t\t\t\t\t\t});\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// As well as metadata\n\t\t\tif (match.extendMetadata) {\n\t\t\t\tfor (\n\t\t\t\t\tconst [prop, meta] of Object.entries(\n\t\t\t\t\t\tmatch.extendMetadata,\n\t\t\t\t\t)\n\t\t\t\t) {\n\t\t\t\t\ttry {\n\t\t\t\t\t\tconst ccValue = prop2value(prop);\n\t\t\t\t\t\tif (ccValue) {\n\t\t\t\t\t\t\tvalueDB.setMetadata(\n\t\t\t\t\t\t\t\tccValue.endpoint(endpoint.index),\n\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t...ccValue.meta,\n\t\t\t\t\t\t\t\t\t...meta,\n\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t);\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tctx.logNode(endpoint.nodeId, {\n\t\t\t\t\t\t\t\tmessage:\n\t\t\t\t\t\t\t\t\t`Failed to extend value metadata ${prop} during overridden API call: value does not exist`,\n\t\t\t\t\t\t\t\tlevel: \"error\",\n\t\t\t\t\t\t\t\tdirection: \"none\",\n\t\t\t\t\t\t\t});\n\t\t\t\t\t\t}\n\t\t\t\t\t} catch (e) {\n\t\t\t\t\t\tctx.logNode(endpoint.nodeId, {\n\t\t\t\t\t\t\tmessage:\n\t\t\t\t\t\t\t\t`Failed to extend value metadata ${prop} during overridden API call: ${\n\t\t\t\t\t\t\t\t\tgetErrorMessage(\n\t\t\t\t\t\t\t\t\t\te,\n\t\t\t\t\t\t\t\t\t)\n\t\t\t\t\t\t\t\t}`,\n\t\t\t\t\t\t\tlevel: \"error\",\n\t\t\t\t\t\t\tdirection: \"none\",\n\t\t\t\t\t\t});\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t// API methods are always async\n\t\treturn Promise.resolve(match.result);\n\t};\n}\n\n/** A CC API that is only available for physical endpoints */\nexport class PhysicalCCAPI extends CCAPI {\n\tpublic constructor(\n\t\thost: CCAPIHost,\n\t\tendpoint: CCAPIEndpoint,\n\t) {\n\t\tsuper(host, endpoint);\n\t\tthis.assertPhysicalEndpoint(endpoint);\n\t}\n\n\tdeclare protected readonly endpoint: PhysicalCCAPIEndpoint;\n}\n\nexport type APIConstructor<T extends CCAPI = CCAPI> = new (\n\thost: CCAPIHost,\n\tendpoint: CCAPIEndpoint,\n) => T;\n\n// This type is auto-generated by maintenance/generateCCAPIInterface.ts\n// Do not edit it by hand or your changes will be lost\ntype CCNameMap = {\n\t\"Alarm Sensor\": typeof CommandClasses[\"Alarm Sensor\"];\n\tAssociation: typeof CommandClasses[\"Association\"];\n\t\"Association Group Information\":\n\t\ttypeof CommandClasses[\"Association Group Information\"];\n\t\"Barrier Operator\": typeof CommandClasses[\"Barrier Operator\"];\n\tBasic: typeof CommandClasses[\"Basic\"];\n\tBattery: typeof CommandClasses[\"Battery\"];\n\t\"Binary Sensor\": typeof CommandClasses[\"Binary Sensor\"];\n\t\"Binary Switch\": typeof CommandClasses[\"Binary Switch\"];\n\t\"CRC-16 Encapsulation\": typeof CommandClasses[\"CRC-16 Encapsulation\"];\n\t\"Central Scene\": typeof CommandClasses[\"Central Scene\"];\n\t\"Climate Control Schedule\":\n\t\ttypeof CommandClasses[\"Climate Control Schedule\"];\n\tClock: typeof CommandClasses[\"Clock\"];\n\t\"Color Switch\": typeof CommandClasses[\"Color Switch\"];\n\tConfiguration: typeof CommandClasses[\"Configuration\"];\n\t\"Device Reset Locally\": typeof CommandClasses[\"Device Reset Locally\"];\n\t\"Door Lock\": typeof CommandClasses[\"Door Lock\"];\n\t\"Door Lock Logging\": typeof CommandClasses[\"Door Lock Logging\"];\n\t\"Energy Production\": typeof CommandClasses[\"Energy Production\"];\n\t\"Entry Control\": typeof CommandClasses[\"Entry Control\"];\n\t\"Firmware Update Meta Data\":\n\t\ttypeof CommandClasses[\"Firmware Update Meta Data\"];\n\t\"Humidity Control Mode\": typeof CommandClasses[\"Humidity Control Mode\"];\n\t\"Humidity Control Operating State\":\n\t\ttypeof CommandClasses[\"Humidity Control Operating State\"];\n\t\"Humidity Control Setpoint\":\n\t\ttypeof CommandClasses[\"Humidity Control Setpoint\"];\n\t\"Inclusion Controller\": typeof CommandClasses[\"Inclusion Controller\"];\n\tIndicator: typeof CommandClasses[\"Indicator\"];\n\tIrrigation: typeof CommandClasses[\"Irrigation\"];\n\tLanguage: typeof CommandClasses[\"Language\"];\n\tLock: typeof CommandClasses[\"Lock\"];\n\t\"Manufacturer Proprietary\":\n\t\ttypeof CommandClasses[\"Manufacturer Proprietary\"];\n\t\"Manufacturer Specific\": typeof CommandClasses[\"Manufacturer Specific\"];\n\tMeter: typeof CommandClasses[\"Meter\"];\n\t\"Multi Channel Association\":\n\t\ttypeof CommandClasses[\"Multi Channel Association\"];\n\t\"Multi Channel\": typeof CommandClasses[\"Multi Channel\"];\n\t\"Multi Command\": typeof CommandClasses[\"Multi Command\"];\n\t\"Multilevel Sensor\": typeof CommandClasses[\"Multilevel Sensor\"];\n\t\"Multilevel Switch\": typeof CommandClasses[\"Multilevel Switch\"];\n\t\"No Operation\": typeof CommandClasses[\"No Operation\"];\n\t\"Node Naming and Location\":\n\t\ttypeof CommandClasses[\"Node Naming and Location\"];\n\tNotification: typeof CommandClasses[\"Notification\"];\n\tPowerlevel: typeof CommandClasses[\"Powerlevel\"];\n\tProtection: typeof CommandClasses[\"Protection\"];\n\t\"Scene Activation\": typeof CommandClasses[\"Scene Activation\"];\n\t\"Scene Actuator Configuration\":\n\t\ttypeof CommandClasses[\"Scene Actuator Configuration\"];\n\t\"Scene Controller Configuration\":\n\t\ttypeof CommandClasses[\"Scene Controller Configuration\"];\n\t\"Schedule Entry Lock\": typeof CommandClasses[\"Schedule Entry Lock\"];\n\t\"Security 2\": typeof CommandClasses[\"Security 2\"];\n\tSecurity: typeof CommandClasses[\"Security\"];\n\t\"Sound Switch\": typeof CommandClasses[\"Sound Switch\"];\n\tSupervision: typeof CommandClasses[\"Supervision\"];\n\t\"Thermostat Fan Mode\": typeof CommandClasses[\"Thermostat Fan Mode\"];\n\t\"Thermostat Fan State\": typeof CommandClasses[\"Thermostat Fan State\"];\n\t\"Thermostat Mode\": typeof CommandClasses[\"Thermostat Mode\"];\n\t\"Thermostat Operating State\":\n\t\ttypeof CommandClasses[\"Thermostat Operating State\"];\n\t\"Thermostat Setback\": typeof CommandClasses[\"Thermostat Setback\"];\n\t\"Thermostat Setpoint\": typeof CommandClasses[\"Thermostat Setpoint\"];\n\tTime: typeof CommandClasses[\"Time\"];\n\t\"Time Parameters\": typeof CommandClasses[\"Time Parameters\"];\n\t\"User Code\": typeof CommandClasses[\"User Code\"];\n\tVersion: typeof CommandClasses[\"Version\"];\n\t\"Wake Up\": typeof CommandClasses[\"Wake Up\"];\n\t\"Window Covering\": typeof CommandClasses[\"Window Covering\"];\n\t\"Z-Wave Plus Info\": typeof CommandClasses[\"Z-Wave Plus Info\"];\n};\nexport type CCToName<CC extends CommandClasses> = {\n\t[K in keyof CCNameMap]: CCNameMap[K] extends CC ? K : never;\n}[keyof CCNameMap];\n\nexport type CCNameOrId = CommandClasses | Extract<keyof CCAPIs, string>;\n\nexport type CCToAPI<CC extends CCNameOrId> = CC extends CommandClasses\n\t? CCToName<CC> extends keyof CCAPIs ? CCAPIs[CCToName<CC>]\n\t: never\n\t: CC extends keyof CCAPIs ? CCAPIs[CC]\n\t: never;\n\nexport type APIMethodsOf<CC extends CCNameOrId> = Omit<\n\tOnlyMethods<CCToAPI<CC>>,\n\t| \"ccId\"\n\t| \"getNode\"\n\t| \"tryGetNode\"\n\t| \"isSetValueOptimistic\"\n\t| \"isSupported\"\n\t| \"pollValue\"\n\t| \"setValue\"\n\t| \"version\"\n\t| \"supportsCommand\"\n\t| \"withOptions\"\n\t| \"withTXReport\"\n>;\n\nexport type OwnMethodsOf<API extends CCAPI> = Omit<\n\tOnlyMethods<API>,\n\tkeyof OnlyMethods<CCAPI>\n>;\n\n// Wraps the given type in an object that contains a TX report\nexport type WrapWithTXReport<T> = [T] extends [Promise<infer U>]\n\t? Promise<WrapWithTXReport<U>>\n\t: [T] extends [void] ? { txReport: TXReport | undefined }\n\t: { result: T; txReport: TXReport | undefined };\n\nexport type ReturnWithTXReport<T> = T extends (...args: any[]) => any\n\t? (...args: Parameters<T>) => WrapWithTXReport<ReturnType<T>>\n\t: undefined;\n\n// Converts the type of the given API implementation so the API methods return an object including the TX report\nexport type WithTXReport<API extends CCAPI> =\n\t& Omit<\n\t\tAPI,\n\t\tkeyof OwnMethodsOf<API> | \"withOptions\" | \"withTXReport\" | \"setValue\"\n\t>\n\t& {\n\t\t[\n\t\t\tK in\n\t\t\t\t| keyof OwnMethodsOf<API>\n\t\t\t\t| \"setValue\"\n\t\t\t\t| \"pollValue\"\n\t\t]: ReturnWithTXReport<API[K]>;\n\t};\n\nexport function normalizeCCNameOrId(\n\tccNameOrId: number | string,\n): CommandClasses | undefined {\n\tif (!(ccNameOrId in CommandClasses)) return undefined;\n\n\tlet ret: CommandClasses | undefined;\n\tif (typeof ccNameOrId === \"string\") {\n\t\tif (/^\\d+$/.test(ccNameOrId)) {\n\t\t\t// This can happen on property access\n\t\t\tret = +ccNameOrId;\n\t\t} else if (typeof (CommandClasses as any)[ccNameOrId] === \"number\") {\n\t\t\tret = (CommandClasses as any)[ccNameOrId];\n\t\t}\n\t} else {\n\t\tret = ccNameOrId;\n\t}\n\n\treturn ret;\n}\n\n// This interface is auto-generated by maintenance/generateCCAPIInterface.ts\n// Do not edit it by hand or your changes will be lost\nexport interface CCAPIs {\n\t[Symbol.iterator](): Iterator<CCAPI>;\n\n\t// AUTO GENERATION BELOW\n\t\"Alarm Sensor\": import(\"../cc/AlarmSensorCC.js\").AlarmSensorCCAPI;\n\tAssociation: import(\"../cc/AssociationCC.js\").AssociationCCAPI;\n\t\"Association Group Information\":\n\t\timport(\"../cc/AssociationGroupInfoCC.js\").AssociationGroupInfoCCAPI;\n\t\"Barrier Operator\":\n\t\timport(\"../cc/BarrierOperatorCC.js\").BarrierOperatorCCAPI;\n\tBasic: import(\"../cc/BasicCC.js\").BasicCCAPI;\n\tBattery: import(\"../cc/BatteryCC.js\").BatteryCCAPI;\n\t\"Binary Sensor\": import(\"../cc/BinarySensorCC.js\").BinarySensorCCAPI;\n\t\"Binary Switch\": import(\"../cc/BinarySwitchCC.js\").BinarySwitchCCAPI;\n\t\"CRC-16 Encapsulation\": import(\"../cc/CRC16CC.js\").CRC16CCAPI;\n\t\"Central Scene\": import(\"../cc/CentralSceneCC.js\").CentralSceneCCAPI;\n\t\"Climate Control Schedule\":\n\t\timport(\"../cc/ClimateControlScheduleCC.js\").ClimateControlScheduleCCAPI;\n\tClock: import(\"../cc/ClockCC.js\").ClockCCAPI;\n\t\"Color Switch\": import(\"../cc/ColorSwitchCC.js\").ColorSwitchCCAPI;\n\tConfiguration: import(\"../cc/ConfigurationCC.js\").ConfigurationCCAPI;\n\t\"Device Reset Locally\":\n\t\timport(\"../cc/DeviceResetLocallyCC.js\").DeviceResetLocallyCCAPI;\n\t\"Door Lock\": import(\"../cc/DoorLockCC.js\").DoorLockCCAPI;\n\t\"Door Lock Logging\":\n\t\timport(\"../cc/DoorLockLoggingCC.js\").DoorLockLoggingCCAPI;\n\t\"Energy Production\":\n\t\timport(\"../cc/EnergyProductionCC.js\").EnergyProductionCCAPI;\n\t\"Entry Control\": import(\"../cc/EntryControlCC.js\").EntryControlCCAPI;\n\t\"Firmware Update Meta Data\":\n\t\timport(\"../cc/FirmwareUpdateMetaDataCC.js\").FirmwareUpdateMetaDataCCAPI;\n\t\"Humidity Control Mode\":\n\t\timport(\"../cc/HumidityControlModeCC.js\").HumidityControlModeCCAPI;\n\t\"Humidity Control Operating State\":\n\t\timport(\"../cc/HumidityControlOperatingStateCC.js\").HumidityControlOperatingStateCCAPI;\n\t\"Humidity Control Setpoint\":\n\t\timport(\"../cc/HumidityControlSetpointCC.js\").HumidityControlSetpointCCAPI;\n\t\"Inclusion Controller\":\n\t\timport(\"../cc/InclusionControllerCC.js\").InclusionControllerCCAPI;\n\tIndicator: import(\"../cc/IndicatorCC.js\").IndicatorCCAPI;\n\tIrrigation: import(\"../cc/IrrigationCC.js\").IrrigationCCAPI;\n\tLanguage: import(\"../cc/LanguageCC.js\").LanguageCCAPI;\n\tLock: import(\"../cc/LockCC.js\").LockCCAPI;\n\t\"Manufacturer Proprietary\":\n\t\timport(\"../cc/ManufacturerProprietaryCC.js\").ManufacturerProprietaryCCAPI;\n\t\"Manufacturer Specific\":\n\t\timport(\"../cc/ManufacturerSpecificCC.js\").ManufacturerSpecificCCAPI;\n\tMeter: import(\"../cc/MeterCC.js\").MeterCCAPI;\n\t\"Multi Channel Association\":\n\t\timport(\"../cc/MultiChannelAssociationCC.js\").MultiChannelAssociationCCAPI;\n\t\"Multi Channel\": import(\"../cc/MultiChannelCC.js\").MultiChannelCCAPI;\n\t\"Multi Command\": import(\"../cc/MultiCommandCC.js\").MultiCommandCCAPI;\n\t\"Multilevel Sensor\":\n\t\timport(\"../cc/MultilevelSensorCC.js\").MultilevelSensorCCAPI;\n\t\"Multilevel Switch\":\n\t\timport(\"../cc/MultilevelSwitchCC.js\").MultilevelSwitchCCAPI;\n\t\"No Operation\": import(\"../cc/NoOperationCC.js\").NoOperationCCAPI;\n\t\"Node Naming and Location\":\n\t\timport(\"../cc/NodeNamingCC.js\").NodeNamingAndLocationCCAPI;\n\tNotification: import(\"../cc/NotificationCC.js\").NotificationCCAPI;\n\tPowerlevel: import(\"../cc/PowerlevelCC.js\").PowerlevelCCAPI;\n\tProtection: import(\"../cc/ProtectionCC.js\").ProtectionCCAPI;\n\t\"Scene Activation\":\n\t\timport(\"../cc/SceneActivationCC.js\").SceneActivationCCAPI;\n\t\"Scene Actuator Configuration\":\n\t\timport(\"../cc/SceneActuatorConfigurationCC.js\").SceneActuatorConfigurationCCAPI;\n\t\"Scene Controller Configuration\":\n\t\timport(\"../cc/SceneControllerConfigurationCC.js\").SceneControllerConfigurationCCAPI;\n\t\"Schedule Entry Lock\":\n\t\timport(\"../cc/ScheduleEntryLockCC.js\").ScheduleEntryLockCCAPI;\n\t\"Security 2\": import(\"../cc/Security2CC.js\").Security2CCAPI;\n\tSecurity: import(\"../cc/SecurityCC.js\").SecurityCCAPI;\n\t\"Sound Switch\": import(\"../cc/SoundSwitchCC.js\").SoundSwitchCCAPI;\n\tSupervision: import(\"../cc/SupervisionCC.js\").SupervisionCCAPI;\n\t\"Thermostat Fan Mode\":\n\t\timport(\"../cc/ThermostatFanModeCC.js\").ThermostatFanModeCCAPI;\n\t\"Thermostat Fan State\":\n\t\timport(\"../cc/ThermostatFanStateCC.js\").ThermostatFanStateCCAPI;\n\t\"Thermostat Mode\": import(\"../cc/ThermostatModeCC.js\").ThermostatModeCCAPI;\n\t\"Thermostat Operating State\":\n\t\timport(\"../cc/ThermostatOperatingStateCC.js\").ThermostatOperatingStateCCAPI;\n\t\"Thermostat Setback\":\n\t\timport(\"../cc/ThermostatSetbackCC.js\").ThermostatSetbackCCAPI;\n\t\"Thermostat Setpoint\":\n\t\timport(\"../cc/ThermostatSetpointCC.js\").ThermostatSetpointCCAPI;\n\tTime: import(\"../cc/TimeCC.js\").TimeCCAPI;\n\t\"Time Parameters\": import(\"../cc/TimeParametersCC.js\").TimeParametersCCAPI;\n\t\"User Code\": import(\"../cc/UserCodeCC.js\").UserCodeCCAPI;\n\tVersion: import(\"../cc/VersionCC.js\").VersionCCAPI;\n\t\"Wake Up\": import(\"../cc/WakeUpCC.js\").WakeUpCCAPI;\n\t\"Window Covering\": import(\"../cc/WindowCoveringCC.js\").WindowCoveringCCAPI;\n\t\"Z-Wave Plus Info\": import(\"../cc/ZWavePlusCC.js\").ZWavePlusCCAPI;\n}\n"],
5
- "mappings": ";;;;;;;;;;;;;;;;;;;AACA;;;;;;;;;;;;;;AAAA,kBA2BO;AAcP,oBAMO;AACP,wBAAwB;AACxB,oCAKO;AAMA,MAAM,YAA2B,OAAO,IAAI,iBAAiB;AAQ7D,MAAM,kBAAiC,OAAO,IACpD,uBAAuB;AAqCjB,MAAM,aAA4B,OAAO,IAAI,kBAAkB;AAOhE,SAAU,yBACf,IACA,UAAyB;AAEzB,QAAM,IAAI,uBACT,GAAG,2BAAe,EAAE,CAAC,MAAM,QAAQ,iCACnC,4BAAgB,gBAAgB;AAElC;AARgB;AAUV,SAAU,4BACf,IACA,UACA,aAA4B;AAE5B,QAAM,IAAI,uBACT,GACC,2BAAe,EAAE,CAClB,MAAM,WAAW,mDAAmD,QAAQ,KAC5E,4BAAgB,gBAAgB;AAElC;AAXgB;AAaV,SAAU,wBACf,IACA,UAAyB;AAEzB,QAAM,IAAI,uBACT,GACC,2BAAe,EAAE,CAClB,eAAe,QAAQ,iDACvB,4BAAgB,gBAAgB;AAElC;AAVgB;AAYV,SAAU,oBACf,IACA,UACA,cACA,cAAoB;AAEpB,QAAM,IAAI,uBACT,GACC,2BAAe,EAAE,CAClB,MAAM,QAAQ,sBAAsB,YAAY,gBAAgB,YAAY,KAC5E,4BAAgB,gBAAgB;AAElC;AAZg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GetDeviceConfig,\n} from \"@zwave-js/config\";\nimport {\n\tCommandClasses,\n\ttype ControlsCC,\n\ttype Duration,\n\ttype EndpointId,\n\ttype GetEndpoint,\n\ttype GetNode,\n\ttype GetSafeCCVersion,\n\ttype GetSupportedCCVersion,\n\ttype GetValueDB,\n\ttype HostIDs,\n\ttype ListenBehavior,\n\ttype LogNode,\n\ttype MaybeNotKnown,\n\tNODE_ID_BROADCAST,\n\tNODE_ID_BROADCAST_LR,\n\tNOT_KNOWN,\n\ttype NodeId,\n\ttype PhysicalNodes,\n\ttype QueryNodeStatus,\n\ttype SecurityManagers,\n\ttype SendCommandOptions,\n\ttype SupervisionResult,\n\ttype SupportsCC,\n\ttype TXReport,\n\ttype ValueChangeOptions,\n\ttype ValueDB,\n\ttype ValueID,\n\ttype VirtualEndpointId,\n\tZWaveError,\n\tZWaveErrorCodes,\n\tgetCCName,\n\tstripUndefined,\n} from \"@zwave-js/core\";\nimport {\n\ttype AllOrNone,\n\ttype OnlyMethods,\n\tgetEnumMemberName,\n\tgetErrorMessage,\n\tnum2hex,\n} from \"@zwave-js/shared\";\nimport { isArray } from \"alcalzone-shared/typeguards\";\nimport {\n\tgetAPI,\n\tgetCCValues,\n\tgetCommandClass,\n\tgetImplementedVersion,\n} from \"./CommandClassDecorators.js\";\nimport { type CCValue, type StaticCCValue } from \"./Values.js\";\nimport {\n\ttype GetRefreshValueTimeouts,\n\ttype GetUserPreferences,\n\ttype SchedulePoll,\n} from \"./traits.js\";\n\nexport type ValueIDProperties = Pick<ValueID, \"property\" | \"propertyKey\">;\n\n/** Used to identify the method on the CC API class that handles setting values on nodes directly */\nexport const SET_VALUE: unique symbol = Symbol.for(\"CCAPI_SET_VALUE\");\n\nexport type SetValueImplementation = (\n\tproperty: ValueIDProperties,\n\tvalue: unknown,\n\toptions?: SetValueAPIOptions,\n) => Promise<SupervisionResult | undefined>;\n\nexport const SET_VALUE_HOOKS: unique symbol = Symbol.for(\n\t\"CCAPI_SET_VALUE_HOOKS\",\n);\n\nexport type SetValueImplementationHooks =\n\t& AllOrNone<{\n\t\t// Opt-in to and handle delayed supervision updates\n\t\tsupervisionDelayedUpdates: boolean;\n\t\tsupervisionOnSuccess: () => void | Promise<void>;\n\t\tsupervisionOnFailure: () => void | Promise<void>;\n\t}>\n\t& {\n\t\t// Optimistically update related cached values (if allowed)\n\t\toptimisticallyUpdateRelatedValues?: (\n\t\t\tsupervisedAndSuccessful: boolean,\n\t\t) => void;\n\t\t// Check if a verification of the set value is required, even if the API response suggests otherwise\n\t\tforceVerifyChanges?: () => boolean;\n\t\t// Verify the changes\n\t\tverifyChanges?: () => void | Promise<void>;\n\t};\n\nexport type SetValueImplementationHooksFactory = (\n\tproperty: ValueIDProperties,\n\tvalue: unknown,\n\toptions?: SetValueAPIOptions,\n) => SetValueImplementationHooks | undefined;\n\n/**\n * A generic options bag for the `setValue` API.\n * Each implementation will choose the options that are relevant for it, so you can use the same options everywhere.\n * @publicAPI\n */\nexport type SetValueAPIOptions =\n\t& Partial<ValueChangeOptions>\n\t& Pick<SendCommandOptions, \"onProgress\">;\n\n/** Used to identify the method on the CC API class that handles polling values from nodes */\nexport const POLL_VALUE: unique symbol = Symbol.for(\"CCAPI_POLL_VALUE\");\nexport type PollValueImplementation<T = unknown> = (\n\tproperty: ValueIDProperties,\n) => Promise<T | undefined>;\n\n// Since the setValue API is called from a point with very generic parameters,\n// we must do narrowing inside the API calls. These three methods are for convenience\nexport function throwUnsupportedProperty(\n\tcc: CommandClasses,\n\tproperty: string | number,\n): never {\n\tthrow new ZWaveError(\n\t\t`${CommandClasses[cc]}: \"${property}\" is not a supported property`,\n\t\tZWaveErrorCodes.Argument_Invalid,\n\t);\n}\n\nexport function throwUnsupportedPropertyKey(\n\tcc: CommandClasses,\n\tproperty: string | number,\n\tpropertyKey: string | number,\n): never {\n\tthrow new ZWaveError(\n\t\t`${\n\t\t\tCommandClasses[cc]\n\t\t}: \"${propertyKey}\" is not a supported property key for property \"${property}\"`,\n\t\tZWaveErrorCodes.Argument_Invalid,\n\t);\n}\n\nexport function throwMissingPropertyKey(\n\tcc: CommandClasses,\n\tproperty: string | number,\n): never {\n\tthrow new ZWaveError(\n\t\t`${\n\t\t\tCommandClasses[cc]\n\t\t}: property \"${property}\" requires a property key, but none was given`,\n\t\tZWaveErrorCodes.Argument_Invalid,\n\t);\n}\n\nexport function throwWrongValueType(\n\tcc: CommandClasses,\n\tproperty: string | number,\n\texpectedType: string,\n\treceivedType: string,\n): never {\n\tthrow new ZWaveError(\n\t\t`${\n\t\t\tCommandClasses[cc]\n\t\t}: \"${property}\" must be of type \"${expectedType}\", received \"${receivedType}\"`,\n\t\tZWaveErrorCodes.Argument_Invalid,\n\t);\n}\n\nexport interface CCAPISchedulePollOptions {\n\tduration?: Duration;\n\ttransition?: \"fast\" | \"slow\";\n}\n\n// Defines the necessary traits the host passed to a CC API must have\nexport type CCAPIHost<TNode extends CCAPINode = CCAPINode> =\n\t& HostIDs\n\t& GetNode<TNode>\n\t& GetValueDB\n\t& GetSupportedCCVersion\n\t& GetSafeCCVersion\n\t& SecurityManagers\n\t& GetDeviceConfig\n\t& SendCommand\n\t& GetRefreshValueTimeouts\n\t& GetUserPreferences\n\t& SchedulePoll\n\t& LogNode;\n\n// Defines the necessary traits a node passed to a CC API must have\nexport type CCAPINode = NodeId & ListenBehavior & QueryNodeStatus;\n\n// Defines the necessary traits an endpoint passed to a CC API must have\nexport type CCAPIEndpoint =\n\t& (\n\t\t| (\n\t\t\t// Physical endpoints must let us query their controlled CCs\n\t\t\tEndpointId & ControlsCC\n\t\t)\n\t\t| (\n\t\t\t// Virtual endpoints must let us query their physical nodes,\n\t\t\t// the CCs those nodes implement, and access the endpoints of those\n\t\t\t// physical nodes\n\t\t\tVirtualEndpointId & {\n\t\t\t\tnode: PhysicalNodes<\n\t\t\t\t\t& NodeId\n\t\t\t\t\t& SupportsCC\n\t\t\t\t\t& ControlsCC\n\t\t\t\t\t& GetEndpoint<EndpointId & SupportsCC & ControlsCC>\n\t\t\t\t>;\n\t\t\t}\n\t\t)\n\t)\n\t& SupportsCC;\n\nexport type PhysicalCCAPIEndpoint = CCAPIEndpoint & EndpointId;\nexport type VirtualCCAPIEndpoint = CCAPIEndpoint & VirtualEndpointId;\n\n/**\n * The base class for all CC APIs exposed via `Node.commandClasses.<CCName>`\n * @publicAPI\n */\nexport class CCAPI {\n\tpublic constructor(\n\t\tprotected readonly host: CCAPIHost,\n\t\tprotected readonly endpoint: CCAPIEndpoint,\n\t) {\n\t\tthis.ccId = getCommandClass(this);\n\t}\n\n\tpublic static create<T extends CommandClasses>(\n\t\tccId: T,\n\t\thost: CCAPIHost,\n\t\tendpoint: CCAPIEndpoint,\n\t\trequireSupport?: boolean,\n\t): CommandClasses extends T ? CCAPI : CCToAPI<T> {\n\t\tconst APIConstructor = getAPI(ccId);\n\t\tconst ccName = CommandClasses[ccId];\n\t\tif (APIConstructor == undefined) {\n\t\t\tthrow new ZWaveError(\n\t\t\t\t`Command Class ${ccName} (${\n\t\t\t\t\tnum2hex(\n\t\t\t\t\t\tccId,\n\t\t\t\t\t)\n\t\t\t\t}) has no associated API!`,\n\t\t\t\tZWaveErrorCodes.CC_NoAPI,\n\t\t\t);\n\t\t}\n\t\tconst apiInstance = new APIConstructor(host, endpoint);\n\n\t\t// Only require support for physical endpoints by default\n\t\trequireSupport ??= !endpoint.virtual;\n\n\t\tif (requireSupport) {\n\t\t\t// @ts-expect-error TS doesn't like assigning to conditional types\n\t\t\treturn new Proxy(apiInstance, {\n\t\t\t\tget: (target, property) => {\n\t\t\t\t\t// Forbid access to the API if it is not supported by the node\n\t\t\t\t\tif (\n\t\t\t\t\t\tproperty !== \"ccId\"\n\t\t\t\t\t\t&& property !== \"endpoint\"\n\t\t\t\t\t\t&& property !== \"isSupported\"\n\t\t\t\t\t\t&& property !== \"withOptions\"\n\t\t\t\t\t\t&& property !== \"commandOptions\"\n\t\t\t\t\t\t&& !target.isSupported()\n\t\t\t\t\t) {\n\t\t\t\t\t\tlet messageStart: string;\n\t\t\t\t\t\tif (endpoint.virtual) {\n\t\t\t\t\t\t\tconst hasNodeId =\n\t\t\t\t\t\t\t\ttypeof endpoint.nodeId === \"number\"\n\t\t\t\t\t\t\t\t&& endpoint.nodeId !== NODE_ID_BROADCAST\n\t\t\t\t\t\t\t\t&& endpoint.nodeId !== NODE_ID_BROADCAST_LR;\n\t\t\t\t\t\t\tmessageStart = `${\n\t\t\t\t\t\t\t\thasNodeId ? \"The\" : \"This\"\n\t\t\t\t\t\t\t} virtual node${\n\t\t\t\t\t\t\t\thasNodeId ? ` ${endpoint.nodeId}` : \"\"\n\t\t\t\t\t\t\t}`;\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tmessageStart = `Node ${endpoint.nodeId}`;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tthrow new ZWaveError(\n\t\t\t\t\t\t\t`${messageStart}${\n\t\t\t\t\t\t\t\tendpoint.index === 0\n\t\t\t\t\t\t\t\t\t? \"\"\n\t\t\t\t\t\t\t\t\t: ` (endpoint ${endpoint.index})`\n\t\t\t\t\t\t\t} does not support the Command Class ${ccName}!`,\n\t\t\t\t\t\t\tZWaveErrorCodes.CC_NotSupported,\n\t\t\t\t\t\t);\n\t\t\t\t\t}\n\n\t\t\t\t\t// If a device config defines overrides for an API call, return a wrapper method that applies them first before calling the actual method\n\t\t\t\t\tconst fallback = target[property as keyof CCAPI];\n\t\t\t\t\tif (\n\t\t\t\t\t\ttypeof property === \"string\"\n\t\t\t\t\t\t&& !endpoint.virtual\n\t\t\t\t\t\t&& typeof fallback === \"function\"\n\t\t\t\t\t) {\n\t\t\t\t\t\tconst overrides = host.getDeviceConfig?.(\n\t\t\t\t\t\t\tendpoint.nodeId,\n\t\t\t\t\t\t)?.compat?.overrideQueries;\n\t\t\t\t\t\tif (overrides?.hasOverride(ccId)) {\n\t\t\t\t\t\t\treturn overrideQueriesWrapper(\n\t\t\t\t\t\t\t\thost,\n\t\t\t\t\t\t\t\tendpoint,\n\t\t\t\t\t\t\t\tccId,\n\t\t\t\t\t\t\t\tproperty,\n\t\t\t\t\t\t\t\toverrides,\n\t\t\t\t\t\t\t\tfallback,\n\t\t\t\t\t\t\t);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\n\t\t\t\t\t// Else just access the property\n\t\t\t\t\treturn fallback;\n\t\t\t\t},\n\t\t\t});\n\t\t} else {\n\t\t\t// @ts-expect-error TS doesn't like assigning to conditional types\n\t\t\treturn apiInstance;\n\t\t}\n\t}\n\n\t/**\n\t * The identifier of the Command Class this API is for\n\t */\n\tpublic readonly ccId: CommandClasses;\n\n\tprotected get [SET_VALUE](): SetValueImplementation | undefined {\n\t\treturn undefined;\n\t}\n\n\t/**\n\t * Can be used on supported CC APIs to set a CC value by property name (and optionally the property key).\n\t * **WARNING:** This function is NOT bound to an API instance. It must be called with the correct `this` context!\n\t */\n\tpublic get setValue(): SetValueImplementation | undefined {\n\t\treturn this[SET_VALUE];\n\t}\n\n\tprotected [SET_VALUE_HOOKS]: SetValueImplementationHooksFactory | undefined;\n\t/**\n\t * Can be implemented by CC APIs to influence the behavior of the setValue API in regards to Supervision and verifying values.\n\t */\n\tpublic get setValueHooks(): SetValueImplementationHooksFactory | undefined {\n\t\treturn this[SET_VALUE_HOOKS];\n\t}\n\n\t/** Whether a successful setValue call should imply that the value was successfully updated */\n\t// eslint-disable-next-line @typescript-eslint/no-unused-vars\n\tpublic isSetValueOptimistic(valueId: ValueID): boolean {\n\t\treturn true;\n\t}\n\n\tprotected get [POLL_VALUE](): PollValueImplementation | undefined {\n\t\treturn undefined;\n\t}\n\t/**\n\t * Can be used on supported CC APIs to poll a CC value by property name (and optionally the property key)\n\t * **WARNING:** This function is NOT bound to an API instance. It must be called with the correct `this` context!\n\t */\n\tpublic get pollValue(): PollValueImplementation | undefined {\n\t\treturn this[POLL_VALUE];\n\t}\n\n\t/**\n\t * Schedules a value to be polled after a given time. Schedules are deduplicated on a per-property basis.\n\t * @returns `true` if the poll was scheduled, `false` otherwise\n\t */\n\tprotected schedulePoll(\n\t\t{ property, propertyKey }: ValueIDProperties,\n\t\texpectedValue: unknown,\n\t\t{ duration, transition = \"slow\" }: CCAPISchedulePollOptions = {},\n\t): boolean {\n\t\t// Figure out the delay. If a non-zero duration was given or this is a \"fast\" transition,\n\t\t// use/add the short delay. Otherwise, default to the long delay.\n\t\tconst durationMs = duration?.toMilliseconds() ?? 0;\n\t\tconst timeouts = this.host.getRefreshValueTimeouts();\n\t\tconst additionalDelay = !!durationMs || transition === \"fast\"\n\t\t\t? timeouts.refreshValueAfterTransition\n\t\t\t: timeouts.refreshValue;\n\t\tconst timeoutMs = durationMs + additionalDelay;\n\n\t\tif (this.isSinglecast()) {\n\t\t\tconst node = this.host.getNode(this.endpoint.nodeId);\n\t\t\tif (!node) return false;\n\n\t\t\treturn this.host.schedulePoll(\n\t\t\t\tnode.id,\n\t\t\t\t{\n\t\t\t\t\tcommandClass: this.ccId,\n\t\t\t\t\tendpoint: this.endpoint.index,\n\t\t\t\t\tproperty,\n\t\t\t\t\tpropertyKey,\n\t\t\t\t},\n\t\t\t\t{ timeoutMs, expectedValue },\n\t\t\t);\n\t\t} else if (this.isMulticast()) {\n\t\t\t// Only poll supporting nodes in multicast\n\t\t\tconst supportingNodes = this.endpoint.node.physicalNodes.filter(\n\t\t\t\t(node) =>\n\t\t\t\t\tnode\n\t\t\t\t\t\t.getEndpoint(this.endpoint.index)\n\t\t\t\t\t\t?.supportsCC(this.ccId),\n\t\t\t);\n\t\t\tlet ret = false;\n\t\t\tfor (const node of supportingNodes) {\n\t\t\t\tret ||= this.host.schedulePoll(\n\t\t\t\t\tnode.id,\n\t\t\t\t\t{\n\t\t\t\t\t\tcommandClass: this.ccId,\n\t\t\t\t\t\tendpoint: this.endpoint.index,\n\t\t\t\t\t\tproperty,\n\t\t\t\t\t\tpropertyKey,\n\t\t\t\t\t},\n\t\t\t\t\t{ timeoutMs, expectedValue },\n\t\t\t\t);\n\t\t\t}\n\t\t\treturn ret;\n\t\t} else {\n\t\t\t// Don't poll the broadcast node\n\t\t\treturn false;\n\t\t}\n\t}\n\n\t/**\n\t * Retrieves the version of the given CommandClass this endpoint implements\n\t */\n\tpublic get version(): number {\n\t\tif (this.isSinglecast()) {\n\t\t\treturn this.host.getSafeCCVersion(\n\t\t\t\tthis.ccId,\n\t\t\t\tthis.endpoint.nodeId,\n\t\t\t\tthis.endpoint.index,\n\t\t\t) ?? 0;\n\t\t} else {\n\t\t\treturn getImplementedVersion(this.ccId);\n\t\t}\n\t}\n\n\t/** Determines if this simplified API instance may be used. */\n\tpublic isSupported(): boolean {\n\t\treturn (\n\t\t\t// NoOperation is always supported\n\t\t\tthis.ccId === CommandClasses[\"No Operation\"]\n\t\t\t// Basic should always be supported. Since we are trying to hide it from library consumers\n\t\t\t// we cannot trust supportsCC to test it\n\t\t\t|| this.ccId === CommandClasses.Basic\n\t\t\t|| this.endpoint.supportsCC(this.ccId)\n\t\t);\n\t}\n\n\t/**\n\t * Determine whether the linked node supports a specific command of this command class.\n\t * {@link NOT_KNOWN} (`undefined`) means that the information has not been received yet\n\t */\n\t// eslint-disable-next-line @typescript-eslint/no-unused-vars\n\tpublic supportsCommand(command: number): MaybeNotKnown<boolean> {\n\t\t// This needs to be overwritten per command class. In the default implementation, we don't know anything!\n\t\treturn NOT_KNOWN;\n\t}\n\n\tprotected assertSupportsCommand(\n\t\tcommandEnum: unknown,\n\t\tcommand: number,\n\t): void {\n\t\tif (this.supportsCommand(command) !== true) {\n\t\t\tthrow new ZWaveError(\n\t\t\t\t`${\n\t\t\t\t\tthis.isSinglecast()\n\t\t\t\t\t\t? `Node #${this.endpoint.nodeId}`\n\t\t\t\t\t\t: \"This virtual node\"\n\t\t\t\t}${\n\t\t\t\t\tthis.endpoint.index > 0\n\t\t\t\t\t\t? ` (Endpoint ${this.endpoint.index})`\n\t\t\t\t\t\t: \"\"\n\t\t\t\t} does not support the command ${\n\t\t\t\t\tgetEnumMemberName(\n\t\t\t\t\t\tcommandEnum,\n\t\t\t\t\t\tcommand,\n\t\t\t\t\t)\n\t\t\t\t}!`,\n\t\t\t\tZWaveErrorCodes.CC_NotSupported,\n\t\t\t);\n\t\t}\n\t}\n\n\tprotected assertPhysicalEndpoint(\n\t\tendpoint: EndpointId | VirtualEndpointId,\n\t): asserts endpoint is EndpointId {\n\t\tif (endpoint.virtual) {\n\t\t\tthrow new ZWaveError(\n\t\t\t\t`This method is not supported for virtual nodes!`,\n\t\t\t\tZWaveErrorCodes.CC_NotSupported,\n\t\t\t);\n\t\t}\n\t}\n\n\t/** Returns the command options to use for sendCommand calls */\n\tprotected get commandOptions(): SendCommandOptions {\n\t\t// No default options\n\t\treturn {};\n\t}\n\n\t/** Creates an instance of this API, scoped to use the given options */\n\tpublic withOptions(options: SendCommandOptions): this {\n\t\tconst mergedOptions = {\n\t\t\t...this.commandOptions,\n\t\t\t...options,\n\t\t};\n\t\treturn new Proxy(this, {\n\t\t\tget: (target, property) => {\n\t\t\t\tif (property === \"commandOptions\") {\n\t\t\t\t\treturn mergedOptions;\n\t\t\t\t} else {\n\t\t\t\t\treturn (target as any)[property];\n\t\t\t\t}\n\t\t\t},\n\t\t});\n\t}\n\n\t/** Creates an instance of this API which (if supported) will return TX reports along with the result. */\n\tpublic withTXReport<T extends this>(): WithTXReport<T> {\n\t\tif (this.constructor === CCAPI) {\n\t\t\tthrow new ZWaveError(\n\t\t\t\t\"The withTXReport method may only be called on specific CC API implementations.\",\n\t\t\t\tZWaveErrorCodes.Driver_NotSupported,\n\t\t\t);\n\t\t}\n\n\t\t// Remember which properties need to be proxied\n\t\tconst proxiedProps = new Set([\n\t\t\t// These are the CC-specific methods\n\t\t\t...Object.getOwnPropertyNames(this.constructor.prototype),\n\t\t\t// as well as setValue and pollValue\n\t\t\t\"setValue\",\n\t\t\t\"pollValue\",\n\t\t]);\n\t\tproxiedProps.delete(\"constructor\");\n\n\t\tfunction wrapResult<T>(result: T, txReport: TXReport): any {\n\t\t\t// Both the result and the TX report may be undefined (no response, no support)\n\t\t\treturn stripUndefined({\n\t\t\t\tresult,\n\t\t\t\ttxReport,\n\t\t\t});\n\t\t}\n\n\t\treturn new Proxy(this, {\n\t\t\tget: (target, prop) => {\n\t\t\t\tif (prop === \"withTXReport\") return undefined;\n\n\t\t\t\tlet original: any = (target as any)[prop];\n\t\t\t\tif (\n\t\t\t\t\tproxiedProps.has(prop as string)\n\t\t\t\t\t&& typeof original === \"function\"\n\t\t\t\t) {\n\t\t\t\t\t// This is a method that only exists in the specific implementation\n\n\t\t\t\t\t// Wrap each call with its own API proxy, so we don't mix up TX reports\n\t\t\t\t\tlet txReport: TXReport;\n\t\t\t\t\tconst api = target.withOptions({\n\t\t\t\t\t\tonTXReport: (report) => {\n\t\t\t\t\t\t\t// Remember the last status report\n\t\t\t\t\t\t\ttxReport = report;\n\t\t\t\t\t\t},\n\t\t\t\t\t});\n\t\t\t\t\toriginal = (api as any)[prop].bind(api);\n\n\t\t\t\t\t// Return a wrapper function that will add the status report after the call is complete\n\t\t\t\t\treturn (...args: any) => {\n\t\t\t\t\t\tlet result = original(...args);\n\t\t\t\t\t\tif (result instanceof Promise) {\n\t\t\t\t\t\t\tresult = result.then((res) =>\n\t\t\t\t\t\t\t\twrapResult(res, txReport)\n\t\t\t\t\t\t\t);\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tresult = wrapResult(result, txReport);\n\t\t\t\t\t\t}\n\t\t\t\t\t\treturn result;\n\t\t\t\t\t};\n\t\t\t\t} else {\n\t\t\t\t\treturn original;\n\t\t\t\t}\n\t\t\t},\n\t\t}) as any;\n\t}\n\n\tprotected isSinglecast(): this is this & {\n\t\tendpoint: PhysicalCCAPIEndpoint;\n\t} {\n\t\treturn (\n\t\t\t!this.endpoint.virtual\n\t\t\t&& typeof this.endpoint.nodeId === \"number\"\n\t\t\t&& this.endpoint.nodeId !== NODE_ID_BROADCAST\n\t\t\t&& this.endpoint.nodeId !== NODE_ID_BROADCAST_LR\n\t\t);\n\t}\n\n\tprotected isMulticast(): this is this & {\n\t\tendpoint: VirtualCCAPIEndpoint & {\n\t\t\tnodeId: number[];\n\t\t};\n\t} {\n\t\treturn this.endpoint.virtual && isArray(this.endpoint.nodeId);\n\t}\n\n\tprotected isBroadcast(): this is this & {\n\t\tendpoint: VirtualCCAPIEndpoint & {\n\t\t\tnodeId: typeof NODE_ID_BROADCAST | typeof NODE_ID_BROADCAST_LR;\n\t\t};\n\t} {\n\t\treturn (\n\t\t\tthis.endpoint.virtual\n\t\t\t&& (this.endpoint.nodeId === NODE_ID_BROADCAST\n\t\t\t\t|| this.endpoint.nodeId === NODE_ID_BROADCAST_LR)\n\t\t);\n\t}\n\n\t/** Returns the value DB for this CC API's node (if it can be safely accessed) */\n\tprotected tryGetValueDB(): ValueDB | undefined {\n\t\tif (!this.isSinglecast()) return;\n\t\ttry {\n\t\t\treturn this.host.getValueDB(this.endpoint.nodeId);\n\t\t} catch {\n\t\t\treturn;\n\t\t}\n\t}\n\n\t/** Returns the value DB for this CC's node (or throws if it cannot be accessed) */\n\tprotected getValueDB(): ValueDB {\n\t\tif (this.isSinglecast()) {\n\t\t\ttry {\n\t\t\t\treturn this.host.getValueDB(this.endpoint.nodeId);\n\t\t\t} catch {\n\t\t\t\tthrow new ZWaveError(\n\t\t\t\t\t\"The node for this CC does not exist or the driver is not ready yet\",\n\t\t\t\t\tZWaveErrorCodes.Driver_NotReady,\n\t\t\t\t);\n\t\t\t}\n\t\t}\n\t\tthrow new ZWaveError(\n\t\t\t\"Cannot retrieve the value DB for non-singlecast CCs\",\n\t\t\tZWaveErrorCodes.CC_NoNodeID,\n\t\t);\n\t}\n}\n\nfunction overrideQueriesWrapper(\n\tctx: GetValueDB & LogNode,\n\tendpoint: PhysicalCCAPIEndpoint,\n\tccId: CommandClasses,\n\tmethod: string,\n\toverrides: CompatOverrideQueries,\n\tfallback: (...args: any[]) => any,\n): (...args: any[]) => any {\n\t// We must not capture the `this` context here, because the API methods are bound on use\n\treturn function(this: any, ...args: any[]) {\n\t\tconst match = overrides.matchOverride(\n\t\t\tccId,\n\t\t\tendpoint.index,\n\t\t\tmethod,\n\t\t\targs,\n\t\t);\n\t\tif (!match) return fallback.call(this, ...args);\n\n\t\tctx.logNode(endpoint.nodeId, {\n\t\t\tmessage: `API call ${method} for ${\n\t\t\t\tgetCCName(\n\t\t\t\t\tccId,\n\t\t\t\t)\n\t\t\t} CC overridden by a compat flag.`,\n\t\t\tlevel: \"debug\",\n\t\t\tdirection: \"none\",\n\t\t});\n\n\t\tconst ccValues = getCCValues(ccId);\n\t\tif (ccValues) {\n\t\t\tconst valueDB = ctx.getValueDB(endpoint.nodeId);\n\n\t\t\tconst prop2value = (prop: string): CCValue | undefined => {\n\t\t\t\t// We use a simplistic parser to support dynamic value IDs:\n\t\t\t\t// If end with round brackets with something inside, they are considered dynamic\n\t\t\t\t// Otherwise static\n\t\t\t\tconst argsMatch = prop.match(/^(.*)\\((.*)\\)$/);\n\t\t\t\tif (argsMatch) {\n\t\t\t\t\tconst methodName = argsMatch[1];\n\t\t\t\t\tconst methodArgs = JSON.parse(`[${argsMatch[2]}]`);\n\n\t\t\t\t\tconst dynValue = ccValues[methodName];\n\t\t\t\t\tif (typeof dynValue === \"function\") {\n\t\t\t\t\t\treturn dynValue(...methodArgs);\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\tconst staticValue = ccValues[prop] as\n\t\t\t\t\t\t| StaticCCValue\n\t\t\t\t\t\t| undefined;\n\t\t\t\t\tif (typeof staticValue?.endpoint === \"function\") {\n\t\t\t\t\t\treturn staticValue;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t};\n\n\t\t\t// Persist values if necessary\n\t\t\tif (match.persistValues) {\n\t\t\t\tfor (\n\t\t\t\t\tconst [prop, value] of Object.entries(\n\t\t\t\t\t\tmatch.persistValues,\n\t\t\t\t\t)\n\t\t\t\t) {\n\t\t\t\t\ttry {\n\t\t\t\t\t\tconst ccValue = prop2value(prop);\n\t\t\t\t\t\tif (ccValue) {\n\t\t\t\t\t\t\tvalueDB.setValue(\n\t\t\t\t\t\t\t\tccValue.endpoint(endpoint.index),\n\t\t\t\t\t\t\t\tvalue,\n\t\t\t\t\t\t\t);\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tctx.logNode(endpoint.nodeId, {\n\t\t\t\t\t\t\t\tmessage:\n\t\t\t\t\t\t\t\t\t`Failed to persist value ${prop} during overridden API call: value does not exist`,\n\t\t\t\t\t\t\t\tlevel: \"error\",\n\t\t\t\t\t\t\t\tdirection: \"none\",\n\t\t\t\t\t\t\t});\n\t\t\t\t\t\t}\n\t\t\t\t\t} catch (e) {\n\t\t\t\t\t\tctx.logNode(endpoint.nodeId, {\n\t\t\t\t\t\t\tmessage:\n\t\t\t\t\t\t\t\t`Failed to persist value ${prop} during overridden API call: ${\n\t\t\t\t\t\t\t\t\tgetErrorMessage(\n\t\t\t\t\t\t\t\t\t\te,\n\t\t\t\t\t\t\t\t\t)\n\t\t\t\t\t\t\t\t}`,\n\t\t\t\t\t\t\tlevel: \"error\",\n\t\t\t\t\t\t\tdirection: \"none\",\n\t\t\t\t\t\t});\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// As well as metadata\n\t\t\tif (match.extendMetadata) {\n\t\t\t\tfor (\n\t\t\t\t\tconst [prop, meta] of Object.entries(\n\t\t\t\t\t\tmatch.extendMetadata,\n\t\t\t\t\t)\n\t\t\t\t) {\n\t\t\t\t\ttry {\n\t\t\t\t\t\tconst ccValue = prop2value(prop);\n\t\t\t\t\t\tif (ccValue) {\n\t\t\t\t\t\t\tvalueDB.setMetadata(\n\t\t\t\t\t\t\t\tccValue.endpoint(endpoint.index),\n\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t...ccValue.meta,\n\t\t\t\t\t\t\t\t\t...meta,\n\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t);\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tctx.logNode(endpoint.nodeId, {\n\t\t\t\t\t\t\t\tmessage:\n\t\t\t\t\t\t\t\t\t`Failed to extend value metadata ${prop} during overridden API call: value does not exist`,\n\t\t\t\t\t\t\t\tlevel: \"error\",\n\t\t\t\t\t\t\t\tdirection: \"none\",\n\t\t\t\t\t\t\t});\n\t\t\t\t\t\t}\n\t\t\t\t\t} catch (e) {\n\t\t\t\t\t\tctx.logNode(endpoint.nodeId, {\n\t\t\t\t\t\t\tmessage:\n\t\t\t\t\t\t\t\t`Failed to extend value metadata ${prop} during overridden API call: ${\n\t\t\t\t\t\t\t\t\tgetErrorMessage(\n\t\t\t\t\t\t\t\t\t\te,\n\t\t\t\t\t\t\t\t\t)\n\t\t\t\t\t\t\t\t}`,\n\t\t\t\t\t\t\tlevel: \"error\",\n\t\t\t\t\t\t\tdirection: \"none\",\n\t\t\t\t\t\t});\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t// API methods are always async\n\t\treturn Promise.resolve(match.result);\n\t};\n}\n\n/** A CC API that is only available for physical endpoints */\nexport class PhysicalCCAPI extends CCAPI {\n\tpublic constructor(\n\t\thost: CCAPIHost,\n\t\tendpoint: CCAPIEndpoint,\n\t) {\n\t\tsuper(host, endpoint);\n\t\tthis.assertPhysicalEndpoint(endpoint);\n\t}\n\n\tdeclare protected readonly endpoint: PhysicalCCAPIEndpoint;\n}\n\nexport type APIConstructor<T extends CCAPI = CCAPI> = new (\n\thost: CCAPIHost,\n\tendpoint: CCAPIEndpoint,\n) => T;\n\n// This type is auto-generated by maintenance/generateCCAPIInterface.ts\n// Do not edit it by hand or your changes will be lost\ntype CCNameMap = {\n\t\"Alarm Sensor\": typeof CommandClasses[\"Alarm Sensor\"];\n\tAssociation: typeof CommandClasses[\"Association\"];\n\t\"Association Group Information\":\n\t\ttypeof CommandClasses[\"Association Group Information\"];\n\t\"Barrier Operator\": typeof CommandClasses[\"Barrier Operator\"];\n\tBasic: typeof CommandClasses[\"Basic\"];\n\tBattery: typeof CommandClasses[\"Battery\"];\n\t\"Binary Sensor\": typeof CommandClasses[\"Binary Sensor\"];\n\t\"Binary Switch\": typeof CommandClasses[\"Binary Switch\"];\n\t\"CRC-16 Encapsulation\": typeof CommandClasses[\"CRC-16 Encapsulation\"];\n\t\"Central Scene\": typeof CommandClasses[\"Central Scene\"];\n\t\"Climate Control Schedule\":\n\t\ttypeof CommandClasses[\"Climate Control Schedule\"];\n\tClock: typeof CommandClasses[\"Clock\"];\n\t\"Color Switch\": typeof CommandClasses[\"Color Switch\"];\n\tConfiguration: typeof CommandClasses[\"Configuration\"];\n\t\"Device Reset Locally\": typeof CommandClasses[\"Device Reset Locally\"];\n\t\"Door Lock\": typeof CommandClasses[\"Door Lock\"];\n\t\"Door Lock Logging\": typeof CommandClasses[\"Door Lock Logging\"];\n\t\"Energy Production\": typeof CommandClasses[\"Energy Production\"];\n\t\"Entry Control\": typeof CommandClasses[\"Entry Control\"];\n\t\"Firmware Update Meta Data\":\n\t\ttypeof CommandClasses[\"Firmware Update Meta Data\"];\n\t\"Humidity Control Mode\": typeof CommandClasses[\"Humidity Control Mode\"];\n\t\"Humidity Control Operating State\":\n\t\ttypeof CommandClasses[\"Humidity Control Operating State\"];\n\t\"Humidity Control Setpoint\":\n\t\ttypeof CommandClasses[\"Humidity Control Setpoint\"];\n\t\"Inclusion Controller\": typeof CommandClasses[\"Inclusion Controller\"];\n\tIndicator: typeof CommandClasses[\"Indicator\"];\n\tIrrigation: typeof CommandClasses[\"Irrigation\"];\n\tLanguage: typeof CommandClasses[\"Language\"];\n\tLock: typeof CommandClasses[\"Lock\"];\n\t\"Manufacturer Proprietary\":\n\t\ttypeof CommandClasses[\"Manufacturer Proprietary\"];\n\t\"Manufacturer Specific\": typeof CommandClasses[\"Manufacturer Specific\"];\n\tMeter: typeof CommandClasses[\"Meter\"];\n\t\"Multi Channel Association\":\n\t\ttypeof CommandClasses[\"Multi Channel Association\"];\n\t\"Multi Channel\": typeof CommandClasses[\"Multi Channel\"];\n\t\"Multi Command\": typeof CommandClasses[\"Multi Command\"];\n\t\"Multilevel Sensor\": typeof CommandClasses[\"Multilevel Sensor\"];\n\t\"Multilevel Switch\": typeof CommandClasses[\"Multilevel Switch\"];\n\t\"No Operation\": typeof CommandClasses[\"No Operation\"];\n\t\"Node Naming and Location\":\n\t\ttypeof CommandClasses[\"Node Naming and Location\"];\n\tNotification: typeof CommandClasses[\"Notification\"];\n\tPowerlevel: typeof CommandClasses[\"Powerlevel\"];\n\tProtection: typeof CommandClasses[\"Protection\"];\n\t\"Scene Activation\": typeof CommandClasses[\"Scene Activation\"];\n\t\"Scene Actuator Configuration\":\n\t\ttypeof CommandClasses[\"Scene Actuator Configuration\"];\n\t\"Scene Controller Configuration\":\n\t\ttypeof CommandClasses[\"Scene Controller Configuration\"];\n\t\"Schedule Entry Lock\": typeof CommandClasses[\"Schedule Entry Lock\"];\n\t\"Security 2\": typeof CommandClasses[\"Security 2\"];\n\tSecurity: typeof CommandClasses[\"Security\"];\n\t\"Sound Switch\": typeof CommandClasses[\"Sound Switch\"];\n\tSupervision: typeof CommandClasses[\"Supervision\"];\n\t\"Thermostat Fan Mode\": typeof CommandClasses[\"Thermostat Fan Mode\"];\n\t\"Thermostat Fan State\": typeof CommandClasses[\"Thermostat Fan State\"];\n\t\"Thermostat Mode\": typeof CommandClasses[\"Thermostat Mode\"];\n\t\"Thermostat Operating State\":\n\t\ttypeof CommandClasses[\"Thermostat Operating State\"];\n\t\"Thermostat Setback\": typeof CommandClasses[\"Thermostat Setback\"];\n\t\"Thermostat Setpoint\": typeof CommandClasses[\"Thermostat Setpoint\"];\n\tTime: typeof CommandClasses[\"Time\"];\n\t\"Time Parameters\": typeof CommandClasses[\"Time Parameters\"];\n\t\"User Code\": typeof CommandClasses[\"User Code\"];\n\tVersion: typeof CommandClasses[\"Version\"];\n\t\"Wake Up\": typeof CommandClasses[\"Wake Up\"];\n\t\"Window Covering\": typeof CommandClasses[\"Window Covering\"];\n\t\"Z-Wave Plus Info\": typeof CommandClasses[\"Z-Wave Plus Info\"];\n};\nexport type CCToName<CC extends CommandClasses> = {\n\t[K in keyof CCNameMap]: CCNameMap[K] extends CC ? K : never;\n}[keyof CCNameMap];\n\nexport type CCNameOrId = CommandClasses | Extract<keyof CCAPIs, string>;\n\nexport type CCToAPI<CC extends CCNameOrId> = CC extends CommandClasses\n\t? CCToName<CC> extends keyof CCAPIs ? CCAPIs[CCToName<CC>]\n\t: never\n\t: CC extends keyof CCAPIs ? CCAPIs[CC]\n\t: never;\n\nexport type APIMethodsOf<CC extends CCNameOrId> = Omit<\n\tOnlyMethods<CCToAPI<CC>>,\n\t| \"ccId\"\n\t| \"getNode\"\n\t| \"tryGetNode\"\n\t| \"isSetValueOptimistic\"\n\t| \"isSupported\"\n\t| \"pollValue\"\n\t| \"setValue\"\n\t| \"version\"\n\t| \"supportsCommand\"\n\t| \"withOptions\"\n\t| \"withTXReport\"\n>;\n\nexport type OwnMethodsOf<API extends CCAPI> = Omit<\n\tOnlyMethods<API>,\n\tkeyof OnlyMethods<CCAPI>\n>;\n\n// Wraps the given type in an object that contains a TX report\nexport type WrapWithTXReport<T> = [T] extends [Promise<infer U>]\n\t? Promise<WrapWithTXReport<U>>\n\t: [T] extends [void] ? { txReport: TXReport | undefined }\n\t: { result: T; txReport: TXReport | undefined };\n\nexport type ReturnWithTXReport<T> = T extends (...args: any[]) => any\n\t? (...args: Parameters<T>) => WrapWithTXReport<ReturnType<T>>\n\t: undefined;\n\n// Converts the type of the given API implementation so the API methods return an object including the TX report\nexport type WithTXReport<API extends CCAPI> =\n\t& Omit<\n\t\tAPI,\n\t\tkeyof OwnMethodsOf<API> | \"withOptions\" | \"withTXReport\" | \"setValue\"\n\t>\n\t& {\n\t\t[\n\t\t\tK in\n\t\t\t\t| keyof OwnMethodsOf<API>\n\t\t\t\t| \"setValue\"\n\t\t\t\t| \"pollValue\"\n\t\t]: ReturnWithTXReport<API[K]>;\n\t};\n\nexport function normalizeCCNameOrId(\n\tccNameOrId: number | string,\n): CommandClasses | undefined {\n\tif (!(ccNameOrId in CommandClasses)) return undefined;\n\n\tlet ret: CommandClasses | undefined;\n\tif (typeof ccNameOrId === \"string\") {\n\t\tif (/^\\d+$/.test(ccNameOrId)) {\n\t\t\t// This can happen on property access\n\t\t\tret = +ccNameOrId;\n\t\t} else if (typeof (CommandClasses as any)[ccNameOrId] === \"number\") {\n\t\t\tret = (CommandClasses as any)[ccNameOrId];\n\t\t}\n\t} else {\n\t\tret = ccNameOrId;\n\t}\n\n\treturn ret;\n}\n\n// This interface is auto-generated by maintenance/generateCCAPIInterface.ts\n// Do not edit it by hand or your changes will be lost\nexport interface CCAPIs {\n\t[Symbol.iterator](): Iterator<CCAPI>;\n\n\t// AUTO GENERATION BELOW\n\t\"Alarm Sensor\": import(\"../cc/AlarmSensorCC.js\").AlarmSensorCCAPI;\n\tAssociation: import(\"../cc/AssociationCC.js\").AssociationCCAPI;\n\t\"Association Group Information\":\n\t\timport(\"../cc/AssociationGroupInfoCC.js\").AssociationGroupInfoCCAPI;\n\t\"Barrier Operator\":\n\t\timport(\"../cc/BarrierOperatorCC.js\").BarrierOperatorCCAPI;\n\tBasic: import(\"../cc/BasicCC.js\").BasicCCAPI;\n\tBattery: import(\"../cc/BatteryCC.js\").BatteryCCAPI;\n\t\"Binary Sensor\": import(\"../cc/BinarySensorCC.js\").BinarySensorCCAPI;\n\t\"Binary Switch\": import(\"../cc/BinarySwitchCC.js\").BinarySwitchCCAPI;\n\t\"CRC-16 Encapsulation\": import(\"../cc/CRC16CC.js\").CRC16CCAPI;\n\t\"Central Scene\": import(\"../cc/CentralSceneCC.js\").CentralSceneCCAPI;\n\t\"Climate Control Schedule\":\n\t\timport(\"../cc/ClimateControlScheduleCC.js\").ClimateControlScheduleCCAPI;\n\tClock: import(\"../cc/ClockCC.js\").ClockCCAPI;\n\t\"Color Switch\": import(\"../cc/ColorSwitchCC.js\").ColorSwitchCCAPI;\n\tConfiguration: import(\"../cc/ConfigurationCC.js\").ConfigurationCCAPI;\n\t\"Device Reset Locally\":\n\t\timport(\"../cc/DeviceResetLocallyCC.js\").DeviceResetLocallyCCAPI;\n\t\"Door Lock\": import(\"../cc/DoorLockCC.js\").DoorLockCCAPI;\n\t\"Door Lock Logging\":\n\t\timport(\"../cc/DoorLockLoggingCC.js\").DoorLockLoggingCCAPI;\n\t\"Energy Production\":\n\t\timport(\"../cc/EnergyProductionCC.js\").EnergyProductionCCAPI;\n\t\"Entry Control\": import(\"../cc/EntryControlCC.js\").EntryControlCCAPI;\n\t\"Firmware Update Meta Data\":\n\t\timport(\"../cc/FirmwareUpdateMetaDataCC.js\").FirmwareUpdateMetaDataCCAPI;\n\t\"Humidity Control Mode\":\n\t\timport(\"../cc/HumidityControlModeCC.js\").HumidityControlModeCCAPI;\n\t\"Humidity Control Operating State\":\n\t\timport(\"../cc/HumidityControlOperatingStateCC.js\").HumidityControlOperatingStateCCAPI;\n\t\"Humidity Control Setpoint\":\n\t\timport(\"../cc/HumidityControlSetpointCC.js\").HumidityControlSetpointCCAPI;\n\t\"Inclusion Controller\":\n\t\timport(\"../cc/InclusionControllerCC.js\").InclusionControllerCCAPI;\n\tIndicator: import(\"../cc/IndicatorCC.js\").IndicatorCCAPI;\n\tIrrigation: import(\"../cc/IrrigationCC.js\").IrrigationCCAPI;\n\tLanguage: import(\"../cc/LanguageCC.js\").LanguageCCAPI;\n\tLock: import(\"../cc/LockCC.js\").LockCCAPI;\n\t\"Manufacturer Proprietary\":\n\t\timport(\"../cc/ManufacturerProprietaryCC.js\").ManufacturerProprietaryCCAPI;\n\t\"Manufacturer Specific\":\n\t\timport(\"../cc/ManufacturerSpecificCC.js\").ManufacturerSpecificCCAPI;\n\tMeter: import(\"../cc/MeterCC.js\").MeterCCAPI;\n\t\"Multi Channel Association\":\n\t\timport(\"../cc/MultiChannelAssociationCC.js\").MultiChannelAssociationCCAPI;\n\t\"Multi Channel\": import(\"../cc/MultiChannelCC.js\").MultiChannelCCAPI;\n\t\"Multi Command\": import(\"../cc/MultiCommandCC.js\").MultiCommandCCAPI;\n\t\"Multilevel Sensor\":\n\t\timport(\"../cc/MultilevelSensorCC.js\").MultilevelSensorCCAPI;\n\t\"Multilevel Switch\":\n\t\timport(\"../cc/MultilevelSwitchCC.js\").MultilevelSwitchCCAPI;\n\t\"No Operation\": import(\"../cc/NoOperationCC.js\").NoOperationCCAPI;\n\t\"Node Naming and Location\":\n\t\timport(\"../cc/NodeNamingCC.js\").NodeNamingAndLocationCCAPI;\n\tNotification: import(\"../cc/NotificationCC.js\").NotificationCCAPI;\n\tPowerlevel: import(\"../cc/PowerlevelCC.js\").PowerlevelCCAPI;\n\tProtection: import(\"../cc/ProtectionCC.js\").ProtectionCCAPI;\n\t\"Scene Activation\":\n\t\timport(\"../cc/SceneActivationCC.js\").SceneActivationCCAPI;\n\t\"Scene Actuator Configuration\":\n\t\timport(\"../cc/SceneActuatorConfigurationCC.js\").SceneActuatorConfigurationCCAPI;\n\t\"Scene Controller Configuration\":\n\t\timport(\"../cc/SceneControllerConfigurationCC.js\").SceneControllerConfigurationCCAPI;\n\t\"Schedule Entry Lock\":\n\t\timport(\"../cc/ScheduleEntryLockCC.js\").ScheduleEntryLockCCAPI;\n\t\"Security 2\": import(\"../cc/Security2CC.js\").Security2CCAPI;\n\tSecurity: import(\"../cc/SecurityCC.js\").SecurityCCAPI;\n\t\"Sound Switch\": import(\"../cc/SoundSwitchCC.js\").SoundSwitchCCAPI;\n\tSupervision: import(\"../cc/SupervisionCC.js\").SupervisionCCAPI;\n\t\"Thermostat Fan Mode\":\n\t\timport(\"../cc/ThermostatFanModeCC.js\").ThermostatFanModeCCAPI;\n\t\"Thermostat Fan State\":\n\t\timport(\"../cc/ThermostatFanStateCC.js\").ThermostatFanStateCCAPI;\n\t\"Thermostat Mode\": import(\"../cc/ThermostatModeCC.js\").ThermostatModeCCAPI;\n\t\"Thermostat Operating State\":\n\t\timport(\"../cc/ThermostatOperatingStateCC.js\").ThermostatOperatingStateCCAPI;\n\t\"Thermostat Setback\":\n\t\timport(\"../cc/ThermostatSetbackCC.js\").ThermostatSetbackCCAPI;\n\t\"Thermostat Setpoint\":\n\t\timport(\"../cc/ThermostatSetpointCC.js\").ThermostatSetpointCCAPI;\n\tTime: import(\"../cc/TimeCC.js\").TimeCCAPI;\n\t\"Time Parameters\": import(\"../cc/TimeParametersCC.js\").TimeParametersCCAPI;\n\t\"User Code\": import(\"../cc/UserCodeCC.js\").UserCodeCCAPI;\n\tVersion: import(\"../cc/VersionCC.js\").VersionCCAPI;\n\t\"Wake Up\": import(\"../cc/WakeUpCC.js\").WakeUpCCAPI;\n\t\"Window Covering\": import(\"../cc/WindowCoveringCC.js\").WindowCoveringCCAPI;\n\t\"Z-Wave Plus Info\": import(\"../cc/ZWavePlusCC.js\").ZWavePlusCCAPI;\n}\n"],
5
+ "mappings": ";;;;;;;;;;;;;;;;;;;AAKA;;;;;;;;;;;;;;AAAA,kBAiCO;AACP,oBAMO;AACP,wBAAwB;AACxB,oCAKO;AAWA,MAAM,YAA2B,OAAO,IAAI,iBAAiB;AAQ7D,MAAM,kBAAiC,OAAO,IACpD,uBAAuB;AAqCjB,MAAM,aAA4B,OAAO,IAAI,kBAAkB;AAOhE,SAAU,yBACf,IACA,UAAyB;AAEzB,QAAM,IAAI,uBACT,GAAG,2BAAe,EAAE,CAAC,MAAM,QAAQ,iCACnC,4BAAgB,gBAAgB;AAElC;AARgB;AAUV,SAAU,4BACf,IACA,UACA,aAA4B;AAE5B,QAAM,IAAI,uBACT,GACC,2BAAe,EAAE,CAClB,MAAM,WAAW,mDAAmD,QAAQ,KAC5E,4BAAgB,gBAAgB;AAElC;AAXgB;AAaV,SAAU,wBACf,IACA,UAAyB;AAEzB,QAAM,IAAI,uBACT,GACC,2BAAe,EAAE,CAClB,eAAe,QAAQ,iDACvB,4BAAgB,gBAAgB;AAElC;AAVgB;AAYV,SAAU,oBACf,IACA,UACA,cACA,cAAoB;AAEpB,QAAM,IAAI,uBACT,GACC,2BAAe,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lBgB;",
6
6
  "names": []
7
7
  }
@@ -1,9 +1,12 @@
1
- import { type BroadcastCC, type CCAddress, type CCId, CommandClasses, type ControlsCC, EncapsulationFlags, type EndpointId, type FrameType, type GetAllEndpoints, type GetCCs, type GetEndpoint, type ListenBehavior, type MessageOrCCLogEntry, type ModifyCCs, type MulticastCC, type MulticastDestination, type NodeId, type QueryNodeStatus, type QuerySecurityClasses, type SetSecurityClass, type SinglecastCC, type SupportsCC, type ValueDB, type ValueID, type ValueMetadata, ZWaveErrorCodes } from "@zwave-js/core";
2
- import type { CCEncodingContext, CCParsingContext, GetDeviceConfig, GetInterviewOptions, GetNode, GetSupportedCCVersion, GetValueDB, HostIDs, LogNode, LookupManufacturer } from "@zwave-js/host";
3
- import { Bytes, type JSONObject } from "@zwave-js/shared";
1
+ import { type CCEncodingContext, type CCParsingContext } from "@zwave-js/cc";
2
+ import { type GetDeviceConfig, type LookupManufacturer } from "@zwave-js/config";
3
+ import { type LogNode } from "@zwave-js/core";
4
+ import { type BroadcastCC, type CCAddress, type CCId, CommandClasses, type ControlsCC, EncapsulationFlags, type EndpointId, type FrameType, type GetAllEndpoints, type GetCCs, type GetEndpoint, type GetNode, type GetSupportedCCVersion, type GetValueDB, type HostIDs, type ListenBehavior, type MessageOrCCLogEntry, type ModifyCCs, type MulticastCC, type MulticastDestination, type NodeId, type QueryNodeStatus, type QuerySecurityClasses, type SetSecurityClass, type SinglecastCC, type SupportsCC, type ValueDB, type ValueID, type ValueMetadata, ZWaveErrorCodes } from "@zwave-js/core/safe";
5
+ import { Bytes, type JSONObject } from "@zwave-js/shared/safe";
4
6
  import type { CCAPIHost, CCAPINode, ValueIDProperties } from "./API.js";
5
7
  import { type EncapsulatingCommandClass } from "./EncapsulatingCommandClass.js";
6
8
  import { type CCValue, type DynamicCCValue, type StaticCCValue } from "./Values.js";
9
+ import { type GetInterviewOptions } from "./traits.js";
7
10
  export interface CommandClassOptions extends CCAddress {
8
11
  ccId?: number;
9
12
  ccCommand?: number;
@@ -25,12 +28,8 @@ export declare class CCRaw {
25
28
  }
26
29
  export declare class CommandClass implements CCId {
27
30
  constructor(options: CommandClassOptions);
28
- /** @deprecated Use {@link parseAsync} instead */
29
- static parse(data: Uint8Array, ctx: CCParsingContext): CommandClass;
30
- static parseAsync(data: Uint8Array, ctx: CCParsingContext): Promise<CommandClass>;
31
- /** @deprecated Use {@link fromAsync} instead */
32
- static from(raw: CCRaw, ctx: CCParsingContext): CommandClass;
33
- static fromAsync(raw: CCRaw, ctx: CCParsingContext): Promise<CommandClass>;
31
+ static parse(data: Uint8Array, ctx: CCParsingContext): Promise<CommandClass>;
32
+ static from(raw: CCRaw, ctx: CCParsingContext): CommandClass | Promise<CommandClass>;
34
33
  /** This CC's identifier */
35
34
  ccId: CommandClasses;
36
35
  ccCommand?: number;
@@ -60,13 +59,8 @@ export declare class CommandClass implements CCId {
60
59
  setInterviewComplete(host: GetValueDB, complete: boolean): void;
61
60
  /**
62
61
  * Serializes this CommandClass to be embedded in a message payload or another CC
63
- * @deprecated Use {@link serializeAsync} instead
64
62
  */
65
- serialize(ctx: CCEncodingContext): Bytes;
66
- /**
67
- * Serializes this CommandClass to be embedded in a message payload or another CC
68
- */
69
- serializeAsync(ctx: CCEncodingContext): Promise<Bytes>;
63
+ serialize(ctx: CCEncodingContext): Promise<Bytes>;
70
64
  prepareRetransmission(): void;
71
65
  /**
72
66
  * Create an instance of the given CC without checking whether it is supported.
@@ -186,13 +180,8 @@ export declare class CommandClass implements CCId {
186
180
  * @param _session The previously received set of messages received in this partial CC session
187
181
  */
188
182
  expectMoreMessages(_session: CommandClass[]): boolean;
189
- /**
190
- * Include previously received partial responses into a final CC
191
- * @deprecated Use {@link mergePartialCCsAsync} instead
192
- */
193
- mergePartialCCs(_partials: CommandClass[], _ctx: CCParsingContext): void;
194
183
  /** Include previously received partial responses into a final CC */
195
- mergePartialCCsAsync(_partials: CommandClass[], _ctx: CCParsingContext): Promise<void>;
184
+ mergePartialCCs(_partials: CommandClass[], _ctx: CCParsingContext): Promise<void>;
196
185
  /** Tests whether this CC expects at least one command in return */
197
186
  expectsCCResponse(): boolean;
198
187
  isExpectedCCResponse(received: CommandClass): boolean;