@zwave-js/cc 15.28.0 → 15.30.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 (404) hide show
  1. package/build/cjs/cc/AlarmSensorCC.d.ts +3 -1
  2. package/build/cjs/cc/AlarmSensorCC.js +22 -2
  3. package/build/cjs/cc/AlarmSensorCC.js.map +2 -2
  4. package/build/cjs/cc/AssociationCC.js +6 -5
  5. package/build/cjs/cc/AssociationCC.js.map +2 -2
  6. package/build/cjs/cc/AssociationGroupInfoCC.js +4 -5
  7. package/build/cjs/cc/AssociationGroupInfoCC.js.map +2 -2
  8. package/build/cjs/cc/BarrierOperatorCC.d.ts +6 -3
  9. package/build/cjs/cc/BarrierOperatorCC.js +40 -6
  10. package/build/cjs/cc/BarrierOperatorCC.js.map +2 -2
  11. package/build/cjs/cc/BasicCC.d.ts +4 -1
  12. package/build/cjs/cc/BasicCC.js +18 -0
  13. package/build/cjs/cc/BasicCC.js.map +3 -3
  14. package/build/cjs/cc/BasicWindowCoveringCC.js.map +2 -2
  15. package/build/cjs/cc/BatteryCC.js +16 -3
  16. package/build/cjs/cc/BatteryCC.js.map +2 -2
  17. package/build/cjs/cc/BinarySensorCC.js.map +2 -2
  18. package/build/cjs/cc/BinarySwitchCC.d.ts +4 -1
  19. package/build/cjs/cc/BinarySwitchCC.js +18 -0
  20. package/build/cjs/cc/BinarySwitchCC.js.map +3 -3
  21. package/build/cjs/cc/CRC16CC.d.ts +3 -2
  22. package/build/cjs/cc/CRC16CC.js +7 -1
  23. package/build/cjs/cc/CRC16CC.js.map +3 -3
  24. package/build/cjs/cc/CentralSceneCC.d.ts +4 -1
  25. package/build/cjs/cc/CentralSceneCC.js +34 -2
  26. package/build/cjs/cc/CentralSceneCC.js.map +2 -2
  27. package/build/cjs/cc/ClimateControlScheduleCC.d.ts +6 -3
  28. package/build/cjs/cc/ClimateControlScheduleCC.js +54 -6
  29. package/build/cjs/cc/ClimateControlScheduleCC.js.map +2 -2
  30. package/build/cjs/cc/ClockCC.d.ts +2 -1
  31. package/build/cjs/cc/ClockCC.js +19 -2
  32. package/build/cjs/cc/ClockCC.js.map +2 -2
  33. package/build/cjs/cc/ColorSwitchCC.js +1 -4
  34. package/build/cjs/cc/ColorSwitchCC.js.map +2 -2
  35. package/build/cjs/cc/ConfigurationCC.d.ts +3 -2
  36. package/build/cjs/cc/ConfigurationCC.js +62 -8
  37. package/build/cjs/cc/ConfigurationCC.js.map +2 -2
  38. package/build/cjs/cc/DeviceResetLocallyCC.js.map +2 -2
  39. package/build/cjs/cc/DoorLockCC.js.map +2 -2
  40. package/build/cjs/cc/DoorLockLoggingCC.d.ts +3 -1
  41. package/build/cjs/cc/DoorLockLoggingCC.js +35 -2
  42. package/build/cjs/cc/DoorLockLoggingCC.js.map +2 -2
  43. package/build/cjs/cc/EntryControlCC.d.ts +5 -1
  44. package/build/cjs/cc/EntryControlCC.js +57 -2
  45. package/build/cjs/cc/EntryControlCC.js.map +2 -2
  46. package/build/cjs/cc/FirmwareUpdateMetaDataCC.js +4 -16
  47. package/build/cjs/cc/FirmwareUpdateMetaDataCC.js.map +2 -2
  48. package/build/cjs/cc/HumidityControlModeCC.d.ts +3 -1
  49. package/build/cjs/cc/HumidityControlModeCC.js +14 -2
  50. package/build/cjs/cc/HumidityControlModeCC.js.map +2 -2
  51. package/build/cjs/cc/HumidityControlOperatingStateCC.d.ts +3 -1
  52. package/build/cjs/cc/HumidityControlOperatingStateCC.js +4 -0
  53. package/build/cjs/cc/HumidityControlOperatingStateCC.js.map +2 -2
  54. package/build/cjs/cc/HumidityControlSetpointCC.d.ts +8 -4
  55. package/build/cjs/cc/HumidityControlSetpointCC.js +61 -12
  56. package/build/cjs/cc/HumidityControlSetpointCC.js.map +2 -2
  57. package/build/cjs/cc/IndicatorCC.js +1 -5
  58. package/build/cjs/cc/IndicatorCC.js.map +2 -2
  59. package/build/cjs/cc/IrrigationCC.d.ts +15 -9
  60. package/build/cjs/cc/IrrigationCC.js +260 -24
  61. package/build/cjs/cc/IrrigationCC.js.map +2 -2
  62. package/build/cjs/cc/LanguageCC.d.ts +2 -1
  63. package/build/cjs/cc/LanguageCC.js +18 -2
  64. package/build/cjs/cc/LanguageCC.js.map +2 -2
  65. package/build/cjs/cc/ManufacturerProprietaryCC.js.map +2 -2
  66. package/build/cjs/cc/ManufacturerSpecificCC.js +4 -5
  67. package/build/cjs/cc/ManufacturerSpecificCC.js.map +2 -2
  68. package/build/cjs/cc/MeterCC.js +8 -21
  69. package/build/cjs/cc/MeterCC.js.map +2 -2
  70. package/build/cjs/cc/MultiChannelAssociationCC.js +11 -7
  71. package/build/cjs/cc/MultiChannelAssociationCC.js.map +2 -2
  72. package/build/cjs/cc/MultiChannelCC.d.ts +5 -2
  73. package/build/cjs/cc/MultiChannelCC.js +35 -12
  74. package/build/cjs/cc/MultiChannelCC.js.map +3 -3
  75. package/build/cjs/cc/MultilevelSensorCC.js.map +2 -2
  76. package/build/cjs/cc/MultilevelSwitchCC.d.ts +5 -1
  77. package/build/cjs/cc/MultilevelSwitchCC.js +30 -0
  78. package/build/cjs/cc/MultilevelSwitchCC.js.map +3 -3
  79. package/build/cjs/cc/NotificationCC.js +29 -11
  80. package/build/cjs/cc/NotificationCC.js.map +2 -2
  81. package/build/cjs/cc/PowerlevelCC.js.map +1 -1
  82. package/build/cjs/cc/ProtectionCC.js.map +2 -2
  83. package/build/cjs/cc/SceneActuatorConfigurationCC.d.ts +3 -2
  84. package/build/cjs/cc/SceneActuatorConfigurationCC.js +38 -5
  85. package/build/cjs/cc/SceneActuatorConfigurationCC.js.map +2 -2
  86. package/build/cjs/cc/SceneControllerConfigurationCC.d.ts +3 -2
  87. package/build/cjs/cc/SceneControllerConfigurationCC.js +25 -4
  88. package/build/cjs/cc/SceneControllerConfigurationCC.js.map +2 -2
  89. package/build/cjs/cc/ScheduleEntryLockCC.js.map +2 -2
  90. package/build/cjs/cc/Security2CC.d.ts +2 -1
  91. package/build/cjs/cc/Security2CC.js +31 -3
  92. package/build/cjs/cc/Security2CC.js.map +2 -2
  93. package/build/cjs/cc/SecurityCC.d.ts +2 -1
  94. package/build/cjs/cc/SecurityCC.js +7 -6
  95. package/build/cjs/cc/SecurityCC.js.map +2 -2
  96. package/build/cjs/cc/SoundSwitchCC.js +6 -6
  97. package/build/cjs/cc/SoundSwitchCC.js.map +2 -2
  98. package/build/cjs/cc/SupervisionCC.d.ts +2 -1
  99. package/build/cjs/cc/SupervisionCC.js +6 -0
  100. package/build/cjs/cc/SupervisionCC.js.map +3 -3
  101. package/build/cjs/cc/ThermostatFanModeCC.d.ts +3 -1
  102. package/build/cjs/cc/ThermostatFanModeCC.js +17 -2
  103. package/build/cjs/cc/ThermostatFanModeCC.js.map +2 -2
  104. package/build/cjs/cc/ThermostatFanStateCC.d.ts +3 -1
  105. package/build/cjs/cc/ThermostatFanStateCC.js +4 -0
  106. package/build/cjs/cc/ThermostatFanStateCC.js.map +2 -2
  107. package/build/cjs/cc/ThermostatModeCC.js +2 -4
  108. package/build/cjs/cc/ThermostatModeCC.js.map +2 -2
  109. package/build/cjs/cc/ThermostatOperatingStateCC.js.map +2 -2
  110. package/build/cjs/cc/ThermostatSetpointCC.d.ts +4 -1
  111. package/build/cjs/cc/ThermostatSetpointCC.js +18 -0
  112. package/build/cjs/cc/ThermostatSetpointCC.js.map +3 -3
  113. package/build/cjs/cc/TimeCC.d.ts +1 -1
  114. package/build/cjs/cc/TimeCC.js +11 -2
  115. package/build/cjs/cc/TimeCC.js.map +2 -2
  116. package/build/cjs/cc/TransportServiceCC.js.map +2 -2
  117. package/build/cjs/cc/UserCodeCC.d.ts +2 -1
  118. package/build/cjs/cc/UserCodeCC.js +32 -8
  119. package/build/cjs/cc/UserCodeCC.js.map +2 -2
  120. package/build/cjs/cc/UserCredentialCC.js +4 -6
  121. package/build/cjs/cc/UserCredentialCC.js.map +2 -2
  122. package/build/cjs/cc/VersionCC.d.ts +1 -0
  123. package/build/cjs/cc/VersionCC.js +32 -0
  124. package/build/cjs/cc/VersionCC.js.map +2 -2
  125. package/build/cjs/cc/WakeUpCC.d.ts +2 -0
  126. package/build/cjs/cc/WakeUpCC.js +14 -0
  127. package/build/cjs/cc/WakeUpCC.js.map +2 -2
  128. package/build/cjs/cc/WindowCoveringCC.js +5 -1
  129. package/build/cjs/cc/WindowCoveringCC.js.map +2 -2
  130. package/build/cjs/cc/ZWaveProtocolCC.js +3 -11
  131. package/build/cjs/cc/ZWaveProtocolCC.js.map +2 -2
  132. package/build/cjs/cc/_CCValues.generated.d.ts +2 -2
  133. package/build/cjs/cc/_CCValues.generated.js.map +2 -2
  134. package/build/cjs/cc/index.d.ts +179 -179
  135. package/build/cjs/cc/index.js.map +1 -1
  136. package/build/cjs/cc/manufacturerProprietary/Decorators.js.map +2 -2
  137. package/build/cjs/cc/manufacturerProprietary/FibaroCC.d.ts +2 -1
  138. package/build/cjs/cc/manufacturerProprietary/FibaroCC.js +30 -2
  139. package/build/cjs/cc/manufacturerProprietary/FibaroCC.js.map +2 -2
  140. package/build/cjs/lib/API.d.ts +3 -2
  141. package/build/cjs/lib/API.js.map +2 -2
  142. package/build/cjs/lib/CommandClass.d.ts +20 -0
  143. package/build/cjs/lib/CommandClass.js +52 -11
  144. package/build/cjs/lib/CommandClass.js.map +3 -3
  145. package/build/cjs/lib/CommandClassDecorators.js.map +2 -2
  146. package/build/cjs/lib/EncapsulatingCommandClass.js.map +2 -2
  147. package/build/cjs/lib/NotificationEventPayload.js.map +2 -2
  148. package/build/cjs/lib/Security2/Extension.js +1 -4
  149. package/build/cjs/lib/Security2/Extension.js.map +2 -2
  150. package/build/cjs/lib/Security2/shared.js.map +2 -2
  151. package/build/cjs/lib/SetValueResult.js.map +1 -1
  152. package/build/cjs/lib/Values.d.ts +1 -1
  153. package/build/cjs/lib/Values.js.map +2 -2
  154. package/build/cjs/lib/_CCAPI.generated.js.map +1 -1
  155. package/build/cjs/lib/_Types.d.ts +30 -30
  156. package/build/cjs/lib/_Types.js.map +2 -2
  157. package/build/cjs/lib/serializers.js +1 -4
  158. package/build/cjs/lib/serializers.js.map +2 -2
  159. package/build/cjs/lib/utils.js.map +2 -2
  160. package/build/esm/cc/AlarmSensorCC.d.ts +3 -1
  161. package/build/esm/cc/AlarmSensorCC.d.ts.map +1 -1
  162. package/build/esm/cc/AlarmSensorCC.js +26 -9
  163. package/build/esm/cc/AlarmSensorCC.js.map +1 -1
  164. package/build/esm/cc/AssociationCC.d.ts.map +1 -1
  165. package/build/esm/cc/AssociationCC.js +8 -7
  166. package/build/esm/cc/AssociationCC.js.map +1 -1
  167. package/build/esm/cc/AssociationGroupInfoCC.d.ts.map +1 -1
  168. package/build/esm/cc/AssociationGroupInfoCC.js +10 -12
  169. package/build/esm/cc/AssociationGroupInfoCC.js.map +1 -1
  170. package/build/esm/cc/BarrierOperatorCC.d.ts +6 -3
  171. package/build/esm/cc/BarrierOperatorCC.d.ts.map +1 -1
  172. package/build/esm/cc/BarrierOperatorCC.js +55 -27
  173. package/build/esm/cc/BarrierOperatorCC.js.map +1 -1
  174. package/build/esm/cc/BasicCC.d.ts +4 -1
  175. package/build/esm/cc/BasicCC.d.ts.map +1 -1
  176. package/build/esm/cc/BasicCC.js +30 -7
  177. package/build/esm/cc/BasicCC.js.map +1 -1
  178. package/build/esm/cc/BasicWindowCoveringCC.d.ts.map +1 -1
  179. package/build/esm/cc/BasicWindowCoveringCC.js +2 -5
  180. package/build/esm/cc/BasicWindowCoveringCC.js.map +1 -1
  181. package/build/esm/cc/BatteryCC.d.ts.map +1 -1
  182. package/build/esm/cc/BatteryCC.js +12 -12
  183. package/build/esm/cc/BatteryCC.js.map +1 -1
  184. package/build/esm/cc/BinarySensorCC.d.ts.map +1 -1
  185. package/build/esm/cc/BinarySensorCC.js +4 -5
  186. package/build/esm/cc/BinarySensorCC.js.map +1 -1
  187. package/build/esm/cc/BinarySwitchCC.d.ts +4 -1
  188. package/build/esm/cc/BinarySwitchCC.d.ts.map +1 -1
  189. package/build/esm/cc/BinarySwitchCC.js +31 -6
  190. package/build/esm/cc/BinarySwitchCC.js.map +1 -1
  191. package/build/esm/cc/CRC16CC.d.ts +3 -2
  192. package/build/esm/cc/CRC16CC.d.ts.map +1 -1
  193. package/build/esm/cc/CRC16CC.js +10 -4
  194. package/build/esm/cc/CRC16CC.js.map +1 -1
  195. package/build/esm/cc/CentralSceneCC.d.ts +4 -1
  196. package/build/esm/cc/CentralSceneCC.d.ts.map +1 -1
  197. package/build/esm/cc/CentralSceneCC.js +37 -7
  198. package/build/esm/cc/CentralSceneCC.js.map +1 -1
  199. package/build/esm/cc/ClimateControlScheduleCC.d.ts +6 -3
  200. package/build/esm/cc/ClimateControlScheduleCC.d.ts.map +1 -1
  201. package/build/esm/cc/ClimateControlScheduleCC.js +63 -18
  202. package/build/esm/cc/ClimateControlScheduleCC.js.map +1 -1
  203. package/build/esm/cc/ClockCC.d.ts +2 -1
  204. package/build/esm/cc/ClockCC.d.ts.map +1 -1
  205. package/build/esm/cc/ClockCC.js +26 -9
  206. package/build/esm/cc/ClockCC.js.map +1 -1
  207. package/build/esm/cc/ColorSwitchCC.d.ts.map +1 -1
  208. package/build/esm/cc/ColorSwitchCC.js +17 -20
  209. package/build/esm/cc/ColorSwitchCC.js.map +1 -1
  210. package/build/esm/cc/ConfigurationCC.d.ts +3 -2
  211. package/build/esm/cc/ConfigurationCC.d.ts.map +1 -1
  212. package/build/esm/cc/ConfigurationCC.js +83 -41
  213. package/build/esm/cc/ConfigurationCC.js.map +1 -1
  214. package/build/esm/cc/DeviceResetLocallyCC.d.ts.map +1 -1
  215. package/build/esm/cc/DeviceResetLocallyCC.js +1 -2
  216. package/build/esm/cc/DeviceResetLocallyCC.js.map +1 -1
  217. package/build/esm/cc/DoorLockCC.d.ts.map +1 -1
  218. package/build/esm/cc/DoorLockCC.js +25 -29
  219. package/build/esm/cc/DoorLockCC.js.map +1 -1
  220. package/build/esm/cc/DoorLockLoggingCC.d.ts +3 -1
  221. package/build/esm/cc/DoorLockLoggingCC.d.ts.map +1 -1
  222. package/build/esm/cc/DoorLockLoggingCC.js +39 -5
  223. package/build/esm/cc/DoorLockLoggingCC.js.map +1 -1
  224. package/build/esm/cc/EntryControlCC.d.ts +5 -1
  225. package/build/esm/cc/EntryControlCC.d.ts.map +1 -1
  226. package/build/esm/cc/EntryControlCC.js +74 -14
  227. package/build/esm/cc/EntryControlCC.js.map +1 -1
  228. package/build/esm/cc/FirmwareUpdateMetaDataCC.d.ts.map +1 -1
  229. package/build/esm/cc/FirmwareUpdateMetaDataCC.js +15 -27
  230. package/build/esm/cc/FirmwareUpdateMetaDataCC.js.map +1 -1
  231. package/build/esm/cc/HumidityControlModeCC.d.ts +3 -1
  232. package/build/esm/cc/HumidityControlModeCC.d.ts.map +1 -1
  233. package/build/esm/cc/HumidityControlModeCC.js +15 -7
  234. package/build/esm/cc/HumidityControlModeCC.js.map +1 -1
  235. package/build/esm/cc/HumidityControlOperatingStateCC.d.ts +3 -1
  236. package/build/esm/cc/HumidityControlOperatingStateCC.d.ts.map +1 -1
  237. package/build/esm/cc/HumidityControlOperatingStateCC.js +5 -1
  238. package/build/esm/cc/HumidityControlOperatingStateCC.js.map +1 -1
  239. package/build/esm/cc/HumidityControlSetpointCC.d.ts +8 -4
  240. package/build/esm/cc/HumidityControlSetpointCC.d.ts.map +1 -1
  241. package/build/esm/cc/HumidityControlSetpointCC.js +60 -34
  242. package/build/esm/cc/HumidityControlSetpointCC.js.map +1 -1
  243. package/build/esm/cc/IndicatorCC.d.ts.map +1 -1
  244. package/build/esm/cc/IndicatorCC.js +19 -38
  245. package/build/esm/cc/IndicatorCC.js.map +1 -1
  246. package/build/esm/cc/IrrigationCC.d.ts +15 -9
  247. package/build/esm/cc/IrrigationCC.d.ts.map +1 -1
  248. package/build/esm/cc/IrrigationCC.js +276 -67
  249. package/build/esm/cc/IrrigationCC.js.map +1 -1
  250. package/build/esm/cc/LanguageCC.d.ts +2 -1
  251. package/build/esm/cc/LanguageCC.d.ts.map +1 -1
  252. package/build/esm/cc/LanguageCC.js +18 -6
  253. package/build/esm/cc/LanguageCC.js.map +1 -1
  254. package/build/esm/cc/ManufacturerProprietaryCC.d.ts.map +1 -1
  255. package/build/esm/cc/ManufacturerProprietaryCC.js +1 -2
  256. package/build/esm/cc/ManufacturerProprietaryCC.js.map +1 -1
  257. package/build/esm/cc/ManufacturerSpecificCC.d.ts.map +1 -1
  258. package/build/esm/cc/ManufacturerSpecificCC.js +5 -8
  259. package/build/esm/cc/ManufacturerSpecificCC.js.map +1 -1
  260. package/build/esm/cc/MeterCC.d.ts.map +1 -1
  261. package/build/esm/cc/MeterCC.js +15 -29
  262. package/build/esm/cc/MeterCC.js.map +1 -1
  263. package/build/esm/cc/MultiChannelAssociationCC.d.ts.map +1 -1
  264. package/build/esm/cc/MultiChannelAssociationCC.js +15 -20
  265. package/build/esm/cc/MultiChannelAssociationCC.js.map +1 -1
  266. package/build/esm/cc/MultiChannelCC.d.ts +5 -2
  267. package/build/esm/cc/MultiChannelCC.d.ts.map +1 -1
  268. package/build/esm/cc/MultiChannelCC.js +43 -29
  269. package/build/esm/cc/MultiChannelCC.js.map +1 -1
  270. package/build/esm/cc/MultilevelSensorCC.d.ts.map +1 -1
  271. package/build/esm/cc/MultilevelSensorCC.js +11 -11
  272. package/build/esm/cc/MultilevelSensorCC.js.map +1 -1
  273. package/build/esm/cc/MultilevelSwitchCC.d.ts +5 -1
  274. package/build/esm/cc/MultilevelSwitchCC.d.ts.map +1 -1
  275. package/build/esm/cc/MultilevelSwitchCC.js +56 -16
  276. package/build/esm/cc/MultilevelSwitchCC.js.map +1 -1
  277. package/build/esm/cc/NotificationCC.d.ts.map +1 -1
  278. package/build/esm/cc/NotificationCC.js +66 -55
  279. package/build/esm/cc/NotificationCC.js.map +1 -1
  280. package/build/esm/cc/PowerlevelCC.d.ts.map +1 -1
  281. package/build/esm/cc/ProtectionCC.d.ts.map +1 -1
  282. package/build/esm/cc/ProtectionCC.js +10 -9
  283. package/build/esm/cc/ProtectionCC.js.map +1 -1
  284. package/build/esm/cc/SceneActuatorConfigurationCC.d.ts +3 -2
  285. package/build/esm/cc/SceneActuatorConfigurationCC.d.ts.map +1 -1
  286. package/build/esm/cc/SceneActuatorConfigurationCC.js +44 -21
  287. package/build/esm/cc/SceneActuatorConfigurationCC.js.map +1 -1
  288. package/build/esm/cc/SceneControllerConfigurationCC.d.ts +3 -2
  289. package/build/esm/cc/SceneControllerConfigurationCC.d.ts.map +1 -1
  290. package/build/esm/cc/SceneControllerConfigurationCC.js +35 -28
  291. package/build/esm/cc/SceneControllerConfigurationCC.js.map +1 -1
  292. package/build/esm/cc/ScheduleEntryLockCC.d.ts.map +1 -1
  293. package/build/esm/cc/ScheduleEntryLockCC.js +13 -20
  294. package/build/esm/cc/ScheduleEntryLockCC.js.map +1 -1
  295. package/build/esm/cc/Security2CC.d.ts +2 -1
  296. package/build/esm/cc/Security2CC.d.ts.map +1 -1
  297. package/build/esm/cc/Security2CC.js +68 -32
  298. package/build/esm/cc/Security2CC.js.map +1 -1
  299. package/build/esm/cc/SecurityCC.d.ts +2 -1
  300. package/build/esm/cc/SecurityCC.d.ts.map +1 -1
  301. package/build/esm/cc/SecurityCC.js +16 -11
  302. package/build/esm/cc/SecurityCC.js.map +1 -1
  303. package/build/esm/cc/SoundSwitchCC.js +2 -2
  304. package/build/esm/cc/SoundSwitchCC.js.map +1 -1
  305. package/build/esm/cc/SupervisionCC.d.ts +2 -1
  306. package/build/esm/cc/SupervisionCC.d.ts.map +1 -1
  307. package/build/esm/cc/SupervisionCC.js +13 -6
  308. package/build/esm/cc/SupervisionCC.js.map +1 -1
  309. package/build/esm/cc/ThermostatFanModeCC.d.ts +3 -1
  310. package/build/esm/cc/ThermostatFanModeCC.d.ts.map +1 -1
  311. package/build/esm/cc/ThermostatFanModeCC.js +19 -9
  312. package/build/esm/cc/ThermostatFanModeCC.js.map +1 -1
  313. package/build/esm/cc/ThermostatFanStateCC.d.ts +3 -1
  314. package/build/esm/cc/ThermostatFanStateCC.d.ts.map +1 -1
  315. package/build/esm/cc/ThermostatFanStateCC.js +5 -1
  316. package/build/esm/cc/ThermostatFanStateCC.js.map +1 -1
  317. package/build/esm/cc/ThermostatModeCC.d.ts.map +1 -1
  318. package/build/esm/cc/ThermostatModeCC.js +2 -4
  319. package/build/esm/cc/ThermostatModeCC.js.map +1 -1
  320. package/build/esm/cc/ThermostatOperatingStateCC.d.ts.map +1 -1
  321. package/build/esm/cc/ThermostatOperatingStateCC.js +1 -2
  322. package/build/esm/cc/ThermostatOperatingStateCC.js.map +1 -1
  323. package/build/esm/cc/ThermostatSetpointCC.d.ts +4 -1
  324. package/build/esm/cc/ThermostatSetpointCC.d.ts.map +1 -1
  325. package/build/esm/cc/ThermostatSetpointCC.js +31 -19
  326. package/build/esm/cc/ThermostatSetpointCC.js.map +1 -1
  327. package/build/esm/cc/TimeCC.d.ts +1 -1
  328. package/build/esm/cc/TimeCC.d.ts.map +1 -1
  329. package/build/esm/cc/TimeCC.js +18 -9
  330. package/build/esm/cc/TimeCC.js.map +1 -1
  331. package/build/esm/cc/TransportServiceCC.d.ts.map +1 -1
  332. package/build/esm/cc/TransportServiceCC.js +8 -8
  333. package/build/esm/cc/TransportServiceCC.js.map +1 -1
  334. package/build/esm/cc/UserCodeCC.d.ts +2 -1
  335. package/build/esm/cc/UserCodeCC.d.ts.map +1 -1
  336. package/build/esm/cc/UserCodeCC.js +51 -36
  337. package/build/esm/cc/UserCodeCC.js.map +1 -1
  338. package/build/esm/cc/UserCredentialCC.d.ts.map +1 -1
  339. package/build/esm/cc/UserCredentialCC.js +42 -59
  340. package/build/esm/cc/UserCredentialCC.js.map +1 -1
  341. package/build/esm/cc/VersionCC.d.ts +1 -0
  342. package/build/esm/cc/VersionCC.d.ts.map +1 -1
  343. package/build/esm/cc/VersionCC.js +37 -3
  344. package/build/esm/cc/VersionCC.js.map +1 -1
  345. package/build/esm/cc/WakeUpCC.d.ts +2 -0
  346. package/build/esm/cc/WakeUpCC.d.ts.map +1 -1
  347. package/build/esm/cc/WakeUpCC.js +14 -0
  348. package/build/esm/cc/WakeUpCC.js.map +1 -1
  349. package/build/esm/cc/WindowCoveringCC.d.ts.map +1 -1
  350. package/build/esm/cc/WindowCoveringCC.js +10 -9
  351. package/build/esm/cc/WindowCoveringCC.js.map +1 -1
  352. package/build/esm/cc/ZWaveProtocolCC.d.ts.map +1 -1
  353. package/build/esm/cc/ZWaveProtocolCC.js +5 -26
  354. package/build/esm/cc/ZWaveProtocolCC.js.map +1 -1
  355. package/build/esm/cc/_CCValues.generated.d.ts +2 -2
  356. package/build/esm/cc/_CCValues.generated.d.ts.map +1 -1
  357. package/build/esm/cc/_CCValues.generated.js +637 -678
  358. package/build/esm/cc/_CCValues.generated.js.map +1 -1
  359. package/build/esm/cc/index.d.ts +179 -179
  360. package/build/esm/cc/index.d.ts.map +1 -1
  361. package/build/esm/cc/index.js +124 -124
  362. package/build/esm/cc/index.js.map +1 -1
  363. package/build/esm/cc/manufacturerProprietary/Decorators.d.ts.map +1 -1
  364. package/build/esm/cc/manufacturerProprietary/Decorators.js.map +1 -1
  365. package/build/esm/cc/manufacturerProprietary/FibaroCC.d.ts +2 -1
  366. package/build/esm/cc/manufacturerProprietary/FibaroCC.d.ts.map +1 -1
  367. package/build/esm/cc/manufacturerProprietary/FibaroCC.js +34 -4
  368. package/build/esm/cc/manufacturerProprietary/FibaroCC.js.map +1 -1
  369. package/build/esm/lib/API.d.ts +3 -2
  370. package/build/esm/lib/API.d.ts.map +1 -1
  371. package/build/esm/lib/API.js +1 -1
  372. package/build/esm/lib/API.js.map +1 -1
  373. package/build/esm/lib/CommandClass.d.ts +20 -0
  374. package/build/esm/lib/CommandClass.d.ts.map +1 -1
  375. package/build/esm/lib/CommandClass.js +50 -16
  376. package/build/esm/lib/CommandClass.js.map +1 -1
  377. package/build/esm/lib/CommandClassDecorators.d.ts.map +1 -1
  378. package/build/esm/lib/CommandClassDecorators.js +1 -2
  379. package/build/esm/lib/CommandClassDecorators.js.map +1 -1
  380. package/build/esm/lib/EncapsulatingCommandClass.d.ts.map +1 -1
  381. package/build/esm/lib/EncapsulatingCommandClass.js.map +1 -1
  382. package/build/esm/lib/NotificationEventPayload.d.ts.map +1 -1
  383. package/build/esm/lib/NotificationEventPayload.js.map +1 -1
  384. package/build/esm/lib/Security2/Extension.d.ts.map +1 -1
  385. package/build/esm/lib/Security2/Extension.js +2 -6
  386. package/build/esm/lib/Security2/Extension.js.map +1 -1
  387. package/build/esm/lib/Security2/shared.d.ts.map +1 -1
  388. package/build/esm/lib/Security2/shared.js.map +1 -1
  389. package/build/esm/lib/SetValueResult.d.ts.map +1 -1
  390. package/build/esm/lib/Values.d.ts +1 -1
  391. package/build/esm/lib/Values.d.ts.map +1 -1
  392. package/build/esm/lib/Values.js.map +1 -1
  393. package/build/esm/lib/_CCAPI.generated.d.ts.map +1 -1
  394. package/build/esm/lib/_Types.d.ts +30 -30
  395. package/build/esm/lib/_Types.d.ts.map +1 -1
  396. package/build/esm/lib/_Types.js.map +1 -1
  397. package/build/esm/lib/serializers.d.ts.map +1 -1
  398. package/build/esm/lib/serializers.js +1 -4
  399. package/build/esm/lib/serializers.js.map +1 -1
  400. package/build/esm/lib/traits.d.ts.map +1 -1
  401. package/build/esm/lib/utils.d.ts.map +1 -1
  402. package/build/esm/lib/utils.js +25 -31
  403. package/build/esm/lib/utils.js.map +1 -1
  404. package/package.json +7 -7
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../src_gen/cc/ProtectionCC.ts"],
4
- "sourcesContent": ["import * as __validateArgs from \"./ProtectionCC._validateArgs.js\";\nconst { validateArgs_ProtectionCCAPI_set, validateArgs_ProtectionCCAPI_setExclusiveControl, validateArgs_ProtectionCCAPI_setTimeout } = __validateArgs;\nimport { CommandClasses, type GetValueDB, MAX_NODES, type MaybeNotKnown, type MessageOrCCLogEntry, MessagePriority, type MessageRecord, type SupervisionResult, Timeout, type ValueID, ValueMetadata, type WithAddress, encodeBitMask, enumValuesToMetadataStates, getNodeTag, logDict, logList, logText, parseBitMask, validatePayload, } from \"@zwave-js/core\";\nimport { Bytes, getEnumMemberName, pick } from \"@zwave-js/shared\";\nimport { CCAPI, POLL_VALUE, type PollValueImplementation, SET_VALUE, SET_VALUE_HOOKS, type SetValueImplementation, type SetValueImplementationHooksFactory, 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, ccValueProperty, ccValues, commandClass, expectedCCResponse, implementedVersion, useSupervision, } from \"../lib/CommandClassDecorators.js\";\nimport { V } from \"../lib/Values.js\";\nimport { LocalProtectionState, ProtectionCommand, RFProtectionState, } from \"../lib/_Types.js\";\nimport type { CCEncodingContext, CCParsingContext } from \"../lib/traits.js\";\nimport { ProtectionCCValues } from \"./_CCValues.generated.js\";\nexport { ProtectionCCValues };\n@API(CommandClasses.Protection)\nexport class ProtectionCCAPI extends CCAPI {\n public supportsCommand(cmd: ProtectionCommand): MaybeNotKnown<boolean> {\n switch (cmd) {\n case ProtectionCommand.Get:\n return this.isSinglecast();\n case ProtectionCommand.Set:\n return true; // This is mandatory\n case ProtectionCommand.SupportedGet:\n return this.version >= 2 && this.isSinglecast();\n case ProtectionCommand.TimeoutGet:\n case ProtectionCommand.TimeoutSet: {\n return (this.isSinglecast()\n && this.tryGetValueDB()?.getValue<boolean>(ProtectionCCValues.supportsTimeout.endpoint(this.endpoint.index)));\n }\n case ProtectionCommand.ExclusiveControlGet:\n case ProtectionCommand.ExclusiveControlSet: {\n return (this.isSinglecast()\n && this.tryGetValueDB()?.getValue<boolean>(ProtectionCCValues.supportsExclusiveControl.endpoint(this.endpoint.index)));\n }\n }\n return super.supportsCommand(cmd);\n }\n protected override get [SET_VALUE](): SetValueImplementation {\n return async function (this: ProtectionCCAPI, { property }, value) {\n const valueDB = this.tryGetValueDB();\n if (property === \"local\") {\n if (typeof value !== \"number\") {\n throwWrongValueType(this.ccId, property, \"number\", typeof value);\n }\n // We need to set both values together, so retrieve the other one from the value DB\n const rf = valueDB?.getValue<RFProtectionState>(ProtectionCCValues.rfProtectionState.endpoint(this.endpoint.index));\n return this.set(value, rf);\n }\n else if (property === \"rf\") {\n if (typeof value !== \"number\") {\n throwWrongValueType(this.ccId, property, \"number\", typeof value);\n }\n // We need to set both values together, so retrieve the other one from the value DB\n const local = valueDB?.getValue<LocalProtectionState>(ProtectionCCValues.localProtectionState.endpoint(this.endpoint.index));\n return this.set(local ?? LocalProtectionState.Unprotected, value);\n }\n else if (property === \"exclusiveControlNodeId\") {\n if (typeof value !== \"number\") {\n throwWrongValueType(this.ccId, property, \"number\", typeof value);\n }\n return this.setExclusiveControl(value);\n }\n else {\n throwUnsupportedProperty(this.ccId, property);\n }\n };\n }\n protected get [POLL_VALUE](): PollValueImplementation {\n return async function (this: ProtectionCCAPI, { property }) {\n switch (property) {\n case \"local\":\n case \"rf\":\n return (await this.get())?.[property];\n case \"exclusiveControlNodeId\":\n return this.getExclusiveControl();\n default:\n throwUnsupportedProperty(this.ccId, property);\n }\n };\n }\n protected [SET_VALUE_HOOKS]: SetValueImplementationHooksFactory = ({ property }, value) => {\n if ((property === \"local\"\n && typeof value === \"number\")\n || (property === \"rf\" && typeof value === \"number\")) {\n return {\n forceVerifyChanges: () => true,\n verifyChanges: () => {\n if (this.isSinglecast()) {\n this.schedulePoll({ property }, value, {\n transition: \"fast\",\n });\n }\n },\n };\n }\n };\n public override isSetValueOptimistic(_valueId: ValueID): boolean {\n // Protection changes may be rejected depending on the node's current\n // exclusive/RF protection state, so we always read the state back.\n return false;\n }\n // oxlint-disable-next-line typescript/explicit-module-boundary-types\n public async get() {\n this.assertSupportsCommand(ProtectionCommand, ProtectionCommand.Get);\n const cc = new ProtectionCCGet({\n nodeId: this.endpoint.nodeId,\n endpointIndex: this.endpoint.index,\n });\n const response = await this.host.sendCommand<ProtectionCCReport>(cc, this.commandOptions);\n if (response) {\n return pick(response, [\"local\", \"rf\"]);\n }\n }\n @validateArgs_ProtectionCCAPI_set()\n public async set(local: LocalProtectionState, rf?: RFProtectionState): Promise<SupervisionResult | undefined> {\n this.assertSupportsCommand(ProtectionCommand, ProtectionCommand.Set);\n const cc = new ProtectionCCSet({\n nodeId: this.endpoint.nodeId,\n endpointIndex: this.endpoint.index,\n local,\n rf,\n });\n return this.host.sendCommand(cc, this.commandOptions);\n }\n // oxlint-disable-next-line typescript/explicit-module-boundary-types\n public async getSupported() {\n this.assertSupportsCommand(ProtectionCommand, ProtectionCommand.SupportedGet);\n const cc = new ProtectionCCSupportedGet({\n nodeId: this.endpoint.nodeId,\n endpointIndex: this.endpoint.index,\n });\n const response = await this.host.sendCommand<ProtectionCCSupportedReport>(cc, this.commandOptions);\n if (response) {\n return pick(response, [\n \"supportsExclusiveControl\",\n \"supportsTimeout\",\n \"supportedLocalStates\",\n \"supportedRFStates\",\n ]);\n }\n }\n public async getExclusiveControl(): Promise<MaybeNotKnown<number>> {\n this.assertSupportsCommand(ProtectionCommand, ProtectionCommand.ExclusiveControlGet);\n const cc = new ProtectionCCExclusiveControlGet({\n nodeId: this.endpoint.nodeId,\n endpointIndex: this.endpoint.index,\n });\n const response = await this.host.sendCommand<ProtectionCCExclusiveControlReport>(cc, this.commandOptions);\n return response?.exclusiveControlNodeId;\n }\n @validateArgs_ProtectionCCAPI_setExclusiveControl()\n public async setExclusiveControl(nodeId: number): Promise<SupervisionResult | undefined> {\n this.assertSupportsCommand(ProtectionCommand, ProtectionCommand.ExclusiveControlSet);\n const cc = new ProtectionCCExclusiveControlSet({\n nodeId: this.endpoint.nodeId,\n endpointIndex: this.endpoint.index,\n exclusiveControlNodeId: nodeId,\n });\n return this.host.sendCommand(cc, this.commandOptions);\n }\n public async getTimeout(): Promise<MaybeNotKnown<Timeout>> {\n this.assertSupportsCommand(ProtectionCommand, ProtectionCommand.TimeoutGet);\n const cc = new ProtectionCCTimeoutGet({\n nodeId: this.endpoint.nodeId,\n endpointIndex: this.endpoint.index,\n });\n const response = await this.host.sendCommand<ProtectionCCTimeoutReport>(cc, this.commandOptions);\n return response?.timeout;\n }\n @validateArgs_ProtectionCCAPI_setTimeout()\n public async setTimeout(timeout: Timeout): Promise<SupervisionResult | undefined> {\n this.assertSupportsCommand(ProtectionCommand, ProtectionCommand.TimeoutSet);\n const cc = new ProtectionCCTimeoutSet({\n nodeId: this.endpoint.nodeId,\n endpointIndex: this.endpoint.index,\n timeout,\n });\n return this.host.sendCommand(cc, this.commandOptions);\n }\n}\n@commandClass(CommandClasses.Protection)\n@implementedVersion(2)\n@ccValues(ProtectionCCValues)\nexport class ProtectionCC extends CommandClass {\n declare ccCommand: ProtectionCommand;\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.Protection, 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 // We need to do some queries after a potential timeout\n // In this case, do now mark this CC as interviewed completely\n let hadCriticalTimeout = false;\n // First find out what the device supports\n if (api.version >= 2) {\n ctx.logNode(node.id, {\n message: \"querying protection capabilities...\",\n direction: \"outbound\",\n });\n const resp = await api.getSupported();\n if (resp) {\n const logMessage = logText(\"received protection capabilities:\", {\n nested: logDict({\n \"exclusive control\": resp.supportsExclusiveControl,\n timeout: resp.supportsTimeout,\n \"local protection states\": logList(resp.supportedLocalStates.map((local) => getEnumMemberName(LocalProtectionState, local))),\n \"RF protection states\": logList(resp.supportedRFStates.map((local) => getEnumMemberName(RFProtectionState, local))),\n }),\n });\n ctx.logNode(node.id, {\n message: logMessage,\n direction: \"inbound\",\n });\n }\n else {\n hadCriticalTimeout = true;\n }\n }\n await this.refreshValues(ctx, { tag: \"interview\" });\n // Remember that the interview is complete\n if (!hadCriticalTimeout)\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.Protection, ctx, endpoint).withOptions({\n priority: options?.priority ?? MessagePriority.NodeQuery,\n tag: options?.tag,\n });\n const supportsExclusiveControl = !!this.getValue(ctx, ProtectionCCValues.supportsExclusiveControl);\n const supportsTimeout = !!this.getValue(ctx, ProtectionCCValues.supportsTimeout);\n // Query the current state\n ctx.logNode(node.id, {\n message: \"querying protection status...\",\n direction: \"outbound\",\n });\n const protectionResp = await api.get();\n if (protectionResp) {\n let logMessage = `received protection status:\nlocal: ${getEnumMemberName(LocalProtectionState, protectionResp.local)}`;\n if (protectionResp.rf != undefined) {\n logMessage += `\nrf ${getEnumMemberName(RFProtectionState, protectionResp.rf)}`;\n }\n ctx.logNode(node.id, {\n message: logMessage,\n direction: \"inbound\",\n });\n }\n if (supportsTimeout) {\n // Query the current timeout\n ctx.logNode(node.id, {\n message: \"querying protection timeout...\",\n direction: \"outbound\",\n });\n const timeout = await api.getTimeout();\n if (timeout) {\n ctx.logNode(node.id, {\n message: `received timeout: ${timeout.toString()}`,\n direction: \"inbound\",\n });\n }\n }\n if (supportsExclusiveControl) {\n // Query the current timeout\n ctx.logNode(node.id, {\n message: \"querying exclusive control node...\",\n direction: \"outbound\",\n });\n const nodeId = await api.getExclusiveControl();\n if (nodeId != undefined) {\n ctx.logNode(node.id, {\n message: (nodeId !== 0\n ? getNodeTag(nodeId)\n : `no node`) + ` has exclusive control`,\n direction: \"inbound\",\n });\n }\n }\n }\n}\n// @publicAPI\nexport interface ProtectionCCSetOptions {\n local: LocalProtectionState;\n rf?: RFProtectionState;\n}\n@CCCommand(ProtectionCommand.Set)\n@useSupervision()\nexport class ProtectionCCSet extends ProtectionCC {\n public constructor(options: WithAddress<ProtectionCCSetOptions>) {\n super(options);\n this.local = options.local;\n this.rf = options.rf;\n }\n public static from(raw: CCRaw, ctx: CCParsingContext): ProtectionCCSet {\n validatePayload(raw.payload.length >= 1);\n const local: LocalProtectionState = raw.payload[0] & 0b1111;\n let rf: RFProtectionState | undefined;\n if (raw.payload.length >= 2) {\n rf = raw.payload[1] & 0b1111;\n }\n return new this({\n nodeId: ctx.sourceNodeId,\n local,\n rf,\n });\n }\n public local: LocalProtectionState;\n public rf?: RFProtectionState;\n public serialize(ctx: CCEncodingContext): Promise<Bytes> {\n this.payload = Bytes.from([\n this.local & 0b1111,\n (this.rf ?? RFProtectionState.Unprotected) & 0b1111,\n ]);\n const ccVersion = getEffectiveCCVersion(ctx, this);\n if (ccVersion < 2 && ctx.getDeviceConfig?.(this.nodeId as number)?.compat?.encodeCCsUsingTargetVersion) {\n // When forcing CC version 1, only include the local state\n this.payload = this.payload.subarray(0, 1);\n }\n return super.serialize(ctx);\n }\n public toLogEntry(ctx?: GetValueDB): MessageOrCCLogEntry {\n const message: MessageRecord = {\n local: getEnumMemberName(LocalProtectionState, this.local),\n };\n if (this.rf != undefined) {\n message.rf = getEnumMemberName(RFProtectionState, this.rf);\n }\n return {\n ...super.toLogEntry(ctx),\n message,\n };\n }\n}\n// @publicAPI\nexport interface ProtectionCCReportOptions {\n local: LocalProtectionState;\n rf?: RFProtectionState;\n}\n@CCCommand(ProtectionCommand.Report)\n@ccValueProperty(\"local\", ProtectionCCValues.localProtectionState)\n@ccValueProperty(\"rf\", ProtectionCCValues.rfProtectionState)\nexport class ProtectionCCReport extends ProtectionCC {\n public constructor(options: WithAddress<ProtectionCCReportOptions>) {\n super(options);\n this.local = options.local;\n this.rf = options.rf;\n }\n public static from(raw: CCRaw, ctx: CCParsingContext): ProtectionCCReport {\n validatePayload(raw.payload.length >= 1);\n const local: LocalProtectionState = raw.payload[0] & 0b1111;\n let rf: RFProtectionState | undefined;\n if (raw.payload.length >= 2) {\n rf = raw.payload[1] & 0b1111;\n }\n return new this({\n nodeId: ctx.sourceNodeId,\n local,\n rf,\n });\n }\n public readonly local: LocalProtectionState;\n public readonly rf?: RFProtectionState;\n public serialize(ctx: CCEncodingContext): Promise<Bytes> {\n this.payload = this.rf !== undefined\n ? Bytes.from([this.local & 0b1111, this.rf & 0b1111])\n : Bytes.from([this.local & 0b1111]);\n return super.serialize(ctx);\n }\n public toLogEntry(ctx?: GetValueDB): MessageOrCCLogEntry {\n const message: MessageRecord = {\n local: getEnumMemberName(LocalProtectionState, this.local),\n };\n if (this.rf != undefined) {\n message.rf = getEnumMemberName(RFProtectionState, this.rf);\n }\n return {\n ...super.toLogEntry(ctx),\n message,\n };\n }\n}\n@CCCommand(ProtectionCommand.Get)\n@expectedCCResponse(ProtectionCCReport)\nexport class ProtectionCCGet extends ProtectionCC {\n}\n// @publicAPI\nexport interface ProtectionCCSupportedReportOptions {\n supportsTimeout: boolean;\n supportsExclusiveControl: boolean;\n supportedLocalStates: LocalProtectionState[];\n supportedRFStates: RFProtectionState[];\n}\n@CCCommand(ProtectionCommand.SupportedReport)\n@ccValueProperty(\"supportsExclusiveControl\", ProtectionCCValues.supportsExclusiveControl)\n@ccValueProperty(\"supportsTimeout\", ProtectionCCValues.supportsTimeout)\n@ccValueProperty(\"supportedLocalStates\", ProtectionCCValues.supportedLocalStates)\n@ccValueProperty(\"supportedRFStates\", ProtectionCCValues.supportedRFStates)\nexport class ProtectionCCSupportedReport extends ProtectionCC {\n public constructor(options: WithAddress<ProtectionCCSupportedReportOptions>) {\n super(options);\n this.supportsTimeout = options.supportsTimeout;\n this.supportsExclusiveControl = options.supportsExclusiveControl;\n this.supportedLocalStates = options.supportedLocalStates;\n this.supportedRFStates = options.supportedRFStates;\n }\n public static from(raw: CCRaw, ctx: CCParsingContext): ProtectionCCSupportedReport {\n validatePayload(raw.payload.length >= 5);\n const supportsTimeout = !!(raw.payload[0] & 0b1);\n const supportsExclusiveControl = !!(raw.payload[0] & 0b10);\n const supportedLocalStates: LocalProtectionState[] = parseBitMask(raw.payload.subarray(1, 3), LocalProtectionState.Unprotected);\n const supportedRFStates: RFProtectionState[] = parseBitMask(raw.payload.subarray(3, 5), RFProtectionState.Unprotected);\n return new this({\n nodeId: ctx.sourceNodeId,\n supportsTimeout,\n supportsExclusiveControl,\n supportedLocalStates,\n supportedRFStates,\n });\n }\n public persistValues(ctx: PersistValuesContext): boolean {\n if (!super.persistValues(ctx))\n return false;\n // This command only exists in V2. Ignore it if the device advertises a lower version.\n if (getEffectiveCCVersion(ctx, this) < 2)\n return true;\n // update metadata (partially) for the local and rf values\n const localStateValue = ProtectionCCValues.localProtectionState;\n this.setMetadata(ctx, localStateValue, {\n ...localStateValue.meta,\n states: enumValuesToMetadataStates(LocalProtectionState, this.supportedLocalStates),\n });\n const rfStateValue = ProtectionCCValues.rfProtectionState;\n this.setMetadata(ctx, rfStateValue, {\n ...rfStateValue.meta,\n states: enumValuesToMetadataStates(RFProtectionState, this.supportedRFStates),\n });\n return true;\n }\n public readonly supportsExclusiveControl: boolean;\n public readonly supportsTimeout: boolean;\n public readonly supportedLocalStates: LocalProtectionState[];\n public readonly supportedRFStates: RFProtectionState[];\n public serialize(ctx: CCEncodingContext): Promise<Bytes> {\n const flags = (this.supportsTimeout ? 0b1 : 0)\n | (this.supportsExclusiveControl ? 0b10 : 0);\n this.payload = Bytes.concat([\n [flags],\n encodeBitMask(this.supportedLocalStates, 15, LocalProtectionState.Unprotected),\n encodeBitMask(this.supportedRFStates, 15, RFProtectionState.Unprotected),\n ]);\n return super.serialize(ctx);\n }\n public toLogEntry(ctx?: GetValueDB): MessageOrCCLogEntry {\n return {\n ...super.toLogEntry(ctx),\n message: {\n \"supports exclusive control\": this.supportsExclusiveControl,\n \"supports timeout\": this.supportsTimeout,\n \"local protection states\": logList(this.supportedLocalStates.map((local) => getEnumMemberName(LocalProtectionState, local))),\n \"RF protection states\": logList(this.supportedRFStates.map((rf) => getEnumMemberName(RFProtectionState, rf))),\n },\n };\n }\n}\n@CCCommand(ProtectionCommand.SupportedGet)\n@expectedCCResponse(ProtectionCCSupportedReport)\nexport class ProtectionCCSupportedGet extends ProtectionCC {\n}\n// @publicAPI\nexport interface ProtectionCCExclusiveControlReportOptions {\n exclusiveControlNodeId: number;\n}\n@CCCommand(ProtectionCommand.ExclusiveControlReport)\n@ccValueProperty(\"exclusiveControlNodeId\", ProtectionCCValues.exclusiveControlNodeId)\nexport class ProtectionCCExclusiveControlReport extends ProtectionCC {\n public constructor(options: WithAddress<ProtectionCCExclusiveControlReportOptions>) {\n super(options);\n this.exclusiveControlNodeId = options.exclusiveControlNodeId;\n }\n public static from(raw: CCRaw, ctx: CCParsingContext): ProtectionCCExclusiveControlReport {\n validatePayload(raw.payload.length >= 1);\n const exclusiveControlNodeId = raw.payload[0];\n return new this({\n nodeId: ctx.sourceNodeId,\n exclusiveControlNodeId,\n });\n }\n public readonly exclusiveControlNodeId: number;\n public serialize(ctx: CCEncodingContext): Promise<Bytes> {\n this.payload = Bytes.from([this.exclusiveControlNodeId]);\n return super.serialize(ctx);\n }\n public toLogEntry(ctx?: GetValueDB): MessageOrCCLogEntry {\n return {\n ...super.toLogEntry(ctx),\n message: {\n \"exclusive control node id\": this.exclusiveControlNodeId,\n },\n };\n }\n}\n@CCCommand(ProtectionCommand.ExclusiveControlGet)\n@expectedCCResponse(ProtectionCCExclusiveControlReport)\nexport class ProtectionCCExclusiveControlGet extends ProtectionCC {\n}\n// @publicAPI\nexport interface ProtectionCCExclusiveControlSetOptions {\n exclusiveControlNodeId: number;\n}\n@CCCommand(ProtectionCommand.ExclusiveControlSet)\n@expectedCCResponse(ProtectionCCReport)\n@useSupervision()\nexport class ProtectionCCExclusiveControlSet extends ProtectionCC {\n public constructor(options: WithAddress<ProtectionCCExclusiveControlSetOptions>) {\n super(options);\n this.exclusiveControlNodeId = options.exclusiveControlNodeId;\n }\n public static from(raw: CCRaw, ctx: CCParsingContext): ProtectionCCExclusiveControlSet {\n validatePayload(raw.payload.length >= 1);\n return new this({\n nodeId: ctx.sourceNodeId,\n exclusiveControlNodeId: raw.payload[0],\n });\n }\n public exclusiveControlNodeId: number;\n public serialize(ctx: CCEncodingContext): Promise<Bytes> {\n this.payload = Bytes.from([this.exclusiveControlNodeId]);\n return super.serialize(ctx);\n }\n public toLogEntry(ctx?: GetValueDB): MessageOrCCLogEntry {\n return {\n ...super.toLogEntry(ctx),\n message: {\n \"exclusive control node id\": this.exclusiveControlNodeId,\n },\n };\n }\n}\n// @publicAPI\nexport interface ProtectionCCTimeoutReportOptions {\n timeout: Timeout;\n}\n@CCCommand(ProtectionCommand.TimeoutReport)\n@ccValueProperty(\"timeout\", ProtectionCCValues.timeout)\nexport class ProtectionCCTimeoutReport extends ProtectionCC {\n public constructor(options: WithAddress<ProtectionCCTimeoutReportOptions>) {\n super(options);\n this.timeout = options.timeout;\n }\n public static from(raw: CCRaw, ctx: CCParsingContext): ProtectionCCTimeoutReport {\n validatePayload(raw.payload.length >= 1);\n const timeout: Timeout = Timeout.parse(raw.payload[0]);\n return new this({\n nodeId: ctx.sourceNodeId,\n timeout,\n });\n }\n public readonly timeout: Timeout;\n public serialize(ctx: CCEncodingContext): Promise<Bytes> {\n this.payload = Bytes.from([this.timeout.serialize()]);\n return super.serialize(ctx);\n }\n public toLogEntry(ctx?: GetValueDB): MessageOrCCLogEntry {\n return {\n ...super.toLogEntry(ctx),\n message: { timeout: this.timeout.toString() },\n };\n }\n}\n@CCCommand(ProtectionCommand.TimeoutGet)\n@expectedCCResponse(ProtectionCCTimeoutReport)\nexport class ProtectionCCTimeoutGet extends ProtectionCC {\n}\n// @publicAPI\nexport interface ProtectionCCTimeoutSetOptions {\n timeout: Timeout;\n}\n@CCCommand(ProtectionCommand.TimeoutSet)\n@expectedCCResponse(ProtectionCCReport)\n@useSupervision()\nexport class ProtectionCCTimeoutSet extends ProtectionCC {\n public constructor(options: WithAddress<ProtectionCCTimeoutSetOptions>) {\n super(options);\n this.timeout = options.timeout;\n }\n public static from(raw: CCRaw, ctx: CCParsingContext): ProtectionCCTimeoutSet {\n validatePayload(raw.payload.length >= 1);\n return new this({\n nodeId: ctx.sourceNodeId,\n timeout: Timeout.parse(raw.payload[0]),\n });\n }\n public timeout: Timeout;\n public serialize(ctx: CCEncodingContext): Promise<Bytes> {\n this.payload = Bytes.from([this.timeout.serialize()]);\n return super.serialize(ctx);\n }\n public toLogEntry(ctx?: GetValueDB): MessageOrCCLogEntry {\n return {\n ...super.toLogEntry(ctx),\n message: { timeout: this.timeout.toString() },\n };\n }\n}\n"],
5
- "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,qBAAgC;AAEhC,kBAAgV;AAChV,oBAA+C;AAC/C,iBAAkN;AAClN,0BAAyK;AACzK,oCAAiI;AAEjI,mBAA4E;AAE5E,gCAAmC;AATnC,MAAM,EAAE,kCAAkC,kDAAkD,wCAAuC,IAAK;IAY3H,mBAAe,MAAA;8BAD3B,mCAAI,2BAAe,UAAU,CAAC;;;;oBACM;;;;;uCAAA,YAAK;WAAA;;;;;;;;yBAkGrC,iCAAgC,CAAE;yCAqClC,iDAAgD,CAAE;gCAmBlD,wCAAuC,CAAE;AAvD1C,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,0BAAA;AAqChB,qCAAA,MAAA,MAAA,iCAAA,EAAA,MAAA,UAAA,MAAA,uBAAA,QAAA,OAAA,SAAA,OAAA,QAAA,EAAA,KAAA,gCAAA,yBAAA,KAAA,QAAA,KAAA,gCAAA,IAAa,qBAAb,OAAgC,GAAA,UAAA,UAAA,GAAA,MAAA,0BAAA;AAmBhC,qCAAA,MAAA,MAAA,wBAAA,EAAA,MAAA,UAAA,MAAA,cAAA,QAAA,OAAA,SAAA,OAAA,QAAA,EAAA,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MAAM,WAAW,GAAG;QACvB,SAAS,EAAE,SAAS,KAAK,QAAQ,SAAQ,EAAE;;IAEnD;;;;",
4
+ "sourcesContent": ["import * as __validateArgs from \"./ProtectionCC._validateArgs.js\";\nconst { validateArgs_ProtectionCCAPI_set, validateArgs_ProtectionCCAPI_setExclusiveControl, validateArgs_ProtectionCCAPI_setTimeout } = __validateArgs;\nimport { CommandClasses, type GetValueDB, MAX_NODES, type MaybeNotKnown, type MessageOrCCLogEntry, MessagePriority, type MessageRecord, type SupervisionResult, Timeout, type ValueID, ValueMetadata, type WithAddress, encodeBitMask, enumValuesToMetadataStates, getNodeTag, logDict, logList, logText, parseBitMask, validatePayload, } from \"@zwave-js/core\";\nimport { Bytes, getEnumMemberName, pick } from \"@zwave-js/shared\";\nimport { CCAPI, POLL_VALUE, type PollValueImplementation, SET_VALUE, SET_VALUE_HOOKS, type SetValueImplementation, type SetValueImplementationHooksFactory, 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, ccValueProperty, ccValues, commandClass, expectedCCResponse, implementedVersion, useSupervision, } from \"../lib/CommandClassDecorators.js\";\nimport { V } from \"../lib/Values.js\";\nimport { LocalProtectionState, ProtectionCommand, RFProtectionState, } from \"../lib/_Types.js\";\nimport type { CCEncodingContext, CCParsingContext } from \"../lib/traits.js\";\nimport { ProtectionCCValues } from \"./_CCValues.generated.js\";\nexport { ProtectionCCValues };\n@API(CommandClasses.Protection)\nexport class ProtectionCCAPI extends CCAPI {\n public supportsCommand(cmd: ProtectionCommand): MaybeNotKnown<boolean> {\n switch (cmd) {\n case ProtectionCommand.Get:\n return this.isSinglecast();\n case ProtectionCommand.Set:\n return true; // This is mandatory\n case ProtectionCommand.SupportedGet:\n return this.version >= 2 && this.isSinglecast();\n case ProtectionCommand.TimeoutGet:\n case ProtectionCommand.TimeoutSet: {\n return (this.isSinglecast()\n && this.tryGetValueDB()?.getValue<boolean>(ProtectionCCValues.supportsTimeout.endpoint(this.endpoint.index)));\n }\n case ProtectionCommand.ExclusiveControlGet:\n case ProtectionCommand.ExclusiveControlSet: {\n return (this.isSinglecast()\n && this.tryGetValueDB()?.getValue<boolean>(ProtectionCCValues.supportsExclusiveControl.endpoint(this.endpoint.index)));\n }\n }\n return super.supportsCommand(cmd);\n }\n protected override get [SET_VALUE](): SetValueImplementation {\n return async function (this: ProtectionCCAPI, { property }, value) {\n const valueDB = this.tryGetValueDB();\n if (property === \"local\") {\n if (typeof value !== \"number\") {\n throwWrongValueType(this.ccId, property, \"number\", typeof value);\n }\n // We need to set both values together, so retrieve the other one from the value DB\n const rf = valueDB?.getValue<RFProtectionState>(ProtectionCCValues.rfProtectionState.endpoint(this.endpoint.index));\n return this.set(value, rf);\n }\n else if (property === \"rf\") {\n if (typeof value !== \"number\") {\n throwWrongValueType(this.ccId, property, \"number\", typeof value);\n }\n // We need to set both values together, so retrieve the other one from the value DB\n const local = valueDB?.getValue<LocalProtectionState>(ProtectionCCValues.localProtectionState.endpoint(this.endpoint.index));\n return this.set(local ?? LocalProtectionState.Unprotected, value);\n }\n else if (property === \"exclusiveControlNodeId\") {\n if (typeof value !== \"number\") {\n throwWrongValueType(this.ccId, property, \"number\", typeof value);\n }\n return this.setExclusiveControl(value);\n }\n else {\n throwUnsupportedProperty(this.ccId, property);\n }\n };\n }\n protected get [POLL_VALUE](): PollValueImplementation {\n return async function (this: ProtectionCCAPI, { property }) {\n switch (property) {\n case \"local\":\n case \"rf\":\n return (await this.get())?.[property];\n case \"exclusiveControlNodeId\":\n return this.getExclusiveControl();\n default:\n throwUnsupportedProperty(this.ccId, property);\n }\n };\n }\n protected [SET_VALUE_HOOKS]: SetValueImplementationHooksFactory = ({ property }, value) => {\n if ((property === \"local\" && typeof value === \"number\")\n || (property === \"rf\" && typeof value === \"number\")) {\n return {\n forceVerifyChanges: () => true,\n verifyChanges: () => {\n if (this.isSinglecast()) {\n this.schedulePoll({ property }, value, {\n transition: \"fast\",\n });\n }\n },\n };\n }\n };\n public override isSetValueOptimistic(_valueId: ValueID): boolean {\n // Protection changes may be rejected depending on the node's current\n // exclusive/RF protection state, so we always read the state back.\n return false;\n }\n // oxlint-disable-next-line typescript/explicit-module-boundary-types\n public async get() {\n this.assertSupportsCommand(ProtectionCommand, ProtectionCommand.Get);\n const cc = new ProtectionCCGet({\n nodeId: this.endpoint.nodeId,\n endpointIndex: this.endpoint.index,\n });\n const response = await this.host.sendCommand<ProtectionCCReport>(cc, this.commandOptions);\n if (response) {\n return pick(response, [\"local\", \"rf\"]);\n }\n }\n @validateArgs_ProtectionCCAPI_set()\n public async set(local: LocalProtectionState, rf?: RFProtectionState): Promise<SupervisionResult | undefined> {\n this.assertSupportsCommand(ProtectionCommand, ProtectionCommand.Set);\n const cc = new ProtectionCCSet({\n nodeId: this.endpoint.nodeId,\n endpointIndex: this.endpoint.index,\n local,\n rf,\n });\n return this.host.sendCommand(cc, this.commandOptions);\n }\n // oxlint-disable-next-line typescript/explicit-module-boundary-types\n public async getSupported() {\n this.assertSupportsCommand(ProtectionCommand, ProtectionCommand.SupportedGet);\n const cc = new ProtectionCCSupportedGet({\n nodeId: this.endpoint.nodeId,\n endpointIndex: this.endpoint.index,\n });\n const response = await this.host.sendCommand<ProtectionCCSupportedReport>(cc, this.commandOptions);\n if (response) {\n return pick(response, [\n \"supportsExclusiveControl\",\n \"supportsTimeout\",\n \"supportedLocalStates\",\n \"supportedRFStates\",\n ]);\n }\n }\n public async getExclusiveControl(): Promise<MaybeNotKnown<number>> {\n this.assertSupportsCommand(ProtectionCommand, ProtectionCommand.ExclusiveControlGet);\n const cc = new ProtectionCCExclusiveControlGet({\n nodeId: this.endpoint.nodeId,\n endpointIndex: this.endpoint.index,\n });\n const response = await this.host.sendCommand<ProtectionCCExclusiveControlReport>(cc, this.commandOptions);\n return response?.exclusiveControlNodeId;\n }\n @validateArgs_ProtectionCCAPI_setExclusiveControl()\n public async setExclusiveControl(nodeId: number): Promise<SupervisionResult | undefined> {\n this.assertSupportsCommand(ProtectionCommand, ProtectionCommand.ExclusiveControlSet);\n const cc = new ProtectionCCExclusiveControlSet({\n nodeId: this.endpoint.nodeId,\n endpointIndex: this.endpoint.index,\n exclusiveControlNodeId: nodeId,\n });\n return this.host.sendCommand(cc, this.commandOptions);\n }\n public async getTimeout(): Promise<MaybeNotKnown<Timeout>> {\n this.assertSupportsCommand(ProtectionCommand, ProtectionCommand.TimeoutGet);\n const cc = new ProtectionCCTimeoutGet({\n nodeId: this.endpoint.nodeId,\n endpointIndex: this.endpoint.index,\n });\n const response = await this.host.sendCommand<ProtectionCCTimeoutReport>(cc, this.commandOptions);\n return response?.timeout;\n }\n @validateArgs_ProtectionCCAPI_setTimeout()\n public async setTimeout(timeout: Timeout): Promise<SupervisionResult | undefined> {\n this.assertSupportsCommand(ProtectionCommand, ProtectionCommand.TimeoutSet);\n const cc = new ProtectionCCTimeoutSet({\n nodeId: this.endpoint.nodeId,\n endpointIndex: this.endpoint.index,\n timeout,\n });\n return this.host.sendCommand(cc, this.commandOptions);\n }\n}\n@commandClass(CommandClasses.Protection)\n@implementedVersion(2)\n@ccValues(ProtectionCCValues)\nexport class ProtectionCC extends CommandClass {\n declare ccCommand: ProtectionCommand;\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.Protection, 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 // We need to do some queries after a potential timeout\n // In this case, do now mark this CC as interviewed completely\n let hadCriticalTimeout = false;\n // First find out what the device supports\n if (api.version >= 2) {\n ctx.logNode(node.id, {\n message: \"querying protection capabilities...\",\n direction: \"outbound\",\n });\n const resp = await api.getSupported();\n if (resp) {\n const logMessage = logText(\"received protection capabilities:\", {\n nested: logDict({\n \"exclusive control\": resp.supportsExclusiveControl,\n timeout: resp.supportsTimeout,\n \"local protection states\": logList(resp.supportedLocalStates.map((local) => getEnumMemberName(LocalProtectionState, local))),\n \"RF protection states\": logList(resp.supportedRFStates.map((local) => getEnumMemberName(RFProtectionState, local))),\n }),\n });\n ctx.logNode(node.id, {\n message: logMessage,\n direction: \"inbound\",\n });\n }\n else {\n hadCriticalTimeout = true;\n }\n }\n await this.refreshValues(ctx, { tag: \"interview\" });\n // Remember that the interview is complete\n if (!hadCriticalTimeout)\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.Protection, ctx, endpoint).withOptions({\n priority: options?.priority ?? MessagePriority.NodeQuery,\n tag: options?.tag,\n });\n const supportsExclusiveControl = !!this.getValue(ctx, ProtectionCCValues.supportsExclusiveControl);\n const supportsTimeout = !!this.getValue(ctx, ProtectionCCValues.supportsTimeout);\n // Query the current state\n ctx.logNode(node.id, {\n message: \"querying protection status...\",\n direction: \"outbound\",\n });\n const protectionResp = await api.get();\n if (protectionResp) {\n let logMessage = `received protection status:\nlocal: ${getEnumMemberName(LocalProtectionState, protectionResp.local)}`;\n if (protectionResp.rf != undefined) {\n logMessage += `\nrf ${getEnumMemberName(RFProtectionState, protectionResp.rf)}`;\n }\n ctx.logNode(node.id, {\n message: logMessage,\n direction: \"inbound\",\n });\n }\n if (supportsTimeout) {\n // Query the current timeout\n ctx.logNode(node.id, {\n message: \"querying protection timeout...\",\n direction: \"outbound\",\n });\n const timeout = await api.getTimeout();\n if (timeout) {\n ctx.logNode(node.id, {\n message: `received timeout: ${timeout.toString()}`,\n direction: \"inbound\",\n });\n }\n }\n if (supportsExclusiveControl) {\n // Query the current timeout\n ctx.logNode(node.id, {\n message: \"querying exclusive control node...\",\n direction: \"outbound\",\n });\n const nodeId = await api.getExclusiveControl();\n if (nodeId != undefined) {\n ctx.logNode(node.id, {\n message: (nodeId !== 0 ? getNodeTag(nodeId) : `no node`)\n + ` has exclusive control`,\n direction: \"inbound\",\n });\n }\n }\n }\n}\n// @publicAPI\nexport interface ProtectionCCSetOptions {\n local: LocalProtectionState;\n rf?: RFProtectionState;\n}\n@CCCommand(ProtectionCommand.Set)\n@useSupervision()\nexport class ProtectionCCSet extends ProtectionCC {\n public constructor(options: WithAddress<ProtectionCCSetOptions>) {\n super(options);\n this.local = options.local;\n this.rf = options.rf;\n }\n public static from(raw: CCRaw, ctx: CCParsingContext): ProtectionCCSet {\n validatePayload(raw.payload.length >= 1);\n const local: LocalProtectionState = raw.payload[0] & 0b1111;\n let rf: RFProtectionState | undefined;\n if (raw.payload.length >= 2) {\n rf = raw.payload[1] & 0b1111;\n }\n return new this({\n nodeId: ctx.sourceNodeId,\n local,\n rf,\n });\n }\n public local: LocalProtectionState;\n public rf?: RFProtectionState;\n public serialize(ctx: CCEncodingContext): Promise<Bytes> {\n this.payload = Bytes.from([\n this.local & 0b1111,\n (this.rf ?? RFProtectionState.Unprotected) & 0b1111,\n ]);\n const ccVersion = getEffectiveCCVersion(ctx, this);\n if (ccVersion < 2\n && ctx.getDeviceConfig?.(this.nodeId as number)?.compat\n ?.encodeCCsUsingTargetVersion) {\n // When forcing CC version 1, only include the local state\n this.payload = this.payload.subarray(0, 1);\n }\n return super.serialize(ctx);\n }\n public toLogEntry(ctx?: GetValueDB): MessageOrCCLogEntry {\n const message: MessageRecord = {\n local: getEnumMemberName(LocalProtectionState, this.local),\n };\n if (this.rf != undefined) {\n message.rf = getEnumMemberName(RFProtectionState, this.rf);\n }\n return {\n ...super.toLogEntry(ctx),\n message,\n };\n }\n}\n// @publicAPI\nexport interface ProtectionCCReportOptions {\n local: LocalProtectionState;\n rf?: RFProtectionState;\n}\n@CCCommand(ProtectionCommand.Report)\n@ccValueProperty(\"local\", ProtectionCCValues.localProtectionState)\n@ccValueProperty(\"rf\", ProtectionCCValues.rfProtectionState)\nexport class ProtectionCCReport extends ProtectionCC {\n public constructor(options: WithAddress<ProtectionCCReportOptions>) {\n super(options);\n this.local = options.local;\n this.rf = options.rf;\n }\n public static from(raw: CCRaw, ctx: CCParsingContext): ProtectionCCReport {\n validatePayload(raw.payload.length >= 1);\n const local: LocalProtectionState = raw.payload[0] & 0b1111;\n let rf: RFProtectionState | undefined;\n if (raw.payload.length >= 2) {\n rf = raw.payload[1] & 0b1111;\n }\n return new this({\n nodeId: ctx.sourceNodeId,\n local,\n rf,\n });\n }\n public readonly local: LocalProtectionState;\n public readonly rf?: RFProtectionState;\n public serialize(ctx: CCEncodingContext): Promise<Bytes> {\n this.payload =\n this.rf !== undefined\n ? Bytes.from([this.local & 0b1111, this.rf & 0b1111])\n : Bytes.from([this.local & 0b1111]);\n return super.serialize(ctx);\n }\n public toLogEntry(ctx?: GetValueDB): MessageOrCCLogEntry {\n const message: MessageRecord = {\n local: getEnumMemberName(LocalProtectionState, this.local),\n };\n if (this.rf != undefined) {\n message.rf = getEnumMemberName(RFProtectionState, this.rf);\n }\n return {\n ...super.toLogEntry(ctx),\n message,\n };\n }\n}\n@CCCommand(ProtectionCommand.Get)\n@expectedCCResponse(ProtectionCCReport)\nexport class ProtectionCCGet extends ProtectionCC {\n}\n// @publicAPI\nexport interface ProtectionCCSupportedReportOptions {\n supportsTimeout: boolean;\n supportsExclusiveControl: boolean;\n supportedLocalStates: LocalProtectionState[];\n supportedRFStates: RFProtectionState[];\n}\n@CCCommand(ProtectionCommand.SupportedReport)\n@ccValueProperty(\"supportsExclusiveControl\", ProtectionCCValues.supportsExclusiveControl)\n@ccValueProperty(\"supportsTimeout\", ProtectionCCValues.supportsTimeout)\n@ccValueProperty(\"supportedLocalStates\", ProtectionCCValues.supportedLocalStates)\n@ccValueProperty(\"supportedRFStates\", ProtectionCCValues.supportedRFStates)\nexport class ProtectionCCSupportedReport extends ProtectionCC {\n public constructor(options: WithAddress<ProtectionCCSupportedReportOptions>) {\n super(options);\n this.supportsTimeout = options.supportsTimeout;\n this.supportsExclusiveControl = options.supportsExclusiveControl;\n this.supportedLocalStates = options.supportedLocalStates;\n this.supportedRFStates = options.supportedRFStates;\n }\n public static from(raw: CCRaw, ctx: CCParsingContext): ProtectionCCSupportedReport {\n validatePayload(raw.payload.length >= 5);\n const supportsTimeout = !!(raw.payload[0] & 0b1);\n const supportsExclusiveControl = !!(raw.payload[0] & 0b10);\n const supportedLocalStates: LocalProtectionState[] = parseBitMask(raw.payload.subarray(1, 3), LocalProtectionState.Unprotected);\n const supportedRFStates: RFProtectionState[] = parseBitMask(raw.payload.subarray(3, 5), RFProtectionState.Unprotected);\n return new this({\n nodeId: ctx.sourceNodeId,\n supportsTimeout,\n supportsExclusiveControl,\n supportedLocalStates,\n supportedRFStates,\n });\n }\n public persistValues(ctx: PersistValuesContext): boolean {\n if (!super.persistValues(ctx))\n return false;\n // This command only exists in V2. Ignore it if the device advertises a lower version.\n if (getEffectiveCCVersion(ctx, this) < 2)\n return true;\n // update metadata (partially) for the local and rf values\n const localStateValue = ProtectionCCValues.localProtectionState;\n this.setMetadata(ctx, localStateValue, {\n ...localStateValue.meta,\n states: enumValuesToMetadataStates(LocalProtectionState, this.supportedLocalStates),\n });\n const rfStateValue = ProtectionCCValues.rfProtectionState;\n this.setMetadata(ctx, rfStateValue, {\n ...rfStateValue.meta,\n states: enumValuesToMetadataStates(RFProtectionState, this.supportedRFStates),\n });\n return true;\n }\n public readonly supportsExclusiveControl: boolean;\n public readonly supportsTimeout: boolean;\n public readonly supportedLocalStates: LocalProtectionState[];\n public readonly supportedRFStates: RFProtectionState[];\n public serialize(ctx: CCEncodingContext): Promise<Bytes> {\n const flags = (this.supportsTimeout ? 0b1 : 0)\n | (this.supportsExclusiveControl ? 0b10 : 0);\n this.payload = Bytes.concat([\n [flags],\n encodeBitMask(this.supportedLocalStates, 15, LocalProtectionState.Unprotected),\n encodeBitMask(this.supportedRFStates, 15, RFProtectionState.Unprotected),\n ]);\n return super.serialize(ctx);\n }\n public toLogEntry(ctx?: GetValueDB): MessageOrCCLogEntry {\n return {\n ...super.toLogEntry(ctx),\n message: {\n \"supports exclusive control\": this.supportsExclusiveControl,\n \"supports timeout\": this.supportsTimeout,\n \"local protection states\": logList(this.supportedLocalStates.map((local) => getEnumMemberName(LocalProtectionState, local))),\n \"RF protection states\": logList(this.supportedRFStates.map((rf) => getEnumMemberName(RFProtectionState, rf))),\n },\n };\n }\n}\n@CCCommand(ProtectionCommand.SupportedGet)\n@expectedCCResponse(ProtectionCCSupportedReport)\nexport class ProtectionCCSupportedGet extends ProtectionCC {\n}\n// @publicAPI\nexport interface ProtectionCCExclusiveControlReportOptions {\n exclusiveControlNodeId: number;\n}\n@CCCommand(ProtectionCommand.ExclusiveControlReport)\n@ccValueProperty(\"exclusiveControlNodeId\", ProtectionCCValues.exclusiveControlNodeId)\nexport class ProtectionCCExclusiveControlReport extends ProtectionCC {\n public constructor(options: WithAddress<ProtectionCCExclusiveControlReportOptions>) {\n super(options);\n this.exclusiveControlNodeId = options.exclusiveControlNodeId;\n }\n public static from(raw: CCRaw, ctx: CCParsingContext): ProtectionCCExclusiveControlReport {\n validatePayload(raw.payload.length >= 1);\n const exclusiveControlNodeId = raw.payload[0];\n return new this({\n nodeId: ctx.sourceNodeId,\n exclusiveControlNodeId,\n });\n }\n public readonly exclusiveControlNodeId: number;\n public serialize(ctx: CCEncodingContext): Promise<Bytes> {\n this.payload = Bytes.from([this.exclusiveControlNodeId]);\n return super.serialize(ctx);\n }\n public toLogEntry(ctx?: GetValueDB): MessageOrCCLogEntry {\n return {\n ...super.toLogEntry(ctx),\n message: {\n \"exclusive control node id\": this.exclusiveControlNodeId,\n },\n };\n }\n}\n@CCCommand(ProtectionCommand.ExclusiveControlGet)\n@expectedCCResponse(ProtectionCCExclusiveControlReport)\nexport class ProtectionCCExclusiveControlGet extends ProtectionCC {\n}\n// @publicAPI\nexport interface ProtectionCCExclusiveControlSetOptions {\n exclusiveControlNodeId: number;\n}\n@CCCommand(ProtectionCommand.ExclusiveControlSet)\n@expectedCCResponse(ProtectionCCReport)\n@useSupervision()\nexport class ProtectionCCExclusiveControlSet extends ProtectionCC {\n public constructor(options: WithAddress<ProtectionCCExclusiveControlSetOptions>) {\n super(options);\n this.exclusiveControlNodeId = options.exclusiveControlNodeId;\n }\n public static from(raw: CCRaw, ctx: CCParsingContext): ProtectionCCExclusiveControlSet {\n validatePayload(raw.payload.length >= 1);\n return new this({\n nodeId: ctx.sourceNodeId,\n exclusiveControlNodeId: raw.payload[0],\n });\n }\n public exclusiveControlNodeId: number;\n public serialize(ctx: CCEncodingContext): Promise<Bytes> {\n this.payload = Bytes.from([this.exclusiveControlNodeId]);\n return super.serialize(ctx);\n }\n public toLogEntry(ctx?: GetValueDB): MessageOrCCLogEntry {\n return {\n ...super.toLogEntry(ctx),\n message: {\n \"exclusive control node id\": this.exclusiveControlNodeId,\n },\n };\n }\n}\n// @publicAPI\nexport interface ProtectionCCTimeoutReportOptions {\n timeout: Timeout;\n}\n@CCCommand(ProtectionCommand.TimeoutReport)\n@ccValueProperty(\"timeout\", ProtectionCCValues.timeout)\nexport class ProtectionCCTimeoutReport extends ProtectionCC {\n public constructor(options: WithAddress<ProtectionCCTimeoutReportOptions>) {\n super(options);\n this.timeout = options.timeout;\n }\n public static from(raw: CCRaw, ctx: CCParsingContext): ProtectionCCTimeoutReport {\n validatePayload(raw.payload.length >= 1);\n const timeout: Timeout = Timeout.parse(raw.payload[0]);\n return new this({\n nodeId: ctx.sourceNodeId,\n timeout,\n });\n }\n public readonly timeout: Timeout;\n public serialize(ctx: CCEncodingContext): Promise<Bytes> {\n this.payload = Bytes.from([this.timeout.serialize()]);\n return super.serialize(ctx);\n }\n public toLogEntry(ctx?: GetValueDB): MessageOrCCLogEntry {\n return {\n ...super.toLogEntry(ctx),\n message: { timeout: this.timeout.toString() },\n };\n }\n}\n@CCCommand(ProtectionCommand.TimeoutGet)\n@expectedCCResponse(ProtectionCCTimeoutReport)\nexport class ProtectionCCTimeoutGet extends ProtectionCC {\n}\n// @publicAPI\nexport interface ProtectionCCTimeoutSetOptions {\n timeout: Timeout;\n}\n@CCCommand(ProtectionCommand.TimeoutSet)\n@expectedCCResponse(ProtectionCCReport)\n@useSupervision()\nexport class ProtectionCCTimeoutSet extends ProtectionCC {\n public constructor(options: WithAddress<ProtectionCCTimeoutSetOptions>) {\n super(options);\n this.timeout = options.timeout;\n }\n public static from(raw: CCRaw, ctx: CCParsingContext): ProtectionCCTimeoutSet {\n validatePayload(raw.payload.length >= 1);\n return new this({\n nodeId: ctx.sourceNodeId,\n timeout: Timeout.parse(raw.payload[0]),\n });\n }\n public timeout: Timeout;\n public serialize(ctx: CCEncodingContext): Promise<Bytes> {\n this.payload = Bytes.from([this.timeout.serialize()]);\n return super.serialize(ctx);\n }\n public toLogEntry(ctx?: GetValueDB): MessageOrCCLogEntry {\n return {\n ...super.toLogEntry(ctx),\n message: { timeout: this.timeout.toString() },\n };\n }\n}\n"],
5
+ "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,qBAAgC;AAEhC,kBAAgV;AAChV,oBAA+C;AAC/C,iBAAkN;AAClN,0BAAyK;AACzK,oCAAiI;AAEjI,mBAA4E;AAE5E,gCAAmC;AATnC,MAAM,EAAE,kCAAkC,kDAAkD,wCAAuC,IAAK;IAY3H,mBAAe,MAAA;8BAD3B,mCAAI,2BAAe,UAAU,CAAC;;;;oBACM;;;;;uCAAA,YAAK;WAAA;;;;;;;;yBAiGrC,iCAAgC,CAAE;yCAqClC,iDAAgD,CAAE;gCAmBlD,wCAAuC,CAAE;AAvD1C,qCAAA,MAAA,MAAA,iBAAA,EAAA,MAAA,UAAA,MAAA,OAAA,QAAA,OAAA,SAAA,OAAA,QAAA,EAAA,KAAA,gCAAA,SAAA,KAAA,QAAA,KAAA,gCAAA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,QAAQ;IAC3B;IACO,OAAO,KAAK,KAAY,KAAqB;AAChD,uCAAgB,IAAI,QAAQ,UAAU,CAAC;AACvC,aAAO,IAAI,KAAK;QACZ,QAAQ,IAAI;QACZ,SAAS,oBAAQ,MAAM,IAAI,QAAQ,CAAC,CAAC;OACxC;IACL;IACO;IACA,UAAU,KAAsB;AACnC,WAAK,UAAU,oBAAM,KAAK,CAAC,KAAK,QAAQ,UAAS,CAAE,CAAC;AACpD,aAAO,MAAM,UAAU,GAAG;IAC9B;IACO,WAAW,KAAgB;AAC9B,aAAO;QACH,GAAG,MAAM,WAAW,GAAG;QACvB,SAAS,EAAE,SAAS,KAAK,QAAQ,SAAQ,EAAE;;IAEnD;;;;",
6
6
  "names": []
7
7
  }
@@ -25,7 +25,7 @@ export interface SceneActuatorConfigurationCCSetOptions {
25
25
  }
26
26
  export declare class SceneActuatorConfigurationCCSet extends SceneActuatorConfigurationCC {
27
27
  constructor(options: WithAddress<SceneActuatorConfigurationCCSetOptions>);
28
- static from(_raw: CCRaw, _ctx: CCParsingContext): SceneActuatorConfigurationCCSet;
28
+ static from(raw: CCRaw, ctx: CCParsingContext): SceneActuatorConfigurationCCSet;
29
29
  sceneId: number;
30
30
  dimmingDuration: Duration;
31
31
  level?: number;
@@ -43,6 +43,7 @@ export declare class SceneActuatorConfigurationCCReport extends SceneActuatorCon
43
43
  readonly sceneId: number;
44
44
  readonly level?: number;
45
45
  readonly dimmingDuration?: Duration;
46
+ serialize(ctx: CCEncodingContext): Promise<Bytes>;
46
47
  persistValues(ctx: PersistValuesContext): boolean;
47
48
  toLogEntry(ctx?: GetValueDB): MessageOrCCLogEntry;
48
49
  }
@@ -51,7 +52,7 @@ export interface SceneActuatorConfigurationCCGetOptions {
51
52
  }
52
53
  export declare class SceneActuatorConfigurationCCGet extends SceneActuatorConfigurationCC {
53
54
  constructor(options: WithAddress<SceneActuatorConfigurationCCGetOptions>);
54
- static from(_raw: CCRaw, _ctx: CCParsingContext): SceneActuatorConfigurationCCGet;
55
+ static from(raw: CCRaw, ctx: CCParsingContext): SceneActuatorConfigurationCCGet;
55
56
  sceneId: number;
56
57
  serialize(ctx: CCEncodingContext): Promise<Bytes>;
57
58
  toLogEntry(ctx?: GetValueDB): MessageOrCCLogEntry;
@@ -239,17 +239,34 @@ let SceneActuatorConfigurationCCSet = (() => {
239
239
  this.dimmingDuration = options.dimmingDuration;
240
240
  this.level = options.level;
241
241
  }
242
- static from(_raw, _ctx) {
243
- throw new import_core.ZWaveError(`${this.name}: deserialization not implemented`, import_core.ZWaveErrorCodes.Deserialization_NotImplemented);
242
+ static from(raw, ctx) {
243
+ (0, import_core.validatePayload)(raw.payload.length >= 4);
244
+ (0, import_core.validatePayload)(raw.payload[0] >= 1);
245
+ const sceneId = raw.payload[0];
246
+ const dimmingDuration = import_core.Duration.parseSet(raw.payload[1]);
247
+ let level;
248
+ if (raw.payload[2] & 128) {
249
+ level = raw.payload[3];
250
+ }
251
+ return new this({
252
+ nodeId: ctx.sourceNodeId,
253
+ sceneId,
254
+ dimmingDuration,
255
+ level
256
+ });
244
257
  }
245
258
  sceneId;
246
259
  dimmingDuration;
247
260
  level;
248
261
  serialize(ctx) {
262
+ let overrideByte = 0;
263
+ if (this.level != void 0) {
264
+ overrideByte = 128;
265
+ }
249
266
  this.payload = import_shared.Bytes.from([
250
267
  this.sceneId,
251
268
  this.dimmingDuration.serializeSet(),
252
- this.level != void 0 ? 128 : 0,
269
+ overrideByte,
253
270
  this.level ?? 255
254
271
  ]);
255
272
  return super.serialize(ctx);
@@ -315,6 +332,18 @@ let SceneActuatorConfigurationCCReport = (() => {
315
332
  sceneId;
316
333
  level;
317
334
  dimmingDuration;
335
+ serialize(ctx) {
336
+ if (this.sceneId === 0) {
337
+ this.payload = import_shared.Bytes.from([0, 0, 0]);
338
+ } else {
339
+ this.payload = import_shared.Bytes.from([
340
+ this.sceneId,
341
+ this.level ?? 255,
342
+ (this.dimmingDuration ?? import_core.Duration.unknown()).serializeReport()
343
+ ]);
344
+ }
345
+ return super.serialize(ctx);
346
+ }
318
347
  persistValues(ctx) {
319
348
  if (!super.persistValues(ctx))
320
349
  return false;
@@ -375,8 +404,12 @@ let SceneActuatorConfigurationCCGet = (() => {
375
404
  super(options);
376
405
  this.sceneId = options.sceneId;
377
406
  }
378
- static from(_raw, _ctx) {
379
- throw new import_core.ZWaveError(`${this.name}: deserialization not implemented`, import_core.ZWaveErrorCodes.Deserialization_NotImplemented);
407
+ static from(raw, ctx) {
408
+ (0, import_core.validatePayload)(raw.payload.length >= 1);
409
+ return new this({
410
+ nodeId: ctx.sourceNodeId,
411
+ sceneId: raw.payload[0]
412
+ });
380
413
  }
381
414
  sceneId;
382
415
  serialize(ctx) {
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../src_gen/cc/SceneActuatorConfigurationCC.ts"],
4
- "sourcesContent": ["import * as __validateArgs from \"./SceneActuatorConfigurationCC._validateArgs.js\";\nconst { validateArgs_SceneActuatorConfigurationCCAPI_set, validateArgs_SceneActuatorConfigurationCCAPI_get } = __validateArgs;\nimport { CommandClasses, Duration, type GetValueDB, type MaybeNotKnown, type MessageOrCCLogEntry, type MessageRecord, type SupervisionResult, ValueMetadata, type WithAddress, ZWaveError, ZWaveErrorCodes, getCCName, validatePayload, } from \"@zwave-js/core\";\nimport { Bytes, pick } from \"@zwave-js/shared\";\nimport { CCAPI, POLL_VALUE, type PollValueImplementation, SET_VALUE, type SetValueImplementation, throwMissingPropertyKey, throwUnsupportedProperty, throwUnsupportedPropertyKey, throwWrongValueType, } from \"../lib/API.js\";\nimport { type CCRaw, CommandClass, type InterviewContext, type PersistValuesContext, } from \"../lib/CommandClass.js\";\nimport { API, CCCommand, ccValues, commandClass, expectedCCResponse, implementedVersion, useSupervision, } from \"../lib/CommandClassDecorators.js\";\nimport { V } from \"../lib/Values.js\";\nimport { SceneActuatorConfigurationCommand } from \"../lib/_Types.js\";\nimport type { CCEncodingContext, CCParsingContext } from \"../lib/traits.js\";\nimport { SceneActuatorConfigurationCCValues } from \"./_CCValues.generated.js\";\nexport { SceneActuatorConfigurationCCValues };\n@API(CommandClasses[\"Scene Actuator Configuration\"])\nexport class SceneActuatorConfigurationCCAPI extends CCAPI {\n public supportsCommand(cmd: SceneActuatorConfigurationCommand): MaybeNotKnown<boolean> {\n switch (cmd) {\n case SceneActuatorConfigurationCommand.Get:\n return this.isSinglecast();\n case SceneActuatorConfigurationCommand.Set:\n return true;\n }\n return super.supportsCommand(cmd);\n }\n protected override get [SET_VALUE](): SetValueImplementation {\n return async function (this: SceneActuatorConfigurationCCAPI, { property, propertyKey }, value, options) {\n if (propertyKey == undefined) {\n throwMissingPropertyKey(this.ccId, property);\n }\n else if (typeof propertyKey !== \"number\") {\n throwUnsupportedPropertyKey(this.ccId, property, propertyKey);\n }\n if (property === \"level\") {\n if (typeof value !== \"number\") {\n throwWrongValueType(this.ccId, property, \"number\", typeof value);\n }\n // We need to set the dimming duration along with the level.\n // Dimming duration is chosen with the following precedence:\n // 1. options.transitionDuration\n // 2. current stored value\n // 3. default\n const dimmingDuration = Duration.from(options?.transitionDuration)\n ?? this.tryGetValueDB()?.getValue<Duration>(SceneActuatorConfigurationCCValues.dimmingDuration(propertyKey).endpoint(this.endpoint.index));\n return this.set(propertyKey, dimmingDuration, value);\n }\n else if (property === \"dimmingDuration\") {\n if (typeof value !== \"string\" && !Duration.isDuration(value)) {\n throwWrongValueType(this.ccId, property, \"duration\", typeof value);\n }\n const dimmingDuration = Duration.from(value);\n if (dimmingDuration == undefined) {\n throw new ZWaveError(`${getCCName(this.ccId)}: \"${property}\" could not be set. ${JSON.stringify(value)} is not a valid duration.`, ZWaveErrorCodes.Argument_Invalid);\n }\n // Must set the level along with the dimmingDuration,\n // Use saved value, if it's defined. Otherwise the default\n // will be used.\n const level = this.tryGetValueDB()?.getValue<number>(SceneActuatorConfigurationCCValues.level(propertyKey).endpoint(this.endpoint.index));\n return this.set(propertyKey, dimmingDuration, level);\n }\n else {\n throwUnsupportedProperty(this.ccId, property);\n }\n };\n }\n protected get [POLL_VALUE](): PollValueImplementation {\n return async function (this: SceneActuatorConfigurationCCAPI, { property, propertyKey }) {\n switch (property) {\n case \"level\":\n case \"dimmingDuration\": {\n if (propertyKey == undefined) {\n throwMissingPropertyKey(this.ccId, property);\n }\n else if (typeof propertyKey !== \"number\") {\n throwUnsupportedPropertyKey(this.ccId, property, propertyKey);\n }\n return (await this.get(propertyKey))?.[property];\n }\n default:\n throwUnsupportedProperty(this.ccId, property);\n }\n };\n }\n @validateArgs_SceneActuatorConfigurationCCAPI_set()\n public async set(sceneId: number, dimmingDuration?: Duration | string, level?: number): Promise<SupervisionResult | undefined> {\n this.assertSupportsCommand(SceneActuatorConfigurationCommand, SceneActuatorConfigurationCommand.Set);\n // Undefined `dimmingDuration` defaults to 0 seconds to simplify the call\n // for actuators that don't support non-instant `dimmingDuration`\n // Undefined `level` uses the actuator's current value (override = 0).\n const cc = new SceneActuatorConfigurationCCSet({\n nodeId: this.endpoint.nodeId,\n endpointIndex: this.endpoint.index,\n sceneId,\n dimmingDuration: Duration.from(dimmingDuration)\n ?? new Duration(0, \"seconds\"),\n level,\n });\n return this.host.sendCommand(cc, this.commandOptions);\n }\n public async getActive(): Promise<MaybeNotKnown<Pick<SceneActuatorConfigurationCCReport, \"sceneId\" | \"level\" | \"dimmingDuration\">>> {\n this.assertSupportsCommand(SceneActuatorConfigurationCommand, SceneActuatorConfigurationCommand.Get);\n const cc = new SceneActuatorConfigurationCCGet({\n nodeId: this.endpoint.nodeId,\n endpointIndex: this.endpoint.index,\n sceneId: 0,\n });\n const response = await this.host.sendCommand<SceneActuatorConfigurationCCReport>(cc, this.commandOptions);\n if (response) {\n return pick(response, [\"sceneId\", \"level\", \"dimmingDuration\"]);\n }\n }\n @validateArgs_SceneActuatorConfigurationCCAPI_get()\n public async get(sceneId: number): Promise<MaybeNotKnown<Pick<SceneActuatorConfigurationCCReport, \"level\" | \"dimmingDuration\">>> {\n this.assertSupportsCommand(SceneActuatorConfigurationCommand, SceneActuatorConfigurationCommand.Get);\n if (sceneId === 0) {\n throw new ZWaveError(`Invalid scene ID 0. To get the currently active scene, use getActive() instead.`, ZWaveErrorCodes.Argument_Invalid);\n }\n const cc = new SceneActuatorConfigurationCCGet({\n nodeId: this.endpoint.nodeId,\n endpointIndex: this.endpoint.index,\n sceneId: sceneId,\n });\n const response = await this.host.sendCommand<SceneActuatorConfigurationCCReport>(cc, this.commandOptions);\n if (response) {\n return pick(response, [\"level\", \"dimmingDuration\"]);\n }\n }\n}\n@commandClass(CommandClasses[\"Scene Actuator Configuration\"])\n@implementedVersion(1)\n@ccValues(SceneActuatorConfigurationCCValues)\nexport class SceneActuatorConfigurationCC extends CommandClass {\n declare ccCommand: SceneActuatorConfigurationCommand;\n public async interview(ctx: InterviewContext): Promise<void> {\n const node = this.getNode(ctx)!;\n ctx.logNode(node.id, {\n message: `${this.constructor.name}: setting metadata`,\n direction: \"none\",\n });\n // Create Metadata for all scenes\n for (let sceneId = 1; sceneId <= 255; sceneId++) {\n const levelValue = SceneActuatorConfigurationCCValues.level(sceneId);\n this.ensureMetadata(ctx, levelValue);\n const dimmingDurationValue = SceneActuatorConfigurationCCValues\n .dimmingDuration(sceneId);\n this.ensureMetadata(ctx, dimmingDurationValue);\n }\n this.setInterviewComplete(ctx, true);\n }\n}\n// @publicAPI\nexport interface SceneActuatorConfigurationCCSetOptions {\n sceneId: number;\n dimmingDuration: Duration;\n level?: number;\n}\n@CCCommand(SceneActuatorConfigurationCommand.Set)\n@useSupervision()\nexport class SceneActuatorConfigurationCCSet extends SceneActuatorConfigurationCC {\n public constructor(options: WithAddress<SceneActuatorConfigurationCCSetOptions>) {\n super(options);\n if (options.sceneId < 1 || options.sceneId > 255) {\n throw new ZWaveError(`The scene id ${options.sceneId} must be between 1 and 255!`, ZWaveErrorCodes.Argument_Invalid);\n }\n this.sceneId = options.sceneId;\n this.dimmingDuration = options.dimmingDuration;\n this.level = options.level;\n }\n public static from(_raw: CCRaw, _ctx: CCParsingContext): SceneActuatorConfigurationCCSet {\n // TODO: Deserialize payload\n throw new ZWaveError(`${this.name}: deserialization not implemented`, ZWaveErrorCodes.Deserialization_NotImplemented);\n // return new SceneActuatorConfigurationCCSet({\n // \tnodeId: ctx.sourceNodeId,\n // });\n }\n public sceneId: number;\n public dimmingDuration: Duration;\n public level?: number;\n public serialize(ctx: CCEncodingContext): Promise<Bytes> {\n this.payload = Bytes.from([\n this.sceneId,\n this.dimmingDuration.serializeSet(),\n this.level != undefined ? 128 : 0,\n this.level ?? 0xff,\n ]);\n return super.serialize(ctx);\n }\n public toLogEntry(ctx?: GetValueDB): MessageOrCCLogEntry {\n const message: MessageRecord = {\n sceneId: this.sceneId,\n dimmingDuration: this.dimmingDuration.toString(),\n };\n if (this.level != undefined) {\n message.level = this.level;\n }\n return {\n ...super.toLogEntry(ctx),\n message,\n };\n }\n}\n// @publicAPI\nexport interface SceneActuatorConfigurationCCReportOptions {\n sceneId: number;\n level?: number;\n dimmingDuration?: Duration;\n}\n@CCCommand(SceneActuatorConfigurationCommand.Report)\nexport class SceneActuatorConfigurationCCReport extends SceneActuatorConfigurationCC {\n public constructor(options: WithAddress<SceneActuatorConfigurationCCReportOptions>) {\n super(options);\n // TODO: Check implementation:\n this.sceneId = options.sceneId;\n this.level = options.level;\n this.dimmingDuration = options.dimmingDuration;\n }\n public static from(raw: CCRaw, ctx: CCParsingContext): SceneActuatorConfigurationCCReport {\n validatePayload(raw.payload.length >= 3);\n const sceneId = raw.payload[0];\n let level: number | undefined;\n let dimmingDuration: Duration | undefined;\n if (sceneId !== 0) {\n level = raw.payload[1];\n dimmingDuration = Duration.parseReport(raw.payload[2])\n ?? Duration.unknown();\n }\n return new this({\n nodeId: ctx.sourceNodeId,\n sceneId,\n level,\n dimmingDuration,\n });\n }\n public readonly sceneId: number;\n public readonly level?: number;\n public readonly dimmingDuration?: Duration;\n public persistValues(ctx: PersistValuesContext): boolean {\n if (!super.persistValues(ctx))\n return false;\n // Do not persist values for an inactive scene\n if (this.sceneId === 0\n || this.level == undefined\n || this.dimmingDuration == undefined) {\n return false;\n }\n const levelValue = SceneActuatorConfigurationCCValues.level(this.sceneId);\n this.ensureMetadata(ctx, levelValue);\n const dimmingDurationValue = SceneActuatorConfigurationCCValues\n .dimmingDuration(this.sceneId);\n this.ensureMetadata(ctx, dimmingDurationValue);\n this.setValue(ctx, levelValue, this.level);\n this.setValue(ctx, dimmingDurationValue, this.dimmingDuration);\n return true;\n }\n public toLogEntry(ctx?: GetValueDB): MessageOrCCLogEntry {\n const message: MessageRecord = {\n sceneId: this.sceneId,\n };\n if (this.dimmingDuration != undefined) {\n message.dimmingDuration = this.dimmingDuration.toString();\n }\n if (this.level != undefined) {\n message.level = this.level;\n }\n return {\n ...super.toLogEntry(ctx),\n message,\n };\n }\n}\nfunction testResponseForSceneActuatorConfigurationGet(sent: SceneActuatorConfigurationCCGet, received: SceneActuatorConfigurationCCReport) {\n // We expect a Scene Actuator Configuration Report that matches\n // the requested sceneId, unless groupId 0 was requested\n return sent.sceneId === 0 || received.sceneId === sent.sceneId;\n}\n// @publicAPI\nexport interface SceneActuatorConfigurationCCGetOptions {\n sceneId: number;\n}\n@CCCommand(SceneActuatorConfigurationCommand.Get)\n@expectedCCResponse(SceneActuatorConfigurationCCReport, testResponseForSceneActuatorConfigurationGet)\nexport class SceneActuatorConfigurationCCGet extends SceneActuatorConfigurationCC {\n public constructor(options: WithAddress<SceneActuatorConfigurationCCGetOptions>) {\n super(options);\n this.sceneId = options.sceneId;\n }\n public static from(_raw: CCRaw, _ctx: CCParsingContext): SceneActuatorConfigurationCCGet {\n // TODO: Deserialize payload\n throw new ZWaveError(`${this.name}: deserialization not implemented`, ZWaveErrorCodes.Deserialization_NotImplemented);\n // return new SceneActuatorConfigurationCCGet({\n // \tnodeId: ctx.sourceNodeId,\n // });\n }\n public sceneId: number;\n public serialize(ctx: CCEncodingContext): Promise<Bytes> {\n this.payload = Bytes.from([this.sceneId]);\n return super.serialize(ctx);\n }\n public toLogEntry(ctx?: GetValueDB): MessageOrCCLogEntry {\n return {\n ...super.toLogEntry(ctx),\n message: { \"scene id\": this.sceneId },\n };\n }\n}\n"],
5
- "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,qBAAgC;AAEhC,kBAA+O;AAC/O,oBAA4B;AAC5B,iBAA8M;AAC9M,0BAA4F;AAC5F,oCAAgH;AAEhH,mBAAkD;AAElD,gCAAmD;AATnD,MAAM,EAAE,kDAAkD,iDAAgD,IAAK;IAYlG,mCAA+B,MAAA;8BAD3C,mCAAI,2BAAe,8BAA8B,CAAC,CAAC;;;;oBACC;;;;uDAAA,YAAK;WAAA;;;;;;;;yBAoErD,iDAAgD,CAAE;yBA4BlD,iDAAgD,CAAE;AA3BnD,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,0BAAA;AA4BhB,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,0BAAA;AAjGpB,qCAAA,MAAA,mBAAA,EAAA,OAAA,WAAA,GAAA,kBAAA,EAAA,MAAA,SAAA,MAAA,WAAA,MAAA,UAAA,UAAA,GAAA,MAAA,uBAAA;;;AAAa,0CAAA,YAAA,uBAAA;;IACF,gBAAgB,KAAsC;AACzD,cAAQ,KAAK;QACT,KAAK,+CAAkC;AACnC,iBAAO,KAAK,aAAY;QAC5B,KAAK,+CAAkC;AACnC,iBAAO;MACf;AACA,aAAO,MAAM,gBAAgB,GAAG;IACpC;IACA,K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nC,WAAK,UAAU,oBAAM,KAAK,CAAC,KAAK,OAAO,CAAC;AACxC,aAAO,MAAM,UAAU,GAAG;IAC9B;IACO,WAAW,KAAgB;AAC9B,aAAO;QACH,GAAG,MAAM,WAAW,GAAG;QACvB,SAAS,EAAE,YAAY,KAAK,QAAO;;IAE3C;;;;",
4
+ "sourcesContent": ["import * as __validateArgs from \"./SceneActuatorConfigurationCC._validateArgs.js\";\nconst { validateArgs_SceneActuatorConfigurationCCAPI_set, validateArgs_SceneActuatorConfigurationCCAPI_get } = __validateArgs;\nimport { CommandClasses, Duration, type GetValueDB, type MaybeNotKnown, type MessageOrCCLogEntry, type MessageRecord, type SupervisionResult, ValueMetadata, type WithAddress, ZWaveError, ZWaveErrorCodes, getCCName, validatePayload, } from \"@zwave-js/core\";\nimport { Bytes, pick } from \"@zwave-js/shared\";\nimport { CCAPI, POLL_VALUE, type PollValueImplementation, SET_VALUE, type SetValueImplementation, throwMissingPropertyKey, throwUnsupportedProperty, throwUnsupportedPropertyKey, throwWrongValueType, } from \"../lib/API.js\";\nimport { type CCRaw, CommandClass, type InterviewContext, type PersistValuesContext, } from \"../lib/CommandClass.js\";\nimport { API, CCCommand, ccValues, commandClass, expectedCCResponse, implementedVersion, useSupervision, } from \"../lib/CommandClassDecorators.js\";\nimport { V } from \"../lib/Values.js\";\nimport { SceneActuatorConfigurationCommand } from \"../lib/_Types.js\";\nimport type { CCEncodingContext, CCParsingContext } from \"../lib/traits.js\";\nimport { SceneActuatorConfigurationCCValues } from \"./_CCValues.generated.js\";\nexport { SceneActuatorConfigurationCCValues };\n@API(CommandClasses[\"Scene Actuator Configuration\"])\nexport class SceneActuatorConfigurationCCAPI extends CCAPI {\n public supportsCommand(cmd: SceneActuatorConfigurationCommand): MaybeNotKnown<boolean> {\n switch (cmd) {\n case SceneActuatorConfigurationCommand.Get:\n return this.isSinglecast();\n case SceneActuatorConfigurationCommand.Set:\n return true;\n }\n return super.supportsCommand(cmd);\n }\n protected override get [SET_VALUE](): SetValueImplementation {\n return async function (this: SceneActuatorConfigurationCCAPI, { property, propertyKey }, value, options) {\n if (propertyKey == undefined) {\n throwMissingPropertyKey(this.ccId, property);\n }\n else if (typeof propertyKey !== \"number\") {\n throwUnsupportedPropertyKey(this.ccId, property, propertyKey);\n }\n if (property === \"level\") {\n if (typeof value !== \"number\") {\n throwWrongValueType(this.ccId, property, \"number\", typeof value);\n }\n // We need to set the dimming duration along with the level.\n // Dimming duration is chosen with the following precedence:\n // 1. options.transitionDuration\n // 2. current stored value\n // 3. default\n const dimmingDuration = Duration.from(options?.transitionDuration)\n ?? this.tryGetValueDB()?.getValue<Duration>(SceneActuatorConfigurationCCValues.dimmingDuration(propertyKey).endpoint(this.endpoint.index));\n return this.set(propertyKey, dimmingDuration, value);\n }\n else if (property === \"dimmingDuration\") {\n if (typeof value !== \"string\" && !Duration.isDuration(value)) {\n throwWrongValueType(this.ccId, property, \"duration\", typeof value);\n }\n const dimmingDuration = Duration.from(value);\n if (dimmingDuration == undefined) {\n throw new ZWaveError(`${getCCName(this.ccId)}: \"${property}\" could not be set. ${JSON.stringify(value)} is not a valid duration.`, ZWaveErrorCodes.Argument_Invalid);\n }\n // Must set the level along with the dimmingDuration,\n // Use saved value, if it's defined. Otherwise the default\n // will be used.\n const level = this.tryGetValueDB()?.getValue<number>(SceneActuatorConfigurationCCValues.level(propertyKey).endpoint(this.endpoint.index));\n return this.set(propertyKey, dimmingDuration, level);\n }\n else {\n throwUnsupportedProperty(this.ccId, property);\n }\n };\n }\n protected get [POLL_VALUE](): PollValueImplementation {\n return async function (this: SceneActuatorConfigurationCCAPI, { property, propertyKey }) {\n switch (property) {\n case \"level\":\n case \"dimmingDuration\": {\n if (propertyKey == undefined) {\n throwMissingPropertyKey(this.ccId, property);\n }\n else if (typeof propertyKey !== \"number\") {\n throwUnsupportedPropertyKey(this.ccId, property, propertyKey);\n }\n return (await this.get(propertyKey))?.[property];\n }\n default:\n throwUnsupportedProperty(this.ccId, property);\n }\n };\n }\n @validateArgs_SceneActuatorConfigurationCCAPI_set()\n public async set(sceneId: number, dimmingDuration?: Duration | string, level?: number): Promise<SupervisionResult | undefined> {\n this.assertSupportsCommand(SceneActuatorConfigurationCommand, SceneActuatorConfigurationCommand.Set);\n // Undefined `dimmingDuration` defaults to 0 seconds to simplify the call\n // for actuators that don't support non-instant `dimmingDuration`\n // Undefined `level` uses the actuator's current value (override = 0).\n const cc = new SceneActuatorConfigurationCCSet({\n nodeId: this.endpoint.nodeId,\n endpointIndex: this.endpoint.index,\n sceneId,\n dimmingDuration: Duration.from(dimmingDuration) ?? new Duration(0, \"seconds\"),\n level,\n });\n return this.host.sendCommand(cc, this.commandOptions);\n }\n public async getActive(): Promise<MaybeNotKnown<Pick<SceneActuatorConfigurationCCReport, \"sceneId\" | \"level\" | \"dimmingDuration\">>> {\n this.assertSupportsCommand(SceneActuatorConfigurationCommand, SceneActuatorConfigurationCommand.Get);\n const cc = new SceneActuatorConfigurationCCGet({\n nodeId: this.endpoint.nodeId,\n endpointIndex: this.endpoint.index,\n sceneId: 0,\n });\n const response = await this.host.sendCommand<SceneActuatorConfigurationCCReport>(cc, this.commandOptions);\n if (response) {\n return pick(response, [\"sceneId\", \"level\", \"dimmingDuration\"]);\n }\n }\n @validateArgs_SceneActuatorConfigurationCCAPI_get()\n public async get(sceneId: number): Promise<MaybeNotKnown<Pick<SceneActuatorConfigurationCCReport, \"level\" | \"dimmingDuration\">>> {\n this.assertSupportsCommand(SceneActuatorConfigurationCommand, SceneActuatorConfigurationCommand.Get);\n if (sceneId === 0) {\n throw new ZWaveError(`Invalid scene ID 0. To get the currently active scene, use getActive() instead.`, ZWaveErrorCodes.Argument_Invalid);\n }\n const cc = new SceneActuatorConfigurationCCGet({\n nodeId: this.endpoint.nodeId,\n endpointIndex: this.endpoint.index,\n sceneId: sceneId,\n });\n const response = await this.host.sendCommand<SceneActuatorConfigurationCCReport>(cc, this.commandOptions);\n if (response) {\n return pick(response, [\"level\", \"dimmingDuration\"]);\n }\n }\n}\n@commandClass(CommandClasses[\"Scene Actuator Configuration\"])\n@implementedVersion(1)\n@ccValues(SceneActuatorConfigurationCCValues)\nexport class SceneActuatorConfigurationCC extends CommandClass {\n declare ccCommand: SceneActuatorConfigurationCommand;\n public async interview(ctx: InterviewContext): Promise<void> {\n const node = this.getNode(ctx)!;\n ctx.logNode(node.id, {\n message: `${this.constructor.name}: setting metadata`,\n direction: \"none\",\n });\n // Create Metadata for all scenes\n for (let sceneId = 1; sceneId <= 255; sceneId++) {\n const levelValue = SceneActuatorConfigurationCCValues.level(sceneId);\n this.ensureMetadata(ctx, levelValue);\n const dimmingDurationValue = SceneActuatorConfigurationCCValues.dimmingDuration(sceneId);\n this.ensureMetadata(ctx, dimmingDurationValue);\n }\n this.setInterviewComplete(ctx, true);\n }\n}\n// @publicAPI\nexport interface SceneActuatorConfigurationCCSetOptions {\n sceneId: number;\n dimmingDuration: Duration;\n level?: number;\n}\n@CCCommand(SceneActuatorConfigurationCommand.Set)\n@useSupervision()\nexport class SceneActuatorConfigurationCCSet extends SceneActuatorConfigurationCC {\n public constructor(options: WithAddress<SceneActuatorConfigurationCCSetOptions>) {\n super(options);\n if (options.sceneId < 1 || options.sceneId > 255) {\n throw new ZWaveError(`The scene id ${options.sceneId} must be between 1 and 255!`, ZWaveErrorCodes.Argument_Invalid);\n }\n this.sceneId = options.sceneId;\n this.dimmingDuration = options.dimmingDuration;\n this.level = options.level;\n }\n public static from(raw: CCRaw, ctx: CCParsingContext): SceneActuatorConfigurationCCSet {\n validatePayload(raw.payload.length >= 4);\n validatePayload(raw.payload[0] >= 1);\n const sceneId = raw.payload[0];\n const dimmingDuration = Duration.parseSet(raw.payload[1])!;\n let level: number | undefined;\n if (raw.payload[2] & 128) {\n level = raw.payload[3];\n }\n return new this({\n nodeId: ctx.sourceNodeId,\n sceneId,\n dimmingDuration,\n level,\n });\n }\n public sceneId: number;\n public dimmingDuration: Duration;\n public level?: number;\n public serialize(ctx: CCEncodingContext): Promise<Bytes> {\n let overrideByte = 0;\n if (this.level != undefined) {\n overrideByte = 128;\n }\n this.payload = Bytes.from([\n this.sceneId,\n this.dimmingDuration.serializeSet(),\n overrideByte,\n this.level ?? 0xff,\n ]);\n return super.serialize(ctx);\n }\n public toLogEntry(ctx?: GetValueDB): MessageOrCCLogEntry {\n const message: MessageRecord = {\n sceneId: this.sceneId,\n dimmingDuration: this.dimmingDuration.toString(),\n };\n if (this.level != undefined) {\n message.level = this.level;\n }\n return {\n ...super.toLogEntry(ctx),\n message,\n };\n }\n}\n// @publicAPI\nexport interface SceneActuatorConfigurationCCReportOptions {\n sceneId: number;\n level?: number;\n dimmingDuration?: Duration;\n}\n@CCCommand(SceneActuatorConfigurationCommand.Report)\nexport class SceneActuatorConfigurationCCReport extends SceneActuatorConfigurationCC {\n public constructor(options: WithAddress<SceneActuatorConfigurationCCReportOptions>) {\n super(options);\n // TODO: Check implementation:\n this.sceneId = options.sceneId;\n this.level = options.level;\n this.dimmingDuration = options.dimmingDuration;\n }\n public static from(raw: CCRaw, ctx: CCParsingContext): SceneActuatorConfigurationCCReport {\n validatePayload(raw.payload.length >= 3);\n const sceneId = raw.payload[0];\n let level: number | undefined;\n let dimmingDuration: Duration | undefined;\n if (sceneId !== 0) {\n level = raw.payload[1];\n dimmingDuration =\n Duration.parseReport(raw.payload[2]) ?? Duration.unknown();\n }\n return new this({\n nodeId: ctx.sourceNodeId,\n sceneId,\n level,\n dimmingDuration,\n });\n }\n public readonly sceneId: number;\n public readonly level?: number;\n public readonly dimmingDuration?: Duration;\n public serialize(ctx: CCEncodingContext): Promise<Bytes> {\n if (this.sceneId === 0) {\n this.payload = Bytes.from([0, 0, 0]);\n }\n else {\n this.payload = Bytes.from([\n this.sceneId,\n this.level ?? 0xff,\n (this.dimmingDuration ?? Duration.unknown()).serializeReport(),\n ]);\n }\n return super.serialize(ctx);\n }\n public persistValues(ctx: PersistValuesContext): boolean {\n if (!super.persistValues(ctx))\n return false;\n // Do not persist values for an inactive scene\n if (this.sceneId === 0\n || this.level == undefined\n || this.dimmingDuration == undefined) {\n return false;\n }\n const levelValue = SceneActuatorConfigurationCCValues.level(this.sceneId);\n this.ensureMetadata(ctx, levelValue);\n const dimmingDurationValue = SceneActuatorConfigurationCCValues.dimmingDuration(this.sceneId);\n this.ensureMetadata(ctx, dimmingDurationValue);\n this.setValue(ctx, levelValue, this.level);\n this.setValue(ctx, dimmingDurationValue, this.dimmingDuration);\n return true;\n }\n public toLogEntry(ctx?: GetValueDB): MessageOrCCLogEntry {\n const message: MessageRecord = {\n sceneId: this.sceneId,\n };\n if (this.dimmingDuration != undefined) {\n message.dimmingDuration = this.dimmingDuration.toString();\n }\n if (this.level != undefined) {\n message.level = this.level;\n }\n return {\n ...super.toLogEntry(ctx),\n message,\n };\n }\n}\nfunction testResponseForSceneActuatorConfigurationGet(sent: SceneActuatorConfigurationCCGet, received: SceneActuatorConfigurationCCReport) {\n // We expect a Scene Actuator Configuration Report that matches\n // the requested sceneId, unless groupId 0 was requested\n return sent.sceneId === 0 || received.sceneId === sent.sceneId;\n}\n// @publicAPI\nexport interface SceneActuatorConfigurationCCGetOptions {\n sceneId: number;\n}\n@CCCommand(SceneActuatorConfigurationCommand.Get)\n@expectedCCResponse(SceneActuatorConfigurationCCReport, testResponseForSceneActuatorConfigurationGet)\nexport class SceneActuatorConfigurationCCGet extends SceneActuatorConfigurationCC {\n public constructor(options: WithAddress<SceneActuatorConfigurationCCGetOptions>) {\n super(options);\n this.sceneId = options.sceneId;\n }\n public static from(raw: CCRaw, ctx: CCParsingContext): SceneActuatorConfigurationCCGet {\n validatePayload(raw.payload.length >= 1);\n return new this({\n nodeId: ctx.sourceNodeId,\n sceneId: raw.payload[0],\n });\n }\n public sceneId: number;\n public serialize(ctx: CCEncodingContext): Promise<Bytes> {\n this.payload = Bytes.from([this.sceneId]);\n return super.serialize(ctx);\n }\n public toLogEntry(ctx?: GetValueDB): MessageOrCCLogEntry {\n return {\n ...super.toLogEntry(ctx),\n message: { \"sc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IAWI,mCAA+B,MAAA;8BAF3C,yCAAU,+CAAkC,GAAG,OAC/C,kDAAmB,oCAAoC,4CAA4C,CAAC;;;;oBAChD;uDAAA,YAA4B;WAAA;;;;;;;;AAAjF,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,SAA4D;AAC3E,YAAM,OAAO;AACb,WAAK,UAAU,QAAQ;IAC3B;IACO,OAAO,KAAK,KAAY,KAAqB;AAChD,uCAAgB,IAAI,QAAQ,UAAU,CAAC;AACvC,aAAO,IAAI,KAAK;QACZ,QAAQ,IAAI;QACZ,SAAS,IAAI,QAAQ,CAAC;OACzB;IACL;IACO;IACA,UAAU,KAAsB;AACnC,WAAK,UAAU,oBAAM,KAAK,CAAC,KAAK,OAAO,CAAC;AACxC,aAAO,MAAM,UAAU,GAAG;IAC9B;IACO,WAAW,KAAgB;AAC9B,aAAO;QACH,GAAG,MAAM,WAAW,GAAG;QACvB,SAAS,EAAE,YAAY,KAAK,QAAO;;IAE3C;;;;",
6
6
  "names": []
7
7
  }
@@ -35,7 +35,7 @@ export interface SceneControllerConfigurationCCSetOptions {
35
35
  }
36
36
  export declare class SceneControllerConfigurationCCSet extends SceneControllerConfigurationCC {
37
37
  constructor(options: WithAddress<SceneControllerConfigurationCCSetOptions>);
38
- static from(_raw: CCRaw, _ctx: CCParsingContext): SceneControllerConfigurationCCSet;
38
+ static from(raw: CCRaw, ctx: CCParsingContext): SceneControllerConfigurationCCSet;
39
39
  groupId: number;
40
40
  sceneId: number;
41
41
  dimmingDuration: Duration;
@@ -53,6 +53,7 @@ export declare class SceneControllerConfigurationCCReport extends SceneControlle
53
53
  readonly groupId: number;
54
54
  readonly sceneId: number;
55
55
  readonly dimmingDuration: Duration;
56
+ serialize(ctx: CCEncodingContext): Promise<Bytes>;
56
57
  persistValues(ctx: PersistValuesContext): boolean;
57
58
  toLogEntry(ctx?: GetValueDB): MessageOrCCLogEntry;
58
59
  }
@@ -61,7 +62,7 @@ export interface SceneControllerConfigurationCCGetOptions {
61
62
  }
62
63
  export declare class SceneControllerConfigurationCCGet extends SceneControllerConfigurationCC {
63
64
  constructor(options: WithAddress<SceneControllerConfigurationCCGetOptions>);
64
- static from(_raw: CCRaw, _ctx: CCParsingContext): SceneControllerConfigurationCCGet;
65
+ static from(raw: CCRaw, ctx: CCParsingContext): SceneControllerConfigurationCCGet;
65
66
  groupId: number;
66
67
  serialize(ctx: CCEncodingContext): Promise<Bytes>;
67
68
  toLogEntry(ctx?: GetValueDB): MessageOrCCLogEntry;
@@ -324,8 +324,17 @@ let SceneControllerConfigurationCCSet = (() => {
324
324
  this.sceneId = options.sceneId;
325
325
  this.dimmingDuration = import_core.Duration.from(options.dimmingDuration) ?? import_core.Duration.default();
326
326
  }
327
- static from(_raw, _ctx) {
328
- throw new import_core.ZWaveError(`${this.name}: deserialization not implemented`, import_core.ZWaveErrorCodes.Deserialization_NotImplemented);
327
+ static from(raw, ctx) {
328
+ (0, import_core.validatePayload)(raw.payload.length >= 3);
329
+ const groupId = raw.payload[0];
330
+ const sceneId = raw.payload[1];
331
+ const dimmingDuration = import_core.Duration.parseSet(raw.payload[2]);
332
+ return new this({
333
+ nodeId: ctx.sourceNodeId,
334
+ groupId,
335
+ sceneId,
336
+ dimmingDuration
337
+ });
329
338
  }
330
339
  groupId;
331
340
  sceneId;
@@ -392,6 +401,14 @@ let SceneControllerConfigurationCCReport = (() => {
392
401
  groupId;
393
402
  sceneId;
394
403
  dimmingDuration;
404
+ serialize(ctx) {
405
+ this.payload = import_shared.Bytes.from([
406
+ this.groupId,
407
+ this.sceneId,
408
+ this.dimmingDuration.serializeReport()
409
+ ]);
410
+ return super.serialize(ctx);
411
+ }
395
412
  persistValues(ctx) {
396
413
  if (!super.persistValues(ctx))
397
414
  return false;
@@ -446,8 +463,12 @@ let SceneControllerConfigurationCCGet = (() => {
446
463
  super(options);
447
464
  this.groupId = options.groupId;
448
465
  }
449
- static from(_raw, _ctx) {
450
- throw new import_core.ZWaveError(`${this.name}: deserialization not implemented`, import_core.ZWaveErrorCodes.Deserialization_NotImplemented);
466
+ static from(raw, ctx) {
467
+ (0, import_core.validatePayload)(raw.payload.length >= 1);
468
+ return new this({
469
+ nodeId: ctx.sourceNodeId,
470
+ groupId: raw.payload[0]
471
+ });
451
472
  }
452
473
  groupId;
453
474
  serialize(ctx) {