@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
@@ -42,8 +42,8 @@ __export(CommandClassDecorators_exports, {
42
42
  useSupervision: () => useSupervision
43
43
  });
44
44
  module.exports = __toCommonJS(CommandClassDecorators_exports);
45
- var import_core = require("@zwave-js/core");
46
45
  var import_reflection = require("@zwave-js/core/reflection");
46
+ var import_safe = require("@zwave-js/core/safe");
47
47
  const CCAndCommandDecorator = (0, import_reflection.createReflectionDecoratorPair)({ superName: "ccId", subName: "ccCommand" });
48
48
  const commandClass = CCAndCommandDecorator.superDecorator;
49
49
  const getCCConstructor = CCAndCommandDecorator.lookupSuperConstructor;
@@ -53,7 +53,7 @@ const getCCCommandConstructor = CCAndCommandDecorator.lookupSubConstructor;
53
53
  function getCommandClassStatic(classConstructor) {
54
54
  const ret = CCAndCommandDecorator.lookupSuperValueStatic(classConstructor);
55
55
  if (ret == void 0) {
56
- throw new import_core.ZWaveError(`No command class defined for ${classConstructor.name}!`, import_core.ZWaveErrorCodes.CC_Invalid);
56
+ throw new import_safe.ZWaveError(`No command class defined for ${classConstructor.name}!`, import_safe.ZWaveErrorCodes.CC_Invalid);
57
57
  }
58
58
  return ret;
59
59
  }
@@ -71,7 +71,7 @@ function getCommandClass(cc) {
71
71
  const constr = cc.constructor;
72
72
  const ret = CCAndCommandDecorator.lookupSuperValueStatic(constr) ?? apiDecorator.lookupValueStatic(constr);
73
73
  if (ret == void 0) {
74
- throw new import_core.ZWaveError(`No command class defined for ${constr.name}!`, import_core.ZWaveErrorCodes.CC_Invalid);
74
+ throw new import_safe.ZWaveError(`No command class defined for ${constr.name}!`, import_safe.ZWaveErrorCodes.CC_Invalid);
75
75
  }
76
76
  return ret;
77
77
  }
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../src/lib/CommandClassDecorators.ts"],
4
- "sourcesContent": ["import {\n\ttype CommandClasses,\n\tZWaveError,\n\tZWaveErrorCodes,\n} from \"@zwave-js/core\";\nimport {\n\tcreateReflectionDecorator,\n\tcreateReflectionDecoratorPair,\n\tcreateValuelessReflectionDecorator,\n} from \"@zwave-js/core/reflection\";\nimport type { TypedClassDecorator } from \"@zwave-js/shared\";\nimport type { APIConstructor, CCAPI } from \"./API.js\";\nimport {\n\ttype CCConstructor,\n\ttype CCResponsePredicate,\n\ttype CommandClass,\n\ttype DynamicCCResponse,\n} from \"./CommandClass.js\";\nimport type {\n\tDynamicCCValue,\n\tStaticCCValue,\n\tStaticCCValueFactory,\n} from \"./Values.js\";\n\nconst CCAndCommandDecorator = createReflectionDecoratorPair<\n\ttypeof CommandClass,\n\t[ccId: CommandClasses],\n\t[ccCommand: number],\n\tCCConstructor<CommandClass>\n>({ superName: \"ccId\", subName: \"ccCommand\" });\n\n/**\n * @publicAPI\n * Defines the CC ID associated with a Z-Wave Command Class\n */\nexport const commandClass = CCAndCommandDecorator.superDecorator;\n\n/**\n * @publicAPI\n * Looks up the command class constructor for a given CC ID\n */\nexport const getCCConstructor = CCAndCommandDecorator.lookupSuperConstructor;\n\n/**\n * @publicAPI\n * Defines the CC command a subclass of a CC implements\n */\nexport const CCCommand = CCAndCommandDecorator.subDecorator;\n\n/**\n * @publicAPI\n * Retrieves the CC command a subclass of a CC implements\n */\nexport const getCCCommand = CCAndCommandDecorator.lookupSubValue;\n\n/**\n * @publicAPI\n * Looks up the command class constructor for a given CC ID and command\n */\nexport const getCCCommandConstructor =\n\tCCAndCommandDecorator.lookupSubConstructor;\n\n/**\n * @publicAPI\n * Retrieves the CC ID defined for a Z-Wave Command Class\n */\nexport function getCommandClassStatic<T extends CCConstructor<CommandClass>>(\n\tclassConstructor: T,\n): CommandClasses {\n\t// retrieve the current metadata\n\tconst ret = CCAndCommandDecorator.lookupSuperValueStatic(classConstructor);\n\tif (ret == undefined) {\n\t\tthrow new ZWaveError(\n\t\t\t`No command class defined for ${classConstructor.name}!`,\n\t\t\tZWaveErrorCodes.CC_Invalid,\n\t\t);\n\t}\n\treturn ret;\n}\n\nconst apiDecorator = createReflectionDecorator<\n\ttypeof CCAPI,\n\t[cc: CommandClasses],\n\tCommandClasses,\n\tAPIConstructor\n>({\n\tname: \"API\",\n\tvalueFromArgs: (cc) => cc,\n});\n\n/**\n * @publicAPI\n * Defines the CC ID a CC API implementation belongs to\n */\nexport const API = apiDecorator.decorator;\n\n/**\n * @publicAPI\n * Retrieves the CC API constructor that is defined for a Z-Wave CC ID\n */\nexport function getAPI(cc: CommandClasses): APIConstructor | undefined {\n\treturn apiDecorator.lookupConstructorByValue(cc);\n}\n\n/**\n * @publicAPI\n * Retrieves the CC ID associated with a Z-Wave Command Class or CC API\n */\nexport function getCommandClass(cc: CommandClass | CCAPI): CommandClasses {\n\t// get the class constructor\n\tconst constr = cc.constructor;\n\t// retrieve the current metadata\n\tconst ret = CCAndCommandDecorator.lookupSuperValueStatic(\n\t\tconstr as typeof CommandClass,\n\t)\n\t\t?? apiDecorator.lookupValueStatic(constr as typeof CCAPI);\n\n\tif (ret == undefined) {\n\t\tthrow new ZWaveError(\n\t\t\t`No command class defined for ${constr.name}!`,\n\t\t\tZWaveErrorCodes.CC_Invalid,\n\t\t);\n\t}\n\treturn ret;\n}\n\nconst implementedVersionDecorator = createReflectionDecorator<\n\ttypeof CommandClass,\n\t[version: number],\n\tnumber\n>({\n\tname: \"implementedVersion\",\n\tvalueFromArgs: (version) => version,\n\tconstructorLookupKey: false,\n});\n\n/**\n * @publicAPI\n * Defines the implemented version of a Z-Wave command class\n */\nexport const implementedVersion = implementedVersionDecorator.decorator;\n\n/**\n * @publicAPI\n * Retrieves the implemented version defined for a Z-Wave command class\n */\nexport function getImplementedVersion<T extends CommandClass>(\n\tcc: T | CommandClasses,\n): number {\n\t// get the class constructor\n\tlet constr: CCConstructor<CommandClass> | undefined;\n\tif (typeof cc === \"number\") {\n\t\tconstr = getCCConstructor(cc);\n\t} else {\n\t\tconstr = cc.constructor as CCConstructor<CommandClass>;\n\t}\n\n\tif (!constr) return 0;\n\treturn implementedVersionDecorator.lookupValueStatic(constr) ?? 0;\n}\n\n/**\n * @publicAPI\n * Retrieves the implemented version defined for a Z-Wave command class\n */\nexport function getImplementedVersionStatic<\n\tT extends CCConstructor<CommandClass>,\n>(classConstructor: T): number {\n\treturn implementedVersionDecorator.lookupValueStatic(classConstructor) ?? 0;\n}\n\nconst expectedCCResponseDecorator = createReflectionDecorator<\n\ttypeof CommandClass,\n\t[\n\t\tcc:\n\t\t\t| CCConstructor<CommandClass>\n\t\t\t| DynamicCCResponse<CommandClass, CommandClass>,\n\t\tpredicate?: CCResponsePredicate<CommandClass, CommandClass>,\n\t],\n\t{\n\t\tcc:\n\t\t\t| CCConstructor<CommandClass>\n\t\t\t| DynamicCCResponse<CommandClass, CommandClass>;\n\t\tpredicate?: CCResponsePredicate<CommandClass, CommandClass>;\n\t}\n>({\n\tname: \"expectedCCResponse\",\n\tvalueFromArgs: (cc, predicate) => ({ cc, predicate }),\n\t// We don't need reverse lookup\n\tconstructorLookupKey: false,\n});\n\n/**\n * @publicAPI\n * Defines the expected response associated with a Z-Wave message\n */\nexport function expectedCCResponse<\n\tTTarget extends typeof CommandClass,\n\tTSent extends CommandClass,\n\tTReceived extends CommandClass,\n>(\n\tcc: CCConstructor<TReceived> | DynamicCCResponse<TSent, TReceived>,\n\tpredicate?: CCResponsePredicate<TSent, TReceived>,\n): TypedClassDecorator<TTarget> {\n\treturn expectedCCResponseDecorator.decorator(cc as any, predicate as any);\n}\n\n/**\n * @publicAPI\n * Retrieves the expected response (static or dynamic) defined for a Z-Wave message class\n */\nexport function getExpectedCCResponse<T extends CommandClass>(\n\tccClass: T,\n): typeof CommandClass | DynamicCCResponse<T> | undefined {\n\treturn expectedCCResponseDecorator.lookupValue(ccClass)?.cc;\n}\n\n/**\n * @publicAPI\n * Retrieves the CC response predicate defined for a Z-Wave message class\n */\nexport function getCCResponsePredicate<T extends CommandClass>(\n\tccClass: T,\n): CCResponsePredicate<T> | undefined {\n\treturn expectedCCResponseDecorator.lookupValue(ccClass)?.predicate;\n}\n\nconst ccValuesDecorator = createReflectionDecorator<\n\ttypeof CommandClass,\n\t[valueDefinition: Record<string, StaticCCValue | DynamicCCValue>],\n\tRecord<string, StaticCCValue | DynamicCCValue | undefined>\n>({\n\tname: \"ccValues\",\n\tvalueFromArgs: (valueDefinition) => valueDefinition,\n\t// We don't need reverse lookup\n\tconstructorLookupKey: false,\n});\n\n/**\n * @publicAPI\n * Defines which CC value definitions belong to a Z-Wave command class\n */\nexport const ccValues = ccValuesDecorator.decorator;\n\n/**\n * @publicAPI\n * Retrieves the CC value definitions which belong to a Z-Wave command class\n */\nexport function getCCValues<T extends CommandClass>(\n\tcc: T | CommandClasses,\n): Record<string, StaticCCValue | DynamicCCValue | undefined> | undefined {\n\t// get the class constructor\n\tlet constr: CCConstructor<CommandClass> | undefined;\n\tif (typeof cc === \"number\") {\n\t\tconstr = getCCConstructor(cc);\n\t} else {\n\t\tconstr = cc.constructor as CCConstructor<CommandClass>;\n\t}\n\n\tif (constr) return ccValuesDecorator.lookupValueStatic(constr);\n}\n\nconst ccValue_METADATA = Symbol.for(`METADATA_ccValue`);\n\n// /**\n// * @publicAPI\n// * Defines which CC value a Z-Wave command class property belongs to\n// */\n// export function ccValue<TTarget extends CommandClass>(\n// \tvalue: StaticCCValue,\n// ): TypedPropertyDecorator<TTarget>;\n\n// export function ccValue<TTarget extends CommandClass, TArgs extends any[]>(\n// \tvalue: DynamicCCValue<TArgs>,\n// \tgetArgs: (self: TTarget) => Readonly<TArgs>,\n// ): TypedPropertyDecorator<TTarget>;\n\n// // Ideally this should use the PropertyReflectionDecorator, but we cannot reuse the\n// // target type in the getArgs function then.\n// export function ccValue<TTarget extends CommandClass, TArgs extends any[]>(\n// \t...args:\n// \t\t| [value: StaticCCValue]\n// \t\t| [value: DynamicCCValue<TArgs>, getArgs: (self: TTarget) => TArgs]\n// ): TypedPropertyDecorator<TTarget> {\n// \t// Normalize the arguments to the expected format\n// \tdebugger;\n// \tlet valueOrFactory: StaticCCValue | StaticCCValueFactory<TTarget>;\n// \tif (args.length === 1) {\n// \t\tvalueOrFactory = args[0];\n// \t} else {\n// \t\tconst [value, getArgs] = args;\n// \t\tvalueOrFactory = (self: TTarget) => {\n// \t\t\tconst args = getArgs(self);\n// \t\t\tconst base = value(...args);\n// \t\t\treturn {\n// \t\t\t\t...base,\n// \t\t\t\tis: value.is,\n// \t\t\t\toptions: value.options,\n// \t\t\t};\n// \t\t};\n// \t}\n\n// \treturn function decoratorBody_ccValue(\n// \t\ttarget: TTarget,\n// \t\tproperty: string | number | symbol,\n// \t): void {\n// \t\t// get the class constructor\n// \t\tconst constr = target.constructor;\n\n// \t\t// retrieve the current metadata\n// \t\tconst metadata: Map<\n// \t\t\tstring | number,\n// \t\t\tStaticCCValue | StaticCCValueFactory<TTarget>\n// \t\t> = Reflect.getMetadata(ccValue_METADATA, constr) ?? new Map();\n\n// \t\t// Add the variable\n// \t\tmetadata.set(property as string | number, valueOrFactory);\n\n// \t\t// And store it back\n// \t\tReflect.defineMetadata(ccValue_METADATA, metadata, constr);\n// \t};\n// }\n\nexport function ccValueProperty<\n\tClass extends abstract new (...args: any) => any,\n>(\n\tproperty: keyof InstanceType<Class>,\n\tvalue: StaticCCValue,\n): TypedClassDecorator<Class>;\n\nexport function ccValueProperty<\n\tClass extends abstract new (...args: any) => any,\n\tconst TArgs extends any[],\n>(\n\tproperty: keyof InstanceType<Class>,\n\tvalue: DynamicCCValue<TArgs>,\n\tgetArgs: (self: InstanceType<Class>) => TArgs,\n): TypedClassDecorator<Class>;\n\n/**\n * @publicAPI\n * Defines which CC values the properties of a Z-Wave Command Class correspond to\n */\nexport function ccValueProperty<\n\tClass extends abstract new (...args: any) => any,\n\tconst TArgs extends any[],\n>(\n\tproperty: keyof InstanceType<Class>,\n\t...args:\n\t\t| [value: StaticCCValue]\n\t\t| [\n\t\t\tvalue: DynamicCCValue<TArgs>,\n\t\t\tgetArgs: (self: InstanceType<Class>) => TArgs,\n\t\t]\n): TypedClassDecorator<Class> {\n\treturn function decorator_ccValueProperty(constr: Class): void {\n\t\t// retrieve the current metadata\n\t\tconst metadata: Map<\n\t\t\tstring | number,\n\t\t\tStaticCCValue | StaticCCValueFactory<InstanceType<Class>>\n\t\t> = Reflect.getMetadata(ccValue_METADATA, constr) ?? new Map();\n\n\t\t// Determine the correct metadata\n\t\tlet valueOrFactory:\n\t\t\t| StaticCCValue\n\t\t\t| StaticCCValueFactory<InstanceType<Class>>;\n\t\tif (args.length === 1) {\n\t\t\tvalueOrFactory = args[0];\n\t\t} else {\n\t\t\tconst [value, getArgs] = args;\n\t\t\tvalueOrFactory = (self: InstanceType<Class>) => {\n\t\t\t\tconst args = getArgs(self);\n\t\t\t\tconst base = value(...args);\n\t\t\t\treturn {\n\t\t\t\t\t...base,\n\t\t\t\t\tis: value.is,\n\t\t\t\t\toptions: value.options,\n\t\t\t\t};\n\t\t\t};\n\t\t}\n\n\t\t// Add the metadata\n\t\tmetadata.set(property as string | number, valueOrFactory);\n\n\t\t// And store it back\n\t\tReflect.defineMetadata(ccValue_METADATA, metadata, constr);\n\t};\n}\n\n/**\n * @publicAPI\n * Retrieves the defined mapping between properties and CC values of a Z-Wave command class instance\n */\nexport function getCCValueProperties<TTarget extends CommandClass>(\n\ttarget: TTarget,\n): ReadonlyMap<string | number, StaticCCValue | StaticCCValueFactory<TTarget>> {\n\treturn (\n\t\tReflect.getMetadata(ccValue_METADATA, target.constructor) ?? new Map()\n\t);\n}\n\n// const ccValueDecorator = createPropertyReflectionDecorator<\n// \tCommandClass,\n// \t[value: StaticCCValue | StaticCCValueFactory<CommandClass>],\n// \tStaticCCValue | StaticCCValueFactory<CommandClass>\n// >({\n// \tname: \"ccValue\",\n// \tvalueFromArgs: (valueDefinition) => valueDefinition,\n// });\n\n// /**\n// * @publicAPI\n// * Defines which CC value a Z-Wave command class property belongs to\n// */\n// export const ccValue = ccValueDecorator.decorator;\n\n// /**\n// * @publicAPI\n// * Retrieves the defined mapping between properties and CC values of a Z-Wave command class instance\n// */\n// export const getCCValueDefinitions = ccValueDecorator.lookupValues;\n\nconst supervisionDecorator = createValuelessReflectionDecorator<\n\ttypeof CommandClass\n>({\n\tname: \"useSupervision\",\n});\n\n/**\n * @publicAPI\n * Defines that this CC may be sent supervised\n */\nexport const useSupervision = supervisionDecorator.decorator;\n\n/**\n * @publicAPI\n * Checks if the given CC may be sent supervised\n */\nexport const shouldUseSupervision = supervisionDecorator.isDecorated;\n"],
5
- "mappings": ";;;;;;;;;;;;;;;;;;;AAAA;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,kBAIO;AACP,wBAIO;AAeP,MAAM,4BAAwB,iDAK5B,EAAE,WAAW,QAAQ,SAAS,YAAW,CAAE;AAMtC,MAAM,eAAe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WAAW,KAAK,oBAAI,IAAG;AAEtE;AANgB;AA6BhB,MAAM,2BAAuB,sDAE3B;EACD,MAAM;CACN;AAMM,MAAM,iBAAiB,qBAAqB;AAM5C,MAAM,uBAAuB,qBAAqB;",
4
+ "sourcesContent": ["import {\n\tcreateReflectionDecorator,\n\tcreateReflectionDecoratorPair,\n\tcreateValuelessReflectionDecorator,\n} from \"@zwave-js/core/reflection\";\nimport {\n\ttype CommandClasses,\n\tZWaveError,\n\tZWaveErrorCodes,\n} from \"@zwave-js/core/safe\";\nimport type { TypedClassDecorator } from \"@zwave-js/shared\";\nimport type { APIConstructor, CCAPI } from \"./API.js\";\nimport {\n\ttype CCConstructor,\n\ttype CCResponsePredicate,\n\ttype CommandClass,\n\ttype DynamicCCResponse,\n} from \"./CommandClass.js\";\nimport type {\n\tDynamicCCValue,\n\tStaticCCValue,\n\tStaticCCValueFactory,\n} from \"./Values.js\";\n\nconst CCAndCommandDecorator = createReflectionDecoratorPair<\n\ttypeof CommandClass,\n\t[ccId: CommandClasses],\n\t[ccCommand: number],\n\tCCConstructor<CommandClass>\n>({ superName: \"ccId\", subName: \"ccCommand\" });\n\n/**\n * @publicAPI\n * Defines the CC ID associated with a Z-Wave Command Class\n */\nexport const commandClass = CCAndCommandDecorator.superDecorator;\n\n/**\n * @publicAPI\n * Looks up the command class constructor for a given CC ID\n */\nexport const getCCConstructor = CCAndCommandDecorator.lookupSuperConstructor;\n\n/**\n * @publicAPI\n * Defines the CC command a subclass of a CC implements\n */\nexport const CCCommand = CCAndCommandDecorator.subDecorator;\n\n/**\n * @publicAPI\n * Retrieves the CC command a subclass of a CC implements\n */\nexport const getCCCommand = CCAndCommandDecorator.lookupSubValue;\n\n/**\n * @publicAPI\n * Looks up the command class constructor for a given CC ID and command\n */\nexport const getCCCommandConstructor =\n\tCCAndCommandDecorator.lookupSubConstructor;\n\n/**\n * @publicAPI\n * Retrieves the CC ID defined for a Z-Wave Command Class\n */\nexport function getCommandClassStatic<T extends CCConstructor<CommandClass>>(\n\tclassConstructor: T,\n): CommandClasses {\n\t// retrieve the current metadata\n\tconst ret = CCAndCommandDecorator.lookupSuperValueStatic(classConstructor);\n\tif (ret == undefined) {\n\t\tthrow new ZWaveError(\n\t\t\t`No command class defined for ${classConstructor.name}!`,\n\t\t\tZWaveErrorCodes.CC_Invalid,\n\t\t);\n\t}\n\treturn ret;\n}\n\nconst apiDecorator = createReflectionDecorator<\n\ttypeof CCAPI,\n\t[cc: CommandClasses],\n\tCommandClasses,\n\tAPIConstructor\n>({\n\tname: \"API\",\n\tvalueFromArgs: (cc) => cc,\n});\n\n/**\n * @publicAPI\n * Defines the CC ID a CC API implementation belongs to\n */\nexport const API = apiDecorator.decorator;\n\n/**\n * @publicAPI\n * Retrieves the CC API constructor that is defined for a Z-Wave CC ID\n */\nexport function getAPI(cc: CommandClasses): APIConstructor | undefined {\n\treturn apiDecorator.lookupConstructorByValue(cc);\n}\n\n/**\n * @publicAPI\n * Retrieves the CC ID associated with a Z-Wave Command Class or CC API\n */\nexport function getCommandClass(cc: CommandClass | CCAPI): CommandClasses {\n\t// get the class constructor\n\tconst constr = cc.constructor;\n\t// retrieve the current metadata\n\tconst ret = CCAndCommandDecorator.lookupSuperValueStatic(\n\t\tconstr as typeof CommandClass,\n\t)\n\t\t?? apiDecorator.lookupValueStatic(constr as typeof CCAPI);\n\n\tif (ret == undefined) {\n\t\tthrow new ZWaveError(\n\t\t\t`No command class defined for ${constr.name}!`,\n\t\t\tZWaveErrorCodes.CC_Invalid,\n\t\t);\n\t}\n\treturn ret;\n}\n\nconst implementedVersionDecorator = createReflectionDecorator<\n\ttypeof CommandClass,\n\t[version: number],\n\tnumber\n>({\n\tname: \"implementedVersion\",\n\tvalueFromArgs: (version) => version,\n\tconstructorLookupKey: false,\n});\n\n/**\n * @publicAPI\n * Defines the implemented version of a Z-Wave command class\n */\nexport const implementedVersion = implementedVersionDecorator.decorator;\n\n/**\n * @publicAPI\n * Retrieves the implemented version defined for a Z-Wave command class\n */\nexport function getImplementedVersion<T extends CommandClass>(\n\tcc: T | CommandClasses,\n): number {\n\t// get the class constructor\n\tlet constr: CCConstructor<CommandClass> | undefined;\n\tif (typeof cc === \"number\") {\n\t\tconstr = getCCConstructor(cc);\n\t} else {\n\t\tconstr = cc.constructor as CCConstructor<CommandClass>;\n\t}\n\n\tif (!constr) return 0;\n\treturn implementedVersionDecorator.lookupValueStatic(constr) ?? 0;\n}\n\n/**\n * @publicAPI\n * Retrieves the implemented version defined for a Z-Wave command class\n */\nexport function getImplementedVersionStatic<\n\tT extends CCConstructor<CommandClass>,\n>(classConstructor: T): number {\n\treturn implementedVersionDecorator.lookupValueStatic(classConstructor) ?? 0;\n}\n\nconst expectedCCResponseDecorator = createReflectionDecorator<\n\ttypeof CommandClass,\n\t[\n\t\tcc:\n\t\t\t| CCConstructor<CommandClass>\n\t\t\t| DynamicCCResponse<CommandClass, CommandClass>,\n\t\tpredicate?: CCResponsePredicate<CommandClass, CommandClass>,\n\t],\n\t{\n\t\tcc:\n\t\t\t| CCConstructor<CommandClass>\n\t\t\t| DynamicCCResponse<CommandClass, CommandClass>;\n\t\tpredicate?: CCResponsePredicate<CommandClass, CommandClass>;\n\t}\n>({\n\tname: \"expectedCCResponse\",\n\tvalueFromArgs: (cc, predicate) => ({ cc, predicate }),\n\t// We don't need reverse lookup\n\tconstructorLookupKey: false,\n});\n\n/**\n * @publicAPI\n * Defines the expected response associated with a Z-Wave message\n */\nexport function expectedCCResponse<\n\tTTarget extends typeof CommandClass,\n\tTSent extends CommandClass,\n\tTReceived extends CommandClass,\n>(\n\tcc: CCConstructor<TReceived> | DynamicCCResponse<TSent, TReceived>,\n\tpredicate?: CCResponsePredicate<TSent, TReceived>,\n): TypedClassDecorator<TTarget> {\n\treturn expectedCCResponseDecorator.decorator(cc as any, predicate as any);\n}\n\n/**\n * @publicAPI\n * Retrieves the expected response (static or dynamic) defined for a Z-Wave message class\n */\nexport function getExpectedCCResponse<T extends CommandClass>(\n\tccClass: T,\n): typeof CommandClass | DynamicCCResponse<T> | undefined {\n\treturn expectedCCResponseDecorator.lookupValue(ccClass)?.cc;\n}\n\n/**\n * @publicAPI\n * Retrieves the CC response predicate defined for a Z-Wave message class\n */\nexport function getCCResponsePredicate<T extends CommandClass>(\n\tccClass: T,\n): CCResponsePredicate<T> | undefined {\n\treturn expectedCCResponseDecorator.lookupValue(ccClass)?.predicate;\n}\n\nconst ccValuesDecorator = createReflectionDecorator<\n\ttypeof CommandClass,\n\t[valueDefinition: Record<string, StaticCCValue | DynamicCCValue>],\n\tRecord<string, StaticCCValue | DynamicCCValue | undefined>\n>({\n\tname: \"ccValues\",\n\tvalueFromArgs: (valueDefinition) => valueDefinition,\n\t// We don't need reverse lookup\n\tconstructorLookupKey: false,\n});\n\n/**\n * @publicAPI\n * Defines which CC value definitions belong to a Z-Wave command class\n */\nexport const ccValues = ccValuesDecorator.decorator;\n\n/**\n * @publicAPI\n * Retrieves the CC value definitions which belong to a Z-Wave command class\n */\nexport function getCCValues<T extends CommandClass>(\n\tcc: T | CommandClasses,\n): Record<string, StaticCCValue | DynamicCCValue | undefined> | undefined {\n\t// get the class constructor\n\tlet constr: CCConstructor<CommandClass> | undefined;\n\tif (typeof cc === \"number\") {\n\t\tconstr = getCCConstructor(cc);\n\t} else {\n\t\tconstr = cc.constructor as CCConstructor<CommandClass>;\n\t}\n\n\tif (constr) return ccValuesDecorator.lookupValueStatic(constr);\n}\n\nconst ccValue_METADATA = Symbol.for(`METADATA_ccValue`);\n\n// /**\n// * @publicAPI\n// * Defines which CC value a Z-Wave command class property belongs to\n// */\n// export function ccValue<TTarget extends CommandClass>(\n// \tvalue: StaticCCValue,\n// ): TypedPropertyDecorator<TTarget>;\n\n// export function ccValue<TTarget extends CommandClass, TArgs extends any[]>(\n// \tvalue: DynamicCCValue<TArgs>,\n// \tgetArgs: (self: TTarget) => Readonly<TArgs>,\n// ): TypedPropertyDecorator<TTarget>;\n\n// // Ideally this should use the PropertyReflectionDecorator, but we cannot reuse the\n// // target type in the getArgs function then.\n// export function ccValue<TTarget extends CommandClass, TArgs extends any[]>(\n// \t...args:\n// \t\t| [value: StaticCCValue]\n// \t\t| [value: DynamicCCValue<TArgs>, getArgs: (self: TTarget) => TArgs]\n// ): TypedPropertyDecorator<TTarget> {\n// \t// Normalize the arguments to the expected format\n// \tdebugger;\n// \tlet valueOrFactory: StaticCCValue | StaticCCValueFactory<TTarget>;\n// \tif (args.length === 1) {\n// \t\tvalueOrFactory = args[0];\n// \t} else {\n// \t\tconst [value, getArgs] = args;\n// \t\tvalueOrFactory = (self: TTarget) => {\n// \t\t\tconst args = getArgs(self);\n// \t\t\tconst base = value(...args);\n// \t\t\treturn {\n// \t\t\t\t...base,\n// \t\t\t\tis: value.is,\n// \t\t\t\toptions: value.options,\n// \t\t\t};\n// \t\t};\n// \t}\n\n// \treturn function decoratorBody_ccValue(\n// \t\ttarget: TTarget,\n// \t\tproperty: string | number | symbol,\n// \t): void {\n// \t\t// get the class constructor\n// \t\tconst constr = target.constructor;\n\n// \t\t// retrieve the current metadata\n// \t\tconst metadata: Map<\n// \t\t\tstring | number,\n// \t\t\tStaticCCValue | StaticCCValueFactory<TTarget>\n// \t\t> = Reflect.getMetadata(ccValue_METADATA, constr) ?? new Map();\n\n// \t\t// Add the variable\n// \t\tmetadata.set(property as string | number, valueOrFactory);\n\n// \t\t// And store it back\n// \t\tReflect.defineMetadata(ccValue_METADATA, metadata, constr);\n// \t};\n// }\n\nexport function ccValueProperty<\n\tClass extends abstract new (...args: any) => any,\n>(\n\tproperty: keyof InstanceType<Class>,\n\tvalue: StaticCCValue,\n): TypedClassDecorator<Class>;\n\nexport function ccValueProperty<\n\tClass extends abstract new (...args: any) => any,\n\tconst TArgs extends any[],\n>(\n\tproperty: keyof InstanceType<Class>,\n\tvalue: DynamicCCValue<TArgs>,\n\tgetArgs: (self: InstanceType<Class>) => TArgs,\n): TypedClassDecorator<Class>;\n\n/**\n * @publicAPI\n * Defines which CC values the properties of a Z-Wave Command Class correspond to\n */\nexport function ccValueProperty<\n\tClass extends abstract new (...args: any) => any,\n\tconst TArgs extends any[],\n>(\n\tproperty: keyof InstanceType<Class>,\n\t...args:\n\t\t| [value: StaticCCValue]\n\t\t| [\n\t\t\tvalue: DynamicCCValue<TArgs>,\n\t\t\tgetArgs: (self: InstanceType<Class>) => TArgs,\n\t\t]\n): TypedClassDecorator<Class> {\n\treturn function decorator_ccValueProperty(constr: Class): void {\n\t\t// retrieve the current metadata\n\t\tconst metadata: Map<\n\t\t\tstring | number,\n\t\t\tStaticCCValue | StaticCCValueFactory<InstanceType<Class>>\n\t\t> = Reflect.getMetadata(ccValue_METADATA, constr) ?? new Map();\n\n\t\t// Determine the correct metadata\n\t\tlet valueOrFactory:\n\t\t\t| StaticCCValue\n\t\t\t| StaticCCValueFactory<InstanceType<Class>>;\n\t\tif (args.length === 1) {\n\t\t\tvalueOrFactory = args[0];\n\t\t} else {\n\t\t\tconst [value, getArgs] = args;\n\t\t\tvalueOrFactory = (self: InstanceType<Class>) => {\n\t\t\t\tconst args = getArgs(self);\n\t\t\t\tconst base = value(...args);\n\t\t\t\treturn {\n\t\t\t\t\t...base,\n\t\t\t\t\tis: value.is,\n\t\t\t\t\toptions: value.options,\n\t\t\t\t};\n\t\t\t};\n\t\t}\n\n\t\t// Add the metadata\n\t\tmetadata.set(property as string | number, valueOrFactory);\n\n\t\t// And store it back\n\t\tReflect.defineMetadata(ccValue_METADATA, metadata, constr);\n\t};\n}\n\n/**\n * @publicAPI\n * Retrieves the defined mapping between properties and CC values of a Z-Wave command class instance\n */\nexport function getCCValueProperties<TTarget extends CommandClass>(\n\ttarget: TTarget,\n): ReadonlyMap<string | number, StaticCCValue | StaticCCValueFactory<TTarget>> {\n\treturn (\n\t\tReflect.getMetadata(ccValue_METADATA, target.constructor) ?? new Map()\n\t);\n}\n\n// const ccValueDecorator = createPropertyReflectionDecorator<\n// \tCommandClass,\n// \t[value: StaticCCValue | StaticCCValueFactory<CommandClass>],\n// \tStaticCCValue | StaticCCValueFactory<CommandClass>\n// >({\n// \tname: \"ccValue\",\n// \tvalueFromArgs: (valueDefinition) => valueDefinition,\n// });\n\n// /**\n// * @publicAPI\n// * Defines which CC value a Z-Wave command class property belongs to\n// */\n// export const ccValue = ccValueDecorator.decorator;\n\n// /**\n// * @publicAPI\n// * Retrieves the defined mapping between properties and CC values of a Z-Wave command class instance\n// */\n// export const getCCValueDefinitions = ccValueDecorator.lookupValues;\n\nconst supervisionDecorator = createValuelessReflectionDecorator<\n\ttypeof CommandClass\n>({\n\tname: \"useSupervision\",\n});\n\n/**\n * @publicAPI\n * Defines that this CC may be sent supervised\n */\nexport const useSupervision = supervisionDecorator.decorator;\n\n/**\n * @publicAPI\n * Checks if the given CC may be sent supervised\n */\nexport const shouldUseSupervision = supervisionDecorator.isDecorated;\n"],
5
+ "mappings": ";;;;;;;;;;;;;;;;;;;AAAA;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,wBAIO;AACP,kBAIO;AAeP,MAAM,4BAAwB,iDAK5B,EAAE,WAAW,QAAQ,SAAS,YAAW,CAAE;AAMtC,MAAM,eAAe,sBAAsB;AAM3C,MAAM,mBAAmB,sBAAsB;AAM/C,MAAM,YAAY,sBAAsB;AAMxC,MAAM,eAAe,sBAAsB;AAM3C,MAAM,0BACZ,sBAAsB;AAMjB,SAAU,sBACf,kBAAmB;AAGnB,QAAM,MAAM,sBAAsB,uBAAuB,gBAAgB;AACzE,MAAI,OAAO,QAAW;AACrB,UAAM,IAAI,uBACT,gCAAgC,iBAAiB,IAAI,KACrD,4BAAgB,UAAU;EAE5B;AACA,SAAO;AACR;AAZgB;AAchB,MAAM,mBAAe,6CAKnB;EACD,MAAM;EACN,eAAe,wBAAC,OAAO,IAAR;CACf;AAMM,MAAM,MAAM,aAAa;AAM1B,SAAU,OAAO,IAAkB;AACxC,SAAO,aAAa,yBAAyB,EAAE;AAChD;AAFgB;AAQV,SAAU,gBAAgB,IAAwB;AAEvD,QAAM,SAAS,GAA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A,MAAI;AAAQ,WAAO,kBAAkB,kBAAkB,MAAM;AAC9D;AAZgB;AAchB,MAAM,mBAAmB,OAAO,IAAI,kBAAkB;AAiFhD,SAAU,gBAIf,aACG,MAKD;AAEF,SAAO,gCAAS,0BAA0B,QAAa;AAEtD,UAAM,WAGF,QAAQ,YAAY,kBAAkB,MAAM,KAAK,oBAAI,IAAG;AAG5D,QAAI;AAGJ,QAAI,KAAK,WAAW,GAAG;AACtB,uBAAiB,KAAK,CAAC;IACxB,OAAO;AACN,YAAM,CAAC,OAAO,OAAO,IAAI;AACzB,uBAAiB,wBAAC,SAA6B;AAC9C,cAAMA,QAAO,QAAQ,IAAI;AACzB,cAAM,OAAO,MAAM,GAAGA,KAAI;AAC1B,eAAO;UACN,GAAG;UACH,IAAI,MAAM;UACV,SAAS,MAAM;;MAEjB,GARiB;IASlB;AAGA,aAAS,IAAI,UAA6B,cAAc;AAGxD,YAAQ,eAAe,kBAAkB,UAAU,MAAM;EAC1D,GA/BO;AAgCR;AA5CgB;AAkDV,SAAU,qBACf,QAAe;AAEf,SACC,QAAQ,YAAY,kBAAkB,OAAO,WAAW,KAAK,oBAAI,IAAG;AAEtE;AANgB;AA6BhB,MAAM,2BAAuB,sDAE3B;EACD,MAAM;CACN;AAMM,MAAM,iBAAiB,qBAAqB;AAM5C,MAAM,uBAAuB,qBAAqB;",
6
6
  "names": ["args"]
7
7
  }
@@ -1,5 +1,5 @@
1
- import { type CommandClasses, type EndpointId, type ValueID, ValueMetadata } from "@zwave-js/core/safe";
2
- import type { GetDeviceConfig, GetValueDB } from "@zwave-js/host";
1
+ import { type GetDeviceConfig } from "@zwave-js/config";
2
+ import { type CommandClasses, type EndpointId, type GetValueDB, type ValueID, ValueMetadata } from "@zwave-js/core/safe";
3
3
  import { type FnOrStatic, type ReturnTypeOrStatic } from "@zwave-js/shared/safe";
4
4
  import type { Overwrite } from "alcalzone-shared/types";
5
5
  import type { ValueIDProperties } from "./API.js";
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../src/lib/Values.ts"],
4
- "sourcesContent": ["import {\n\ttype CommandClasses,\n\ttype EndpointId,\n\ttype ValueID,\n\tValueMetadata,\n} from \"@zwave-js/core/safe\";\nimport type { GetDeviceConfig, GetValueDB } from \"@zwave-js/host\";\nimport {\n\ttype FnOrStatic,\n\ttype ReturnTypeOrStatic,\n\tevalOrStatic,\n} from \"@zwave-js/shared/safe\";\nimport type { Overwrite } from \"alcalzone-shared/types\";\nimport type { ValueIDProperties } from \"./API.js\";\n\n// HINT: To fully view types for definitions created by this, open\n// node_modules/typescript/lib/tsserver.js and change the definition of\n// ts.defaultMaximumTruncationLength = 160\n// to something higher like\n// ts.defaultMaximumTruncationLength = 1000\n// Then restart TS Server\n\nexport interface CCValueOptions {\n\t/**\n\t * Whether the CC value is internal. Internal values are not exposed to the user.\n\t */\n\tinternal?: boolean;\n\t/**\n\t * The minimum CC version required for this value to exist.\n\t */\n\tminVersion?: number;\n\t/**\n\t * Whether this value represents a state (`true`) or a notification/event (`false`). Default: `true`\n\t */\n\tstateful?: boolean;\n\t/**\n\t * Omit this value from value logs. Default: `false`\n\t */\n\tsecret?: boolean;\n\n\t/** Whether the CC value may exist on endpoints. Default: `true` */\n\tsupportsEndpoints?: boolean;\n\n\t/**\n\t * Can be used to dynamically decide if this value should be created automatically.\n\t * This is ignored for dynamic values and defaults to `true` if not given.\n\t */\n\tautoCreate?:\n\t\t| boolean\n\t\t| ((\n\t\t\tctx: GetValueDB & GetDeviceConfig,\n\t\t\tendpoint: EndpointId,\n\t\t) => boolean);\n}\n\nexport const defaultCCValueOptions = {\n\tinternal: false,\n\tminVersion: 1,\n\tsecret: false,\n\tstateful: true,\n\tsupportsEndpoints: true,\n\tautoCreate: true,\n} as const;\n\ntype DefaultOptions = typeof defaultCCValueOptions;\n\n// expands object types recursively\nexport type ExpandRecursively<T> =\n\t// Split functions with properties into the function and object parts\n\tT extends (...args: infer A) => infer R\n\t\t? [keyof T] extends [never] ? (...args: A) => ExpandRecursively<R>\n\t\t:\n\t\t\t& ((...args: A) => ExpandRecursively<R>)\n\t\t\t& {\n\t\t\t\t[P in keyof T]: ExpandRecursively<T[P]>;\n\t\t\t}\n\t\t// Expand object types\n\t\t: T extends object\n\t\t\t? T extends infer O ? { [K in keyof O]: ExpandRecursively<O[K]> }\n\t\t\t: never\n\t\t// Fallback to the type itself if no match\n\t\t: T;\n\nexport type ExpandRecursivelySkipMeta<T> =\n\t// Split functions with properties into the function and object parts\n\tT extends (...args: infer A) => infer R\n\t\t? [keyof T] extends [never]\n\t\t\t? (...args: A) => ExpandRecursivelySkipMeta<R>\n\t\t:\n\t\t\t& ((...args: A) => ExpandRecursivelySkipMeta<R>)\n\t\t\t& {\n\t\t\t\t[P in keyof T]: ExpandRecursivelySkipMeta<T[P]>;\n\t\t\t}\n\t\t// Ignore the ValueMetadata type\n\t\t: T extends ValueMetadata ? T\n\t\t// Expand object types\n\t\t: T extends object\n\t\t\t? T extends infer O\n\t\t\t\t? { [K in keyof O]: ExpandRecursivelySkipMeta<O[K]> }\n\t\t\t: never\n\t\t// Fallback to the type itself if no match\n\t\t: T;\n\ntype InferValueIDBase<\n\tTCommandClass extends CommandClasses,\n\tTBlueprint extends CCValueBlueprint,\n\tTWorker = {\n\t\tcommandClass: TCommandClass;\n\t} & Pick<TBlueprint, \"property\" | \"propertyKey\">,\n> = {\n\t[K in keyof TWorker as unknown extends TWorker[K] ? never : K]: TWorker[K];\n};\n\ntype ToStaticCCValues<\n\tTCommandClass extends CommandClasses,\n\tTValues extends Record<keyof TValues, CCValueBlueprint>,\n> = Readonly<\n\t{\n\t\t[K in keyof TValues]: ExpandRecursively<\n\t\t\tInferStaticCCValue<TCommandClass, TValues[K]>\n\t\t>;\n\t}\n>;\n\ntype ToDynamicCCValues<\n\tTCommandClass extends CommandClasses,\n\tTValues extends Record<keyof TValues, DynamicCCValueBlueprint<any>>,\n> = Readonly<\n\t{\n\t\t[K in keyof TValues]: ExpandRecursively<\n\t\t\tInferDynamicCCValue<TCommandClass, TValues[K]>\n\t\t>;\n\t}\n>;\n\ntype InferArgs<T extends FnOrStatic<any, any>[]> = T extends [\n\t(...args: infer A) => any,\n\t...any,\n] ? A\n\t: T extends [any, ...infer R] ? InferArgs<R>\n\t: [];\n\n/** Defines a single static CC values that belong to a CC */\nfunction defineStaticCCValue<\n\tTCommandClass extends CommandClasses,\n\tTBlueprint extends CCValueBlueprint,\n>(\n\tcommandClass: TCommandClass,\n\tblueprint: TBlueprint,\n): ExpandRecursively<InferStaticCCValue<TCommandClass, TBlueprint>> {\n\t// Normalize value options\n\tconst _blueprint = {\n\t\t...blueprint,\n\t\toptions: {\n\t\t\t...defaultCCValueOptions,\n\t\t\t...blueprint.options,\n\t\t},\n\t};\n\n\tconst valueId = {\n\t\tcommandClass,\n\t\tproperty: _blueprint.property,\n\t\tpropertyKey: _blueprint.propertyKey,\n\t};\n\tif (valueId.propertyKey === undefined) delete valueId.propertyKey;\n\n\tconst ret: InferStaticCCValue<TCommandClass, TBlueprint> = {\n\t\tget id() {\n\t\t\treturn { ...valueId };\n\t\t},\n\t\tendpoint: (endpoint: number = 0) => {\n\t\t\tif (!_blueprint.options.supportsEndpoints) endpoint = 0;\n\t\t\treturn { ...valueId, endpoint } as any;\n\t\t},\n\t\tis: (testValueId) => {\n\t\t\treturn (\n\t\t\t\tvalueId.commandClass === testValueId.commandClass\n\t\t\t\t&& valueId.property === testValueId.property\n\t\t\t\t&& valueId.propertyKey === testValueId.propertyKey\n\t\t\t);\n\t\t},\n\t\tget meta() {\n\t\t\treturn { ...ValueMetadata.Any, ..._blueprint.meta } as any;\n\t\t},\n\t\tget options() {\n\t\t\treturn { ..._blueprint.options } as any;\n\t\t},\n\t};\n\n\treturn ret as any;\n}\n\n/** Defines a single CC value which depends on one or more parameters */\nfunction defineDynamicCCValue<\n\tTCommandClass extends CommandClasses,\n\tTBlueprint extends DynamicCCValueBlueprint<any[]>,\n>(\n\tcommandClass: TCommandClass,\n\tblueprint: TBlueprint,\n): ExpandRecursively<InferDynamicCCValue<TCommandClass, TBlueprint>> {\n\tconst options = {\n\t\t...defaultCCValueOptions,\n\t\t...blueprint.options,\n\t};\n\n\tconst ret: ExpandRecursively<\n\t\tInferDynamicCCValue<TCommandClass, TBlueprint>\n\t> = ((...args: Parameters<TBlueprint>) => {\n\t\tconst _blueprint = blueprint(...args);\n\n\t\t// Normalize value options\n\t\tconst actualBlueprint = {\n\t\t\t..._blueprint,\n\t\t};\n\n\t\tconst valueId = {\n\t\t\tcommandClass,\n\t\t\tproperty: actualBlueprint.property,\n\t\t\tpropertyKey: actualBlueprint.propertyKey,\n\t\t};\n\t\tif (valueId.propertyKey === undefined) delete valueId.propertyKey;\n\n\t\tconst value: Omit<\n\t\t\tInferStaticCCValue<TCommandClass, ReturnType<TBlueprint>>,\n\t\t\t\"options\" | \"is\"\n\t\t> = {\n\t\t\tget id() {\n\t\t\t\treturn { ...valueId };\n\t\t\t},\n\t\t\tendpoint: (endpoint: number = 0) => {\n\t\t\t\tif (!options.supportsEndpoints) endpoint = 0;\n\t\t\t\treturn { ...valueId, endpoint } as any;\n\t\t\t},\n\t\t\tget meta() {\n\t\t\t\treturn { ...ValueMetadata.Any, ...actualBlueprint.meta } as any;\n\t\t\t},\n\t\t};\n\n\t\treturn value;\n\t}) as any;\n\n\tObject.defineProperty(ret, \"options\", {\n\t\tconfigurable: false,\n\t\tenumerable: true,\n\t\tget() {\n\t\t\treturn { ...options };\n\t\t},\n\t});\n\n\tObject.defineProperty(ret, \"is\", {\n\t\tconfigurable: false,\n\t\tenumerable: false,\n\t\twritable: false,\n\t\tvalue: (id: ValueID) =>\n\t\t\tid.commandClass === commandClass && blueprint.is(id),\n\t});\n\n\treturn ret;\n}\n\n// Namespace for utilities to define CC values\nexport const V = {\n\t/** Defines multiple static CC values that belong to the same CC */\n\tdefineStaticCCValues<\n\t\tTCommandClass extends CommandClasses,\n\t\tTValues extends Record<keyof TValues, CCValueBlueprint>,\n\t>(\n\t\tcommandClass: TCommandClass,\n\t\tvalues: TValues,\n\t): TValues extends Record<keyof TValues, CCValueBlueprint>\n\t\t? ExpandRecursively<ToStaticCCValues<TCommandClass, TValues>>\n\t\t: never\n\t{\n\t\treturn Object.fromEntries(\n\t\t\tObject.entries<CCValueBlueprint>(values).map(([key, blueprint]) => [\n\t\t\t\tkey,\n\t\t\t\tdefineStaticCCValue(commandClass, blueprint),\n\t\t\t]),\n\t\t) as any;\n\t},\n\n\t/** Defines multiple static CC values that belong to the same CC */\n\tdefineDynamicCCValues<\n\t\tTCommandClass extends CommandClasses,\n\t\tTValues extends Record<keyof TValues, DynamicCCValueBlueprint<any>>,\n\t>(\n\t\tcommandClass: TCommandClass,\n\t\tvalues: TValues,\n\t): TValues extends Record<keyof TValues, DynamicCCValueBlueprint<any>>\n\t\t? ExpandRecursively<ToDynamicCCValues<TCommandClass, TValues>>\n\t\t: never\n\t{\n\t\treturn Object.fromEntries(\n\t\t\tObject.entries<DynamicCCValueBlueprint<any>>(values).map(\n\t\t\t\t([key, blueprint]) => [\n\t\t\t\t\tkey,\n\t\t\t\t\tdefineDynamicCCValue(commandClass, blueprint),\n\t\t\t\t],\n\t\t\t),\n\t\t) as any;\n\t},\n\n\t/** Returns a CC value definition that is named like the value `property` */\n\tstaticProperty<\n\t\tTProp extends string | number,\n\t\tTMeta extends ValueMetadata,\n\t\tTOptions extends CCValueOptions,\n\t>(\n\t\tproperty: TProp,\n\t\tmeta?: TMeta,\n\t\toptions?: TOptions,\n\t): {\n\t\t[K in TProp]: {\n\t\t\tproperty: TProp;\n\t\t\tmeta: TMeta;\n\t\t\toptions: TOptions;\n\t\t};\n\t} {\n\t\treturn {\n\t\t\t[property]: {\n\t\t\t\tproperty,\n\t\t\t\tmeta,\n\t\t\t\toptions,\n\t\t\t},\n\t\t} as any;\n\t},\n\n\t/** Returns a CC value definition with the given name and `property` */\n\tstaticPropertyWithName<\n\t\tTName extends string,\n\t\tTProp extends string | number,\n\t\tTMeta extends ValueMetadata,\n\t\tTOptions extends CCValueOptions,\n\t>(\n\t\tname: TName,\n\t\tproperty: TProp,\n\t\tmeta?: TMeta,\n\t\toptions?: TOptions,\n\t): {\n\t\t[K in TName]: {\n\t\t\tproperty: TProp;\n\t\t\tmeta: TMeta;\n\t\t\toptions: TOptions;\n\t\t};\n\t} {\n\t\treturn {\n\t\t\t[name]: {\n\t\t\t\tproperty,\n\t\t\t\tmeta,\n\t\t\t\toptions,\n\t\t\t},\n\t\t} as any;\n\t},\n\n\t/** Returns a CC value definition with the given name, `property` and `propertyKey` */\n\tstaticPropertyAndKeyWithName<\n\t\tTName extends string,\n\t\tTProp extends string | number,\n\t\tTKey extends string | number,\n\t\tTMeta extends ValueMetadata,\n\t\tTOptions extends CCValueOptions,\n\t>(\n\t\tname: TName,\n\t\tproperty: TProp,\n\t\tpropertyKey: TKey,\n\t\tmeta?: TMeta,\n\t\toptions?: TOptions,\n\t): {\n\t\t[K in TName]: {\n\t\t\tproperty: TProp;\n\t\t\tpropertyKey: TKey;\n\t\t\tmeta: TMeta;\n\t\t\toptions: TOptions;\n\t\t};\n\t} {\n\t\treturn {\n\t\t\t[name]: {\n\t\t\t\tproperty,\n\t\t\t\tpropertyKey,\n\t\t\t\tmeta,\n\t\t\t\toptions,\n\t\t\t},\n\t\t} as any;\n\t},\n\n\t/** Returns a CC value definition with the given name and a dynamic `property` */\n\tdynamicPropertyWithName<\n\t\tTName extends string,\n\t\tTProp extends FnOrStatic<any[], ValueIDProperties[\"property\"]>,\n\t\tTMeta extends FnOrStatic<any[], ValueMetadata> = ValueMetadata,\n\t\tTOptions extends CCValueOptions = CCValueOptions,\n\t>(\n\t\tname: TName,\n\t\tproperty: TProp,\n\t\tis: PartialCCValuePredicate,\n\t\tmeta?: TMeta,\n\t\toptions?: TOptions,\n\t): {\n\t\t[K in TName]: {\n\t\t\t(...args: InferArgs<[TProp, TMeta]>): {\n\t\t\t\tproperty: ReturnTypeOrStatic<TProp>;\n\t\t\t\tmeta: ReturnTypeOrStatic<TMeta>;\n\t\t\t};\n\t\t\tis: PartialCCValuePredicate;\n\t\t\toptions: TOptions;\n\t\t};\n\t} {\n\t\treturn {\n\t\t\t[name]: Object.assign(\n\t\t\t\t(...args: InferArgs<[TProp, TMeta]>) => ({\n\t\t\t\t\tproperty: evalOrStatic(property, ...args),\n\t\t\t\t\tmeta: evalOrStatic(meta, ...args),\n\t\t\t\t}),\n\t\t\t\t{ is, options },\n\t\t\t),\n\t\t} as any;\n\t},\n\n\t/** Returns a CC value definition with the given name and a dynamic `property` */\n\tdynamicPropertyAndKeyWithName<\n\t\tTName extends string,\n\t\tTProp extends FnOrStatic<any[], ValueIDProperties[\"property\"]>,\n\t\tTKey extends FnOrStatic<any[], ValueIDProperties[\"propertyKey\"]>,\n\t\tTMeta extends FnOrStatic<any[], ValueMetadata> = ValueMetadata,\n\t\tTOptions extends FnOrStatic<any[], CCValueOptions> = CCValueOptions,\n\t>(\n\t\tname: TName,\n\t\tproperty: TProp,\n\t\tpropertyKey: TKey,\n\t\tis: PartialCCValuePredicate,\n\t\tmeta?: TMeta,\n\t\toptions?: TOptions,\n\t): {\n\t\t[K in TName]: {\n\t\t\t(...args: InferArgs<[TProp, TKey, TMeta]>): {\n\t\t\t\tproperty: ReturnTypeOrStatic<TProp>;\n\t\t\t\tpropertyKey: ReturnTypeOrStatic<TKey>;\n\t\t\t\tmeta: ReturnTypeOrStatic<TMeta>;\n\t\t\t};\n\t\t\tis: PartialCCValuePredicate;\n\t\t\toptions: TOptions;\n\t\t};\n\t} {\n\t\treturn {\n\t\t\t[name]: Object.assign(\n\t\t\t\t(...args: any[]) => {\n\t\t\t\t\treturn {\n\t\t\t\t\t\tproperty: evalOrStatic(property, ...args),\n\t\t\t\t\t\tpropertyKey: evalOrStatic(propertyKey, ...args),\n\t\t\t\t\t\tmeta: evalOrStatic(meta, ...args),\n\t\t\t\t\t};\n\t\t\t\t},\n\t\t\t\t{ is, options },\n\t\t\t),\n\t\t} as any;\n\t},\n};\n\nexport interface CCValueBlueprint extends Readonly<ValueIDProperties> {\n\treadonly meta?: Readonly<ValueMetadata>;\n\treadonly options?: Readonly<CCValueOptions>;\n}\n\nexport type CCValuePredicate = (valueId: ValueID) => boolean;\nexport type PartialCCValuePredicate = (\n\tproperties: ValueIDProperties,\n) => boolean;\n\n/** A blueprint for a CC value which depends on one or more parameters */\nexport interface DynamicCCValueBlueprint<TArgs extends any[]> {\n\t(...args: TArgs): Omit<CCValueBlueprint, \"options\">;\n\tis: PartialCCValuePredicate;\n\treadonly options?: Readonly<CCValueOptions>;\n}\n\ntype DropOptional<T> = {\n\t[K in keyof T as [undefined] extends [T[K]] ? never : K]: T[K];\n};\n\ntype MergeOptions<TOptions extends CCValueOptions> = DropOptional<\n\tCCValueOptions extends TOptions\n\t\t// When the type cannot be inferred exactly (not given), default to DefaultOptions\n\t\t? DefaultOptions\n\t\t: Overwrite<DefaultOptions, TOptions>\n>;\n\ntype MergeMeta<TMeta extends ValueMetadata> = DropOptional<\n\tValueMetadata extends TMeta\n\t\t// When the type cannot be inferred exactly (not given), default to ValueMetadata.Any\n\t\t? (typeof ValueMetadata)[\"Any\"]\n\t\t: Overwrite<(typeof ValueMetadata)[\"Any\"], TMeta>\n>;\n\n/** The common base type of all CC value definitions */\nexport interface CCValue {\n\treadonly id: Omit<ValueID, \"endpoint\">;\n\tendpoint(endpoint?: number): ValueID;\n\treadonly meta: ValueMetadata;\n}\n\ntype AddCCValueProperties<\n\tTCommandClass extends CommandClasses,\n\tTBlueprint extends CCValueBlueprint,\n\tValueIDBase extends Record<string, any> = InferValueIDBase<\n\t\tTCommandClass,\n\t\tTBlueprint\n\t>,\n> = {\n\t/** Returns the value ID of this CC value, without endpoint information */\n\tget id(): ValueIDBase;\n\n\t/** Returns the value ID, specialized to the given endpoint */\n\tendpoint(\n\t\tendpoint?: number,\n\t): Readonly<\n\t\t& Pick<ValueIDBase, \"commandClass\">\n\t\t& { endpoint: number }\n\t\t& Omit<\n\t\t\tValueIDBase,\n\t\t\t\"commandClass\"\n\t\t>\n\t>;\n\n\t/** Whether the given value ID matches this value definition */\n\tis: CCValuePredicate;\n\n\t/** Returns the metadata for this value ID */\n\tget meta(): Readonly<MergeMeta<NonNullable<TBlueprint[\"meta\"]>>>;\n\t/** Returns the value options for this value ID */\n\tget options(): Readonly<MergeOptions<NonNullable<TBlueprint[\"options\"]>>>;\n};\n\n/** A CC value definition which depends on one or more parameters, transparently inferred from its arguments */\nexport type InferDynamicCCValue<\n\tTCommandClass extends CommandClasses,\n\tTBlueprint extends DynamicCCValueBlueprint<any[]>,\n> = TBlueprint extends DynamicCCValueBlueprint<infer TArgs> ? {\n\t\t(...args: TArgs): Omit<\n\t\t\tInferStaticCCValue<TCommandClass, ReturnType<TBlueprint>>,\n\t\t\t\"options\" | \"is\"\n\t\t>;\n\n\t\t/** Whether the given value ID matches this value definition */\n\t\tis: CCValuePredicate;\n\n\t\treadonly options: InferStaticCCValue<\n\t\t\tTCommandClass,\n\t\t\tReturnType<TBlueprint> & { options: TBlueprint[\"options\"] }\n\t\t>[\"options\"];\n\t}\n\t: never;\n\n/** A static or evaluated CC value definition, transparently inferred from its arguments */\nexport type InferStaticCCValue<\n\tTCommandClass extends CommandClasses,\n\tTBlueprint extends CCValueBlueprint,\n> = Readonly<AddCCValueProperties<TCommandClass, TBlueprint>>;\n\n/** The generic variant of {@link InferStaticCCValue}, without inferring arguments */\nexport interface StaticCCValue extends CCValue {\n\t/** Whether the given value ID matches this value definition */\n\tis: CCValuePredicate;\n\treadonly options: Required<CCValueOptions>;\n}\n\n/** The generic variant of {@link InferDynamicCCValue}, without inferring arguments */\nexport type DynamicCCValue<TArgs extends any[] = any[]> =\n\t& ExpandRecursivelySkipMeta<(...args: TArgs) => CCValue>\n\t& {\n\t\t/** Whether the given value ID matches this value definition */\n\t\tis: CCValuePredicate;\n\t\treadonly options: Required<CCValueOptions>;\n\t};\n\nexport type StaticCCValueFactory<T> = (self: T) => StaticCCValue;\n\n// This interface is auto-generated by maintenance/generateCCValuesInterface.ts\n// Do not edit it by hand or your changes will be lost\nexport interface CCValues {\n\t// AUTO GENERATION BELOW\n\t\"Alarm Sensor\": typeof import(\"../cc/AlarmSensorCC.js\").AlarmSensorCCValues;\n\tAssociation: typeof import(\"../cc/AssociationCC.js\").AssociationCCValues;\n\t\"Association Group Information\":\n\t\ttypeof import(\"../cc/AssociationGroupInfoCC.js\").AssociationGroupInfoCCValues;\n\t\"Barrier Operator\":\n\t\ttypeof import(\"../cc/BarrierOperatorCC.js\").BarrierOperatorCCValues;\n\tBasic: typeof import(\"../cc/BasicCC.js\").BasicCCValues;\n\tBattery: typeof import(\"../cc/BatteryCC.js\").BatteryCCValues;\n\t\"Binary Sensor\":\n\t\ttypeof import(\"../cc/BinarySensorCC.js\").BinarySensorCCValues;\n\t\"Binary Switch\":\n\t\ttypeof import(\"../cc/BinarySwitchCC.js\").BinarySwitchCCValues;\n\t\"Central Scene\":\n\t\ttypeof import(\"../cc/CentralSceneCC.js\").CentralSceneCCValues;\n\t\"Climate Control Schedule\":\n\t\ttypeof import(\"../cc/ClimateControlScheduleCC.js\").ClimateControlScheduleCCValues;\n\t\"Color Switch\": typeof import(\"../cc/ColorSwitchCC.js\").ColorSwitchCCValues;\n\tConfiguration:\n\t\ttypeof import(\"../cc/ConfigurationCC.js\").ConfigurationCCValues;\n\t\"Door Lock\": typeof import(\"../cc/DoorLockCC.js\").DoorLockCCValues;\n\t\"Door Lock Logging\":\n\t\ttypeof import(\"../cc/DoorLockLoggingCC.js\").DoorLockLoggingCCValues;\n\t\"Energy Production\":\n\t\ttypeof import(\"../cc/EnergyProductionCC.js\").EnergyProductionCCValues;\n\t\"Entry Control\":\n\t\ttypeof import(\"../cc/EntryControlCC.js\").EntryControlCCValues;\n\t\"Firmware Update Meta Data\":\n\t\ttypeof import(\"../cc/FirmwareUpdateMetaDataCC.js\").FirmwareUpdateMetaDataCCValues;\n\t\"Humidity Control Mode\":\n\t\ttypeof import(\"../cc/HumidityControlModeCC.js\").HumidityControlModeCCValues;\n\t\"Humidity Control Operating State\":\n\t\ttypeof import(\"../cc/HumidityControlOperatingStateCC.js\").HumidityControlOperatingStateCCValues;\n\t\"Humidity Control Setpoint\":\n\t\ttypeof import(\"../cc/HumidityControlSetpointCC.js\").HumidityControlSetpointCCValues;\n\tIndicator: typeof import(\"../cc/IndicatorCC.js\").IndicatorCCValues;\n\tIrrigation: typeof import(\"../cc/IrrigationCC.js\").IrrigationCCValues;\n\tLanguage: typeof import(\"../cc/LanguageCC.js\").LanguageCCValues;\n\tLock: typeof import(\"../cc/LockCC.js\").LockCCValues;\n\t\"Manufacturer Specific\":\n\t\ttypeof import(\"../cc/ManufacturerSpecificCC.js\").ManufacturerSpecificCCValues;\n\tMeter: typeof import(\"../cc/MeterCC.js\").MeterCCValues;\n\t\"Multi Channel Association\":\n\t\ttypeof import(\"../cc/MultiChannelAssociationCC.js\").MultiChannelAssociationCCValues;\n\t\"Multi Channel\":\n\t\ttypeof import(\"../cc/MultiChannelCC.js\").MultiChannelCCValues;\n\t\"Multilevel Sensor\":\n\t\ttypeof import(\"../cc/MultilevelSensorCC.js\").MultilevelSensorCCValues;\n\t\"Multilevel Switch\":\n\t\ttypeof import(\"../cc/MultilevelSwitchCC.js\").MultilevelSwitchCCValues;\n\t\"Node Naming and Location\":\n\t\ttypeof import(\"../cc/NodeNamingCC.js\").NodeNamingAndLocationCCValues;\n\tNotification: typeof import(\"../cc/NotificationCC.js\").NotificationCCValues;\n\tProtection: typeof import(\"../cc/ProtectionCC.js\").ProtectionCCValues;\n\t\"Scene Activation\":\n\t\ttypeof import(\"../cc/SceneActivationCC.js\").SceneActivationCCValues;\n\t\"Scene Actuator Configuration\":\n\t\ttypeof import(\"../cc/SceneActuatorConfigurationCC.js\").SceneActuatorConfigurationCCValues;\n\t\"Scene Controller Configuration\":\n\t\ttypeof import(\"../cc/SceneControllerConfigurationCC.js\").SceneControllerConfigurationCCValues;\n\t\"Schedule Entry Lock\":\n\t\ttypeof import(\"../cc/ScheduleEntryLockCC.js\").ScheduleEntryLockCCValues;\n\t\"Sound Switch\": typeof import(\"../cc/SoundSwitchCC.js\").SoundSwitchCCValues;\n\tSupervision: typeof import(\"../cc/SupervisionCC.js\").SupervisionCCValues;\n\t\"Thermostat Fan Mode\":\n\t\ttypeof import(\"../cc/ThermostatFanModeCC.js\").ThermostatFanModeCCValues;\n\t\"Thermostat Fan State\":\n\t\ttypeof import(\"../cc/ThermostatFanStateCC.js\").ThermostatFanStateCCValues;\n\t\"Thermostat Mode\":\n\t\ttypeof import(\"../cc/ThermostatModeCC.js\").ThermostatModeCCValues;\n\t\"Thermostat Operating State\":\n\t\ttypeof import(\"../cc/ThermostatOperatingStateCC.js\").ThermostatOperatingStateCCValues;\n\t\"Thermostat Setpoint\":\n\t\ttypeof import(\"../cc/ThermostatSetpointCC.js\").ThermostatSetpointCCValues;\n\t\"Time Parameters\":\n\t\ttypeof import(\"../cc/TimeParametersCC.js\").TimeParametersCCValues;\n\t\"User Code\": typeof import(\"../cc/UserCodeCC.js\").UserCodeCCValues;\n\tVersion: typeof import(\"../cc/VersionCC.js\").VersionCCValues;\n\t\"Wake Up\": typeof import(\"../cc/WakeUpCC.js\").WakeUpCCValues;\n\t\"Window Covering\":\n\t\ttypeof import(\"../cc/WindowCoveringCC.js\").WindowCoveringCCValues;\n\t\"Z-Wave Plus Info\": typeof import(\"../cc/ZWavePlusCC.js\").ZWavePlusCCValues;\n}\n"],
5
- "mappings": ";;;;;;;;;;;;;;;;;;;AAAA;;;;;;AAAA,kBAKO;AAEP,IAAAA,eAIO;AA4CA,MAAM,wBAAwB;EACpC,UAAU;EACV,YAAY;EACZ,QAAQ;EACR,UAAU;EACV,mBAAmB;EACnB,YAAY;;AAkFb,SAAS,oBAIR,cACA,WAAqB;AAGrB,QAAM,aAAa;IAClB,GAAG;IACH,SAAS;MACR,GAAG;MACH,GAAG,UAAU;;;AAIf,QAAM,UAAU;IACf;IACA,UAAU,WAAW;I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UAAM,2BAAa,MAAM,GAAG,IAAI;;MAElC,GACA,EAAE,IAAI,QAAO,CAAE;;EAGlB;;",
4
+ "sourcesContent": ["import { type GetDeviceConfig } from \"@zwave-js/config\";\nimport {\n\ttype CommandClasses,\n\ttype EndpointId,\n\ttype GetValueDB,\n\ttype ValueID,\n\tValueMetadata,\n} from \"@zwave-js/core/safe\";\nimport {\n\ttype FnOrStatic,\n\ttype ReturnTypeOrStatic,\n\tevalOrStatic,\n} from \"@zwave-js/shared/safe\";\nimport type { Overwrite } from \"alcalzone-shared/types\";\nimport type { ValueIDProperties } from \"./API.js\";\n\n// HINT: To fully view types for definitions created by this, open\n// node_modules/typescript/lib/tsserver.js and change the definition of\n// ts.defaultMaximumTruncationLength = 160\n// to something higher like\n// ts.defaultMaximumTruncationLength = 1000\n// Then restart TS Server\n\nexport interface CCValueOptions {\n\t/**\n\t * Whether the CC value is internal. Internal values are not exposed to the user.\n\t */\n\tinternal?: boolean;\n\t/**\n\t * The minimum CC version required for this value to exist.\n\t */\n\tminVersion?: number;\n\t/**\n\t * Whether this value represents a state (`true`) or a notification/event (`false`). Default: `true`\n\t */\n\tstateful?: boolean;\n\t/**\n\t * Omit this value from value logs. Default: `false`\n\t */\n\tsecret?: boolean;\n\n\t/** Whether the CC value may exist on endpoints. Default: `true` */\n\tsupportsEndpoints?: boolean;\n\n\t/**\n\t * Can be used to dynamically decide if this value should be created automatically.\n\t * This is ignored for dynamic values and defaults to `true` if not given.\n\t */\n\tautoCreate?:\n\t\t| boolean\n\t\t| ((\n\t\t\tctx: GetValueDB & GetDeviceConfig,\n\t\t\tendpoint: EndpointId,\n\t\t) => boolean);\n}\n\nexport const defaultCCValueOptions = {\n\tinternal: false,\n\tminVersion: 1,\n\tsecret: false,\n\tstateful: true,\n\tsupportsEndpoints: true,\n\tautoCreate: true,\n} as const;\n\ntype DefaultOptions = typeof defaultCCValueOptions;\n\n// expands object types recursively\nexport type ExpandRecursively<T> =\n\t// Split functions with properties into the function and object parts\n\tT extends (...args: infer A) => infer R\n\t\t? [keyof T] extends [never] ? (...args: A) => ExpandRecursively<R>\n\t\t:\n\t\t\t& ((...args: A) => ExpandRecursively<R>)\n\t\t\t& {\n\t\t\t\t[P in keyof T]: ExpandRecursively<T[P]>;\n\t\t\t}\n\t\t// Expand object types\n\t\t: T extends object\n\t\t\t? T extends infer O ? { [K in keyof O]: ExpandRecursively<O[K]> }\n\t\t\t: never\n\t\t// Fallback to the type itself if no match\n\t\t: T;\n\nexport type ExpandRecursivelySkipMeta<T> =\n\t// Split functions with properties into the function and object parts\n\tT extends (...args: infer A) => infer R\n\t\t? [keyof T] extends [never]\n\t\t\t? (...args: A) => ExpandRecursivelySkipMeta<R>\n\t\t:\n\t\t\t& ((...args: A) => ExpandRecursivelySkipMeta<R>)\n\t\t\t& {\n\t\t\t\t[P in keyof T]: ExpandRecursivelySkipMeta<T[P]>;\n\t\t\t}\n\t\t// Ignore the ValueMetadata type\n\t\t: T extends ValueMetadata ? T\n\t\t// Expand object types\n\t\t: T extends object\n\t\t\t? T extends infer O\n\t\t\t\t? { [K in keyof O]: ExpandRecursivelySkipMeta<O[K]> }\n\t\t\t: never\n\t\t// Fallback to the type itself if no match\n\t\t: T;\n\ntype InferValueIDBase<\n\tTCommandClass extends CommandClasses,\n\tTBlueprint extends CCValueBlueprint,\n\tTWorker = {\n\t\tcommandClass: TCommandClass;\n\t} & Pick<TBlueprint, \"property\" | \"propertyKey\">,\n> = {\n\t[K in keyof TWorker as unknown extends TWorker[K] ? never : K]: TWorker[K];\n};\n\ntype ToStaticCCValues<\n\tTCommandClass extends CommandClasses,\n\tTValues extends Record<keyof TValues, CCValueBlueprint>,\n> = Readonly<\n\t{\n\t\t[K in keyof TValues]: ExpandRecursively<\n\t\t\tInferStaticCCValue<TCommandClass, TValues[K]>\n\t\t>;\n\t}\n>;\n\ntype ToDynamicCCValues<\n\tTCommandClass extends CommandClasses,\n\tTValues extends Record<keyof TValues, DynamicCCValueBlueprint<any>>,\n> = Readonly<\n\t{\n\t\t[K in keyof TValues]: ExpandRecursively<\n\t\t\tInferDynamicCCValue<TCommandClass, TValues[K]>\n\t\t>;\n\t}\n>;\n\ntype InferArgs<T extends FnOrStatic<any, any>[]> = T extends [\n\t(...args: infer A) => any,\n\t...any,\n] ? A\n\t: T extends [any, ...infer R] ? InferArgs<R>\n\t: [];\n\n/** Defines a single static CC values that belong to a CC */\nfunction defineStaticCCValue<\n\tTCommandClass extends CommandClasses,\n\tTBlueprint extends CCValueBlueprint,\n>(\n\tcommandClass: TCommandClass,\n\tblueprint: TBlueprint,\n): ExpandRecursively<InferStaticCCValue<TCommandClass, TBlueprint>> {\n\t// Normalize value options\n\tconst _blueprint = {\n\t\t...blueprint,\n\t\toptions: {\n\t\t\t...defaultCCValueOptions,\n\t\t\t...blueprint.options,\n\t\t},\n\t};\n\n\tconst valueId = {\n\t\tcommandClass,\n\t\tproperty: _blueprint.property,\n\t\tpropertyKey: _blueprint.propertyKey,\n\t};\n\tif (valueId.propertyKey === undefined) delete valueId.propertyKey;\n\n\tconst ret: InferStaticCCValue<TCommandClass, TBlueprint> = {\n\t\tget id() {\n\t\t\treturn { ...valueId };\n\t\t},\n\t\tendpoint: (endpoint: number = 0) => {\n\t\t\tif (!_blueprint.options.supportsEndpoints) endpoint = 0;\n\t\t\treturn { ...valueId, endpoint } as any;\n\t\t},\n\t\tis: (testValueId) => {\n\t\t\treturn (\n\t\t\t\tvalueId.commandClass === testValueId.commandClass\n\t\t\t\t&& valueId.property === testValueId.property\n\t\t\t\t&& valueId.propertyKey === testValueId.propertyKey\n\t\t\t);\n\t\t},\n\t\tget meta() {\n\t\t\treturn { ...ValueMetadata.Any, ..._blueprint.meta } as any;\n\t\t},\n\t\tget options() {\n\t\t\treturn { ..._blueprint.options } as any;\n\t\t},\n\t};\n\n\treturn ret as any;\n}\n\n/** Defines a single CC value which depends on one or more parameters */\nfunction defineDynamicCCValue<\n\tTCommandClass extends CommandClasses,\n\tTBlueprint extends DynamicCCValueBlueprint<any[]>,\n>(\n\tcommandClass: TCommandClass,\n\tblueprint: TBlueprint,\n): ExpandRecursively<InferDynamicCCValue<TCommandClass, TBlueprint>> {\n\tconst options = {\n\t\t...defaultCCValueOptions,\n\t\t...blueprint.options,\n\t};\n\n\tconst ret: ExpandRecursively<\n\t\tInferDynamicCCValue<TCommandClass, TBlueprint>\n\t> = ((...args: Parameters<TBlueprint>) => {\n\t\tconst _blueprint = blueprint(...args);\n\n\t\t// Normalize value options\n\t\tconst actualBlueprint = {\n\t\t\t..._blueprint,\n\t\t};\n\n\t\tconst valueId = {\n\t\t\tcommandClass,\n\t\t\tproperty: actualBlueprint.property,\n\t\t\tpropertyKey: actualBlueprint.propertyKey,\n\t\t};\n\t\tif (valueId.propertyKey === undefined) delete valueId.propertyKey;\n\n\t\tconst value: Omit<\n\t\t\tInferStaticCCValue<TCommandClass, ReturnType<TBlueprint>>,\n\t\t\t\"options\" | \"is\"\n\t\t> = {\n\t\t\tget id() {\n\t\t\t\treturn { ...valueId };\n\t\t\t},\n\t\t\tendpoint: (endpoint: number = 0) => {\n\t\t\t\tif (!options.supportsEndpoints) endpoint = 0;\n\t\t\t\treturn { ...valueId, endpoint } as any;\n\t\t\t},\n\t\t\tget meta() {\n\t\t\t\treturn { ...ValueMetadata.Any, ...actualBlueprint.meta } as any;\n\t\t\t},\n\t\t};\n\n\t\treturn value;\n\t}) as any;\n\n\tObject.defineProperty(ret, \"options\", {\n\t\tconfigurable: false,\n\t\tenumerable: true,\n\t\tget() {\n\t\t\treturn { ...options };\n\t\t},\n\t});\n\n\tObject.defineProperty(ret, \"is\", {\n\t\tconfigurable: false,\n\t\tenumerable: false,\n\t\twritable: false,\n\t\tvalue: (id: ValueID) =>\n\t\t\tid.commandClass === commandClass && blueprint.is(id),\n\t});\n\n\treturn ret;\n}\n\n// Namespace for utilities to define CC values\nexport const V = {\n\t/** Defines multiple static CC values that belong to the same CC */\n\tdefineStaticCCValues<\n\t\tTCommandClass extends CommandClasses,\n\t\tTValues extends Record<keyof TValues, CCValueBlueprint>,\n\t>(\n\t\tcommandClass: TCommandClass,\n\t\tvalues: TValues,\n\t): TValues extends Record<keyof TValues, CCValueBlueprint>\n\t\t? ExpandRecursively<ToStaticCCValues<TCommandClass, TValues>>\n\t\t: never\n\t{\n\t\treturn Object.fromEntries(\n\t\t\tObject.entries<CCValueBlueprint>(values).map(([key, blueprint]) => [\n\t\t\t\tkey,\n\t\t\t\tdefineStaticCCValue(commandClass, blueprint),\n\t\t\t]),\n\t\t) as any;\n\t},\n\n\t/** Defines multiple static CC values that belong to the same CC */\n\tdefineDynamicCCValues<\n\t\tTCommandClass extends CommandClasses,\n\t\tTValues extends Record<keyof TValues, DynamicCCValueBlueprint<any>>,\n\t>(\n\t\tcommandClass: TCommandClass,\n\t\tvalues: TValues,\n\t): TValues extends Record<keyof TValues, DynamicCCValueBlueprint<any>>\n\t\t? ExpandRecursively<ToDynamicCCValues<TCommandClass, TValues>>\n\t\t: never\n\t{\n\t\treturn Object.fromEntries(\n\t\t\tObject.entries<DynamicCCValueBlueprint<any>>(values).map(\n\t\t\t\t([key, blueprint]) => [\n\t\t\t\t\tkey,\n\t\t\t\t\tdefineDynamicCCValue(commandClass, blueprint),\n\t\t\t\t],\n\t\t\t),\n\t\t) as any;\n\t},\n\n\t/** Returns a CC value definition that is named like the value `property` */\n\tstaticProperty<\n\t\tTProp extends string | number,\n\t\tTMeta extends ValueMetadata,\n\t\tTOptions extends CCValueOptions,\n\t>(\n\t\tproperty: TProp,\n\t\tmeta?: TMeta,\n\t\toptions?: TOptions,\n\t): {\n\t\t[K in TProp]: {\n\t\t\tproperty: TProp;\n\t\t\tmeta: TMeta;\n\t\t\toptions: TOptions;\n\t\t};\n\t} {\n\t\treturn {\n\t\t\t[property]: {\n\t\t\t\tproperty,\n\t\t\t\tmeta,\n\t\t\t\toptions,\n\t\t\t},\n\t\t} as any;\n\t},\n\n\t/** Returns a CC value definition with the given name and `property` */\n\tstaticPropertyWithName<\n\t\tTName extends string,\n\t\tTProp extends string | number,\n\t\tTMeta extends ValueMetadata,\n\t\tTOptions extends CCValueOptions,\n\t>(\n\t\tname: TName,\n\t\tproperty: TProp,\n\t\tmeta?: TMeta,\n\t\toptions?: TOptions,\n\t): {\n\t\t[K in TName]: {\n\t\t\tproperty: TProp;\n\t\t\tmeta: TMeta;\n\t\t\toptions: TOptions;\n\t\t};\n\t} {\n\t\treturn {\n\t\t\t[name]: {\n\t\t\t\tproperty,\n\t\t\t\tmeta,\n\t\t\t\toptions,\n\t\t\t},\n\t\t} as any;\n\t},\n\n\t/** Returns a CC value definition with the given name, `property` and `propertyKey` */\n\tstaticPropertyAndKeyWithName<\n\t\tTName extends string,\n\t\tTProp extends string | number,\n\t\tTKey extends string | number,\n\t\tTMeta extends ValueMetadata,\n\t\tTOptions extends CCValueOptions,\n\t>(\n\t\tname: TName,\n\t\tproperty: TProp,\n\t\tpropertyKey: TKey,\n\t\tmeta?: TMeta,\n\t\toptions?: TOptions,\n\t): {\n\t\t[K in TName]: {\n\t\t\tproperty: TProp;\n\t\t\tpropertyKey: TKey;\n\t\t\tmeta: TMeta;\n\t\t\toptions: TOptions;\n\t\t};\n\t} {\n\t\treturn {\n\t\t\t[name]: {\n\t\t\t\tproperty,\n\t\t\t\tpropertyKey,\n\t\t\t\tmeta,\n\t\t\t\toptions,\n\t\t\t},\n\t\t} as any;\n\t},\n\n\t/** Returns a CC value definition with the given name and a dynamic `property` */\n\tdynamicPropertyWithName<\n\t\tTName extends string,\n\t\tTProp extends FnOrStatic<any[], ValueIDProperties[\"property\"]>,\n\t\tTMeta extends FnOrStatic<any[], ValueMetadata> = ValueMetadata,\n\t\tTOptions extends CCValueOptions = CCValueOptions,\n\t>(\n\t\tname: TName,\n\t\tproperty: TProp,\n\t\tis: PartialCCValuePredicate,\n\t\tmeta?: TMeta,\n\t\toptions?: TOptions,\n\t): {\n\t\t[K in TName]: {\n\t\t\t(...args: InferArgs<[TProp, TMeta]>): {\n\t\t\t\tproperty: ReturnTypeOrStatic<TProp>;\n\t\t\t\tmeta: ReturnTypeOrStatic<TMeta>;\n\t\t\t};\n\t\t\tis: PartialCCValuePredicate;\n\t\t\toptions: TOptions;\n\t\t};\n\t} {\n\t\treturn {\n\t\t\t[name]: Object.assign(\n\t\t\t\t(...args: InferArgs<[TProp, TMeta]>) => ({\n\t\t\t\t\tproperty: evalOrStatic(property, ...args),\n\t\t\t\t\tmeta: evalOrStatic(meta, ...args),\n\t\t\t\t}),\n\t\t\t\t{ is, options },\n\t\t\t),\n\t\t} as any;\n\t},\n\n\t/** Returns a CC value definition with the given name and a dynamic `property` */\n\tdynamicPropertyAndKeyWithName<\n\t\tTName extends string,\n\t\tTProp extends FnOrStatic<any[], ValueIDProperties[\"property\"]>,\n\t\tTKey extends FnOrStatic<any[], ValueIDProperties[\"propertyKey\"]>,\n\t\tTMeta extends FnOrStatic<any[], ValueMetadata> = ValueMetadata,\n\t\tTOptions extends FnOrStatic<any[], CCValueOptions> = CCValueOptions,\n\t>(\n\t\tname: TName,\n\t\tproperty: TProp,\n\t\tpropertyKey: TKey,\n\t\tis: PartialCCValuePredicate,\n\t\tmeta?: TMeta,\n\t\toptions?: TOptions,\n\t): {\n\t\t[K in TName]: {\n\t\t\t(...args: InferArgs<[TProp, TKey, TMeta]>): {\n\t\t\t\tproperty: ReturnTypeOrStatic<TProp>;\n\t\t\t\tpropertyKey: ReturnTypeOrStatic<TKey>;\n\t\t\t\tmeta: ReturnTypeOrStatic<TMeta>;\n\t\t\t};\n\t\t\tis: PartialCCValuePredicate;\n\t\t\toptions: TOptions;\n\t\t};\n\t} {\n\t\treturn {\n\t\t\t[name]: Object.assign(\n\t\t\t\t(...args: any[]) => {\n\t\t\t\t\treturn {\n\t\t\t\t\t\tproperty: evalOrStatic(property, ...args),\n\t\t\t\t\t\tpropertyKey: evalOrStatic(propertyKey, ...args),\n\t\t\t\t\t\tmeta: evalOrStatic(meta, ...args),\n\t\t\t\t\t};\n\t\t\t\t},\n\t\t\t\t{ is, options },\n\t\t\t),\n\t\t} as any;\n\t},\n};\n\nexport interface CCValueBlueprint extends Readonly<ValueIDProperties> {\n\treadonly meta?: Readonly<ValueMetadata>;\n\treadonly options?: Readonly<CCValueOptions>;\n}\n\nexport type CCValuePredicate = (valueId: ValueID) => boolean;\nexport type PartialCCValuePredicate = (\n\tproperties: ValueIDProperties,\n) => boolean;\n\n/** A blueprint for a CC value which depends on one or more parameters */\nexport interface DynamicCCValueBlueprint<TArgs extends any[]> {\n\t(...args: TArgs): Omit<CCValueBlueprint, \"options\">;\n\tis: PartialCCValuePredicate;\n\treadonly options?: Readonly<CCValueOptions>;\n}\n\ntype DropOptional<T> = {\n\t[K in keyof T as [undefined] extends [T[K]] ? never : K]: T[K];\n};\n\ntype MergeOptions<TOptions extends CCValueOptions> = DropOptional<\n\tCCValueOptions extends TOptions\n\t\t// When the type cannot be inferred exactly (not given), default to DefaultOptions\n\t\t? DefaultOptions\n\t\t: Overwrite<DefaultOptions, TOptions>\n>;\n\ntype MergeMeta<TMeta extends ValueMetadata> = DropOptional<\n\tValueMetadata extends TMeta\n\t\t// When the type cannot be inferred exactly (not given), default to ValueMetadata.Any\n\t\t? (typeof ValueMetadata)[\"Any\"]\n\t\t: Overwrite<(typeof ValueMetadata)[\"Any\"], TMeta>\n>;\n\n/** The common base type of all CC value definitions */\nexport interface CCValue {\n\treadonly id: Omit<ValueID, \"endpoint\">;\n\tendpoint(endpoint?: number): ValueID;\n\treadonly meta: ValueMetadata;\n}\n\ntype AddCCValueProperties<\n\tTCommandClass extends CommandClasses,\n\tTBlueprint extends CCValueBlueprint,\n\tValueIDBase extends Record<string, any> = InferValueIDBase<\n\t\tTCommandClass,\n\t\tTBlueprint\n\t>,\n> = {\n\t/** Returns the value ID of this CC value, without endpoint information */\n\tget id(): ValueIDBase;\n\n\t/** Returns the value ID, specialized to the given endpoint */\n\tendpoint(\n\t\tendpoint?: number,\n\t): Readonly<\n\t\t& Pick<ValueIDBase, \"commandClass\">\n\t\t& { endpoint: number }\n\t\t& Omit<\n\t\t\tValueIDBase,\n\t\t\t\"commandClass\"\n\t\t>\n\t>;\n\n\t/** Whether the given value ID matches this value definition */\n\tis: CCValuePredicate;\n\n\t/** Returns the metadata for this value ID */\n\tget meta(): Readonly<MergeMeta<NonNullable<TBlueprint[\"meta\"]>>>;\n\t/** Returns the value options for this value ID */\n\tget options(): Readonly<MergeOptions<NonNullable<TBlueprint[\"options\"]>>>;\n};\n\n/** A CC value definition which depends on one or more parameters, transparently inferred from its arguments */\nexport type InferDynamicCCValue<\n\tTCommandClass extends CommandClasses,\n\tTBlueprint extends DynamicCCValueBlueprint<any[]>,\n> = TBlueprint extends DynamicCCValueBlueprint<infer TArgs> ? {\n\t\t(...args: TArgs): Omit<\n\t\t\tInferStaticCCValue<TCommandClass, ReturnType<TBlueprint>>,\n\t\t\t\"options\" | \"is\"\n\t\t>;\n\n\t\t/** Whether the given value ID matches this value definition */\n\t\tis: CCValuePredicate;\n\n\t\treadonly options: InferStaticCCValue<\n\t\t\tTCommandClass,\n\t\t\tReturnType<TBlueprint> & { options: TBlueprint[\"options\"] }\n\t\t>[\"options\"];\n\t}\n\t: never;\n\n/** A static or evaluated CC value definition, transparently inferred from its arguments */\nexport type InferStaticCCValue<\n\tTCommandClass extends CommandClasses,\n\tTBlueprint extends CCValueBlueprint,\n> = Readonly<AddCCValueProperties<TCommandClass, TBlueprint>>;\n\n/** The generic variant of {@link InferStaticCCValue}, without inferring arguments */\nexport interface StaticCCValue extends CCValue {\n\t/** Whether the given value ID matches this value definition */\n\tis: CCValuePredicate;\n\treadonly options: Required<CCValueOptions>;\n}\n\n/** The generic variant of {@link InferDynamicCCValue}, without inferring arguments */\nexport type DynamicCCValue<TArgs extends any[] = any[]> =\n\t& ExpandRecursivelySkipMeta<(...args: TArgs) => CCValue>\n\t& {\n\t\t/** Whether the given value ID matches this value definition */\n\t\tis: CCValuePredicate;\n\t\treadonly options: Required<CCValueOptions>;\n\t};\n\nexport type StaticCCValueFactory<T> = (self: T) => StaticCCValue;\n\n// This interface is auto-generated by maintenance/generateCCValuesInterface.ts\n// Do not edit it by hand or your changes will be lost\nexport interface CCValues {\n\t// AUTO GENERATION BELOW\n\t\"Alarm Sensor\": typeof import(\"../cc/AlarmSensorCC.js\").AlarmSensorCCValues;\n\tAssociation: typeof import(\"../cc/AssociationCC.js\").AssociationCCValues;\n\t\"Association Group Information\":\n\t\ttypeof import(\"../cc/AssociationGroupInfoCC.js\").AssociationGroupInfoCCValues;\n\t\"Barrier Operator\":\n\t\ttypeof import(\"../cc/BarrierOperatorCC.js\").BarrierOperatorCCValues;\n\tBasic: typeof import(\"../cc/BasicCC.js\").BasicCCValues;\n\tBattery: typeof import(\"../cc/BatteryCC.js\").BatteryCCValues;\n\t\"Binary Sensor\":\n\t\ttypeof import(\"../cc/BinarySensorCC.js\").BinarySensorCCValues;\n\t\"Binary Switch\":\n\t\ttypeof import(\"../cc/BinarySwitchCC.js\").BinarySwitchCCValues;\n\t\"Central Scene\":\n\t\ttypeof import(\"../cc/CentralSceneCC.js\").CentralSceneCCValues;\n\t\"Climate Control Schedule\":\n\t\ttypeof import(\"../cc/ClimateControlScheduleCC.js\").ClimateControlScheduleCCValues;\n\t\"Color Switch\": typeof import(\"../cc/ColorSwitchCC.js\").ColorSwitchCCValues;\n\tConfiguration:\n\t\ttypeof import(\"../cc/ConfigurationCC.js\").ConfigurationCCValues;\n\t\"Door Lock\": typeof import(\"../cc/DoorLockCC.js\").DoorLockCCValues;\n\t\"Door Lock Logging\":\n\t\ttypeof import(\"../cc/DoorLockLoggingCC.js\").DoorLockLoggingCCValues;\n\t\"Energy Production\":\n\t\ttypeof import(\"../cc/EnergyProductionCC.js\").EnergyProductionCCValues;\n\t\"Entry Control\":\n\t\ttypeof import(\"../cc/EntryControlCC.js\").EntryControlCCValues;\n\t\"Firmware Update Meta Data\":\n\t\ttypeof import(\"../cc/FirmwareUpdateMetaDataCC.js\").FirmwareUpdateMetaDataCCValues;\n\t\"Humidity Control Mode\":\n\t\ttypeof import(\"../cc/HumidityControlModeCC.js\").HumidityControlModeCCValues;\n\t\"Humidity Control Operating State\":\n\t\ttypeof import(\"../cc/HumidityControlOperatingStateCC.js\").HumidityControlOperatingStateCCValues;\n\t\"Humidity Control Setpoint\":\n\t\ttypeof import(\"../cc/HumidityControlSetpointCC.js\").HumidityControlSetpointCCValues;\n\tIndicator: typeof import(\"../cc/IndicatorCC.js\").IndicatorCCValues;\n\tIrrigation: typeof import(\"../cc/IrrigationCC.js\").IrrigationCCValues;\n\tLanguage: typeof import(\"../cc/LanguageCC.js\").LanguageCCValues;\n\tLock: typeof import(\"../cc/LockCC.js\").LockCCValues;\n\t\"Manufacturer Specific\":\n\t\ttypeof import(\"../cc/ManufacturerSpecificCC.js\").ManufacturerSpecificCCValues;\n\tMeter: typeof import(\"../cc/MeterCC.js\").MeterCCValues;\n\t\"Multi Channel Association\":\n\t\ttypeof import(\"../cc/MultiChannelAssociationCC.js\").MultiChannelAssociationCCValues;\n\t\"Multi Channel\":\n\t\ttypeof import(\"../cc/MultiChannelCC.js\").MultiChannelCCValues;\n\t\"Multilevel Sensor\":\n\t\ttypeof import(\"../cc/MultilevelSensorCC.js\").MultilevelSensorCCValues;\n\t\"Multilevel Switch\":\n\t\ttypeof import(\"../cc/MultilevelSwitchCC.js\").MultilevelSwitchCCValues;\n\t\"Node Naming and Location\":\n\t\ttypeof import(\"../cc/NodeNamingCC.js\").NodeNamingAndLocationCCValues;\n\tNotification: typeof import(\"../cc/NotificationCC.js\").NotificationCCValues;\n\tProtection: typeof import(\"../cc/ProtectionCC.js\").ProtectionCCValues;\n\t\"Scene Activation\":\n\t\ttypeof import(\"../cc/SceneActivationCC.js\").SceneActivationCCValues;\n\t\"Scene Actuator Configuration\":\n\t\ttypeof import(\"../cc/SceneActuatorConfigurationCC.js\").SceneActuatorConfigurationCCValues;\n\t\"Scene Controller Configuration\":\n\t\ttypeof import(\"../cc/SceneControllerConfigurationCC.js\").SceneControllerConfigurationCCValues;\n\t\"Schedule Entry Lock\":\n\t\ttypeof import(\"../cc/ScheduleEntryLockCC.js\").ScheduleEntryLockCCValues;\n\t\"Sound Switch\": typeof import(\"../cc/SoundSwitchCC.js\").SoundSwitchCCValues;\n\tSupervision: typeof import(\"../cc/SupervisionCC.js\").SupervisionCCValues;\n\t\"Thermostat Fan Mode\":\n\t\ttypeof import(\"../cc/ThermostatFanModeCC.js\").ThermostatFanModeCCValues;\n\t\"Thermostat Fan State\":\n\t\ttypeof import(\"../cc/ThermostatFanStateCC.js\").ThermostatFanStateCCValues;\n\t\"Thermostat Mode\":\n\t\ttypeof import(\"../cc/ThermostatModeCC.js\").ThermostatModeCCValues;\n\t\"Thermostat Operating State\":\n\t\ttypeof import(\"../cc/ThermostatOperatingStateCC.js\").ThermostatOperatingStateCCValues;\n\t\"Thermostat Setpoint\":\n\t\ttypeof import(\"../cc/ThermostatSetpointCC.js\").ThermostatSetpointCCValues;\n\t\"Time Parameters\":\n\t\ttypeof import(\"../cc/TimeParametersCC.js\").TimeParametersCCValues;\n\t\"User Code\": typeof import(\"../cc/UserCodeCC.js\").UserCodeCCValues;\n\tVersion: typeof import(\"../cc/VersionCC.js\").VersionCCValues;\n\t\"Wake Up\": typeof import(\"../cc/WakeUpCC.js\").WakeUpCCValues;\n\t\"Window Covering\":\n\t\ttypeof import(\"../cc/WindowCoveringCC.js\").WindowCoveringCCValues;\n\t\"Z-Wave Plus Info\": typeof import(\"../cc/ZWavePlusCC.js\").ZWavePlusCCValues;\n}\n"],
5
+ "mappings": ";;;;;;;;;;;;;;;;;;;AACA;;;;;;AAAA,kBAMO;AACP,IAAAA,eAIO;AA4CA,MAAM,wBAAwB;EACpC,UAAU;EACV,YAAY;EACZ,QAAQ;EACR,UAAU;EACV,mBAAmB;EACnB,YAAY;;AAkFb,SAAS,oBAIR,cACA,WAAqB;AAGrB,QAAM,aAAa;IAClB,GAAG;IACH,SAAS;MACR,GAAG;MACH,GAAG,UAAU;;;AAIf,Q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,2BAAa,aAAa,GAAG,IAAI;UAC9C,UAAM,2BAAa,MAAM,GAAG,IAAI;;MAElC,GACA,EAAE,IAAI,QAAO,CAAE;;EAGlB;;",
6
6
  "names": ["import_safe"]
7
7
  }
@@ -0,0 +1,94 @@
1
+ import { type GetDeviceConfig } from "@zwave-js/config";
2
+ import { type CCId, type FrameType, type GetSupportedCCVersion, type HostIDs, type MaybeNotKnown, type SecurityClass, type SecurityManagers, type SendCommandOptions, type SendCommandReturnType, type ValueID } from "@zwave-js/core";
3
+ /** Allows scheduling a value refresh (poll) for a later time */
4
+ export interface SchedulePoll {
5
+ schedulePoll(nodeId: number, valueId: ValueID, options: SchedulePollOptions): boolean;
6
+ }
7
+ export interface SchedulePollOptions {
8
+ /** The timeout after which the poll is to be scheduled */
9
+ timeoutMs?: number;
10
+ /**
11
+ * The expected value that's should be verified with this poll.
12
+ * When this value is received in the meantime, the poll will be cancelled.
13
+ */
14
+ expectedValue?: unknown;
15
+ }
16
+ export interface RefreshValueTimeouts {
17
+ /**
18
+ * How long to wait for a poll after setting a value without transition duration
19
+ */
20
+ refreshValue: number;
21
+ /**
22
+ * How long to wait for a poll after setting a value with transition duration. This doubles as the "fast" delay.
23
+ */
24
+ refreshValueAfterTransition: number;
25
+ }
26
+ /** Allows reading timeouts for refreshing values from a node */
27
+ export interface GetRefreshValueTimeouts {
28
+ getRefreshValueTimeouts(): RefreshValueTimeouts;
29
+ }
30
+ export interface UserPreferences {
31
+ /**
32
+ * The preferred scales to use when querying sensors. The key is either:
33
+ * - the name of a named scale group, e.g. "temperature", which applies to every sensor type that uses this scale group.
34
+ * - or the numeric sensor type to specify the scale for a single sensor type
35
+ *
36
+ * Single-type preferences have a higher priority than named ones. For example, the following preference
37
+ * ```js
38
+ * {
39
+ * temperature: "°F",
40
+ * 0x01: "°C",
41
+ * }
42
+ * ```
43
+ * will result in using the Fahrenheit scale for all temperature sensors, except the air temperature (0x01).
44
+ *
45
+ * The value must match what is defined in the sensor type config file and contain either:
46
+ * - the label (e.g. "Celsius", "Fahrenheit")
47
+ * - the unit (e.g. "°C", "°F")
48
+ * - or the numeric key of the scale (e.g. 0 or 1).
49
+ *
50
+ * Default:
51
+ * ```js
52
+ * {
53
+ * temperature: "Celsius"
54
+ * }
55
+ * ```
56
+ */
57
+ scales: Partial<Record<string | number, string | number>>;
58
+ }
59
+ /** Allows reading user preferences */
60
+ export interface GetUserPreferences {
61
+ getUserPreferences(): UserPreferences;
62
+ }
63
+ export interface InterviewOptions {
64
+ /**
65
+ * Whether all user code should be queried during the interview of the UserCode CC.
66
+ * Note that enabling this can cause a lot of traffic during the interview.
67
+ */
68
+ queryAllUserCodes?: boolean;
69
+ }
70
+ /** Allows reading options to use for interviewing devices */
71
+ export interface GetInterviewOptions {
72
+ getInterviewOptions(): InterviewOptions;
73
+ }
74
+ /** Additional context needed for deserializing CCs */
75
+ export interface CCParsingContext extends Readonly<SecurityManagers>, GetDeviceConfig, HostIDs {
76
+ sourceNodeId: number;
77
+ __internalIsMockNode?: boolean;
78
+ /** If known, the frame type of the containing message */
79
+ frameType: FrameType;
80
+ getHighestSecurityClass(nodeId: number): MaybeNotKnown<SecurityClass>;
81
+ hasSecurityClass(nodeId: number, securityClass: SecurityClass): MaybeNotKnown<boolean>;
82
+ setSecurityClass(nodeId: number, securityClass: SecurityClass, granted: boolean): void;
83
+ }
84
+ /** Additional context needed for serializing CCs */
85
+ export interface CCEncodingContext extends Readonly<SecurityManagers>, GetDeviceConfig, HostIDs, GetSupportedCCVersion {
86
+ getHighestSecurityClass(nodeId: number): MaybeNotKnown<SecurityClass>;
87
+ hasSecurityClass(nodeId: number, securityClass: SecurityClass): MaybeNotKnown<boolean>;
88
+ setSecurityClass(nodeId: number, securityClass: SecurityClass, granted: boolean): void;
89
+ }
90
+ /** Allows sending commands to one or more nodes */
91
+ export interface SendCommand {
92
+ sendCommand<TResponse extends CCId | undefined = undefined>(command: CCId, options?: SendCommandOptions): Promise<SendCommandReturnType<TResponse>>;
93
+ }
94
+ //# sourceMappingURL=traits.d.ts.map
@@ -0,0 +1,17 @@
1
+ "use strict";
2
+ var __defProp = Object.defineProperty;
3
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
+ var __getOwnPropNames = Object.getOwnPropertyNames;
5
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
6
+ var __copyProps = (to, from, except, desc) => {
7
+ if (from && typeof from === "object" || typeof from === "function") {
8
+ for (let key of __getOwnPropNames(from))
9
+ if (!__hasOwnProp.call(to, key) && key !== except)
10
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
11
+ }
12
+ return to;
13
+ };
14
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
15
+ var traits_exports = {};
16
+ module.exports = __toCommonJS(traits_exports);
17
+ //# sourceMappingURL=traits.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../esm/lib/traits.js"],
4
+ "sourcesContent": ["export {};\n//# sourceMappingURL=traits.js.map"],
5
+ "mappings": ";;;;;;;;;;;;;;AAAA;AAAA;",
6
+ "names": []
7
+ }
@@ -1,5 +1,5 @@
1
- import { CommandClasses, type ControlsCC, type EndpointId, type GetAllEndpoints, type GetEndpoint, type MaybeNotKnown, type NodeId, type QuerySecurityClasses, type SupportsCC } from "@zwave-js/core/safe";
2
- import { type GetDeviceConfig, type GetNode, type GetValueDB, type HostIDs } from "@zwave-js/host";
1
+ import type { GetDeviceConfig } from "@zwave-js/config";
2
+ import { CommandClasses, type ControlsCC, type EndpointId, type GetAllEndpoints, type GetEndpoint, type GetNode, type GetValueDB, type HostIDs, type MaybeNotKnown, type NodeId, type QuerySecurityClasses, type SupportsCC } from "@zwave-js/core/safe";
3
3
  import { type ReadonlyObjectKeyMap } from "@zwave-js/shared/safe";
4
4
  import { type CCAPIHost, type CCAPINode } from "./API.js";
5
5
  import { type AssociationAddress, AssociationCheckResult, type AssociationGroup } from "./_Types.js";