@zwave-js/cc 15.1.0 → 15.1.2

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 (537) hide show
  1. package/build/cjs/cc/AlarmSensorCC.d.ts +7 -7
  2. package/build/cjs/cc/AlarmSensorCC.js +22 -23
  3. package/build/cjs/cc/AlarmSensorCC.js.map +3 -3
  4. package/build/cjs/cc/AssociationCC.d.ts +8 -9
  5. package/build/cjs/cc/AssociationCC.js +29 -29
  6. package/build/cjs/cc/AssociationCC.js.map +3 -3
  7. package/build/cjs/cc/AssociationGroupInfoCC.d.ts +7 -7
  8. package/build/cjs/cc/AssociationGroupInfoCC.js +31 -32
  9. package/build/cjs/cc/AssociationGroupInfoCC.js.map +3 -3
  10. package/build/cjs/cc/BarrierOperatorCC.d.ts +8 -8
  11. package/build/cjs/cc/BarrierOperatorCC.js +35 -36
  12. package/build/cjs/cc/BarrierOperatorCC.js.map +3 -3
  13. package/build/cjs/cc/BasicCC.d.ts +4 -4
  14. package/build/cjs/cc/BasicCC.js +23 -24
  15. package/build/cjs/cc/BasicCC.js.map +3 -3
  16. package/build/cjs/cc/BatteryCC.d.ts +6 -8
  17. package/build/cjs/cc/BatteryCC.js +24 -28
  18. package/build/cjs/cc/BatteryCC.js.map +3 -3
  19. package/build/cjs/cc/BinarySensorCC.d.ts +5 -5
  20. package/build/cjs/cc/BinarySensorCC.js +20 -21
  21. package/build/cjs/cc/BinarySensorCC.js.map +3 -3
  22. package/build/cjs/cc/BinarySwitchCC._validateArgs.js +2 -2
  23. package/build/cjs/cc/BinarySwitchCC.d.ts +6 -6
  24. package/build/cjs/cc/BinarySwitchCC.js +26 -26
  25. package/build/cjs/cc/BinarySwitchCC.js.map +3 -3
  26. package/build/cjs/cc/CRC16CC.d.ts +3 -3
  27. package/build/cjs/cc/CRC16CC.js +15 -15
  28. package/build/cjs/cc/CRC16CC.js.map +3 -3
  29. package/build/cjs/cc/CentralSceneCC.d.ts +8 -8
  30. package/build/cjs/cc/CentralSceneCC.js +23 -24
  31. package/build/cjs/cc/CentralSceneCC.js.map +3 -3
  32. package/build/cjs/cc/ClimateControlScheduleCC.d.ts +6 -6
  33. package/build/cjs/cc/ClimateControlScheduleCC.js +19 -20
  34. package/build/cjs/cc/ClimateControlScheduleCC.js.map +3 -3
  35. package/build/cjs/cc/ClockCC.d.ts +3 -4
  36. package/build/cjs/cc/ClockCC.js +13 -14
  37. package/build/cjs/cc/ClockCC.js.map +3 -3
  38. package/build/cjs/cc/ColorSwitchCC.d.ts +3 -4
  39. package/build/cjs/cc/ColorSwitchCC.js +22 -24
  40. package/build/cjs/cc/ColorSwitchCC.js.map +3 -3
  41. package/build/cjs/cc/ConfigurationCC.d.ts +3 -3
  42. package/build/cjs/cc/ConfigurationCC.js +114 -115
  43. package/build/cjs/cc/ConfigurationCC.js.map +3 -3
  44. package/build/cjs/cc/DeviceResetLocallyCC.d.ts +2 -2
  45. package/build/cjs/cc/DeviceResetLocallyCC.js +5 -5
  46. package/build/cjs/cc/DeviceResetLocallyCC.js.map +1 -1
  47. package/build/cjs/cc/DoorLockCC.d.ts +29 -29
  48. package/build/cjs/cc/DoorLockCC.js +39 -40
  49. package/build/cjs/cc/DoorLockCC.js.map +3 -3
  50. package/build/cjs/cc/DoorLockLoggingCC.d.ts +4 -4
  51. package/build/cjs/cc/DoorLockLoggingCC.js +13 -14
  52. package/build/cjs/cc/DoorLockLoggingCC.js.map +3 -3
  53. package/build/cjs/cc/EnergyProductionCC.d.ts +2 -3
  54. package/build/cjs/cc/EnergyProductionCC.js.map +2 -2
  55. package/build/cjs/cc/EntryControlCC.d.ts +8 -8
  56. package/build/cjs/cc/EntryControlCC.js +41 -42
  57. package/build/cjs/cc/EntryControlCC.js.map +3 -3
  58. package/build/cjs/cc/FirmwareUpdateMetaDataCC.d.ts +9 -10
  59. package/build/cjs/cc/FirmwareUpdateMetaDataCC.js +52 -53
  60. package/build/cjs/cc/FirmwareUpdateMetaDataCC.js.map +3 -3
  61. package/build/cjs/cc/HailCC.js +2 -2
  62. package/build/cjs/cc/HailCC.js.map +1 -1
  63. package/build/cjs/cc/HumidityControlModeCC.d.ts +5 -5
  64. package/build/cjs/cc/HumidityControlModeCC.js +20 -21
  65. package/build/cjs/cc/HumidityControlModeCC.js.map +3 -3
  66. package/build/cjs/cc/HumidityControlOperatingStateCC.d.ts +3 -3
  67. package/build/cjs/cc/HumidityControlOperatingStateCC.js +9 -9
  68. package/build/cjs/cc/HumidityControlOperatingStateCC.js.map +3 -3
  69. package/build/cjs/cc/HumidityControlSetpointCC.d.ts +6 -6
  70. package/build/cjs/cc/HumidityControlSetpointCC.js +43 -44
  71. package/build/cjs/cc/HumidityControlSetpointCC.js.map +3 -3
  72. package/build/cjs/cc/InclusionControllerCC.d.ts +2 -3
  73. package/build/cjs/cc/InclusionControllerCC.js.map +2 -2
  74. package/build/cjs/cc/IndicatorCC.d.ts +3 -3
  75. package/build/cjs/cc/IndicatorCC.js +50 -52
  76. package/build/cjs/cc/IndicatorCC.js.map +3 -3
  77. package/build/cjs/cc/IrrigationCC.d.ts +3 -3
  78. package/build/cjs/cc/IrrigationCC.js +74 -75
  79. package/build/cjs/cc/IrrigationCC.js.map +3 -3
  80. package/build/cjs/cc/LanguageCC.d.ts +5 -6
  81. package/build/cjs/cc/LanguageCC.js +14 -15
  82. package/build/cjs/cc/LanguageCC.js.map +3 -3
  83. package/build/cjs/cc/LockCC.d.ts +4 -4
  84. package/build/cjs/cc/LockCC.js +10 -10
  85. package/build/cjs/cc/LockCC.js.map +3 -3
  86. package/build/cjs/cc/ManufacturerProprietaryCC.d.ts +4 -3
  87. package/build/cjs/cc/ManufacturerProprietaryCC.js +14 -12
  88. package/build/cjs/cc/ManufacturerProprietaryCC.js.map +3 -3
  89. package/build/cjs/cc/ManufacturerSpecificCC.d.ts +7 -8
  90. package/build/cjs/cc/ManufacturerSpecificCC.js +20 -21
  91. package/build/cjs/cc/ManufacturerSpecificCC.js.map +3 -3
  92. package/build/cjs/cc/MeterCC.d.ts +4 -6
  93. package/build/cjs/cc/MeterCC.js +52 -54
  94. package/build/cjs/cc/MeterCC.js.map +3 -3
  95. package/build/cjs/cc/MultiChannelAssociationCC.d.ts +7 -8
  96. package/build/cjs/cc/MultiChannelAssociationCC.js +34 -35
  97. package/build/cjs/cc/MultiChannelAssociationCC.js.map +3 -3
  98. package/build/cjs/cc/MultiChannelCC.d.ts +13 -12
  99. package/build/cjs/cc/MultiChannelCC.js +104 -56
  100. package/build/cjs/cc/MultiChannelCC.js.map +3 -3
  101. package/build/cjs/cc/MultiCommandCC.d.ts +3 -3
  102. package/build/cjs/cc/MultiCommandCC.js +13 -13
  103. package/build/cjs/cc/MultiCommandCC.js.map +3 -3
  104. package/build/cjs/cc/MultilevelSensorCC.d.ts +4 -7
  105. package/build/cjs/cc/MultilevelSensorCC.js +26 -28
  106. package/build/cjs/cc/MultilevelSensorCC.js.map +3 -3
  107. package/build/cjs/cc/MultilevelSwitchCC._validateArgs.js +3 -3
  108. package/build/cjs/cc/MultilevelSwitchCC.d.ts +13 -13
  109. package/build/cjs/cc/MultilevelSwitchCC.js +36 -37
  110. package/build/cjs/cc/MultilevelSwitchCC.js.map +3 -3
  111. package/build/cjs/cc/NoOperationCC.js +4 -4
  112. package/build/cjs/cc/NoOperationCC.js.map +1 -1
  113. package/build/cjs/cc/NodeNamingCC.d.ts +5 -5
  114. package/build/cjs/cc/NodeNamingCC.js +20 -20
  115. package/build/cjs/cc/NodeNamingCC.js.map +3 -3
  116. package/build/cjs/cc/NotificationCC.d.ts +4 -5
  117. package/build/cjs/cc/NotificationCC.js +66 -68
  118. package/build/cjs/cc/NotificationCC.js.map +3 -3
  119. package/build/cjs/cc/PowerlevelCC.d.ts +3 -3
  120. package/build/cjs/cc/PowerlevelCC.js +25 -26
  121. package/build/cjs/cc/PowerlevelCC.js.map +3 -3
  122. package/build/cjs/cc/ProtectionCC._validateArgs.js +2 -2
  123. package/build/cjs/cc/ProtectionCC.d.ts +11 -11
  124. package/build/cjs/cc/ProtectionCC.js +35 -36
  125. package/build/cjs/cc/ProtectionCC.js.map +3 -3
  126. package/build/cjs/cc/SceneActivationCC._validateArgs.js +2 -2
  127. package/build/cjs/cc/SceneActivationCC.d.ts +5 -6
  128. package/build/cjs/cc/SceneActivationCC.js +10 -10
  129. package/build/cjs/cc/SceneActivationCC.js.map +3 -3
  130. package/build/cjs/cc/SceneActuatorConfigurationCC._validateArgs.js +2 -2
  131. package/build/cjs/cc/SceneActuatorConfigurationCC.d.ts +5 -5
  132. package/build/cjs/cc/SceneActuatorConfigurationCC.js +19 -20
  133. package/build/cjs/cc/SceneActuatorConfigurationCC.js.map +3 -3
  134. package/build/cjs/cc/SceneControllerConfigurationCC._validateArgs.js +2 -2
  135. package/build/cjs/cc/SceneControllerConfigurationCC.d.ts +6 -6
  136. package/build/cjs/cc/SceneControllerConfigurationCC.js +25 -26
  137. package/build/cjs/cc/SceneControllerConfigurationCC.js.map +3 -3
  138. package/build/cjs/cc/ScheduleEntryLockCC.d.ts +2 -3
  139. package/build/cjs/cc/ScheduleEntryLockCC.js.map +2 -2
  140. package/build/cjs/cc/Security2CC.d.ts +3 -4
  141. package/build/cjs/cc/Security2CC.js +60 -62
  142. package/build/cjs/cc/Security2CC.js.map +3 -3
  143. package/build/cjs/cc/SecurityCC.d.ts +3 -4
  144. package/build/cjs/cc/SecurityCC.js +25 -26
  145. package/build/cjs/cc/SecurityCC.js.map +3 -3
  146. package/build/cjs/cc/SoundSwitchCC.d.ts +7 -7
  147. package/build/cjs/cc/SoundSwitchCC.js +28 -29
  148. package/build/cjs/cc/SoundSwitchCC.js.map +3 -3
  149. package/build/cjs/cc/SupervisionCC.d.ts +4 -4
  150. package/build/cjs/cc/SupervisionCC.js +28 -29
  151. package/build/cjs/cc/SupervisionCC.js.map +3 -3
  152. package/build/cjs/cc/ThermostatFanModeCC.d.ts +6 -6
  153. package/build/cjs/cc/ThermostatFanModeCC.js +21 -22
  154. package/build/cjs/cc/ThermostatFanModeCC.js.map +3 -3
  155. package/build/cjs/cc/ThermostatFanStateCC.d.ts +3 -3
  156. package/build/cjs/cc/ThermostatFanStateCC.js +9 -9
  157. package/build/cjs/cc/ThermostatFanStateCC.js.map +3 -3
  158. package/build/cjs/cc/ThermostatModeCC.d.ts +6 -6
  159. package/build/cjs/cc/ThermostatModeCC.js +30 -31
  160. package/build/cjs/cc/ThermostatModeCC.js.map +3 -3
  161. package/build/cjs/cc/ThermostatOperatingStateCC.d.ts +3 -4
  162. package/build/cjs/cc/ThermostatOperatingStateCC.js +9 -9
  163. package/build/cjs/cc/ThermostatOperatingStateCC.js.map +3 -3
  164. package/build/cjs/cc/ThermostatSetbackCC.d.ts +3 -3
  165. package/build/cjs/cc/ThermostatSetbackCC.js +14 -15
  166. package/build/cjs/cc/ThermostatSetbackCC.js.map +3 -3
  167. package/build/cjs/cc/ThermostatSetpointCC.d.ts +6 -6
  168. package/build/cjs/cc/ThermostatSetpointCC.js +48 -49
  169. package/build/cjs/cc/ThermostatSetpointCC.js.map +3 -3
  170. package/build/cjs/cc/TimeCC.d.ts +3 -4
  171. package/build/cjs/cc/TimeCC.js +9 -10
  172. package/build/cjs/cc/TimeCC.js.map +3 -3
  173. package/build/cjs/cc/TimeParametersCC.d.ts +3 -4
  174. package/build/cjs/cc/TimeParametersCC.js +2 -2
  175. package/build/cjs/cc/TimeParametersCC.js.map +2 -2
  176. package/build/cjs/cc/TransportServiceCC.d.ts +3 -3
  177. package/build/cjs/cc/TransportServiceCC.js +44 -45
  178. package/build/cjs/cc/TransportServiceCC.js.map +3 -3
  179. package/build/cjs/cc/UserCodeCC.d.ts +19 -19
  180. package/build/cjs/cc/UserCodeCC.js +102 -103
  181. package/build/cjs/cc/UserCodeCC.js.map +3 -3
  182. package/build/cjs/cc/VersionCC.d.ts +17 -17
  183. package/build/cjs/cc/VersionCC.js +46 -47
  184. package/build/cjs/cc/VersionCC.js.map +3 -3
  185. package/build/cjs/cc/WakeUpCC.d.ts +6 -6
  186. package/build/cjs/cc/WakeUpCC.js +16 -17
  187. package/build/cjs/cc/WakeUpCC.js.map +3 -3
  188. package/build/cjs/cc/WindowCoveringCC.d.ts +3 -4
  189. package/build/cjs/cc/WindowCoveringCC.js +17 -18
  190. package/build/cjs/cc/WindowCoveringCC.js.map +3 -3
  191. package/build/cjs/cc/ZWavePlusCC.d.ts +8 -8
  192. package/build/cjs/cc/ZWavePlusCC.js +15 -16
  193. package/build/cjs/cc/ZWavePlusCC.js.map +3 -3
  194. package/build/cjs/cc/ZWaveProtocolCC.d.ts +2 -2
  195. package/build/cjs/cc/ZWaveProtocolCC.js +35 -35
  196. package/build/cjs/cc/ZWaveProtocolCC.js.map +2 -2
  197. package/build/cjs/cc/_CCValues.generated.d.ts +2 -0
  198. package/build/cjs/cc/_CCValues.generated.js +28 -27
  199. package/build/cjs/cc/_CCValues.generated.js.map +3 -3
  200. package/build/cjs/cc/manufacturerProprietary/FibaroCC.d.ts +3 -3
  201. package/build/cjs/cc/manufacturerProprietary/FibaroCC.js +14 -14
  202. package/build/cjs/cc/manufacturerProprietary/FibaroCC.js.map +1 -1
  203. package/build/cjs/lib/API.d.ts +3 -3
  204. package/build/cjs/lib/API.js.map +2 -2
  205. package/build/cjs/lib/CommandClass.d.ts +5 -6
  206. package/build/cjs/lib/CommandClass.js +45 -45
  207. package/build/cjs/lib/CommandClass.js.map +3 -3
  208. package/build/cjs/lib/CommandClassDecorators.d.ts +2 -2
  209. package/build/cjs/lib/CommandClassDecorators.js +3 -3
  210. package/build/cjs/lib/CommandClassDecorators.js.map +2 -2
  211. package/build/cjs/lib/Security2/Extension.d.ts +2 -2
  212. package/build/cjs/lib/Security2/Extension.js +17 -17
  213. package/build/cjs/lib/Security2/Extension.js.map +3 -3
  214. package/build/cjs/lib/SetValueResult.d.ts +1 -1
  215. package/build/cjs/lib/SetValueResult.js.map +1 -1
  216. package/build/cjs/lib/Values.d.ts +3 -3
  217. package/build/cjs/lib/Values.js +6 -6
  218. package/build/cjs/lib/Values.js.map +2 -2
  219. package/build/cjs/lib/_Types.d.ts +2 -2
  220. package/build/cjs/lib/_Types.js +3 -3
  221. package/build/cjs/lib/_Types.js.map +1 -1
  222. package/build/cjs/lib/serializers.d.ts +1 -1
  223. package/build/cjs/lib/serializers.js +5 -5
  224. package/build/cjs/lib/serializers.js.map +2 -2
  225. package/build/cjs/lib/traits.d.ts +2 -2
  226. package/build/cjs/lib/utils.d.ts +2 -2
  227. package/build/cjs/lib/utils.js +60 -60
  228. package/build/cjs/lib/utils.js.map +3 -3
  229. package/build/esm/cc/AlarmSensorCC.d.ts +7 -7
  230. package/build/esm/cc/AlarmSensorCC.d.ts.map +1 -1
  231. package/build/esm/cc/AlarmSensorCC.js +2 -3
  232. package/build/esm/cc/AlarmSensorCC.js.map +1 -1
  233. package/build/esm/cc/AssociationCC.d.ts +8 -9
  234. package/build/esm/cc/AssociationCC.d.ts.map +1 -1
  235. package/build/esm/cc/AssociationCC.js +2 -2
  236. package/build/esm/cc/AssociationCC.js.map +1 -1
  237. package/build/esm/cc/AssociationGroupInfoCC.d.ts +7 -7
  238. package/build/esm/cc/AssociationGroupInfoCC.d.ts.map +1 -1
  239. package/build/esm/cc/AssociationGroupInfoCC.js +2 -3
  240. package/build/esm/cc/AssociationGroupInfoCC.js.map +1 -1
  241. package/build/esm/cc/BarrierOperatorCC.d.ts +8 -8
  242. package/build/esm/cc/BarrierOperatorCC.d.ts.map +1 -1
  243. package/build/esm/cc/BarrierOperatorCC.js +2 -3
  244. package/build/esm/cc/BarrierOperatorCC.js.map +1 -1
  245. package/build/esm/cc/BasicCC.d.ts +4 -4
  246. package/build/esm/cc/BasicCC.d.ts.map +1 -1
  247. package/build/esm/cc/BasicCC.js +2 -3
  248. package/build/esm/cc/BasicCC.js.map +1 -1
  249. package/build/esm/cc/BatteryCC.d.ts +6 -8
  250. package/build/esm/cc/BatteryCC.d.ts.map +1 -1
  251. package/build/esm/cc/BatteryCC.js +13 -15
  252. package/build/esm/cc/BatteryCC.js.map +1 -1
  253. package/build/esm/cc/BinarySensorCC.d.ts +5 -5
  254. package/build/esm/cc/BinarySensorCC.d.ts.map +1 -1
  255. package/build/esm/cc/BinarySensorCC.js +2 -3
  256. package/build/esm/cc/BinarySensorCC.js.map +1 -1
  257. package/build/esm/cc/BinarySwitchCC._validateArgs.js +1 -1
  258. package/build/esm/cc/BinarySwitchCC._validateArgs.js.map +1 -1
  259. package/build/esm/cc/BinarySwitchCC.d.ts +6 -6
  260. package/build/esm/cc/BinarySwitchCC.d.ts.map +1 -1
  261. package/build/esm/cc/BinarySwitchCC.js +2 -2
  262. package/build/esm/cc/BinarySwitchCC.js.map +1 -1
  263. package/build/esm/cc/CRC16CC.d.ts +3 -3
  264. package/build/esm/cc/CRC16CC.d.ts.map +1 -1
  265. package/build/esm/cc/CRC16CC.js +2 -2
  266. package/build/esm/cc/CRC16CC.js.map +1 -1
  267. package/build/esm/cc/CentralSceneCC.d.ts +8 -8
  268. package/build/esm/cc/CentralSceneCC.d.ts.map +1 -1
  269. package/build/esm/cc/CentralSceneCC.js +2 -3
  270. package/build/esm/cc/CentralSceneCC.js.map +1 -1
  271. package/build/esm/cc/ClimateControlScheduleCC.d.ts +6 -6
  272. package/build/esm/cc/ClimateControlScheduleCC.d.ts.map +1 -1
  273. package/build/esm/cc/ClimateControlScheduleCC.js +2 -3
  274. package/build/esm/cc/ClimateControlScheduleCC.js.map +1 -1
  275. package/build/esm/cc/ClockCC.d.ts +3 -4
  276. package/build/esm/cc/ClockCC.d.ts.map +1 -1
  277. package/build/esm/cc/ClockCC.js +2 -3
  278. package/build/esm/cc/ClockCC.js.map +1 -1
  279. package/build/esm/cc/ColorSwitchCC.d.ts +3 -4
  280. package/build/esm/cc/ColorSwitchCC.d.ts.map +1 -1
  281. package/build/esm/cc/ColorSwitchCC.js +2 -4
  282. package/build/esm/cc/ColorSwitchCC.js.map +1 -1
  283. package/build/esm/cc/ConfigurationCC.d.ts +3 -3
  284. package/build/esm/cc/ConfigurationCC.d.ts.map +1 -1
  285. package/build/esm/cc/ConfigurationCC.js +2 -3
  286. package/build/esm/cc/ConfigurationCC.js.map +1 -1
  287. package/build/esm/cc/DeviceResetLocallyCC.d.ts +2 -2
  288. package/build/esm/cc/DeviceResetLocallyCC.d.ts.map +1 -1
  289. package/build/esm/cc/DeviceResetLocallyCC.js +1 -1
  290. package/build/esm/cc/DeviceResetLocallyCC.js.map +1 -1
  291. package/build/esm/cc/DoorLockCC.d.ts +29 -29
  292. package/build/esm/cc/DoorLockCC.d.ts.map +1 -1
  293. package/build/esm/cc/DoorLockCC.js +2 -3
  294. package/build/esm/cc/DoorLockCC.js.map +1 -1
  295. package/build/esm/cc/DoorLockLoggingCC.d.ts +4 -4
  296. package/build/esm/cc/DoorLockLoggingCC.d.ts.map +1 -1
  297. package/build/esm/cc/DoorLockLoggingCC.js +2 -3
  298. package/build/esm/cc/DoorLockLoggingCC.js.map +1 -1
  299. package/build/esm/cc/EnergyProductionCC.d.ts +2 -3
  300. package/build/esm/cc/EnergyProductionCC.d.ts.map +1 -1
  301. package/build/esm/cc/EnergyProductionCC.js.map +1 -1
  302. package/build/esm/cc/EntryControlCC.d.ts +8 -8
  303. package/build/esm/cc/EntryControlCC.d.ts.map +1 -1
  304. package/build/esm/cc/EntryControlCC.js +2 -3
  305. package/build/esm/cc/EntryControlCC.js.map +1 -1
  306. package/build/esm/cc/FirmwareUpdateMetaDataCC.d.ts +9 -10
  307. package/build/esm/cc/FirmwareUpdateMetaDataCC.d.ts.map +1 -1
  308. package/build/esm/cc/FirmwareUpdateMetaDataCC.js +2 -3
  309. package/build/esm/cc/FirmwareUpdateMetaDataCC.js.map +1 -1
  310. package/build/esm/cc/HailCC.js +1 -1
  311. package/build/esm/cc/HailCC.js.map +1 -1
  312. package/build/esm/cc/HumidityControlModeCC.d.ts +5 -5
  313. package/build/esm/cc/HumidityControlModeCC.d.ts.map +1 -1
  314. package/build/esm/cc/HumidityControlModeCC.js +2 -3
  315. package/build/esm/cc/HumidityControlModeCC.js.map +1 -1
  316. package/build/esm/cc/HumidityControlOperatingStateCC.d.ts +3 -3
  317. package/build/esm/cc/HumidityControlOperatingStateCC.d.ts.map +1 -1
  318. package/build/esm/cc/HumidityControlOperatingStateCC.js +2 -2
  319. package/build/esm/cc/HumidityControlOperatingStateCC.js.map +1 -1
  320. package/build/esm/cc/HumidityControlSetpointCC.d.ts +6 -6
  321. package/build/esm/cc/HumidityControlSetpointCC.d.ts.map +1 -1
  322. package/build/esm/cc/HumidityControlSetpointCC.js +2 -3
  323. package/build/esm/cc/HumidityControlSetpointCC.js.map +1 -1
  324. package/build/esm/cc/InclusionControllerCC.d.ts +2 -3
  325. package/build/esm/cc/InclusionControllerCC.d.ts.map +1 -1
  326. package/build/esm/cc/InclusionControllerCC.js.map +1 -1
  327. package/build/esm/cc/IndicatorCC.d.ts +3 -3
  328. package/build/esm/cc/IndicatorCC.d.ts.map +1 -1
  329. package/build/esm/cc/IndicatorCC.js +2 -4
  330. package/build/esm/cc/IndicatorCC.js.map +1 -1
  331. package/build/esm/cc/IrrigationCC.d.ts +3 -3
  332. package/build/esm/cc/IrrigationCC.d.ts.map +1 -1
  333. package/build/esm/cc/IrrigationCC.js +2 -3
  334. package/build/esm/cc/IrrigationCC.js.map +1 -1
  335. package/build/esm/cc/LanguageCC.d.ts +5 -6
  336. package/build/esm/cc/LanguageCC.d.ts.map +1 -1
  337. package/build/esm/cc/LanguageCC.js +2 -3
  338. package/build/esm/cc/LanguageCC.js.map +1 -1
  339. package/build/esm/cc/LockCC.d.ts +4 -4
  340. package/build/esm/cc/LockCC.d.ts.map +1 -1
  341. package/build/esm/cc/LockCC.js +2 -2
  342. package/build/esm/cc/LockCC.js.map +1 -1
  343. package/build/esm/cc/ManufacturerProprietaryCC.d.ts +4 -3
  344. package/build/esm/cc/ManufacturerProprietaryCC.d.ts.map +1 -1
  345. package/build/esm/cc/ManufacturerProprietaryCC.js +5 -3
  346. package/build/esm/cc/ManufacturerProprietaryCC.js.map +1 -1
  347. package/build/esm/cc/ManufacturerSpecificCC.d.ts +7 -8
  348. package/build/esm/cc/ManufacturerSpecificCC.d.ts.map +1 -1
  349. package/build/esm/cc/ManufacturerSpecificCC.js +2 -3
  350. package/build/esm/cc/ManufacturerSpecificCC.js.map +1 -1
  351. package/build/esm/cc/MeterCC.d.ts +4 -6
  352. package/build/esm/cc/MeterCC.d.ts.map +1 -1
  353. package/build/esm/cc/MeterCC.js +2 -4
  354. package/build/esm/cc/MeterCC.js.map +1 -1
  355. package/build/esm/cc/MultiChannelAssociationCC.d.ts +7 -8
  356. package/build/esm/cc/MultiChannelAssociationCC.d.ts.map +1 -1
  357. package/build/esm/cc/MultiChannelAssociationCC.js +2 -3
  358. package/build/esm/cc/MultiChannelAssociationCC.js.map +1 -1
  359. package/build/esm/cc/MultiChannelCC.d.ts +13 -12
  360. package/build/esm/cc/MultiChannelCC.d.ts.map +1 -1
  361. package/build/esm/cc/MultiChannelCC.js +65 -16
  362. package/build/esm/cc/MultiChannelCC.js.map +1 -1
  363. package/build/esm/cc/MultiCommandCC.d.ts +3 -3
  364. package/build/esm/cc/MultiCommandCC.d.ts.map +1 -1
  365. package/build/esm/cc/MultiCommandCC.js +2 -2
  366. package/build/esm/cc/MultiCommandCC.js.map +1 -1
  367. package/build/esm/cc/MultilevelSensorCC.d.ts +4 -7
  368. package/build/esm/cc/MultilevelSensorCC.d.ts.map +1 -1
  369. package/build/esm/cc/MultilevelSensorCC.js +2 -4
  370. package/build/esm/cc/MultilevelSensorCC.js.map +1 -1
  371. package/build/esm/cc/MultilevelSwitchCC._validateArgs.js +1 -1
  372. package/build/esm/cc/MultilevelSwitchCC._validateArgs.js.map +1 -1
  373. package/build/esm/cc/MultilevelSwitchCC.d.ts +13 -13
  374. package/build/esm/cc/MultilevelSwitchCC.d.ts.map +1 -1
  375. package/build/esm/cc/MultilevelSwitchCC.js +2 -3
  376. package/build/esm/cc/MultilevelSwitchCC.js.map +1 -1
  377. package/build/esm/cc/NoOperationCC.js +1 -1
  378. package/build/esm/cc/NoOperationCC.js.map +1 -1
  379. package/build/esm/cc/NodeNamingCC.d.ts +5 -5
  380. package/build/esm/cc/NodeNamingCC.d.ts.map +1 -1
  381. package/build/esm/cc/NodeNamingCC.js +2 -2
  382. package/build/esm/cc/NodeNamingCC.js.map +1 -1
  383. package/build/esm/cc/NotificationCC.d.ts +4 -5
  384. package/build/esm/cc/NotificationCC.d.ts.map +1 -1
  385. package/build/esm/cc/NotificationCC.js +2 -4
  386. package/build/esm/cc/NotificationCC.js.map +1 -1
  387. package/build/esm/cc/PowerlevelCC.d.ts +3 -3
  388. package/build/esm/cc/PowerlevelCC.d.ts.map +1 -1
  389. package/build/esm/cc/PowerlevelCC.js +2 -3
  390. package/build/esm/cc/PowerlevelCC.js.map +1 -1
  391. package/build/esm/cc/ProtectionCC._validateArgs.js +1 -1
  392. package/build/esm/cc/ProtectionCC._validateArgs.js.map +1 -1
  393. package/build/esm/cc/ProtectionCC.d.ts +11 -11
  394. package/build/esm/cc/ProtectionCC.d.ts.map +1 -1
  395. package/build/esm/cc/ProtectionCC.js +2 -3
  396. package/build/esm/cc/ProtectionCC.js.map +1 -1
  397. package/build/esm/cc/SceneActivationCC._validateArgs.js +1 -1
  398. package/build/esm/cc/SceneActivationCC._validateArgs.js.map +1 -1
  399. package/build/esm/cc/SceneActivationCC.d.ts +5 -6
  400. package/build/esm/cc/SceneActivationCC.d.ts.map +1 -1
  401. package/build/esm/cc/SceneActivationCC.js +2 -2
  402. package/build/esm/cc/SceneActivationCC.js.map +1 -1
  403. package/build/esm/cc/SceneActuatorConfigurationCC._validateArgs.js +1 -1
  404. package/build/esm/cc/SceneActuatorConfigurationCC._validateArgs.js.map +1 -1
  405. package/build/esm/cc/SceneActuatorConfigurationCC.d.ts +5 -5
  406. package/build/esm/cc/SceneActuatorConfigurationCC.d.ts.map +1 -1
  407. package/build/esm/cc/SceneActuatorConfigurationCC.js +2 -3
  408. package/build/esm/cc/SceneActuatorConfigurationCC.js.map +1 -1
  409. package/build/esm/cc/SceneControllerConfigurationCC._validateArgs.js +1 -1
  410. package/build/esm/cc/SceneControllerConfigurationCC._validateArgs.js.map +1 -1
  411. package/build/esm/cc/SceneControllerConfigurationCC.d.ts +6 -6
  412. package/build/esm/cc/SceneControllerConfigurationCC.d.ts.map +1 -1
  413. package/build/esm/cc/SceneControllerConfigurationCC.js +2 -3
  414. package/build/esm/cc/SceneControllerConfigurationCC.js.map +1 -1
  415. package/build/esm/cc/ScheduleEntryLockCC.d.ts +2 -3
  416. package/build/esm/cc/ScheduleEntryLockCC.d.ts.map +1 -1
  417. package/build/esm/cc/ScheduleEntryLockCC.js.map +1 -1
  418. package/build/esm/cc/Security2CC.d.ts +3 -4
  419. package/build/esm/cc/Security2CC.d.ts.map +1 -1
  420. package/build/esm/cc/Security2CC.js +2 -4
  421. package/build/esm/cc/Security2CC.js.map +1 -1
  422. package/build/esm/cc/SecurityCC.d.ts +3 -4
  423. package/build/esm/cc/SecurityCC.d.ts.map +1 -1
  424. package/build/esm/cc/SecurityCC.js +1 -2
  425. package/build/esm/cc/SecurityCC.js.map +1 -1
  426. package/build/esm/cc/SoundSwitchCC.d.ts +7 -7
  427. package/build/esm/cc/SoundSwitchCC.d.ts.map +1 -1
  428. package/build/esm/cc/SoundSwitchCC.js +2 -3
  429. package/build/esm/cc/SoundSwitchCC.js.map +1 -1
  430. package/build/esm/cc/SupervisionCC.d.ts +4 -4
  431. package/build/esm/cc/SupervisionCC.d.ts.map +1 -1
  432. package/build/esm/cc/SupervisionCC.js +2 -3
  433. package/build/esm/cc/SupervisionCC.js.map +1 -1
  434. package/build/esm/cc/ThermostatFanModeCC.d.ts +6 -6
  435. package/build/esm/cc/ThermostatFanModeCC.d.ts.map +1 -1
  436. package/build/esm/cc/ThermostatFanModeCC.js +2 -3
  437. package/build/esm/cc/ThermostatFanModeCC.js.map +1 -1
  438. package/build/esm/cc/ThermostatFanStateCC.d.ts +3 -3
  439. package/build/esm/cc/ThermostatFanStateCC.d.ts.map +1 -1
  440. package/build/esm/cc/ThermostatFanStateCC.js +2 -2
  441. package/build/esm/cc/ThermostatFanStateCC.js.map +1 -1
  442. package/build/esm/cc/ThermostatModeCC.d.ts +6 -6
  443. package/build/esm/cc/ThermostatModeCC.d.ts.map +1 -1
  444. package/build/esm/cc/ThermostatModeCC.js +2 -3
  445. package/build/esm/cc/ThermostatModeCC.js.map +1 -1
  446. package/build/esm/cc/ThermostatOperatingStateCC.d.ts +3 -4
  447. package/build/esm/cc/ThermostatOperatingStateCC.d.ts.map +1 -1
  448. package/build/esm/cc/ThermostatOperatingStateCC.js +2 -2
  449. package/build/esm/cc/ThermostatOperatingStateCC.js.map +1 -1
  450. package/build/esm/cc/ThermostatSetbackCC.d.ts +3 -3
  451. package/build/esm/cc/ThermostatSetbackCC.d.ts.map +1 -1
  452. package/build/esm/cc/ThermostatSetbackCC.js +2 -3
  453. package/build/esm/cc/ThermostatSetbackCC.js.map +1 -1
  454. package/build/esm/cc/ThermostatSetpointCC.d.ts +6 -6
  455. package/build/esm/cc/ThermostatSetpointCC.d.ts.map +1 -1
  456. package/build/esm/cc/ThermostatSetpointCC.js +2 -3
  457. package/build/esm/cc/ThermostatSetpointCC.js.map +1 -1
  458. package/build/esm/cc/TimeCC.d.ts +3 -4
  459. package/build/esm/cc/TimeCC.d.ts.map +1 -1
  460. package/build/esm/cc/TimeCC.js +1 -2
  461. package/build/esm/cc/TimeCC.js.map +1 -1
  462. package/build/esm/cc/TimeParametersCC.d.ts +3 -4
  463. package/build/esm/cc/TimeParametersCC.d.ts.map +1 -1
  464. package/build/esm/cc/TimeParametersCC.js +1 -1
  465. package/build/esm/cc/TimeParametersCC.js.map +1 -1
  466. package/build/esm/cc/TransportServiceCC.d.ts +3 -3
  467. package/build/esm/cc/TransportServiceCC.d.ts.map +1 -1
  468. package/build/esm/cc/TransportServiceCC.js +2 -3
  469. package/build/esm/cc/TransportServiceCC.js.map +1 -1
  470. package/build/esm/cc/UserCodeCC.d.ts +19 -19
  471. package/build/esm/cc/UserCodeCC.d.ts.map +1 -1
  472. package/build/esm/cc/UserCodeCC.js +2 -3
  473. package/build/esm/cc/UserCodeCC.js.map +1 -1
  474. package/build/esm/cc/VersionCC.d.ts +17 -17
  475. package/build/esm/cc/VersionCC.d.ts.map +1 -1
  476. package/build/esm/cc/VersionCC.js +2 -3
  477. package/build/esm/cc/VersionCC.js.map +1 -1
  478. package/build/esm/cc/WakeUpCC.d.ts +6 -6
  479. package/build/esm/cc/WakeUpCC.d.ts.map +1 -1
  480. package/build/esm/cc/WakeUpCC.js +2 -3
  481. package/build/esm/cc/WakeUpCC.js.map +1 -1
  482. package/build/esm/cc/WindowCoveringCC.d.ts +3 -4
  483. package/build/esm/cc/WindowCoveringCC.d.ts.map +1 -1
  484. package/build/esm/cc/WindowCoveringCC.js +1 -2
  485. package/build/esm/cc/WindowCoveringCC.js.map +1 -1
  486. package/build/esm/cc/ZWavePlusCC.d.ts +8 -8
  487. package/build/esm/cc/ZWavePlusCC.d.ts.map +1 -1
  488. package/build/esm/cc/ZWavePlusCC.js +2 -3
  489. package/build/esm/cc/ZWavePlusCC.js.map +1 -1
  490. package/build/esm/cc/ZWaveProtocolCC.d.ts +2 -2
  491. package/build/esm/cc/ZWaveProtocolCC.d.ts.map +1 -1
  492. package/build/esm/cc/ZWaveProtocolCC.js +1 -1
  493. package/build/esm/cc/ZWaveProtocolCC.js.map +1 -1
  494. package/build/esm/cc/_CCValues.generated.d.ts +2 -0
  495. package/build/esm/cc/_CCValues.generated.d.ts.map +1 -1
  496. package/build/esm/cc/_CCValues.generated.js +5 -4
  497. package/build/esm/cc/_CCValues.generated.js.map +1 -1
  498. package/build/esm/cc/manufacturerProprietary/FibaroCC.d.ts +3 -3
  499. package/build/esm/cc/manufacturerProprietary/FibaroCC.d.ts.map +1 -1
  500. package/build/esm/cc/manufacturerProprietary/FibaroCC.js +1 -1
  501. package/build/esm/cc/manufacturerProprietary/FibaroCC.js.map +1 -1
  502. package/build/esm/lib/API.d.ts +3 -3
  503. package/build/esm/lib/API.d.ts.map +1 -1
  504. package/build/esm/lib/API.js.map +1 -1
  505. package/build/esm/lib/CommandClass.d.ts +5 -6
  506. package/build/esm/lib/CommandClass.d.ts.map +1 -1
  507. package/build/esm/lib/CommandClass.js +2 -2
  508. package/build/esm/lib/CommandClass.js.map +1 -1
  509. package/build/esm/lib/CommandClassDecorators.d.ts +2 -2
  510. package/build/esm/lib/CommandClassDecorators.d.ts.map +1 -1
  511. package/build/esm/lib/CommandClassDecorators.js +1 -1
  512. package/build/esm/lib/CommandClassDecorators.js.map +1 -1
  513. package/build/esm/lib/Security2/Extension.d.ts +2 -2
  514. package/build/esm/lib/Security2/Extension.d.ts.map +1 -1
  515. package/build/esm/lib/Security2/Extension.js +2 -2
  516. package/build/esm/lib/Security2/Extension.js.map +1 -1
  517. package/build/esm/lib/SetValueResult.d.ts +1 -1
  518. package/build/esm/lib/SetValueResult.d.ts.map +1 -1
  519. package/build/esm/lib/Values.d.ts +3 -3
  520. package/build/esm/lib/Values.d.ts.map +1 -1
  521. package/build/esm/lib/Values.js +1 -1
  522. package/build/esm/lib/Values.js.map +1 -1
  523. package/build/esm/lib/_Types.d.ts +2 -2
  524. package/build/esm/lib/_Types.d.ts.map +1 -1
  525. package/build/esm/lib/_Types.js +1 -1
  526. package/build/esm/lib/_Types.js.map +1 -1
  527. package/build/esm/lib/serializers.d.ts +1 -1
  528. package/build/esm/lib/serializers.d.ts.map +1 -1
  529. package/build/esm/lib/serializers.js +1 -1
  530. package/build/esm/lib/serializers.js.map +1 -1
  531. package/build/esm/lib/traits.d.ts +2 -2
  532. package/build/esm/lib/traits.d.ts.map +1 -1
  533. package/build/esm/lib/utils.d.ts +2 -2
  534. package/build/esm/lib/utils.d.ts.map +1 -1
  535. package/build/esm/lib/utils.js +2 -2
  536. package/build/esm/lib/utils.js.map +1 -1
  537. package/package.json +6 -6
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../src/cc/NotificationCC.ts"],
4
- "sourcesContent": ["import { type CCEncodingContext, type CCParsingContext } from \"@zwave-js/cc\";\nimport { type GetDeviceConfig } from \"@zwave-js/config\";\nimport {\n\ttype GetNode,\n\ttype GetSupportedCCVersion,\n\ttype GetValueDB,\n\ttype LogNode,\n\ttype Notification,\n\ttype NotificationState,\n\ttype NotificationValue,\n\ttype WithAddress,\n\tgetNotification,\n\tgetNotificationEventName,\n\tgetNotificationName,\n\tgetNotificationValue,\n\tgetNotificationValueName,\n\ttimespan,\n} from \"@zwave-js/core\";\nimport {\n\tCommandClasses,\n\ttype ControlsCC,\n\tDuration,\n\ttype EndpointId,\n\ttype GetEndpoint,\n\ttype MaybeNotKnown,\n\ttype MessageOrCCLogEntry,\n\tMessagePriority,\n\ttype MessageRecord,\n\ttype NodeId,\n\tSecurityClass,\n\ttype SinglecastCC,\n\ttype SupervisionResult,\n\ttype SupportsCC,\n\ttype ValueID,\n\tValueMetadata,\n\ttype ValueMetadataNumeric,\n\tZWaveError,\n\tZWaveErrorCodes,\n\tencodeBitMask,\n\tgetCCName,\n\tisZWaveError,\n\tparseBitMask,\n\tvalidatePayload,\n} from \"@zwave-js/core/safe\";\nimport { Bytes, isUint8Array } from \"@zwave-js/shared/safe\";\nimport { buffer2hex, num2hex, pick } from \"@zwave-js/shared/safe\";\nimport { validateArgs } from \"@zwave-js/transformers\";\nimport { isArray } from \"alcalzone-shared/typeguards\";\nimport {\n\tCCAPI,\n\tPOLL_VALUE,\n\tPhysicalCCAPI,\n\ttype PollValueImplementation,\n\tthrowUnsupportedProperty,\n} from \"../lib/API.js\";\nimport {\n\tCCRaw,\n\tCommandClass,\n\ttype InterviewContext,\n\tInvalidCC,\n\ttype PersistValuesContext,\n\ttype RefreshValuesContext,\n\tgetEffectiveCCVersion,\n} from \"../lib/CommandClass.js\";\nimport {\n\tAPI,\n\tCCCommand,\n\tccValueProperty,\n\tccValues,\n\tcommandClass,\n\texpectedCCResponse,\n\tgetCCCommandConstructor,\n\timplementedVersion,\n\tuseSupervision,\n} from \"../lib/CommandClassDecorators.js\";\nimport { isNotificationEventPayload } from \"../lib/NotificationEventPayload.js\";\nimport { V } from \"../lib/Values.js\";\nimport { NotificationCommand, UserCodeCommand } from \"../lib/_Types.js\";\nimport * as ccUtils from \"../lib/utils.js\";\nimport { AssociationGroupInfoCC } from \"./AssociationGroupInfoCC.js\";\n\nexport const NotificationCCValues = V.defineCCValues(\n\tCommandClasses.Notification,\n\t{\n\t\t...V.staticProperty(\"supportsV1Alarm\", undefined, {\n\t\t\tinternal: true,\n\t\t\tsupportsEndpoints: false,\n\t\t}),\n\t\t...V.staticProperty(\"supportedNotificationTypes\", undefined, {\n\t\t\tinternal: true,\n\t\t\tsupportsEndpoints: false,\n\t\t}),\n\t\t...V.staticProperty(\"notificationMode\", undefined, {\n\t\t\tinternal: true,\n\t\t\tsupportsEndpoints: false,\n\t\t}),\n\t\t...V.staticProperty(\"lastRefresh\", undefined, {\n\t\t\tinternal: true,\n\t\t}),\n\t\t...V.staticProperty(\n\t\t\t\"alarmType\",\n\t\t\t{\n\t\t\t\t...ValueMetadata.ReadOnlyUInt8,\n\t\t\t\tlabel: \"Alarm Type\",\n\t\t\t} as const,\n\t\t),\n\t\t...V.staticProperty(\n\t\t\t\"alarmLevel\",\n\t\t\t{\n\t\t\t\t...ValueMetadata.ReadOnlyUInt8,\n\t\t\t\tlabel: \"Alarm Level\",\n\t\t\t} as const,\n\t\t),\n\t\t...V.staticPropertyAndKeyWithName(\n\t\t\t\"doorStateSimple\",\n\t\t\t\"Access Control\",\n\t\t\t\"Door state (simple)\",\n\t\t\t{\n\t\t\t\t// Must be a number for compatibility reasons\n\t\t\t\t...ValueMetadata.ReadOnlyUInt8,\n\t\t\t\tlabel: \"Door state (simple)\",\n\t\t\t\tstates: {\n\t\t\t\t\t[0x16]: \"Window/door is open\",\n\t\t\t\t\t[0x17]: \"Window/door is closed\",\n\t\t\t\t},\n\t\t\t\tccSpecific: {\n\t\t\t\t\tnotificationType: 0x06,\n\t\t\t\t},\n\t\t\t} as const,\n\t\t\t{\n\t\t\t\tautoCreate: shouldAutoCreateSimpleDoorSensorValue,\n\t\t\t} as const,\n\t\t),\n\t\t...V.staticPropertyAndKeyWithName(\n\t\t\t\"doorTiltState\",\n\t\t\t\"Access Control\",\n\t\t\t\"Door tilt state\",\n\t\t\t{\n\t\t\t\t// Must be a number for compatibility reasons\n\t\t\t\t...ValueMetadata.ReadOnlyUInt8,\n\t\t\t\tlabel: \"Door tilt state\",\n\t\t\t\tstates: {\n\t\t\t\t\t[0x00]: \"Window/door is not tilted\",\n\t\t\t\t\t[0x01]: \"Window/door is tilted\",\n\t\t\t\t},\n\t\t\t\tccSpecific: {\n\t\t\t\t\tnotificationType: 0x06,\n\t\t\t\t},\n\t\t\t} as const,\n\t\t\t{\n\t\t\t\t// This is created when the tilt state is first received.\n\t\t\t\tautoCreate: false,\n\t\t\t} as const,\n\t\t),\n\t\t...V.dynamicPropertyAndKeyWithName(\n\t\t\t\"supportedNotificationEvents\",\n\t\t\t\"supportedNotificationEvents\",\n\t\t\t(notificationType: number) => notificationType,\n\t\t\t({ property, propertyKey }) =>\n\t\t\t\tproperty === \"supportedNotificationEvents\"\n\t\t\t\t&& typeof propertyKey === \"number\",\n\t\t\tundefined,\n\t\t\t{ internal: true, supportsEndpoints: false },\n\t\t),\n\t\t...V.dynamicPropertyWithName(\n\t\t\t\"unknownNotificationType\",\n\t\t\t(notificationType: number) =>\n\t\t\t\t`UNKNOWN_${num2hex(notificationType)}`,\n\t\t\t({ property }) =>\n\t\t\t\ttypeof property === \"string\"\n\t\t\t\t&& property.startsWith(\"UNKNOWN_0x\"),\n\t\t\t(notificationType: number) => ({\n\t\t\t\t...ValueMetadata.ReadOnlyUInt8,\n\t\t\t\tlabel: `Unknown notification (${\n\t\t\t\t\tnum2hex(\n\t\t\t\t\t\tnotificationType,\n\t\t\t\t\t)\n\t\t\t\t})`,\n\t\t\t\tccSpecific: { notificationType },\n\t\t\t} as const),\n\t\t),\n\t\t...V.dynamicPropertyAndKeyWithName(\n\t\t\t\"unknownNotificationVariable\",\n\t\t\t(notificationType: number, notificationName: string) =>\n\t\t\t\tnotificationName,\n\t\t\t\"unknown\",\n\t\t\t({ property, propertyKey }) =>\n\t\t\t\ttypeof property === \"string\" && propertyKey === \"unknown\",\n\t\t\t(notificationType: number, notificationName: string) => ({\n\t\t\t\t...ValueMetadata.ReadOnlyUInt8,\n\t\t\t\tlabel: `${notificationName}: Unknown value`,\n\t\t\t\tccSpecific: { notificationType },\n\t\t\t} as const),\n\t\t),\n\t\t...V.dynamicPropertyAndKeyWithName(\n\t\t\t\"notificationVariable\",\n\t\t\t// eslint-disable-next-line @typescript-eslint/no-unused-vars\n\t\t\t(notificationName: string, variableName: string) =>\n\t\t\t\tnotificationName,\n\t\t\t(notificationName: string, variableName: string) => variableName,\n\t\t\t({ property, propertyKey }) =>\n\t\t\t\ttypeof property === \"string\" && typeof propertyKey === \"string\",\n\t\t\t// Notification metadata is so dynamic, it does not make sense to define it here\n\t\t\tundefined,\n\t\t),\n\t},\n);\n\nexport function shouldAutoCreateSimpleDoorSensorValue(\n\tctx: GetValueDB,\n\tendpoint: EndpointId,\n): boolean {\n\tconst valueDB = ctx.tryGetValueDB(endpoint.nodeId);\n\tif (!valueDB) return false;\n\tconst supportedACEvents = valueDB.getValue<readonly number[]>(\n\t\tNotificationCCValues.supportedNotificationEvents(\n\t\t\t// Access Control\n\t\t\t0x06,\n\t\t).endpoint(endpoint.index),\n\t);\n\tif (!supportedACEvents) return false;\n\treturn (\n\t\tsupportedACEvents.includes(\n\t\t\t// Window/door is open\n\t\t\t0x16,\n\t\t)\n\t\t&& supportedACEvents.includes(\n\t\t\t// Window/door is closed\n\t\t\t0x17,\n\t\t)\n\t);\n}\n\n@API(CommandClasses.Notification)\nexport class NotificationCCAPI extends PhysicalCCAPI {\n\tpublic supportsCommand(cmd: NotificationCommand): MaybeNotKnown<boolean> {\n\t\tswitch (cmd) {\n\t\t\tcase NotificationCommand.Report:\n\t\t\tcase NotificationCommand.Get:\n\t\t\t\treturn true; // These exist starting with V1\n\n\t\t\tcase NotificationCommand.Set:\n\t\t\tcase NotificationCommand.SupportedGet:\n\t\t\t\treturn this.version >= 2;\n\n\t\t\tcase NotificationCommand.EventSupportedGet:\n\t\t\t\treturn this.version >= 3;\n\t\t}\n\t\treturn super.supportsCommand(cmd);\n\t}\n\n\tprotected get [POLL_VALUE](): PollValueImplementation {\n\t\treturn async function(\n\t\t\tthis: NotificationCCAPI,\n\t\t\t{ property, propertyKey },\n\t\t) {\n\t\t\tconst valueId: ValueID = {\n\t\t\t\tcommandClass: this.ccId,\n\t\t\t\tendpoint: this.endpoint.index,\n\t\t\t\tproperty,\n\t\t\t\tpropertyKey,\n\t\t\t};\n\t\t\tif (NotificationCCValues.notificationVariable.is(valueId)) {\n\t\t\t\tconst notificationType: number | undefined = this\n\t\t\t\t\t.tryGetValueDB()?.getMetadata(valueId)?.ccSpecific\n\t\t\t\t\t?.notificationType;\n\t\t\t\tif (notificationType != undefined) {\n\t\t\t\t\treturn this.getInternal({ notificationType });\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tthrowUnsupportedProperty(this.ccId, property);\n\t\t};\n\t}\n\n\t/**\n\t * @internal\n\t */\n\tpublic async getInternal(\n\t\toptions: NotificationCCGetOptions,\n\t): Promise<NotificationCCReport | undefined> {\n\t\tthis.assertSupportsCommand(\n\t\t\tNotificationCommand,\n\t\t\tNotificationCommand.Get,\n\t\t);\n\n\t\tconst cc = new NotificationCCGet({\n\t\t\tnodeId: this.endpoint.nodeId,\n\t\t\tendpointIndex: this.endpoint.index,\n\t\t\t...options,\n\t\t});\n\t\treturn this.host.sendCommand<NotificationCCReport>(\n\t\t\tcc,\n\t\t\tthis.commandOptions,\n\t\t);\n\t}\n\n\t@validateArgs()\n\tpublic async sendReport(\n\t\toptions: NotificationCCReportOptions,\n\t): Promise<SupervisionResult | undefined> {\n\t\tthis.assertSupportsCommand(\n\t\t\tNotificationCommand,\n\t\t\tNotificationCommand.Report,\n\t\t);\n\n\t\tconst cc = new NotificationCCReport({\n\t\t\tnodeId: this.endpoint.nodeId,\n\t\t\tendpointIndex: this.endpoint.index,\n\t\t\t...options,\n\t\t});\n\t\treturn this.host.sendCommand(cc, this.commandOptions);\n\t}\n\n\t@validateArgs()\n\t// eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types\n\tpublic async get(options: NotificationCCGetOptions) {\n\t\tconst response = await this.getInternal(options);\n\t\tif (response) {\n\t\t\treturn pick(response, [\n\t\t\t\t\"notificationStatus\",\n\t\t\t\t\"notificationEvent\",\n\t\t\t\t\"alarmLevel\",\n\t\t\t\t\"eventParameters\",\n\t\t\t\t\"sequenceNumber\",\n\t\t\t]);\n\t\t}\n\t}\n\n\t@validateArgs()\n\tpublic async set(\n\t\tnotificationType: number,\n\t\tnotificationStatus: boolean,\n\t): Promise<SupervisionResult | undefined> {\n\t\tthis.assertSupportsCommand(\n\t\t\tNotificationCommand,\n\t\t\tNotificationCommand.Set,\n\t\t);\n\n\t\tconst cc = new NotificationCCSet({\n\t\t\tnodeId: this.endpoint.nodeId,\n\t\t\tendpointIndex: this.endpoint.index,\n\t\t\tnotificationType,\n\t\t\tnotificationStatus,\n\t\t});\n\t\treturn this.host.sendCommand(cc, this.commandOptions);\n\t}\n\n\t// eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types\n\tpublic async getSupported() {\n\t\tthis.assertSupportsCommand(\n\t\t\tNotificationCommand,\n\t\t\tNotificationCommand.SupportedGet,\n\t\t);\n\n\t\tconst cc = new NotificationCCSupportedGet({\n\t\t\tnodeId: this.endpoint.nodeId,\n\t\t\tendpointIndex: this.endpoint.index,\n\t\t});\n\t\tconst response = await this.host.sendCommand<\n\t\t\tNotificationCCSupportedReport\n\t\t>(\n\t\t\tcc,\n\t\t\tthis.commandOptions,\n\t\t);\n\t\tif (response) {\n\t\t\treturn pick(response, [\n\t\t\t\t\"supportsV1Alarm\",\n\t\t\t\t\"supportedNotificationTypes\",\n\t\t\t]);\n\t\t}\n\t}\n\n\t@validateArgs()\n\tpublic async getSupportedEvents(\n\t\tnotificationType: number,\n\t): Promise<MaybeNotKnown<readonly number[]>> {\n\t\tthis.assertSupportsCommand(\n\t\t\tNotificationCommand,\n\t\t\tNotificationCommand.EventSupportedGet,\n\t\t);\n\n\t\tconst cc = new NotificationCCEventSupportedGet({\n\t\t\tnodeId: this.endpoint.nodeId,\n\t\t\tendpointIndex: this.endpoint.index,\n\t\t\tnotificationType,\n\t\t});\n\t\tconst response = await this.host.sendCommand<\n\t\t\tNotificationCCEventSupportedReport\n\t\t>(\n\t\t\tcc,\n\t\t\tthis.commandOptions,\n\t\t);\n\t\treturn response?.supportedEvents;\n\t}\n}\n\nexport function getNotificationEnumBehavior(\n\tnotification: Notification,\n\tvalueConfig: NotificationState,\n): \"none\" | \"extend\" | \"replace\" {\n\tconst variable = notification.variables.find((v) =>\n\t\tv.states.has(valueConfig.value)\n\t);\n\tif (!variable) return \"none\";\n\tconst numStatesWithEnums = [...variable.states.values()].filter(\n\t\t(val) => val.parameter?.type === \"enum\",\n\t).length;\n\tif (numStatesWithEnums === 0) return \"none\";\n\t// An enum value replaces the original value if there is only a single possible state\n\t// which also has an enum parameter\n\tif (numStatesWithEnums === 1 && variable.states.size === 1) {\n\t\treturn \"replace\";\n\t}\n\treturn \"extend\";\n}\n\nexport function getNotificationStateValueWithEnum(\n\tstateValue: number,\n\tenumValue: number,\n): number {\n\treturn (stateValue << 8) | enumValue;\n}\n\n/**\n * Returns the metadata to use for a known notification value.\n * Can be used to extend a previously defined metadata,\n * e.g. for V2 notifications that don't allow discovering supported events.\n */\nexport function getNotificationValueMetadata(\n\tprevious: ValueMetadataNumeric | undefined,\n\tnotification: Notification,\n\tvalueConfig: NotificationState,\n): ValueMetadataNumeric {\n\tconst metadata: ValueMetadataNumeric = previous ?? {\n\t\t...ValueMetadata.ReadOnlyUInt8,\n\t\tlabel: valueConfig.variableName,\n\t\tstates: {},\n\t\tccSpecific: {\n\t\t\tnotificationType: notification.type,\n\t\t},\n\t};\n\tif (valueConfig.idle) {\n\t\tmetadata.states![0] = \"idle\";\n\t}\n\tconst enumBehavior = getNotificationEnumBehavior(\n\t\tnotification,\n\t\tvalueConfig,\n\t);\n\tif (enumBehavior !== \"replace\") {\n\t\tmetadata.states![valueConfig.value] = valueConfig.label;\n\t}\n\tif (valueConfig.parameter?.type === \"enum\") {\n\t\tfor (\n\t\t\tconst [key, label] of Object.entries(valueConfig.parameter.values)\n\t\t) {\n\t\t\tconst value = parseInt(key);\n\t\t\tconst stateKey = enumBehavior === \"replace\"\n\t\t\t\t? value\n\t\t\t\t: getNotificationStateValueWithEnum(valueConfig.value, value);\n\t\t\tmetadata.states![stateKey] = label;\n\t\t}\n\t}\n\n\treturn metadata;\n}\n\n@commandClass(CommandClasses.Notification)\n@implementedVersion(8)\n@ccValues(NotificationCCValues)\nexport class NotificationCC extends CommandClass {\n\tdeclare ccCommand: NotificationCommand;\n\n\t// former AlarmCC (v1..v2)\n\n\tpublic determineRequiredCCInterviews(): readonly CommandClasses[] {\n\t\treturn [\n\t\t\t...super.determineRequiredCCInterviews(),\n\t\t\tCommandClasses.Association,\n\t\t\tCommandClasses[\"Multi Channel Association\"],\n\t\t\tCommandClasses[\"Association Group Information\"],\n\t\t];\n\t}\n\n\tprivate async determineNotificationMode(\n\t\tctx: GetValueDB & GetNode<NodeId & SupportsCC> & LogNode,\n\t\tapi: NotificationCCAPI,\n\t\tsupportedNotificationEvents: ReadonlyMap<number, readonly number[]>,\n\t): Promise<\"push\" | \"pull\"> {\n\t\tconst node = this.getNode(ctx)!;\n\n\t\t// SDS14223: If the supporting node does not support the Association Command Class,\n\t\t// it may be concluded that the supporting node implements Pull Mode and discovery may be aborted.\n\t\tif (!node.supportsCC(CommandClasses.Association)) return \"pull\";\n\n\t\tif (node.supportsCC(CommandClasses[\"Association Group Information\"])) {\n\t\t\ttry {\n\t\t\t\tconst groupsIssueingNotifications = AssociationGroupInfoCC\n\t\t\t\t\t.findGroupsForIssuedCommand(\n\t\t\t\t\t\tctx,\n\t\t\t\t\t\tnode,\n\t\t\t\t\t\tthis.ccId,\n\t\t\t\t\t\tNotificationCommand.Report,\n\t\t\t\t\t);\n\t\t\t\treturn groupsIssueingNotifications.length > 0 ? \"push\" : \"pull\";\n\t\t\t} catch {\n\t\t\t\t// We might be dealing with an older cache file, fall back to testing\n\t\t\t}\n\t\t}\n\n\t\tctx.logNode(node.id, {\n\t\t\tendpoint: this.endpointIndex,\n\t\t\tmessage: `determining whether this node is pull or push...`,\n\t\t\tdirection: \"outbound\",\n\t\t});\n\t\t// Find a notification type with at least one supported event\n\t\tfor (const [type, events] of supportedNotificationEvents) {\n\t\t\tif (events.length === 0) continue;\n\t\t\t// Enable the event and request the status\n\t\t\tawait api.set(type, true);\n\t\t\ttry {\n\t\t\t\tconst resp = await api.get({\n\t\t\t\t\tnotificationType: type,\n\t\t\t\t\tnotificationEvent: events[0],\n\t\t\t\t});\n\t\t\t\tswitch (resp?.notificationStatus) {\n\t\t\t\t\tcase 0xff:\n\t\t\t\t\t\treturn \"push\";\n\t\t\t\t\tcase 0xfe:\n\t\t\t\t\tcase 0x00:\n\t\t\t\t\t\treturn \"pull\";\n\t\t\t\t}\n\t\t\t} catch {\n\t\t\t\t/* ignore */\n\t\t\t}\n\t\t}\n\n\t\t// If everything failed, e.g. because the node is V1/V2, assume this is a \"push\" node.\n\t\t// If we assumed \"pull\", we would have to query the node regularly, which can cause\n\t\t// the node to return old (already handled) notifications.\n\t\t// https://github.com/zwave-js/zwave-js/issues/5626\n\t\treturn \"push\";\n\t}\n\n\t/** Whether the node implements push or pull notifications */\n\tpublic static getNotificationMode(\n\t\tctx: GetValueDB,\n\t\tnode: NodeId,\n\t): MaybeNotKnown<\"push\" | \"pull\"> {\n\t\treturn ctx\n\t\t\t.getValueDB(node.id)\n\t\t\t.getValue(NotificationCCValues.notificationMode.id);\n\t}\n\n\tpublic async interview(\n\t\tctx: InterviewContext,\n\t): Promise<void> {\n\t\tconst node = this.getNode(ctx)!;\n\t\tconst endpoint = this.getEndpoint(ctx)!;\n\t\tconst api = CCAPI.create(\n\t\t\tCommandClasses.Notification,\n\t\t\tctx,\n\t\t\tendpoint,\n\t\t).withOptions({\n\t\t\tpriority: MessagePriority.NodeQuery,\n\t\t});\n\n\t\tctx.logNode(node.id, {\n\t\t\tendpoint: this.endpointIndex,\n\t\t\tmessage: `Interviewing ${this.ccName}...`,\n\t\t\tdirection: \"none\",\n\t\t});\n\n\t\t// If one Association group issues Notification Reports,\n\t\t// we must associate ourselves with that channel\n\t\ttry {\n\t\t\tawait ccUtils.assignLifelineIssueingCommand(\n\t\t\t\tctx,\n\t\t\t\tendpoint,\n\t\t\t\tthis.ccId,\n\t\t\t\tNotificationCommand.Report,\n\t\t\t);\n\t\t} catch {\n\t\t\tctx.logNode(node.id, {\n\t\t\t\tendpoint: endpoint.index,\n\t\t\t\tmessage: `Configuring associations to receive ${\n\t\t\t\t\tgetCCName(\n\t\t\t\t\t\tthis.ccId,\n\t\t\t\t\t)\n\t\t\t\t} reports failed!`,\n\t\t\t\tlevel: \"warn\",\n\t\t\t});\n\t\t}\n\n\t\tlet supportsV1Alarm = false;\n\t\tif (api.version >= 2) {\n\t\t\tctx.logNode(node.id, {\n\t\t\t\tendpoint: this.endpointIndex,\n\t\t\t\tmessage: \"querying supported notification types...\",\n\t\t\t\tdirection: \"outbound\",\n\t\t\t});\n\n\t\t\tconst suppResponse = await api.getSupported();\n\t\t\tif (!suppResponse) {\n\t\t\t\tctx.logNode(node.id, {\n\t\t\t\t\tendpoint: this.endpointIndex,\n\t\t\t\t\tmessage:\n\t\t\t\t\t\t\"Querying supported notification types timed out, skipping interview...\",\n\t\t\t\t\tlevel: \"warn\",\n\t\t\t\t});\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tsupportsV1Alarm = suppResponse.supportsV1Alarm;\n\t\t\tconst supportedNotificationTypes =\n\t\t\t\tsuppResponse.supportedNotificationTypes;\n\t\t\tconst supportedNotificationNames = supportedNotificationTypes.map(\n\t\t\t\tgetNotificationName,\n\t\t\t);\n\t\t\tconst supportedNotificationEvents = new Map<\n\t\t\t\tnumber,\n\t\t\t\treadonly number[]\n\t\t\t>();\n\n\t\t\tconst logMessage = `received supported notification types:${\n\t\t\t\tsupportedNotificationNames\n\t\t\t\t\t.map((name) => `\\n\u00B7 ${name}`)\n\t\t\t\t\t.join(\"\")\n\t\t\t}`;\n\t\t\tctx.logNode(node.id, {\n\t\t\t\tendpoint: this.endpointIndex,\n\t\t\t\tmessage: logMessage,\n\t\t\t\tdirection: \"inbound\",\n\t\t\t});\n\n\t\t\tif (api.version >= 3) {\n\t\t\t\t// Query each notification for its supported events\n\t\t\t\tfor (let i = 0; i < supportedNotificationTypes.length; i++) {\n\t\t\t\t\tconst type = supportedNotificationTypes[i];\n\t\t\t\t\tconst name = supportedNotificationNames[i];\n\n\t\t\t\t\tctx.logNode(node.id, {\n\t\t\t\t\t\tendpoint: this.endpointIndex,\n\t\t\t\t\t\tmessage:\n\t\t\t\t\t\t\t`querying supported notification events for ${name}...`,\n\t\t\t\t\t\tdirection: \"outbound\",\n\t\t\t\t\t});\n\t\t\t\t\tconst supportedEvents = await api.getSupportedEvents(type);\n\t\t\t\t\tif (supportedEvents) {\n\t\t\t\t\t\tsupportedNotificationEvents.set(type, supportedEvents);\n\t\t\t\t\t\tctx.logNode(node.id, {\n\t\t\t\t\t\t\tendpoint: this.endpointIndex,\n\t\t\t\t\t\t\tmessage:\n\t\t\t\t\t\t\t\t`received supported notification events for ${name}: ${\n\t\t\t\t\t\t\t\t\tsupportedEvents\n\t\t\t\t\t\t\t\t\t\t.map(String)\n\t\t\t\t\t\t\t\t\t\t.join(\", \")\n\t\t\t\t\t\t\t\t}`,\n\t\t\t\t\t\t\tdirection: \"inbound\",\n\t\t\t\t\t\t});\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// Determine whether the node is a push or pull node\n\t\t\tlet notificationMode = this.getValue<\"push\" | \"pull\">(\n\t\t\t\tctx,\n\t\t\t\tNotificationCCValues.notificationMode,\n\t\t\t);\n\t\t\tif (notificationMode !== \"push\" && notificationMode !== \"pull\") {\n\t\t\t\tnotificationMode = await this.determineNotificationMode(\n\t\t\t\t\tctx,\n\t\t\t\t\tapi,\n\t\t\t\t\tsupportedNotificationEvents,\n\t\t\t\t);\n\t\t\t\tthis.setValue(\n\t\t\t\t\tctx,\n\t\t\t\t\tNotificationCCValues.notificationMode,\n\t\t\t\t\tnotificationMode,\n\t\t\t\t);\n\t\t\t}\n\n\t\t\tif (notificationMode === \"pull\") {\n\t\t\t\tawait this.refreshValues(ctx);\n\t\t\t} /* if (notificationMode === \"push\") */ else {\n\t\t\t\tfor (let i = 0; i < supportedNotificationTypes.length; i++) {\n\t\t\t\t\tconst type = supportedNotificationTypes[i];\n\t\t\t\t\tconst name = supportedNotificationNames[i];\n\t\t\t\t\tconst notification = getNotification(type);\n\n\t\t\t\t\t// Enable reports for each notification type\n\t\t\t\t\tctx.logNode(node.id, {\n\t\t\t\t\t\tendpoint: this.endpointIndex,\n\t\t\t\t\t\tmessage: `enabling notifications for ${name}...`,\n\t\t\t\t\t\tdirection: \"outbound\",\n\t\t\t\t\t});\n\t\t\t\t\tawait api.set(type, true);\n\n\t\t\t\t\t// Set the value to idle if possible and there is no value yet\n\t\t\t\t\tif (notification) {\n\t\t\t\t\t\tconst events = supportedNotificationEvents.get(type);\n\t\t\t\t\t\tif (events) {\n\t\t\t\t\t\t\t// Find all variables that are supported by this node and have an idle state\n\t\t\t\t\t\t\tfor (\n\t\t\t\t\t\t\t\tconst variable of notification.variables\n\t\t\t\t\t\t\t\t\t.filter((v) => !!v.idle)\n\t\t\t\t\t\t\t) {\n\t\t\t\t\t\t\t\tif (\n\t\t\t\t\t\t\t\t\t[...variable.states.keys()].some((key) =>\n\t\t\t\t\t\t\t\t\t\tevents.includes(key)\n\t\t\t\t\t\t\t\t\t)\n\t\t\t\t\t\t\t\t) {\n\t\t\t\t\t\t\t\t\tconst value = NotificationCCValues\n\t\t\t\t\t\t\t\t\t\t.notificationVariable(\n\t\t\t\t\t\t\t\t\t\t\tnotification.name,\n\t\t\t\t\t\t\t\t\t\t\tvariable.name,\n\t\t\t\t\t\t\t\t\t\t);\n\n\t\t\t\t\t\t\t\t\t// Set the value to idle if it has no value yet\n\t\t\t\t\t\t\t\t\t// TODO: GH#1028\n\t\t\t\t\t\t\t\t\t// * do this only if the last update was more than 5 minutes ago\n\t\t\t\t\t\t\t\t\t// * schedule an auto-idle if the last update was less than 5 minutes ago but before the current applHost start\n\t\t\t\t\t\t\t\t\tif (\n\t\t\t\t\t\t\t\t\t\tthis.getValue(ctx, value)\n\t\t\t\t\t\t\t\t\t\t\t== undefined\n\t\t\t\t\t\t\t\t\t) {\n\t\t\t\t\t\t\t\t\t\tthis.setValue(\n\t\t\t\t\t\t\t\t\t\t\tctx,\n\t\t\t\t\t\t\t\t\t\t\tvalue,\n\t\t\t\t\t\t\t\t\t\t\t0, /* idle */\n\t\t\t\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t// Only create metadata for V1 values if necessary\n\t\tif (api.version === 1 || supportsV1Alarm) {\n\t\t\tthis.ensureMetadata(ctx, NotificationCCValues.alarmType);\n\t\t\tthis.ensureMetadata(ctx, NotificationCCValues.alarmLevel);\n\t\t}\n\n\t\t// Also create metadata for values mapped through compat config\n\t\tconst mappings = ctx.getDeviceConfig?.(this.nodeId as number)\n\t\t\t?.compat?.alarmMapping;\n\t\tif (mappings) {\n\t\t\t// Find all mappings to a valid notification variable\n\t\t\tconst supportedNotifications = new Map<number, Set<number>>();\n\t\t\tfor (const { to } of mappings) {\n\t\t\t\tconst notification = getNotification(to.notificationType);\n\t\t\t\tif (!notification) continue;\n\t\t\t\tconst valueConfig = getNotificationValue(\n\t\t\t\t\tnotification,\n\t\t\t\t\tto.notificationEvent,\n\t\t\t\t);\n\n\t\t\t\t// Remember supported notification types and events to create the internal values later\n\t\t\t\tif (!supportedNotifications.has(to.notificationType)) {\n\t\t\t\t\tsupportedNotifications.set(\n\t\t\t\t\t\tto.notificationType,\n\t\t\t\t\t\tnew Set(),\n\t\t\t\t\t);\n\t\t\t\t}\n\t\t\t\tconst supportedNotificationTypesSet = supportedNotifications\n\t\t\t\t\t.get(to.notificationType)!;\n\t\t\t\tsupportedNotificationTypesSet.add(to.notificationEvent);\n\n\t\t\t\tif (valueConfig?.type !== \"state\") continue;\n\n\t\t\t\tconst notificationValue = NotificationCCValues\n\t\t\t\t\t.notificationVariable(\n\t\t\t\t\t\tnotification.name,\n\t\t\t\t\t\tvalueConfig.variableName,\n\t\t\t\t\t);\n\n\t\t\t\t// Create or update the metadata\n\t\t\t\tconst metadata = getNotificationValueMetadata(\n\t\t\t\t\tthis.getMetadata(ctx, notificationValue),\n\t\t\t\t\tnotification,\n\t\t\t\t\tvalueConfig,\n\t\t\t\t);\n\t\t\t\tthis.setMetadata(ctx, notificationValue, metadata);\n\n\t\t\t\t// Set the value to idle if it has no value yet\n\t\t\t\tif (valueConfig.idle) {\n\t\t\t\t\t// TODO: GH#1028\n\t\t\t\t\t// * do this only if the last update was more than 5 minutes ago\n\t\t\t\t\t// * schedule an auto-idle if the last update was less than 5 minutes ago but before the current applHost start\n\t\t\t\t\tif (\n\t\t\t\t\t\tthis.getValue(ctx, notificationValue) == undefined\n\t\t\t\t\t) {\n\t\t\t\t\t\tthis.setValue(\n\t\t\t\t\t\t\tctx,\n\t\t\t\t\t\t\tnotificationValue,\n\t\t\t\t\t\t\t0, /* idle */\n\t\t\t\t\t\t);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// Remember supported notification types and events in the cache\n\t\t\tthis.setValue(\n\t\t\t\tctx,\n\t\t\t\tNotificationCCValues.supportedNotificationTypes,\n\t\t\t\t[...supportedNotifications.keys()],\n\t\t\t);\n\t\t\tfor (const [type, events] of supportedNotifications) {\n\t\t\t\tthis.setValue(\n\t\t\t\t\tctx,\n\t\t\t\t\tNotificationCCValues.supportedNotificationEvents(type),\n\t\t\t\t\t[...events],\n\t\t\t\t);\n\t\t\t}\n\t\t}\n\n\t\t// Remember that the interview is complete\n\t\tthis.setInterviewComplete(ctx, true);\n\t}\n\n\tpublic async refreshValues(\n\t\tctx: RefreshValuesContext,\n\t): Promise<void> {\n\t\tconst node = this.getNode(ctx)!;\n\t\t// Refreshing values only works on pull nodes\n\t\tif (NotificationCC.getNotificationMode(ctx, node) === \"pull\") {\n\t\t\tconst endpoint = this.getEndpoint(ctx)!;\n\t\t\tconst api = CCAPI.create(\n\t\t\t\tCommandClasses.Notification,\n\t\t\t\tctx,\n\t\t\t\tendpoint,\n\t\t\t).withOptions({\n\t\t\t\tpriority: MessagePriority.NodeQuery,\n\t\t\t});\n\n\t\t\t// Load supported notification types and events from cache\n\t\t\tconst supportedNotificationTypes = this.getValue<readonly number[]>(\n\t\t\t\tctx,\n\t\t\t\tNotificationCCValues.supportedNotificationTypes,\n\t\t\t) ?? [];\n\t\t\tconst supportedNotificationNames = supportedNotificationTypes.map(\n\t\t\t\tgetNotificationName,\n\t\t\t);\n\n\t\t\tfor (let i = 0; i < supportedNotificationTypes.length; i++) {\n\t\t\t\tconst type = supportedNotificationTypes[i];\n\t\t\t\tconst name = supportedNotificationNames[i];\n\n\t\t\t\t// Always query each notification for its current status\n\t\t\t\tctx.logNode(node.id, {\n\t\t\t\t\tendpoint: this.endpointIndex,\n\t\t\t\t\tmessage: `querying notification status for ${name}...`,\n\t\t\t\t\tdirection: \"outbound\",\n\t\t\t\t});\n\t\t\t\tconst response = await api.getInternal({\n\t\t\t\t\tnotificationType: type,\n\t\t\t\t});\n\t\t\t\t// NotificationReports don't store their values themselves,\n\t\t\t\t// because the behaviour is too complex and spans the lifetime\n\t\t\t\t// of several reports. Thus we handle it in the Node instance\n\n\t\t\t\t// @ts-expect-error\n\t\t\t\tif (response) await node.handleCommand(response);\n\t\t\t}\n\n\t\t\t// Remember when we did this\n\t\t\tthis.setValue(\n\t\t\t\tctx,\n\t\t\t\tNotificationCCValues.lastRefresh,\n\t\t\t\tDate.now(),\n\t\t\t);\n\t\t}\n\t}\n\n\tpublic shouldRefreshValues(\n\t\tthis: SinglecastCC<this>,\n\t\tctx:\n\t\t\t& GetValueDB\n\t\t\t& GetSupportedCCVersion\n\t\t\t& GetDeviceConfig\n\t\t\t& GetNode<\n\t\t\t\tNodeId & GetEndpoint<EndpointId & SupportsCC & ControlsCC>\n\t\t\t>,\n\t): boolean {\n\t\t// Pull-mode nodes must be polled regularly\n\n\t\tconst isPullMode = NotificationCC.getNotificationMode(\n\t\t\tctx,\n\t\t\tthis.getNode(ctx)!,\n\t\t) === \"pull\";\n\t\tif (!isPullMode) return false;\n\n\t\tconst lastUpdated = this.getValue<number>(\n\t\t\tctx,\n\t\t\tNotificationCCValues.lastRefresh,\n\t\t);\n\n\t\treturn (\n\t\t\tlastUpdated == undefined\n\t\t\t|| Date.now() - lastUpdated > timespan.hours(6)\n\t\t);\n\t}\n}\n\n// @publicAPI\nexport interface NotificationCCSetOptions {\n\tnotificationType: number;\n\tnotificationStatus: boolean;\n}\n\n@CCCommand(NotificationCommand.Set)\n@useSupervision()\nexport class NotificationCCSet extends NotificationCC {\n\tpublic constructor(\n\t\toptions: WithAddress<NotificationCCSetOptions>,\n\t) {\n\t\tsuper(options);\n\t\tthis.notificationType = options.notificationType;\n\t\tthis.notificationStatus = options.notificationStatus;\n\t}\n\n\tpublic static from(raw: CCRaw, ctx: CCParsingContext): NotificationCCSet {\n\t\tvalidatePayload(raw.payload.length >= 2);\n\t\tconst notificationType = raw.payload[0];\n\t\tconst notificationStatus = raw.payload[1] === 0xff;\n\n\t\treturn new this({\n\t\t\tnodeId: ctx.sourceNodeId,\n\t\t\tnotificationType,\n\t\t\tnotificationStatus,\n\t\t});\n\t}\n\n\tpublic notificationType: number;\n\tpublic notificationStatus: boolean;\n\n\tpublic serialize(ctx: CCEncodingContext): Promise<Bytes> {\n\t\tthis.payload = Bytes.from([\n\t\t\tthis.notificationType,\n\t\t\tthis.notificationStatus ? 0xff : 0x00,\n\t\t]);\n\t\treturn super.serialize(ctx);\n\t}\n\n\tpublic toLogEntry(ctx?: GetValueDB): MessageOrCCLogEntry {\n\t\treturn {\n\t\t\t...super.toLogEntry(ctx),\n\t\t\tmessage: {\n\t\t\t\t\"notification type\": getNotificationName(this.notificationType),\n\t\t\t\tstatus: this.notificationStatus,\n\t\t\t},\n\t\t};\n\t}\n}\n\n// @publicAPI\nexport type NotificationCCReportOptions = {\n\talarmType?: number;\n\talarmLevel?: number;\n\tnotificationType?: number;\n\tnotificationEvent?: number;\n\tnotificationStatus?: number;\n\teventParameters?: Uint8Array;\n\tsequenceNumber?: number;\n};\n\n@CCCommand(NotificationCommand.Report)\n@useSupervision()\nexport class NotificationCCReport extends NotificationCC {\n\tpublic constructor(\n\t\toptions: WithAddress<NotificationCCReportOptions>,\n\t) {\n\t\tsuper(options);\n\n\t\tif (options.alarmType != undefined) {\n\t\t\tthis.alarmType = options.alarmType;\n\t\t\tthis.alarmLevel = options.alarmLevel;\n\t\t}\n\n\t\tif (options.notificationType != undefined) {\n\t\t\tthis.notificationType = options.notificationType;\n\t\t\tthis.notificationStatus = options.notificationStatus ?? true;\n\t\t\tthis.notificationEvent = options.notificationEvent;\n\t\t\tthis.eventParameters = options.eventParameters;\n\t\t\tthis.sequenceNumber = options.sequenceNumber;\n\t\t}\n\t}\n\n\tpublic static from(\n\t\traw: CCRaw,\n\t\tctx: CCParsingContext,\n\t): NotificationCCReport {\n\t\tvalidatePayload(raw.payload.length >= 2);\n\t\tconst alarmType = raw.payload[0];\n\t\tconst alarmLevel = raw.payload[1];\n\n\t\t// Byte 2 used to be zensorNetSourceNodeId in V2 and V3, but we don't care about that\n\n\t\tif (raw.payload.length < 7) {\n\t\t\treturn new this({\n\t\t\t\tnodeId: ctx.sourceNodeId,\n\t\t\t\talarmType,\n\t\t\t\talarmLevel,\n\t\t\t});\n\t\t}\n\n\t\t// V2+ requires the alarm bytes to be zero. Manufacturers don't care though, so we don't enforce that.\n\t\t// Don't use the version to decide because we might discard notifications\n\t\t// before the interview is complete\n\n\t\tconst notificationStatus = raw.payload[3];\n\t\tconst notificationType = raw.payload[4];\n\t\tconst notificationEvent = raw.payload[5];\n\n\t\tconst containsSeqNum = !!(raw.payload[6] & 0b1000_0000);\n\t\tconst numEventParams = raw.payload[6] & 0b11111;\n\t\tlet eventParameters: Uint8Array | undefined;\n\t\tif (numEventParams > 0) {\n\t\t\tvalidatePayload(raw.payload.length >= 7 + numEventParams);\n\t\t\teventParameters = raw.payload.subarray(7, 7 + numEventParams);\n\t\t}\n\t\tlet sequenceNumber: number | undefined;\n\t\tif (containsSeqNum) {\n\t\t\tvalidatePayload(\n\t\t\t\traw.payload.length >= 7 + numEventParams + 1,\n\t\t\t);\n\t\t\tsequenceNumber = raw.payload[7 + numEventParams];\n\t\t}\n\n\t\treturn new this({\n\t\t\tnodeId: ctx.sourceNodeId,\n\t\t\talarmType,\n\t\t\talarmLevel,\n\t\t\tnotificationStatus,\n\t\t\tnotificationType,\n\t\t\tnotificationEvent,\n\t\t\teventParameters,\n\t\t\tsequenceNumber,\n\t\t});\n\t}\n\n\tpublic persistValues(ctx: PersistValuesContext): boolean {\n\t\tif (!super.persistValues(ctx)) return false;\n\n\t\tconst ccVersion = getEffectiveCCVersion(ctx, this);\n\n\t\t// Check if we need to re-interpret the alarm values somehow\n\t\tif (\n\t\t\tthis.alarmType != undefined\n\t\t\t&& this.alarmLevel != undefined\n\t\t\t&& this.alarmType !== 0\n\t\t) {\n\t\t\tif (ccVersion >= 2) {\n\t\t\t\t// Check if the device actually supports Notification CC, but chooses\n\t\t\t\t// to send Alarm frames instead (GH#1034)\n\t\t\t\tconst supportedNotificationTypes = this.getValue<\n\t\t\t\t\treadonly number[]\n\t\t\t\t>(ctx, NotificationCCValues.supportedNotificationTypes);\n\t\t\t\tif (\n\t\t\t\t\tisArray(supportedNotificationTypes)\n\t\t\t\t\t&& supportedNotificationTypes.includes(this.alarmType)\n\t\t\t\t) {\n\t\t\t\t\tconst supportedNotificationEvents = this.getValue<\n\t\t\t\t\t\treadonly number[]\n\t\t\t\t\t>(\n\t\t\t\t\t\tctx,\n\t\t\t\t\t\tNotificationCCValues.supportedNotificationEvents(\n\t\t\t\t\t\t\tthis.alarmType,\n\t\t\t\t\t\t),\n\t\t\t\t\t);\n\t\t\t\t\tif (\n\t\t\t\t\t\tisArray(supportedNotificationEvents)\n\t\t\t\t\t\t&& supportedNotificationEvents.includes(this.alarmLevel)\n\t\t\t\t\t) {\n\t\t\t\t\t\t// This alarm frame corresponds to a valid notification event\n\t\t\t\t\t\tctx.logNode(\n\t\t\t\t\t\t\tthis.nodeId as number,\n\t\t\t\t\t\t\t`treating V1 Alarm frame as Notification Report`,\n\t\t\t\t\t\t);\n\t\t\t\t\t\tthis.notificationType = this.alarmType;\n\t\t\t\t\t\tthis.notificationEvent = this.alarmLevel;\n\t\t\t\t\t\tthis.alarmType = undefined;\n\t\t\t\t\t\tthis.alarmLevel = undefined;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\t// V1 Alarm, check if there is a compat option to map this V1 report to a V2+ report\n\t\t\t\tconst mapping = ctx.getDeviceConfig?.(\n\t\t\t\t\tthis.nodeId as number,\n\t\t\t\t)?.compat?.alarmMapping;\n\t\t\t\tconst match = mapping?.find(\n\t\t\t\t\t(m) =>\n\t\t\t\t\t\tm.from.alarmType === this.alarmType\n\t\t\t\t\t\t&& (m.from.alarmLevel == undefined\n\t\t\t\t\t\t\t|| m.from.alarmLevel === this.alarmLevel),\n\t\t\t\t);\n\t\t\t\tif (match) {\n\t\t\t\t\tctx.logNode(\n\t\t\t\t\t\tthis.nodeId as number,\n\t\t\t\t\t\t`compat mapping found, treating V1 Alarm frame as Notification Report`,\n\t\t\t\t\t);\n\t\t\t\t\tthis.notificationType = match.to.notificationType;\n\t\t\t\t\tthis.notificationEvent = match.to.notificationEvent;\n\t\t\t\t\tif (match.to.eventParameters) {\n\t\t\t\t\t\tthis.eventParameters = {};\n\t\t\t\t\t\tfor (\n\t\t\t\t\t\t\tconst [key, val] of Object.entries(\n\t\t\t\t\t\t\t\tmatch.to.eventParameters,\n\t\t\t\t\t\t\t)\n\t\t\t\t\t\t) {\n\t\t\t\t\t\t\tif (typeof val === \"number\") {\n\t\t\t\t\t\t\t\tthis.eventParameters[key] = val;\n\t\t\t\t\t\t\t} else if (val === \"alarmLevel\") {\n\t\t\t\t\t\t\t\tthis.eventParameters[key] = this.alarmLevel;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\t// After mapping we do not set the legacy V1 values to undefined\n\t\t\t\t\t// Otherwise, adding a new mapping will be a breaking change\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t// Now we can interpret the event parameters and turn them into something useful\n\t\tthis.parseEventParameters(ctx);\n\n\t\tif (this.alarmType != undefined) {\n\t\t\tconst alarmTypeValue = NotificationCCValues.alarmType;\n\t\t\tthis.ensureMetadata(ctx, alarmTypeValue);\n\t\t\tthis.setValue(ctx, alarmTypeValue, this.alarmType);\n\t\t}\n\t\tif (this.alarmLevel != undefined) {\n\t\t\tconst alarmLevelValue = NotificationCCValues.alarmLevel;\n\t\t\tthis.ensureMetadata(ctx, alarmLevelValue);\n\t\t\tthis.setValue(ctx, alarmLevelValue, this.alarmLevel);\n\t\t}\n\n\t\treturn true;\n\t}\n\n\tpublic alarmType: number | undefined;\n\tpublic alarmLevel: number | undefined;\n\n\tpublic notificationType: number | undefined;\n\tpublic notificationStatus: boolean | number | undefined;\n\tpublic notificationEvent: number | undefined;\n\n\tpublic eventParameters:\n\t\t| Uint8Array\n\t\t| Duration\n\t\t| Record<string, number>\n\t\t| number\n\t\t| undefined;\n\n\tpublic sequenceNumber: number | undefined;\n\n\tpublic toLogEntry(ctx?: GetValueDB): MessageOrCCLogEntry {\n\t\tlet message: MessageRecord = {};\n\t\tif (this.alarmType) {\n\t\t\tmessage = {\n\t\t\t\t\"V1 alarm type\": this.alarmType,\n\t\t\t\t\"V1 alarm level\": this.alarmLevel!,\n\t\t\t};\n\t\t}\n\n\t\tlet valueConfig: NotificationValue | undefined;\n\t\tif (this.notificationType) {\n\t\t\tconst notification = getNotification(this.notificationType);\n\t\t\tif (notification) {\n\t\t\t\tvalueConfig = getNotificationValue(\n\t\t\t\t\tnotification,\n\t\t\t\t\tthis.notificationEvent!,\n\t\t\t\t);\n\t\t\t}\n\t\t\tif (valueConfig) {\n\t\t\t\tmessage = {\n\t\t\t\t\t...message,\n\t\t\t\t\t\"notification type\": getNotificationName(\n\t\t\t\t\t\tthis.notificationType,\n\t\t\t\t\t),\n\t\t\t\t\t\"notification status\": this.notificationStatus!,\n\t\t\t\t\t[`notification ${valueConfig.type}`]: valueConfig.label\n\t\t\t\t\t\t?? `Unknown (${num2hex(this.notificationEvent)})`,\n\t\t\t\t};\n\t\t\t} else if (this.notificationEvent === 0x00) {\n\t\t\t\tmessage = {\n\t\t\t\t\t...message,\n\t\t\t\t\t\"notification type\": this.notificationType,\n\t\t\t\t\t\"notification status\": this.notificationStatus!,\n\t\t\t\t\t\"notification state\": \"idle\",\n\t\t\t\t};\n\t\t\t} else {\n\t\t\t\tmessage = {\n\t\t\t\t\t...message,\n\t\t\t\t\t\"notification type\": this.notificationType,\n\t\t\t\t\t\"notification status\": this.notificationStatus!,\n\t\t\t\t\t\"notification event\": num2hex(this.notificationEvent),\n\t\t\t\t};\n\t\t\t}\n\t\t}\n\t\tif (this.sequenceNumber != undefined) {\n\t\t\tmessage[\"sequence number\"] = this.sequenceNumber;\n\t\t}\n\t\tif (this.eventParameters != undefined) {\n\t\t\tif (typeof this.eventParameters === \"number\") {\n\t\t\t\t// Try to look up the enum label\n\t\t\t\tlet found = false;\n\t\t\t\tif (\n\t\t\t\t\tvalueConfig?.parameter?.type === \"enum\"\n\t\t\t\t) {\n\t\t\t\t\tconst label =\n\t\t\t\t\t\tvalueConfig.parameter.values[this.eventParameters];\n\t\t\t\t\tif (label) {\n\t\t\t\t\t\tmessage[\"state parameters\"] = label;\n\t\t\t\t\t\tfound = true;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tif (!found) {\n\t\t\t\t\tmessage[\"state parameters\"] = num2hex(this.eventParameters);\n\t\t\t\t}\n\t\t\t} else if (isUint8Array(this.eventParameters)) {\n\t\t\t\tmessage[\"event parameters\"] = buffer2hex(this.eventParameters);\n\t\t\t} else if (Duration.isDuration(this.eventParameters)) {\n\t\t\t\tmessage[\"event parameters\"] = this.eventParameters.toString();\n\t\t\t} else {\n\t\t\t\tmessage[\"event parameters\"] = Object.entries(\n\t\t\t\t\tthis.eventParameters,\n\t\t\t\t)\n\t\t\t\t\t.map(([param, val]) => `\\n ${param}: ${num2hex(val)}`)\n\t\t\t\t\t.join(\"\");\n\t\t\t}\n\t\t} else if (\n\t\t\tvalueConfig?.parameter?.type === \"enum\"\n\t\t\t&& valueConfig.parameter.default != undefined\n\t\t) {\n\t\t\tconst label = valueConfig.parameter.values[\n\t\t\t\tvalueConfig.parameter.default\n\t\t\t];\n\t\t\tif (label) {\n\t\t\t\tmessage[\"state parameters\"] = `${label} (omitted)`;\n\t\t\t}\n\t\t}\n\t\treturn {\n\t\t\t...super.toLogEntry(ctx),\n\t\t\tmessage,\n\t\t};\n\t}\n\n\tprivate parseEventParameters(ctx: PersistValuesContext): void {\n\t\t// This only makes sense for V2+ notifications\n\t\tif (\n\t\t\tthis.notificationType == undefined\n\t\t\t|| this.notificationEvent == undefined\n\t\t) {\n\t\t\treturn;\n\t\t}\n\n\t\t// Look up the received notification and value in the config\n\t\tconst notification = getNotification(this.notificationType);\n\t\tif (!notification) return;\n\t\tconst valueConfig = getNotificationValue(\n\t\t\tnotification,\n\t\t\tthis.notificationEvent,\n\t\t);\n\t\tif (!valueConfig) return;\n\n\t\t// Parse the event parameters if possible\n\t\tif (valueConfig.parameter?.type === \"duration\") {\n\t\t\t// This only makes sense if the event parameters are a buffer\n\t\t\tif (!isUint8Array(this.eventParameters)) {\n\t\t\t\treturn;\n\t\t\t}\n\t\t\t// The parameters contain a Duration\n\t\t\tthis.eventParameters = Duration.parseReport(\n\t\t\t\tthis.eventParameters[0],\n\t\t\t);\n\t\t} else if (valueConfig.parameter?.type === \"commandclass\") {\n\t\t\t// This only makes sense if the event parameters are a buffer\n\t\t\tif (!isUint8Array(this.eventParameters)) {\n\t\t\t\treturn;\n\t\t\t}\n\t\t\t// The parameters **should** contain a CC, however there might be some exceptions\n\t\t\tif (\n\t\t\t\tthis.eventParameters.length === 1\n\t\t\t\t&& notification.type === 0x06\n\t\t\t\t&& (this.notificationEvent === 0x05\n\t\t\t\t\t|| this.notificationEvent === 0x06)\n\t\t\t) {\n\t\t\t\t// Access control -> Keypad Lock/Unlock operation\n\t\t\t\t// Some devices only send the User ID, not a complete CC payload\n\t\t\t\tthis.eventParameters = {\n\t\t\t\t\tuserId: this.eventParameters[0],\n\t\t\t\t};\n\t\t\t} else {\n\t\t\t\t// Try to parse the event parameters - if this fails, we should still handle the notification report\n\t\t\t\ttry {\n\t\t\t\t\t// Convert CommandClass instances to a standardized object representation\n\n\t\t\t\t\t// We do not want to parse asynchronously here, but the `CommandClass.parse` method is async.\n\t\t\t\t\t// However, we only deal with simple CCs that can be parsed synchronously. We can do this\n\t\t\t\t\t// by replicating what `CommandClass.parse` does: determine the correct CC class and call its\n\t\t\t\t\t// `from` method. If that returns a CC instance, we're good to continue.\n\n\t\t\t\t\tconst raw = CCRaw.parse(this.eventParameters);\n\t\t\t\t\tif (raw.ccCommand == undefined) {\n\t\t\t\t\t\tvalidatePayload.fail(\n\t\t\t\t\t\t\t\"event parameters contain an invalid CC\",\n\t\t\t\t\t\t);\n\t\t\t\t\t}\n\t\t\t\t\tconst CommandConstructor = getCCCommandConstructor(\n\t\t\t\t\t\traw.ccId,\n\t\t\t\t\t\traw.ccCommand,\n\t\t\t\t\t);\n\t\t\t\t\tif (!CommandConstructor) {\n\t\t\t\t\t\tvalidatePayload.fail(\n\t\t\t\t\t\t\t\"event parameters contain an invalid CC\",\n\t\t\t\t\t\t);\n\t\t\t\t\t}\n\n\t\t\t\t\tconst cc = CommandConstructor.from(raw, {\n\t\t\t\t\t\t...ctx,\n\t\t\t\t\t\tframeType: \"singlecast\",\n\t\t\t\t\t\tsourceNodeId: this.nodeId as number,\n\t\t\t\t\t\t// Security encapsulation is handled outside of this CC,\n\t\t\t\t\t\t// so it is not needed here:\n\t\t\t\t\t\thasSecurityClass: () => false,\n\t\t\t\t\t\tgetHighestSecurityClass: () => SecurityClass.None,\n\t\t\t\t\t\tsetSecurityClass: () => {},\n\t\t\t\t\t\tsecurityManager: undefined,\n\t\t\t\t\t\tsecurityManager2: undefined,\n\t\t\t\t\t\tsecurityManagerLR: undefined,\n\t\t\t\t\t});\n\t\t\t\t\tif (cc instanceof Promise) {\n\t\t\t\t\t\tvalidatePayload.fail(\n\t\t\t\t\t\t\t\"Cannot asynchronously parse CC from event parameters\",\n\t\t\t\t\t\t);\n\t\t\t\t\t}\n\t\t\t\t\tvalidatePayload(!(cc instanceof InvalidCC));\n\t\t\t\t\tcc.encapsulatingCC = this as any;\n\n\t\t\t\t\tif (isNotificationEventPayload(cc)) {\n\t\t\t\t\t\tthis.eventParameters = cc\n\t\t\t\t\t\t\t.toNotificationEventParameters();\n\t\t\t\t\t} else {\n\t\t\t\t\t\t// If a CC has no good toJSON() representation, we're only interested in the payload\n\t\t\t\t\t\tlet json = cc.toJSON();\n\t\t\t\t\t\tif (\n\t\t\t\t\t\t\t\"nodeId\" in json\n\t\t\t\t\t\t\t&& \"ccId\" in json\n\t\t\t\t\t\t\t&& \"payload\" in json\n\t\t\t\t\t\t) {\n\t\t\t\t\t\t\tjson = pick(json, [\"payload\"]);\n\t\t\t\t\t\t}\n\t\t\t\t\t\tthis.eventParameters = json;\n\t\t\t\t\t}\n\t\t\t\t} catch (e) {\n\t\t\t\t\tif (\n\t\t\t\t\t\tisZWaveError(e)\n\t\t\t\t\t\t&& e.code\n\t\t\t\t\t\t\t=== ZWaveErrorCodes.PacketFormat_InvalidPayload\n\t\t\t\t\t\t&& isUint8Array(this.eventParameters)\n\t\t\t\t\t) {\n\t\t\t\t\t\tconst { ccId, ccCommand } = CCRaw.parse(\n\t\t\t\t\t\t\tthis.eventParameters,\n\t\t\t\t\t\t);\n\t\t\t\t\t\tif (\n\t\t\t\t\t\t\tccId === CommandClasses[\"User Code\"]\n\t\t\t\t\t\t\t&& ccCommand === UserCodeCommand.Report\n\t\t\t\t\t\t\t&& this.eventParameters.length >= 3\n\t\t\t\t\t\t) {\n\t\t\t\t\t\t\t// Access control -> Keypad Lock/Unlock operation\n\t\t\t\t\t\t\t// Some devices report the user code with truncated UserCode reports\n\t\t\t\t\t\t\tthis.eventParameters = {\n\t\t\t\t\t\t\t\tuserId: this.eventParameters[2],\n\t\t\t\t\t\t\t};\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tctx.logNode(\n\t\t\t\t\t\t\t\tthis.nodeId as number,\n\t\t\t\t\t\t\t\t`Failed to parse Notification CC event parameters, ignoring them...`,\n\t\t\t\t\t\t\t\t\"error\",\n\t\t\t\t\t\t\t);\n\t\t\t\t\t\t}\n\t\t\t\t\t} else {\n\t\t\t\t\t\t// unexpected error\n\t\t\t\t\t\tthrow e;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t} else if (valueConfig.parameter?.type === \"value\") {\n\t\t\t// This only makes sense if the event parameters are a buffer\n\t\t\tif (!isUint8Array(this.eventParameters)) {\n\t\t\t\treturn;\n\t\t\t}\n\t\t\t// The parameters contain a named value\n\t\t\tthis.eventParameters = {\n\t\t\t\t[valueConfig.parameter.propertyName]: Bytes.view(\n\t\t\t\t\tthis.eventParameters,\n\t\t\t\t)\n\t\t\t\t\t.readUIntBE(\n\t\t\t\t\t\t0,\n\t\t\t\t\t\tthis.eventParameters.length,\n\t\t\t\t\t),\n\t\t\t};\n\t\t} else if (valueConfig.parameter?.type === \"enum\") {\n\t\t\t// The parameters may contain an enum value\n\t\t\tthis.eventParameters = isUint8Array(this.eventParameters)\n\t\t\t\t\t&& this.eventParameters.length === 1\n\t\t\t\t? this.eventParameters[0]\n\t\t\t\t: undefined;\n\n\t\t\t// Some devices send notifications without an event parameter when they should.\n\t\t\t// In this case, fall back to the default value where possible.\n\n\t\t\tif (\n\t\t\t\tthis.eventParameters == undefined\n\t\t\t\t&& valueConfig.parameter.default != undefined\n\t\t\t) {\n\t\t\t\tthis.eventParameters = valueConfig.parameter.default;\n\t\t\t}\n\t\t}\n\t}\n\n\tpublic serialize(ctx: CCEncodingContext): Promise<Bytes> {\n\t\tif (this.notificationType != undefined) {\n\t\t\tif (\n\t\t\t\tthis.notificationEvent == undefined\n\t\t\t) {\n\t\t\t\tthrow new ZWaveError(\n\t\t\t\t\t`Notification CC reports requires the notification event to be set!`,\n\t\t\t\t\tZWaveErrorCodes.Argument_Invalid,\n\t\t\t\t);\n\t\t\t} else if (\n\t\t\t\tthis.eventParameters != undefined\n\t\t\t\t&& !isUint8Array(this.eventParameters)\n\t\t\t) {\n\t\t\t\tthrow new ZWaveError(\n\t\t\t\t\t`When sending Notification CC reports, the event parameters can only be buffers!`,\n\t\t\t\t\tZWaveErrorCodes.Argument_Invalid,\n\t\t\t\t);\n\t\t\t}\n\n\t\t\tconst controlByte =\n\t\t\t\t(this.sequenceNumber != undefined ? 0b1000_0000 : 0)\n\t\t\t\t| ((this.eventParameters?.length ?? 0) & 0b11111);\n\t\t\tthis.payload = Bytes.from([\n\t\t\t\t0,\n\t\t\t\t0,\n\t\t\t\t0,\n\t\t\t\t0xff,\n\t\t\t\tthis.notificationType,\n\t\t\t\tthis.notificationEvent,\n\t\t\t\tcontrolByte,\n\t\t\t]);\n\t\t\tif (this.eventParameters) {\n\t\t\t\tthis.payload = Bytes.concat([\n\t\t\t\t\tthis.payload,\n\t\t\t\t\tthis.eventParameters,\n\t\t\t\t]);\n\t\t\t}\n\t\t\tif (this.sequenceNumber != undefined) {\n\t\t\t\tthis.payload = Bytes.concat([\n\t\t\t\t\tthis.payload,\n\t\t\t\t\tBytes.from([this.sequenceNumber]),\n\t\t\t\t]);\n\t\t\t}\n\t\t} else {\n\t\t\tthis.payload = Bytes.from([\n\t\t\t\tthis.alarmType ?? 0x00,\n\t\t\t\tthis.alarmLevel ?? 0x00,\n\t\t\t]);\n\t\t}\n\n\t\treturn super.serialize(ctx);\n\t}\n}\n\n// @publicAPI\nexport type NotificationCCGetOptions =\n\t| {\n\t\talarmType: number;\n\t}\n\t| {\n\t\tnotificationType: number;\n\t\tnotificationEvent?: number;\n\t};\n\n@CCCommand(NotificationCommand.Get)\n@expectedCCResponse(NotificationCCReport)\nexport class NotificationCCGet extends NotificationCC {\n\tpublic constructor(\n\t\toptions: WithAddress<NotificationCCGetOptions>,\n\t) {\n\t\tsuper(options);\n\t\tif (\"alarmType\" in options) {\n\t\t\tthis.alarmType = options.alarmType;\n\t\t} else {\n\t\t\tthis.notificationType = options.notificationType;\n\t\t\tthis.notificationEvent = options.notificationEvent;\n\t\t}\n\t}\n\n\tpublic static from(raw: CCRaw, ctx: CCParsingContext): NotificationCCGet {\n\t\tvalidatePayload(raw.payload.length >= 1);\n\n\t\tif (raw.payload.length >= 2) {\n\t\t\tconst notificationType = raw.payload[1];\n\t\t\tlet notificationEvent: number | undefined;\n\t\t\tif (raw.payload.length >= 3 && notificationType != 0xff) {\n\t\t\t\tnotificationEvent = raw.payload[2];\n\t\t\t}\n\t\t\treturn new this({\n\t\t\t\tnodeId: ctx.sourceNodeId,\n\t\t\t\tnotificationType,\n\t\t\t\tnotificationEvent,\n\t\t\t});\n\t\t} else {\n\t\t\tconst alarmType = raw.payload[0];\n\t\t\treturn new this({\n\t\t\t\tnodeId: ctx.sourceNodeId,\n\t\t\t\talarmType,\n\t\t\t});\n\t\t}\n\t}\n\n\t/** Proprietary V1/V2 alarm type */\n\tpublic alarmType: number | undefined;\n\t/** Regulated V3+ notification type */\n\tpublic notificationType: number | undefined;\n\tpublic notificationEvent: number | undefined;\n\n\tpublic serialize(ctx: CCEncodingContext): Promise<Bytes> {\n\t\tconst notificationEvent = this.notificationEvent === 0xff\n\t\t\t? 0x00\n\t\t\t: this.notificationEvent;\n\t\tthis.payload = Bytes.from([\n\t\t\tthis.alarmType ?? 0x00,\n\t\t\tthis.notificationType ?? 0xff,\n\t\t\tnotificationEvent ?? 0x00,\n\t\t]);\n\t\treturn super.serialize(ctx);\n\t}\n\n\tpublic toLogEntry(ctx?: GetValueDB): MessageOrCCLogEntry {\n\t\tconst message: MessageRecord = {};\n\t\tif (this.alarmType != undefined) {\n\t\t\tmessage[\"V1 alarm type\"] = this.alarmType;\n\t\t}\n\t\tif (this.notificationType != undefined) {\n\t\t\tmessage[\"notification type\"] = getNotificationName(\n\t\t\t\tthis.notificationType,\n\t\t\t);\n\t\t\tif (this.notificationEvent != undefined) {\n\t\t\t\tmessage[\"notification event\"] = getNotificationEventName(\n\t\t\t\t\tthis.notificationType,\n\t\t\t\t\tthis.notificationEvent,\n\t\t\t\t);\n\t\t\t}\n\t\t}\n\t\treturn {\n\t\t\t...super.toLogEntry(ctx),\n\t\t\tmessage,\n\t\t};\n\t}\n}\n\n// @publicAPI\nexport interface NotificationCCSupportedReportOptions {\n\tsupportsV1Alarm: boolean;\n\tsupportedNotificationTypes: number[];\n}\n\n@CCCommand(NotificationCommand.SupportedReport)\n@ccValueProperty(\"supportsV1Alarm\", NotificationCCValues.supportsV1Alarm)\n@ccValueProperty(\n\t\"supportedNotificationTypes\",\n\tNotificationCCValues.supportedNotificationTypes,\n)\nexport class NotificationCCSupportedReport extends NotificationCC {\n\tpublic constructor(\n\t\toptions: WithAddress<NotificationCCSupportedReportOptions>,\n\t) {\n\t\tsuper(options);\n\n\t\tthis.supportsV1Alarm = options.supportsV1Alarm;\n\t\tthis.supportedNotificationTypes = options.supportedNotificationTypes;\n\t}\n\n\tpublic static from(\n\t\traw: CCRaw,\n\t\tctx: CCParsingContext,\n\t): NotificationCCSupportedReport {\n\t\tvalidatePayload(raw.payload.length >= 1);\n\t\tconst supportsV1Alarm = !!(raw.payload[0] & 0b1000_0000);\n\t\tconst numBitMaskBytes = raw.payload[0] & 0b0001_1111;\n\t\tvalidatePayload(\n\t\t\tnumBitMaskBytes > 0,\n\t\t\traw.payload.length >= 1 + numBitMaskBytes,\n\t\t);\n\t\tconst notificationBitMask = raw.payload.subarray(\n\t\t\t1,\n\t\t\t1 + numBitMaskBytes,\n\t\t);\n\t\tconst supportedNotificationTypes = parseBitMask(\n\t\t\tnotificationBitMask,\n\t\t\t// bit 0 is ignored, but counting still starts at 1, so the first bit must have the value 0\n\t\t\t0,\n\t\t);\n\n\t\treturn new this({\n\t\t\tnodeId: ctx.sourceNodeId,\n\t\t\tsupportsV1Alarm,\n\t\t\tsupportedNotificationTypes,\n\t\t});\n\t}\n\n\tpublic supportsV1Alarm: boolean;\n\n\tpublic supportedNotificationTypes: number[];\n\n\tpublic serialize(ctx: CCEncodingContext): Promise<Bytes> {\n\t\tconst bitMask = encodeBitMask(\n\t\t\tthis.supportedNotificationTypes,\n\t\t\tMath.max(...this.supportedNotificationTypes),\n\t\t\t0,\n\t\t);\n\t\tthis.payload = Bytes.concat([\n\t\t\tBytes.from([\n\t\t\t\t(this.supportsV1Alarm ? 0b1000_0000 : 0) | bitMask.length,\n\t\t\t]),\n\t\t\tbitMask,\n\t\t]);\n\t\treturn super.serialize(ctx);\n\t}\n\n\tpublic toLogEntry(ctx?: GetValueDB): MessageOrCCLogEntry {\n\t\treturn {\n\t\t\t...super.toLogEntry(ctx),\n\t\t\tmessage: {\n\t\t\t\t\"supports V1 alarm\": this.supportsV1Alarm,\n\t\t\t\t\"supported notification types\": this.supportedNotificationTypes\n\t\t\t\t\t.map(\n\t\t\t\t\t\t(t) => `\\n\u00B7 ${getNotificationName(t)}`,\n\t\t\t\t\t)\n\t\t\t\t\t.join(\"\"),\n\t\t\t},\n\t\t};\n\t}\n}\n\n@CCCommand(NotificationCommand.SupportedGet)\n@expectedCCResponse(NotificationCCSupportedReport)\nexport class NotificationCCSupportedGet extends NotificationCC {}\n\n// @publicAPI\nexport interface NotificationCCEventSupportedReportOptions {\n\tnotificationType: number;\n\tsupportedEvents: number[];\n}\n\n@CCCommand(NotificationCommand.EventSupportedReport)\nexport class NotificationCCEventSupportedReport extends NotificationCC {\n\tpublic constructor(\n\t\toptions: WithAddress<NotificationCCEventSupportedReportOptions>,\n\t) {\n\t\tsuper(options);\n\n\t\tthis.notificationType = options.notificationType;\n\t\tthis.supportedEvents = options.supportedEvents;\n\t}\n\n\tpublic static from(\n\t\traw: CCRaw,\n\t\tctx: CCParsingContext,\n\t): NotificationCCEventSupportedReport {\n\t\tvalidatePayload(raw.payload.length >= 1);\n\t\tconst notificationType = raw.payload[0];\n\t\tconst numBitMaskBytes = raw.payload[1] & 0b000_11111;\n\n\t\tif (numBitMaskBytes === 0) {\n\t\t\t// Notification type is not supported\n\t\t\treturn new this({\n\t\t\t\tnodeId: ctx.sourceNodeId,\n\t\t\t\tnotificationType,\n\t\t\t\tsupportedEvents: [],\n\t\t\t});\n\t\t}\n\n\t\tvalidatePayload(raw.payload.length >= 2 + numBitMaskBytes);\n\t\tconst eventBitMask = raw.payload.subarray(2, 2 + numBitMaskBytes);\n\t\tconst supportedEvents = parseBitMask(\n\t\t\teventBitMask,\n\t\t\t// In this mask, bit 0 is ignored, but counting still starts at 1, so the first bit must have the value 0\n\t\t\t0,\n\t\t);\n\n\t\treturn new this({\n\t\t\tnodeId: ctx.sourceNodeId,\n\t\t\tnotificationType,\n\t\t\tsupportedEvents,\n\t\t});\n\t}\n\n\tpublic persistValues(ctx: PersistValuesContext): boolean {\n\t\tif (!super.persistValues(ctx)) return false;\n\n\t\t// Store which events this notification supports\n\t\tthis.setValue(\n\t\t\tctx,\n\t\t\tNotificationCCValues.supportedNotificationEvents(\n\t\t\t\tthis.notificationType,\n\t\t\t),\n\t\t\tthis.supportedEvents,\n\t\t);\n\n\t\t// For each event, predefine the value metadata\n\t\tconst notification = getNotification(this.notificationType);\n\n\t\tif (!notification) {\n\t\t\t// This is an unknown notification\n\t\t\tthis.setMetadata(\n\t\t\t\tctx,\n\t\t\t\tNotificationCCValues.unknownNotificationType(\n\t\t\t\t\tthis.notificationType,\n\t\t\t\t),\n\t\t\t);\n\t\t} else {\n\t\t\t// This is a standardized notification\n\t\t\tlet isFirst = true;\n\t\t\tfor (const value of this.supportedEvents) {\n\t\t\t\t// Find out which property we need to update\n\t\t\t\tconst valueConfig = getNotificationValue(notification, value);\n\t\t\t\tif (valueConfig?.type === \"state\") {\n\t\t\t\t\tconst notificationValue = NotificationCCValues\n\t\t\t\t\t\t.notificationVariable(\n\t\t\t\t\t\t\tnotification.name,\n\t\t\t\t\t\t\tvalueConfig.variableName,\n\t\t\t\t\t\t);\n\n\t\t\t\t\t// After we've created the metadata initially, extend it\n\t\t\t\t\tconst metadata = getNotificationValueMetadata(\n\t\t\t\t\t\tisFirst\n\t\t\t\t\t\t\t? undefined\n\t\t\t\t\t\t\t: this.getMetadata(ctx, notificationValue),\n\t\t\t\t\t\tnotification,\n\t\t\t\t\t\tvalueConfig,\n\t\t\t\t\t);\n\n\t\t\t\t\tthis.setMetadata(ctx, notificationValue, metadata);\n\n\t\t\t\t\tisFirst = false;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\treturn true;\n\t}\n\n\tpublic notificationType: number;\n\tpublic supportedEvents: number[];\n\n\tpublic serialize(ctx: CCEncodingContext): Promise<Bytes> {\n\t\tthis.payload = Bytes.from([this.notificationType, 0]);\n\t\tif (this.supportedEvents.length > 0) {\n\t\t\tconst bitMask = encodeBitMask(\n\t\t\t\tthis.supportedEvents,\n\t\t\t\tMath.max(...this.supportedEvents),\n\t\t\t\t0,\n\t\t\t);\n\t\t\tthis.payload[1] = bitMask.length;\n\t\t\tthis.payload = Bytes.concat([this.payload, bitMask]);\n\t\t}\n\n\t\treturn super.serialize(ctx);\n\t}\n\n\tpublic toLogEntry(ctx?: GetValueDB): MessageOrCCLogEntry {\n\t\treturn {\n\t\t\t...super.toLogEntry(ctx),\n\t\t\tmessage: {\n\t\t\t\t\"notification type\": getNotificationName(this.notificationType),\n\t\t\t\t\"supported events\": this.supportedEvents\n\t\t\t\t\t.map(\n\t\t\t\t\t\t(e) =>\n\t\t\t\t\t\t\t`\\n\u00B7 ${\n\t\t\t\t\t\t\t\tgetNotificationValueName(\n\t\t\t\t\t\t\t\t\tthis.notificationType,\n\t\t\t\t\t\t\t\t\te,\n\t\t\t\t\t\t\t\t)\n\t\t\t\t\t\t\t}`,\n\t\t\t\t\t)\n\t\t\t\t\t.join(\"\"),\n\t\t\t},\n\t\t};\n\t}\n}\n\n// @publicAPI\nexport interface NotificationCCEventSupportedGetOptions {\n\tnotificationType: number;\n}\n\n@CCCommand(NotificationCommand.EventSupportedGet)\n@expectedCCResponse(NotificationCCEventSupportedReport)\nexport class NotificationCCEventSupportedGet extends NotificationCC {\n\tpublic constructor(\n\t\toptions: WithAddress<NotificationCCEventSupportedGetOptions>,\n\t) {\n\t\tsuper(options);\n\t\tthis.notificationType = options.notificationType;\n\t}\n\n\tpublic static from(\n\t\traw: CCRaw,\n\t\tctx: CCParsingContext,\n\t): NotificationCCEventSupportedGet {\n\t\tvalidatePayload(raw.payload.length >= 1);\n\t\tconst notificationType = raw.payload[0];\n\n\t\treturn new this({\n\t\t\tnodeId: ctx.sourceNodeId,\n\t\t\tnotificationType,\n\t\t});\n\t}\n\n\tpublic notificationType: number;\n\n\tpublic serialize(ctx: CCEncodingContext): Promise<Bytes> {\n\t\tthis.payload = Bytes.from([this.notificationType]);\n\t\treturn super.serialize(ctx);\n\t}\n\n\tpublic toLogEntry(ctx?: GetValueDB): MessageOrCCLogEntry {\n\t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OAC/C,kDAAmB,kCAAkC,CAAC;;;;oBACF;uDAAA,YAAc;WAAA;;;;;;;;AAAnE,mBAAA,MAAA,mBAAA,EAAA,OAAA,WAAA,GAAA,kBAAA,EAAA,MAAA,SAAA,MAAA,WAAA,MAAA,UAAA,UAAA,GAAA,MAAA,uBAAA;;;AAAa,wBAAA,YAAA,uBAAA;;IACZ,YACC,SAA4D;AAE5D,YAAM,OAAO;AACb,WAAK,mBAAmB,QAAQ;IACjC;IAEO,OAAO,KACb,KACA,KAAqB;AAErB,uCAAgB,IAAI,QAAQ,UAAU,CAAC;AACvC,YAAM,mBAAmB,IAAI,QAAQ,CAAC;AAEtC,aAAO,IAAI,KAAK;QACf,QAAQ,IAAI;QACZ;OACA;IACF;IAEO;IAEA,UAAU,KAAsB;AACtC,WAAK,UAAU,mBAAM,KAAK,CAAC,KAAK,gBAAgB,CAAC;AACjD,aAAO,MAAM,UAAU,GAAG;IAC3B;IAEO,WAAW,KAAgB;AACjC,aAAO;QACN,GAAG,MAAM,WAAW,GAAG;QACvB,SAAS;UACR,yBAAqB,iCAAoB,KAAK,gBAAgB;;;IAGjE;;;;",
6
- "names": ["import_safe", "NotificationCC"]
4
+ "sourcesContent": ["import type { CCEncodingContext, CCParsingContext } from \"@zwave-js/cc\";\nimport type { GetDeviceConfig } from \"@zwave-js/config\";\nimport {\n\tCommandClasses,\n\ttype ControlsCC,\n\tDuration,\n\ttype EndpointId,\n\ttype GetEndpoint,\n\ttype GetNode,\n\ttype GetSupportedCCVersion,\n\ttype GetValueDB,\n\ttype LogNode,\n\ttype MaybeNotKnown,\n\ttype MessageOrCCLogEntry,\n\tMessagePriority,\n\ttype MessageRecord,\n\ttype NodeId,\n\ttype Notification,\n\ttype NotificationState,\n\ttype NotificationValue,\n\tSecurityClass,\n\ttype SinglecastCC,\n\ttype SupervisionResult,\n\ttype SupportsCC,\n\ttype ValueID,\n\tValueMetadata,\n\ttype ValueMetadataNumeric,\n\ttype WithAddress,\n\tZWaveError,\n\tZWaveErrorCodes,\n\tencodeBitMask,\n\tgetCCName,\n\tgetNotification,\n\tgetNotificationEventName,\n\tgetNotificationName,\n\tgetNotificationValue,\n\tgetNotificationValueName,\n\tisZWaveError,\n\tparseBitMask,\n\ttimespan,\n\tvalidatePayload,\n} from \"@zwave-js/core\";\nimport {\n\tBytes,\n\tbuffer2hex,\n\tisUint8Array,\n\tnum2hex,\n\tpick,\n} from \"@zwave-js/shared\";\nimport { validateArgs } from \"@zwave-js/transformers\";\nimport { isArray } from \"alcalzone-shared/typeguards\";\nimport {\n\tCCAPI,\n\tPOLL_VALUE,\n\tPhysicalCCAPI,\n\ttype PollValueImplementation,\n\tthrowUnsupportedProperty,\n} from \"../lib/API.js\";\nimport {\n\tCCRaw,\n\tCommandClass,\n\ttype InterviewContext,\n\tInvalidCC,\n\ttype PersistValuesContext,\n\ttype RefreshValuesContext,\n\tgetEffectiveCCVersion,\n} from \"../lib/CommandClass.js\";\nimport {\n\tAPI,\n\tCCCommand,\n\tccValueProperty,\n\tccValues,\n\tcommandClass,\n\texpectedCCResponse,\n\tgetCCCommandConstructor,\n\timplementedVersion,\n\tuseSupervision,\n} from \"../lib/CommandClassDecorators.js\";\nimport { isNotificationEventPayload } from \"../lib/NotificationEventPayload.js\";\nimport { V } from \"../lib/Values.js\";\nimport { NotificationCommand, UserCodeCommand } from \"../lib/_Types.js\";\nimport * as ccUtils from \"../lib/utils.js\";\nimport { AssociationGroupInfoCC } from \"./AssociationGroupInfoCC.js\";\n\nexport const NotificationCCValues = V.defineCCValues(\n\tCommandClasses.Notification,\n\t{\n\t\t...V.staticProperty(\"supportsV1Alarm\", undefined, {\n\t\t\tinternal: true,\n\t\t\tsupportsEndpoints: false,\n\t\t}),\n\t\t...V.staticProperty(\"supportedNotificationTypes\", undefined, {\n\t\t\tinternal: true,\n\t\t\tsupportsEndpoints: false,\n\t\t}),\n\t\t...V.staticProperty(\"notificationMode\", undefined, {\n\t\t\tinternal: true,\n\t\t\tsupportsEndpoints: false,\n\t\t}),\n\t\t...V.staticProperty(\"lastRefresh\", undefined, {\n\t\t\tinternal: true,\n\t\t}),\n\t\t...V.staticProperty(\n\t\t\t\"alarmType\",\n\t\t\t{\n\t\t\t\t...ValueMetadata.ReadOnlyUInt8,\n\t\t\t\tlabel: \"Alarm Type\",\n\t\t\t} as const,\n\t\t),\n\t\t...V.staticProperty(\n\t\t\t\"alarmLevel\",\n\t\t\t{\n\t\t\t\t...ValueMetadata.ReadOnlyUInt8,\n\t\t\t\tlabel: \"Alarm Level\",\n\t\t\t} as const,\n\t\t),\n\t\t...V.staticPropertyAndKeyWithName(\n\t\t\t\"doorStateSimple\",\n\t\t\t\"Access Control\",\n\t\t\t\"Door state (simple)\",\n\t\t\t{\n\t\t\t\t// Must be a number for compatibility reasons\n\t\t\t\t...ValueMetadata.ReadOnlyUInt8,\n\t\t\t\tlabel: \"Door state (simple)\",\n\t\t\t\tstates: {\n\t\t\t\t\t[0x16]: \"Window/door is open\",\n\t\t\t\t\t[0x17]: \"Window/door is closed\",\n\t\t\t\t},\n\t\t\t\tccSpecific: {\n\t\t\t\t\tnotificationType: 0x06,\n\t\t\t\t},\n\t\t\t} as const,\n\t\t\t{\n\t\t\t\tautoCreate: shouldAutoCreateSimpleDoorSensorValue,\n\t\t\t} as const,\n\t\t),\n\t\t...V.staticPropertyAndKeyWithName(\n\t\t\t\"doorTiltState\",\n\t\t\t\"Access Control\",\n\t\t\t\"Door tilt state\",\n\t\t\t{\n\t\t\t\t// Must be a number for compatibility reasons\n\t\t\t\t...ValueMetadata.ReadOnlyUInt8,\n\t\t\t\tlabel: \"Door tilt state\",\n\t\t\t\tstates: {\n\t\t\t\t\t[0x00]: \"Window/door is not tilted\",\n\t\t\t\t\t[0x01]: \"Window/door is tilted\",\n\t\t\t\t},\n\t\t\t\tccSpecific: {\n\t\t\t\t\tnotificationType: 0x06,\n\t\t\t\t},\n\t\t\t} as const,\n\t\t\t{\n\t\t\t\t// This is created when the tilt state is first received.\n\t\t\t\tautoCreate: false,\n\t\t\t} as const,\n\t\t),\n\t\t...V.dynamicPropertyAndKeyWithName(\n\t\t\t\"supportedNotificationEvents\",\n\t\t\t\"supportedNotificationEvents\",\n\t\t\t(notificationType: number) => notificationType,\n\t\t\t({ property, propertyKey }) =>\n\t\t\t\tproperty === \"supportedNotificationEvents\"\n\t\t\t\t&& typeof propertyKey === \"number\",\n\t\t\tundefined,\n\t\t\t{ internal: true, supportsEndpoints: false },\n\t\t),\n\t\t...V.dynamicPropertyWithName(\n\t\t\t\"unknownNotificationType\",\n\t\t\t(notificationType: number) =>\n\t\t\t\t`UNKNOWN_${num2hex(notificationType)}`,\n\t\t\t({ property }) =>\n\t\t\t\ttypeof property === \"string\"\n\t\t\t\t&& property.startsWith(\"UNKNOWN_0x\"),\n\t\t\t(notificationType: number) => ({\n\t\t\t\t...ValueMetadata.ReadOnlyUInt8,\n\t\t\t\tlabel: `Unknown notification (${\n\t\t\t\t\tnum2hex(\n\t\t\t\t\t\tnotificationType,\n\t\t\t\t\t)\n\t\t\t\t})`,\n\t\t\t\tccSpecific: { notificationType },\n\t\t\t} as const),\n\t\t),\n\t\t...V.dynamicPropertyAndKeyWithName(\n\t\t\t\"unknownNotificationVariable\",\n\t\t\t(notificationType: number, notificationName: string) =>\n\t\t\t\tnotificationName,\n\t\t\t\"unknown\",\n\t\t\t({ property, propertyKey }) =>\n\t\t\t\ttypeof property === \"string\" && propertyKey === \"unknown\",\n\t\t\t(notificationType: number, notificationName: string) => ({\n\t\t\t\t...ValueMetadata.ReadOnlyUInt8,\n\t\t\t\tlabel: `${notificationName}: Unknown value`,\n\t\t\t\tccSpecific: { notificationType },\n\t\t\t} as const),\n\t\t),\n\t\t...V.dynamicPropertyAndKeyWithName(\n\t\t\t\"notificationVariable\",\n\t\t\t// eslint-disable-next-line @typescript-eslint/no-unused-vars\n\t\t\t(notificationName: string, variableName: string) =>\n\t\t\t\tnotificationName,\n\t\t\t(notificationName: string, variableName: string) => variableName,\n\t\t\t({ property, propertyKey }) =>\n\t\t\t\ttypeof property === \"string\" && typeof propertyKey === \"string\",\n\t\t\t// Notification metadata is so dynamic, it does not make sense to define it here\n\t\t\tundefined,\n\t\t),\n\t},\n);\n\nexport function shouldAutoCreateSimpleDoorSensorValue(\n\tctx: GetValueDB,\n\tendpoint: EndpointId,\n): boolean {\n\tconst valueDB = ctx.tryGetValueDB(endpoint.nodeId);\n\tif (!valueDB) return false;\n\tconst supportedACEvents = valueDB.getValue<readonly number[]>(\n\t\tNotificationCCValues.supportedNotificationEvents(\n\t\t\t// Access Control\n\t\t\t0x06,\n\t\t).endpoint(endpoint.index),\n\t);\n\tif (!supportedACEvents) return false;\n\treturn (\n\t\tsupportedACEvents.includes(\n\t\t\t// Window/door is open\n\t\t\t0x16,\n\t\t)\n\t\t&& supportedACEvents.includes(\n\t\t\t// Window/door is closed\n\t\t\t0x17,\n\t\t)\n\t);\n}\n\n@API(CommandClasses.Notification)\nexport class NotificationCCAPI extends PhysicalCCAPI {\n\tpublic supportsCommand(cmd: NotificationCommand): MaybeNotKnown<boolean> {\n\t\tswitch (cmd) {\n\t\t\tcase NotificationCommand.Report:\n\t\t\tcase NotificationCommand.Get:\n\t\t\t\treturn true; // These exist starting with V1\n\n\t\t\tcase NotificationCommand.Set:\n\t\t\tcase NotificationCommand.SupportedGet:\n\t\t\t\treturn this.version >= 2;\n\n\t\t\tcase NotificationCommand.EventSupportedGet:\n\t\t\t\treturn this.version >= 3;\n\t\t}\n\t\treturn super.supportsCommand(cmd);\n\t}\n\n\tprotected get [POLL_VALUE](): PollValueImplementation {\n\t\treturn async function(\n\t\t\tthis: NotificationCCAPI,\n\t\t\t{ property, propertyKey },\n\t\t) {\n\t\t\tconst valueId: ValueID = {\n\t\t\t\tcommandClass: this.ccId,\n\t\t\t\tendpoint: this.endpoint.index,\n\t\t\t\tproperty,\n\t\t\t\tpropertyKey,\n\t\t\t};\n\t\t\tif (NotificationCCValues.notificationVariable.is(valueId)) {\n\t\t\t\tconst notificationType: number | undefined = this\n\t\t\t\t\t.tryGetValueDB()?.getMetadata(valueId)?.ccSpecific\n\t\t\t\t\t?.notificationType;\n\t\t\t\tif (notificationType != undefined) {\n\t\t\t\t\treturn this.getInternal({ notificationType });\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tthrowUnsupportedProperty(this.ccId, property);\n\t\t};\n\t}\n\n\t/**\n\t * @internal\n\t */\n\tpublic async getInternal(\n\t\toptions: NotificationCCGetOptions,\n\t): Promise<NotificationCCReport | undefined> {\n\t\tthis.assertSupportsCommand(\n\t\t\tNotificationCommand,\n\t\t\tNotificationCommand.Get,\n\t\t);\n\n\t\tconst cc = new NotificationCCGet({\n\t\t\tnodeId: this.endpoint.nodeId,\n\t\t\tendpointIndex: this.endpoint.index,\n\t\t\t...options,\n\t\t});\n\t\treturn this.host.sendCommand<NotificationCCReport>(\n\t\t\tcc,\n\t\t\tthis.commandOptions,\n\t\t);\n\t}\n\n\t@validateArgs()\n\tpublic async sendReport(\n\t\toptions: NotificationCCReportOptions,\n\t): Promise<SupervisionResult | undefined> {\n\t\tthis.assertSupportsCommand(\n\t\t\tNotificationCommand,\n\t\t\tNotificationCommand.Report,\n\t\t);\n\n\t\tconst cc = new NotificationCCReport({\n\t\t\tnodeId: this.endpoint.nodeId,\n\t\t\tendpointIndex: this.endpoint.index,\n\t\t\t...options,\n\t\t});\n\t\treturn this.host.sendCommand(cc, this.commandOptions);\n\t}\n\n\t@validateArgs()\n\t// eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types\n\tpublic async get(options: NotificationCCGetOptions) {\n\t\tconst response = await this.getInternal(options);\n\t\tif (response) {\n\t\t\treturn pick(response, [\n\t\t\t\t\"notificationStatus\",\n\t\t\t\t\"notificationEvent\",\n\t\t\t\t\"alarmLevel\",\n\t\t\t\t\"eventParameters\",\n\t\t\t\t\"sequenceNumber\",\n\t\t\t]);\n\t\t}\n\t}\n\n\t@validateArgs()\n\tpublic async set(\n\t\tnotificationType: number,\n\t\tnotificationStatus: boolean,\n\t): Promise<SupervisionResult | undefined> {\n\t\tthis.assertSupportsCommand(\n\t\t\tNotificationCommand,\n\t\t\tNotificationCommand.Set,\n\t\t);\n\n\t\tconst cc = new NotificationCCSet({\n\t\t\tnodeId: this.endpoint.nodeId,\n\t\t\tendpointIndex: this.endpoint.index,\n\t\t\tnotificationType,\n\t\t\tnotificationStatus,\n\t\t});\n\t\treturn this.host.sendCommand(cc, this.commandOptions);\n\t}\n\n\t// eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types\n\tpublic async getSupported() {\n\t\tthis.assertSupportsCommand(\n\t\t\tNotificationCommand,\n\t\t\tNotificationCommand.SupportedGet,\n\t\t);\n\n\t\tconst cc = new NotificationCCSupportedGet({\n\t\t\tnodeId: this.endpoint.nodeId,\n\t\t\tendpointIndex: this.endpoint.index,\n\t\t});\n\t\tconst response = await this.host.sendCommand<\n\t\t\tNotificationCCSupportedReport\n\t\t>(\n\t\t\tcc,\n\t\t\tthis.commandOptions,\n\t\t);\n\t\tif (response) {\n\t\t\treturn pick(response, [\n\t\t\t\t\"supportsV1Alarm\",\n\t\t\t\t\"supportedNotificationTypes\",\n\t\t\t]);\n\t\t}\n\t}\n\n\t@validateArgs()\n\tpublic async getSupportedEvents(\n\t\tnotificationType: number,\n\t): Promise<MaybeNotKnown<readonly number[]>> {\n\t\tthis.assertSupportsCommand(\n\t\t\tNotificationCommand,\n\t\t\tNotificationCommand.EventSupportedGet,\n\t\t);\n\n\t\tconst cc = new NotificationCCEventSupportedGet({\n\t\t\tnodeId: this.endpoint.nodeId,\n\t\t\tendpointIndex: this.endpoint.index,\n\t\t\tnotificationType,\n\t\t});\n\t\tconst response = await this.host.sendCommand<\n\t\t\tNotificationCCEventSupportedReport\n\t\t>(\n\t\t\tcc,\n\t\t\tthis.commandOptions,\n\t\t);\n\t\treturn response?.supportedEvents;\n\t}\n}\n\nexport function getNotificationEnumBehavior(\n\tnotification: Notification,\n\tvalueConfig: NotificationState,\n): \"none\" | \"extend\" | \"replace\" {\n\tconst variable = notification.variables.find((v) =>\n\t\tv.states.has(valueConfig.value)\n\t);\n\tif (!variable) return \"none\";\n\tconst numStatesWithEnums = [...variable.states.values()].filter(\n\t\t(val) => val.parameter?.type === \"enum\",\n\t).length;\n\tif (numStatesWithEnums === 0) return \"none\";\n\t// An enum value replaces the original value if there is only a single possible state\n\t// which also has an enum parameter\n\tif (numStatesWithEnums === 1 && variable.states.size === 1) {\n\t\treturn \"replace\";\n\t}\n\treturn \"extend\";\n}\n\nexport function getNotificationStateValueWithEnum(\n\tstateValue: number,\n\tenumValue: number,\n): number {\n\treturn (stateValue << 8) | enumValue;\n}\n\n/**\n * Returns the metadata to use for a known notification value.\n * Can be used to extend a previously defined metadata,\n * e.g. for V2 notifications that don't allow discovering supported events.\n */\nexport function getNotificationValueMetadata(\n\tprevious: ValueMetadataNumeric | undefined,\n\tnotification: Notification,\n\tvalueConfig: NotificationState,\n): ValueMetadataNumeric {\n\tconst metadata: ValueMetadataNumeric = previous ?? {\n\t\t...ValueMetadata.ReadOnlyUInt8,\n\t\tlabel: valueConfig.variableName,\n\t\tstates: {},\n\t\tccSpecific: {\n\t\t\tnotificationType: notification.type,\n\t\t},\n\t};\n\tif (valueConfig.idle) {\n\t\tmetadata.states![0] = \"idle\";\n\t}\n\tconst enumBehavior = getNotificationEnumBehavior(\n\t\tnotification,\n\t\tvalueConfig,\n\t);\n\tif (enumBehavior !== \"replace\") {\n\t\tmetadata.states![valueConfig.value] = valueConfig.label;\n\t}\n\tif (valueConfig.parameter?.type === \"enum\") {\n\t\tfor (\n\t\t\tconst [key, label] of Object.entries(valueConfig.parameter.values)\n\t\t) {\n\t\t\tconst value = parseInt(key);\n\t\t\tconst stateKey = enumBehavior === \"replace\"\n\t\t\t\t? value\n\t\t\t\t: getNotificationStateValueWithEnum(valueConfig.value, value);\n\t\t\tmetadata.states![stateKey] = label;\n\t\t}\n\t}\n\n\treturn metadata;\n}\n\n@commandClass(CommandClasses.Notification)\n@implementedVersion(8)\n@ccValues(NotificationCCValues)\nexport class NotificationCC extends CommandClass {\n\tdeclare ccCommand: NotificationCommand;\n\n\t// former AlarmCC (v1..v2)\n\n\tpublic determineRequiredCCInterviews(): readonly CommandClasses[] {\n\t\treturn [\n\t\t\t...super.determineRequiredCCInterviews(),\n\t\t\tCommandClasses.Association,\n\t\t\tCommandClasses[\"Multi Channel Association\"],\n\t\t\tCommandClasses[\"Association Group Information\"],\n\t\t];\n\t}\n\n\tprivate async determineNotificationMode(\n\t\tctx: GetValueDB & GetNode<NodeId & SupportsCC> & LogNode,\n\t\tapi: NotificationCCAPI,\n\t\tsupportedNotificationEvents: ReadonlyMap<number, readonly number[]>,\n\t): Promise<\"push\" | \"pull\"> {\n\t\tconst node = this.getNode(ctx)!;\n\n\t\t// SDS14223: If the supporting node does not support the Association Command Class,\n\t\t// it may be concluded that the supporting node implements Pull Mode and discovery may be aborted.\n\t\tif (!node.supportsCC(CommandClasses.Association)) return \"pull\";\n\n\t\tif (node.supportsCC(CommandClasses[\"Association Group Information\"])) {\n\t\t\ttry {\n\t\t\t\tconst groupsIssueingNotifications = AssociationGroupInfoCC\n\t\t\t\t\t.findGroupsForIssuedCommand(\n\t\t\t\t\t\tctx,\n\t\t\t\t\t\tnode,\n\t\t\t\t\t\tthis.ccId,\n\t\t\t\t\t\tNotificationCommand.Report,\n\t\t\t\t\t);\n\t\t\t\treturn groupsIssueingNotifications.length > 0 ? \"push\" : \"pull\";\n\t\t\t} catch {\n\t\t\t\t// We might be dealing with an older cache file, fall back to testing\n\t\t\t}\n\t\t}\n\n\t\tctx.logNode(node.id, {\n\t\t\tendpoint: this.endpointIndex,\n\t\t\tmessage: `determining whether this node is pull or push...`,\n\t\t\tdirection: \"outbound\",\n\t\t});\n\t\t// Find a notification type with at least one supported event\n\t\tfor (const [type, events] of supportedNotificationEvents) {\n\t\t\tif (events.length === 0) continue;\n\t\t\t// Enable the event and request the status\n\t\t\tawait api.set(type, true);\n\t\t\ttry {\n\t\t\t\tconst resp = await api.get({\n\t\t\t\t\tnotificationType: type,\n\t\t\t\t\tnotificationEvent: events[0],\n\t\t\t\t});\n\t\t\t\tswitch (resp?.notificationStatus) {\n\t\t\t\t\tcase 0xff:\n\t\t\t\t\t\treturn \"push\";\n\t\t\t\t\tcase 0xfe:\n\t\t\t\t\tcase 0x00:\n\t\t\t\t\t\treturn \"pull\";\n\t\t\t\t}\n\t\t\t} catch {\n\t\t\t\t/* ignore */\n\t\t\t}\n\t\t}\n\n\t\t// If everything failed, e.g. because the node is V1/V2, assume this is a \"push\" node.\n\t\t// If we assumed \"pull\", we would have to query the node regularly, which can cause\n\t\t// the node to return old (already handled) notifications.\n\t\t// https://github.com/zwave-js/zwave-js/issues/5626\n\t\treturn \"push\";\n\t}\n\n\t/** Whether the node implements push or pull notifications */\n\tpublic static getNotificationMode(\n\t\tctx: GetValueDB,\n\t\tnode: NodeId,\n\t): MaybeNotKnown<\"push\" | \"pull\"> {\n\t\treturn ctx\n\t\t\t.getValueDB(node.id)\n\t\t\t.getValue(NotificationCCValues.notificationMode.id);\n\t}\n\n\tpublic async interview(\n\t\tctx: InterviewContext,\n\t): Promise<void> {\n\t\tconst node = this.getNode(ctx)!;\n\t\tconst endpoint = this.getEndpoint(ctx)!;\n\t\tconst api = CCAPI.create(\n\t\t\tCommandClasses.Notification,\n\t\t\tctx,\n\t\t\tendpoint,\n\t\t).withOptions({\n\t\t\tpriority: MessagePriority.NodeQuery,\n\t\t});\n\n\t\tctx.logNode(node.id, {\n\t\t\tendpoint: this.endpointIndex,\n\t\t\tmessage: `Interviewing ${this.ccName}...`,\n\t\t\tdirection: \"none\",\n\t\t});\n\n\t\t// If one Association group issues Notification Reports,\n\t\t// we must associate ourselves with that channel\n\t\ttry {\n\t\t\tawait ccUtils.assignLifelineIssueingCommand(\n\t\t\t\tctx,\n\t\t\t\tendpoint,\n\t\t\t\tthis.ccId,\n\t\t\t\tNotificationCommand.Report,\n\t\t\t);\n\t\t} catch {\n\t\t\tctx.logNode(node.id, {\n\t\t\t\tendpoint: endpoint.index,\n\t\t\t\tmessage: `Configuring associations to receive ${\n\t\t\t\t\tgetCCName(\n\t\t\t\t\t\tthis.ccId,\n\t\t\t\t\t)\n\t\t\t\t} reports failed!`,\n\t\t\t\tlevel: \"warn\",\n\t\t\t});\n\t\t}\n\n\t\tlet supportsV1Alarm = false;\n\t\tif (api.version >= 2) {\n\t\t\tctx.logNode(node.id, {\n\t\t\t\tendpoint: this.endpointIndex,\n\t\t\t\tmessage: \"querying supported notification types...\",\n\t\t\t\tdirection: \"outbound\",\n\t\t\t});\n\n\t\t\tconst suppResponse = await api.getSupported();\n\t\t\tif (!suppResponse) {\n\t\t\t\tctx.logNode(node.id, {\n\t\t\t\t\tendpoint: this.endpointIndex,\n\t\t\t\t\tmessage:\n\t\t\t\t\t\t\"Querying supported notification types timed out, skipping interview...\",\n\t\t\t\t\tlevel: \"warn\",\n\t\t\t\t});\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tsupportsV1Alarm = suppResponse.supportsV1Alarm;\n\t\t\tconst supportedNotificationTypes =\n\t\t\t\tsuppResponse.supportedNotificationTypes;\n\t\t\tconst supportedNotificationNames = supportedNotificationTypes.map(\n\t\t\t\tgetNotificationName,\n\t\t\t);\n\t\t\tconst supportedNotificationEvents = new Map<\n\t\t\t\tnumber,\n\t\t\t\treadonly number[]\n\t\t\t>();\n\n\t\t\tconst logMessage = `received supported notification types:${\n\t\t\t\tsupportedNotificationNames\n\t\t\t\t\t.map((name) => `\\n\u00B7 ${name}`)\n\t\t\t\t\t.join(\"\")\n\t\t\t}`;\n\t\t\tctx.logNode(node.id, {\n\t\t\t\tendpoint: this.endpointIndex,\n\t\t\t\tmessage: logMessage,\n\t\t\t\tdirection: \"inbound\",\n\t\t\t});\n\n\t\t\tif (api.version >= 3) {\n\t\t\t\t// Query each notification for its supported events\n\t\t\t\tfor (let i = 0; i < supportedNotificationTypes.length; i++) {\n\t\t\t\t\tconst type = supportedNotificationTypes[i];\n\t\t\t\t\tconst name = supportedNotificationNames[i];\n\n\t\t\t\t\tctx.logNode(node.id, {\n\t\t\t\t\t\tendpoint: this.endpointIndex,\n\t\t\t\t\t\tmessage:\n\t\t\t\t\t\t\t`querying supported notification events for ${name}...`,\n\t\t\t\t\t\tdirection: \"outbound\",\n\t\t\t\t\t});\n\t\t\t\t\tconst supportedEvents = await api.getSupportedEvents(type);\n\t\t\t\t\tif (supportedEvents) {\n\t\t\t\t\t\tsupportedNotificationEvents.set(type, supportedEvents);\n\t\t\t\t\t\tctx.logNode(node.id, {\n\t\t\t\t\t\t\tendpoint: this.endpointIndex,\n\t\t\t\t\t\t\tmessage:\n\t\t\t\t\t\t\t\t`received supported notification events for ${name}: ${\n\t\t\t\t\t\t\t\t\tsupportedEvents\n\t\t\t\t\t\t\t\t\t\t.map(String)\n\t\t\t\t\t\t\t\t\t\t.join(\", \")\n\t\t\t\t\t\t\t\t}`,\n\t\t\t\t\t\t\tdirection: \"inbound\",\n\t\t\t\t\t\t});\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// Determine whether the node is a push or pull node\n\t\t\tlet notificationMode = this.getValue<\"push\" | \"pull\">(\n\t\t\t\tctx,\n\t\t\t\tNotificationCCValues.notificationMode,\n\t\t\t);\n\t\t\tif (notificationMode !== \"push\" && notificationMode !== \"pull\") {\n\t\t\t\tnotificationMode = await this.determineNotificationMode(\n\t\t\t\t\tctx,\n\t\t\t\t\tapi,\n\t\t\t\t\tsupportedNotificationEvents,\n\t\t\t\t);\n\t\t\t\tthis.setValue(\n\t\t\t\t\tctx,\n\t\t\t\t\tNotificationCCValues.notificationMode,\n\t\t\t\t\tnotificationMode,\n\t\t\t\t);\n\t\t\t}\n\n\t\t\tif (notificationMode === \"pull\") {\n\t\t\t\tawait this.refreshValues(ctx);\n\t\t\t} /* if (notificationMode === \"push\") */ else {\n\t\t\t\tfor (let i = 0; i < supportedNotificationTypes.length; i++) {\n\t\t\t\t\tconst type = supportedNotificationTypes[i];\n\t\t\t\t\tconst name = supportedNotificationNames[i];\n\t\t\t\t\tconst notification = getNotification(type);\n\n\t\t\t\t\t// Enable reports for each notification type\n\t\t\t\t\tctx.logNode(node.id, {\n\t\t\t\t\t\tendpoint: this.endpointIndex,\n\t\t\t\t\t\tmessage: `enabling notifications for ${name}...`,\n\t\t\t\t\t\tdirection: \"outbound\",\n\t\t\t\t\t});\n\t\t\t\t\tawait api.set(type, true);\n\n\t\t\t\t\t// Set the value to idle if possible and there is no value yet\n\t\t\t\t\tif (notification) {\n\t\t\t\t\t\tconst events = supportedNotificationEvents.get(type);\n\t\t\t\t\t\tif (events) {\n\t\t\t\t\t\t\t// Find all variables that are supported by this node and have an idle state\n\t\t\t\t\t\t\tfor (\n\t\t\t\t\t\t\t\tconst variable of notification.variables\n\t\t\t\t\t\t\t\t\t.filter((v) => !!v.idle)\n\t\t\t\t\t\t\t) {\n\t\t\t\t\t\t\t\tif (\n\t\t\t\t\t\t\t\t\t[...variable.states.keys()].some((key) =>\n\t\t\t\t\t\t\t\t\t\tevents.includes(key)\n\t\t\t\t\t\t\t\t\t)\n\t\t\t\t\t\t\t\t) {\n\t\t\t\t\t\t\t\t\tconst value = NotificationCCValues\n\t\t\t\t\t\t\t\t\t\t.notificationVariable(\n\t\t\t\t\t\t\t\t\t\t\tnotification.name,\n\t\t\t\t\t\t\t\t\t\t\tvariable.name,\n\t\t\t\t\t\t\t\t\t\t);\n\n\t\t\t\t\t\t\t\t\t// Set the value to idle if it has no value yet\n\t\t\t\t\t\t\t\t\t// TODO: GH#1028\n\t\t\t\t\t\t\t\t\t// * do this only if the last update was more than 5 minutes ago\n\t\t\t\t\t\t\t\t\t// * schedule an auto-idle if the last update was less than 5 minutes ago but before the current applHost start\n\t\t\t\t\t\t\t\t\tif (\n\t\t\t\t\t\t\t\t\t\tthis.getValue(ctx, value)\n\t\t\t\t\t\t\t\t\t\t\t== undefined\n\t\t\t\t\t\t\t\t\t) {\n\t\t\t\t\t\t\t\t\t\tthis.setValue(\n\t\t\t\t\t\t\t\t\t\t\tctx,\n\t\t\t\t\t\t\t\t\t\t\tvalue,\n\t\t\t\t\t\t\t\t\t\t\t0, /* idle */\n\t\t\t\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t// Only create metadata for V1 values if necessary\n\t\tif (api.version === 1 || supportsV1Alarm) {\n\t\t\tthis.ensureMetadata(ctx, NotificationCCValues.alarmType);\n\t\t\tthis.ensureMetadata(ctx, NotificationCCValues.alarmLevel);\n\t\t}\n\n\t\t// Also create metadata for values mapped through compat config\n\t\tconst mappings = ctx.getDeviceConfig?.(this.nodeId as number)\n\t\t\t?.compat?.alarmMapping;\n\t\tif (mappings) {\n\t\t\t// Find all mappings to a valid notification variable\n\t\t\tconst supportedNotifications = new Map<number, Set<number>>();\n\t\t\tfor (const { to } of mappings) {\n\t\t\t\tconst notification = getNotification(to.notificationType);\n\t\t\t\tif (!notification) continue;\n\t\t\t\tconst valueConfig = getNotificationValue(\n\t\t\t\t\tnotification,\n\t\t\t\t\tto.notificationEvent,\n\t\t\t\t);\n\n\t\t\t\t// Remember supported notification types and events to create the internal values later\n\t\t\t\tif (!supportedNotifications.has(to.notificationType)) {\n\t\t\t\t\tsupportedNotifications.set(\n\t\t\t\t\t\tto.notificationType,\n\t\t\t\t\t\tnew Set(),\n\t\t\t\t\t);\n\t\t\t\t}\n\t\t\t\tconst supportedNotificationTypesSet = supportedNotifications\n\t\t\t\t\t.get(to.notificationType)!;\n\t\t\t\tsupportedNotificationTypesSet.add(to.notificationEvent);\n\n\t\t\t\tif (valueConfig?.type !== \"state\") continue;\n\n\t\t\t\tconst notificationValue = NotificationCCValues\n\t\t\t\t\t.notificationVariable(\n\t\t\t\t\t\tnotification.name,\n\t\t\t\t\t\tvalueConfig.variableName,\n\t\t\t\t\t);\n\n\t\t\t\t// Create or update the metadata\n\t\t\t\tconst metadata = getNotificationValueMetadata(\n\t\t\t\t\tthis.getMetadata(ctx, notificationValue),\n\t\t\t\t\tnotification,\n\t\t\t\t\tvalueConfig,\n\t\t\t\t);\n\t\t\t\tthis.setMetadata(ctx, notificationValue, metadata);\n\n\t\t\t\t// Set the value to idle if it has no value yet\n\t\t\t\tif (valueConfig.idle) {\n\t\t\t\t\t// TODO: GH#1028\n\t\t\t\t\t// * do this only if the last update was more than 5 minutes ago\n\t\t\t\t\t// * schedule an auto-idle if the last update was less than 5 minutes ago but before the current applHost start\n\t\t\t\t\tif (\n\t\t\t\t\t\tthis.getValue(ctx, notificationValue) == undefined\n\t\t\t\t\t) {\n\t\t\t\t\t\tthis.setValue(\n\t\t\t\t\t\t\tctx,\n\t\t\t\t\t\t\tnotificationValue,\n\t\t\t\t\t\t\t0, /* idle */\n\t\t\t\t\t\t);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// Remember supported notification types and events in the cache\n\t\t\tthis.setValue(\n\t\t\t\tctx,\n\t\t\t\tNotificationCCValues.supportedNotificationTypes,\n\t\t\t\t[...supportedNotifications.keys()],\n\t\t\t);\n\t\t\tfor (const [type, events] of supportedNotifications) {\n\t\t\t\tthis.setValue(\n\t\t\t\t\tctx,\n\t\t\t\t\tNotificationCCValues.supportedNotificationEvents(type),\n\t\t\t\t\t[...events],\n\t\t\t\t);\n\t\t\t}\n\t\t}\n\n\t\t// Remember that the interview is complete\n\t\tthis.setInterviewComplete(ctx, true);\n\t}\n\n\tpublic async refreshValues(\n\t\tctx: RefreshValuesContext,\n\t): Promise<void> {\n\t\tconst node = this.getNode(ctx)!;\n\t\t// Refreshing values only works on pull nodes\n\t\tif (NotificationCC.getNotificationMode(ctx, node) === \"pull\") {\n\t\t\tconst endpoint = this.getEndpoint(ctx)!;\n\t\t\tconst api = CCAPI.create(\n\t\t\t\tCommandClasses.Notification,\n\t\t\t\tctx,\n\t\t\t\tendpoint,\n\t\t\t).withOptions({\n\t\t\t\tpriority: MessagePriority.NodeQuery,\n\t\t\t});\n\n\t\t\t// Load supported notification types and events from cache\n\t\t\tconst supportedNotificationTypes = this.getValue<readonly number[]>(\n\t\t\t\tctx,\n\t\t\t\tNotificationCCValues.supportedNotificationTypes,\n\t\t\t) ?? [];\n\t\t\tconst supportedNotificationNames = supportedNotificationTypes.map(\n\t\t\t\tgetNotificationName,\n\t\t\t);\n\n\t\t\tfor (let i = 0; i < supportedNotificationTypes.length; i++) {\n\t\t\t\tconst type = supportedNotificationTypes[i];\n\t\t\t\tconst name = supportedNotificationNames[i];\n\n\t\t\t\t// Always query each notification for its current status\n\t\t\t\tctx.logNode(node.id, {\n\t\t\t\t\tendpoint: this.endpointIndex,\n\t\t\t\t\tmessage: `querying notification status for ${name}...`,\n\t\t\t\t\tdirection: \"outbound\",\n\t\t\t\t});\n\t\t\t\tconst response = await api.getInternal({\n\t\t\t\t\tnotificationType: type,\n\t\t\t\t});\n\t\t\t\t// NotificationReports don't store their values themselves,\n\t\t\t\t// because the behaviour is too complex and spans the lifetime\n\t\t\t\t// of several reports. Thus we handle it in the Node instance\n\n\t\t\t\t// @ts-expect-error\n\t\t\t\tif (response) await node.handleCommand(response);\n\t\t\t}\n\n\t\t\t// Remember when we did this\n\t\t\tthis.setValue(\n\t\t\t\tctx,\n\t\t\t\tNotificationCCValues.lastRefresh,\n\t\t\t\tDate.now(),\n\t\t\t);\n\t\t}\n\t}\n\n\tpublic shouldRefreshValues(\n\t\tthis: SinglecastCC<this>,\n\t\tctx:\n\t\t\t& GetValueDB\n\t\t\t& GetSupportedCCVersion\n\t\t\t& GetDeviceConfig\n\t\t\t& GetNode<\n\t\t\t\tNodeId & GetEndpoint<EndpointId & SupportsCC & ControlsCC>\n\t\t\t>,\n\t): boolean {\n\t\t// Pull-mode nodes must be polled regularly\n\n\t\tconst isPullMode = NotificationCC.getNotificationMode(\n\t\t\tctx,\n\t\t\tthis.getNode(ctx)!,\n\t\t) === \"pull\";\n\t\tif (!isPullMode) return false;\n\n\t\tconst lastUpdated = this.getValue<number>(\n\t\t\tctx,\n\t\t\tNotificationCCValues.lastRefresh,\n\t\t);\n\n\t\treturn (\n\t\t\tlastUpdated == undefined\n\t\t\t|| Date.now() - lastUpdated > timespan.hours(6)\n\t\t);\n\t}\n}\n\n// @publicAPI\nexport interface NotificationCCSetOptions {\n\tnotificationType: number;\n\tnotificationStatus: boolean;\n}\n\n@CCCommand(NotificationCommand.Set)\n@useSupervision()\nexport class NotificationCCSet extends NotificationCC {\n\tpublic constructor(\n\t\toptions: WithAddress<NotificationCCSetOptions>,\n\t) {\n\t\tsuper(options);\n\t\tthis.notificationType = options.notificationType;\n\t\tthis.notificationStatus = options.notificationStatus;\n\t}\n\n\tpublic static from(raw: CCRaw, ctx: CCParsingContext): NotificationCCSet {\n\t\tvalidatePayload(raw.payload.length >= 2);\n\t\tconst notificationType = raw.payload[0];\n\t\tconst notificationStatus = raw.payload[1] === 0xff;\n\n\t\treturn new this({\n\t\t\tnodeId: ctx.sourceNodeId,\n\t\t\tnotificationType,\n\t\t\tnotificationStatus,\n\t\t});\n\t}\n\n\tpublic notificationType: number;\n\tpublic notificationStatus: boolean;\n\n\tpublic serialize(ctx: CCEncodingContext): Promise<Bytes> {\n\t\tthis.payload = Bytes.from([\n\t\t\tthis.notificationType,\n\t\t\tthis.notificationStatus ? 0xff : 0x00,\n\t\t]);\n\t\treturn super.serialize(ctx);\n\t}\n\n\tpublic toLogEntry(ctx?: GetValueDB): MessageOrCCLogEntry {\n\t\treturn {\n\t\t\t...super.toLogEntry(ctx),\n\t\t\tmessage: {\n\t\t\t\t\"notification type\": getNotificationName(this.notificationType),\n\t\t\t\tstatus: this.notificationStatus,\n\t\t\t},\n\t\t};\n\t}\n}\n\n// @publicAPI\nexport type NotificationCCReportOptions = {\n\talarmType?: number;\n\talarmLevel?: number;\n\tnotificationType?: number;\n\tnotificationEvent?: number;\n\tnotificationStatus?: number;\n\teventParameters?: Uint8Array;\n\tsequenceNumber?: number;\n};\n\n@CCCommand(NotificationCommand.Report)\n@useSupervision()\nexport class NotificationCCReport extends NotificationCC {\n\tpublic constructor(\n\t\toptions: WithAddress<NotificationCCReportOptions>,\n\t) {\n\t\tsuper(options);\n\n\t\tif (options.alarmType != undefined) {\n\t\t\tthis.alarmType = options.alarmType;\n\t\t\tthis.alarmLevel = options.alarmLevel;\n\t\t}\n\n\t\tif (options.notificationType != undefined) {\n\t\t\tthis.notificationType = options.notificationType;\n\t\t\tthis.notificationStatus = options.notificationStatus ?? true;\n\t\t\tthis.notificationEvent = options.notificationEvent;\n\t\t\tthis.eventParameters = options.eventParameters;\n\t\t\tthis.sequenceNumber = options.sequenceNumber;\n\t\t}\n\t}\n\n\tpublic static from(\n\t\traw: CCRaw,\n\t\tctx: CCParsingContext,\n\t): NotificationCCReport {\n\t\tvalidatePayload(raw.payload.length >= 2);\n\t\tconst alarmType = raw.payload[0];\n\t\tconst alarmLevel = raw.payload[1];\n\n\t\t// Byte 2 used to be zensorNetSourceNodeId in V2 and V3, but we don't care about that\n\n\t\tif (raw.payload.length < 7) {\n\t\t\treturn new this({\n\t\t\t\tnodeId: ctx.sourceNodeId,\n\t\t\t\talarmType,\n\t\t\t\talarmLevel,\n\t\t\t});\n\t\t}\n\n\t\t// V2+ requires the alarm bytes to be zero. Manufacturers don't care though, so we don't enforce that.\n\t\t// Don't use the version to decide because we might discard notifications\n\t\t// before the interview is complete\n\n\t\tconst notificationStatus = raw.payload[3];\n\t\tconst notificationType = raw.payload[4];\n\t\tconst notificationEvent = raw.payload[5];\n\n\t\tconst containsSeqNum = !!(raw.payload[6] & 0b1000_0000);\n\t\tconst numEventParams = raw.payload[6] & 0b11111;\n\t\tlet eventParameters: Uint8Array | undefined;\n\t\tif (numEventParams > 0) {\n\t\t\tvalidatePayload(raw.payload.length >= 7 + numEventParams);\n\t\t\teventParameters = raw.payload.subarray(7, 7 + numEventParams);\n\t\t}\n\t\tlet sequenceNumber: number | undefined;\n\t\tif (containsSeqNum) {\n\t\t\tvalidatePayload(\n\t\t\t\traw.payload.length >= 7 + numEventParams + 1,\n\t\t\t);\n\t\t\tsequenceNumber = raw.payload[7 + numEventParams];\n\t\t}\n\n\t\treturn new this({\n\t\t\tnodeId: ctx.sourceNodeId,\n\t\t\talarmType,\n\t\t\talarmLevel,\n\t\t\tnotificationStatus,\n\t\t\tnotificationType,\n\t\t\tnotificationEvent,\n\t\t\teventParameters,\n\t\t\tsequenceNumber,\n\t\t});\n\t}\n\n\tpublic persistValues(ctx: PersistValuesContext): boolean {\n\t\tif (!super.persistValues(ctx)) return false;\n\n\t\tconst ccVersion = getEffectiveCCVersion(ctx, this);\n\n\t\t// Check if we need to re-interpret the alarm values somehow\n\t\tif (\n\t\t\tthis.alarmType != undefined\n\t\t\t&& this.alarmLevel != undefined\n\t\t\t&& this.alarmType !== 0\n\t\t) {\n\t\t\tif (ccVersion >= 2) {\n\t\t\t\t// Check if the device actually supports Notification CC, but chooses\n\t\t\t\t// to send Alarm frames instead (GH#1034)\n\t\t\t\tconst supportedNotificationTypes = this.getValue<\n\t\t\t\t\treadonly number[]\n\t\t\t\t>(ctx, NotificationCCValues.supportedNotificationTypes);\n\t\t\t\tif (\n\t\t\t\t\tisArray(supportedNotificationTypes)\n\t\t\t\t\t&& supportedNotificationTypes.includes(this.alarmType)\n\t\t\t\t) {\n\t\t\t\t\tconst supportedNotificationEvents = this.getValue<\n\t\t\t\t\t\treadonly number[]\n\t\t\t\t\t>(\n\t\t\t\t\t\tctx,\n\t\t\t\t\t\tNotificationCCValues.supportedNotificationEvents(\n\t\t\t\t\t\t\tthis.alarmType,\n\t\t\t\t\t\t),\n\t\t\t\t\t);\n\t\t\t\t\tif (\n\t\t\t\t\t\tisArray(supportedNotificationEvents)\n\t\t\t\t\t\t&& supportedNotificationEvents.includes(this.alarmLevel)\n\t\t\t\t\t) {\n\t\t\t\t\t\t// This alarm frame corresponds to a valid notification event\n\t\t\t\t\t\tctx.logNode(\n\t\t\t\t\t\t\tthis.nodeId as number,\n\t\t\t\t\t\t\t`treating V1 Alarm frame as Notification Report`,\n\t\t\t\t\t\t);\n\t\t\t\t\t\tthis.notificationType = this.alarmType;\n\t\t\t\t\t\tthis.notificationEvent = this.alarmLevel;\n\t\t\t\t\t\tthis.alarmType = undefined;\n\t\t\t\t\t\tthis.alarmLevel = undefined;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\t// V1 Alarm, check if there is a compat option to map this V1 report to a V2+ report\n\t\t\t\tconst mapping = ctx.getDeviceConfig?.(\n\t\t\t\t\tthis.nodeId as number,\n\t\t\t\t)?.compat?.alarmMapping;\n\t\t\t\tconst match = mapping?.find(\n\t\t\t\t\t(m) =>\n\t\t\t\t\t\tm.from.alarmType === this.alarmType\n\t\t\t\t\t\t&& (m.from.alarmLevel == undefined\n\t\t\t\t\t\t\t|| m.from.alarmLevel === this.alarmLevel),\n\t\t\t\t);\n\t\t\t\tif (match) {\n\t\t\t\t\tctx.logNode(\n\t\t\t\t\t\tthis.nodeId as number,\n\t\t\t\t\t\t`compat mapping found, treating V1 Alarm frame as Notification Report`,\n\t\t\t\t\t);\n\t\t\t\t\tthis.notificationType = match.to.notificationType;\n\t\t\t\t\tthis.notificationEvent = match.to.notificationEvent;\n\t\t\t\t\tif (match.to.eventParameters) {\n\t\t\t\t\t\tthis.eventParameters = {};\n\t\t\t\t\t\tfor (\n\t\t\t\t\t\t\tconst [key, val] of Object.entries(\n\t\t\t\t\t\t\t\tmatch.to.eventParameters,\n\t\t\t\t\t\t\t)\n\t\t\t\t\t\t) {\n\t\t\t\t\t\t\tif (typeof val === \"number\") {\n\t\t\t\t\t\t\t\tthis.eventParameters[key] = val;\n\t\t\t\t\t\t\t} else if (val === \"alarmLevel\") {\n\t\t\t\t\t\t\t\tthis.eventParameters[key] = this.alarmLevel;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\t// After mapping we do not set the legacy V1 values to undefined\n\t\t\t\t\t// Otherwise, adding a new mapping will be a breaking change\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t// Now we can interpret the event parameters and turn them into something useful\n\t\tthis.parseEventParameters(ctx);\n\n\t\tif (this.alarmType != undefined) {\n\t\t\tconst alarmTypeValue = NotificationCCValues.alarmType;\n\t\t\tthis.ensureMetadata(ctx, alarmTypeValue);\n\t\t\tthis.setValue(ctx, alarmTypeValue, this.alarmType);\n\t\t}\n\t\tif (this.alarmLevel != undefined) {\n\t\t\tconst alarmLevelValue = NotificationCCValues.alarmLevel;\n\t\t\tthis.ensureMetadata(ctx, alarmLevelValue);\n\t\t\tthis.setValue(ctx, alarmLevelValue, this.alarmLevel);\n\t\t}\n\n\t\treturn true;\n\t}\n\n\tpublic alarmType: number | undefined;\n\tpublic alarmLevel: number | undefined;\n\n\tpublic notificationType: number | undefined;\n\tpublic notificationStatus: boolean | number | undefined;\n\tpublic notificationEvent: number | undefined;\n\n\tpublic eventParameters:\n\t\t| Uint8Array\n\t\t| Duration\n\t\t| Record<string, number>\n\t\t| number\n\t\t| undefined;\n\n\tpublic sequenceNumber: number | undefined;\n\n\tpublic toLogEntry(ctx?: GetValueDB): MessageOrCCLogEntry {\n\t\tlet message: MessageRecord = {};\n\t\tif (this.alarmType) {\n\t\t\tmessage = {\n\t\t\t\t\"V1 alarm type\": this.alarmType,\n\t\t\t\t\"V1 alarm level\": this.alarmLevel!,\n\t\t\t};\n\t\t}\n\n\t\tlet valueConfig: NotificationValue | undefined;\n\t\tif (this.notificationType) {\n\t\t\tconst notification = getNotification(this.notificationType);\n\t\t\tif (notification) {\n\t\t\t\tvalueConfig = getNotificationValue(\n\t\t\t\t\tnotification,\n\t\t\t\t\tthis.notificationEvent!,\n\t\t\t\t);\n\t\t\t}\n\t\t\tif (valueConfig) {\n\t\t\t\tmessage = {\n\t\t\t\t\t...message,\n\t\t\t\t\t\"notification type\": getNotificationName(\n\t\t\t\t\t\tthis.notificationType,\n\t\t\t\t\t),\n\t\t\t\t\t\"notification status\": this.notificationStatus!,\n\t\t\t\t\t[`notification ${valueConfig.type}`]: valueConfig.label\n\t\t\t\t\t\t?? `Unknown (${num2hex(this.notificationEvent)})`,\n\t\t\t\t};\n\t\t\t} else if (this.notificationEvent === 0x00) {\n\t\t\t\tmessage = {\n\t\t\t\t\t...message,\n\t\t\t\t\t\"notification type\": this.notificationType,\n\t\t\t\t\t\"notification status\": this.notificationStatus!,\n\t\t\t\t\t\"notification state\": \"idle\",\n\t\t\t\t};\n\t\t\t} else {\n\t\t\t\tmessage = {\n\t\t\t\t\t...message,\n\t\t\t\t\t\"notification type\": this.notificationType,\n\t\t\t\t\t\"notification status\": this.notificationStatus!,\n\t\t\t\t\t\"notification event\": num2hex(this.notificationEvent),\n\t\t\t\t};\n\t\t\t}\n\t\t}\n\t\tif (this.sequenceNumber != undefined) {\n\t\t\tmessage[\"sequence number\"] = this.sequenceNumber;\n\t\t}\n\t\tif (this.eventParameters != undefined) {\n\t\t\tif (typeof this.eventParameters === \"number\") {\n\t\t\t\t// Try to look up the enum label\n\t\t\t\tlet found = false;\n\t\t\t\tif (\n\t\t\t\t\tvalueConfig?.parameter?.type === \"enum\"\n\t\t\t\t) {\n\t\t\t\t\tconst label =\n\t\t\t\t\t\tvalueConfig.parameter.values[this.eventParameters];\n\t\t\t\t\tif (label) {\n\t\t\t\t\t\tmessage[\"state parameters\"] = label;\n\t\t\t\t\t\tfound = true;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tif (!found) {\n\t\t\t\t\tmessage[\"state parameters\"] = num2hex(this.eventParameters);\n\t\t\t\t}\n\t\t\t} else if (isUint8Array(this.eventParameters)) {\n\t\t\t\tmessage[\"event parameters\"] = buffer2hex(this.eventParameters);\n\t\t\t} else if (Duration.isDuration(this.eventParameters)) {\n\t\t\t\tmessage[\"event parameters\"] = this.eventParameters.toString();\n\t\t\t} else {\n\t\t\t\tmessage[\"event parameters\"] = Object.entries(\n\t\t\t\t\tthis.eventParameters,\n\t\t\t\t)\n\t\t\t\t\t.map(([param, val]) => `\\n ${param}: ${num2hex(val)}`)\n\t\t\t\t\t.join(\"\");\n\t\t\t}\n\t\t} else if (\n\t\t\tvalueConfig?.parameter?.type === \"enum\"\n\t\t\t&& valueConfig.parameter.default != undefined\n\t\t) {\n\t\t\tconst label = valueConfig.parameter.values[\n\t\t\t\tvalueConfig.parameter.default\n\t\t\t];\n\t\t\tif (label) {\n\t\t\t\tmessage[\"state parameters\"] = `${label} (omitted)`;\n\t\t\t}\n\t\t}\n\t\treturn {\n\t\t\t...super.toLogEntry(ctx),\n\t\t\tmessage,\n\t\t};\n\t}\n\n\tprivate parseEventParameters(ctx: PersistValuesContext): void {\n\t\t// This only makes sense for V2+ notifications\n\t\tif (\n\t\t\tthis.notificationType == undefined\n\t\t\t|| this.notificationEvent == undefined\n\t\t) {\n\t\t\treturn;\n\t\t}\n\n\t\t// Look up the received notification and value in the config\n\t\tconst notification = getNotification(this.notificationType);\n\t\tif (!notification) return;\n\t\tconst valueConfig = getNotificationValue(\n\t\t\tnotification,\n\t\t\tthis.notificationEvent,\n\t\t);\n\t\tif (!valueConfig) return;\n\n\t\t// Parse the event parameters if possible\n\t\tif (valueConfig.parameter?.type === \"duration\") {\n\t\t\t// This only makes sense if the event parameters are a buffer\n\t\t\tif (!isUint8Array(this.eventParameters)) {\n\t\t\t\treturn;\n\t\t\t}\n\t\t\t// The parameters contain a Duration\n\t\t\tthis.eventParameters = Duration.parseReport(\n\t\t\t\tthis.eventParameters[0],\n\t\t\t);\n\t\t} else if (valueConfig.parameter?.type === \"commandclass\") {\n\t\t\t// This only makes sense if the event parameters are a buffer\n\t\t\tif (!isUint8Array(this.eventParameters)) {\n\t\t\t\treturn;\n\t\t\t}\n\t\t\t// The parameters **should** contain a CC, however there might be some exceptions\n\t\t\tif (\n\t\t\t\tthis.eventParameters.length === 1\n\t\t\t\t&& notification.type === 0x06\n\t\t\t\t&& (this.notificationEvent === 0x05\n\t\t\t\t\t|| this.notificationEvent === 0x06)\n\t\t\t) {\n\t\t\t\t// Access control -> Keypad Lock/Unlock operation\n\t\t\t\t// Some devices only send the User ID, not a complete CC payload\n\t\t\t\tthis.eventParameters = {\n\t\t\t\t\tuserId: this.eventParameters[0],\n\t\t\t\t};\n\t\t\t} else {\n\t\t\t\t// Try to parse the event parameters - if this fails, we should still handle the notification report\n\t\t\t\ttry {\n\t\t\t\t\t// Convert CommandClass instances to a standardized object representation\n\n\t\t\t\t\t// We do not want to parse asynchronously here, but the `CommandClass.parse` method is async.\n\t\t\t\t\t// However, we only deal with simple CCs that can be parsed synchronously. We can do this\n\t\t\t\t\t// by replicating what `CommandClass.parse` does: determine the correct CC class and call its\n\t\t\t\t\t// `from` method. If that returns a CC instance, we're good to continue.\n\n\t\t\t\t\tconst raw = CCRaw.parse(this.eventParameters);\n\t\t\t\t\tif (raw.ccCommand == undefined) {\n\t\t\t\t\t\tvalidatePayload.fail(\n\t\t\t\t\t\t\t\"event parameters contain an invalid CC\",\n\t\t\t\t\t\t);\n\t\t\t\t\t}\n\t\t\t\t\tconst CommandConstructor = getCCCommandConstructor(\n\t\t\t\t\t\traw.ccId,\n\t\t\t\t\t\traw.ccCommand,\n\t\t\t\t\t);\n\t\t\t\t\tif (!CommandConstructor) {\n\t\t\t\t\t\tvalidatePayload.fail(\n\t\t\t\t\t\t\t\"event parameters contain an invalid CC\",\n\t\t\t\t\t\t);\n\t\t\t\t\t}\n\n\t\t\t\t\tconst cc = CommandConstructor.from(raw, {\n\t\t\t\t\t\t...ctx,\n\t\t\t\t\t\tframeType: \"singlecast\",\n\t\t\t\t\t\tsourceNodeId: this.nodeId as number,\n\t\t\t\t\t\t// Security encapsulation is handled outside of this CC,\n\t\t\t\t\t\t// so it is not needed here:\n\t\t\t\t\t\thasSecurityClass: () => false,\n\t\t\t\t\t\tgetHighestSecurityClass: () => SecurityClass.None,\n\t\t\t\t\t\tsetSecurityClass: () => {},\n\t\t\t\t\t\tsecurityManager: undefined,\n\t\t\t\t\t\tsecurityManager2: undefined,\n\t\t\t\t\t\tsecurityManagerLR: undefined,\n\t\t\t\t\t});\n\t\t\t\t\tif (cc instanceof Promise) {\n\t\t\t\t\t\tvalidatePayload.fail(\n\t\t\t\t\t\t\t\"Cannot asynchronously parse CC from event parameters\",\n\t\t\t\t\t\t);\n\t\t\t\t\t}\n\t\t\t\t\tvalidatePayload(!(cc instanceof InvalidCC));\n\t\t\t\t\tcc.encapsulatingCC = this as any;\n\n\t\t\t\t\tif (isNotificationEventPayload(cc)) {\n\t\t\t\t\t\tthis.eventParameters = cc\n\t\t\t\t\t\t\t.toNotificationEventParameters();\n\t\t\t\t\t} else {\n\t\t\t\t\t\t// If a CC has no good toJSON() representation, we're only interested in the payload\n\t\t\t\t\t\tlet json = cc.toJSON();\n\t\t\t\t\t\tif (\n\t\t\t\t\t\t\t\"nodeId\" in json\n\t\t\t\t\t\t\t&& \"ccId\" in json\n\t\t\t\t\t\t\t&& \"payload\" in json\n\t\t\t\t\t\t) {\n\t\t\t\t\t\t\tjson = pick(json, [\"payload\"]);\n\t\t\t\t\t\t}\n\t\t\t\t\t\tthis.eventParameters = json;\n\t\t\t\t\t}\n\t\t\t\t} catch (e) {\n\t\t\t\t\tif (\n\t\t\t\t\t\tisZWaveError(e)\n\t\t\t\t\t\t&& e.code\n\t\t\t\t\t\t\t=== ZWaveErrorCodes.PacketFormat_InvalidPayload\n\t\t\t\t\t\t&& isUint8Array(this.eventParameters)\n\t\t\t\t\t) {\n\t\t\t\t\t\tconst { ccId, ccCommand } = CCRaw.parse(\n\t\t\t\t\t\t\tthis.eventParameters,\n\t\t\t\t\t\t);\n\t\t\t\t\t\tif (\n\t\t\t\t\t\t\tccId === CommandClasses[\"User Code\"]\n\t\t\t\t\t\t\t&& ccCommand === UserCodeCommand.Report\n\t\t\t\t\t\t\t&& this.eventParameters.length >= 3\n\t\t\t\t\t\t) {\n\t\t\t\t\t\t\t// Access control -> Keypad Lock/Unlock operation\n\t\t\t\t\t\t\t// Some devices report the user code with truncated UserCode reports\n\t\t\t\t\t\t\tthis.eventParameters = {\n\t\t\t\t\t\t\t\tuserId: this.eventParameters[2],\n\t\t\t\t\t\t\t};\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tctx.logNode(\n\t\t\t\t\t\t\t\tthis.nodeId as number,\n\t\t\t\t\t\t\t\t`Failed to parse Notification CC event parameters, ignoring them...`,\n\t\t\t\t\t\t\t\t\"error\",\n\t\t\t\t\t\t\t);\n\t\t\t\t\t\t}\n\t\t\t\t\t} else {\n\t\t\t\t\t\t// unexpected error\n\t\t\t\t\t\tthrow e;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t} else if (valueConfig.parameter?.type === \"value\") {\n\t\t\t// This only makes sense if the event parameters are a buffer\n\t\t\tif (!isUint8Array(this.eventParameters)) {\n\t\t\t\treturn;\n\t\t\t}\n\t\t\t// The parameters contain a named value\n\t\t\tthis.eventParameters = {\n\t\t\t\t[valueConfig.parameter.propertyName]: Bytes.view(\n\t\t\t\t\tthis.eventParameters,\n\t\t\t\t)\n\t\t\t\t\t.readUIntBE(\n\t\t\t\t\t\t0,\n\t\t\t\t\t\tthis.eventParameters.length,\n\t\t\t\t\t),\n\t\t\t};\n\t\t} else if (valueConfig.parameter?.type === \"enum\") {\n\t\t\t// The parameters may contain an enum value\n\t\t\tthis.eventParameters = isUint8Array(this.eventParameters)\n\t\t\t\t\t&& this.eventParameters.length === 1\n\t\t\t\t? this.eventParameters[0]\n\t\t\t\t: undefined;\n\n\t\t\t// Some devices send notifications without an event parameter when they should.\n\t\t\t// In this case, fall back to the default value where possible.\n\n\t\t\tif (\n\t\t\t\tthis.eventParameters == undefined\n\t\t\t\t&& valueConfig.parameter.default != undefined\n\t\t\t) {\n\t\t\t\tthis.eventParameters = valueConfig.parameter.default;\n\t\t\t}\n\t\t}\n\t}\n\n\tpublic serialize(ctx: CCEncodingContext): Promise<Bytes> {\n\t\tif (this.notificationType != undefined) {\n\t\t\tif (\n\t\t\t\tthis.notificationEvent == undefined\n\t\t\t) {\n\t\t\t\tthrow new ZWaveError(\n\t\t\t\t\t`Notification CC reports requires the notification event to be set!`,\n\t\t\t\t\tZWaveErrorCodes.Argument_Invalid,\n\t\t\t\t);\n\t\t\t} else if (\n\t\t\t\tthis.eventParameters != undefined\n\t\t\t\t&& !isUint8Array(this.eventParameters)\n\t\t\t) {\n\t\t\t\tthrow new ZWaveError(\n\t\t\t\t\t`When sending Notification CC reports, the event parameters can only be buffers!`,\n\t\t\t\t\tZWaveErrorCodes.Argument_Invalid,\n\t\t\t\t);\n\t\t\t}\n\n\t\t\tconst controlByte =\n\t\t\t\t(this.sequenceNumber != undefined ? 0b1000_0000 : 0)\n\t\t\t\t| ((this.eventParameters?.length ?? 0) & 0b11111);\n\t\t\tthis.payload = Bytes.from([\n\t\t\t\t0,\n\t\t\t\t0,\n\t\t\t\t0,\n\t\t\t\t0xff,\n\t\t\t\tthis.notificationType,\n\t\t\t\tthis.notificationEvent,\n\t\t\t\tcontrolByte,\n\t\t\t]);\n\t\t\tif (this.eventParameters) {\n\t\t\t\tthis.payload = Bytes.concat([\n\t\t\t\t\tthis.payload,\n\t\t\t\t\tthis.eventParameters,\n\t\t\t\t]);\n\t\t\t}\n\t\t\tif (this.sequenceNumber != undefined) {\n\t\t\t\tthis.payload = Bytes.concat([\n\t\t\t\t\tthis.payload,\n\t\t\t\t\tBytes.from([this.sequenceNumber]),\n\t\t\t\t]);\n\t\t\t}\n\t\t} else {\n\t\t\tthis.payload = Bytes.from([\n\t\t\t\tthis.alarmType ?? 0x00,\n\t\t\t\tthis.alarmLevel ?? 0x00,\n\t\t\t]);\n\t\t}\n\n\t\treturn super.serialize(ctx);\n\t}\n}\n\n// @publicAPI\nexport type NotificationCCGetOptions =\n\t| {\n\t\talarmType: number;\n\t}\n\t| {\n\t\tnotificationType: number;\n\t\tnotificationEvent?: number;\n\t};\n\n@CCCommand(NotificationCommand.Get)\n@expectedCCResponse(NotificationCCReport)\nexport class NotificationCCGet extends NotificationCC {\n\tpublic constructor(\n\t\toptions: WithAddress<NotificationCCGetOptions>,\n\t) {\n\t\tsuper(options);\n\t\tif (\"alarmType\" in options) {\n\t\t\tthis.alarmType = options.alarmType;\n\t\t} else {\n\t\t\tthis.notificationType = options.notificationType;\n\t\t\tthis.notificationEvent = options.notificationEvent;\n\t\t}\n\t}\n\n\tpublic static from(raw: CCRaw, ctx: CCParsingContext): NotificationCCGet {\n\t\tvalidatePayload(raw.payload.length >= 1);\n\n\t\tif (raw.payload.length >= 2) {\n\t\t\tconst notificationType = raw.payload[1];\n\t\t\tlet notificationEvent: number | undefined;\n\t\t\tif (raw.payload.length >= 3 && notificationType != 0xff) {\n\t\t\t\tnotificationEvent = raw.payload[2];\n\t\t\t}\n\t\t\treturn new this({\n\t\t\t\tnodeId: ctx.sourceNodeId,\n\t\t\t\tnotificationType,\n\t\t\t\tnotificationEvent,\n\t\t\t});\n\t\t} else {\n\t\t\tconst alarmType = raw.payload[0];\n\t\t\treturn new this({\n\t\t\t\tnodeId: ctx.sourceNodeId,\n\t\t\t\talarmType,\n\t\t\t});\n\t\t}\n\t}\n\n\t/** Proprietary V1/V2 alarm type */\n\tpublic alarmType: number | undefined;\n\t/** Regulated V3+ notification type */\n\tpublic notificationType: number | undefined;\n\tpublic notificationEvent: number | undefined;\n\n\tpublic serialize(ctx: CCEncodingContext): Promise<Bytes> {\n\t\tconst notificationEvent = this.notificationEvent === 0xff\n\t\t\t? 0x00\n\t\t\t: this.notificationEvent;\n\t\tthis.payload = Bytes.from([\n\t\t\tthis.alarmType ?? 0x00,\n\t\t\tthis.notificationType ?? 0xff,\n\t\t\tnotificationEvent ?? 0x00,\n\t\t]);\n\t\treturn super.serialize(ctx);\n\t}\n\n\tpublic toLogEntry(ctx?: GetValueDB): MessageOrCCLogEntry {\n\t\tconst message: MessageRecord = {};\n\t\tif (this.alarmType != undefined) {\n\t\t\tmessage[\"V1 alarm type\"] = this.alarmType;\n\t\t}\n\t\tif (this.notificationType != undefined) {\n\t\t\tmessage[\"notification type\"] = getNotificationName(\n\t\t\t\tthis.notificationType,\n\t\t\t);\n\t\t\tif (this.notificationEvent != undefined) {\n\t\t\t\tmessage[\"notification event\"] = getNotificationEventName(\n\t\t\t\t\tthis.notificationType,\n\t\t\t\t\tthis.notificationEvent,\n\t\t\t\t);\n\t\t\t}\n\t\t}\n\t\treturn {\n\t\t\t...super.toLogEntry(ctx),\n\t\t\tmessage,\n\t\t};\n\t}\n}\n\n// @publicAPI\nexport interface NotificationCCSupportedReportOptions {\n\tsupportsV1Alarm: boolean;\n\tsupportedNotificationTypes: number[];\n}\n\n@CCCommand(NotificationCommand.SupportedReport)\n@ccValueProperty(\"supportsV1Alarm\", NotificationCCValues.supportsV1Alarm)\n@ccValueProperty(\n\t\"supportedNotificationTypes\",\n\tNotificationCCValues.supportedNotificationTypes,\n)\nexport class NotificationCCSupportedReport extends NotificationCC {\n\tpublic constructor(\n\t\toptions: WithAddress<NotificationCCSupportedReportOptions>,\n\t) {\n\t\tsuper(options);\n\n\t\tthis.supportsV1Alarm = options.supportsV1Alarm;\n\t\tthis.supportedNotificationTypes = options.supportedNotificationTypes;\n\t}\n\n\tpublic static from(\n\t\traw: CCRaw,\n\t\tctx: CCParsingContext,\n\t): NotificationCCSupportedReport {\n\t\tvalidatePayload(raw.payload.length >= 1);\n\t\tconst supportsV1Alarm = !!(raw.payload[0] & 0b1000_0000);\n\t\tconst numBitMaskBytes = raw.payload[0] & 0b0001_1111;\n\t\tvalidatePayload(\n\t\t\tnumBitMaskBytes > 0,\n\t\t\traw.payload.length >= 1 + numBitMaskBytes,\n\t\t);\n\t\tconst notificationBitMask = raw.payload.subarray(\n\t\t\t1,\n\t\t\t1 + numBitMaskBytes,\n\t\t);\n\t\tconst supportedNotificationTypes = parseBitMask(\n\t\t\tnotificationBitMask,\n\t\t\t// bit 0 is ignored, but counting still starts at 1, so the first bit must have the value 0\n\t\t\t0,\n\t\t);\n\n\t\treturn new this({\n\t\t\tnodeId: ctx.sourceNodeId,\n\t\t\tsupportsV1Alarm,\n\t\t\tsupportedNotificationTypes,\n\t\t});\n\t}\n\n\tpublic supportsV1Alarm: boolean;\n\n\tpublic supportedNotificationTypes: number[];\n\n\tpublic serialize(ctx: CCEncodingContext): Promise<Bytes> {\n\t\tconst bitMask = encodeBitMask(\n\t\t\tthis.supportedNotificationTypes,\n\t\t\tMath.max(...this.supportedNotificationTypes),\n\t\t\t0,\n\t\t);\n\t\tthis.payload = Bytes.concat([\n\t\t\tBytes.from([\n\t\t\t\t(this.supportsV1Alarm ? 0b1000_0000 : 0) | bitMask.length,\n\t\t\t]),\n\t\t\tbitMask,\n\t\t]);\n\t\treturn super.serialize(ctx);\n\t}\n\n\tpublic toLogEntry(ctx?: GetValueDB): MessageOrCCLogEntry {\n\t\treturn {\n\t\t\t...super.toLogEntry(ctx),\n\t\t\tmessage: {\n\t\t\t\t\"supports V1 alarm\": this.supportsV1Alarm,\n\t\t\t\t\"supported notification types\": this.supportedNotificationTypes\n\t\t\t\t\t.map(\n\t\t\t\t\t\t(t) => `\\n\u00B7 ${getNotificationName(t)}`,\n\t\t\t\t\t)\n\t\t\t\t\t.join(\"\"),\n\t\t\t},\n\t\t};\n\t}\n}\n\n@CCCommand(NotificationCommand.SupportedGet)\n@expectedCCResponse(NotificationCCSupportedReport)\nexport class NotificationCCSupportedGet extends NotificationCC {}\n\n// @publicAPI\nexport interface NotificationCCEventSupportedReportOptions {\n\tnotificationType: number;\n\tsupportedEvents: number[];\n}\n\n@CCCommand(NotificationCommand.EventSupportedReport)\nexport class NotificationCCEventSupportedReport extends NotificationCC {\n\tpublic constructor(\n\t\toptions: WithAddress<NotificationCCEventSupportedReportOptions>,\n\t) {\n\t\tsuper(options);\n\n\t\tthis.notificationType = options.notificationType;\n\t\tthis.supportedEvents = options.supportedEvents;\n\t}\n\n\tpublic static from(\n\t\traw: CCRaw,\n\t\tctx: CCParsingContext,\n\t): NotificationCCEventSupportedReport {\n\t\tvalidatePayload(raw.payload.length >= 1);\n\t\tconst notificationType = raw.payload[0];\n\t\tconst numBitMaskBytes = raw.payload[1] & 0b000_11111;\n\n\t\tif (numBitMaskBytes === 0) {\n\t\t\t// Notification type is not supported\n\t\t\treturn new this({\n\t\t\t\tnodeId: ctx.sourceNodeId,\n\t\t\t\tnotificationType,\n\t\t\t\tsupportedEvents: [],\n\t\t\t});\n\t\t}\n\n\t\tvalidatePayload(raw.payload.length >= 2 + numBitMaskBytes);\n\t\tconst eventBitMask = raw.payload.subarray(2, 2 + numBitMaskBytes);\n\t\tconst supportedEvents = parseBitMask(\n\t\t\teventBitMask,\n\t\t\t// In this mask, bit 0 is ignored, but counting still starts at 1, so the first bit must have the value 0\n\t\t\t0,\n\t\t);\n\n\t\treturn new this({\n\t\t\tnodeId: ctx.sourceNodeId,\n\t\t\tnotificationType,\n\t\t\tsupportedEvents,\n\t\t});\n\t}\n\n\tpublic persistValues(ctx: PersistValuesContext): boolean {\n\t\tif (!super.persistValues(ctx)) return false;\n\n\t\t// Store which events this notification supports\n\t\tthis.setValue(\n\t\t\tctx,\n\t\t\tNotificationCCValues.supportedNotificationEvents(\n\t\t\t\tthis.notificationType,\n\t\t\t),\n\t\t\tthis.supportedEvents,\n\t\t);\n\n\t\t// For each event, predefine the value metadata\n\t\tconst notification = getNotification(this.notificationType);\n\n\t\tif (!notification) {\n\t\t\t// This is an unknown notification\n\t\t\tthis.setMetadata(\n\t\t\t\tctx,\n\t\t\t\tNotificationCCValues.unknownNotificationType(\n\t\t\t\t\tthis.notificationType,\n\t\t\t\t),\n\t\t\t);\n\t\t} else {\n\t\t\t// This is a standardized notification\n\t\t\tlet isFirst = true;\n\t\t\tfor (const value of this.supportedEvents) {\n\t\t\t\t// Find out which property we need to update\n\t\t\t\tconst valueConfig = getNotificationValue(notification, value);\n\t\t\t\tif (valueConfig?.type === \"state\") {\n\t\t\t\t\tconst notificationValue = NotificationCCValues\n\t\t\t\t\t\t.notificationVariable(\n\t\t\t\t\t\t\tnotification.name,\n\t\t\t\t\t\t\tvalueConfig.variableName,\n\t\t\t\t\t\t);\n\n\t\t\t\t\t// After we've created the metadata initially, extend it\n\t\t\t\t\tconst metadata = getNotificationValueMetadata(\n\t\t\t\t\t\tisFirst\n\t\t\t\t\t\t\t? undefined\n\t\t\t\t\t\t\t: this.getMetadata(ctx, notificationValue),\n\t\t\t\t\t\tnotification,\n\t\t\t\t\t\tvalueConfig,\n\t\t\t\t\t);\n\n\t\t\t\t\tthis.setMetadata(ctx, notificationValue, metadata);\n\n\t\t\t\t\tisFirst = false;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\treturn true;\n\t}\n\n\tpublic notificationType: number;\n\tpublic supportedEvents: number[];\n\n\tpublic serialize(ctx: CCEncodingContext): Promise<Bytes> {\n\t\tthis.payload = Bytes.from([this.notificationType, 0]);\n\t\tif (this.supportedEvents.length > 0) {\n\t\t\tconst bitMask = encodeBitMask(\n\t\t\t\tthis.supportedEvents,\n\t\t\t\tMath.max(...this.supportedEvents),\n\t\t\t\t0,\n\t\t\t);\n\t\t\tthis.payload[1] = bitMask.length;\n\t\t\tthis.payload = Bytes.concat([this.payload, bitMask]);\n\t\t}\n\n\t\treturn super.serialize(ctx);\n\t}\n\n\tpublic toLogEntry(ctx?: GetValueDB): MessageOrCCLogEntry {\n\t\treturn {\n\t\t\t...super.toLogEntry(ctx),\n\t\t\tmessage: {\n\t\t\t\t\"notification type\": getNotificationName(this.notificationType),\n\t\t\t\t\"supported events\": this.supportedEvents\n\t\t\t\t\t.map(\n\t\t\t\t\t\t(e) =>\n\t\t\t\t\t\t\t`\\n\u00B7 ${\n\t\t\t\t\t\t\t\tgetNotificationValueName(\n\t\t\t\t\t\t\t\t\tthis.notificationType,\n\t\t\t\t\t\t\t\t\te,\n\t\t\t\t\t\t\t\t)\n\t\t\t\t\t\t\t}`,\n\t\t\t\t\t)\n\t\t\t\t\t.join(\"\"),\n\t\t\t},\n\t\t};\n\t}\n}\n\n// @publicAPI\nexport interface NotificationCCEventSupportedGetOptions {\n\tnotificationType: number;\n}\n\n@CCCommand(NotificationCommand.EventSupportedGet)\n@expectedCCResponse(NotificationCCEventSupportedReport)\nexport class NotificationCCEventSupportedGet extends NotificationCC {\n\tpublic constructor(\n\t\toptions: WithAddress<NotificationCCEventSupportedGetOptions>,\n\t) {\n\t\tsuper(options);\n\t\tthis.notificationType = options.notificationType;\n\t}\n\n\tpublic static from(\n\t\traw: CCRaw,\n\t\tctx: CCParsingContext,\n\t): NotificationCCEventSupportedGet {\n\t\tvalidatePayload(raw.payload.length >= 1);\n\t\tconst notificationType = raw.payload[0];\n\n\t\treturn new this({\n\t\t\tnodeId: ctx.sourceNodeId,\n\t\t\tnotificationType,\n\t\t});\n\t}\n\n\tpublic notificationType: number;\n\n\tpublic serialize(ctx: CCEncodingContext): Promise<Bytes> {\n\t\tthis.payload = Bytes.from([this.notificationType]);\n\t\treturn super.serialize(ctx);\n\t}\n\n\tpublic toLogEntry(ctx?: GetValueDB): MessageOrCCLogEntry {\n\t\treturn {\n\t\t\t...super.toLogEntry(ctx),\n\t\t\tmessage: {\n\t\t\t\t\"notification type\": getNotificationName(this.notificationType),\n\t\t\t},\n\t\t};\n\t}\n}\n"],
5
+ "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAEA,kBAuCO;AACP,oBAMO;AAEP,wBAAwB;AACxB,iBAMO;AACP,0BAQO;AACP,oCAUO;AACP,sCAA2C;AAC3C,oBAAkB;AAClB,mBAAqD;AACrD,cAAyB;AACzB,oCAAuC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAiIjC,SAAU,sCACf,KACA,UAAoB;AAEpB,QAAM,UAAU,IAAI,cAAc,SAAS,MAAM;AACjD,MAAI,CAAC;AAAS,WAAO;AACrB,QAAM,oBAAoB,QAAQ,SACjC,+CAAqB;;IAEpB;EAAI,EACH,S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B;AACjC,aAAO;QACN,GAAG,MAAM,WAAW,GAAG;QACvB,SAAS;UACR,yBAAqB,iCAAoB,KAAK,gBAAgB;;;IAGjE;;;;",
6
+ "names": ["NotificationCC"]
7
7
  }
@@ -1,6 +1,6 @@
1
- import { type CCEncodingContext, type CCParsingContext } from "@zwave-js/cc";
2
- import { type GetValueDB, type MaybeNotKnown, type MessageOrCCLogEntry, type SupervisionResult, type WithAddress } from "@zwave-js/core/safe";
3
- import { Bytes } from "@zwave-js/shared/safe";
1
+ import type { CCEncodingContext, CCParsingContext } from "@zwave-js/cc";
2
+ import { type GetValueDB, type MaybeNotKnown, type MessageOrCCLogEntry, type SupervisionResult, type WithAddress } from "@zwave-js/core";
3
+ import { Bytes } from "@zwave-js/shared";
4
4
  import { PhysicalCCAPI } from "../lib/API.js";
5
5
  import { type CCRaw, CommandClass } from "../lib/CommandClass.js";
6
6
  import { Powerlevel, PowerlevelCommand, PowerlevelTestStatus } from "../lib/_Types.js";
@@ -40,9 +40,8 @@ __export(PowerlevelCC_exports, {
40
40
  });
41
41
  module.exports = __toCommonJS(PowerlevelCC_exports);
42
42
  var __validateArgs = __toESM(require("./PowerlevelCC._validateArgs.js"), 1);
43
- var import_safe = require("@zwave-js/core/safe");
44
- var import_safe2 = require("@zwave-js/shared/safe");
45
- var import_safe3 = require("@zwave-js/shared/safe");
43
+ var import_core = require("@zwave-js/core");
44
+ var import_shared = require("@zwave-js/shared");
46
45
  var import_API = require("../lib/API.js");
47
46
  var import_CommandClass = require("../lib/CommandClass.js");
48
47
  var import_CommandClassDecorators = require("../lib/CommandClassDecorators.js");
@@ -89,7 +88,7 @@ var __esDecorate = function(ctor, descriptorIn, decorators, contextIn, initializ
89
88
  };
90
89
  const { validateArgs_PowerlevelCCAPI_setCustomPowerlevel, validateArgs_PowerlevelCCAPI_reportPowerlevel, validateArgs_PowerlevelCCAPI_startNodeTest, validateArgs_PowerlevelCCAPI_sendNodeTestReport } = __validateArgs;
91
90
  let PowerlevelCCAPI = (() => {
92
- let _classDecorators = [(0, import_CommandClassDecorators.API)(import_safe.CommandClasses.Powerlevel)];
91
+ let _classDecorators = [(0, import_CommandClassDecorators.API)(import_core.CommandClasses.Powerlevel)];
93
92
  let _classDescriptor;
94
93
  let _classExtraInitializers = [];
95
94
  let _classThis;
@@ -161,7 +160,7 @@ let PowerlevelCCAPI = (() => {
161
160
  });
162
161
  const response = await this.host.sendCommand(cc, this.commandOptions);
163
162
  if (response) {
164
- return (0, import_safe3.pick)(response, ["powerlevel", "timeout"]);
163
+ return (0, import_shared.pick)(response, ["powerlevel", "timeout"]);
165
164
  }
166
165
  }
167
166
  async reportPowerlevel(options) {
@@ -176,14 +175,14 @@ let PowerlevelCCAPI = (() => {
176
175
  async startNodeTest(testNodeId, powerlevel, testFrameCount) {
177
176
  this.assertSupportsCommand(import_Types.PowerlevelCommand, import_Types.PowerlevelCommand.TestNodeSet);
178
177
  if (testNodeId === this.endpoint.nodeId) {
179
- throw new import_safe.ZWaveError(`For a powerlevel test, the test node ID must different from the source node ID.`, import_safe.ZWaveErrorCodes.Argument_Invalid);
178
+ throw new import_core.ZWaveError(`For a powerlevel test, the test node ID must different from the source node ID.`, import_core.ZWaveErrorCodes.Argument_Invalid);
180
179
  }
181
180
  const testNode = this.host.getNodeOrThrow(testNodeId);
182
181
  if (testNode.isFrequentListening) {
183
- throw new import_safe.ZWaveError(`Node ${testNodeId} is FLiRS and therefore cannot be used for a powerlevel test.`, import_safe.ZWaveErrorCodes.PowerlevelCC_UnsupportedTestNode);
182
+ throw new import_core.ZWaveError(`Node ${testNodeId} is FLiRS and therefore cannot be used for a powerlevel test.`, import_core.ZWaveErrorCodes.PowerlevelCC_UnsupportedTestNode);
184
183
  }
185
- if (testNode.canSleep && testNode.status !== import_safe.NodeStatus.Awake) {
186
- throw new import_safe.ZWaveError(`Node ${testNodeId} is not awake and therefore cannot be used for a powerlevel test.`, import_safe.ZWaveErrorCodes.PowerlevelCC_UnsupportedTestNode);
184
+ if (testNode.canSleep && testNode.status !== import_core.NodeStatus.Awake) {
185
+ throw new import_core.ZWaveError(`Node ${testNodeId} is not awake and therefore cannot be used for a powerlevel test.`, import_core.ZWaveErrorCodes.PowerlevelCC_UnsupportedTestNode);
187
186
  }
188
187
  const cc = new PowerlevelCCTestNodeSet({
189
188
  nodeId: this.endpoint.nodeId,
@@ -202,7 +201,7 @@ let PowerlevelCCAPI = (() => {
202
201
  });
203
202
  const response = await this.host.sendCommand(cc, this.commandOptions);
204
203
  if (response) {
205
- return (0, import_safe3.pick)(response, [
204
+ return (0, import_shared.pick)(response, [
206
205
  "testNodeId",
207
206
  "status",
208
207
  "acknowledgedFrames"
@@ -226,7 +225,7 @@ let PowerlevelCCAPI = (() => {
226
225
  return PowerlevelCCAPI2 = _classThis;
227
226
  })();
228
227
  let PowerlevelCC = (() => {
229
- let _classDecorators = [(0, import_CommandClassDecorators.commandClass)(import_safe.CommandClasses.Powerlevel), (0, import_CommandClassDecorators.implementedVersion)(1)];
228
+ let _classDecorators = [(0, import_CommandClassDecorators.commandClass)(import_core.CommandClasses.Powerlevel), (0, import_CommandClassDecorators.implementedVersion)(1)];
230
229
  let _classDescriptor;
231
230
  let _classExtraInitializers = [];
232
231
  let _classThis;
@@ -273,13 +272,13 @@ let PowerlevelCCSet = (() => {
273
272
  this.powerlevel = options.powerlevel;
274
273
  if (options.powerlevel !== import_Types.Powerlevel["Normal Power"]) {
275
274
  if (options.timeout < 1 || options.timeout > 255) {
276
- throw new import_safe.ZWaveError(`The timeout parameter must be between 1 and 255.`, import_safe.ZWaveErrorCodes.Argument_Invalid);
275
+ throw new import_core.ZWaveError(`The timeout parameter must be between 1 and 255.`, import_core.ZWaveErrorCodes.Argument_Invalid);
277
276
  }
278
277
  this.timeout = options.timeout;
279
278
  }
280
279
  }
281
280
  static from(raw, ctx) {
282
- (0, import_safe.validatePayload)(raw.payload.length >= 1);
281
+ (0, import_core.validatePayload)(raw.payload.length >= 1);
283
282
  const powerlevel = raw.payload[0];
284
283
  if (powerlevel === import_Types.Powerlevel["Normal Power"]) {
285
284
  return new this({
@@ -287,7 +286,7 @@ let PowerlevelCCSet = (() => {
287
286
  powerlevel
288
287
  });
289
288
  } else {
290
- (0, import_safe.validatePayload)(raw.payload.length >= 2);
289
+ (0, import_core.validatePayload)(raw.payload.length >= 2);
291
290
  const timeout = raw.payload[1];
292
291
  return new this({
293
292
  nodeId: ctx.sourceNodeId,
@@ -299,12 +298,12 @@ let PowerlevelCCSet = (() => {
299
298
  powerlevel;
300
299
  timeout;
301
300
  serialize(ctx) {
302
- this.payload = import_safe2.Bytes.from([this.powerlevel, this.timeout ?? 0]);
301
+ this.payload = import_shared.Bytes.from([this.powerlevel, this.timeout ?? 0]);
303
302
  return super.serialize(ctx);
304
303
  }
305
304
  toLogEntry(ctx) {
306
305
  const message = {
307
- "power level": (0, import_safe3.getEnumMemberName)(import_Types.Powerlevel, this.powerlevel)
306
+ "power level": (0, import_shared.getEnumMemberName)(import_Types.Powerlevel, this.powerlevel)
308
307
  };
309
308
  if (this.timeout != void 0) {
310
309
  message.timeout = `${this.timeout} s`;
@@ -343,7 +342,7 @@ let PowerlevelCCReport = (() => {
343
342
  this.timeout = options.timeout;
344
343
  }
345
344
  static from(raw, ctx) {
346
- (0, import_safe.validatePayload)(raw.payload.length >= 1);
345
+ (0, import_core.validatePayload)(raw.payload.length >= 1);
347
346
  const powerlevel = raw.payload[0];
348
347
  if (powerlevel === import_Types.Powerlevel["Normal Power"]) {
349
348
  return new this({
@@ -351,7 +350,7 @@ let PowerlevelCCReport = (() => {
351
350
  powerlevel
352
351
  });
353
352
  } else {
354
- (0, import_safe.validatePayload)(raw.payload.length >= 2);
353
+ (0, import_core.validatePayload)(raw.payload.length >= 2);
355
354
  const timeout = raw.payload[1];
356
355
  return new this({
357
356
  nodeId: ctx.sourceNodeId,
@@ -363,12 +362,12 @@ let PowerlevelCCReport = (() => {
363
362
  powerlevel;
364
363
  timeout;
365
364
  serialize(ctx) {
366
- this.payload = import_safe2.Bytes.from([this.powerlevel, this.timeout ?? 0]);
365
+ this.payload = import_shared.Bytes.from([this.powerlevel, this.timeout ?? 0]);
367
366
  return super.serialize(ctx);
368
367
  }
369
368
  toLogEntry(ctx) {
370
369
  const message = {
371
- "power level": (0, import_safe3.getEnumMemberName)(import_Types.Powerlevel, this.powerlevel)
370
+ "power level": (0, import_shared.getEnumMemberName)(import_Types.Powerlevel, this.powerlevel)
372
371
  };
373
372
  if (this.timeout != void 0) {
374
373
  message.timeout = `${this.timeout} s`;
@@ -431,7 +430,7 @@ let PowerlevelCCTestNodeSet = (() => {
431
430
  this.testFrameCount = options.testFrameCount;
432
431
  }
433
432
  static from(raw, ctx) {
434
- (0, import_safe.validatePayload)(raw.payload.length >= 4);
433
+ (0, import_core.validatePayload)(raw.payload.length >= 4);
435
434
  const testNodeId = raw.payload[0];
436
435
  const powerlevel = raw.payload[1];
437
436
  const testFrameCount = raw.payload.readUInt16BE(2);
@@ -446,7 +445,7 @@ let PowerlevelCCTestNodeSet = (() => {
446
445
  powerlevel;
447
446
  testFrameCount;
448
447
  serialize(ctx) {
449
- this.payload = import_safe2.Bytes.from([this.testNodeId, this.powerlevel, 0, 0]);
448
+ this.payload = import_shared.Bytes.from([this.testNodeId, this.powerlevel, 0, 0]);
450
449
  this.payload.writeUInt16BE(this.testFrameCount, 2);
451
450
  return super.serialize(ctx);
452
451
  }
@@ -455,7 +454,7 @@ let PowerlevelCCTestNodeSet = (() => {
455
454
  ...super.toLogEntry(ctx),
456
455
  message: {
457
456
  "test node id": this.testNodeId,
458
- "power level": (0, import_safe3.getEnumMemberName)(import_Types.Powerlevel, this.powerlevel),
457
+ "power level": (0, import_shared.getEnumMemberName)(import_Types.Powerlevel, this.powerlevel),
459
458
  "test frame count": this.testFrameCount
460
459
  }
461
460
  };
@@ -490,7 +489,7 @@ let PowerlevelCCTestNodeReport = (() => {
490
489
  this.acknowledgedFrames = options.acknowledgedFrames;
491
490
  }
492
491
  static from(raw, ctx) {
493
- (0, import_safe.validatePayload)(raw.payload.length >= 4);
492
+ (0, import_core.validatePayload)(raw.payload.length >= 4);
494
493
  const testNodeId = raw.payload[0];
495
494
  const status = raw.payload[1];
496
495
  const acknowledgedFrames = raw.payload.readUInt16BE(2);
@@ -505,7 +504,7 @@ let PowerlevelCCTestNodeReport = (() => {
505
504
  status;
506
505
  acknowledgedFrames;
507
506
  serialize(ctx) {
508
- this.payload = import_safe2.Bytes.from([
507
+ this.payload = import_shared.Bytes.from([
509
508
  this.testNodeId,
510
509
  this.status,
511
510
  // Placeholder for acknowledged frames
@@ -520,7 +519,7 @@ let PowerlevelCCTestNodeReport = (() => {
520
519
  ...super.toLogEntry(ctx),
521
520
  message: {
522
521
  "test node id": this.testNodeId,
523
- status: (0, import_safe3.getEnumMemberName)(import_Types.PowerlevelTestStatus, this.status),
522
+ status: (0, import_shared.getEnumMemberName)(import_Types.PowerlevelTestStatus, this.status),
524
523
  "acknowledged frames": this.acknowledgedFrames
525
524
  }
526
525
  };