@zwave-js/cc 15.27.1 → 15.29.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 (327) hide show
  1. package/build/cjs/cc/AlarmSensorCC.js.map +2 -2
  2. package/build/cjs/cc/AssociationCC.js +6 -5
  3. package/build/cjs/cc/AssociationCC.js.map +2 -2
  4. package/build/cjs/cc/AssociationGroupInfoCC.js +5 -5
  5. package/build/cjs/cc/AssociationGroupInfoCC.js.map +2 -2
  6. package/build/cjs/cc/BarrierOperatorCC.js.map +2 -2
  7. package/build/cjs/cc/BasicCC.d.ts +4 -1
  8. package/build/cjs/cc/BasicCC.js +18 -0
  9. package/build/cjs/cc/BasicCC.js.map +3 -3
  10. package/build/cjs/cc/BasicWindowCoveringCC.js.map +2 -2
  11. package/build/cjs/cc/BatteryCC.js +18 -4
  12. package/build/cjs/cc/BatteryCC.js.map +2 -2
  13. package/build/cjs/cc/BinarySensorCC.js +5 -1
  14. package/build/cjs/cc/BinarySensorCC.js.map +2 -2
  15. package/build/cjs/cc/BinarySwitchCC.d.ts +4 -1
  16. package/build/cjs/cc/BinarySwitchCC.js +18 -0
  17. package/build/cjs/cc/BinarySwitchCC.js.map +3 -3
  18. package/build/cjs/cc/CRC16CC.d.ts +3 -2
  19. package/build/cjs/cc/CRC16CC.js +7 -1
  20. package/build/cjs/cc/CRC16CC.js.map +3 -3
  21. package/build/cjs/cc/CentralSceneCC.js.map +2 -2
  22. package/build/cjs/cc/ClimateControlScheduleCC.js.map +2 -2
  23. package/build/cjs/cc/ClockCC.js.map +2 -2
  24. package/build/cjs/cc/ColorSwitchCC.js +1 -4
  25. package/build/cjs/cc/ColorSwitchCC.js.map +2 -2
  26. package/build/cjs/cc/ConfigurationCC.js +16 -8
  27. package/build/cjs/cc/ConfigurationCC.js.map +2 -2
  28. package/build/cjs/cc/DeviceResetLocallyCC.js.map +2 -2
  29. package/build/cjs/cc/DoorLockCC.js +1 -1
  30. package/build/cjs/cc/DoorLockCC.js.map +2 -2
  31. package/build/cjs/cc/EntryControlCC.js.map +2 -2
  32. package/build/cjs/cc/FirmwareUpdateMetaDataCC.js +4 -16
  33. package/build/cjs/cc/FirmwareUpdateMetaDataCC.js.map +2 -2
  34. package/build/cjs/cc/HumidityControlSetpointCC.js +10 -4
  35. package/build/cjs/cc/HumidityControlSetpointCC.js.map +2 -2
  36. package/build/cjs/cc/IndicatorCC.js +5 -8
  37. package/build/cjs/cc/IndicatorCC.js.map +2 -2
  38. package/build/cjs/cc/IrrigationCC.js.map +2 -2
  39. package/build/cjs/cc/ManufacturerProprietaryCC.js.map +2 -2
  40. package/build/cjs/cc/ManufacturerSpecificCC._validateArgs.d.ts +1 -0
  41. package/build/cjs/cc/ManufacturerSpecificCC._validateArgs.js +13 -0
  42. package/build/cjs/cc/ManufacturerSpecificCC._validateArgs.js.map +2 -2
  43. package/build/cjs/cc/ManufacturerSpecificCC.d.ts +6 -4
  44. package/build/cjs/cc/ManufacturerSpecificCC.js +41 -8
  45. package/build/cjs/cc/ManufacturerSpecificCC.js.map +2 -2
  46. package/build/cjs/cc/MeterCC.js +18 -29
  47. package/build/cjs/cc/MeterCC.js.map +2 -2
  48. package/build/cjs/cc/MultiChannelAssociationCC.js +11 -7
  49. package/build/cjs/cc/MultiChannelAssociationCC.js.map +2 -2
  50. package/build/cjs/cc/MultiChannelCC.d.ts +3 -1
  51. package/build/cjs/cc/MultiChannelCC.js +21 -10
  52. package/build/cjs/cc/MultiChannelCC.js.map +3 -3
  53. package/build/cjs/cc/MultilevelSensorCC.js.map +2 -2
  54. package/build/cjs/cc/MultilevelSwitchCC.d.ts +5 -1
  55. package/build/cjs/cc/MultilevelSwitchCC.js +30 -0
  56. package/build/cjs/cc/MultilevelSwitchCC.js.map +3 -3
  57. package/build/cjs/cc/NotificationCC.js +29 -11
  58. package/build/cjs/cc/NotificationCC.js.map +2 -2
  59. package/build/cjs/cc/PowerlevelCC.js.map +1 -1
  60. package/build/cjs/cc/ProtectionCC.js +2 -0
  61. package/build/cjs/cc/ProtectionCC.js.map +2 -2
  62. package/build/cjs/cc/SceneActuatorConfigurationCC.js.map +2 -2
  63. package/build/cjs/cc/SceneControllerConfigurationCC.js.map +2 -2
  64. package/build/cjs/cc/ScheduleEntryLockCC.js.map +2 -2
  65. package/build/cjs/cc/Security2CC.d.ts +2 -1
  66. package/build/cjs/cc/Security2CC.js +31 -3
  67. package/build/cjs/cc/Security2CC.js.map +2 -2
  68. package/build/cjs/cc/SecurityCC.d.ts +3 -2
  69. package/build/cjs/cc/SecurityCC.js +7 -6
  70. package/build/cjs/cc/SecurityCC.js.map +2 -2
  71. package/build/cjs/cc/SoundSwitchCC.js +6 -6
  72. package/build/cjs/cc/SoundSwitchCC.js.map +2 -2
  73. package/build/cjs/cc/SupervisionCC.d.ts +2 -1
  74. package/build/cjs/cc/SupervisionCC.js +6 -0
  75. package/build/cjs/cc/SupervisionCC.js.map +3 -3
  76. package/build/cjs/cc/ThermostatFanModeCC.js.map +2 -2
  77. package/build/cjs/cc/ThermostatModeCC.js +1 -3
  78. package/build/cjs/cc/ThermostatModeCC.js.map +2 -2
  79. package/build/cjs/cc/ThermostatOperatingStateCC.js.map +2 -2
  80. package/build/cjs/cc/ThermostatSetpointCC.d.ts +4 -1
  81. package/build/cjs/cc/ThermostatSetpointCC.js +18 -0
  82. package/build/cjs/cc/ThermostatSetpointCC.js.map +3 -3
  83. package/build/cjs/cc/TimeCC.js.map +2 -2
  84. package/build/cjs/cc/TransportServiceCC.js.map +2 -2
  85. package/build/cjs/cc/UserCodeCC.js +3 -6
  86. package/build/cjs/cc/UserCodeCC.js.map +2 -2
  87. package/build/cjs/cc/UserCredentialCC.js +8 -6
  88. package/build/cjs/cc/UserCredentialCC.js.map +2 -2
  89. package/build/cjs/cc/VersionCC.js.map +2 -2
  90. package/build/cjs/cc/WindowCoveringCC.js +5 -1
  91. package/build/cjs/cc/WindowCoveringCC.js.map +2 -2
  92. package/build/cjs/cc/ZWaveProtocolCC.js +3 -11
  93. package/build/cjs/cc/ZWaveProtocolCC.js.map +2 -2
  94. package/build/cjs/cc/_CCValues.generated.d.ts +4 -4
  95. package/build/cjs/cc/_CCValues.generated.js +1 -1
  96. package/build/cjs/cc/_CCValues.generated.js.map +2 -2
  97. package/build/cjs/cc/index.d.ts +179 -179
  98. package/build/cjs/cc/index.js.map +1 -1
  99. package/build/cjs/cc/manufacturerProprietary/Decorators.js.map +2 -2
  100. package/build/cjs/lib/API.d.ts +3 -2
  101. package/build/cjs/lib/API.js.map +2 -2
  102. package/build/cjs/lib/CommandClass.d.ts +23 -1
  103. package/build/cjs/lib/CommandClass.js +63 -15
  104. package/build/cjs/lib/CommandClass.js.map +3 -3
  105. package/build/cjs/lib/CommandClassDecorators.js.map +2 -2
  106. package/build/cjs/lib/EncapsulatingCommandClass.js.map +2 -2
  107. package/build/cjs/lib/NotificationEventPayload.js.map +2 -2
  108. package/build/cjs/lib/Security2/Extension.js +1 -4
  109. package/build/cjs/lib/Security2/Extension.js.map +2 -2
  110. package/build/cjs/lib/Security2/shared.js.map +2 -2
  111. package/build/cjs/lib/SetValueResult.js.map +1 -1
  112. package/build/cjs/lib/Values.d.ts +1 -1
  113. package/build/cjs/lib/Values.js.map +2 -2
  114. package/build/cjs/lib/_CCAPI.generated.js.map +1 -1
  115. package/build/cjs/lib/_Types.d.ts +34 -30
  116. package/build/cjs/lib/_Types.js +7 -0
  117. package/build/cjs/lib/_Types.js.map +3 -3
  118. package/build/cjs/lib/serializers.js +1 -4
  119. package/build/cjs/lib/serializers.js.map +2 -2
  120. package/build/cjs/lib/utils.js.map +2 -2
  121. package/build/esm/cc/AlarmSensorCC.d.ts.map +1 -1
  122. package/build/esm/cc/AlarmSensorCC.js +1 -2
  123. package/build/esm/cc/AlarmSensorCC.js.map +1 -1
  124. package/build/esm/cc/AssociationCC.d.ts.map +1 -1
  125. package/build/esm/cc/AssociationCC.js +8 -7
  126. package/build/esm/cc/AssociationCC.js.map +1 -1
  127. package/build/esm/cc/AssociationGroupInfoCC.d.ts.map +1 -1
  128. package/build/esm/cc/AssociationGroupInfoCC.js +11 -12
  129. package/build/esm/cc/AssociationGroupInfoCC.js.map +1 -1
  130. package/build/esm/cc/BarrierOperatorCC.d.ts.map +1 -1
  131. package/build/esm/cc/BarrierOperatorCC.js +10 -9
  132. package/build/esm/cc/BarrierOperatorCC.js.map +1 -1
  133. package/build/esm/cc/BasicCC.d.ts +4 -1
  134. package/build/esm/cc/BasicCC.d.ts.map +1 -1
  135. package/build/esm/cc/BasicCC.js +30 -7
  136. package/build/esm/cc/BasicCC.js.map +1 -1
  137. package/build/esm/cc/BasicWindowCoveringCC.d.ts.map +1 -1
  138. package/build/esm/cc/BasicWindowCoveringCC.js +2 -5
  139. package/build/esm/cc/BasicWindowCoveringCC.js.map +1 -1
  140. package/build/esm/cc/BatteryCC.d.ts.map +1 -1
  141. package/build/esm/cc/BatteryCC.js +17 -14
  142. package/build/esm/cc/BatteryCC.js.map +1 -1
  143. package/build/esm/cc/BinarySensorCC.d.ts.map +1 -1
  144. package/build/esm/cc/BinarySensorCC.js +12 -7
  145. package/build/esm/cc/BinarySensorCC.js.map +1 -1
  146. package/build/esm/cc/BinarySwitchCC.d.ts +4 -1
  147. package/build/esm/cc/BinarySwitchCC.d.ts.map +1 -1
  148. package/build/esm/cc/BinarySwitchCC.js +31 -6
  149. package/build/esm/cc/BinarySwitchCC.js.map +1 -1
  150. package/build/esm/cc/CRC16CC.d.ts +3 -2
  151. package/build/esm/cc/CRC16CC.d.ts.map +1 -1
  152. package/build/esm/cc/CRC16CC.js +10 -4
  153. package/build/esm/cc/CRC16CC.js.map +1 -1
  154. package/build/esm/cc/CentralSceneCC.d.ts.map +1 -1
  155. package/build/esm/cc/CentralSceneCC.js +2 -1
  156. package/build/esm/cc/CentralSceneCC.js.map +1 -1
  157. package/build/esm/cc/ClimateControlScheduleCC.d.ts.map +1 -1
  158. package/build/esm/cc/ClimateControlScheduleCC.js +6 -2
  159. package/build/esm/cc/ClimateControlScheduleCC.js.map +1 -1
  160. package/build/esm/cc/ClockCC.d.ts.map +1 -1
  161. package/build/esm/cc/ClockCC.js +6 -2
  162. package/build/esm/cc/ClockCC.js.map +1 -1
  163. package/build/esm/cc/ColorSwitchCC.d.ts.map +1 -1
  164. package/build/esm/cc/ColorSwitchCC.js +17 -20
  165. package/build/esm/cc/ColorSwitchCC.js.map +1 -1
  166. package/build/esm/cc/ConfigurationCC.d.ts.map +1 -1
  167. package/build/esm/cc/ConfigurationCC.js +37 -33
  168. package/build/esm/cc/ConfigurationCC.js.map +1 -1
  169. package/build/esm/cc/DeviceResetLocallyCC.d.ts.map +1 -1
  170. package/build/esm/cc/DeviceResetLocallyCC.js +1 -2
  171. package/build/esm/cc/DeviceResetLocallyCC.js.map +1 -1
  172. package/build/esm/cc/DoorLockCC.d.ts.map +1 -1
  173. package/build/esm/cc/DoorLockCC.js +26 -30
  174. package/build/esm/cc/DoorLockCC.js.map +1 -1
  175. package/build/esm/cc/EntryControlCC.d.ts.map +1 -1
  176. package/build/esm/cc/EntryControlCC.js +10 -7
  177. package/build/esm/cc/EntryControlCC.js.map +1 -1
  178. package/build/esm/cc/FirmwareUpdateMetaDataCC.d.ts.map +1 -1
  179. package/build/esm/cc/FirmwareUpdateMetaDataCC.js +15 -27
  180. package/build/esm/cc/FirmwareUpdateMetaDataCC.js.map +1 -1
  181. package/build/esm/cc/HumidityControlSetpointCC.d.ts.map +1 -1
  182. package/build/esm/cc/HumidityControlSetpointCC.js +8 -9
  183. package/build/esm/cc/HumidityControlSetpointCC.js.map +1 -1
  184. package/build/esm/cc/IndicatorCC.d.ts.map +1 -1
  185. package/build/esm/cc/IndicatorCC.js +27 -42
  186. package/build/esm/cc/IndicatorCC.js.map +1 -1
  187. package/build/esm/cc/IrrigationCC.d.ts.map +1 -1
  188. package/build/esm/cc/IrrigationCC.js +8 -6
  189. package/build/esm/cc/IrrigationCC.js.map +1 -1
  190. package/build/esm/cc/ManufacturerProprietaryCC.d.ts.map +1 -1
  191. package/build/esm/cc/ManufacturerProprietaryCC.js +1 -2
  192. package/build/esm/cc/ManufacturerProprietaryCC.js.map +1 -1
  193. package/build/esm/cc/ManufacturerSpecificCC._validateArgs.d.ts +1 -0
  194. package/build/esm/cc/ManufacturerSpecificCC._validateArgs.d.ts.map +1 -1
  195. package/build/esm/cc/ManufacturerSpecificCC._validateArgs.js +10 -0
  196. package/build/esm/cc/ManufacturerSpecificCC._validateArgs.js.map +1 -1
  197. package/build/esm/cc/ManufacturerSpecificCC.d.ts +6 -4
  198. package/build/esm/cc/ManufacturerSpecificCC.d.ts.map +1 -1
  199. package/build/esm/cc/ManufacturerSpecificCC.js +54 -17
  200. package/build/esm/cc/ManufacturerSpecificCC.js.map +1 -1
  201. package/build/esm/cc/MeterCC.d.ts.map +1 -1
  202. package/build/esm/cc/MeterCC.js +28 -38
  203. package/build/esm/cc/MeterCC.js.map +1 -1
  204. package/build/esm/cc/MultiChannelAssociationCC.d.ts.map +1 -1
  205. package/build/esm/cc/MultiChannelAssociationCC.js +15 -20
  206. package/build/esm/cc/MultiChannelAssociationCC.js.map +1 -1
  207. package/build/esm/cc/MultiChannelCC.d.ts +3 -1
  208. package/build/esm/cc/MultiChannelCC.d.ts.map +1 -1
  209. package/build/esm/cc/MultiChannelCC.js +28 -22
  210. package/build/esm/cc/MultiChannelCC.js.map +1 -1
  211. package/build/esm/cc/MultilevelSensorCC.d.ts.map +1 -1
  212. package/build/esm/cc/MultilevelSensorCC.js +11 -11
  213. package/build/esm/cc/MultilevelSensorCC.js.map +1 -1
  214. package/build/esm/cc/MultilevelSwitchCC.d.ts +5 -1
  215. package/build/esm/cc/MultilevelSwitchCC.d.ts.map +1 -1
  216. package/build/esm/cc/MultilevelSwitchCC.js +56 -16
  217. package/build/esm/cc/MultilevelSwitchCC.js.map +1 -1
  218. package/build/esm/cc/NotificationCC.d.ts.map +1 -1
  219. package/build/esm/cc/NotificationCC.js +66 -55
  220. package/build/esm/cc/NotificationCC.js.map +1 -1
  221. package/build/esm/cc/PowerlevelCC.d.ts.map +1 -1
  222. package/build/esm/cc/ProtectionCC.d.ts.map +1 -1
  223. package/build/esm/cc/ProtectionCC.js +13 -9
  224. package/build/esm/cc/ProtectionCC.js.map +1 -1
  225. package/build/esm/cc/SceneActuatorConfigurationCC.d.ts.map +1 -1
  226. package/build/esm/cc/SceneActuatorConfigurationCC.js +5 -8
  227. package/build/esm/cc/SceneActuatorConfigurationCC.js.map +1 -1
  228. package/build/esm/cc/SceneControllerConfigurationCC.d.ts.map +1 -1
  229. package/build/esm/cc/SceneControllerConfigurationCC.js +10 -16
  230. package/build/esm/cc/SceneControllerConfigurationCC.js.map +1 -1
  231. package/build/esm/cc/ScheduleEntryLockCC.d.ts.map +1 -1
  232. package/build/esm/cc/ScheduleEntryLockCC.js +13 -20
  233. package/build/esm/cc/ScheduleEntryLockCC.js.map +1 -1
  234. package/build/esm/cc/Security2CC.d.ts +2 -1
  235. package/build/esm/cc/Security2CC.d.ts.map +1 -1
  236. package/build/esm/cc/Security2CC.js +68 -32
  237. package/build/esm/cc/Security2CC.js.map +1 -1
  238. package/build/esm/cc/SecurityCC.d.ts +3 -2
  239. package/build/esm/cc/SecurityCC.d.ts.map +1 -1
  240. package/build/esm/cc/SecurityCC.js +16 -11
  241. package/build/esm/cc/SecurityCC.js.map +1 -1
  242. package/build/esm/cc/SoundSwitchCC.js +2 -2
  243. package/build/esm/cc/SoundSwitchCC.js.map +1 -1
  244. package/build/esm/cc/SupervisionCC.d.ts +2 -1
  245. package/build/esm/cc/SupervisionCC.d.ts.map +1 -1
  246. package/build/esm/cc/SupervisionCC.js +13 -6
  247. package/build/esm/cc/SupervisionCC.js.map +1 -1
  248. package/build/esm/cc/ThermostatFanModeCC.d.ts.map +1 -1
  249. package/build/esm/cc/ThermostatFanModeCC.js +1 -2
  250. package/build/esm/cc/ThermostatFanModeCC.js.map +1 -1
  251. package/build/esm/cc/ThermostatModeCC.d.ts.map +1 -1
  252. package/build/esm/cc/ThermostatModeCC.js +1 -3
  253. package/build/esm/cc/ThermostatModeCC.js.map +1 -1
  254. package/build/esm/cc/ThermostatOperatingStateCC.d.ts.map +1 -1
  255. package/build/esm/cc/ThermostatOperatingStateCC.js +1 -2
  256. package/build/esm/cc/ThermostatOperatingStateCC.js.map +1 -1
  257. package/build/esm/cc/ThermostatSetpointCC.d.ts +4 -1
  258. package/build/esm/cc/ThermostatSetpointCC.d.ts.map +1 -1
  259. package/build/esm/cc/ThermostatSetpointCC.js +31 -19
  260. package/build/esm/cc/ThermostatSetpointCC.js.map +1 -1
  261. package/build/esm/cc/TimeCC.d.ts.map +1 -1
  262. package/build/esm/cc/TimeCC.js +6 -2
  263. package/build/esm/cc/TimeCC.js.map +1 -1
  264. package/build/esm/cc/TransportServiceCC.d.ts.map +1 -1
  265. package/build/esm/cc/TransportServiceCC.js +8 -8
  266. package/build/esm/cc/TransportServiceCC.js.map +1 -1
  267. package/build/esm/cc/UserCodeCC.d.ts.map +1 -1
  268. package/build/esm/cc/UserCodeCC.js +23 -30
  269. package/build/esm/cc/UserCodeCC.js.map +1 -1
  270. package/build/esm/cc/UserCredentialCC.d.ts.map +1 -1
  271. package/build/esm/cc/UserCredentialCC.js +49 -60
  272. package/build/esm/cc/UserCredentialCC.js.map +1 -1
  273. package/build/esm/cc/VersionCC.js +3 -3
  274. package/build/esm/cc/VersionCC.js.map +1 -1
  275. package/build/esm/cc/WindowCoveringCC.d.ts.map +1 -1
  276. package/build/esm/cc/WindowCoveringCC.js +10 -9
  277. package/build/esm/cc/WindowCoveringCC.js.map +1 -1
  278. package/build/esm/cc/ZWaveProtocolCC.d.ts.map +1 -1
  279. package/build/esm/cc/ZWaveProtocolCC.js +5 -26
  280. package/build/esm/cc/ZWaveProtocolCC.js.map +1 -1
  281. package/build/esm/cc/_CCValues.generated.d.ts +4 -4
  282. package/build/esm/cc/_CCValues.generated.d.ts.map +1 -1
  283. package/build/esm/cc/_CCValues.generated.js +638 -679
  284. package/build/esm/cc/_CCValues.generated.js.map +1 -1
  285. package/build/esm/cc/index.d.ts +179 -179
  286. package/build/esm/cc/index.d.ts.map +1 -1
  287. package/build/esm/cc/index.js +124 -124
  288. package/build/esm/cc/index.js.map +1 -1
  289. package/build/esm/cc/manufacturerProprietary/Decorators.d.ts.map +1 -1
  290. package/build/esm/cc/manufacturerProprietary/Decorators.js.map +1 -1
  291. package/build/esm/lib/API.d.ts +3 -2
  292. package/build/esm/lib/API.d.ts.map +1 -1
  293. package/build/esm/lib/API.js +1 -1
  294. package/build/esm/lib/API.js.map +1 -1
  295. package/build/esm/lib/CommandClass.d.ts +23 -1
  296. package/build/esm/lib/CommandClass.d.ts.map +1 -1
  297. package/build/esm/lib/CommandClass.js +61 -20
  298. package/build/esm/lib/CommandClass.js.map +1 -1
  299. package/build/esm/lib/CommandClassDecorators.d.ts.map +1 -1
  300. package/build/esm/lib/CommandClassDecorators.js +1 -2
  301. package/build/esm/lib/CommandClassDecorators.js.map +1 -1
  302. package/build/esm/lib/EncapsulatingCommandClass.d.ts.map +1 -1
  303. package/build/esm/lib/EncapsulatingCommandClass.js.map +1 -1
  304. package/build/esm/lib/NotificationEventPayload.d.ts.map +1 -1
  305. package/build/esm/lib/NotificationEventPayload.js.map +1 -1
  306. package/build/esm/lib/Security2/Extension.d.ts.map +1 -1
  307. package/build/esm/lib/Security2/Extension.js +2 -6
  308. package/build/esm/lib/Security2/Extension.js.map +1 -1
  309. package/build/esm/lib/Security2/shared.d.ts.map +1 -1
  310. package/build/esm/lib/Security2/shared.js.map +1 -1
  311. package/build/esm/lib/SetValueResult.d.ts.map +1 -1
  312. package/build/esm/lib/Values.d.ts +1 -1
  313. package/build/esm/lib/Values.d.ts.map +1 -1
  314. package/build/esm/lib/Values.js.map +1 -1
  315. package/build/esm/lib/_CCAPI.generated.d.ts.map +1 -1
  316. package/build/esm/lib/_Types.d.ts +34 -30
  317. package/build/esm/lib/_Types.d.ts.map +1 -1
  318. package/build/esm/lib/_Types.js +5 -0
  319. package/build/esm/lib/_Types.js.map +1 -1
  320. package/build/esm/lib/serializers.d.ts.map +1 -1
  321. package/build/esm/lib/serializers.js +1 -4
  322. package/build/esm/lib/serializers.js.map +1 -1
  323. package/build/esm/lib/traits.d.ts.map +1 -1
  324. package/build/esm/lib/utils.d.ts.map +1 -1
  325. package/build/esm/lib/utils.js +25 -31
  326. package/build/esm/lib/utils.js.map +1 -1
  327. package/package.json +7 -7
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../src_gen/cc/HumidityControlSetpointCC.ts"],
4
- "sourcesContent": ["import * as __validateArgs from \"./HumidityControlSetpointCC._validateArgs.js\";\nconst { validateArgs_HumidityControlSetpointCCAPI_get, validateArgs_HumidityControlSetpointCCAPI_set, validateArgs_HumidityControlSetpointCCAPI_getCapabilities, validateArgs_HumidityControlSetpointCCAPI_getSupportedScales } = __validateArgs;\nimport { CommandClasses, type GetValueDB, type MaybeNotKnown, type MessageOrCCLogEntry, MessagePriority, type Scale, type SupervisionResult, ValueMetadata, type ValueMetadataNumeric, type WithAddress, ZWaveError, ZWaveErrorCodes, encodeFloatWithScale, getNamedScale, getUnknownScale, logDict, logList, logText, parseBitMask, parseFloatWithScale, supervisedCommandSucceeded, validatePayload, } from \"@zwave-js/core\";\nimport { Bytes, getEnumMemberName, pick } from \"@zwave-js/shared\";\nimport { CCAPI, POLL_VALUE, type PollValueImplementation, SET_VALUE, type SetValueImplementation, throwUnsupportedProperty, throwWrongValueType, } from \"../lib/API.js\";\nimport { type CCRaw, CommandClass, type InterviewContext, type PersistValuesContext, type RefreshValuesContext, type RefreshValuesOptions, } from \"../lib/CommandClass.js\";\nimport { API, CCCommand, ccValueProperty, ccValues, commandClass, expectedCCResponse, implementedVersion, useSupervision, } from \"../lib/CommandClassDecorators.js\";\nimport { V } from \"../lib/Values.js\";\nimport { type HumidityControlSetpointCapabilities, HumidityControlSetpointCommand, HumidityControlSetpointType, type HumidityControlSetpointValue, } from \"../lib/_Types.js\";\nimport type { CCEncodingContext, CCParsingContext } from \"../lib/traits.js\";\nimport { HumidityControlSetpointCCValues } from \"./_CCValues.generated.js\";\nexport { HumidityControlSetpointCCValues };\nfunction getScale(scale: number): Scale {\n return getNamedScale(\"humidity\", scale as any) ?? getUnknownScale(scale);\n}\nfunction getSetpointUnit(scale: number): string {\n return getScale(scale).unit ?? \"\";\n}\n@API(CommandClasses[\"Humidity Control Setpoint\"])\nexport class HumidityControlSetpointCCAPI extends CCAPI {\n public supportsCommand(cmd: HumidityControlSetpointCommand): MaybeNotKnown<boolean> {\n switch (cmd) {\n case HumidityControlSetpointCommand.Get:\n case HumidityControlSetpointCommand.SupportedGet:\n case HumidityControlSetpointCommand.CapabilitiesGet:\n return this.isSinglecast();\n case HumidityControlSetpointCommand.Set:\n return true; // This is mandatory\n }\n return super.supportsCommand(cmd);\n }\n protected override get [SET_VALUE](): SetValueImplementation {\n return async function (this: HumidityControlSetpointCCAPI, { property, propertyKey }, value) {\n if (property !== \"setpoint\") {\n throwUnsupportedProperty(this.ccId, property);\n }\n if (typeof propertyKey !== \"number\") {\n throw new ZWaveError(`${CommandClasses[this.ccId]}: \"${property}\" must be further specified by a numeric property key`, ZWaveErrorCodes.Argument_Invalid);\n }\n if (typeof value !== \"number\") {\n throwWrongValueType(this.ccId, property, \"number\", typeof value);\n }\n const scaleValueId = HumidityControlSetpointCCValues.setpointScale(propertyKey).endpoint(this.endpoint.index);\n const preferredScale = this.tryGetValueDB()?.getValue<number>(scaleValueId);\n const result = await this.set(propertyKey, value, preferredScale ?? 0);\n // Verify the change after a delay, unless the command was supervised and successful\n if (this.isSinglecast() && !supervisedCommandSucceeded(result)) {\n this.schedulePoll({ property, propertyKey }, value);\n }\n return result;\n };\n }\n protected get [POLL_VALUE](): PollValueImplementation {\n return async function (this: HumidityControlSetpointCCAPI, { property, propertyKey }) {\n switch (property) {\n case \"setpoint\":\n if (typeof propertyKey !== \"number\") {\n throw new ZWaveError(`${CommandClasses[this.ccId]}: \"${property}\" must be further specified by a numeric property key`, ZWaveErrorCodes.Argument_Invalid);\n }\n return (await this.get(propertyKey))?.value;\n default:\n throwUnsupportedProperty(this.ccId, property);\n }\n };\n }\n @validateArgs_HumidityControlSetpointCCAPI_get()\n public async get(setpointType: HumidityControlSetpointType): Promise<MaybeNotKnown<HumidityControlSetpointValue>> {\n this.assertSupportsCommand(HumidityControlSetpointCommand, HumidityControlSetpointCommand.Get);\n const cc = new HumidityControlSetpointCCGet({\n nodeId: this.endpoint.nodeId,\n endpointIndex: this.endpoint.index,\n setpointType,\n });\n const response = await this.host.sendCommand<HumidityControlSetpointCCReport>(cc, this.commandOptions);\n if (!response)\n return;\n return response.type === HumidityControlSetpointType[\"N/A\"]\n // not supported\n ? undefined\n // supported\n : {\n value: response.value,\n scale: response.scale,\n };\n }\n @validateArgs_HumidityControlSetpointCCAPI_set()\n public async set(setpointType: HumidityControlSetpointType, value: number, scale: number): Promise<SupervisionResult | undefined> {\n this.assertSupportsCommand(HumidityControlSetpointCommand, HumidityControlSetpointCommand.Set);\n const cc = new HumidityControlSetpointCCSet({\n nodeId: this.endpoint.nodeId,\n endpointIndex: this.endpoint.index,\n setpointType,\n value,\n scale,\n });\n return this.host.sendCommand(cc, this.commandOptions);\n }\n @validateArgs_HumidityControlSetpointCCAPI_getCapabilities()\n public async getCapabilities(setpointType: HumidityControlSetpointType): Promise<MaybeNotKnown<HumidityControlSetpointCapabilities>> {\n this.assertSupportsCommand(HumidityControlSetpointCommand, HumidityControlSetpointCommand.CapabilitiesGet);\n const cc = new HumidityControlSetpointCCCapabilitiesGet({\n nodeId: this.endpoint.nodeId,\n endpointIndex: this.endpoint.index,\n setpointType,\n });\n const response = await this.host.sendCommand<HumidityControlSetpointCCCapabilitiesReport>(cc, this.commandOptions);\n if (response) {\n return pick(response, [\n \"minValue\",\n \"maxValue\",\n \"minValueScale\",\n \"maxValueScale\",\n ]);\n }\n }\n public async getSupportedSetpointTypes(): Promise<MaybeNotKnown<readonly HumidityControlSetpointType[]>> {\n this.assertSupportsCommand(HumidityControlSetpointCommand, HumidityControlSetpointCommand.SupportedGet);\n const cc = new HumidityControlSetpointCCSupportedGet({\n nodeId: this.endpoint.nodeId,\n endpointIndex: this.endpoint.index,\n });\n const response = await this.host.sendCommand<HumidityControlSetpointCCSupportedReport>(cc, this.commandOptions);\n return response?.supportedSetpointTypes;\n }\n @validateArgs_HumidityControlSetpointCCAPI_getSupportedScales()\n public async getSupportedScales(setpointType: HumidityControlSetpointType): Promise<MaybeNotKnown<readonly Scale[]>> {\n this.assertSupportsCommand(HumidityControlSetpointCommand, HumidityControlSetpointCommand.SupportedGet);\n const cc = new HumidityControlSetpointCCScaleSupportedGet({\n nodeId: this.endpoint.nodeId,\n endpointIndex: this.endpoint.index,\n setpointType,\n });\n const response = await this.host.sendCommand<HumidityControlSetpointCCScaleSupportedReport>(cc, this.commandOptions);\n if (response) {\n return response.supportedScales.map((scale) => getScale(scale));\n }\n }\n}\n@commandClass(CommandClasses[\"Humidity Control Setpoint\"])\n@implementedVersion(2)\n@ccValues(HumidityControlSetpointCCValues)\nexport class HumidityControlSetpointCC extends CommandClass {\n declare ccCommand: HumidityControlSetpointCommand;\n public translatePropertyKey(ctx: GetValueDB, property: string | number, propertyKey: string | number): string | undefined {\n if (property === \"setpoint\") {\n return getEnumMemberName(HumidityControlSetpointType, propertyKey as any);\n }\n else {\n return super.translatePropertyKey(ctx, property, propertyKey);\n }\n }\n public async interview(ctx: InterviewContext): Promise<void> {\n const node = this.getNode(ctx)!;\n const endpoint = this.getEndpoint(ctx)!;\n const api = CCAPI.create(CommandClasses[\"Humidity Control Setpoint\"], ctx, endpoint).withOptions({\n priority: MessagePriority.NodeQuery,\n tag: \"interview\",\n });\n ctx.logNode(node.id, {\n endpoint: this.endpointIndex,\n message: `Interviewing ${this.ccName}...`,\n direction: \"none\",\n });\n // Query the supported setpoint types\n let setpointTypes: HumidityControlSetpointType[] = [];\n ctx.logNode(node.id, {\n endpoint: this.endpointIndex,\n message: \"retrieving supported setpoint types...\",\n direction: \"outbound\",\n });\n const resp = await api.getSupportedSetpointTypes();\n if (resp) {\n setpointTypes = [...resp];\n ctx.logNode(node.id, {\n endpoint: this.endpointIndex,\n message: logText(\"received supported setpoint types:\", {\n nested: logList(setpointTypes.map((type) => getEnumMemberName(HumidityControlSetpointType, type))),\n }),\n direction: \"inbound\",\n });\n }\n else {\n ctx.logNode(node.id, {\n endpoint: this.endpointIndex,\n message: \"Querying supported setpoint types timed out, skipping interview...\",\n level: \"warn\",\n });\n return;\n }\n for (const type of setpointTypes) {\n const setpointName = getEnumMemberName(HumidityControlSetpointType, type);\n // Find out the capabilities of this setpoint\n ctx.logNode(node.id, {\n endpoint: this.endpointIndex,\n message: `retrieving capabilities for setpoint ${setpointName}...`,\n direction: \"outbound\",\n });\n const setpointScaleSupported = await api.getSupportedScales(type);\n if (setpointScaleSupported) {\n ctx.logNode(node.id, {\n endpoint: this.endpointIndex,\n message: logText(`received supported scales for setpoint ${setpointName}:`, {\n nested: logList(setpointScaleSupported.map((t) => `${t.key} ${t.unit} - ${t.label}`)),\n }),\n direction: \"inbound\",\n });\n const scaleValue = HumidityControlSetpointCCValues\n .setpointScale(type);\n const states: Record<number, string> = {};\n for (const scale of setpointScaleSupported) {\n if (scale.unit)\n states[scale.key] = scale.unit;\n }\n this.setMetadata(ctx, scaleValue, {\n ...scaleValue.meta,\n states,\n });\n }\n const setpointCaps = await api.getCapabilities(type);\n if (setpointCaps) {\n const minValueUnit = getSetpointUnit(setpointCaps.minValueScale);\n const maxValueUnit = getSetpointUnit(setpointCaps.maxValueScale);\n ctx.logNode(node.id, {\n endpoint: this.endpointIndex,\n message: logText(`received capabilities for setpoint ${setpointName}:`, {\n nested: logDict({\n \"minimum value\": `${setpointCaps.minValue} ${minValueUnit}`,\n \"maximum value\": `${setpointCaps.maxValue} ${maxValueUnit}`,\n }),\n }),\n direction: \"inbound\",\n });\n }\n }\n // Query the current value for all setpoint types\n await this.refreshValues(ctx, { tag: \"interview\" });\n // Remember that the interview is complete\n this.setInterviewComplete(ctx, true);\n }\n public async refreshValues(ctx: RefreshValuesContext, options?: RefreshValuesOptions): Promise<void> {\n const node = this.getNode(ctx)!;\n const endpoint = this.getEndpoint(ctx)!;\n const api = CCAPI.create(CommandClasses[\"Humidity Control Setpoint\"], ctx, endpoint).withOptions({\n priority: options?.priority ?? MessagePriority.NodeQuery,\n tag: options?.tag,\n });\n const setpointTypes: HumidityControlSetpointType[] = this.getValue(ctx, HumidityControlSetpointCCValues.supportedSetpointTypes) ?? [];\n // Query each setpoint's current value\n for (const type of setpointTypes) {\n const setpointName = getEnumMemberName(HumidityControlSetpointType, type);\n // Every time, query the current value\n ctx.logNode(node.id, {\n endpoint: this.endpointIndex,\n message: `querying current value of setpoint ${setpointName}...`,\n direction: \"outbound\",\n });\n const setpoint = await api.get(type);\n if (setpoint) {\n const logMessage = `received current value of setpoint ${setpointName}: ${setpoint.value} ${getScale(setpoint.scale).unit ?? \"\"}`;\n ctx.logNode(node.id, {\n endpoint: this.endpointIndex,\n message: logMessage,\n direction: \"inbound\",\n });\n }\n }\n }\n}\n// @publicAPI\nexport interface HumidityControlSetpointCCSetOptions {\n setpointType: HumidityControlSetpointType;\n value: number;\n scale: number;\n}\n@CCCommand(HumidityControlSetpointCommand.Set)\n@useSupervision()\nexport class HumidityControlSetpointCCSet extends HumidityControlSetpointCC {\n public constructor(options: WithAddress<HumidityControlSetpointCCSetOptions>) {\n super(options);\n this.setpointType = options.setpointType;\n this.value = options.value;\n this.scale = options.scale;\n }\n public static from(_raw: CCRaw, _ctx: CCParsingContext): HumidityControlSetpointCCSet {\n // TODO: Deserialize payload\n throw new ZWaveError(`${this.name}: deserialization not implemented`, ZWaveErrorCodes.Deserialization_NotImplemented);\n // return new HumidityControlSetpointCCSet({\n // \tnodeId: ctx.sourceNodeId,\n // });\n }\n public setpointType: HumidityControlSetpointType;\n public value: number;\n public scale: number;\n public serialize(ctx: CCEncodingContext): Promise<Bytes> {\n this.payload = Bytes.concat([\n [this.setpointType & 0b1111],\n encodeFloatWithScale(this.value, this.scale),\n ]);\n return super.serialize(ctx);\n }\n public toLogEntry(ctx?: GetValueDB): MessageOrCCLogEntry {\n const scale = getScale(this.scale);\n return {\n ...super.toLogEntry(ctx),\n message: {\n \"setpoint type\": getEnumMemberName(HumidityControlSetpointType, this.setpointType),\n value: `${this.value} ${scale.unit}`,\n },\n };\n }\n}\n// @publicAPI\nexport interface HumidityControlSetpointCCReportOptions {\n type: HumidityControlSetpointType;\n scale: number;\n value: number;\n}\n@CCCommand(HumidityControlSetpointCommand.Report)\nexport class HumidityControlSetpointCCReport extends HumidityControlSetpointCC {\n public constructor(options: WithAddress<HumidityControlSetpointCCReportOptions>) {\n super(options);\n // TODO: Check implementation:\n this.type = options.type;\n this.value = options.value;\n this.scale = options.scale;\n }\n public static from(raw: CCRaw, ctx: CCParsingContext): HumidityControlSetpointCCReport {\n validatePayload(raw.payload.length >= 1);\n const type: HumidityControlSetpointType = raw.payload[0] & 0b1111;\n // Setpoint type 0 is not defined in the spec, prevent devices from using it.\n if (type === 0) {\n // Not supported\n return new this({\n nodeId: ctx.sourceNodeId,\n type,\n value: 0,\n scale: 0,\n });\n }\n // parseFloatWithScale does its own validation\n const { value, scale } = parseFloatWithScale(raw.payload.subarray(1));\n return new this({\n nodeId: ctx.sourceNodeId,\n type,\n value,\n scale,\n });\n }\n public persistValues(ctx: PersistValuesContext): boolean {\n if (!super.persistValues(ctx))\n return false;\n const scale = getScale(this.scale);\n const setpointValue = HumidityControlSetpointCCValues.setpoint(this.type);\n const existingMetadata = this.getMetadata<ValueMetadataNumeric>(ctx, setpointValue);\n // Update the metadata when it is missing or the unit has changed\n if (existingMetadata?.unit !== scale.unit) {\n this.setMetadata(ctx, setpointValue, {\n ...(existingMetadata ?? setpointValue.meta),\n unit: scale.unit,\n });\n }\n this.setValue(ctx, setpointValue, this.value);\n // Remember the device-preferred setpoint scale so it can be used in SET commands\n this.setValue(ctx, HumidityControlSetpointCCValues.setpointScale(this.type), this.scale);\n return true;\n }\n public type: HumidityControlSetpointType;\n public scale: number;\n public value: number;\n public toLogEntry(ctx?: GetValueDB): MessageOrCCLogEntry {\n const scale = getScale(this.scale);\n return {\n ...super.toLogEntry(ctx),\n message: {\n \"setpoint type\": getEnumMemberName(HumidityControlSetpointType, this.type),\n value: `${this.value} ${scale.unit}`,\n },\n };\n }\n}\nfunction testResponseForHumidityControlSetpointGet(sent: HumidityControlSetpointCCGet, received: HumidityControlSetpointCCReport) {\n // We expect a Humidity Control Setpoint Report that matches the requested setpoint type\n return received.type === sent.setpointType;\n}\n// @publicAPI\nexport interface HumidityControlSetpointCCGetOptions {\n setpointType: HumidityControlSetpointType;\n}\n@CCCommand(HumidityControlSetpointCommand.Get)\n@expectedCCResponse(HumidityControlSetpointCCReport, testResponseForHumidityControlSetpointGet)\nexport class HumidityControlSetpointCCGet extends HumidityControlSetpointCC {\n public constructor(options: WithAddress<HumidityControlSetpointCCGetOptions>) {\n super(options);\n this.setpointType = options.setpointType;\n }\n public static from(_raw: CCRaw, _ctx: CCParsingContext): HumidityControlSetpointCCGet {\n // TODO: Deserialize payload\n throw new ZWaveError(`${this.name}: deserialization not implemented`, ZWaveErrorCodes.Deserialization_NotImplemented);\n // return new HumidityControlSetpointCCGet({\n // \tnodeId: ctx.sourceNodeId,\n // });\n }\n public setpointType: HumidityControlSetpointType;\n public serialize(ctx: CCEncodingContext): Promise<Bytes> {\n this.payload = Bytes.from([this.setpointType & 0b1111]);\n return super.serialize(ctx);\n }\n public toLogEntry(ctx?: GetValueDB): MessageOrCCLogEntry {\n return {\n ...super.toLogEntry(ctx),\n message: {\n \"setpoint type\": getEnumMemberName(HumidityControlSetpointType, this.setpointType),\n },\n };\n }\n}\n// @publicAPI\nexport interface HumidityControlSetpointCCSupportedReportOptions {\n supportedSetpointTypes: HumidityControlSetpointType[];\n}\n@CCCommand(HumidityControlSetpointCommand.SupportedReport)\n@ccValueProperty(\"supportedSetpointTypes\", HumidityControlSetpointCCValues.supportedSetpointTypes)\nexport class HumidityControlSetpointCCSupportedReport extends HumidityControlSetpointCC {\n public constructor(options: WithAddress<HumidityControlSetpointCCSupportedReportOptions>) {\n super(options);\n // TODO: Check implementation:\n this.supportedSetpointTypes = options.supportedSetpointTypes;\n }\n public static from(raw: CCRaw, ctx: CCParsingContext): HumidityControlSetpointCCSupportedReport {\n validatePayload(raw.payload.length >= 1);\n const supportedSetpointTypes: HumidityControlSetpointType[] = parseBitMask(raw.payload, HumidityControlSetpointType[\"N/A\"]);\n return new this({\n nodeId: ctx.sourceNodeId,\n supportedSetpointTypes,\n });\n }\n public readonly supportedSetpointTypes: readonly HumidityControlSetpointType[];\n public toLogEntry(ctx?: GetValueDB): MessageOrCCLogEntry {\n return {\n ...super.toLogEntry(ctx),\n message: {\n \"supported setpoint types\": logList(this.supportedSetpointTypes.map((t) => getEnumMemberName(HumidityControlSetpointType, t))),\n },\n };\n }\n}\n@CCCommand(HumidityControlSetpointCommand.SupportedGet)\n@expectedCCResponse(HumidityControlSetpointCCSupportedReport)\nexport class HumidityControlSetpointCCSupportedGet extends HumidityControlSetpointCC {\n}\n// @publicAPI\nexport interface HumidityControlSetpointCCScaleSupportedReportOptions {\n supportedScales: number[];\n}\n@CCCommand(HumidityControlSetpointCommand.ScaleSupportedReport)\nexport class HumidityControlSetpointCCScaleSupportedReport extends HumidityControlSetpointCC {\n public constructor(options: WithAddress<HumidityControlSetpointCCScaleSupportedReportOptions>) {\n super(options);\n // TODO: Check implementation:\n this.supportedScales = options.supportedScales;\n }\n public static from(raw: CCRaw, ctx: CCParsingContext): HumidityControlSetpointCCScaleSupportedReport {\n validatePayload(raw.payload.length >= 1);\n const supportedScales = parseBitMask(Bytes.from([raw.payload[0] & 0b1111]), 0);\n return new this({\n nodeId: ctx.sourceNodeId,\n supportedScales,\n });\n }\n public readonly supportedScales: readonly number[];\n public toLogEntry(ctx?: GetValueDB): MessageOrCCLogEntry {\n const supportedScales = this.supportedScales.map((scale) => getScale(scale));\n return {\n ...super.toLogEntry(ctx),\n message: {\n \"scale supported\": logList(supportedScales.map((t) => `${t.key} ${t.unit} - ${t.label}`)),\n },\n };\n }\n}\n// @publicAPI\nexport interface HumidityControlSetpointCCScaleSupportedGetOptions {\n setpointType: HumidityControlSetpointType;\n}\n@CCCommand(HumidityControlSetpointCommand.ScaleSupportedGet)\n@expectedCCResponse(HumidityControlSetpointCCScaleSupportedReport)\nexport class HumidityControlSetpointCCScaleSupportedGet extends HumidityControlSetpointCC {\n public constructor(options: WithAddress<HumidityControlSetpointCCScaleSupportedGetOptions>) {\n super(options);\n this.setpointType = options.setpointType;\n }\n public static from(_raw: CCRaw, _ctx: CCParsingContext): HumidityControlSetpointCCScaleSupportedGet {\n // TODO: Deserialize payload\n throw new ZWaveError(`${this.name}: deserialization not implemented`, ZWaveErrorCodes.Deserialization_NotImplemented);\n // return new HumidityControlSetpointCCScaleSupportedGet({\n // \tnodeId: ctx.sourceNodeId,\n // });\n }\n public setpointType: HumidityControlSetpointType;\n public serialize(ctx: CCEncodingContext): Promise<Bytes> {\n this.payload = Bytes.from([this.setpointType & 0b1111]);\n return super.serialize(ctx);\n }\n public toLogEntry(ctx?: GetValueDB): MessageOrCCLogEntry {\n return {\n ...super.toLogEntry(ctx),\n message: {\n \"setpoint type\": getEnumMemberName(HumidityControlSetpointType, this.setpointType),\n },\n };\n }\n}\n// @publicAPI\nexport interface HumidityControlSetpointCCCapabilitiesReportOptions {\n type: HumidityControlSetpointType;\n minValue: number;\n maxValue: number;\n minValueScale: number;\n maxValueScale: number;\n}\n@CCCommand(HumidityControlSetpointCommand.CapabilitiesReport)\nexport class HumidityControlSetpointCCCapabilitiesReport extends HumidityControlSetpointCC {\n public constructor(options: WithAddress<HumidityControlSetpointCCCapabilitiesReportOptions>) {\n super(options);\n this.type = options.type;\n this.minValue = options.minValue;\n this.maxValue = options.maxValue;\n this.minValueScale = options.minValueScale;\n this.maxValueScale = options.maxValueScale;\n }\n public static from(raw: CCRaw, ctx: CCParsingContext): HumidityControlSetpointCCCapabilitiesReport {\n validatePayload(raw.payload.length >= 1);\n const type: HumidityControlSetpointType = raw.payload[0] & 0b1111;\n // parseFloatWithScale does its own validation\n const { value: minValue, scale: minValueScale, bytesRead, } = parseFloatWithScale(raw.payload.subarray(1));\n const { value: maxValue, scale: maxValueScale } = parseFloatWithScale(raw.payload.subarray(1 + bytesRead));\n return new this({\n nodeId: ctx.sourceNodeId,\n type,\n minValue,\n minValueScale,\n maxValue,\n maxValueScale,\n });\n }\n public persistValues(ctx: PersistValuesContext): boolean {\n if (!super.persistValues(ctx))\n return false;\n // Predefine the metadata\n const setpointValue = HumidityControlSetpointCCValues.setpoint(this.type);\n this.setMetadata(ctx, setpointValue, {\n ...setpointValue.meta,\n min: this.minValue,\n max: this.maxValue,\n unit: getSetpointUnit(this.minValueScale)\n || getSetpointUnit(this.maxValueScale),\n });\n return true;\n }\n public type: HumidityControlSetpointType;\n public minValue: number;\n public maxValue: number;\n public minValueScale: number;\n public maxValueScale: number;\n public toLogEntry(ctx?: GetValueDB): MessageOrCCLogEntry {\n const minValueScale = getScale(this.minValueScale);\n const maxValueScale = getScale(this.maxValueScale);\n return {\n ...super.toLogEntry(ctx),\n message: {\n \"setpoint type\": getEnumMemberName(HumidityControlSetpointType, this.type),\n \"min value\": `${this.minValue} ${minValueScale.unit}`,\n \"max value\": `${this.maxValue} ${maxValueScale.unit}`,\n },\n };\n }\n}\n// @publicAPI\nexport interface HumidityControlSetpointCCCapabilitiesGetOptions {\n setpointType: HumidityControlSetpointType;\n}\n@CCCommand(HumidityControlSetpointCommand.CapabilitiesGet)\n@expectedCCResponse(HumidityControlSetpointCCCapabilitiesReport)\nexport class HumidityControlSetpointCCCapabilitiesGet extends HumidityControlSetpointCC {\n public constructor(options: WithAddress<HumidityControlSetpointCCCapabilitiesGetOptions>) {\n super(options);\n this.setpointType = options.setpointType;\n }\n public static from(_raw: CCRaw, _ctx: CCParsingContext): HumidityControlSetpointCCCapabilitiesGet {\n // TODO: Deserialize payload\n throw new ZWaveError(`${this.name}: deserialization not implemented`, ZWaveErrorCodes.Deserialization_NotImplemented);\n // return new HumidityControlSetpointCCCapabilitiesGet({\n // \tnodeId: ctx.sourceNodeId,\n // });\n }\n public setpointType: HumidityControlSetpointType;\n public serialize(ctx: CCEncodingContext): Promise<Bytes> {\n this.payload = Bytes.from([this.setpointType & 0b1111]);\n return super.serialize(ctx);\n }\n public toLogEntry(ctx?: GetValueDB): MessageOrCCLogEntry {\n return {\n ...super.toLogEntry(ctx),\n message: {\n \"setpoint type\": getEnumMemberName(HumidityControlSetpointType, this.setpointType),\n },\n };\n }\n}\n"],
5
- "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,qBAAgC;AAEhC,kBAA8Y;AAC9Y,oBAA+C;AAC/C,iBAAwJ;AACxJ,0BAAkJ;AAClJ,oCAAiI;AAEjI,mBAA0J;AAE1J,gCAAgD;AAThD,MAAM,EAAE,+CAA+C,+CAA+C,2DAA2D,6DAA4D,IAAK;AAWlO,SAAS,SAAS,OAAa;AAC3B,aAAO,2BAAc,YAAY,KAAY,SAAK,6BAAgB,KAAK;AAC3E;AAFS;AAGT,SAAS,gBAAgB,OAAa;AAClC,SAAO,SAAS,KAAK,EAAE,QAAQ;AACnC;AAFS;IAII,gCAA4B,MAAA;8BADxC,mCAAI,2BAAe,2BAA2B,CAAC,CAAC;;;;oBACC;;;;;;oDAAA,YAAK;WAAA;;;;;;;;yBA8ClD,8CAA6C,CAAE;yBAoB/C,8CAA6C,CAAE;qCAY/C,0DAAyD,CAAE;wCA2B3D,6DAA4D,CAAE;AA1D/D,qCAAA,MAAA,MAAA,iBAAA,EAAA,MAAA,UAAA,MAAA,OAAA,QAAA,OAAA,SAAA,OAAA,QAAA,EAAA,KAAA,gCAAA,SAAA,KAAA,QAAA,KAAA,gCAAA,IAAa,KAAb,OAAgB,GAAA,UAAA,UAAA,GAAA,MAAA,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D,aAAa,GAAG,KAAK,QAAQ,IAAI,cAAc,IAAI;;;IAG/D;;;;IAQS,4CAAwC,MAAA;8BAFpD,yCAAU,4CAA+B,eAAe,OACxD,kDAAmB,2CAA2C,CAAC;;;;oBACF;gEAAA,YAAyB;WAAA;;;;;;;;AAAvF,qCAAA,MAAA,mBAAA,EAAA,OAAA,WAAA,GAAA,kBAAA,EAAA,MAAA,SAAA,MAAA,WAAA,MAAA,UAAA,UAAA,GAAA,MAAA,uBAAA;;;AAAa,0CAAA,YAAA,uBAAA;;IACT,YAAmB,SAAqE;AACpF,YAAM,OAAO;AACb,WAAK,eAAe,QAAQ;IAChC;IACO,OAAO,KAAK,MAAa,MAAsB;AAElD,YAAM,IAAI,uBAAW,GAAG,KAAK,IAAI,qCAAqC,4BAAgB,8BAA8B;IAIxH;IACO;IACA,UAAU,KAAsB;AACnC,WAAK,UAAU,oBAAM,KAAK,CAAC,KAAK,eAAe,EAAM,CAAC;AACtD,aAAO,MAAM,UAAU,GAAG;IAC9B;IACO,WAAW,KAAgB;AAC9B,aAAO;QACH,GAAG,MAAM,WAAW,GAAG;QACvB,SAAS;UACL,qBAAiB,iCAAkB,0CAA6B,KAAK,YAAY;;;IAG7F;;;;",
4
+ "sourcesContent": ["import * as __validateArgs from \"./HumidityControlSetpointCC._validateArgs.js\";\nconst { validateArgs_HumidityControlSetpointCCAPI_get, validateArgs_HumidityControlSetpointCCAPI_set, validateArgs_HumidityControlSetpointCCAPI_getCapabilities, validateArgs_HumidityControlSetpointCCAPI_getSupportedScales } = __validateArgs;\nimport { CommandClasses, type GetValueDB, type MaybeNotKnown, type MessageOrCCLogEntry, MessagePriority, type Scale, type SupervisionResult, ValueMetadata, type ValueMetadataNumeric, type WithAddress, ZWaveError, ZWaveErrorCodes, encodeFloatWithScale, getNamedScale, getUnknownScale, logDict, logList, logText, parseBitMask, parseFloatWithScale, supervisedCommandSucceeded, validatePayload, } from \"@zwave-js/core\";\nimport { Bytes, getEnumMemberName, pick } from \"@zwave-js/shared\";\nimport { CCAPI, POLL_VALUE, type PollValueImplementation, SET_VALUE, type SetValueImplementation, throwUnsupportedProperty, throwWrongValueType, } from \"../lib/API.js\";\nimport { type CCRaw, CommandClass, type InterviewContext, type PersistValuesContext, type RefreshValuesContext, type RefreshValuesOptions, } from \"../lib/CommandClass.js\";\nimport { API, CCCommand, ccValueProperty, ccValues, commandClass, expectedCCResponse, implementedVersion, useSupervision, } from \"../lib/CommandClassDecorators.js\";\nimport { V } from \"../lib/Values.js\";\nimport { type HumidityControlSetpointCapabilities, HumidityControlSetpointCommand, HumidityControlSetpointType, type HumidityControlSetpointValue, } from \"../lib/_Types.js\";\nimport type { CCEncodingContext, CCParsingContext } from \"../lib/traits.js\";\nimport { HumidityControlSetpointCCValues } from \"./_CCValues.generated.js\";\nexport { HumidityControlSetpointCCValues };\nfunction getScale(scale: number): Scale {\n return getNamedScale(\"humidity\", scale as any) ?? getUnknownScale(scale);\n}\nfunction getSetpointUnit(scale: number): string {\n return getScale(scale).unit ?? \"\";\n}\n@API(CommandClasses[\"Humidity Control Setpoint\"])\nexport class HumidityControlSetpointCCAPI extends CCAPI {\n public supportsCommand(cmd: HumidityControlSetpointCommand): MaybeNotKnown<boolean> {\n switch (cmd) {\n case HumidityControlSetpointCommand.Get:\n case HumidityControlSetpointCommand.SupportedGet:\n case HumidityControlSetpointCommand.CapabilitiesGet:\n return this.isSinglecast();\n case HumidityControlSetpointCommand.Set:\n return true; // This is mandatory\n }\n return super.supportsCommand(cmd);\n }\n protected override get [SET_VALUE](): SetValueImplementation {\n return async function (this: HumidityControlSetpointCCAPI, { property, propertyKey }, value) {\n if (property !== \"setpoint\") {\n throwUnsupportedProperty(this.ccId, property);\n }\n if (typeof propertyKey !== \"number\") {\n throw new ZWaveError(`${CommandClasses[this.ccId]}: \"${property}\" must be further specified by a numeric property key`, ZWaveErrorCodes.Argument_Invalid);\n }\n if (typeof value !== \"number\") {\n throwWrongValueType(this.ccId, property, \"number\", typeof value);\n }\n const scaleValueId = HumidityControlSetpointCCValues.setpointScale(propertyKey).endpoint(this.endpoint.index);\n const preferredScale = this.tryGetValueDB()?.getValue<number>(scaleValueId);\n const result = await this.set(propertyKey, value, preferredScale ?? 0);\n // Verify the change after a delay, unless the command was supervised and successful\n if (this.isSinglecast() && !supervisedCommandSucceeded(result)) {\n this.schedulePoll({ property, propertyKey }, value);\n }\n return result;\n };\n }\n protected get [POLL_VALUE](): PollValueImplementation {\n return async function (this: HumidityControlSetpointCCAPI, { property, propertyKey }) {\n switch (property) {\n case \"setpoint\":\n if (typeof propertyKey !== \"number\") {\n throw new ZWaveError(`${CommandClasses[this.ccId]}: \"${property}\" must be further specified by a numeric property key`, ZWaveErrorCodes.Argument_Invalid);\n }\n return (await this.get(propertyKey))?.value;\n default:\n throwUnsupportedProperty(this.ccId, property);\n }\n };\n }\n @validateArgs_HumidityControlSetpointCCAPI_get()\n public async get(setpointType: HumidityControlSetpointType): Promise<MaybeNotKnown<HumidityControlSetpointValue>> {\n this.assertSupportsCommand(HumidityControlSetpointCommand, HumidityControlSetpointCommand.Get);\n const cc = new HumidityControlSetpointCCGet({\n nodeId: this.endpoint.nodeId,\n endpointIndex: this.endpoint.index,\n setpointType,\n });\n const response = await this.host.sendCommand<HumidityControlSetpointCCReport>(cc, this.commandOptions);\n if (!response)\n return;\n return response.type === HumidityControlSetpointType[\"N/A\"]\n ? // not supported\n undefined\n : // supported\n {\n value: response.value,\n scale: response.scale,\n };\n }\n @validateArgs_HumidityControlSetpointCCAPI_set()\n public async set(setpointType: HumidityControlSetpointType, value: number, scale: number): Promise<SupervisionResult | undefined> {\n this.assertSupportsCommand(HumidityControlSetpointCommand, HumidityControlSetpointCommand.Set);\n const cc = new HumidityControlSetpointCCSet({\n nodeId: this.endpoint.nodeId,\n endpointIndex: this.endpoint.index,\n setpointType,\n value,\n scale,\n });\n return this.host.sendCommand(cc, this.commandOptions);\n }\n @validateArgs_HumidityControlSetpointCCAPI_getCapabilities()\n public async getCapabilities(setpointType: HumidityControlSetpointType): Promise<MaybeNotKnown<HumidityControlSetpointCapabilities>> {\n this.assertSupportsCommand(HumidityControlSetpointCommand, HumidityControlSetpointCommand.CapabilitiesGet);\n const cc = new HumidityControlSetpointCCCapabilitiesGet({\n nodeId: this.endpoint.nodeId,\n endpointIndex: this.endpoint.index,\n setpointType,\n });\n const response = await this.host.sendCommand<HumidityControlSetpointCCCapabilitiesReport>(cc, this.commandOptions);\n if (response) {\n return pick(response, [\n \"minValue\",\n \"maxValue\",\n \"minValueScale\",\n \"maxValueScale\",\n ]);\n }\n }\n public async getSupportedSetpointTypes(): Promise<MaybeNotKnown<readonly HumidityControlSetpointType[]>> {\n this.assertSupportsCommand(HumidityControlSetpointCommand, HumidityControlSetpointCommand.SupportedGet);\n const cc = new HumidityControlSetpointCCSupportedGet({\n nodeId: this.endpoint.nodeId,\n endpointIndex: this.endpoint.index,\n });\n const response = await this.host.sendCommand<HumidityControlSetpointCCSupportedReport>(cc, this.commandOptions);\n return response?.supportedSetpointTypes;\n }\n @validateArgs_HumidityControlSetpointCCAPI_getSupportedScales()\n public async getSupportedScales(setpointType: HumidityControlSetpointType): Promise<MaybeNotKnown<readonly Scale[]>> {\n this.assertSupportsCommand(HumidityControlSetpointCommand, HumidityControlSetpointCommand.SupportedGet);\n const cc = new HumidityControlSetpointCCScaleSupportedGet({\n nodeId: this.endpoint.nodeId,\n endpointIndex: this.endpoint.index,\n setpointType,\n });\n const response = await this.host.sendCommand<HumidityControlSetpointCCScaleSupportedReport>(cc, this.commandOptions);\n if (response) {\n return response.supportedScales.map((scale) => getScale(scale));\n }\n }\n}\n@commandClass(CommandClasses[\"Humidity Control Setpoint\"])\n@implementedVersion(2)\n@ccValues(HumidityControlSetpointCCValues)\nexport class HumidityControlSetpointCC extends CommandClass {\n declare ccCommand: HumidityControlSetpointCommand;\n public translatePropertyKey(ctx: GetValueDB, property: string | number, propertyKey: string | number): string | undefined {\n if (property === \"setpoint\") {\n return getEnumMemberName(HumidityControlSetpointType, propertyKey as any);\n }\n else {\n return super.translatePropertyKey(ctx, property, propertyKey);\n }\n }\n public async interview(ctx: InterviewContext): Promise<void> {\n const node = this.getNode(ctx)!;\n const endpoint = this.getEndpoint(ctx)!;\n const api = CCAPI.create(CommandClasses[\"Humidity Control Setpoint\"], ctx, endpoint).withOptions({\n priority: MessagePriority.NodeQuery,\n tag: \"interview\",\n });\n ctx.logNode(node.id, {\n endpoint: this.endpointIndex,\n message: `Interviewing ${this.ccName}...`,\n direction: \"none\",\n });\n // Query the supported setpoint types\n let setpointTypes: HumidityControlSetpointType[] = [];\n ctx.logNode(node.id, {\n endpoint: this.endpointIndex,\n message: \"retrieving supported setpoint types...\",\n direction: \"outbound\",\n });\n const resp = await api.getSupportedSetpointTypes();\n if (resp) {\n setpointTypes = [...resp];\n ctx.logNode(node.id, {\n endpoint: this.endpointIndex,\n message: logText(\"received supported setpoint types:\", {\n nested: logList(setpointTypes.map((type) => getEnumMemberName(HumidityControlSetpointType, type))),\n }),\n direction: \"inbound\",\n });\n }\n else {\n ctx.logNode(node.id, {\n endpoint: this.endpointIndex,\n message: \"Querying supported setpoint types timed out, skipping interview...\",\n level: \"warn\",\n });\n return;\n }\n for (const type of setpointTypes) {\n const setpointName = getEnumMemberName(HumidityControlSetpointType, type);\n // Find out the capabilities of this setpoint\n ctx.logNode(node.id, {\n endpoint: this.endpointIndex,\n message: `retrieving capabilities for setpoint ${setpointName}...`,\n direction: \"outbound\",\n });\n const setpointScaleSupported = await api.getSupportedScales(type);\n if (setpointScaleSupported) {\n ctx.logNode(node.id, {\n endpoint: this.endpointIndex,\n message: logText(`received supported scales for setpoint ${setpointName}:`, {\n nested: logList(setpointScaleSupported.map((t) => `${t.key} ${t.unit} - ${t.label}`)),\n }),\n direction: \"inbound\",\n });\n const scaleValue = HumidityControlSetpointCCValues.setpointScale(type);\n const states: Record<number, string> = {};\n for (const scale of setpointScaleSupported) {\n if (scale.unit)\n states[scale.key] = scale.unit;\n }\n this.setMetadata(ctx, scaleValue, {\n ...scaleValue.meta,\n states,\n });\n }\n const setpointCaps = await api.getCapabilities(type);\n if (setpointCaps) {\n const minValueUnit = getSetpointUnit(setpointCaps.minValueScale);\n const maxValueUnit = getSetpointUnit(setpointCaps.maxValueScale);\n ctx.logNode(node.id, {\n endpoint: this.endpointIndex,\n message: logText(`received capabilities for setpoint ${setpointName}:`, {\n nested: logDict({\n \"minimum value\": `${setpointCaps.minValue} ${minValueUnit}`,\n \"maximum value\": `${setpointCaps.maxValue} ${maxValueUnit}`,\n }),\n }),\n direction: \"inbound\",\n });\n }\n }\n // Query the current value for all setpoint types\n await this.refreshValues(ctx, { tag: \"interview\" });\n // Remember that the interview is complete\n this.setInterviewComplete(ctx, true);\n }\n public async refreshValues(ctx: RefreshValuesContext, options?: RefreshValuesOptions): Promise<void> {\n const node = this.getNode(ctx)!;\n const endpoint = this.getEndpoint(ctx)!;\n const api = CCAPI.create(CommandClasses[\"Humidity Control Setpoint\"], ctx, endpoint).withOptions({\n priority: options?.priority ?? MessagePriority.NodeQuery,\n tag: options?.tag,\n });\n const setpointTypes: HumidityControlSetpointType[] = this.getValue(ctx, HumidityControlSetpointCCValues.supportedSetpointTypes) ?? [];\n // Query each setpoint's current value\n for (const type of setpointTypes) {\n const setpointName = getEnumMemberName(HumidityControlSetpointType, type);\n // Every time, query the current value\n ctx.logNode(node.id, {\n endpoint: this.endpointIndex,\n message: `querying current value of setpoint ${setpointName}...`,\n direction: \"outbound\",\n });\n const setpoint = await api.get(type);\n if (setpoint) {\n const logMessage = `received current value of setpoint ${setpointName}: ${setpoint.value} ${getScale(setpoint.scale).unit ?? \"\"}`;\n ctx.logNode(node.id, {\n endpoint: this.endpointIndex,\n message: logMessage,\n direction: \"inbound\",\n });\n }\n }\n }\n}\n// @publicAPI\nexport interface HumidityControlSetpointCCSetOptions {\n setpointType: HumidityControlSetpointType;\n value: number;\n scale: number;\n}\n@CCCommand(HumidityControlSetpointCommand.Set)\n@useSupervision()\nexport class HumidityControlSetpointCCSet extends HumidityControlSetpointCC {\n public constructor(options: WithAddress<HumidityControlSetpointCCSetOptions>) {\n super(options);\n this.setpointType = options.setpointType;\n this.value = options.value;\n this.scale = options.scale;\n }\n public static from(_raw: CCRaw, _ctx: CCParsingContext): HumidityControlSetpointCCSet {\n // TODO: Deserialize payload\n throw new ZWaveError(`${this.name}: deserialization not implemented`, ZWaveErrorCodes.Deserialization_NotImplemented);\n // return new HumidityControlSetpointCCSet({\n // \tnodeId: ctx.sourceNodeId,\n // });\n }\n public setpointType: HumidityControlSetpointType;\n public value: number;\n public scale: number;\n public serialize(ctx: CCEncodingContext): Promise<Bytes> {\n this.payload = Bytes.concat([\n [this.setpointType & 0b1111],\n encodeFloatWithScale(this.value, this.scale),\n ]);\n return super.serialize(ctx);\n }\n public toLogEntry(ctx?: GetValueDB): MessageOrCCLogEntry {\n const scale = getScale(this.scale);\n return {\n ...super.toLogEntry(ctx),\n message: {\n \"setpoint type\": getEnumMemberName(HumidityControlSetpointType, this.setpointType),\n value: `${this.value} ${scale.unit}`,\n },\n };\n }\n}\n// @publicAPI\nexport interface HumidityControlSetpointCCReportOptions {\n type: HumidityControlSetpointType;\n scale: number;\n value: number;\n}\n@CCCommand(HumidityControlSetpointCommand.Report)\nexport class HumidityControlSetpointCCReport extends HumidityControlSetpointCC {\n public constructor(options: WithAddress<HumidityControlSetpointCCReportOptions>) {\n super(options);\n // TODO: Check implementation:\n this.type = options.type;\n this.value = options.value;\n this.scale = options.scale;\n }\n public static from(raw: CCRaw, ctx: CCParsingContext): HumidityControlSetpointCCReport {\n validatePayload(raw.payload.length >= 1);\n const type: HumidityControlSetpointType = raw.payload[0] & 0b1111;\n // Setpoint type 0 is not defined in the spec, prevent devices from using it.\n if (type === 0) {\n // Not supported\n return new this({\n nodeId: ctx.sourceNodeId,\n type,\n value: 0,\n scale: 0,\n });\n }\n // parseFloatWithScale does its own validation\n const { value, scale } = parseFloatWithScale(raw.payload.subarray(1));\n return new this({\n nodeId: ctx.sourceNodeId,\n type,\n value,\n scale,\n });\n }\n public persistValues(ctx: PersistValuesContext): boolean {\n if (!super.persistValues(ctx))\n return false;\n const scale = getScale(this.scale);\n const setpointValue = HumidityControlSetpointCCValues.setpoint(this.type);\n const existingMetadata = this.getMetadata<ValueMetadataNumeric>(ctx, setpointValue);\n // Update the metadata when it is missing or the unit has changed\n if (existingMetadata?.unit !== scale.unit) {\n this.setMetadata(ctx, setpointValue, {\n ...(existingMetadata ?? setpointValue.meta),\n unit: scale.unit,\n });\n }\n this.setValue(ctx, setpointValue, this.value);\n // Remember the device-preferred setpoint scale so it can be used in SET commands\n this.setValue(ctx, HumidityControlSetpointCCValues.setpointScale(this.type), this.scale);\n return true;\n }\n public type: HumidityControlSetpointType;\n public scale: number;\n public value: number;\n public toLogEntry(ctx?: GetValueDB): MessageOrCCLogEntry {\n const scale = getScale(this.scale);\n return {\n ...super.toLogEntry(ctx),\n message: {\n \"setpoint type\": getEnumMemberName(HumidityControlSetpointType, this.type),\n value: `${this.value} ${scale.unit}`,\n },\n };\n }\n}\nfunction testResponseForHumidityControlSetpointGet(sent: HumidityControlSetpointCCGet, received: HumidityControlSetpointCCReport) {\n // We expect a Humidity Control Setpoint Report that matches the requested setpoint type\n return received.type === sent.setpointType;\n}\n// @publicAPI\nexport interface HumidityControlSetpointCCGetOptions {\n setpointType: HumidityControlSetpointType;\n}\n@CCCommand(HumidityControlSetpointCommand.Get)\n@expectedCCResponse(HumidityControlSetpointCCReport, testResponseForHumidityControlSetpointGet)\nexport class HumidityControlSetpointCCGet extends HumidityControlSetpointCC {\n public constructor(options: WithAddress<HumidityControlSetpointCCGetOptions>) {\n super(options);\n this.setpointType = options.setpointType;\n }\n public static from(_raw: CCRaw, _ctx: CCParsingContext): HumidityControlSetpointCCGet {\n // TODO: Deserialize payload\n throw new ZWaveError(`${this.name}: deserialization not implemented`, ZWaveErrorCodes.Deserialization_NotImplemented);\n // return new HumidityControlSetpointCCGet({\n // \tnodeId: ctx.sourceNodeId,\n // });\n }\n public setpointType: HumidityControlSetpointType;\n public serialize(ctx: CCEncodingContext): Promise<Bytes> {\n this.payload = Bytes.from([this.setpointType & 0b1111]);\n return super.serialize(ctx);\n }\n public toLogEntry(ctx?: GetValueDB): MessageOrCCLogEntry {\n return {\n ...super.toLogEntry(ctx),\n message: {\n \"setpoint type\": getEnumMemberName(HumidityControlSetpointType, this.setpointType),\n },\n };\n }\n}\n// @publicAPI\nexport interface HumidityControlSetpointCCSupportedReportOptions {\n supportedSetpointTypes: HumidityControlSetpointType[];\n}\n@CCCommand(HumidityControlSetpointCommand.SupportedReport)\n@ccValueProperty(\"supportedSetpointTypes\", HumidityControlSetpointCCValues.supportedSetpointTypes)\nexport class HumidityControlSetpointCCSupportedReport extends HumidityControlSetpointCC {\n public constructor(options: WithAddress<HumidityControlSetpointCCSupportedReportOptions>) {\n super(options);\n // TODO: Check implementation:\n this.supportedSetpointTypes = options.supportedSetpointTypes;\n }\n public static from(raw: CCRaw, ctx: CCParsingContext): HumidityControlSetpointCCSupportedReport {\n validatePayload(raw.payload.length >= 1);\n const supportedSetpointTypes: HumidityControlSetpointType[] = parseBitMask(raw.payload, HumidityControlSetpointType[\"N/A\"]);\n return new this({\n nodeId: ctx.sourceNodeId,\n supportedSetpointTypes,\n });\n }\n public readonly supportedSetpointTypes: readonly HumidityControlSetpointType[];\n public toLogEntry(ctx?: GetValueDB): MessageOrCCLogEntry {\n return {\n ...super.toLogEntry(ctx),\n message: {\n \"supported setpoint types\": logList(this.supportedSetpointTypes.map((t) => getEnumMemberName(HumidityControlSetpointType, t))),\n },\n };\n }\n}\n@CCCommand(HumidityControlSetpointCommand.SupportedGet)\n@expectedCCResponse(HumidityControlSetpointCCSupportedReport)\nexport class HumidityControlSetpointCCSupportedGet extends HumidityControlSetpointCC {\n}\n// @publicAPI\nexport interface HumidityControlSetpointCCScaleSupportedReportOptions {\n supportedScales: number[];\n}\n@CCCommand(HumidityControlSetpointCommand.ScaleSupportedReport)\nexport class HumidityControlSetpointCCScaleSupportedReport extends HumidityControlSetpointCC {\n public constructor(options: WithAddress<HumidityControlSetpointCCScaleSupportedReportOptions>) {\n super(options);\n // TODO: Check implementation:\n this.supportedScales = options.supportedScales;\n }\n public static from(raw: CCRaw, ctx: CCParsingContext): HumidityControlSetpointCCScaleSupportedReport {\n validatePayload(raw.payload.length >= 1);\n const supportedScales = parseBitMask(Bytes.from([raw.payload[0] & 0b1111]), 0);\n return new this({\n nodeId: ctx.sourceNodeId,\n supportedScales,\n });\n }\n public readonly supportedScales: readonly number[];\n public toLogEntry(ctx?: GetValueDB): MessageOrCCLogEntry {\n const supportedScales = this.supportedScales.map((scale) => getScale(scale));\n return {\n ...super.toLogEntry(ctx),\n message: {\n \"scale supported\": logList(supportedScales.map((t) => `${t.key} ${t.unit} - ${t.label}`)),\n },\n };\n }\n}\n// @publicAPI\nexport interface HumidityControlSetpointCCScaleSupportedGetOptions {\n setpointType: HumidityControlSetpointType;\n}\n@CCCommand(HumidityControlSetpointCommand.ScaleSupportedGet)\n@expectedCCResponse(HumidityControlSetpointCCScaleSupportedReport)\nexport class HumidityControlSetpointCCScaleSupportedGet extends HumidityControlSetpointCC {\n public constructor(options: WithAddress<HumidityControlSetpointCCScaleSupportedGetOptions>) {\n super(options);\n this.setpointType = options.setpointType;\n }\n public static from(_raw: CCRaw, _ctx: CCParsingContext): HumidityControlSetpointCCScaleSupportedGet {\n // TODO: Deserialize payload\n throw new ZWaveError(`${this.name}: deserialization not implemented`, ZWaveErrorCodes.Deserialization_NotImplemented);\n // return new HumidityControlSetpointCCScaleSupportedGet({\n // \tnodeId: ctx.sourceNodeId,\n // });\n }\n public setpointType: HumidityControlSetpointType;\n public serialize(ctx: CCEncodingContext): Promise<Bytes> {\n this.payload = Bytes.from([this.setpointType & 0b1111]);\n return super.serialize(ctx);\n }\n public toLogEntry(ctx?: GetValueDB): MessageOrCCLogEntry {\n return {\n ...super.toLogEntry(ctx),\n message: {\n \"setpoint type\": getEnumMemberName(HumidityControlSetpointType, this.setpointType),\n },\n };\n }\n}\n// @publicAPI\nexport interface HumidityControlSetpointCCCapabilitiesReportOptions {\n type: HumidityControlSetpointType;\n minValue: number;\n maxValue: number;\n minValueScale: number;\n maxValueScale: number;\n}\n@CCCommand(HumidityControlSetpointCommand.CapabilitiesReport)\nexport class HumidityControlSetpointCCCapabilitiesReport extends HumidityControlSetpointCC {\n public constructor(options: WithAddress<HumidityControlSetpointCCCapabilitiesReportOptions>) {\n super(options);\n this.type = options.type;\n this.minValue = options.minValue;\n this.maxValue = options.maxValue;\n this.minValueScale = options.minValueScale;\n this.maxValueScale = options.maxValueScale;\n }\n public static from(raw: CCRaw, ctx: CCParsingContext): HumidityControlSetpointCCCapabilitiesReport {\n validatePayload(raw.payload.length >= 1);\n const type: HumidityControlSetpointType = raw.payload[0] & 0b1111;\n // parseFloatWithScale does its own validation\n const { value: minValue, scale: minValueScale, bytesRead, } = parseFloatWithScale(raw.payload.subarray(1));\n const { value: maxValue, scale: maxValueScale } = parseFloatWithScale(raw.payload.subarray(1 + bytesRead));\n return new this({\n nodeId: ctx.sourceNodeId,\n type,\n minValue,\n minValueScale,\n maxValue,\n maxValueScale,\n });\n }\n public persistValues(ctx: PersistValuesContext): boolean {\n if (!super.persistValues(ctx))\n return false;\n // Predefine the metadata\n const setpointValue = HumidityControlSetpointCCValues.setpoint(this.type);\n this.setMetadata(ctx, setpointValue, {\n ...setpointValue.meta,\n min: this.minValue,\n max: this.maxValue,\n unit: getSetpointUnit(this.minValueScale)\n || getSetpointUnit(this.maxValueScale),\n });\n return true;\n }\n public type: HumidityControlSetpointType;\n public minValue: number;\n public maxValue: number;\n public minValueScale: number;\n public maxValueScale: number;\n public toLogEntry(ctx?: GetValueDB): MessageOrCCLogEntry {\n const minValueScale = getScale(this.minValueScale);\n const maxValueScale = getScale(this.maxValueScale);\n return {\n ...super.toLogEntry(ctx),\n message: {\n \"setpoint type\": getEnumMemberName(HumidityControlSetpointType, this.type),\n \"min value\": `${this.minValue} ${minValueScale.unit}`,\n \"max value\": `${this.maxValue} ${maxValueScale.unit}`,\n },\n };\n }\n}\n// @publicAPI\nexport interface HumidityControlSetpointCCCapabilitiesGetOptions {\n setpointType: HumidityControlSetpointType;\n}\n@CCCommand(HumidityControlSetpointCommand.CapabilitiesGet)\n@expectedCCResponse(HumidityControlSetpointCCCapabilitiesReport)\nexport class HumidityControlSetpointCCCapabilitiesGet extends HumidityControlSetpointCC {\n public constructor(options: WithAddress<HumidityControlSetpointCCCapabilitiesGetOptions>) {\n super(options);\n this.setpointType = options.setpointType;\n }\n public static from(_raw: CCRaw, _ctx: CCParsingContext): HumidityControlSetpointCCCapabilitiesGet {\n // TODO: Deserialize payload\n throw new ZWaveError(`${this.name}: deserialization not implemented`, ZWaveErrorCodes.Deserialization_NotImplemented);\n // return new HumidityControlSetpointCCCapabilitiesGet({\n // \tnodeId: ctx.sourceNodeId,\n // });\n }\n public setpointType: HumidityControlSetpointType;\n public serialize(ctx: CCEncodingContext): Promise<Bytes> {\n this.payload = Bytes.from([this.setpointType & 0b1111]);\n return super.serialize(ctx);\n }\n public toLogEntry(ctx?: GetValueDB): MessageOrCCLogEntry {\n return {\n ...super.toLogEntry(ctx),\n message: {\n \"setpoint type\": getEnumMemberName(HumidityControlSetpointType, this.setpointType),\n },\n };\n }\n}\n"],
5
+ "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,qBAAgC;AAEhC,kBAA8Y;AAC9Y,oBAA+C;AAC/C,iBAAwJ;AACxJ,0BAAkJ;AAClJ,oCAAiI;AAEjI,mBAA0J;AAE1J,gCAAgD;AAThD,MAAM,EAAE,+CAA+C,+CAA+C,2DAA2D,6DAA4D,IAAK;AAWlO,SAAS,SAAS,OAAa;AAC3B,aAAO,2BAAc,YAAY,KAAY,SAAK,6BAAgB,KAAK;AAC3E;AAFS;AAGT,SAAS,gBAAgB,OAAa;AAClC,SAAO,SAAS,KAAK,EAAE,QAAQ;AACnC;A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ues(ctx) {
796
796
  if (!super.persistValues(ctx))
797
797
  return false;
798
+ const ccVersion = (0, import_CommandClass.getEffectiveCCVersion)(ctx, this);
798
799
  if (this.indicator0Value != void 0) {
799
800
  if (!this.supportsV2Indicators(ctx)) {
800
801
  const valueV1 = import_CCValues_generated.IndicatorCCValues.valueV1;
@@ -809,7 +810,7 @@ let IndicatorCCReport = (() => {
809
810
  });
810
811
  }
811
812
  }
812
- } else if (this.values) {
813
+ } else if (this.values && ccVersion >= 2) {
813
814
  for (const value of this.values) {
814
815
  this.setIndicatorValue(ctx, value);
815
816
  }
@@ -819,7 +820,7 @@ let IndicatorCCReport = (() => {
819
820
  const filteredValues = values.filter((v) => supportedPropertyIDs.includes(v.propertyId));
820
821
  const overrideIndicatorLabel = this.getManufacturerDefinedIndicatorLabel(ctx, indicatorId);
821
822
  const timeout = indicatorObjectsToTimeout(filteredValues);
822
- if (timeout) {
823
+ if (timeout && ccVersion >= 3) {
823
824
  let timeoutString = "";
824
825
  if (timeout?.hours)
825
826
  timeoutString += `${timeout.hours}h`;
@@ -1015,11 +1016,7 @@ let IndicatorCCSupportedReport = (() => {
1015
1016
  serialize(ctx) {
1016
1017
  const bitmask = this.supportedProperties.length > 0 ? (0, import_core.encodeBitMask)(this.supportedProperties, void 0, 0) : new import_shared.Bytes();
1017
1018
  this.payload = import_shared.Bytes.concat([
1018
- [
1019
- this.indicatorId,
1020
- this.nextIndicatorId,
1021
- bitmask.length
1022
- ],
1019
+ [this.indicatorId, this.nextIndicatorId, bitmask.length],
1023
1020
  bitmask
1024
1021
  ]);
1025
1022
  return super.serialize(ctx);
@@ -1131,7 +1128,7 @@ let IndicatorCCDescriptionReport = (() => {
1131
1128
  persistValues(ctx) {
1132
1129
  if (!super.persistValues(ctx))
1133
1130
  return false;
1134
- if (this.description) {
1131
+ if (this.description && (0, import_CommandClass.getEffectiveCCVersion)(ctx, this) >= 4) {
1135
1132
  this.setValue(ctx, import_CCValues_generated.IndicatorCCValues.indicatorDescription(this.indicatorId), this.description);
1136
1133
  }
1137
1134
  return true;
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../src_gen/cc/IndicatorCC.ts"],
4
- "sourcesContent": ["import * as __validateArgs from \"./IndicatorCC._validateArgs.js\";\nconst { validateArgs_IndicatorCCAPI_get, validateArgs_IndicatorCCAPI_set, validateArgs_IndicatorCCAPI_sendReport, validateArgs_IndicatorCCAPI_getSupported, validateArgs_IndicatorCCAPI_reportSupported, validateArgs_IndicatorCCAPI_reportDescription, validateArgs_IndicatorCCAPI_setTimeout, validateArgs_IndicatorCCAPI_getTimeout, validateArgs_IndicatorCCAPI_getDescription } = __validateArgs;\nimport { CommandClasses, type EndpointId, type GetValueDB, Indicator, type MaybeNotKnown, type MessageOrCCLogEntry, MessagePriority, type MessageRecord, type SupervisionResult, type ValueID, ValueMetadata, type WithAddress, ZWaveError, ZWaveErrorCodes, encodeBitMask, getIndicatorProperty, parseBitMask, validatePayload, } from \"@zwave-js/core\";\nimport { Bytes, getEnumMemberName, num2hex } from \"@zwave-js/shared\";\nimport { clamp, roundTo } from \"alcalzone-shared/math\";\nimport { isArray } from \"alcalzone-shared/typeguards\";\nimport { CCAPI, POLL_VALUE, type PollValueImplementation, SET_VALUE, type SetValueImplementation, throwUnsupportedProperty, throwWrongValueType, } from \"../lib/API.js\";\nimport { type CCRaw, CommandClass, type InterviewContext, type PersistValuesContext, type RefreshValuesContext, type RefreshValuesOptions, } from \"../lib/CommandClass.js\";\nimport { API, CCCommand, ccValues, commandClass, expectedCCResponse, implementedVersion, useSupervision, } from \"../lib/CommandClassDecorators.js\";\nimport { V } from \"../lib/Values.js\";\nimport { IndicatorCommand, type IndicatorTimeout } from \"../lib/_Types.js\";\nimport type { CCEncodingContext, CCParsingContext } from \"../lib/traits.js\";\nfunction isManufacturerDefinedIndicator(indicatorId: number): boolean {\n return indicatorId >= 0x80 && indicatorId <= 0x9f;\n}\nconst timeoutStringRegex = /^(?:(?<hoursStr>\\d+)h)?(?:(?<minutesStr>\\d+)m)?(?:(?<secondsStr>\\d+(?:\\.\\d+)?)s)?$/i;\nconst MAX_INDICATOR_OBJECTS = 31;\nfunction parseIndicatorTimeoutString(text: string): IndicatorTimeout | undefined {\n if (!text.length)\n return undefined;\n // Try to parse the numeric parts from a timeout\n const match = timeoutStringRegex.exec(text);\n if (!match)\n return undefined;\n const { hoursStr, minutesStr, secondsStr } = match.groups!;\n if (!hoursStr && !minutesStr && !secondsStr)\n return undefined;\n const ret: IndicatorTimeout = {};\n if (hoursStr) {\n ret.hours = clamp(parseInt(hoursStr, 10), 0, 255);\n }\n if (minutesStr) {\n ret.minutes = clamp(parseInt(minutesStr, 10), 0, 255);\n }\n if (secondsStr) {\n ret.seconds = clamp(roundTo(parseFloat(secondsStr), 2), 0, 59.99);\n }\n return ret;\n}\nfunction groupByIndicatorId(values: IndicatorObject[]): Map<number, IndicatorObject[]> {\n const ret = new Map();\n for (const value of values) {\n if (!ret.has(value.indicatorId)) {\n ret.set(value.indicatorId, []);\n }\n ret.get(value.indicatorId)!.push(value);\n }\n return ret;\n}\nfunction indicatorObjectsToTimeout(values: IndicatorObject[]): IndicatorTimeout | undefined {\n const timeoutValues = values.filter((v) => [0x0a, 0x06, 0x07, 0x08].includes(v.propertyId));\n if (!timeoutValues.length)\n return undefined;\n const hours = (timeoutValues.find((v) => v.propertyId === 0x0a)?.value\n ?? 0) as number;\n const minutes = (timeoutValues.find((v) => v.propertyId === 0x06)?.value\n ?? 0) as number;\n const seconds = clamp((timeoutValues.find((v) => v.propertyId === 0x07)\n ?.value as number) ?? 0, 0, 59)\n + clamp((timeoutValues.find((v) => v.propertyId === 0x08)\n ?.value as number) ?? 0, 0, 99)\n / 100;\n return {\n hours,\n minutes,\n seconds,\n };\n}\nimport { IndicatorCCValues } from \"./_CCValues.generated.js\";\nexport { IndicatorCCValues };\n/**\n * Looks up the configured metadata for the given indicator and property\n */\nfunction getIndicatorMetadata(indicatorId: Indicator, propertyId: number, overrideIndicatorLabel?: string): ValueMetadata {\n const label = getIndicatorLabel(indicatorId, propertyId, overrideIndicatorLabel);\n const prop = getIndicatorProperty(propertyId);\n const baseMetadata = IndicatorCCValues.valueV2(indicatorId, propertyId).meta;\n if (!prop) {\n return {\n ...baseMetadata,\n ...ValueMetadata.UInt8,\n label,\n };\n }\n else {\n if (prop.type === \"boolean\") {\n return {\n ...baseMetadata,\n ...ValueMetadata.Boolean,\n label,\n description: prop.description,\n readable: !prop.readonly,\n };\n }\n else {\n // UInt8\n return {\n ...baseMetadata,\n ...ValueMetadata.UInt8,\n label,\n description: prop.description,\n min: prop.min,\n max: prop.max,\n readable: !prop.readonly,\n };\n }\n }\n}\nfunction getIndicatorName(indicatorId: number | undefined): string {\n if (indicatorId) {\n return getEnumMemberName(Indicator, indicatorId);\n }\n else {\n return \"Default\";\n }\n}\n/** Returns a user-friendly label for an indicator */\nfunction getIndicatorLabel(indicatorId: number, propertyId: number, overrideIndicatorLabel?: string, overridePropertyLabel?: string): string {\n const defaultName = overrideIndicatorLabel || getIndicatorName(indicatorId);\n // Without a defined property, we cannot suggest a better label\n const prop = getIndicatorProperty(propertyId);\n if (!prop)\n return defaultName;\n // For indicators that correspond to an LCD or buttons,\n // the indicator enum names are enough\n if (indicatorId >= Indicator[\"LCD backlight\"]\n && indicatorId <= Indicator[\"Button 12 indication\"]\n && (propertyId === 0x01 /* Multilevel */\n || propertyId === 0x02 /* Binary */\n || overridePropertyLabel) // custom property label\n ) {\n let ret: string = (Indicator as any)[indicatorId];\n // Append the overridden property label if it exists\n if (overridePropertyLabel) {\n ret += ` - ${overridePropertyLabel}`;\n }\n return ret;\n }\n // Default to the current behavior of <indicator name> - <property label>\n return `${defaultName} - ${overridePropertyLabel || prop.label}`;\n}\nexport function shouldExposeIndicatorValue(indicatorId: number, propertyId: number): boolean {\n // Many possible indicator values are not suitable to be exposed as CC values,\n // usually because they need to be set in groups.\n // Indicator properties that should be exposed are marked as such\n const prop = getIndicatorProperty(propertyId);\n if (prop && !prop.exposeAsValue) {\n return false;\n }\n // Unless we know better, expose anyways\n return true;\n}\n@API(CommandClasses.Indicator)\nexport class IndicatorCCAPI extends CCAPI {\n public supportsCommand(cmd: IndicatorCommand): MaybeNotKnown<boolean> {\n switch (cmd) {\n case IndicatorCommand.Get:\n case IndicatorCommand.Report:\n return this.isSinglecast();\n case IndicatorCommand.Set:\n return true; // This is mandatory\n case IndicatorCommand.SupportedGet:\n case IndicatorCommand.SupportedReport:\n return this.version >= 2 && this.isSinglecast();\n case IndicatorCommand.DescriptionGet:\n case IndicatorCommand.DescriptionReport:\n return this.version >= 4 && this.isSinglecast();\n }\n return super.supportsCommand(cmd);\n }\n protected override get [SET_VALUE](): SetValueImplementation {\n return async function (this: IndicatorCCAPI, { property, propertyKey }, value) {\n const valueId: ValueID = {\n commandClass: this.ccId,\n endpoint: this.endpoint.index,\n property,\n propertyKey,\n };\n if (property === \"value\") {\n // V1 value\n if (typeof value !== \"number\") {\n throwWrongValueType(this.ccId, property, \"number\", typeof value);\n }\n return this.set(value);\n }\n else if (IndicatorCCValues.valueV2.is(valueId)) {\n const indicatorId = property as number;\n const propertyId = propertyKey as number;\n const expectedType = getIndicatorMetadata(indicatorId, propertyId).type as \"number\" | \"boolean\";\n // V2+ value\n if (typeof value !== expectedType) {\n throwWrongValueType(this.ccId, property, expectedType, typeof value);\n }\n return this.set([\n {\n indicatorId,\n propertyId,\n value: value as any,\n },\n ]);\n }\n else if (IndicatorCCValues.timeout.is(valueId)) {\n const indicatorId = property as number;\n if (typeof value !== \"string\") {\n throwWrongValueType(this.ccId, property, \"string\", typeof value);\n }\n return this.setTimeout(indicatorId, value);\n }\n else if (IndicatorCCValues.identify.is(valueId)) {\n if (typeof value !== \"boolean\") {\n throwWrongValueType(this.ccId, property, \"boolean\", typeof value);\n }\n return this.identify();\n }\n else {\n throwUnsupportedProperty(this.ccId, property);\n }\n };\n }\n protected get [POLL_VALUE](): PollValueImplementation {\n return async function (this: IndicatorCCAPI, { property }) {\n if (property === \"value\")\n return this.get();\n if (typeof property === \"number\") {\n return this.get(property);\n }\n throwUnsupportedProperty(this.ccId, property);\n };\n }\n @validateArgs_IndicatorCCAPI_get()\n public async get(indicatorId?: number): Promise<MaybeNotKnown<number | IndicatorObject[]>> {\n this.assertSupportsCommand(IndicatorCommand, IndicatorCommand.Get);\n const cc = new IndicatorCCGet({\n nodeId: this.endpoint.nodeId,\n endpointIndex: this.endpoint.index,\n indicatorId,\n });\n const response = await this.host.sendCommand<IndicatorCCReport>(cc, this.commandOptions);\n if (!response)\n return;\n if (response.values)\n return response.values;\n return response.indicator0Value!;\n }\n @validateArgs_IndicatorCCAPI_set()\n public async set(value: number | IndicatorObject[]): Promise<SupervisionResult | undefined> {\n this.assertSupportsCommand(IndicatorCommand, IndicatorCommand.Set);\n if (this.version === 1 && typeof value !== \"number\") {\n throw new ZWaveError(`Node ${this.endpoint\n .nodeId as number} only supports IndicatorCC V1 which requires a single value to be set`, ZWaveErrorCodes.Argument_Invalid);\n }\n else if (this.version >= 2\n && isArray(value)\n && value.length > MAX_INDICATOR_OBJECTS) {\n throw new ZWaveError(`Only ${MAX_INDICATOR_OBJECTS} indicator values can be set at a time!`, ZWaveErrorCodes.Argument_Invalid);\n }\n const cc = new IndicatorCCSet({\n nodeId: this.endpoint.nodeId,\n endpointIndex: this.endpoint.index,\n ...(typeof value === \"number\" ? { value } : { values: value }),\n });\n return this.host.sendCommand(cc, this.commandOptions);\n }\n @validateArgs_IndicatorCCAPI_sendReport()\n public async sendReport(options: IndicatorCCReportOptions): Promise<void> {\n this.assertSupportsCommand(IndicatorCommand, IndicatorCommand.Report);\n const cc = new IndicatorCCReport({\n nodeId: this.endpoint.nodeId,\n endpointIndex: this.endpoint.index,\n ...options,\n });\n await this.host.sendCommand(cc, this.commandOptions);\n }\n @validateArgs_IndicatorCCAPI_getSupported()\n public async getSupported(indicatorId: number): Promise<{\n indicatorId?: number;\n supportedProperties: readonly number[];\n nextIndicatorId: number;\n } | undefined> {\n this.assertSupportsCommand(IndicatorCommand, IndicatorCommand.SupportedGet);\n const cc = new IndicatorCCSupportedGet({\n nodeId: this.endpoint.nodeId,\n endpointIndex: this.endpoint.index,\n indicatorId,\n });\n const response = await this.host.sendCommand<IndicatorCCSupportedReport>(cc, this.commandOptions);\n if (response) {\n return {\n // Include the actual indicator ID if 0x00 was requested\n ...(indicatorId === 0x00\n ? { indicatorId: response.indicatorId }\n : undefined),\n supportedProperties: response.supportedProperties,\n nextIndicatorId: response.nextIndicatorId,\n };\n }\n }\n @validateArgs_IndicatorCCAPI_reportSupported()\n public async reportSupported(indicatorId: number, supportedProperties: readonly number[], nextIndicatorId: number): Promise<void> {\n this.assertSupportsCommand(IndicatorCommand, IndicatorCommand.SupportedReport);\n const cc = new IndicatorCCSupportedReport({\n nodeId: this.endpoint.nodeId,\n endpointIndex: this.endpoint.index,\n indicatorId,\n supportedProperties,\n nextIndicatorId,\n });\n await this.host.sendCommand(cc, this.commandOptions);\n }\n @validateArgs_IndicatorCCAPI_reportDescription()\n public async reportDescription(indicatorId: number, description: string): Promise<void> {\n this.assertSupportsCommand(IndicatorCommand, IndicatorCommand.DescriptionReport);\n const cc = new IndicatorCCDescriptionReport({\n nodeId: this.endpoint.nodeId,\n endpointIndex: this.endpoint.index,\n indicatorId,\n description,\n });\n await this.host.sendCommand(cc, this.commandOptions);\n }\n /**\n * Instructs the node to identify itself. Available starting with V3 of this CC.\n */\n public async identify(): Promise<SupervisionResult | undefined> {\n if (this.version < 3) {\n throw new ZWaveError(`The identify command is only supported in Indicator CC version 3 and above`, ZWaveErrorCodes.CC_NotSupported);\n }\n return this.set([\n {\n indicatorId: 0x50,\n propertyId: 0x03,\n value: 0x08,\n },\n {\n indicatorId: 0x50,\n propertyId: 0x04,\n value: 0x03,\n },\n {\n indicatorId: 0x50,\n propertyId: 0x05,\n value: 0x06,\n },\n ]);\n }\n /**\n * Set a timeout for a given indicator ID after which the indicator will be turned off.\n * @param timeout The timeout in one of the supported forms:\n * \t- a timeout string in the form `12h18m17.59s`. All parts (hours, minutes, seconds, hundredths) are optional, but must be specified in this order. An empty string will be treated like `undefined`.\n * \t- an object specifying the timeout parts. An empty object will be treated like `undefined`.\n * \t- `undefined` to disable the timeout.\n */\n @validateArgs_IndicatorCCAPI_setTimeout()\n public async setTimeout(indicatorId: number, timeout: IndicatorTimeout | string | undefined): Promise<SupervisionResult | undefined> {\n this.assertPhysicalEndpoint(this.endpoint);\n if (this.version < 3) {\n throw new ZWaveError(`The setTimeout command is only supported in Indicator CC version 3 and above`, ZWaveErrorCodes.CC_NotSupported);\n }\n if (typeof timeout === \"string\") {\n if (timeout === \"\") {\n timeout = undefined;\n }\n else {\n const parsed = parseIndicatorTimeoutString(timeout);\n if (!parsed) {\n throw new ZWaveError(`The timeout string \"${timeout}\" is not valid`, ZWaveErrorCodes.Argument_Invalid);\n }\n timeout = parsed;\n }\n }\n const supportedPropertyIDs = IndicatorCC.getSupportedPropertyIDsCached(this.host, this.endpoint, indicatorId);\n const objects: IndicatorObject[] = [];\n if (timeout) {\n const hours = timeout.hours ?? 0;\n const minutes = timeout.minutes ?? 0;\n const seconds = Math.floor(timeout.seconds ?? 0);\n const hundredths = Math.round(((timeout.seconds ?? 0) % 1) * 100);\n if (hours) {\n if (!supportedPropertyIDs?.includes(0x0a)) {\n throw new ZWaveError(`The indicator ${indicatorId} does not support setting the timeout in hours`, ZWaveErrorCodes.Argument_Invalid);\n }\n objects.push({\n indicatorId,\n propertyId: 0x0a,\n value: hours,\n });\n }\n if (minutes) {\n if (!supportedPropertyIDs?.includes(0x06)) {\n throw new ZWaveError(`The indicator ${indicatorId} does not support setting the timeout in minutes`, ZWaveErrorCodes.Argument_Invalid);\n }\n objects.push({\n indicatorId,\n propertyId: 0x06,\n value: minutes,\n });\n }\n if (seconds) {\n if (!supportedPropertyIDs?.includes(0x07)) {\n throw new ZWaveError(`The indicator ${indicatorId} does not support setting the timeout in seconds`, ZWaveErrorCodes.Argument_Invalid);\n }\n objects.push({\n indicatorId,\n propertyId: 0x07,\n value: seconds,\n });\n }\n if (hundredths) {\n if (!supportedPropertyIDs?.includes(0x08)) {\n throw new ZWaveError(`The indicator ${indicatorId} does not support setting the timeout in 1/100 seconds`, ZWaveErrorCodes.Argument_Invalid);\n }\n objects.push({\n indicatorId,\n propertyId: 0x08,\n value: hundredths,\n });\n }\n }\n if (!objects.length) {\n objects.push(...(supportedPropertyIDs ?? []).map((p) => ({\n indicatorId,\n propertyId: p,\n value: 0,\n })));\n }\n return this.set(objects);\n }\n /**\n * Returns the timeout after which the given indicator will be turned off.\n */\n @validateArgs_IndicatorCCAPI_getTimeout()\n public async getTimeout(indicatorId: number): Promise<MaybeNotKnown<IndicatorTimeout>> {\n const values = await this.get(indicatorId);\n if (!isArray(values))\n return;\n return indicatorObjectsToTimeout(values);\n }\n @validateArgs_IndicatorCCAPI_getDescription()\n public async getDescription(indicatorId: number): Promise<MaybeNotKnown<string>> {\n this.assertSupportsCommand(IndicatorCommand, IndicatorCommand.DescriptionGet);\n const cc = new IndicatorCCDescriptionGet({\n nodeId: this.endpoint.nodeId,\n endpointIndex: this.endpoint.index,\n indicatorId,\n });\n const response = await this.host.sendCommand<IndicatorCCDescriptionReport>(cc, this.commandOptions);\n return response?.description;\n }\n}\n@commandClass(CommandClasses.Indicator)\n@implementedVersion(4)\n@ccValues(IndicatorCCValues)\nexport class IndicatorCC extends CommandClass {\n declare ccCommand: IndicatorCommand;\n public async interview(ctx: InterviewContext): Promise<void> {\n const node = this.getNode(ctx)!;\n const endpoint = this.getEndpoint(ctx)!;\n const api = CCAPI.create(CommandClasses.Indicator, ctx, endpoint).withOptions({\n priority: MessagePriority.NodeQuery,\n tag: \"interview\",\n });\n ctx.logNode(node.id, {\n endpoint: this.endpointIndex,\n message: `Interviewing ${this.ccName}...`,\n direction: \"none\",\n });\n if (api.version > 1) {\n ctx.logNode(node.id, {\n endpoint: this.endpointIndex,\n message: \"scanning supported indicator IDs...\",\n direction: \"outbound\",\n });\n // Query ID 0 to get the first supported ID\n let curId = 0x00;\n const supportedIndicatorIds: number[] = [];\n do {\n const supportedResponse = await api.getSupported(curId);\n if (!supportedResponse) {\n ctx.logNode(node.id, {\n endpoint: this.endpointIndex,\n message: \"Time out while scanning supported indicator IDs, skipping interview...\",\n level: \"warn\",\n });\n return;\n }\n if (supportedResponse.supportedProperties.length > 0) {\n supportedIndicatorIds.push(supportedResponse.indicatorId ?? curId);\n }\n curId = supportedResponse.nextIndicatorId;\n } while (curId !== 0x00);\n // The IDs are not stored by the report CCs so store them here once we have all of them\n this.setValue(ctx, IndicatorCCValues.supportedIndicatorIds, supportedIndicatorIds);\n const logMessage = `supported indicator IDs: ${supportedIndicatorIds.join(\", \")}`;\n ctx.logNode(node.id, {\n endpoint: this.endpointIndex,\n message: logMessage,\n direction: \"inbound\",\n });\n if (api.version >= 4) {\n const manufacturerDefinedIndicatorIds = supportedIndicatorIds\n .filter((id) => isManufacturerDefinedIndicator(id));\n if (manufacturerDefinedIndicatorIds.length > 0) {\n ctx.logNode(node.id, {\n endpoint: this.endpointIndex,\n message: \"retrieving description for manufacturer-defined indicator IDs...\",\n direction: \"outbound\",\n });\n for (const [i, id] of manufacturerDefinedIndicatorIds\n .entries()) {\n await api.getDescription(id);\n node.reportInterviewProgress(i + 1, manufacturerDefinedIndicatorIds.length);\n }\n }\n }\n }\n // Query current values\n await this.refreshValues(ctx, {\n tag: \"interview\",\n onProgress: (completed, total) => node.reportInterviewProgress(completed, total),\n });\n // Remember that the interview is complete\n this.setInterviewComplete(ctx, true);\n }\n public async refreshValues(ctx: RefreshValuesContext, options?: RefreshValuesOptions): Promise<void> {\n const node = this.getNode(ctx)!;\n const endpoint = this.getEndpoint(ctx)!;\n const api = CCAPI.create(CommandClasses.Indicator, ctx, endpoint).withOptions({\n priority: options?.priority ?? MessagePriority.NodeQuery,\n tag: options?.tag,\n });\n if (api.version === 1) {\n ctx.logNode(node.id, {\n endpoint: this.endpointIndex,\n message: \"requesting current indicator value...\",\n direction: \"outbound\",\n });\n await api.get();\n }\n else {\n const supportedIndicatorIds: number[] = this.getValue(ctx, IndicatorCCValues.supportedIndicatorIds) ?? [];\n for (const [i, indicatorId] of supportedIndicatorIds.entries()) {\n ctx.logNode(node.id, {\n endpoint: this.endpointIndex,\n message: `requesting current indicator value (id = ${num2hex(indicatorId)})...`,\n direction: \"outbound\",\n });\n await api.get(indicatorId);\n options?.onProgress?.(i + 1, supportedIndicatorIds.length);\n }\n }\n }\n public translatePropertyKey(ctx: GetValueDB, property: string | number, propertyKey: string | number): string | undefined {\n if (property === \"value\") {\n // CC version 1 only has a single value that doesn't need to be translated\n return undefined;\n }\n else if (typeof property === \"number\"\n && typeof propertyKey === \"number\") {\n // The indicator property is our property key\n const prop = getIndicatorProperty(propertyKey);\n if (prop)\n return prop.label;\n }\n else if (typeof property === \"number\"\n && propertyKey === \"timeout\") {\n return \"Timeout\";\n }\n return super.translatePropertyKey(ctx, property, propertyKey);\n }\n public translateProperty(ctx: GetValueDB, property: string | number, propertyKey?: string | number): string {\n if (typeof property === \"number\") {\n if (typeof propertyKey === \"number\" || propertyKey === \"timeout\") {\n // The indicator corresponds to our property\n if (property in Indicator)\n return Indicator[property];\n }\n }\n return super.translateProperty(ctx, property, propertyKey);\n }\n protected supportsV2Indicators(ctx: GetValueDB): boolean {\n // First test if there are any indicator ids defined\n const supportedIndicatorIds = this.getValue<number[]>(ctx, IndicatorCCValues.supportedIndicatorIds);\n if (!supportedIndicatorIds?.length)\n return false;\n // Then test if there are any property ids defined\n return supportedIndicatorIds.some((indicatorId) => !!this.getValue<number[]>(ctx, IndicatorCCValues.supportedPropertyIDs(indicatorId))?.length);\n }\n protected getManufacturerDefinedIndicatorLabel(ctx: GetValueDB, indicatorId: number): string | undefined {\n if (isManufacturerDefinedIndicator(indicatorId)) {\n return this.getValue(ctx, IndicatorCCValues.indicatorDescription(indicatorId));\n }\n }\n public static getSupportedPropertyIDsCached(ctx: GetValueDB, endpoint: EndpointId, indicatorId: number): MaybeNotKnown<number[]> {\n return ctx\n .getValueDB(endpoint.nodeId)\n .getValue(IndicatorCCValues.supportedPropertyIDs(indicatorId).endpoint(endpoint.index));\n }\n}\n// @publicAPI\nexport interface IndicatorObject {\n indicatorId: number;\n propertyId: number;\n value: number | boolean;\n}\n// @publicAPI\nexport type IndicatorCCSetOptions = {\n value: number;\n} | {\n values: IndicatorObject[];\n};\n@CCCommand(IndicatorCommand.Set)\n@useSupervision()\nexport class IndicatorCCSet extends IndicatorCC {\n public constructor(options: WithAddress<IndicatorCCSetOptions>) {\n super(options);\n if (\"value\" in options) {\n this.indicator0Value = options.value;\n }\n else {\n this.values = options.values;\n }\n }\n public static from(raw: CCRaw, ctx: CCParsingContext): IndicatorCCSet {\n validatePayload(raw.payload.length >= 1);\n const objCount = raw.payload.length >= 2\n ? raw.payload[1] & 0b11111\n : 0;\n if (objCount === 0) {\n const indicator0Value = raw.payload[0];\n return new this({\n nodeId: ctx.sourceNodeId,\n value: indicator0Value,\n });\n }\n validatePayload(raw.payload.length >= 2 + 3 * objCount);\n const values: IndicatorObject[] = [];\n for (let i = 0; i < objCount; i++) {\n const offset = 2 + 3 * i;\n const value: IndicatorObject = {\n indicatorId: raw.payload[offset],\n propertyId: raw.payload[offset + 1],\n value: raw.payload[offset + 2],\n };\n values.push(value);\n }\n return new this({\n nodeId: ctx.sourceNodeId,\n values,\n });\n }\n public indicator0Value: number | undefined;\n public values: IndicatorObject[] | undefined;\n public serialize(ctx: CCEncodingContext): Promise<Bytes> {\n if (this.values != undefined) {\n // V2+\n this.payload = Bytes.alloc(2 + 3 * this.values.length, 0);\n // Byte 0 is the legacy value\n const objCount = this.values.length & MAX_INDICATOR_OBJECTS;\n this.payload[1] = objCount;\n for (let i = 0; i < objCount; i++) {\n const offset = 2 + 3 * i;\n this.payload[offset] = this.values[i].indicatorId;\n this.payload[offset + 1] = this.values[i].propertyId;\n const value = this.values[i].value;\n this.payload[offset + 2] = value === true\n ? 0xff\n : value === false\n ? 0x00\n : value;\n }\n }\n else {\n // V1\n this.payload = Bytes.from([this.indicator0Value ?? 0]);\n }\n return super.serialize(ctx);\n }\n public toLogEntry(ctx?: GetValueDB): MessageOrCCLogEntry {\n const message: MessageRecord = {};\n if (this.indicator0Value != undefined) {\n message[\"indicator 0 value\"] = this.indicator0Value;\n }\n if (this.values != undefined) {\n message.values = this.values\n .map((v) => `\n\u00B7 indicatorId: ${v.indicatorId}\n propertyId: ${v.propertyId}\n value: ${v.value}`)\n .join(\"\");\n }\n return {\n ...super.toLogEntry(ctx),\n message,\n };\n }\n}\n// @publicAPI\nexport type IndicatorCCReportOptions = {\n value: number;\n} | {\n values: IndicatorObject[];\n};\n@CCCommand(IndicatorCommand.Report)\nexport class IndicatorCCReport extends IndicatorCC {\n public constructor(options: WithAddress<IndicatorCCReportOptions>) {\n super(options);\n if (\"value\" in options) {\n this.indicator0Value = options.value;\n }\n else if (\"values\" in options) {\n if (options.values.length > MAX_INDICATOR_OBJECTS) {\n throw new ZWaveError(`Only ${MAX_INDICATOR_OBJECTS} indicator values can be set at a time!`, ZWaveErrorCodes.Argument_Invalid);\n }\n this.values = options.values;\n }\n }\n public static from(raw: CCRaw, ctx: CCParsingContext): IndicatorCCReport {\n validatePayload(raw.payload.length >= 1);\n const objCount = raw.payload.length >= 2\n ? raw.payload[1] & 0b11111\n : 0;\n if (objCount === 0) {\n const indicator0Value = raw.payload[0];\n return new this({\n nodeId: ctx.sourceNodeId,\n value: indicator0Value,\n });\n }\n validatePayload(raw.payload.length >= 2 + 3 * objCount);\n const values: IndicatorObject[] = [];\n for (let i = 0; i < objCount; i++) {\n const offset = 2 + 3 * i;\n const value: IndicatorObject = {\n indicatorId: raw.payload[offset],\n propertyId: raw.payload[offset + 1],\n value: raw.payload[offset + 2],\n };\n values.push(value);\n }\n return new this({\n nodeId: ctx.sourceNodeId,\n values,\n });\n // TODO: Think if we want this:\n // // If not all Property IDs are included in the command for the actual Indicator ID,\n // // a controlling node MUST assume non-specified Property IDs values to be 0x00.\n // const indicatorId = this.values[0].indicatorId;\n // const supportedIndicatorProperties =\n // \tvalueDB.getValue<number[]>(\n // \t\tgetSupportedPropertyIDsValueID(\n // \t\t\tthis.endpointIndex,\n // \t\t\tindicatorId,\n // \t\t),\n // \t) ?? [];\n // // Find out which ones are missing\n // const missingIndicatorProperties = supportedIndicatorProperties.filter(\n // \tprop =>\n // \t\t!this.values!.find(({ propertyId }) => prop === propertyId),\n // );\n // // And assume they are 0 (false)\n // for (const missing of missingIndicatorProperties) {\n // \tthis.setIndicatorValue({\n // \t\tindicatorId,\n // \t\tpropertyId: missing,\n // \t\tvalue: 0,\n // \t});\n // }\n }\n public persistValues(ctx: PersistValuesContext): boolean {\n if (!super.persistValues(ctx))\n return false;\n if (this.indicator0Value != undefined) {\n if (!this.supportsV2Indicators(ctx)) {\n // Publish the value\n const valueV1 = IndicatorCCValues.valueV1;\n this.setMetadata(ctx, valueV1);\n this.setValue(ctx, valueV1, this.indicator0Value);\n }\n else {\n if (this.isSinglecast()) {\n // Don't!\n ctx.logNode(this.nodeId, {\n message: `ignoring V1 indicator report because the node supports V2 indicators`,\n direction: \"none\",\n endpoint: this.endpointIndex,\n });\n }\n }\n }\n else if (this.values) {\n // Store the simple values first\n for (const value of this.values) {\n this.setIndicatorValue(ctx, value);\n }\n // Then group values into the convenience properties\n const groupedValues = groupByIndicatorId(this.values);\n for (const [indicatorId, values] of groupedValues) {\n // Some devices report all properties it supports in every report,\n // even if it does not support all properties for the given indicator ID.\n // To avoid confusion, we need to filter out the unsupported properties\n const supportedPropertyIDs = this.getValue<number[]>(ctx, IndicatorCCValues.supportedPropertyIDs(indicatorId)) ?? [];\n const filteredValues = values.filter((v) => supportedPropertyIDs.includes(v.propertyId));\n const overrideIndicatorLabel = this\n .getManufacturerDefinedIndicatorLabel(ctx, indicatorId);\n // ... timeout\n const timeout = indicatorObjectsToTimeout(filteredValues);\n if (timeout) {\n let timeoutString = \"\";\n if (timeout?.hours)\n timeoutString += `${timeout.hours}h`;\n if (timeout?.minutes) {\n timeoutString += `${timeout.minutes}m`;\n }\n if (timeout?.seconds) {\n timeoutString += `${timeout.seconds}s`;\n }\n const timeoutValue = IndicatorCCValues.timeout(indicatorId);\n const metadata: ValueMetadata = {\n ...timeoutValue.meta,\n label: getIndicatorLabel(indicatorId, 0x06, // This is actually ignored, but pass a valid ID for clarity\n overrideIndicatorLabel, \"Timeout\"),\n };\n this.setMetadata(ctx, timeoutValue, metadata);\n this.setValue(ctx, timeoutValue, timeoutString);\n }\n }\n }\n return true;\n }\n public readonly indicator0Value: number | undefined;\n public readonly values: IndicatorObject[] | undefined;\n private setIndicatorValue(ctx: GetValueDB, value: IndicatorObject): void {\n // Manufacturer-defined indicators may need a custom label\n const overrideIndicatorLabel = this\n .getManufacturerDefinedIndicatorLabel(ctx, value.indicatorId);\n const metadata = getIndicatorMetadata(value.indicatorId, value.propertyId, overrideIndicatorLabel);\n // Some values need to be converted\n if (metadata.type === \"boolean\") {\n value.value = !!value.value;\n }\n // Only expose the value if it should be user-facing\n if (value.indicatorId === Indicator[\"Node Identify\"]) {\n return;\n }\n const prop = getIndicatorProperty(value.propertyId);\n if (!prop?.exposeAsValue)\n return;\n // And only if it is actually supported and not just reported by accident\n const supportedPropertyIDs = this.getValue<number[]>(ctx, IndicatorCCValues.supportedPropertyIDs(value.indicatorId)) ?? [];\n if (!supportedPropertyIDs.includes(value.propertyId))\n return;\n // Publish the value\n const valueV2 = IndicatorCCValues.valueV2(value.indicatorId, value.propertyId);\n this.setMetadata(ctx, valueV2, metadata);\n this.setValue(ctx, valueV2, value.value);\n }\n public serialize(ctx: CCEncodingContext): Promise<Bytes> {\n if (this.values != undefined) {\n // V2+\n this.payload = Bytes.alloc(2 + 3 * this.values.length, 0);\n // Byte 0 is the legacy value\n const objCount = this.values.length & MAX_INDICATOR_OBJECTS;\n this.payload[1] = objCount;\n for (let i = 0; i < objCount; i++) {\n const offset = 2 + 3 * i;\n this.payload[offset] = this.values[i].indicatorId;\n this.payload[offset + 1] = this.values[i].propertyId;\n const value = this.values[i].value;\n this.payload[offset + 2] = value === true\n ? 0xff\n : value === false\n ? 0x00\n : value;\n }\n }\n else {\n // V1\n this.payload = Bytes.from([this.indicator0Value ?? 0]);\n }\n return super.serialize(ctx);\n }\n public toLogEntry(ctx?: GetValueDB): MessageOrCCLogEntry {\n const message: MessageRecord = {};\n if (this.indicator0Value != undefined) {\n message[\"indicator 0 value\"] = this.indicator0Value;\n }\n if (this.values != undefined) {\n message.values = this.values\n .map((v) => `\n\u00B7 indicatorId: ${v.indicatorId}\n propertyId: ${v.propertyId}\n value: ${v.value}`)\n .join(\"\");\n }\n return {\n ...super.toLogEntry(ctx),\n message,\n };\n }\n}\n// @publicAPI\nexport interface IndicatorCCGetOptions {\n indicatorId?: number;\n}\n@CCCommand(IndicatorCommand.Get)\n@expectedCCResponse(IndicatorCCReport)\nexport class IndicatorCCGet extends IndicatorCC {\n public constructor(options: WithAddress<IndicatorCCGetOptions>) {\n super(options);\n this.indicatorId = options.indicatorId;\n }\n public static from(raw: CCRaw, ctx: CCParsingContext): IndicatorCCGet {\n let indicatorId: number | undefined;\n if (raw.payload.length > 0) {\n indicatorId = raw.payload[0];\n }\n return new this({\n nodeId: ctx.sourceNodeId,\n indicatorId,\n });\n }\n public indicatorId: number | undefined;\n public serialize(ctx: CCEncodingContext): Promise<Bytes> {\n if (this.indicatorId != undefined) {\n this.payload = Bytes.from([this.indicatorId]);\n }\n return super.serialize(ctx);\n }\n public toLogEntry(ctx?: GetValueDB): MessageOrCCLogEntry {\n return {\n ...super.toLogEntry(ctx),\n message: {\n indicator: getIndicatorName(this.indicatorId),\n },\n };\n }\n}\n// @publicAPI\nexport interface IndicatorCCSupportedReportOptions {\n indicatorId: number;\n nextIndicatorId: number;\n supportedProperties: readonly number[];\n}\n@CCCommand(IndicatorCommand.SupportedReport)\nexport class IndicatorCCSupportedReport extends IndicatorCC {\n public constructor(options: WithAddress<IndicatorCCSupportedReportOptions>) {\n super(options);\n this.indicatorId = options.indicatorId;\n this.nextIndicatorId = options.nextIndicatorId;\n this.supportedProperties = options.supportedProperties;\n }\n public static from(raw: CCRaw, ctx: CCParsingContext): IndicatorCCSupportedReport {\n validatePayload(raw.payload.length >= 3);\n const indicatorId = raw.payload[0];\n const nextIndicatorId = raw.payload[1];\n const bitMaskLength = raw.payload[2] & 0b11111;\n let supportedProperties: readonly number[];\n if (bitMaskLength === 0) {\n supportedProperties = [];\n }\n else {\n validatePayload(raw.payload.length >= 3 + bitMaskLength);\n // The bit mask starts at 0, but bit 0 is not used\n supportedProperties = parseBitMask(raw.payload.subarray(3, 3 + bitMaskLength), 0).filter((v) => v !== 0);\n }\n return new this({\n nodeId: ctx.sourceNodeId,\n indicatorId,\n nextIndicatorId,\n supportedProperties,\n });\n }\n public persistValues(ctx: PersistValuesContext): boolean {\n if (!super.persistValues(ctx))\n return false;\n if (this.indicatorId !== 0x00) {\n // Remember which property IDs are supported\n this.setValue(ctx, IndicatorCCValues.supportedPropertyIDs(this.indicatorId), this.supportedProperties);\n }\n return true;\n }\n public readonly indicatorId: number;\n public readonly nextIndicatorId: number;\n public readonly supportedProperties: readonly number[];\n public serialize(ctx: CCEncodingContext): Promise<Bytes> {\n const bitmask = this.supportedProperties.length > 0\n ? encodeBitMask(this.supportedProperties, undefined, 0)\n : new Bytes();\n this.payload = Bytes.concat([\n [\n this.indicatorId,\n this.nextIndicatorId,\n bitmask.length,\n ],\n bitmask,\n ]);\n return super.serialize(ctx);\n }\n public toLogEntry(ctx?: GetValueDB): MessageOrCCLogEntry {\n return {\n ...super.toLogEntry(ctx),\n message: {\n indicator: getIndicatorName(this.indicatorId),\n \"supported properties\": this.supportedProperties\n .map((id) => getIndicatorProperty(id)?.label\n ?? `Unknown (${num2hex(id)})`)\n .join(\", \"),\n \"next indicator\": getIndicatorName(this.nextIndicatorId),\n },\n };\n }\n}\n// @publicAPI\nexport interface IndicatorCCSupportedGetOptions {\n indicatorId: number;\n}\nfunction testResponseForIndicatorSupportedGet(sent: IndicatorCCSupportedGet, received: IndicatorCCSupportedReport) {\n return sent.indicatorId === 0 || received.indicatorId === sent.indicatorId;\n}\n@CCCommand(IndicatorCommand.SupportedGet)\n@expectedCCResponse(IndicatorCCSupportedReport, testResponseForIndicatorSupportedGet)\nexport class IndicatorCCSupportedGet extends IndicatorCC {\n public constructor(options: WithAddress<IndicatorCCSupportedGetOptions>) {\n super(options);\n this.indicatorId = options.indicatorId;\n }\n public static from(raw: CCRaw, ctx: CCParsingContext): IndicatorCCSupportedGet {\n validatePayload(raw.payload.length >= 1);\n const indicatorId = raw.payload[0];\n return new this({\n nodeId: ctx.sourceNodeId,\n indicatorId,\n });\n }\n public indicatorId: number;\n public serialize(ctx: CCEncodingContext): Promise<Bytes> {\n this.payload = Bytes.from([this.indicatorId]);\n return super.serialize(ctx);\n }\n public toLogEntry(ctx?: GetValueDB): MessageOrCCLogEntry {\n return {\n ...super.toLogEntry(ctx),\n message: {\n indicator: getIndicatorName(this.indicatorId),\n },\n };\n }\n}\n// @publicAPI\nexport interface IndicatorCCDescriptionReportOptions {\n indicatorId: number;\n description: string;\n}\n@CCCommand(IndicatorCommand.DescriptionReport)\nexport class IndicatorCCDescriptionReport extends IndicatorCC {\n public constructor(options: WithAddress<IndicatorCCDescriptionReportOptions>) {\n super(options);\n this.indicatorId = options.indicatorId;\n this.description = options.description;\n }\n public static from(raw: CCRaw, ctx: CCParsingContext): IndicatorCCDescriptionReport {\n validatePayload(raw.payload.length >= 2);\n const indicatorId = raw.payload[0];\n const descrptionLength = raw.payload[1];\n validatePayload(raw.payload.length >= 2 + descrptionLength);\n const description: string = raw.payload\n .subarray(2, 2 + descrptionLength)\n .toString(\"utf8\");\n return new this({\n nodeId: ctx.sourceNodeId,\n indicatorId,\n description,\n });\n }\n public indicatorId: number;\n public description: string;\n public persistValues(ctx: PersistValuesContext): boolean {\n if (!super.persistValues(ctx))\n return false;\n if (this.description) {\n this.setValue(ctx, IndicatorCCValues.indicatorDescription(this.indicatorId), this.description);\n }\n return true;\n }\n public serialize(ctx: CCEncodingContext): Promise<Bytes> {\n const description = Bytes.from(this.description, \"utf8\");\n this.payload = Bytes.concat([\n [this.indicatorId, description.length],\n description,\n ]);\n return super.serialize(ctx);\n }\n public toLogEntry(ctx?: GetValueDB): MessageOrCCLogEntry {\n return {\n ...super.toLogEntry(ctx),\n message: {\n \"indicator ID\": this.indicatorId,\n description: this.description || \"(none)\",\n },\n };\n }\n}\n// @publicAPI\nexport interface IndicatorCCDescriptionGetOptions {\n indicatorId: number;\n}\nfunction testResponseForIndicatorDescriptionGet(sent: IndicatorCCDescriptionGet, received: IndicatorCCDescriptionReport) {\n return received.indicatorId === sent.indicatorId;\n}\n@CCCommand(IndicatorCommand.DescriptionGet)\n@expectedCCResponse(IndicatorCCDescriptionReport, testResponseForIndicatorDescriptionGet)\nexport class IndicatorCCDescriptionGet extends IndicatorCC {\n public constructor(options: WithAddress<IndicatorCCDescriptionGetOptions>) {\n super(options);\n this.indicatorId = options.indicatorId;\n }\n public static from(raw: CCRaw, ctx: CCParsingContext): IndicatorCCDescriptionGet {\n validatePayload(raw.payload.length >= 1);\n const indicatorId = raw.payload[0];\n return new this({\n nodeId: ctx.sourceNodeId,\n indicatorId,\n });\n }\n public indicatorId: number;\n public serialize(ctx: CCEncodingContext): Promise<Bytes> {\n this.payload = Bytes.from([this.indicatorId]);\n return super.serialize(ctx);\n }\n public toLogEntry(ctx?: GetValueDB): MessageOrCCLogEntry {\n return {\n ...super.toLogEntry(ctx),\n message: {\n \"indicator ID\": this.indicatorId,\n },\n };\n }\n}\n"],
5
- "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,qBAAgC;AAEhC,kBAAwU;AACxU,oBAAkD;AAClD,kBAA+B;AAC/B,wBAAwB;AACxB,iBAAwJ;AACxJ,0BAAkJ;AAClJ,oCAAgH;AAEhH,mBAAwD;AA0DxD,gCAAkC;AAnElC,MAAM,EAAE,iCAAi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,aAAO;QACH,GAAG,MAAM,WAAW,GAAG;QACvB,SAAS;UACL,gBAAgB,KAAK;UACrB,aAAa,KAAK,eAAe;;;IAG7C;;;;AAMJ,SAAS,uCAAuC,MAAiC,UAAsC;AACnH,SAAO,SAAS,gBAAgB,KAAK;AACzC;AAFS;IAKI,6BAAyB,MAAA;8BAFrC,yCAAU,8BAAiB,cAAc,OACzC,kDAAmB,8BAA8B,sCAAsC,CAAC;;;;oBAC1C;iDAAA,YAAW;WAAA;;;;;;;;AAA1D,qCAAA,MAAA,mBAAA,EAAA,OAAA,WAAA,GAAA,kBAAA,EAAA,MAAA,SAAA,MAAA,WAAA,MAAA,UAAA,UAAA,GAAA,MAAA,uBAAA;;;AAAa,0CAAA,YAAA,uBAAA;;IACT,YAAmB,SAAsD;AACrE,YAAM,OAAO;AACb,WAAK,cAAc,QAAQ;IAC/B;IACO,OAAO,KAAK,KAAY,KAAqB;AAChD,uCAAgB,IAAI,QAAQ,UAAU,CAAC;AACvC,YAAM,cAAc,IAAI,QAAQ,CAAC;AACjC,aAAO,IAAI,KAAK;QACZ,QAAQ,IAAI;QACZ;OACH;IACL;IACO;IACA,UAAU,KAAsB;AACnC,WAAK,UAAU,oBAAM,KAAK,CAAC,KAAK,WAAW,CAAC;AAC5C,aAAO,MAAM,UAAU,GAAG;IAC9B;IACO,WAAW,KAAgB;AAC9B,aAAO;QACH,GAAG,MAAM,WAAW,GAAG;QACvB,SAAS;UACL,gBAAgB,KAAK;;;IAGjC;;;;",
4
+ "sourcesContent": ["import * as __validateArgs from \"./IndicatorCC._validateArgs.js\";\nconst { validateArgs_IndicatorCCAPI_get, validateArgs_IndicatorCCAPI_set, validateArgs_IndicatorCCAPI_sendReport, validateArgs_IndicatorCCAPI_getSupported, validateArgs_IndicatorCCAPI_reportSupported, validateArgs_IndicatorCCAPI_reportDescription, validateArgs_IndicatorCCAPI_setTimeout, validateArgs_IndicatorCCAPI_getTimeout, validateArgs_IndicatorCCAPI_getDescription } = __validateArgs;\nimport { CommandClasses, type EndpointId, type GetValueDB, Indicator, type MaybeNotKnown, type MessageOrCCLogEntry, MessagePriority, type MessageRecord, type SupervisionResult, type ValueID, ValueMetadata, type WithAddress, ZWaveError, ZWaveErrorCodes, encodeBitMask, getIndicatorProperty, parseBitMask, validatePayload, } from \"@zwave-js/core\";\nimport { Bytes, getEnumMemberName, num2hex } from \"@zwave-js/shared\";\nimport { clamp, roundTo } from \"alcalzone-shared/math\";\nimport { isArray } from \"alcalzone-shared/typeguards\";\nimport { CCAPI, POLL_VALUE, type PollValueImplementation, SET_VALUE, type SetValueImplementation, throwUnsupportedProperty, throwWrongValueType, } from \"../lib/API.js\";\nimport { type CCRaw, CommandClass, type InterviewContext, type PersistValuesContext, type RefreshValuesContext, type RefreshValuesOptions, getEffectiveCCVersion, } from \"../lib/CommandClass.js\";\nimport { API, CCCommand, ccValues, commandClass, expectedCCResponse, implementedVersion, useSupervision, } from \"../lib/CommandClassDecorators.js\";\nimport { V } from \"../lib/Values.js\";\nimport { IndicatorCommand, type IndicatorTimeout } from \"../lib/_Types.js\";\nimport type { CCEncodingContext, CCParsingContext } from \"../lib/traits.js\";\nfunction isManufacturerDefinedIndicator(indicatorId: number): boolean {\n return indicatorId >= 0x80 && indicatorId <= 0x9f;\n}\nconst timeoutStringRegex = /^(?:(?<hoursStr>\\d+)h)?(?:(?<minutesStr>\\d+)m)?(?:(?<secondsStr>\\d+(?:\\.\\d+)?)s)?$/i;\nconst MAX_INDICATOR_OBJECTS = 31;\nfunction parseIndicatorTimeoutString(text: string): IndicatorTimeout | undefined {\n if (!text.length)\n return undefined;\n // Try to parse the numeric parts from a timeout\n const match = timeoutStringRegex.exec(text);\n if (!match)\n return undefined;\n const { hoursStr, minutesStr, secondsStr } = match.groups!;\n if (!hoursStr && !minutesStr && !secondsStr)\n return undefined;\n const ret: IndicatorTimeout = {};\n if (hoursStr) {\n ret.hours = clamp(parseInt(hoursStr, 10), 0, 255);\n }\n if (minutesStr) {\n ret.minutes = clamp(parseInt(minutesStr, 10), 0, 255);\n }\n if (secondsStr) {\n ret.seconds = clamp(roundTo(parseFloat(secondsStr), 2), 0, 59.99);\n }\n return ret;\n}\nfunction groupByIndicatorId(values: IndicatorObject[]): Map<number, IndicatorObject[]> {\n const ret = new Map();\n for (const value of values) {\n if (!ret.has(value.indicatorId)) {\n ret.set(value.indicatorId, []);\n }\n ret.get(value.indicatorId)!.push(value);\n }\n return ret;\n}\nfunction indicatorObjectsToTimeout(values: IndicatorObject[]): IndicatorTimeout | undefined {\n const timeoutValues = values.filter((v) => [0x0a, 0x06, 0x07, 0x08].includes(v.propertyId));\n if (!timeoutValues.length)\n return undefined;\n const hours = (timeoutValues.find((v) => v.propertyId === 0x0a)?.value\n ?? 0) as number;\n const minutes = (timeoutValues.find((v) => v.propertyId === 0x06)?.value\n ?? 0) as number;\n const seconds = clamp((timeoutValues.find((v) => v.propertyId === 0x07)?.value as number)\n ?? 0, 0, 59)\n + clamp((timeoutValues.find((v) => v.propertyId === 0x08)?.value as number)\n ?? 0, 0, 99)\n / 100;\n return {\n hours,\n minutes,\n seconds,\n };\n}\nimport { IndicatorCCValues } from \"./_CCValues.generated.js\";\nexport { IndicatorCCValues };\n/**\n * Looks up the configured metadata for the given indicator and property\n */\nfunction getIndicatorMetadata(indicatorId: Indicator, propertyId: number, overrideIndicatorLabel?: string): ValueMetadata {\n const label = getIndicatorLabel(indicatorId, propertyId, overrideIndicatorLabel);\n const prop = getIndicatorProperty(propertyId);\n const baseMetadata = IndicatorCCValues.valueV2(indicatorId, propertyId).meta;\n if (!prop) {\n return {\n ...baseMetadata,\n ...ValueMetadata.UInt8,\n label,\n };\n }\n else {\n if (prop.type === \"boolean\") {\n return {\n ...baseMetadata,\n ...ValueMetadata.Boolean,\n label,\n description: prop.description,\n readable: !prop.readonly,\n };\n }\n else {\n // UInt8\n return {\n ...baseMetadata,\n ...ValueMetadata.UInt8,\n label,\n description: prop.description,\n min: prop.min,\n max: prop.max,\n readable: !prop.readonly,\n };\n }\n }\n}\nfunction getIndicatorName(indicatorId: number | undefined): string {\n if (indicatorId) {\n return getEnumMemberName(Indicator, indicatorId);\n }\n else {\n return \"Default\";\n }\n}\n/** Returns a user-friendly label for an indicator */\nfunction getIndicatorLabel(indicatorId: number, propertyId: number, overrideIndicatorLabel?: string, overridePropertyLabel?: string): string {\n const defaultName = overrideIndicatorLabel || getIndicatorName(indicatorId);\n // Without a defined property, we cannot suggest a better label\n const prop = getIndicatorProperty(propertyId);\n if (!prop)\n return defaultName;\n // For indicators that correspond to an LCD or buttons,\n // the indicator enum names are enough\n if (indicatorId >= Indicator[\"LCD backlight\"]\n && indicatorId <= Indicator[\"Button 12 indication\"]\n && (propertyId === 0x01 /* Multilevel */\n || propertyId === 0x02 /* Binary */\n || overridePropertyLabel) // custom property label\n ) {\n let ret: string = (Indicator as any)[indicatorId];\n // Append the overridden property label if it exists\n if (overridePropertyLabel) {\n ret += ` - ${overridePropertyLabel}`;\n }\n return ret;\n }\n // Default to the current behavior of <indicator name> - <property label>\n return `${defaultName} - ${overridePropertyLabel || prop.label}`;\n}\nexport function shouldExposeIndicatorValue(indicatorId: number, propertyId: number): boolean {\n // Many possible indicator values are not suitable to be exposed as CC values,\n // usually because they need to be set in groups.\n // Indicator properties that should be exposed are marked as such\n const prop = getIndicatorProperty(propertyId);\n if (prop && !prop.exposeAsValue) {\n return false;\n }\n // Unless we know better, expose anyways\n return true;\n}\n@API(CommandClasses.Indicator)\nexport class IndicatorCCAPI extends CCAPI {\n public supportsCommand(cmd: IndicatorCommand): MaybeNotKnown<boolean> {\n switch (cmd) {\n case IndicatorCommand.Get:\n case IndicatorCommand.Report:\n return this.isSinglecast();\n case IndicatorCommand.Set:\n return true; // This is mandatory\n case IndicatorCommand.SupportedGet:\n case IndicatorCommand.SupportedReport:\n return this.version >= 2 && this.isSinglecast();\n case IndicatorCommand.DescriptionGet:\n case IndicatorCommand.DescriptionReport:\n return this.version >= 4 && this.isSinglecast();\n }\n return super.supportsCommand(cmd);\n }\n protected override get [SET_VALUE](): SetValueImplementation {\n return async function (this: IndicatorCCAPI, { property, propertyKey }, value) {\n const valueId: ValueID = {\n commandClass: this.ccId,\n endpoint: this.endpoint.index,\n property,\n propertyKey,\n };\n if (property === \"value\") {\n // V1 value\n if (typeof value !== \"number\") {\n throwWrongValueType(this.ccId, property, \"number\", typeof value);\n }\n return this.set(value);\n }\n else if (IndicatorCCValues.valueV2.is(valueId)) {\n const indicatorId = property as number;\n const propertyId = propertyKey as number;\n const expectedType = getIndicatorMetadata(indicatorId, propertyId).type as \"number\" | \"boolean\";\n // V2+ value\n if (typeof value !== expectedType) {\n throwWrongValueType(this.ccId, property, expectedType, typeof value);\n }\n return this.set([\n {\n indicatorId,\n propertyId,\n value: value as any,\n },\n ]);\n }\n else if (IndicatorCCValues.timeout.is(valueId)) {\n const indicatorId = property as number;\n if (typeof value !== \"string\") {\n throwWrongValueType(this.ccId, property, \"string\", typeof value);\n }\n return this.setTimeout(indicatorId, value);\n }\n else if (IndicatorCCValues.identify.is(valueId)) {\n if (typeof value !== \"boolean\") {\n throwWrongValueType(this.ccId, property, \"boolean\", typeof value);\n }\n return this.identify();\n }\n else {\n throwUnsupportedProperty(this.ccId, property);\n }\n };\n }\n protected get [POLL_VALUE](): PollValueImplementation {\n return async function (this: IndicatorCCAPI, { property }) {\n if (property === \"value\")\n return this.get();\n if (typeof property === \"number\") {\n return this.get(property);\n }\n throwUnsupportedProperty(this.ccId, property);\n };\n }\n @validateArgs_IndicatorCCAPI_get()\n public async get(indicatorId?: number): Promise<MaybeNotKnown<number | IndicatorObject[]>> {\n this.assertSupportsCommand(IndicatorCommand, IndicatorCommand.Get);\n const cc = new IndicatorCCGet({\n nodeId: this.endpoint.nodeId,\n endpointIndex: this.endpoint.index,\n indicatorId,\n });\n const response = await this.host.sendCommand<IndicatorCCReport>(cc, this.commandOptions);\n if (!response)\n return;\n if (response.values)\n return response.values;\n return response.indicator0Value!;\n }\n @validateArgs_IndicatorCCAPI_set()\n public async set(value: number | IndicatorObject[]): Promise<SupervisionResult | undefined> {\n this.assertSupportsCommand(IndicatorCommand, IndicatorCommand.Set);\n if (this.version === 1 && typeof value !== \"number\") {\n throw new ZWaveError(`Node ${this.endpoint.nodeId as number} only supports IndicatorCC V1 which requires a single value to be set`, ZWaveErrorCodes.Argument_Invalid);\n }\n else if (this.version >= 2\n && isArray(value)\n && value.length > MAX_INDICATOR_OBJECTS) {\n throw new ZWaveError(`Only ${MAX_INDICATOR_OBJECTS} indicator values can be set at a time!`, ZWaveErrorCodes.Argument_Invalid);\n }\n const cc = new IndicatorCCSet({\n nodeId: this.endpoint.nodeId,\n endpointIndex: this.endpoint.index,\n ...(typeof value === \"number\" ? { value } : { values: value }),\n });\n return this.host.sendCommand(cc, this.commandOptions);\n }\n @validateArgs_IndicatorCCAPI_sendReport()\n public async sendReport(options: IndicatorCCReportOptions): Promise<void> {\n this.assertSupportsCommand(IndicatorCommand, IndicatorCommand.Report);\n const cc = new IndicatorCCReport({\n nodeId: this.endpoint.nodeId,\n endpointIndex: this.endpoint.index,\n ...options,\n });\n await this.host.sendCommand(cc, this.commandOptions);\n }\n @validateArgs_IndicatorCCAPI_getSupported()\n public async getSupported(indicatorId: number): Promise<{\n indicatorId?: number;\n supportedProperties: readonly number[];\n nextIndicatorId: number;\n } | undefined> {\n this.assertSupportsCommand(IndicatorCommand, IndicatorCommand.SupportedGet);\n const cc = new IndicatorCCSupportedGet({\n nodeId: this.endpoint.nodeId,\n endpointIndex: this.endpoint.index,\n indicatorId,\n });\n const response = await this.host.sendCommand<IndicatorCCSupportedReport>(cc, this.commandOptions);\n if (response) {\n return {\n // Include the actual indicator ID if 0x00 was requested\n ...(indicatorId === 0x00\n ? { indicatorId: response.indicatorId }\n : undefined),\n supportedProperties: response.supportedProperties,\n nextIndicatorId: response.nextIndicatorId,\n };\n }\n }\n @validateArgs_IndicatorCCAPI_reportSupported()\n public async reportSupported(indicatorId: number, supportedProperties: readonly number[], nextIndicatorId: number): Promise<void> {\n this.assertSupportsCommand(IndicatorCommand, IndicatorCommand.SupportedReport);\n const cc = new IndicatorCCSupportedReport({\n nodeId: this.endpoint.nodeId,\n endpointIndex: this.endpoint.index,\n indicatorId,\n supportedProperties,\n nextIndicatorId,\n });\n await this.host.sendCommand(cc, this.commandOptions);\n }\n @validateArgs_IndicatorCCAPI_reportDescription()\n public async reportDescription(indicatorId: number, description: string): Promise<void> {\n this.assertSupportsCommand(IndicatorCommand, IndicatorCommand.DescriptionReport);\n const cc = new IndicatorCCDescriptionReport({\n nodeId: this.endpoint.nodeId,\n endpointIndex: this.endpoint.index,\n indicatorId,\n description,\n });\n await this.host.sendCommand(cc, this.commandOptions);\n }\n /**\n * Instructs the node to identify itself. Available starting with V3 of this CC.\n */\n public async identify(): Promise<SupervisionResult | undefined> {\n if (this.version < 3) {\n throw new ZWaveError(`The identify command is only supported in Indicator CC version 3 and above`, ZWaveErrorCodes.CC_NotSupported);\n }\n return this.set([\n {\n indicatorId: 0x50,\n propertyId: 0x03,\n value: 0x08,\n },\n {\n indicatorId: 0x50,\n propertyId: 0x04,\n value: 0x03,\n },\n {\n indicatorId: 0x50,\n propertyId: 0x05,\n value: 0x06,\n },\n ]);\n }\n /**\n * Set a timeout for a given indicator ID after which the indicator will be turned off.\n * @param timeout The timeout in one of the supported forms:\n * \t- a timeout string in the form `12h18m17.59s`. All parts (hours, minutes, seconds, hundredths) are optional, but must be specified in this order. An empty string will be treated like `undefined`.\n * \t- an object specifying the timeout parts. An empty object will be treated like `undefined`.\n * \t- `undefined` to disable the timeout.\n */\n @validateArgs_IndicatorCCAPI_setTimeout()\n public async setTimeout(indicatorId: number, timeout: IndicatorTimeout | string | undefined): Promise<SupervisionResult | undefined> {\n this.assertPhysicalEndpoint(this.endpoint);\n if (this.version < 3) {\n throw new ZWaveError(`The setTimeout command is only supported in Indicator CC version 3 and above`, ZWaveErrorCodes.CC_NotSupported);\n }\n if (typeof timeout === \"string\") {\n if (timeout === \"\") {\n timeout = undefined;\n }\n else {\n const parsed = parseIndicatorTimeoutString(timeout);\n if (!parsed) {\n throw new ZWaveError(`The timeout string \"${timeout}\" is not valid`, ZWaveErrorCodes.Argument_Invalid);\n }\n timeout = parsed;\n }\n }\n const supportedPropertyIDs = IndicatorCC.getSupportedPropertyIDsCached(this.host, this.endpoint, indicatorId);\n const objects: IndicatorObject[] = [];\n if (timeout) {\n const hours = timeout.hours ?? 0;\n const minutes = timeout.minutes ?? 0;\n const seconds = Math.floor(timeout.seconds ?? 0);\n const hundredths = Math.round(((timeout.seconds ?? 0) % 1) * 100);\n if (hours) {\n if (!supportedPropertyIDs?.includes(0x0a)) {\n throw new ZWaveError(`The indicator ${indicatorId} does not support setting the timeout in hours`, ZWaveErrorCodes.Argument_Invalid);\n }\n objects.push({\n indicatorId,\n propertyId: 0x0a,\n value: hours,\n });\n }\n if (minutes) {\n if (!supportedPropertyIDs?.includes(0x06)) {\n throw new ZWaveError(`The indicator ${indicatorId} does not support setting the timeout in minutes`, ZWaveErrorCodes.Argument_Invalid);\n }\n objects.push({\n indicatorId,\n propertyId: 0x06,\n value: minutes,\n });\n }\n if (seconds) {\n if (!supportedPropertyIDs?.includes(0x07)) {\n throw new ZWaveError(`The indicator ${indicatorId} does not support setting the timeout in seconds`, ZWaveErrorCodes.Argument_Invalid);\n }\n objects.push({\n indicatorId,\n propertyId: 0x07,\n value: seconds,\n });\n }\n if (hundredths) {\n if (!supportedPropertyIDs?.includes(0x08)) {\n throw new ZWaveError(`The indicator ${indicatorId} does not support setting the timeout in 1/100 seconds`, ZWaveErrorCodes.Argument_Invalid);\n }\n objects.push({\n indicatorId,\n propertyId: 0x08,\n value: hundredths,\n });\n }\n }\n if (!objects.length) {\n objects.push(...(supportedPropertyIDs ?? []).map((p) => ({\n indicatorId,\n propertyId: p,\n value: 0,\n })));\n }\n return this.set(objects);\n }\n /**\n * Returns the timeout after which the given indicator will be turned off.\n */\n @validateArgs_IndicatorCCAPI_getTimeout()\n public async getTimeout(indicatorId: number): Promise<MaybeNotKnown<IndicatorTimeout>> {\n const values = await this.get(indicatorId);\n if (!isArray(values))\n return;\n return indicatorObjectsToTimeout(values);\n }\n @validateArgs_IndicatorCCAPI_getDescription()\n public async getDescription(indicatorId: number): Promise<MaybeNotKnown<string>> {\n this.assertSupportsCommand(IndicatorCommand, IndicatorCommand.DescriptionGet);\n const cc = new IndicatorCCDescriptionGet({\n nodeId: this.endpoint.nodeId,\n endpointIndex: this.endpoint.index,\n indicatorId,\n });\n const response = await this.host.sendCommand<IndicatorCCDescriptionReport>(cc, this.commandOptions);\n return response?.description;\n }\n}\n@commandClass(CommandClasses.Indicator)\n@implementedVersion(4)\n@ccValues(IndicatorCCValues)\nexport class IndicatorCC extends CommandClass {\n declare ccCommand: IndicatorCommand;\n public async interview(ctx: InterviewContext): Promise<void> {\n const node = this.getNode(ctx)!;\n const endpoint = this.getEndpoint(ctx)!;\n const api = CCAPI.create(CommandClasses.Indicator, ctx, endpoint).withOptions({\n priority: MessagePriority.NodeQuery,\n tag: \"interview\",\n });\n ctx.logNode(node.id, {\n endpoint: this.endpointIndex,\n message: `Interviewing ${this.ccName}...`,\n direction: \"none\",\n });\n if (api.version > 1) {\n ctx.logNode(node.id, {\n endpoint: this.endpointIndex,\n message: \"scanning supported indicator IDs...\",\n direction: \"outbound\",\n });\n // Query ID 0 to get the first supported ID\n let curId = 0x00;\n const supportedIndicatorIds: number[] = [];\n do {\n const supportedResponse = await api.getSupported(curId);\n if (!supportedResponse) {\n ctx.logNode(node.id, {\n endpoint: this.endpointIndex,\n message: \"Time out while scanning supported indicator IDs, skipping interview...\",\n level: \"warn\",\n });\n return;\n }\n if (supportedResponse.supportedProperties.length > 0) {\n supportedIndicatorIds.push(supportedResponse.indicatorId ?? curId);\n }\n curId = supportedResponse.nextIndicatorId;\n } while (curId !== 0x00);\n // The IDs are not stored by the report CCs so store them here once we have all of them\n this.setValue(ctx, IndicatorCCValues.supportedIndicatorIds, supportedIndicatorIds);\n const logMessage = `supported indicator IDs: ${supportedIndicatorIds.join(\", \")}`;\n ctx.logNode(node.id, {\n endpoint: this.endpointIndex,\n message: logMessage,\n direction: \"inbound\",\n });\n if (api.version >= 4) {\n const manufacturerDefinedIndicatorIds = supportedIndicatorIds.filter((id) => isManufacturerDefinedIndicator(id));\n if (manufacturerDefinedIndicatorIds.length > 0) {\n ctx.logNode(node.id, {\n endpoint: this.endpointIndex,\n message: \"retrieving description for manufacturer-defined indicator IDs...\",\n direction: \"outbound\",\n });\n for (const [i, id,] of manufacturerDefinedIndicatorIds.entries()) {\n await api.getDescription(id);\n node.reportInterviewProgress(i + 1, manufacturerDefinedIndicatorIds.length);\n }\n }\n }\n }\n // Query current values\n await this.refreshValues(ctx, {\n tag: \"interview\",\n onProgress: (completed, total) => node.reportInterviewProgress(completed, total),\n });\n // Remember that the interview is complete\n this.setInterviewComplete(ctx, true);\n }\n public async refreshValues(ctx: RefreshValuesContext, options?: RefreshValuesOptions): Promise<void> {\n const node = this.getNode(ctx)!;\n const endpoint = this.getEndpoint(ctx)!;\n const api = CCAPI.create(CommandClasses.Indicator, ctx, endpoint).withOptions({\n priority: options?.priority ?? MessagePriority.NodeQuery,\n tag: options?.tag,\n });\n if (api.version === 1) {\n ctx.logNode(node.id, {\n endpoint: this.endpointIndex,\n message: \"requesting current indicator value...\",\n direction: \"outbound\",\n });\n await api.get();\n }\n else {\n const supportedIndicatorIds: number[] = this.getValue(ctx, IndicatorCCValues.supportedIndicatorIds)\n ?? [];\n for (const [i, indicatorId] of supportedIndicatorIds.entries()) {\n ctx.logNode(node.id, {\n endpoint: this.endpointIndex,\n message: `requesting current indicator value (id = ${num2hex(indicatorId)})...`,\n direction: \"outbound\",\n });\n await api.get(indicatorId);\n options?.onProgress?.(i + 1, supportedIndicatorIds.length);\n }\n }\n }\n public translatePropertyKey(ctx: GetValueDB, property: string | number, propertyKey: string | number): string | undefined {\n if (property === \"value\") {\n // CC version 1 only has a single value that doesn't need to be translated\n return undefined;\n }\n else if (typeof property === \"number\"\n && typeof propertyKey === \"number\") {\n // The indicator property is our property key\n const prop = getIndicatorProperty(propertyKey);\n if (prop)\n return prop.label;\n }\n else if (typeof property === \"number\" && propertyKey === \"timeout\") {\n return \"Timeout\";\n }\n return super.translatePropertyKey(ctx, property, propertyKey);\n }\n public translateProperty(ctx: GetValueDB, property: string | number, propertyKey?: string | number): string {\n if (typeof property === \"number\") {\n if (typeof propertyKey === \"number\" || propertyKey === \"timeout\") {\n // The indicator corresponds to our property\n if (property in Indicator)\n return Indicator[property];\n }\n }\n return super.translateProperty(ctx, property, propertyKey);\n }\n protected supportsV2Indicators(ctx: GetValueDB): boolean {\n // First test if there are any indicator ids defined\n const supportedIndicatorIds = this.getValue<number[]>(ctx, IndicatorCCValues.supportedIndicatorIds);\n if (!supportedIndicatorIds?.length)\n return false;\n // Then test if there are any property ids defined\n return supportedIndicatorIds.some((indicatorId) => !!this.getValue<number[]>(ctx, IndicatorCCValues.supportedPropertyIDs(indicatorId))?.length);\n }\n protected getManufacturerDefinedIndicatorLabel(ctx: GetValueDB, indicatorId: number): string | undefined {\n if (isManufacturerDefinedIndicator(indicatorId)) {\n return this.getValue(ctx, IndicatorCCValues.indicatorDescription(indicatorId));\n }\n }\n public static getSupportedPropertyIDsCached(ctx: GetValueDB, endpoint: EndpointId, indicatorId: number): MaybeNotKnown<number[]> {\n return ctx\n .getValueDB(endpoint.nodeId)\n .getValue(IndicatorCCValues.supportedPropertyIDs(indicatorId).endpoint(endpoint.index));\n }\n}\n// @publicAPI\nexport interface IndicatorObject {\n indicatorId: number;\n propertyId: number;\n value: number | boolean;\n}\n// @publicAPI\nexport type IndicatorCCSetOptions = {\n value: number;\n} | {\n values: IndicatorObject[];\n};\n@CCCommand(IndicatorCommand.Set)\n@useSupervision()\nexport class IndicatorCCSet extends IndicatorCC {\n public constructor(options: WithAddress<IndicatorCCSetOptions>) {\n super(options);\n if (\"value\" in options) {\n this.indicator0Value = options.value;\n }\n else {\n this.values = options.values;\n }\n }\n public static from(raw: CCRaw, ctx: CCParsingContext): IndicatorCCSet {\n validatePayload(raw.payload.length >= 1);\n const objCount = raw.payload.length >= 2 ? raw.payload[1] & 0b11111 : 0;\n if (objCount === 0) {\n const indicator0Value = raw.payload[0];\n return new this({\n nodeId: ctx.sourceNodeId,\n value: indicator0Value,\n });\n }\n validatePayload(raw.payload.length >= 2 + 3 * objCount);\n const values: IndicatorObject[] = [];\n for (let i = 0; i < objCount; i++) {\n const offset = 2 + 3 * i;\n const value: IndicatorObject = {\n indicatorId: raw.payload[offset],\n propertyId: raw.payload[offset + 1],\n value: raw.payload[offset + 2],\n };\n values.push(value);\n }\n return new this({\n nodeId: ctx.sourceNodeId,\n values,\n });\n }\n public indicator0Value: number | undefined;\n public values: IndicatorObject[] | undefined;\n public serialize(ctx: CCEncodingContext): Promise<Bytes> {\n if (this.values != undefined) {\n // V2+\n this.payload = Bytes.alloc(2 + 3 * this.values.length, 0);\n // Byte 0 is the legacy value\n const objCount = this.values.length & MAX_INDICATOR_OBJECTS;\n this.payload[1] = objCount;\n for (let i = 0; i < objCount; i++) {\n const offset = 2 + 3 * i;\n this.payload[offset] = this.values[i].indicatorId;\n this.payload[offset + 1] = this.values[i].propertyId;\n const value = this.values[i].value;\n this.payload[offset + 2] =\n value === true ? 0xff : value === false ? 0x00 : value;\n }\n }\n else {\n // V1\n this.payload = Bytes.from([this.indicator0Value ?? 0]);\n }\n return super.serialize(ctx);\n }\n public toLogEntry(ctx?: GetValueDB): MessageOrCCLogEntry {\n const message: MessageRecord = {};\n if (this.indicator0Value != undefined) {\n message[\"indicator 0 value\"] = this.indicator0Value;\n }\n if (this.values != undefined) {\n message.values = this.values\n .map((v) => `\n\u00B7 indicatorId: ${v.indicatorId}\n propertyId: ${v.propertyId}\n value: ${v.value}`)\n .join(\"\");\n }\n return {\n ...super.toLogEntry(ctx),\n message,\n };\n }\n}\n// @publicAPI\nexport type IndicatorCCReportOptions = {\n value: number;\n} | {\n values: IndicatorObject[];\n};\n@CCCommand(IndicatorCommand.Report)\nexport class IndicatorCCReport extends IndicatorCC {\n public constructor(options: WithAddress<IndicatorCCReportOptions>) {\n super(options);\n if (\"value\" in options) {\n this.indicator0Value = options.value;\n }\n else if (\"values\" in options) {\n if (options.values.length > MAX_INDICATOR_OBJECTS) {\n throw new ZWaveError(`Only ${MAX_INDICATOR_OBJECTS} indicator values can be set at a time!`, ZWaveErrorCodes.Argument_Invalid);\n }\n this.values = options.values;\n }\n }\n public static from(raw: CCRaw, ctx: CCParsingContext): IndicatorCCReport {\n validatePayload(raw.payload.length >= 1);\n const objCount = raw.payload.length >= 2 ? raw.payload[1] & 0b11111 : 0;\n if (objCount === 0) {\n const indicator0Value = raw.payload[0];\n return new this({\n nodeId: ctx.sourceNodeId,\n value: indicator0Value,\n });\n }\n validatePayload(raw.payload.length >= 2 + 3 * objCount);\n const values: IndicatorObject[] = [];\n for (let i = 0; i < objCount; i++) {\n const offset = 2 + 3 * i;\n const value: IndicatorObject = {\n indicatorId: raw.payload[offset],\n propertyId: raw.payload[offset + 1],\n value: raw.payload[offset + 2],\n };\n values.push(value);\n }\n return new this({\n nodeId: ctx.sourceNodeId,\n values,\n });\n // TODO: Think if we want this:\n // // If not all Property IDs are included in the command for the actual Indicator ID,\n // // a controlling node MUST assume non-specified Property IDs values to be 0x00.\n // const indicatorId = this.values[0].indicatorId;\n // const supportedIndicatorProperties =\n // \tvalueDB.getValue<number[]>(\n // \t\tgetSupportedPropertyIDsValueID(\n // \t\t\tthis.endpointIndex,\n // \t\t\tindicatorId,\n // \t\t),\n // \t) ?? [];\n // // Find out which ones are missing\n // const missingIndicatorProperties = supportedIndicatorProperties.filter(\n // \tprop =>\n // \t\t!this.values!.find(({ propertyId }) => prop === propertyId),\n // );\n // // And assume they are 0 (false)\n // for (const missing of missingIndicatorProperties) {\n // \tthis.setIndicatorValue({\n // \t\tindicatorId,\n // \t\tpropertyId: missing,\n // \t\tvalue: 0,\n // \t});\n // }\n }\n public persistValues(ctx: PersistValuesContext): boolean {\n if (!super.persistValues(ctx))\n return false;\n // Indicator objects only exist in V2+ reports, the timeout properties in V3+.\n // Ignore them if the device advertises a lower version.\n const ccVersion = getEffectiveCCVersion(ctx, this);\n if (this.indicator0Value != undefined) {\n if (!this.supportsV2Indicators(ctx)) {\n // Publish the value\n const valueV1 = IndicatorCCValues.valueV1;\n this.setMetadata(ctx, valueV1);\n this.setValue(ctx, valueV1, this.indicator0Value);\n }\n else {\n if (this.isSinglecast()) {\n // Don't!\n ctx.logNode(this.nodeId, {\n message: `ignoring V1 indicator report because the node supports V2 indicators`,\n direction: \"none\",\n endpoint: this.endpointIndex,\n });\n }\n }\n }\n else if (this.values && ccVersion >= 2) {\n // Store the simple values first\n for (const value of this.values) {\n this.setIndicatorValue(ctx, value);\n }\n // Then group values into the convenience properties\n const groupedValues = groupByIndicatorId(this.values);\n for (const [indicatorId, values] of groupedValues) {\n // Some devices report all properties it supports in every report,\n // even if it does not support all properties for the given indicator ID.\n // To avoid confusion, we need to filter out the unsupported properties\n const supportedPropertyIDs = this.getValue<number[]>(ctx, IndicatorCCValues.supportedPropertyIDs(indicatorId)) ?? [];\n const filteredValues = values.filter((v) => supportedPropertyIDs.includes(v.propertyId));\n const overrideIndicatorLabel = this.getManufacturerDefinedIndicatorLabel(ctx, indicatorId);\n // ... timeout\n const timeout = indicatorObjectsToTimeout(filteredValues);\n if (timeout && ccVersion >= 3) {\n let timeoutString = \"\";\n if (timeout?.hours)\n timeoutString += `${timeout.hours}h`;\n if (timeout?.minutes) {\n timeoutString += `${timeout.minutes}m`;\n }\n if (timeout?.seconds) {\n timeoutString += `${timeout.seconds}s`;\n }\n const timeoutValue = IndicatorCCValues.timeout(indicatorId);\n const metadata: ValueMetadata = {\n ...timeoutValue.meta,\n label: getIndicatorLabel(indicatorId, 0x06, // This is actually ignored, but pass a valid ID for clarity\n overrideIndicatorLabel, \"Timeout\"),\n };\n this.setMetadata(ctx, timeoutValue, metadata);\n this.setValue(ctx, timeoutValue, timeoutString);\n }\n }\n }\n return true;\n }\n public readonly indicator0Value: number | undefined;\n public readonly values: IndicatorObject[] | undefined;\n private setIndicatorValue(ctx: GetValueDB, value: IndicatorObject): void {\n // Manufacturer-defined indicators may need a custom label\n const overrideIndicatorLabel = this.getManufacturerDefinedIndicatorLabel(ctx, value.indicatorId);\n const metadata = getIndicatorMetadata(value.indicatorId, value.propertyId, overrideIndicatorLabel);\n // Some values need to be converted\n if (metadata.type === \"boolean\") {\n value.value = !!value.value;\n }\n // Only expose the value if it should be user-facing\n if (value.indicatorId === Indicator[\"Node Identify\"]) {\n return;\n }\n const prop = getIndicatorProperty(value.propertyId);\n if (!prop?.exposeAsValue)\n return;\n // And only if it is actually supported and not just reported by accident\n const supportedPropertyIDs = this.getValue<number[]>(ctx, IndicatorCCValues.supportedPropertyIDs(value.indicatorId)) ?? [];\n if (!supportedPropertyIDs.includes(value.propertyId))\n return;\n // Publish the value\n const valueV2 = IndicatorCCValues.valueV2(value.indicatorId, value.propertyId);\n this.setMetadata(ctx, valueV2, metadata);\n this.setValue(ctx, valueV2, value.value);\n }\n public serialize(ctx: CCEncodingContext): Promise<Bytes> {\n if (this.values != undefined) {\n // V2+\n this.payload = Bytes.alloc(2 + 3 * this.values.length, 0);\n // Byte 0 is the legacy value\n const objCount = this.values.length & MAX_INDICATOR_OBJECTS;\n this.payload[1] = objCount;\n for (let i = 0; i < objCount; i++) {\n const offset = 2 + 3 * i;\n this.payload[offset] = this.values[i].indicatorId;\n this.payload[offset + 1] = this.values[i].propertyId;\n const value = this.values[i].value;\n this.payload[offset + 2] =\n value === true ? 0xff : value === false ? 0x00 : value;\n }\n }\n else {\n // V1\n this.payload = Bytes.from([this.indicator0Value ?? 0]);\n }\n return super.serialize(ctx);\n }\n public toLogEntry(ctx?: GetValueDB): MessageOrCCLogEntry {\n const message: MessageRecord = {};\n if (this.indicator0Value != undefined) {\n message[\"indicator 0 value\"] = this.indicator0Value;\n }\n if (this.values != undefined) {\n message.values = this.values\n .map((v) => `\n\u00B7 indicatorId: ${v.indicatorId}\n propertyId: ${v.propertyId}\n value: ${v.value}`)\n .join(\"\");\n }\n return {\n ...super.toLogEntry(ctx),\n message,\n };\n }\n}\n// @publicAPI\nexport interface IndicatorCCGetOptions {\n indicatorId?: number;\n}\n@CCCommand(IndicatorCommand.Get)\n@expectedCCResponse(IndicatorCCReport)\nexport class IndicatorCCGet extends IndicatorCC {\n public constructor(options: WithAddress<IndicatorCCGetOptions>) {\n super(options);\n this.indicatorId = options.indicatorId;\n }\n public static from(raw: CCRaw, ctx: CCParsingContext): IndicatorCCGet {\n let indicatorId: number | undefined;\n if (raw.payload.length > 0) {\n indicatorId = raw.payload[0];\n }\n return new this({\n nodeId: ctx.sourceNodeId,\n indicatorId,\n });\n }\n public indicatorId: number | undefined;\n public serialize(ctx: CCEncodingContext): Promise<Bytes> {\n if (this.indicatorId != undefined) {\n this.payload = Bytes.from([this.indicatorId]);\n }\n return super.serialize(ctx);\n }\n public toLogEntry(ctx?: GetValueDB): MessageOrCCLogEntry {\n return {\n ...super.toLogEntry(ctx),\n message: {\n indicator: getIndicatorName(this.indicatorId),\n },\n };\n }\n}\n// @publicAPI\nexport interface IndicatorCCSupportedReportOptions {\n indicatorId: number;\n nextIndicatorId: number;\n supportedProperties: readonly number[];\n}\n@CCCommand(IndicatorCommand.SupportedReport)\nexport class IndicatorCCSupportedReport extends IndicatorCC {\n public constructor(options: WithAddress<IndicatorCCSupportedReportOptions>) {\n super(options);\n this.indicatorId = options.indicatorId;\n this.nextIndicatorId = options.nextIndicatorId;\n this.supportedProperties = options.supportedProperties;\n }\n public static from(raw: CCRaw, ctx: CCParsingContext): IndicatorCCSupportedReport {\n validatePayload(raw.payload.length >= 3);\n const indicatorId = raw.payload[0];\n const nextIndicatorId = raw.payload[1];\n const bitMaskLength = raw.payload[2] & 0b11111;\n let supportedProperties: readonly number[];\n if (bitMaskLength === 0) {\n supportedProperties = [];\n }\n else {\n validatePayload(raw.payload.length >= 3 + bitMaskLength);\n // The bit mask starts at 0, but bit 0 is not used\n supportedProperties = parseBitMask(raw.payload.subarray(3, 3 + bitMaskLength), 0).filter((v) => v !== 0);\n }\n return new this({\n nodeId: ctx.sourceNodeId,\n indicatorId,\n nextIndicatorId,\n supportedProperties,\n });\n }\n public persistValues(ctx: PersistValuesContext): boolean {\n if (!super.persistValues(ctx))\n return false;\n if (this.indicatorId !== 0x00) {\n // Remember which property IDs are supported\n this.setValue(ctx, IndicatorCCValues.supportedPropertyIDs(this.indicatorId), this.supportedProperties);\n }\n return true;\n }\n public readonly indicatorId: number;\n public readonly nextIndicatorId: number;\n public readonly supportedProperties: readonly number[];\n public serialize(ctx: CCEncodingContext): Promise<Bytes> {\n const bitmask = this.supportedProperties.length > 0\n ? encodeBitMask(this.supportedProperties, undefined, 0)\n : new Bytes();\n this.payload = Bytes.concat([\n [this.indicatorId, this.nextIndicatorId, bitmask.length],\n bitmask,\n ]);\n return super.serialize(ctx);\n }\n public toLogEntry(ctx?: GetValueDB): MessageOrCCLogEntry {\n return {\n ...super.toLogEntry(ctx),\n message: {\n indicator: getIndicatorName(this.indicatorId),\n \"supported properties\": this.supportedProperties\n .map((id) => getIndicatorProperty(id)?.label\n ?? `Unknown (${num2hex(id)})`)\n .join(\", \"),\n \"next indicator\": getIndicatorName(this.nextIndicatorId),\n },\n };\n }\n}\n// @publicAPI\nexport interface IndicatorCCSupportedGetOptions {\n indicatorId: number;\n}\nfunction testResponseForIndicatorSupportedGet(sent: IndicatorCCSupportedGet, received: IndicatorCCSupportedReport) {\n return sent.indicatorId === 0 || received.indicatorId === sent.indicatorId;\n}\n@CCCommand(IndicatorCommand.SupportedGet)\n@expectedCCResponse(IndicatorCCSupportedReport, testResponseForIndicatorSupportedGet)\nexport class IndicatorCCSupportedGet extends IndicatorCC {\n public constructor(options: WithAddress<IndicatorCCSupportedGetOptions>) {\n super(options);\n this.indicatorId = options.indicatorId;\n }\n public static from(raw: CCRaw, ctx: CCParsingContext): IndicatorCCSupportedGet {\n validatePayload(raw.payload.length >= 1);\n const indicatorId = raw.payload[0];\n return new this({\n nodeId: ctx.sourceNodeId,\n indicatorId,\n });\n }\n public indicatorId: number;\n public serialize(ctx: CCEncodingContext): Promise<Bytes> {\n this.payload = Bytes.from([this.indicatorId]);\n return super.serialize(ctx);\n }\n public toLogEntry(ctx?: GetValueDB): MessageOrCCLogEntry {\n return {\n ...super.toLogEntry(ctx),\n message: {\n indicator: getIndicatorName(this.indicatorId),\n },\n };\n }\n}\n// @publicAPI\nexport interface IndicatorCCDescriptionReportOptions {\n indicatorId: number;\n description: string;\n}\n@CCCommand(IndicatorCommand.DescriptionReport)\nexport class IndicatorCCDescriptionReport extends IndicatorCC {\n public constructor(options: WithAddress<IndicatorCCDescriptionReportOptions>) {\n super(options);\n this.indicatorId = options.indicatorId;\n this.description = options.description;\n }\n public static from(raw: CCRaw, ctx: CCParsingContext): IndicatorCCDescriptionReport {\n validatePayload(raw.payload.length >= 2);\n const indicatorId = raw.payload[0];\n const descrptionLength = raw.payload[1];\n validatePayload(raw.payload.length >= 2 + descrptionLength);\n const description: string = raw.payload\n .subarray(2, 2 + descrptionLength)\n .toString(\"utf8\");\n return new this({\n nodeId: ctx.sourceNodeId,\n indicatorId,\n description,\n });\n }\n public indicatorId: number;\n public description: string;\n public persistValues(ctx: PersistValuesContext): boolean {\n if (!super.persistValues(ctx))\n return false;\n // This command only exists in V4. Ignore it if the device advertises a lower version.\n if (this.description && getEffectiveCCVersion(ctx, this) >= 4) {\n this.setValue(ctx, IndicatorCCValues.indicatorDescription(this.indicatorId), this.description);\n }\n return true;\n }\n public serialize(ctx: CCEncodingContext): Promise<Bytes> {\n const description = Bytes.from(this.description, \"utf8\");\n this.payload = Bytes.concat([\n [this.indicatorId, description.length],\n description,\n ]);\n return super.serialize(ctx);\n }\n public toLogEntry(ctx?: GetValueDB): MessageOrCCLogEntry {\n return {\n ...super.toLogEntry(ctx),\n message: {\n \"indicator ID\": this.indicatorId,\n description: this.description || \"(none)\",\n },\n };\n }\n}\n// @publicAPI\nexport interface IndicatorCCDescriptionGetOptions {\n indicatorId: number;\n}\nfunction testResponseForIndicatorDescriptionGet(sent: IndicatorCCDescriptionGet, received: IndicatorCCDescriptionReport) {\n return received.indicatorId === sent.indicatorId;\n}\n@CCCommand(IndicatorCommand.DescriptionGet)\n@expectedCCResponse(IndicatorCCDescriptionReport, testResponseForIndicatorDescriptionGet)\nexport class IndicatorCCDescriptionGet extends IndicatorCC {\n public constructor(options: WithAddress<IndicatorCCDescriptionGetOptions>) {\n super(options);\n this.indicatorId = options.indicatorId;\n }\n public static from(raw: CCRaw, ctx: CCParsingContext): IndicatorCCDescriptionGet {\n validatePayload(raw.payload.length >= 1);\n const indicatorId = raw.payload[0];\n return new this({\n nodeId: ctx.sourceNodeId,\n indicatorId,\n });\n }\n public indicatorId: number;\n public serialize(ctx: CCEncodingContext): Promise<Bytes> {\n this.payload = Bytes.from([this.indicatorId]);\n return super.serialize(ctx);\n }\n public toLogEntry(ctx?: GetValueDB): MessageOrCCLogEntry {\n return {\n ...super.toLogEntry(ctx),\n message: {\n \"indicator ID\": this.indicatorId,\n },\n };\n }\n}\n"],
5
+ "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,qBAAgC;AAEhC,kBAAwU;AACxU,oBAAkD;AAClD,kBAA+B;AAC/B,wBAAwB;AACxB,iBAAwJ;AACxJ,0BAAyK;AACzK,oCAAgH;AAEhH,mBAAwD;AA0DxD,gCAAkC;AAnElC,MAAM,EAAE,iCAAiC,iCAAiC,wCAAwC,0CAA0C,6CAA6C,+CAA+C,wCAAwC,wCAAwC,2CAA0C,IAAK;AAWvX,SAAS,+BAA+B,aAAmB;AACvD,SAAO,eAAe,OAAQ,eAAe;AACjD;AAFS;AAGT,MAAM,qBAAqB;AAC3B,MAAM,wBAAwB;AAC9B,SAAS,4BAA4B,MAAY;AAC7C,MAAI,CAAC,KAAK;AACN,WAAO;AAEX,QAAM,QAAQ,mBA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