@zwave-js/cc 15.20.1 → 15.21.1
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.
- package/build/cjs/cc/AlarmSensorCC._validateArgs.js.map +2 -2
- package/build/cjs/cc/AlarmSensorCC.d.ts +4 -131
- package/build/cjs/cc/AlarmSensorCC.js +1 -2
- package/build/cjs/cc/AlarmSensorCC.js.map +3 -3
- package/build/cjs/cc/ApplicationStatusCC.d.ts +1 -1
- package/build/cjs/cc/ApplicationStatusCC.js.map +3 -3
- package/build/cjs/cc/AssociationCC._validateArgs.js.map +2 -2
- package/build/cjs/cc/AssociationCC.d.ts +3 -109
- package/build/cjs/cc/AssociationCC.js +0 -1
- package/build/cjs/cc/AssociationCC.js.map +3 -3
- package/build/cjs/cc/AssociationGroupInfoCC._validateArgs.js.map +2 -2
- package/build/cjs/cc/AssociationGroupInfoCC.d.ts +3 -112
- package/build/cjs/cc/AssociationGroupInfoCC.js +0 -1
- package/build/cjs/cc/AssociationGroupInfoCC.js.map +3 -3
- package/build/cjs/cc/BarrierOperatorCC._validateArgs.js.map +2 -2
- package/build/cjs/cc/BarrierOperatorCC.d.ts +4 -148
- package/build/cjs/cc/BarrierOperatorCC.js +1 -2
- package/build/cjs/cc/BarrierOperatorCC.js.map +3 -3
- package/build/cjs/cc/BasicCC._validateArgs.js.map +2 -2
- package/build/cjs/cc/BasicCC.d.ts +4 -143
- package/build/cjs/cc/BasicCC.js +0 -1
- package/build/cjs/cc/BasicCC.js.map +3 -3
- package/build/cjs/cc/BasicWindowCoveringCC._validateArgs.js.map +2 -2
- package/build/cjs/cc/BasicWindowCoveringCC.d.ts +3 -63
- package/build/cjs/cc/BasicWindowCoveringCC.js +2 -3
- package/build/cjs/cc/BasicWindowCoveringCC.js.map +3 -3
- package/build/cjs/cc/BatteryCC.d.ts +4 -305
- package/build/cjs/cc/BatteryCC.js +39 -15
- package/build/cjs/cc/BatteryCC.js.map +3 -3
- package/build/cjs/cc/BinarySensorCC._validateArgs.js.map +2 -2
- package/build/cjs/cc/BinarySensorCC.d.ts +4 -59
- package/build/cjs/cc/BinarySensorCC.js +12 -3
- package/build/cjs/cc/BinarySensorCC.js.map +3 -3
- package/build/cjs/cc/BinarySwitchCC._validateArgs.js.map +2 -2
- package/build/cjs/cc/BinarySwitchCC.d.ts +4 -83
- package/build/cjs/cc/BinarySwitchCC.js +0 -1
- package/build/cjs/cc/BinarySwitchCC.js.map +3 -3
- package/build/cjs/cc/CRC16CC.d.ts +1 -1
- package/build/cjs/cc/CRC16CC.js.map +3 -3
- package/build/cjs/cc/CentralSceneCC._validateArgs.js.map +2 -2
- package/build/cjs/cc/CentralSceneCC.d.ts +3 -136
- package/build/cjs/cc/CentralSceneCC.js +0 -1
- package/build/cjs/cc/CentralSceneCC.js.map +3 -3
- package/build/cjs/cc/ClimateControlScheduleCC._validateArgs.js.map +2 -2
- package/build/cjs/cc/ClimateControlScheduleCC.d.ts +4 -87
- package/build/cjs/cc/ClimateControlScheduleCC.js +3 -4
- package/build/cjs/cc/ClimateControlScheduleCC.js.map +3 -3
- package/build/cjs/cc/ClockCC._validateArgs.js.map +2 -2
- package/build/cjs/cc/ClockCC.d.ts +1 -1
- package/build/cjs/cc/ClockCC.js +1 -1
- package/build/cjs/cc/ClockCC.js.map +3 -3
- package/build/cjs/cc/ColorSwitchCC._validateArgs.js.map +2 -2
- package/build/cjs/cc/ColorSwitchCC.d.ts +4 -227
- package/build/cjs/cc/ColorSwitchCC.js +3 -3
- package/build/cjs/cc/ColorSwitchCC.js.map +3 -3
- package/build/cjs/cc/ConfigurationCC._validateArgs.js.map +2 -2
- package/build/cjs/cc/ConfigurationCC.d.ts +9 -60
- package/build/cjs/cc/ConfigurationCC.js +71 -59
- package/build/cjs/cc/ConfigurationCC.js.map +3 -3
- package/build/cjs/cc/DeviceResetLocallyCC.d.ts +1 -1
- package/build/cjs/cc/DeviceResetLocallyCC.js.map +3 -3
- package/build/cjs/cc/DoorLockCC._validateArgs.js.map +2 -2
- package/build/cjs/cc/DoorLockCC.d.ts +4 -688
- package/build/cjs/cc/DoorLockCC.js +1 -2
- package/build/cjs/cc/DoorLockCC.js.map +3 -3
- package/build/cjs/cc/DoorLockLoggingCC._validateArgs.js.map +2 -2
- package/build/cjs/cc/DoorLockLoggingCC.d.ts +4 -29
- package/build/cjs/cc/DoorLockLoggingCC.js +0 -1
- package/build/cjs/cc/DoorLockLoggingCC.js.map +3 -3
- package/build/cjs/cc/EnergyProductionCC._validateArgs.js.map +2 -2
- package/build/cjs/cc/EnergyProductionCC.d.ts +4 -33
- package/build/cjs/cc/EnergyProductionCC.js +1 -2
- package/build/cjs/cc/EnergyProductionCC.js.map +3 -3
- package/build/cjs/cc/EntryControlCC._validateArgs.js.map +2 -2
- package/build/cjs/cc/EntryControlCC.d.ts +3 -137
- package/build/cjs/cc/EntryControlCC.js +0 -1
- package/build/cjs/cc/EntryControlCC.js.map +3 -3
- package/build/cjs/cc/FirmwareUpdateMetaDataCC._validateArgs.js.map +2 -2
- package/build/cjs/cc/FirmwareUpdateMetaDataCC.d.ts +4 -154
- package/build/cjs/cc/FirmwareUpdateMetaDataCC.js +0 -1
- package/build/cjs/cc/FirmwareUpdateMetaDataCC.js.map +3 -3
- package/build/cjs/cc/HailCC.js.map +3 -3
- package/build/cjs/cc/HumidityControlModeCC._validateArgs.js.map +2 -2
- package/build/cjs/cc/HumidityControlModeCC.d.ts +4 -58
- package/build/cjs/cc/HumidityControlModeCC.js +1 -2
- package/build/cjs/cc/HumidityControlModeCC.js.map +3 -3
- package/build/cjs/cc/HumidityControlOperatingStateCC.d.ts +4 -33
- package/build/cjs/cc/HumidityControlOperatingStateCC.js +0 -1
- package/build/cjs/cc/HumidityControlOperatingStateCC.js.map +3 -3
- package/build/cjs/cc/HumidityControlSetpointCC._validateArgs.js.map +2 -2
- package/build/cjs/cc/HumidityControlSetpointCC.d.ts +4 -92
- package/build/cjs/cc/HumidityControlSetpointCC.js +0 -1
- package/build/cjs/cc/HumidityControlSetpointCC.js.map +3 -3
- package/build/cjs/cc/InclusionControllerCC.d.ts +1 -1
- package/build/cjs/cc/InclusionControllerCC.js.map +3 -3
- package/build/cjs/cc/IndicatorCC._validateArgs.js.map +2 -2
- package/build/cjs/cc/IndicatorCC.d.ts +4 -207
- package/build/cjs/cc/IndicatorCC.js +0 -1
- package/build/cjs/cc/IndicatorCC.js.map +3 -3
- package/build/cjs/cc/IrrigationCC._validateArgs.js.map +2 -2
- package/build/cjs/cc/IrrigationCC.d.ts +4 -1186
- package/build/cjs/cc/IrrigationCC.js +1 -3
- package/build/cjs/cc/IrrigationCC.js.map +3 -3
- package/build/cjs/cc/LanguageCC._validateArgs.js.map +2 -2
- package/build/cjs/cc/LanguageCC.d.ts +4 -56
- package/build/cjs/cc/LanguageCC.js +0 -1
- package/build/cjs/cc/LanguageCC.js.map +3 -3
- package/build/cjs/cc/LockCC._validateArgs.js.map +2 -2
- package/build/cjs/cc/LockCC.d.ts +4 -31
- package/build/cjs/cc/LockCC.js +0 -1
- package/build/cjs/cc/LockCC.js.map +3 -3
- package/build/cjs/cc/ManufacturerProprietaryCC._validateArgs.js.map +2 -2
- package/build/cjs/cc/ManufacturerProprietaryCC.d.ts +1 -1
- package/build/cjs/cc/ManufacturerProprietaryCC.js.map +3 -3
- package/build/cjs/cc/ManufacturerSpecificCC._validateArgs.js.map +2 -2
- package/build/cjs/cc/ManufacturerSpecificCC.d.ts +3 -116
- package/build/cjs/cc/ManufacturerSpecificCC.js +0 -1
- package/build/cjs/cc/ManufacturerSpecificCC.js.map +3 -3
- package/build/cjs/cc/MeterCC._validateArgs.js.map +2 -2
- package/build/cjs/cc/MeterCC.d.ts +4 -203
- package/build/cjs/cc/MeterCC.js +0 -2
- package/build/cjs/cc/MeterCC.js.map +3 -3
- package/build/cjs/cc/MultiChannelAssociationCC._validateArgs.js.map +2 -2
- package/build/cjs/cc/MultiChannelAssociationCC.d.ts +3 -112
- package/build/cjs/cc/MultiChannelAssociationCC.js +0 -1
- package/build/cjs/cc/MultiChannelAssociationCC.js.map +3 -3
- package/build/cjs/cc/MultiChannelCC._validateArgs.js.map +2 -2
- package/build/cjs/cc/MultiChannelCC.d.ts +3 -207
- package/build/cjs/cc/MultiChannelCC.js +0 -1
- package/build/cjs/cc/MultiChannelCC.js.map +3 -3
- package/build/cjs/cc/MultiCommandCC._validateArgs.js.map +2 -2
- package/build/cjs/cc/MultiCommandCC.d.ts +1 -1
- package/build/cjs/cc/MultiCommandCC.js.map +3 -3
- package/build/cjs/cc/MultilevelSensorCC._validateArgs.js.map +2 -2
- package/build/cjs/cc/MultilevelSensorCC.d.ts +4 -84
- package/build/cjs/cc/MultilevelSensorCC.js +0 -1
- package/build/cjs/cc/MultilevelSensorCC.js.map +3 -3
- package/build/cjs/cc/MultilevelSwitchCC._validateArgs.js.map +2 -2
- package/build/cjs/cc/MultilevelSwitchCC.d.ts +5 -264
- package/build/cjs/cc/MultilevelSwitchCC.js +34 -1
- package/build/cjs/cc/MultilevelSwitchCC.js.map +3 -3
- package/build/cjs/cc/NoOperationCC.js.map +3 -3
- package/build/cjs/cc/NodeNamingCC._validateArgs.js.map +2 -2
- package/build/cjs/cc/NodeNamingCC.d.ts +8 -58
- package/build/cjs/cc/NodeNamingCC.js +48 -25
- package/build/cjs/cc/NodeNamingCC.js.map +3 -3
- package/build/cjs/cc/NotificationCC._validateArgs.js.map +2 -2
- package/build/cjs/cc/NotificationCC.d.ts +5 -357
- package/build/cjs/cc/NotificationCC.js +2 -2
- package/build/cjs/cc/NotificationCC.js.map +3 -3
- package/build/cjs/cc/PowerlevelCC._validateArgs.js.map +2 -2
- package/build/cjs/cc/PowerlevelCC.d.ts +1 -1
- package/build/cjs/cc/PowerlevelCC.js +2 -2
- package/build/cjs/cc/PowerlevelCC.js.map +3 -3
- package/build/cjs/cc/ProtectionCC._validateArgs.js.map +2 -2
- package/build/cjs/cc/ProtectionCC.d.ts +4 -212
- package/build/cjs/cc/ProtectionCC.js +1 -2
- package/build/cjs/cc/ProtectionCC.js.map +3 -3
- package/build/cjs/cc/SceneActivationCC._validateArgs.js.map +2 -2
- package/build/cjs/cc/SceneActivationCC.d.ts +4 -59
- package/build/cjs/cc/SceneActivationCC.js +0 -1
- package/build/cjs/cc/SceneActivationCC.js.map +3 -3
- package/build/cjs/cc/SceneActuatorConfigurationCC._validateArgs.js.map +2 -2
- package/build/cjs/cc/SceneActuatorConfigurationCC.d.ts +4 -65
- package/build/cjs/cc/SceneActuatorConfigurationCC.js +0 -1
- package/build/cjs/cc/SceneActuatorConfigurationCC.js.map +3 -3
- package/build/cjs/cc/SceneControllerConfigurationCC._validateArgs.js.map +2 -2
- package/build/cjs/cc/SceneControllerConfigurationCC.d.ts +3 -64
- package/build/cjs/cc/SceneControllerConfigurationCC.js +0 -1
- package/build/cjs/cc/SceneControllerConfigurationCC.js.map +3 -3
- package/build/cjs/cc/ScheduleEntryLockCC._validateArgs.js.map +2 -2
- package/build/cjs/cc/ScheduleEntryLockCC.d.ts +4 -163
- package/build/cjs/cc/ScheduleEntryLockCC.js +0 -1
- package/build/cjs/cc/ScheduleEntryLockCC.js.map +3 -3
- package/build/cjs/cc/Security2CC.d.ts +1 -1
- package/build/cjs/cc/Security2CC.js.map +3 -3
- package/build/cjs/cc/SecurityCC.d.ts +4 -2
- package/build/cjs/cc/SecurityCC.js.map +3 -3
- package/build/cjs/cc/SoundSwitchCC._validateArgs.js.map +2 -2
- package/build/cjs/cc/SoundSwitchCC.d.ts +4 -123
- package/build/cjs/cc/SoundSwitchCC.js +6 -2
- package/build/cjs/cc/SoundSwitchCC.js.map +3 -3
- package/build/cjs/cc/SupervisionCC.d.ts +3 -31
- package/build/cjs/cc/SupervisionCC.js +4 -2
- package/build/cjs/cc/SupervisionCC.js.map +3 -3
- package/build/cjs/cc/ThermostatFanModeCC._validateArgs.js.map +2 -2
- package/build/cjs/cc/ThermostatFanModeCC.d.ts +4 -84
- package/build/cjs/cc/ThermostatFanModeCC.js +1 -2
- package/build/cjs/cc/ThermostatFanModeCC.js.map +3 -3
- package/build/cjs/cc/ThermostatFanStateCC.d.ts +4 -33
- package/build/cjs/cc/ThermostatFanStateCC.js +0 -1
- package/build/cjs/cc/ThermostatFanStateCC.js.map +3 -3
- package/build/cjs/cc/ThermostatModeCC._validateArgs.js.map +2 -2
- package/build/cjs/cc/ThermostatModeCC.d.ts +4 -84
- package/build/cjs/cc/ThermostatModeCC.js +1 -2
- package/build/cjs/cc/ThermostatModeCC.js.map +3 -3
- package/build/cjs/cc/ThermostatOperatingStateCC.d.ts +4 -33
- package/build/cjs/cc/ThermostatOperatingStateCC.js +0 -1
- package/build/cjs/cc/ThermostatOperatingStateCC.js.map +3 -3
- package/build/cjs/cc/ThermostatSetbackCC._validateArgs.js.map +2 -2
- package/build/cjs/cc/ThermostatSetbackCC.d.ts +1 -1
- package/build/cjs/cc/ThermostatSetbackCC.js.map +3 -3
- package/build/cjs/cc/ThermostatSetpointCC._validateArgs.js.map +2 -2
- package/build/cjs/cc/ThermostatSetpointCC.d.ts +5 -90
- package/build/cjs/cc/ThermostatSetpointCC.js +0 -1
- package/build/cjs/cc/ThermostatSetpointCC.js.map +3 -3
- package/build/cjs/cc/TimeCC._validateArgs.js.map +2 -2
- package/build/cjs/cc/TimeCC.d.ts +2 -2
- package/build/cjs/cc/TimeCC.js.map +3 -3
- package/build/cjs/cc/TimeParametersCC._validateArgs.js.map +2 -2
- package/build/cjs/cc/TimeParametersCC.d.ts +4 -30
- package/build/cjs/cc/TimeParametersCC.js +0 -1
- package/build/cjs/cc/TimeParametersCC.js.map +3 -3
- package/build/cjs/cc/TransportServiceCC.d.ts +1 -1
- package/build/cjs/cc/TransportServiceCC.js.map +3 -3
- package/build/cjs/cc/UserCodeCC._validateArgs.js.map +2 -2
- package/build/cjs/cc/UserCodeCC.d.ts +4 -415
- package/build/cjs/cc/UserCodeCC.js +1 -2
- package/build/cjs/cc/UserCodeCC.js.map +3 -3
- package/build/cjs/cc/VersionCC._validateArgs.js.map +2 -2
- package/build/cjs/cc/VersionCC.d.ts +3 -367
- package/build/cjs/cc/VersionCC.js +0 -1
- package/build/cjs/cc/VersionCC.js.map +3 -3
- package/build/cjs/cc/WakeUpCC._validateArgs.js.map +2 -2
- package/build/cjs/cc/WakeUpCC.d.ts +4 -83
- package/build/cjs/cc/WakeUpCC.js +11 -4
- package/build/cjs/cc/WakeUpCC.js.map +3 -3
- package/build/cjs/cc/WindowCoveringCC._validateArgs.js.map +2 -2
- package/build/cjs/cc/WindowCoveringCC.d.ts +4 -207
- package/build/cjs/cc/WindowCoveringCC.js +3 -5
- package/build/cjs/cc/WindowCoveringCC.js.map +3 -3
- package/build/cjs/cc/ZWaveLongRangeCC.js.map +3 -3
- package/build/cjs/cc/ZWavePlusCC._validateArgs.js.map +2 -2
- package/build/cjs/cc/ZWavePlusCC.d.ts +4 -129
- package/build/cjs/cc/ZWavePlusCC.js +0 -1
- package/build/cjs/cc/ZWavePlusCC.js.map +3 -3
- package/build/cjs/cc/ZWaveProtocolCC.d.ts +1 -1
- package/build/cjs/cc/ZWaveProtocolCC.js.map +3 -3
- package/build/cjs/cc/_CCValues.generated.js.map +1 -1
- package/build/cjs/cc/index.js.map +1 -1
- package/build/cjs/cc/manufacturerProprietary/Decorators.js.map +1 -1
- package/build/cjs/cc/manufacturerProprietary/FibaroCC._validateArgs.js.map +2 -2
- package/build/cjs/cc/manufacturerProprietary/FibaroCC.d.ts +1 -1
- package/build/cjs/cc/manufacturerProprietary/FibaroCC.js.map +3 -3
- package/build/cjs/index.js.map +1 -1
- package/build/cjs/index_browser.js.map +1 -1
- package/build/cjs/index_safe.js.map +1 -1
- package/build/cjs/lib/API.d.ts +3 -135
- package/build/cjs/lib/API.js.map +3 -3
- package/build/cjs/lib/CCValueUtils.js.map +1 -1
- package/build/cjs/lib/CommandClass.d.ts +1 -1
- package/build/cjs/lib/CommandClass.js.map +3 -3
- package/build/cjs/lib/CommandClassDecorators.js.map +1 -1
- package/build/cjs/lib/EncapsulatingCommandClass.js.map +1 -1
- package/build/cjs/lib/NotificationEventPayload.js.map +1 -1
- package/build/cjs/lib/Security2/Extension.js.map +1 -1
- package/build/cjs/lib/Security2/shared.js.map +1 -1
- package/build/cjs/lib/SetValueResult.js.map +1 -1
- package/build/cjs/lib/Values.js.map +1 -1
- package/build/cjs/lib/_CCAPI.generated.d.ts +136 -0
- package/build/cjs/lib/_CCAPI.generated.js +17 -0
- package/build/cjs/lib/_CCAPI.generated.js.map +7 -0
- package/build/cjs/lib/_Types.js.map +1 -1
- package/build/cjs/lib/serializers.js.map +1 -1
- package/build/cjs/lib/utils.js.map +1 -1
- package/build/esm/cc/AlarmSensorCC._validateArgs.d.ts.map +1 -1
- package/build/esm/cc/AlarmSensorCC._validateArgs.js.map +1 -1
- package/build/esm/cc/AlarmSensorCC.d.ts +4 -131
- package/build/esm/cc/AlarmSensorCC.d.ts.map +1 -1
- package/build/esm/cc/AlarmSensorCC.js +2 -3
- package/build/esm/cc/AlarmSensorCC.js.map +1 -1
- package/build/esm/cc/ApplicationStatusCC.d.ts +1 -1
- package/build/esm/cc/ApplicationStatusCC.d.ts.map +1 -1
- package/build/esm/cc/ApplicationStatusCC.js.map +1 -1
- package/build/esm/cc/AssociationCC._validateArgs.d.ts.map +1 -1
- package/build/esm/cc/AssociationCC._validateArgs.js.map +1 -1
- package/build/esm/cc/AssociationCC.d.ts +3 -109
- package/build/esm/cc/AssociationCC.d.ts.map +1 -1
- package/build/esm/cc/AssociationCC.js +0 -1
- package/build/esm/cc/AssociationCC.js.map +1 -1
- package/build/esm/cc/AssociationGroupInfoCC._validateArgs.d.ts.map +1 -1
- package/build/esm/cc/AssociationGroupInfoCC._validateArgs.js.map +1 -1
- package/build/esm/cc/AssociationGroupInfoCC.d.ts +3 -112
- package/build/esm/cc/AssociationGroupInfoCC.d.ts.map +1 -1
- package/build/esm/cc/AssociationGroupInfoCC.js +12 -13
- package/build/esm/cc/AssociationGroupInfoCC.js.map +1 -1
- package/build/esm/cc/BarrierOperatorCC._validateArgs.d.ts.map +1 -1
- package/build/esm/cc/BarrierOperatorCC._validateArgs.js.map +1 -1
- package/build/esm/cc/BarrierOperatorCC.d.ts +4 -148
- package/build/esm/cc/BarrierOperatorCC.d.ts.map +1 -1
- package/build/esm/cc/BarrierOperatorCC.js +2 -3
- package/build/esm/cc/BarrierOperatorCC.js.map +1 -1
- package/build/esm/cc/BasicCC._validateArgs.d.ts.map +1 -1
- package/build/esm/cc/BasicCC._validateArgs.js.map +1 -1
- package/build/esm/cc/BasicCC.d.ts +4 -143
- package/build/esm/cc/BasicCC.d.ts.map +1 -1
- package/build/esm/cc/BasicCC.js +1 -2
- package/build/esm/cc/BasicCC.js.map +1 -1
- package/build/esm/cc/BasicWindowCoveringCC._validateArgs.d.ts.map +1 -1
- package/build/esm/cc/BasicWindowCoveringCC._validateArgs.js.map +1 -1
- package/build/esm/cc/BasicWindowCoveringCC.d.ts +3 -63
- package/build/esm/cc/BasicWindowCoveringCC.d.ts.map +1 -1
- package/build/esm/cc/BasicWindowCoveringCC.js +5 -6
- package/build/esm/cc/BasicWindowCoveringCC.js.map +1 -1
- package/build/esm/cc/BatteryCC.d.ts +4 -305
- package/build/esm/cc/BatteryCC.d.ts.map +1 -1
- package/build/esm/cc/BatteryCC.js +67 -26
- package/build/esm/cc/BatteryCC.js.map +1 -1
- package/build/esm/cc/BinarySensorCC._validateArgs.d.ts.map +1 -1
- package/build/esm/cc/BinarySensorCC._validateArgs.js.map +1 -1
- package/build/esm/cc/BinarySensorCC.d.ts +4 -59
- package/build/esm/cc/BinarySensorCC.d.ts.map +1 -1
- package/build/esm/cc/BinarySensorCC.js +24 -4
- package/build/esm/cc/BinarySensorCC.js.map +1 -1
- package/build/esm/cc/BinarySwitchCC._validateArgs.d.ts.map +1 -1
- package/build/esm/cc/BinarySwitchCC._validateArgs.js.map +1 -1
- package/build/esm/cc/BinarySwitchCC.d.ts +4 -83
- package/build/esm/cc/BinarySwitchCC.d.ts.map +1 -1
- package/build/esm/cc/BinarySwitchCC.js +1 -2
- package/build/esm/cc/BinarySwitchCC.js.map +1 -1
- package/build/esm/cc/CRC16CC.d.ts +1 -1
- package/build/esm/cc/CRC16CC.d.ts.map +1 -1
- package/build/esm/cc/CRC16CC.js.map +1 -1
- package/build/esm/cc/CentralSceneCC._validateArgs.d.ts.map +1 -1
- package/build/esm/cc/CentralSceneCC._validateArgs.js.map +1 -1
- package/build/esm/cc/CentralSceneCC.d.ts +3 -136
- package/build/esm/cc/CentralSceneCC.d.ts.map +1 -1
- package/build/esm/cc/CentralSceneCC.js +5 -6
- package/build/esm/cc/CentralSceneCC.js.map +1 -1
- package/build/esm/cc/ClimateControlScheduleCC._validateArgs.d.ts.map +1 -1
- package/build/esm/cc/ClimateControlScheduleCC._validateArgs.js.map +1 -1
- package/build/esm/cc/ClimateControlScheduleCC.d.ts +4 -87
- package/build/esm/cc/ClimateControlScheduleCC.d.ts.map +1 -1
- package/build/esm/cc/ClimateControlScheduleCC.js +4 -5
- package/build/esm/cc/ClimateControlScheduleCC.js.map +1 -1
- package/build/esm/cc/ClockCC._validateArgs.d.ts.map +1 -1
- package/build/esm/cc/ClockCC._validateArgs.js.map +1 -1
- package/build/esm/cc/ClockCC.d.ts +1 -1
- package/build/esm/cc/ClockCC.d.ts.map +1 -1
- package/build/esm/cc/ClockCC.js +1 -1
- package/build/esm/cc/ClockCC.js.map +1 -1
- package/build/esm/cc/ColorSwitchCC._validateArgs.d.ts.map +1 -1
- package/build/esm/cc/ColorSwitchCC._validateArgs.js.map +1 -1
- package/build/esm/cc/ColorSwitchCC.d.ts +4 -227
- package/build/esm/cc/ColorSwitchCC.d.ts.map +1 -1
- package/build/esm/cc/ColorSwitchCC.js +8 -8
- package/build/esm/cc/ColorSwitchCC.js.map +1 -1
- package/build/esm/cc/ConfigurationCC._validateArgs.d.ts.map +1 -1
- package/build/esm/cc/ConfigurationCC._validateArgs.js.map +1 -1
- package/build/esm/cc/ConfigurationCC.d.ts +9 -60
- package/build/esm/cc/ConfigurationCC.d.ts.map +1 -1
- package/build/esm/cc/ConfigurationCC.js +94 -76
- package/build/esm/cc/ConfigurationCC.js.map +1 -1
- package/build/esm/cc/DeviceResetLocallyCC.d.ts +1 -1
- package/build/esm/cc/DeviceResetLocallyCC.d.ts.map +1 -1
- package/build/esm/cc/DeviceResetLocallyCC.js.map +1 -1
- package/build/esm/cc/DoorLockCC._validateArgs.d.ts.map +1 -1
- package/build/esm/cc/DoorLockCC._validateArgs.js.map +1 -1
- package/build/esm/cc/DoorLockCC.d.ts +4 -688
- package/build/esm/cc/DoorLockCC.d.ts.map +1 -1
- package/build/esm/cc/DoorLockCC.js +14 -15
- package/build/esm/cc/DoorLockCC.js.map +1 -1
- package/build/esm/cc/DoorLockLoggingCC._validateArgs.d.ts.map +1 -1
- package/build/esm/cc/DoorLockLoggingCC._validateArgs.js.map +1 -1
- package/build/esm/cc/DoorLockLoggingCC.d.ts +4 -29
- package/build/esm/cc/DoorLockLoggingCC.d.ts.map +1 -1
- package/build/esm/cc/DoorLockLoggingCC.js +0 -1
- package/build/esm/cc/DoorLockLoggingCC.js.map +1 -1
- package/build/esm/cc/EnergyProductionCC._validateArgs.d.ts.map +1 -1
- package/build/esm/cc/EnergyProductionCC._validateArgs.js.map +1 -1
- package/build/esm/cc/EnergyProductionCC.d.ts +4 -33
- package/build/esm/cc/EnergyProductionCC.d.ts.map +1 -1
- package/build/esm/cc/EnergyProductionCC.js +2 -3
- package/build/esm/cc/EnergyProductionCC.js.map +1 -1
- package/build/esm/cc/EntryControlCC._validateArgs.d.ts.map +1 -1
- package/build/esm/cc/EntryControlCC._validateArgs.js.map +1 -1
- package/build/esm/cc/EntryControlCC.d.ts +3 -137
- package/build/esm/cc/EntryControlCC.d.ts.map +1 -1
- package/build/esm/cc/EntryControlCC.js +1 -2
- package/build/esm/cc/EntryControlCC.js.map +1 -1
- package/build/esm/cc/FirmwareUpdateMetaDataCC._validateArgs.d.ts.map +1 -1
- package/build/esm/cc/FirmwareUpdateMetaDataCC._validateArgs.js.map +1 -1
- package/build/esm/cc/FirmwareUpdateMetaDataCC.d.ts +4 -154
- package/build/esm/cc/FirmwareUpdateMetaDataCC.d.ts.map +1 -1
- package/build/esm/cc/FirmwareUpdateMetaDataCC.js +0 -1
- package/build/esm/cc/FirmwareUpdateMetaDataCC.js.map +1 -1
- package/build/esm/cc/HailCC.d.ts.map +1 -1
- package/build/esm/cc/HailCC.js.map +1 -1
- package/build/esm/cc/HumidityControlModeCC._validateArgs.d.ts.map +1 -1
- package/build/esm/cc/HumidityControlModeCC._validateArgs.js.map +1 -1
- package/build/esm/cc/HumidityControlModeCC.d.ts +4 -58
- package/build/esm/cc/HumidityControlModeCC.d.ts.map +1 -1
- package/build/esm/cc/HumidityControlModeCC.js +2 -3
- package/build/esm/cc/HumidityControlModeCC.js.map +1 -1
- package/build/esm/cc/HumidityControlOperatingStateCC.d.ts +4 -33
- package/build/esm/cc/HumidityControlOperatingStateCC.d.ts.map +1 -1
- package/build/esm/cc/HumidityControlOperatingStateCC.js +1 -2
- package/build/esm/cc/HumidityControlOperatingStateCC.js.map +1 -1
- package/build/esm/cc/HumidityControlSetpointCC._validateArgs.d.ts.map +1 -1
- package/build/esm/cc/HumidityControlSetpointCC._validateArgs.js.map +1 -1
- package/build/esm/cc/HumidityControlSetpointCC.d.ts +4 -92
- package/build/esm/cc/HumidityControlSetpointCC.d.ts.map +1 -1
- package/build/esm/cc/HumidityControlSetpointCC.js +1 -2
- package/build/esm/cc/HumidityControlSetpointCC.js.map +1 -1
- package/build/esm/cc/InclusionControllerCC.d.ts +1 -1
- package/build/esm/cc/InclusionControllerCC.d.ts.map +1 -1
- package/build/esm/cc/InclusionControllerCC.js.map +1 -1
- package/build/esm/cc/IndicatorCC._validateArgs.d.ts.map +1 -1
- package/build/esm/cc/IndicatorCC._validateArgs.js.map +1 -1
- package/build/esm/cc/IndicatorCC.d.ts +4 -207
- package/build/esm/cc/IndicatorCC.d.ts.map +1 -1
- package/build/esm/cc/IndicatorCC.js +0 -1
- package/build/esm/cc/IndicatorCC.js.map +1 -1
- package/build/esm/cc/IrrigationCC._validateArgs.d.ts.map +1 -1
- package/build/esm/cc/IrrigationCC._validateArgs.js.map +1 -1
- package/build/esm/cc/IrrigationCC.d.ts +4 -1186
- package/build/esm/cc/IrrigationCC.d.ts.map +1 -1
- package/build/esm/cc/IrrigationCC.js +6 -8
- package/build/esm/cc/IrrigationCC.js.map +1 -1
- package/build/esm/cc/LanguageCC._validateArgs.d.ts.map +1 -1
- package/build/esm/cc/LanguageCC._validateArgs.js.map +1 -1
- package/build/esm/cc/LanguageCC.d.ts +4 -56
- package/build/esm/cc/LanguageCC.d.ts.map +1 -1
- package/build/esm/cc/LanguageCC.js +1 -2
- package/build/esm/cc/LanguageCC.js.map +1 -1
- package/build/esm/cc/LockCC._validateArgs.d.ts.map +1 -1
- package/build/esm/cc/LockCC._validateArgs.js.map +1 -1
- package/build/esm/cc/LockCC.d.ts +4 -31
- package/build/esm/cc/LockCC.d.ts.map +1 -1
- package/build/esm/cc/LockCC.js +1 -2
- package/build/esm/cc/LockCC.js.map +1 -1
- package/build/esm/cc/ManufacturerProprietaryCC._validateArgs.d.ts.map +1 -1
- package/build/esm/cc/ManufacturerProprietaryCC._validateArgs.js.map +1 -1
- package/build/esm/cc/ManufacturerProprietaryCC.d.ts +1 -1
- package/build/esm/cc/ManufacturerProprietaryCC.d.ts.map +1 -1
- package/build/esm/cc/ManufacturerProprietaryCC.js.map +1 -1
- package/build/esm/cc/ManufacturerSpecificCC._validateArgs.d.ts.map +1 -1
- package/build/esm/cc/ManufacturerSpecificCC._validateArgs.js.map +1 -1
- package/build/esm/cc/ManufacturerSpecificCC.d.ts +3 -116
- package/build/esm/cc/ManufacturerSpecificCC.d.ts.map +1 -1
- package/build/esm/cc/ManufacturerSpecificCC.js +1 -2
- package/build/esm/cc/ManufacturerSpecificCC.js.map +1 -1
- package/build/esm/cc/MeterCC._validateArgs.d.ts.map +1 -1
- package/build/esm/cc/MeterCC._validateArgs.js.map +1 -1
- package/build/esm/cc/MeterCC.d.ts +4 -203
- package/build/esm/cc/MeterCC.d.ts.map +1 -1
- package/build/esm/cc/MeterCC.js +17 -19
- package/build/esm/cc/MeterCC.js.map +1 -1
- package/build/esm/cc/MultiChannelAssociationCC._validateArgs.d.ts.map +1 -1
- package/build/esm/cc/MultiChannelAssociationCC._validateArgs.js.map +1 -1
- package/build/esm/cc/MultiChannelAssociationCC.d.ts +3 -112
- package/build/esm/cc/MultiChannelAssociationCC.d.ts.map +1 -1
- package/build/esm/cc/MultiChannelAssociationCC.js +4 -5
- package/build/esm/cc/MultiChannelAssociationCC.js.map +1 -1
- package/build/esm/cc/MultiChannelCC._validateArgs.d.ts.map +1 -1
- package/build/esm/cc/MultiChannelCC._validateArgs.js.map +1 -1
- package/build/esm/cc/MultiChannelCC.d.ts +3 -207
- package/build/esm/cc/MultiChannelCC.d.ts.map +1 -1
- package/build/esm/cc/MultiChannelCC.js +9 -10
- package/build/esm/cc/MultiChannelCC.js.map +1 -1
- package/build/esm/cc/MultiCommandCC._validateArgs.d.ts.map +1 -1
- package/build/esm/cc/MultiCommandCC._validateArgs.js.map +1 -1
- package/build/esm/cc/MultiCommandCC.d.ts +1 -1
- package/build/esm/cc/MultiCommandCC.d.ts.map +1 -1
- package/build/esm/cc/MultiCommandCC.js.map +1 -1
- package/build/esm/cc/MultilevelSensorCC._validateArgs.d.ts.map +1 -1
- package/build/esm/cc/MultilevelSensorCC._validateArgs.js.map +1 -1
- package/build/esm/cc/MultilevelSensorCC.d.ts +4 -84
- package/build/esm/cc/MultilevelSensorCC.d.ts.map +1 -1
- package/build/esm/cc/MultilevelSensorCC.js +1 -2
- package/build/esm/cc/MultilevelSensorCC.js.map +1 -1
- package/build/esm/cc/MultilevelSwitchCC._validateArgs.d.ts.map +1 -1
- package/build/esm/cc/MultilevelSwitchCC._validateArgs.js.map +1 -1
- package/build/esm/cc/MultilevelSwitchCC.d.ts +5 -264
- package/build/esm/cc/MultilevelSwitchCC.d.ts.map +1 -1
- package/build/esm/cc/MultilevelSwitchCC.js +44 -6
- package/build/esm/cc/MultilevelSwitchCC.js.map +1 -1
- package/build/esm/cc/NoOperationCC.d.ts.map +1 -1
- package/build/esm/cc/NoOperationCC.js.map +1 -1
- package/build/esm/cc/NodeNamingCC._validateArgs.d.ts.map +1 -1
- package/build/esm/cc/NodeNamingCC._validateArgs.js.map +1 -1
- package/build/esm/cc/NodeNamingCC.d.ts +8 -58
- package/build/esm/cc/NodeNamingCC.d.ts.map +1 -1
- package/build/esm/cc/NodeNamingCC.js +49 -38
- package/build/esm/cc/NodeNamingCC.js.map +1 -1
- package/build/esm/cc/NotificationCC._validateArgs.d.ts.map +1 -1
- package/build/esm/cc/NotificationCC._validateArgs.js.map +1 -1
- package/build/esm/cc/NotificationCC.d.ts +5 -357
- package/build/esm/cc/NotificationCC.d.ts.map +1 -1
- package/build/esm/cc/NotificationCC.js +9 -9
- package/build/esm/cc/NotificationCC.js.map +1 -1
- package/build/esm/cc/PowerlevelCC._validateArgs.d.ts.map +1 -1
- package/build/esm/cc/PowerlevelCC._validateArgs.js.map +1 -1
- package/build/esm/cc/PowerlevelCC.d.ts +1 -1
- package/build/esm/cc/PowerlevelCC.d.ts.map +1 -1
- package/build/esm/cc/PowerlevelCC.js +2 -2
- package/build/esm/cc/PowerlevelCC.js.map +1 -1
- package/build/esm/cc/ProtectionCC._validateArgs.d.ts.map +1 -1
- package/build/esm/cc/ProtectionCC._validateArgs.js.map +1 -1
- package/build/esm/cc/ProtectionCC.d.ts +4 -212
- package/build/esm/cc/ProtectionCC.d.ts.map +1 -1
- package/build/esm/cc/ProtectionCC.js +2 -3
- package/build/esm/cc/ProtectionCC.js.map +1 -1
- package/build/esm/cc/SceneActivationCC._validateArgs.d.ts.map +1 -1
- package/build/esm/cc/SceneActivationCC._validateArgs.js.map +1 -1
- package/build/esm/cc/SceneActivationCC.d.ts +4 -59
- package/build/esm/cc/SceneActivationCC.d.ts.map +1 -1
- package/build/esm/cc/SceneActivationCC.js +1 -2
- package/build/esm/cc/SceneActivationCC.js.map +1 -1
- package/build/esm/cc/SceneActuatorConfigurationCC._validateArgs.d.ts.map +1 -1
- package/build/esm/cc/SceneActuatorConfigurationCC._validateArgs.js.map +1 -1
- package/build/esm/cc/SceneActuatorConfigurationCC.d.ts +4 -65
- package/build/esm/cc/SceneActuatorConfigurationCC.d.ts.map +1 -1
- package/build/esm/cc/SceneActuatorConfigurationCC.js +2 -3
- package/build/esm/cc/SceneActuatorConfigurationCC.js.map +1 -1
- package/build/esm/cc/SceneControllerConfigurationCC._validateArgs.d.ts.map +1 -1
- package/build/esm/cc/SceneControllerConfigurationCC._validateArgs.js.map +1 -1
- package/build/esm/cc/SceneControllerConfigurationCC.d.ts +3 -64
- package/build/esm/cc/SceneControllerConfigurationCC.d.ts.map +1 -1
- package/build/esm/cc/SceneControllerConfigurationCC.js +1 -2
- package/build/esm/cc/SceneControllerConfigurationCC.js.map +1 -1
- package/build/esm/cc/ScheduleEntryLockCC._validateArgs.d.ts.map +1 -1
- package/build/esm/cc/ScheduleEntryLockCC._validateArgs.js.map +1 -1
- package/build/esm/cc/ScheduleEntryLockCC.d.ts +4 -163
- package/build/esm/cc/ScheduleEntryLockCC.d.ts.map +1 -1
- package/build/esm/cc/ScheduleEntryLockCC.js +0 -1
- package/build/esm/cc/ScheduleEntryLockCC.js.map +1 -1
- package/build/esm/cc/Security2CC.d.ts +1 -1
- package/build/esm/cc/Security2CC.d.ts.map +1 -1
- package/build/esm/cc/Security2CC.js +2 -2
- package/build/esm/cc/Security2CC.js.map +1 -1
- package/build/esm/cc/SecurityCC.d.ts +4 -2
- package/build/esm/cc/SecurityCC.d.ts.map +1 -1
- package/build/esm/cc/SecurityCC.js +2 -2
- package/build/esm/cc/SecurityCC.js.map +1 -1
- package/build/esm/cc/SoundSwitchCC._validateArgs.d.ts.map +1 -1
- package/build/esm/cc/SoundSwitchCC._validateArgs.js.map +1 -1
- package/build/esm/cc/SoundSwitchCC.d.ts +4 -123
- package/build/esm/cc/SoundSwitchCC.d.ts.map +1 -1
- package/build/esm/cc/SoundSwitchCC.js +7 -3
- package/build/esm/cc/SoundSwitchCC.js.map +1 -1
- package/build/esm/cc/SupervisionCC.d.ts +3 -31
- package/build/esm/cc/SupervisionCC.d.ts.map +1 -1
- package/build/esm/cc/SupervisionCC.js +9 -7
- package/build/esm/cc/SupervisionCC.js.map +1 -1
- package/build/esm/cc/ThermostatFanModeCC._validateArgs.d.ts.map +1 -1
- package/build/esm/cc/ThermostatFanModeCC._validateArgs.js.map +1 -1
- package/build/esm/cc/ThermostatFanModeCC.d.ts +4 -84
- package/build/esm/cc/ThermostatFanModeCC.d.ts.map +1 -1
- package/build/esm/cc/ThermostatFanModeCC.js +4 -5
- package/build/esm/cc/ThermostatFanModeCC.js.map +1 -1
- package/build/esm/cc/ThermostatFanStateCC.d.ts +4 -33
- package/build/esm/cc/ThermostatFanStateCC.d.ts.map +1 -1
- package/build/esm/cc/ThermostatFanStateCC.js +1 -2
- package/build/esm/cc/ThermostatFanStateCC.js.map +1 -1
- package/build/esm/cc/ThermostatModeCC._validateArgs.d.ts.map +1 -1
- package/build/esm/cc/ThermostatModeCC._validateArgs.js.map +1 -1
- package/build/esm/cc/ThermostatModeCC.d.ts +4 -84
- package/build/esm/cc/ThermostatModeCC.d.ts.map +1 -1
- package/build/esm/cc/ThermostatModeCC.js +2 -3
- package/build/esm/cc/ThermostatModeCC.js.map +1 -1
- package/build/esm/cc/ThermostatOperatingStateCC.d.ts +4 -33
- package/build/esm/cc/ThermostatOperatingStateCC.d.ts.map +1 -1
- package/build/esm/cc/ThermostatOperatingStateCC.js +1 -2
- package/build/esm/cc/ThermostatOperatingStateCC.js.map +1 -1
- package/build/esm/cc/ThermostatSetbackCC._validateArgs.d.ts.map +1 -1
- package/build/esm/cc/ThermostatSetbackCC._validateArgs.js.map +1 -1
- package/build/esm/cc/ThermostatSetbackCC.d.ts +1 -1
- package/build/esm/cc/ThermostatSetbackCC.d.ts.map +1 -1
- package/build/esm/cc/ThermostatSetbackCC.js.map +1 -1
- package/build/esm/cc/ThermostatSetpointCC._validateArgs.d.ts.map +1 -1
- package/build/esm/cc/ThermostatSetpointCC._validateArgs.js.map +1 -1
- package/build/esm/cc/ThermostatSetpointCC.d.ts +5 -90
- package/build/esm/cc/ThermostatSetpointCC.d.ts.map +1 -1
- package/build/esm/cc/ThermostatSetpointCC.js +1 -2
- package/build/esm/cc/ThermostatSetpointCC.js.map +1 -1
- package/build/esm/cc/TimeCC._validateArgs.d.ts.map +1 -1
- package/build/esm/cc/TimeCC._validateArgs.js.map +1 -1
- package/build/esm/cc/TimeCC.d.ts +2 -2
- package/build/esm/cc/TimeCC.d.ts.map +1 -1
- package/build/esm/cc/TimeCC.js.map +1 -1
- package/build/esm/cc/TimeParametersCC._validateArgs.d.ts.map +1 -1
- package/build/esm/cc/TimeParametersCC._validateArgs.js.map +1 -1
- package/build/esm/cc/TimeParametersCC.d.ts +4 -30
- package/build/esm/cc/TimeParametersCC.d.ts.map +1 -1
- package/build/esm/cc/TimeParametersCC.js +1 -2
- package/build/esm/cc/TimeParametersCC.js.map +1 -1
- package/build/esm/cc/TransportServiceCC.d.ts +1 -1
- package/build/esm/cc/TransportServiceCC.d.ts.map +1 -1
- package/build/esm/cc/TransportServiceCC.js +2 -2
- package/build/esm/cc/TransportServiceCC.js.map +1 -1
- package/build/esm/cc/UserCodeCC._validateArgs.d.ts.map +1 -1
- package/build/esm/cc/UserCodeCC._validateArgs.js.map +1 -1
- package/build/esm/cc/UserCodeCC.d.ts +4 -415
- package/build/esm/cc/UserCodeCC.d.ts.map +1 -1
- package/build/esm/cc/UserCodeCC.js +17 -18
- package/build/esm/cc/UserCodeCC.js.map +1 -1
- package/build/esm/cc/VersionCC._validateArgs.d.ts.map +1 -1
- package/build/esm/cc/VersionCC._validateArgs.js.map +1 -1
- package/build/esm/cc/VersionCC.d.ts +3 -367
- package/build/esm/cc/VersionCC.d.ts.map +1 -1
- package/build/esm/cc/VersionCC.js +1 -2
- package/build/esm/cc/VersionCC.js.map +1 -1
- package/build/esm/cc/WakeUpCC._validateArgs.d.ts.map +1 -1
- package/build/esm/cc/WakeUpCC._validateArgs.js.map +1 -1
- package/build/esm/cc/WakeUpCC.d.ts +4 -83
- package/build/esm/cc/WakeUpCC.d.ts.map +1 -1
- package/build/esm/cc/WakeUpCC.js +10 -3
- package/build/esm/cc/WakeUpCC.js.map +1 -1
- package/build/esm/cc/WindowCoveringCC._validateArgs.d.ts.map +1 -1
- package/build/esm/cc/WindowCoveringCC._validateArgs.js.map +1 -1
- package/build/esm/cc/WindowCoveringCC.d.ts +4 -207
- package/build/esm/cc/WindowCoveringCC.d.ts.map +1 -1
- package/build/esm/cc/WindowCoveringCC.js +6 -8
- package/build/esm/cc/WindowCoveringCC.js.map +1 -1
- package/build/esm/cc/ZWaveLongRangeCC.d.ts.map +1 -1
- package/build/esm/cc/ZWaveLongRangeCC.js.map +1 -1
- package/build/esm/cc/ZWavePlusCC._validateArgs.d.ts.map +1 -1
- package/build/esm/cc/ZWavePlusCC._validateArgs.js.map +1 -1
- package/build/esm/cc/ZWavePlusCC.d.ts +4 -129
- package/build/esm/cc/ZWavePlusCC.d.ts.map +1 -1
- package/build/esm/cc/ZWavePlusCC.js +0 -1
- package/build/esm/cc/ZWavePlusCC.js.map +1 -1
- package/build/esm/cc/ZWaveProtocolCC.d.ts +1 -1
- package/build/esm/cc/ZWaveProtocolCC.d.ts.map +1 -1
- package/build/esm/cc/ZWaveProtocolCC.js +4 -4
- package/build/esm/cc/ZWaveProtocolCC.js.map +1 -1
- package/build/esm/cc/_CCValues.generated.d.ts.map +1 -1
- package/build/esm/cc/_CCValues.generated.js.map +1 -1
- package/build/esm/cc/index.d.ts.map +1 -1
- package/build/esm/cc/index.js.map +1 -1
- package/build/esm/cc/manufacturerProprietary/Decorators.d.ts.map +1 -1
- package/build/esm/cc/manufacturerProprietary/Decorators.js.map +1 -1
- package/build/esm/cc/manufacturerProprietary/FibaroCC._validateArgs.d.ts.map +1 -1
- package/build/esm/cc/manufacturerProprietary/FibaroCC._validateArgs.js.map +1 -1
- package/build/esm/cc/manufacturerProprietary/FibaroCC.d.ts +1 -1
- package/build/esm/cc/manufacturerProprietary/FibaroCC.d.ts.map +1 -1
- package/build/esm/cc/manufacturerProprietary/FibaroCC.js.map +1 -1
- package/build/esm/index.d.ts.map +1 -1
- package/build/esm/index.js.map +1 -1
- package/build/esm/index_browser.d.ts.map +1 -1
- package/build/esm/index_browser.js.map +1 -1
- package/build/esm/index_safe.d.ts.map +1 -1
- package/build/esm/index_safe.js.map +1 -1
- package/build/esm/lib/API.d.ts +3 -135
- package/build/esm/lib/API.d.ts.map +1 -1
- package/build/esm/lib/API.js.map +1 -1
- package/build/esm/lib/CCValueUtils.d.ts.map +1 -1
- package/build/esm/lib/CCValueUtils.js.map +1 -1
- package/build/esm/lib/CommandClass.d.ts +1 -1
- package/build/esm/lib/CommandClass.d.ts.map +1 -1
- package/build/esm/lib/CommandClass.js.map +1 -1
- package/build/esm/lib/CommandClassDecorators.d.ts.map +1 -1
- package/build/esm/lib/CommandClassDecorators.js.map +1 -1
- package/build/esm/lib/EncapsulatingCommandClass.d.ts.map +1 -1
- package/build/esm/lib/EncapsulatingCommandClass.js.map +1 -1
- package/build/esm/lib/NotificationEventPayload.d.ts.map +1 -1
- package/build/esm/lib/NotificationEventPayload.js.map +1 -1
- package/build/esm/lib/Security2/Extension.d.ts.map +1 -1
- package/build/esm/lib/Security2/Extension.js.map +1 -1
- package/build/esm/lib/Security2/shared.d.ts.map +1 -1
- package/build/esm/lib/Security2/shared.js.map +1 -1
- package/build/esm/lib/SetValueResult.d.ts.map +1 -1
- package/build/esm/lib/SetValueResult.js.map +1 -1
- package/build/esm/lib/Values.d.ts.map +1 -1
- package/build/esm/lib/Values.js.map +1 -1
- package/build/esm/lib/_CCAPI.generated.d.ts +136 -0
- package/build/esm/lib/_CCAPI.generated.d.ts.map +1 -0
- package/build/esm/lib/_CCAPI.generated.js +4 -0
- package/build/esm/lib/_CCAPI.generated.js.map +1 -0
- package/build/esm/lib/_Types.d.ts.map +1 -1
- package/build/esm/lib/_Types.js.map +1 -1
- package/build/esm/lib/serializers.d.ts.map +1 -1
- package/build/esm/lib/serializers.js.map +1 -1
- package/build/esm/lib/traits.d.ts.map +1 -1
- package/build/esm/lib/traits.js.map +1 -1
- package/build/esm/lib/utils.d.ts.map +1 -1
- package/build/esm/lib/utils.js.map +1 -1
- package/package.json +11 -11
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
|
-
"sources": ["../../../
|
|
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\ttype BytesView,\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 { ApplicationStatusCCRejectedRequest } from \"./ApplicationStatusCC.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// oxlint-disable-next-line 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// oxlint-disable-next-line typescript/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// oxlint-disable-next-line typescript/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\t// First, query the current state of each supported notification\n\t\t\t\tawait this.refreshValues(ctx);\n\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\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\t// Load supported notification types and events from cache\n\t\tconst supportedNotificationTypes = this.getValue<readonly number[]>(\n\t\t\tctx,\n\t\t\tNotificationCCValues.supportedNotificationTypes,\n\t\t) ?? [];\n\t\tconst supportedNotificationNames = supportedNotificationTypes.map(\n\t\t\tgetNotificationName,\n\t\t);\n\n\t\tfor (let i = 0; i < supportedNotificationTypes.length; i++) {\n\t\t\tconst type = supportedNotificationTypes[i];\n\t\t\tconst name = supportedNotificationNames[i];\n\n\t\t\t// Always query each notification for its current status\n\t\t\tctx.logNode(node.id, {\n\t\t\t\tendpoint: this.endpointIndex,\n\t\t\t\tmessage: `querying notification status for ${name}...`,\n\t\t\t\tdirection: \"outbound\",\n\t\t\t});\n\t\t\tconst response = await api.getInternal({\n\t\t\t\tnotificationType: type,\n\t\t\t});\n\t\t\t// NotificationReports don't store their values themselves,\n\t\t\t// because the behaviour is too complex and spans the lifetime\n\t\t\t// of several reports. Thus we handle it in the Node instance\n\n\t\t\t// @ts-expect-error\n\t\t\tif (response) await node.handleCommand(response);\n\t\t}\n\n\t\t// Remember when we did this\n\t\tthis.setValue(\n\t\t\tctx,\n\t\t\tNotificationCCValues.lastRefresh,\n\t\t\tDate.now(),\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\nfunction getCCResponseForNotificationCCSet(\n\tctx: GetNode<NodeId & SupportsCC>,\n\tsent: NotificationCCSet,\n) {\n\t// CC:0071.03.06.11.008: A receiving node MAY deny the deactivation\n\t// of a specific Notification Type. In that case, the receiving node\n\t// MUST respond to this command with an Application Rejected Request\n\t// Command.\n\tif (\n\t\tsent.isSinglecast()\n\t\t&& !sent.notificationStatus\n\t\t&& !sent.isEncapsulatedWith(CommandClasses.Supervision)\n\t\t&& ctx.getNode(sent.nodeId)?.supportsCC(\n\t\t\tCommandClasses[\"Application Status\"],\n\t\t)\n\t) {\n\t\treturn ApplicationStatusCCRejectedRequest;\n\t}\n}\n\n@CCCommand(NotificationCommand.Set)\n@expectedCCResponse(getCCResponseForNotificationCCSet)\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?: BytesView;\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: BytesView | 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| BytesView\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 (this.eventParameters instanceof Duration) {\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\t[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\t[\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,oBAOO;AAEP,wBAAwB;AACxB,iBAMO;AACP,0BAQO;AACP,oCAUO;AACP,sCAA2C;AAC3C,oBAAkB;AAClB,mBAAqD;AACrD,cAAyB;AACzB,iCAAmD;AACnD,oCAAuC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAiIjC,SAAU,sCACf,KACA,UAAoB;AAEpB,QAAM,UAAU,IAAI,cAAc,SAAS,MAAM;AACjD,MAAI,CAAC;AAAS,WAAO;AACrB,QAAM,oBAAoB,QAAQ,S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C,aAAO,IAAI,KAAK;QACf,QAAQ,IAAI;QACZ;OACA;IACF;IAEO;IAEA,UAAU,KAAsB;AACtC,WAAK,UAAU,oBAAM,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;;;;",
|
|
3
|
+
"sources": ["../../../src_gen/cc/NotificationCC.ts"],
|
|
4
|
+
"sourcesContent": ["import * as __validateArgs from \"./NotificationCC._validateArgs.js\";\nconst { validateArgs_NotificationCCAPI_sendReport, validateArgs_NotificationCCAPI_get, validateArgs_NotificationCCAPI_set, validateArgs_NotificationCCAPI_getSupportedEvents } = __validateArgs;\nimport type { GetDeviceConfig } from \"@zwave-js/config\";\nimport { CommandClasses, type ControlsCC, Duration, type EndpointId, type GetEndpoint, type GetNode, type GetSupportedCCVersion, type GetValueDB, type LogNode, type MaybeNotKnown, type MessageOrCCLogEntry, MessagePriority, type MessageRecord, type NodeId, type Notification, type NotificationState, type NotificationValue, SecurityClass, type SinglecastCC, type SupervisionResult, type SupportsCC, type ValueID, ValueMetadata, type ValueMetadataNumeric, type WithAddress, ZWaveError, ZWaveErrorCodes, encodeBitMask, getCCName, getNotification, getNotificationEventName, getNotificationName, getNotificationValue, getNotificationValueName, isZWaveError, parseBitMask, timespan, validatePayload, } from \"@zwave-js/core\";\nimport { Bytes, type BytesView, buffer2hex, isUint8Array, num2hex, pick, } from \"@zwave-js/shared\";\nimport { isArray } from \"alcalzone-shared/typeguards\";\nimport { CCAPI, POLL_VALUE, PhysicalCCAPI, type PollValueImplementation, throwUnsupportedProperty, } from \"../lib/API.js\";\nimport { CCRaw, CommandClass, type InterviewContext, InvalidCC, type PersistValuesContext, type RefreshValuesContext, getEffectiveCCVersion, } from \"../lib/CommandClass.js\";\nimport { API, CCCommand, ccValueProperty, ccValues, commandClass, expectedCCResponse, getCCCommandConstructor, implementedVersion, useSupervision, } from \"../lib/CommandClassDecorators.js\";\nimport { isNotificationEventPayload } from \"../lib/NotificationEventPayload.js\";\nimport { V } from \"../lib/Values.js\";\nimport { NotificationCommand, UserCodeCommand } from \"../lib/_Types.js\";\nimport type { CCEncodingContext, CCParsingContext } from \"../lib/traits.js\";\nimport * as ccUtils from \"../lib/utils.js\";\nimport { ApplicationStatusCCRejectedRequest } from \"./ApplicationStatusCC.js\";\nimport { AssociationGroupInfoCC } from \"./AssociationGroupInfoCC.js\";\nimport { NotificationCCValues } from \"./_CCValues.generated.js\";\nexport { NotificationCCValues };\nexport function shouldAutoCreateSimpleDoorSensorValue(ctx: GetValueDB, endpoint: EndpointId): boolean {\n const valueDB = ctx.tryGetValueDB(endpoint.nodeId);\n if (!valueDB)\n return false;\n const supportedACEvents = valueDB.getValue<readonly number[]>(NotificationCCValues.supportedNotificationEvents(\n // Access Control\n 0x06).endpoint(endpoint.index));\n if (!supportedACEvents)\n return false;\n return (supportedACEvents.includes(\n // Window/door is open\n 0x16)\n && supportedACEvents.includes(\n // Window/door is closed\n 0x17));\n}\n@API(CommandClasses.Notification)\nexport class NotificationCCAPI extends PhysicalCCAPI {\n public supportsCommand(cmd: NotificationCommand): MaybeNotKnown<boolean> {\n switch (cmd) {\n case NotificationCommand.Report:\n case NotificationCommand.Get:\n return true; // These exist starting with V1\n case NotificationCommand.Set:\n case NotificationCommand.SupportedGet:\n return this.version >= 2;\n case NotificationCommand.EventSupportedGet:\n return this.version >= 3;\n }\n return super.supportsCommand(cmd);\n }\n protected get [POLL_VALUE](): PollValueImplementation {\n return async function (this: NotificationCCAPI, { property, propertyKey }) {\n const valueId: ValueID = {\n commandClass: this.ccId,\n endpoint: this.endpoint.index,\n property,\n propertyKey,\n };\n if (NotificationCCValues.notificationVariable.is(valueId)) {\n const notificationType: number | undefined = this\n .tryGetValueDB()?.getMetadata(valueId)?.ccSpecific\n ?.notificationType;\n if (notificationType != undefined) {\n return this.getInternal({ notificationType });\n }\n }\n throwUnsupportedProperty(this.ccId, property);\n };\n }\n /**\n * @internal\n */\n public async getInternal(options: NotificationCCGetOptions): Promise<NotificationCCReport | undefined> {\n this.assertSupportsCommand(NotificationCommand, NotificationCommand.Get);\n const cc = new NotificationCCGet({\n nodeId: this.endpoint.nodeId,\n endpointIndex: this.endpoint.index,\n ...options,\n });\n return this.host.sendCommand<NotificationCCReport>(cc, this.commandOptions);\n }\n @validateArgs_NotificationCCAPI_sendReport()\n public async sendReport(options: NotificationCCReportOptions): Promise<SupervisionResult | undefined> {\n this.assertSupportsCommand(NotificationCommand, NotificationCommand.Report);\n const cc = new NotificationCCReport({\n nodeId: this.endpoint.nodeId,\n endpointIndex: this.endpoint.index,\n ...options,\n });\n return this.host.sendCommand(cc, this.commandOptions);\n }\n @validateArgs_NotificationCCAPI_get()\n // oxlint-disable-next-line typescript/explicit-module-boundary-types\n public async get(options: NotificationCCGetOptions) {\n const response = await this.getInternal(options);\n if (response) {\n return pick(response, [\n \"notificationStatus\",\n \"notificationEvent\",\n \"alarmLevel\",\n \"eventParameters\",\n \"sequenceNumber\",\n ]);\n }\n }\n @validateArgs_NotificationCCAPI_set()\n public async set(notificationType: number, notificationStatus: boolean): Promise<SupervisionResult | undefined> {\n this.assertSupportsCommand(NotificationCommand, NotificationCommand.Set);\n const cc = new NotificationCCSet({\n nodeId: this.endpoint.nodeId,\n endpointIndex: this.endpoint.index,\n notificationType,\n notificationStatus,\n });\n return this.host.sendCommand(cc, this.commandOptions);\n }\n // oxlint-disable-next-line typescript/explicit-module-boundary-types\n public async getSupported() {\n this.assertSupportsCommand(NotificationCommand, NotificationCommand.SupportedGet);\n const cc = new NotificationCCSupportedGet({\n nodeId: this.endpoint.nodeId,\n endpointIndex: this.endpoint.index,\n });\n const response = await this.host.sendCommand<NotificationCCSupportedReport>(cc, this.commandOptions);\n if (response) {\n return pick(response, [\n \"supportsV1Alarm\",\n \"supportedNotificationTypes\",\n ]);\n }\n }\n @validateArgs_NotificationCCAPI_getSupportedEvents()\n public async getSupportedEvents(notificationType: number): Promise<MaybeNotKnown<readonly number[]>> {\n this.assertSupportsCommand(NotificationCommand, NotificationCommand.EventSupportedGet);\n const cc = new NotificationCCEventSupportedGet({\n nodeId: this.endpoint.nodeId,\n endpointIndex: this.endpoint.index,\n notificationType,\n });\n const response = await this.host.sendCommand<NotificationCCEventSupportedReport>(cc, this.commandOptions);\n return response?.supportedEvents;\n }\n}\nexport function getNotificationEnumBehavior(notification: Notification, valueConfig: NotificationState): \"none\" | \"extend\" | \"replace\" {\n const variable = notification.variables.find((v) => v.states.has(valueConfig.value));\n if (!variable)\n return \"none\";\n const numStatesWithEnums = [...variable.states.values()].filter((val) => val.parameter?.type === \"enum\").length;\n if (numStatesWithEnums === 0)\n return \"none\";\n // An enum value replaces the original value if there is only a single possible state\n // which also has an enum parameter\n if (numStatesWithEnums === 1 && variable.states.size === 1) {\n return \"replace\";\n }\n return \"extend\";\n}\nexport function getNotificationStateValueWithEnum(stateValue: number, enumValue: number): number {\n return (stateValue << 8) | enumValue;\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(previous: ValueMetadataNumeric | undefined, notification: Notification, valueConfig: NotificationState): ValueMetadataNumeric {\n const metadata: ValueMetadataNumeric = previous ?? {\n ...ValueMetadata.ReadOnlyUInt8,\n label: valueConfig.variableName,\n states: {},\n ccSpecific: {\n notificationType: notification.type,\n },\n };\n if (valueConfig.idle) {\n metadata.states![0] = \"idle\";\n }\n const enumBehavior = getNotificationEnumBehavior(notification, valueConfig);\n if (enumBehavior !== \"replace\") {\n metadata.states![valueConfig.value] = valueConfig.label;\n }\n if (valueConfig.parameter?.type === \"enum\") {\n for (const [key, label] of Object.entries(valueConfig.parameter.values)) {\n const value = parseInt(key);\n const stateKey = enumBehavior === \"replace\"\n ? value\n : getNotificationStateValueWithEnum(valueConfig.value, value);\n metadata.states![stateKey] = label;\n }\n }\n return metadata;\n}\n@commandClass(CommandClasses.Notification)\n@implementedVersion(8)\n@ccValues(NotificationCCValues)\nexport class NotificationCC extends CommandClass {\n declare ccCommand: NotificationCommand;\n // former AlarmCC (v1..v2)\n public determineRequiredCCInterviews(): readonly CommandClasses[] {\n return [\n ...super.determineRequiredCCInterviews(),\n CommandClasses.Association,\n CommandClasses[\"Multi Channel Association\"],\n CommandClasses[\"Association Group Information\"],\n ];\n }\n private async determineNotificationMode(ctx: GetValueDB & GetNode<NodeId & SupportsCC> & LogNode, api: NotificationCCAPI, supportedNotificationEvents: ReadonlyMap<number, readonly number[]>): Promise<\"push\" | \"pull\"> {\n const node = this.getNode(ctx)!;\n // SDS14223: If the supporting node does not support the Association Command Class,\n // it may be concluded that the supporting node implements Pull Mode and discovery may be aborted.\n if (!node.supportsCC(CommandClasses.Association))\n return \"pull\";\n if (node.supportsCC(CommandClasses[\"Association Group Information\"])) {\n try {\n const groupsIssueingNotifications = AssociationGroupInfoCC\n .findGroupsForIssuedCommand(ctx, node, this.ccId, NotificationCommand.Report);\n return groupsIssueingNotifications.length > 0 ? \"push\" : \"pull\";\n }\n catch {\n // We might be dealing with an older cache file, fall back to testing\n }\n }\n ctx.logNode(node.id, {\n endpoint: this.endpointIndex,\n message: `determining whether this node is pull or push...`,\n direction: \"outbound\",\n });\n // Find a notification type with at least one supported event\n for (const [type, events] of supportedNotificationEvents) {\n if (events.length === 0)\n continue;\n // Enable the event and request the status\n await api.set(type, true);\n try {\n const resp = await api.get({\n notificationType: type,\n notificationEvent: events[0],\n });\n switch (resp?.notificationStatus) {\n case 0xff:\n return \"push\";\n case 0xfe:\n case 0x00:\n return \"pull\";\n }\n }\n catch {\n /* ignore */\n }\n }\n // If everything failed, e.g. because the node is V1/V2, assume this is a \"push\" node.\n // If we assumed \"pull\", we would have to query the node regularly, which can cause\n // the node to return old (already handled) notifications.\n // https://github.com/zwave-js/zwave-js/issues/5626\n return \"push\";\n }\n /** Whether the node implements push or pull notifications */\n public static getNotificationMode(ctx: GetValueDB, node: NodeId): MaybeNotKnown<\"push\" | \"pull\"> {\n return ctx\n .getValueDB(node.id)\n .getValue(NotificationCCValues.notificationMode.id);\n }\n public async interview(ctx: InterviewContext): Promise<void> {\n const node = this.getNode(ctx)!;\n const endpoint = this.getEndpoint(ctx)!;\n const api = CCAPI.create(CommandClasses.Notification, ctx, endpoint).withOptions({\n priority: MessagePriority.NodeQuery,\n });\n ctx.logNode(node.id, {\n endpoint: this.endpointIndex,\n message: `Interviewing ${this.ccName}...`,\n direction: \"none\",\n });\n // If one Association group issues Notification Reports,\n // we must associate ourselves with that channel\n try {\n await ccUtils.assignLifelineIssueingCommand(ctx, endpoint, this.ccId, NotificationCommand.Report);\n }\n catch {\n ctx.logNode(node.id, {\n endpoint: endpoint.index,\n message: `Configuring associations to receive ${getCCName(this.ccId)} reports failed!`,\n level: \"warn\",\n });\n }\n let supportsV1Alarm = false;\n if (api.version >= 2) {\n ctx.logNode(node.id, {\n endpoint: this.endpointIndex,\n message: \"querying supported notification types...\",\n direction: \"outbound\",\n });\n const suppResponse = await api.getSupported();\n if (!suppResponse) {\n ctx.logNode(node.id, {\n endpoint: this.endpointIndex,\n message: \"Querying supported notification types timed out, skipping interview...\",\n level: \"warn\",\n });\n return;\n }\n supportsV1Alarm = suppResponse.supportsV1Alarm;\n const supportedNotificationTypes = suppResponse.supportedNotificationTypes;\n const supportedNotificationNames = supportedNotificationTypes.map(getNotificationName);\n const supportedNotificationEvents = new Map<number, readonly number[]>();\n const logMessage = `received supported notification types:${supportedNotificationNames\n .map((name) => `\\n\u00B7 ${name}`)\n .join(\"\")}`;\n ctx.logNode(node.id, {\n endpoint: this.endpointIndex,\n message: logMessage,\n direction: \"inbound\",\n });\n if (api.version >= 3) {\n // Query each notification for its supported events\n for (let i = 0; i < supportedNotificationTypes.length; i++) {\n const type = supportedNotificationTypes[i];\n const name = supportedNotificationNames[i];\n ctx.logNode(node.id, {\n endpoint: this.endpointIndex,\n message: `querying supported notification events for ${name}...`,\n direction: \"outbound\",\n });\n const supportedEvents = await api.getSupportedEvents(type);\n if (supportedEvents) {\n supportedNotificationEvents.set(type, supportedEvents);\n ctx.logNode(node.id, {\n endpoint: this.endpointIndex,\n message: `received supported notification events for ${name}: ${supportedEvents\n .map(String)\n .join(\", \")}`,\n direction: \"inbound\",\n });\n }\n }\n }\n // Determine whether the node is a push or pull node\n let notificationMode = this.getValue<\"push\" | \"pull\">(ctx, NotificationCCValues.notificationMode);\n if (notificationMode !== \"push\" && notificationMode !== \"pull\") {\n notificationMode = await this.determineNotificationMode(ctx, api, supportedNotificationEvents);\n this.setValue(ctx, NotificationCCValues.notificationMode, notificationMode);\n }\n if (notificationMode === \"pull\") {\n await this.refreshValues(ctx);\n } /* if (notificationMode === \"push\") */\n else {\n // First, query the current state of each supported notification\n await this.refreshValues(ctx);\n for (let i = 0; i < supportedNotificationTypes.length; i++) {\n const type = supportedNotificationTypes[i];\n const name = supportedNotificationNames[i];\n const notification = getNotification(type);\n // Enable reports for each notification type\n ctx.logNode(node.id, {\n endpoint: this.endpointIndex,\n message: `enabling notifications for ${name}...`,\n direction: \"outbound\",\n });\n await api.set(type, true);\n // Set the value to idle if possible and there is no value yet\n if (notification) {\n const events = supportedNotificationEvents.get(type);\n if (events) {\n // Find all variables that are supported by this node and have an idle state\n for (const variable of notification.variables\n .filter((v) => !!v.idle)) {\n if ([...variable.states.keys()].some((key) => events.includes(key))) {\n const value = NotificationCCValues\n .notificationVariable(notification.name, variable.name);\n // Set the value to idle if it has no value yet\n // TODO: GH#1028\n // * do this only if the last update was more than 5 minutes ago\n // * schedule an auto-idle if the last update was less than 5 minutes ago but before the current applHost start\n if (this.getValue(ctx, value)\n == undefined) {\n this.setValue(ctx, value, 0);\n }\n }\n }\n }\n }\n }\n }\n }\n // Only create metadata for V1 values if necessary\n if (api.version === 1 || supportsV1Alarm) {\n this.ensureMetadata(ctx, NotificationCCValues.alarmType);\n this.ensureMetadata(ctx, NotificationCCValues.alarmLevel);\n }\n // Also create metadata for values mapped through compat config\n const mappings = ctx.getDeviceConfig?.(this.nodeId as number)\n ?.compat?.alarmMapping;\n if (mappings) {\n // Find all mappings to a valid notification variable\n const supportedNotifications = new Map<number, Set<number>>();\n for (const { to } of mappings) {\n const notification = getNotification(to.notificationType);\n if (!notification)\n continue;\n const valueConfig = getNotificationValue(notification, to.notificationEvent);\n // Remember supported notification types and events to create the internal values later\n if (!supportedNotifications.has(to.notificationType)) {\n supportedNotifications.set(to.notificationType, new Set());\n }\n const supportedNotificationTypesSet = supportedNotifications\n .get(to.notificationType)!;\n supportedNotificationTypesSet.add(to.notificationEvent);\n if (valueConfig?.type !== \"state\")\n continue;\n const notificationValue = NotificationCCValues\n .notificationVariable(notification.name, valueConfig.variableName);\n // Create or update the metadata\n const metadata = getNotificationValueMetadata(this.getMetadata(ctx, notificationValue), notification, valueConfig);\n this.setMetadata(ctx, notificationValue, metadata);\n // Set the value to idle if it has no value yet\n if (valueConfig.idle) {\n // TODO: GH#1028\n // * do this only if the last update was more than 5 minutes ago\n // * schedule an auto-idle if the last update was less than 5 minutes ago but before the current applHost start\n if (this.getValue(ctx, notificationValue) == undefined) {\n this.setValue(ctx, notificationValue, 0);\n }\n }\n }\n // Remember supported notification types and events in the cache\n this.setValue(ctx, NotificationCCValues.supportedNotificationTypes, [...supportedNotifications.keys()]);\n for (const [type, events] of supportedNotifications) {\n this.setValue(ctx, NotificationCCValues.supportedNotificationEvents(type), [...events]);\n }\n }\n // Remember that the interview is complete\n this.setInterviewComplete(ctx, true);\n }\n public async refreshValues(ctx: RefreshValuesContext): Promise<void> {\n const node = this.getNode(ctx)!;\n const endpoint = this.getEndpoint(ctx)!;\n const api = CCAPI.create(CommandClasses.Notification, ctx, endpoint).withOptions({\n priority: MessagePriority.NodeQuery,\n });\n // Load supported notification types and events from cache\n const supportedNotificationTypes = this.getValue<readonly number[]>(ctx, NotificationCCValues.supportedNotificationTypes) ?? [];\n const supportedNotificationNames = supportedNotificationTypes.map(getNotificationName);\n for (let i = 0; i < supportedNotificationTypes.length; i++) {\n const type = supportedNotificationTypes[i];\n const name = supportedNotificationNames[i];\n // Always query each notification for its current status\n ctx.logNode(node.id, {\n endpoint: this.endpointIndex,\n message: `querying notification status for ${name}...`,\n direction: \"outbound\",\n });\n const response = await api.getInternal({\n notificationType: type,\n });\n // NotificationReports don't store their values themselves,\n // because the behaviour is too complex and spans the lifetime\n // of several reports. Thus we handle it in the Node instance\n if (response) {\n // @ts-expect-error\n await node.handleCommand(response);\n }\n }\n // Remember when we did this\n this.setValue(ctx, NotificationCCValues.lastRefresh, Date.now());\n }\n public shouldRefreshValues(this: SinglecastCC<this>, ctx: GetValueDB & GetSupportedCCVersion & GetDeviceConfig & GetNode<NodeId & GetEndpoint<EndpointId & SupportsCC & ControlsCC>>): boolean {\n // Pull-mode nodes must be polled regularly\n const isPullMode = NotificationCC.getNotificationMode(ctx, this.getNode(ctx)!) === \"pull\";\n if (!isPullMode)\n return false;\n const lastUpdated = this.getValue<number>(ctx, NotificationCCValues.lastRefresh);\n return (lastUpdated == undefined\n || Date.now() - lastUpdated > timespan.hours(6));\n }\n}\n// @publicAPI\nexport interface NotificationCCSetOptions {\n notificationType: number;\n notificationStatus: boolean;\n}\nfunction getCCResponseForNotificationCCSet(ctx: GetNode<NodeId & SupportsCC>, sent: NotificationCCSet) {\n // CC:0071.03.06.11.008: A receiving node MAY deny the deactivation\n // of a specific Notification Type. In that case, the receiving node\n // MUST respond to this command with an Application Rejected Request\n // Command.\n if (sent.isSinglecast()\n && !sent.notificationStatus\n && !sent.isEncapsulatedWith(CommandClasses.Supervision)\n && ctx.getNode(sent.nodeId)?.supportsCC(CommandClasses[\"Application Status\"])) {\n return ApplicationStatusCCRejectedRequest;\n }\n}\n@CCCommand(NotificationCommand.Set)\n@expectedCCResponse(getCCResponseForNotificationCCSet)\n@useSupervision()\nexport class NotificationCCSet extends NotificationCC {\n public constructor(options: WithAddress<NotificationCCSetOptions>) {\n super(options);\n this.notificationType = options.notificationType;\n this.notificationStatus = options.notificationStatus;\n }\n public static from(raw: CCRaw, ctx: CCParsingContext): NotificationCCSet {\n validatePayload(raw.payload.length >= 2);\n const notificationType = raw.payload[0];\n const notificationStatus = raw.payload[1] === 0xff;\n return new this({\n nodeId: ctx.sourceNodeId,\n notificationType,\n notificationStatus,\n });\n }\n public notificationType: number;\n public notificationStatus: boolean;\n public serialize(ctx: CCEncodingContext): Promise<Bytes> {\n this.payload = Bytes.from([\n this.notificationType,\n this.notificationStatus ? 0xff : 0x00,\n ]);\n return super.serialize(ctx);\n }\n public toLogEntry(ctx?: GetValueDB): MessageOrCCLogEntry {\n return {\n ...super.toLogEntry(ctx),\n message: {\n \"notification type\": getNotificationName(this.notificationType),\n status: this.notificationStatus,\n },\n };\n }\n}\n// @publicAPI\nexport type NotificationCCReportOptions = {\n alarmType?: number;\n alarmLevel?: number;\n notificationType?: number;\n notificationEvent?: number;\n notificationStatus?: number;\n eventParameters?: BytesView;\n sequenceNumber?: number;\n};\n@CCCommand(NotificationCommand.Report)\n@useSupervision()\nexport class NotificationCCReport extends NotificationCC {\n public constructor(options: WithAddress<NotificationCCReportOptions>) {\n super(options);\n if (options.alarmType != undefined) {\n this.alarmType = options.alarmType;\n this.alarmLevel = options.alarmLevel;\n }\n if (options.notificationType != undefined) {\n this.notificationType = options.notificationType;\n this.notificationStatus = options.notificationStatus ?? true;\n this.notificationEvent = options.notificationEvent;\n this.eventParameters = options.eventParameters;\n this.sequenceNumber = options.sequenceNumber;\n }\n }\n public static from(raw: CCRaw, ctx: CCParsingContext): NotificationCCReport {\n validatePayload(raw.payload.length >= 2);\n const alarmType = raw.payload[0];\n const alarmLevel = raw.payload[1];\n // Byte 2 used to be zensorNetSourceNodeId in V2 and V3, but we don't care about that\n if (raw.payload.length < 7) {\n return new this({\n nodeId: ctx.sourceNodeId,\n alarmType,\n alarmLevel,\n });\n }\n // V2+ requires the alarm bytes to be zero. Manufacturers don't care though, so we don't enforce that.\n // Don't use the version to decide because we might discard notifications\n // before the interview is complete\n const notificationStatus = raw.payload[3];\n const notificationType = raw.payload[4];\n const notificationEvent = raw.payload[5];\n const containsSeqNum = !!(raw.payload[6] & 128);\n const numEventParams = raw.payload[6] & 0b11111;\n let eventParameters: BytesView | undefined;\n if (numEventParams > 0) {\n validatePayload(raw.payload.length >= 7 + numEventParams);\n eventParameters = raw.payload.subarray(7, 7 + numEventParams);\n }\n let sequenceNumber: number | undefined;\n if (containsSeqNum) {\n validatePayload(raw.payload.length >= 7 + numEventParams + 1);\n sequenceNumber = raw.payload[7 + numEventParams];\n }\n return new this({\n nodeId: ctx.sourceNodeId,\n alarmType,\n alarmLevel,\n notificationStatus,\n notificationType,\n notificationEvent,\n eventParameters,\n sequenceNumber,\n });\n }\n public persistValues(ctx: PersistValuesContext): boolean {\n if (!super.persistValues(ctx))\n return false;\n const ccVersion = getEffectiveCCVersion(ctx, this);\n // Check if we need to re-interpret the alarm values somehow\n if (this.alarmType != undefined\n && this.alarmLevel != undefined\n && this.alarmType !== 0) {\n if (ccVersion >= 2) {\n // Check if the device actually supports Notification CC, but chooses\n // to send Alarm frames instead (GH#1034)\n const supportedNotificationTypes = this.getValue<readonly number[]>(ctx, NotificationCCValues.supportedNotificationTypes);\n if (isArray(supportedNotificationTypes)\n && supportedNotificationTypes.includes(this.alarmType)) {\n const supportedNotificationEvents = this.getValue<readonly number[]>(ctx, NotificationCCValues.supportedNotificationEvents(this.alarmType));\n if (isArray(supportedNotificationEvents)\n && supportedNotificationEvents.includes(this.alarmLevel)) {\n // This alarm frame corresponds to a valid notification event\n ctx.logNode(this.nodeId as number, `treating V1 Alarm frame as Notification Report`);\n this.notificationType = this.alarmType;\n this.notificationEvent = this.alarmLevel;\n this.alarmType = undefined;\n this.alarmLevel = undefined;\n }\n }\n }\n else {\n // V1 Alarm, check if there is a compat option to map this V1 report to a V2+ report\n const mapping = ctx.getDeviceConfig?.(this.nodeId as number)?.compat?.alarmMapping;\n const match = mapping?.find((m) => m.from.alarmType === this.alarmType\n && (m.from.alarmLevel == undefined\n || m.from.alarmLevel === this.alarmLevel));\n if (match) {\n ctx.logNode(this.nodeId as number, `compat mapping found, treating V1 Alarm frame as Notification Report`);\n this.notificationType = match.to.notificationType;\n this.notificationEvent = match.to.notificationEvent;\n if (match.to.eventParameters) {\n this.eventParameters = {};\n for (const [key, val] of Object.entries(match.to.eventParameters)) {\n if (typeof val === \"number\") {\n this.eventParameters[key] = val;\n }\n else if (val === \"alarmLevel\") {\n this.eventParameters[key] = this.alarmLevel;\n }\n }\n }\n // After mapping we do not set the legacy V1 values to undefined\n // Otherwise, adding a new mapping will be a breaking change\n }\n }\n }\n // Now we can interpret the event parameters and turn them into something useful\n this.parseEventParameters(ctx);\n if (this.alarmType != undefined) {\n const alarmTypeValue = NotificationCCValues.alarmType;\n this.ensureMetadata(ctx, alarmTypeValue);\n this.setValue(ctx, alarmTypeValue, this.alarmType);\n }\n if (this.alarmLevel != undefined) {\n const alarmLevelValue = NotificationCCValues.alarmLevel;\n this.ensureMetadata(ctx, alarmLevelValue);\n this.setValue(ctx, alarmLevelValue, this.alarmLevel);\n }\n return true;\n }\n public alarmType: number | undefined;\n public alarmLevel: number | undefined;\n public notificationType: number | undefined;\n public notificationStatus: boolean | number | undefined;\n public notificationEvent: number | undefined;\n public eventParameters: BytesView | Duration | Record<string, number> | number | undefined;\n public sequenceNumber: number | undefined;\n public toLogEntry(ctx?: GetValueDB): MessageOrCCLogEntry {\n let message: MessageRecord = {};\n if (this.alarmType) {\n message = {\n \"V1 alarm type\": this.alarmType,\n \"V1 alarm level\": this.alarmLevel!,\n };\n }\n let valueConfig: NotificationValue | undefined;\n if (this.notificationType) {\n const notification = getNotification(this.notificationType);\n if (notification) {\n valueConfig = getNotificationValue(notification, this.notificationEvent!);\n }\n if (valueConfig) {\n message = {\n ...message,\n \"notification type\": getNotificationName(this.notificationType),\n \"notification status\": this.notificationStatus!,\n [`notification ${valueConfig.type}`]: valueConfig.label\n ?? `Unknown (${num2hex(this.notificationEvent)})`,\n };\n }\n else if (this.notificationEvent === 0x00) {\n message = {\n ...message,\n \"notification type\": this.notificationType,\n \"notification status\": this.notificationStatus!,\n \"notification state\": \"idle\",\n };\n }\n else {\n message = {\n ...message,\n \"notification type\": this.notificationType,\n \"notification status\": this.notificationStatus!,\n \"notification event\": num2hex(this.notificationEvent),\n };\n }\n }\n if (this.sequenceNumber != undefined) {\n message[\"sequence number\"] = this.sequenceNumber;\n }\n if (this.eventParameters != undefined) {\n if (typeof this.eventParameters === \"number\") {\n // Try to look up the enum label\n let found = false;\n if (valueConfig?.parameter?.type === \"enum\") {\n const label = valueConfig.parameter.values[this.eventParameters];\n if (label) {\n message[\"state parameters\"] = label;\n found = true;\n }\n }\n if (!found) {\n message[\"state parameters\"] = num2hex(this.eventParameters);\n }\n }\n else if (isUint8Array(this.eventParameters)) {\n message[\"event parameters\"] = buffer2hex(this.eventParameters);\n }\n else if (this.eventParameters instanceof Duration) {\n message[\"event parameters\"] = this.eventParameters.toString();\n }\n else {\n message[\"event parameters\"] = Object.entries(this.eventParameters)\n .map(([param, val]) => `\\n ${param}: ${num2hex(val)}`)\n .join(\"\");\n }\n }\n else if (valueConfig?.parameter?.type === \"enum\"\n && valueConfig.parameter.default != undefined) {\n const label = valueConfig.parameter.values[valueConfig.parameter.default];\n if (label) {\n message[\"state parameters\"] = `${label} (omitted)`;\n }\n }\n return {\n ...super.toLogEntry(ctx),\n message,\n };\n }\n private parseEventParameters(ctx: PersistValuesContext): void {\n // This only makes sense for V2+ notifications\n if (this.notificationType == undefined\n || this.notificationEvent == undefined) {\n return;\n }\n // Look up the received notification and value in the config\n const notification = getNotification(this.notificationType);\n if (!notification)\n return;\n const valueConfig = getNotificationValue(notification, this.notificationEvent);\n if (!valueConfig)\n return;\n // Parse the event parameters if possible\n if (valueConfig.parameter?.type === \"duration\") {\n // This only makes sense if the event parameters are a buffer\n if (!isUint8Array(this.eventParameters)) {\n return;\n }\n // The parameters contain a Duration\n this.eventParameters = Duration.parseReport(this.eventParameters[0]);\n }\n else if (valueConfig.parameter?.type === \"commandclass\") {\n // This only makes sense if the event parameters are a buffer\n if (!isUint8Array(this.eventParameters)) {\n return;\n }\n // The parameters **should** contain a CC, however there might be some exceptions\n if (this.eventParameters.length === 1\n && notification.type === 0x06\n && (this.notificationEvent === 0x05\n || this.notificationEvent === 0x06)) {\n // Access control -> Keypad Lock/Unlock operation\n // Some devices only send the User ID, not a complete CC payload\n this.eventParameters = {\n userId: this.eventParameters[0],\n };\n }\n else {\n // Try to parse the event parameters - if this fails, we should still handle the notification report\n try {\n // Convert CommandClass instances to a standardized object representation\n // We do not want to parse asynchronously here, but the `CommandClass.parse` method is async.\n // However, we only deal with simple CCs that can be parsed synchronously. We can do this\n // by replicating what `CommandClass.parse` does: determine the correct CC class and call its\n // `from` method. If that returns a CC instance, we're good to continue.\n const raw = CCRaw.parse(this.eventParameters);\n if (raw.ccCommand == undefined) {\n validatePayload.fail(\"event parameters contain an invalid CC\");\n }\n const CommandConstructor = getCCCommandConstructor(raw.ccId, raw.ccCommand);\n if (!CommandConstructor) {\n validatePayload.fail(\"event parameters contain an invalid CC\");\n }\n const cc = CommandConstructor.from(raw, {\n ...ctx,\n frameType: \"singlecast\",\n sourceNodeId: this.nodeId as number,\n // Security encapsulation is handled outside of this CC,\n // so it is not needed here:\n hasSecurityClass: () => false,\n getHighestSecurityClass: () => SecurityClass.None,\n setSecurityClass: () => { },\n securityManager: undefined,\n securityManager2: undefined,\n securityManagerLR: undefined,\n });\n if (cc instanceof Promise) {\n validatePayload.fail(\"Cannot asynchronously parse CC from event parameters\");\n }\n validatePayload(!(cc instanceof InvalidCC));\n cc.encapsulatingCC = this as any;\n if (isNotificationEventPayload(cc)) {\n this.eventParameters = cc\n .toNotificationEventParameters();\n }\n else {\n // If a CC has no good toJSON() representation, we're only interested in the payload\n let json = cc.toJSON();\n if (\"nodeId\" in json\n && \"ccId\" in json\n && \"payload\" in json) {\n json = pick(json, [\"payload\"]);\n }\n this.eventParameters = json;\n }\n }\n catch (e) {\n if (isZWaveError(e)\n && e.code\n === ZWaveErrorCodes.PacketFormat_InvalidPayload\n && isUint8Array(this.eventParameters)) {\n const { ccId, ccCommand } = CCRaw.parse(this.eventParameters);\n if (ccId === CommandClasses[\"User Code\"]\n && ccCommand === UserCodeCommand.Report\n && this.eventParameters.length >= 3) {\n // Access control -> Keypad Lock/Unlock operation\n // Some devices report the user code with truncated UserCode reports\n this.eventParameters = {\n userId: this.eventParameters[2],\n };\n }\n else {\n ctx.logNode(this.nodeId as number, `Failed to parse Notification CC event parameters, ignoring them...`, \"error\");\n }\n }\n else {\n // unexpected error\n throw e;\n }\n }\n }\n }\n else if (valueConfig.parameter?.type === \"value\") {\n // This only makes sense if the event parameters are a buffer\n if (!isUint8Array(this.eventParameters)) {\n return;\n }\n // The parameters contain a named value\n this.eventParameters = {\n [valueConfig.parameter.propertyName]: Bytes.view(this.eventParameters)\n .readUIntBE(0, this.eventParameters.length),\n };\n }\n else if (valueConfig.parameter?.type === \"enum\") {\n // The parameters may contain an enum value\n this.eventParameters = isUint8Array(this.eventParameters)\n && this.eventParameters.length === 1\n ? this.eventParameters[0]\n : undefined;\n // Some devices send notifications without an event parameter when they should.\n // In this case, fall back to the default value where possible.\n if (this.eventParameters == undefined\n && valueConfig.parameter.default != undefined) {\n this.eventParameters = valueConfig.parameter.default;\n }\n }\n }\n public serialize(ctx: CCEncodingContext): Promise<Bytes> {\n if (this.notificationType != undefined) {\n if (this.notificationEvent == undefined) {\n throw new ZWaveError(`Notification CC reports requires the notification event to be set!`, ZWaveErrorCodes.Argument_Invalid);\n }\n else if (this.eventParameters != undefined\n && !isUint8Array(this.eventParameters)) {\n throw new ZWaveError(`When sending Notification CC reports, the event parameters can only be buffers!`, ZWaveErrorCodes.Argument_Invalid);\n }\n const controlByte = (this.sequenceNumber != undefined ? 128 : 0)\n | ((this.eventParameters?.length ?? 0) & 0b11111);\n this.payload = Bytes.from([\n 0,\n 0,\n 0,\n 0xff,\n this.notificationType,\n this.notificationEvent,\n controlByte,\n ]);\n if (this.eventParameters) {\n this.payload = Bytes.concat([\n this.payload,\n this.eventParameters,\n ]);\n }\n if (this.sequenceNumber != undefined) {\n this.payload = Bytes.concat([\n this.payload,\n [this.sequenceNumber],\n ]);\n }\n }\n else {\n this.payload = Bytes.from([\n this.alarmType ?? 0x00,\n this.alarmLevel ?? 0x00,\n ]);\n }\n return super.serialize(ctx);\n }\n}\n// @publicAPI\nexport type NotificationCCGetOptions = {\n alarmType: number;\n} | {\n notificationType: number;\n notificationEvent?: number;\n};\n@CCCommand(NotificationCommand.Get)\n@expectedCCResponse(NotificationCCReport)\nexport class NotificationCCGet extends NotificationCC {\n public constructor(options: WithAddress<NotificationCCGetOptions>) {\n super(options);\n if (\"alarmType\" in options) {\n this.alarmType = options.alarmType;\n }\n else {\n this.notificationType = options.notificationType;\n this.notificationEvent = options.notificationEvent;\n }\n }\n public static from(raw: CCRaw, ctx: CCParsingContext): NotificationCCGet {\n validatePayload(raw.payload.length >= 1);\n if (raw.payload.length >= 2) {\n const notificationType = raw.payload[1];\n let notificationEvent: number | undefined;\n if (raw.payload.length >= 3 && notificationType != 0xff) {\n notificationEvent = raw.payload[2];\n }\n return new this({\n nodeId: ctx.sourceNodeId,\n notificationType,\n notificationEvent,\n });\n }\n else {\n const alarmType = raw.payload[0];\n return new this({\n nodeId: ctx.sourceNodeId,\n alarmType,\n });\n }\n }\n /** Proprietary V1/V2 alarm type */\n public alarmType: number | undefined;\n /** Regulated V3+ notification type */\n public notificationType: number | undefined;\n public notificationEvent: number | undefined;\n public serialize(ctx: CCEncodingContext): Promise<Bytes> {\n const notificationEvent = this.notificationEvent === 0xff\n ? 0x00\n : this.notificationEvent;\n this.payload = Bytes.from([\n this.alarmType ?? 0x00,\n this.notificationType ?? 0xff,\n notificationEvent ?? 0x00,\n ]);\n return super.serialize(ctx);\n }\n public toLogEntry(ctx?: GetValueDB): MessageOrCCLogEntry {\n const message: MessageRecord = {};\n if (this.alarmType != undefined) {\n message[\"V1 alarm type\"] = this.alarmType;\n }\n if (this.notificationType != undefined) {\n message[\"notification type\"] = getNotificationName(this.notificationType);\n if (this.notificationEvent != undefined) {\n message[\"notification event\"] = getNotificationEventName(this.notificationType, this.notificationEvent);\n }\n }\n return {\n ...super.toLogEntry(ctx),\n message,\n };\n }\n}\n// @publicAPI\nexport interface NotificationCCSupportedReportOptions {\n supportsV1Alarm: boolean;\n supportedNotificationTypes: number[];\n}\n@CCCommand(NotificationCommand.SupportedReport)\n@ccValueProperty(\"supportsV1Alarm\", NotificationCCValues.supportsV1Alarm)\n@ccValueProperty(\"supportedNotificationTypes\", NotificationCCValues.supportedNotificationTypes)\nexport class NotificationCCSupportedReport extends NotificationCC {\n public constructor(options: WithAddress<NotificationCCSupportedReportOptions>) {\n super(options);\n this.supportsV1Alarm = options.supportsV1Alarm;\n this.supportedNotificationTypes = options.supportedNotificationTypes;\n }\n public static from(raw: CCRaw, ctx: CCParsingContext): NotificationCCSupportedReport {\n validatePayload(raw.payload.length >= 1);\n const supportsV1Alarm = !!(raw.payload[0] & 128);\n const numBitMaskBytes = raw.payload[0] & 31;\n validatePayload(numBitMaskBytes > 0, raw.payload.length >= 1 + numBitMaskBytes);\n const notificationBitMask = raw.payload.subarray(1, 1 + numBitMaskBytes);\n const supportedNotificationTypes = parseBitMask(notificationBitMask, \n // bit 0 is ignored, but counting still starts at 1, so the first bit must have the value 0\n 0);\n return new this({\n nodeId: ctx.sourceNodeId,\n supportsV1Alarm,\n supportedNotificationTypes,\n });\n }\n public supportsV1Alarm: boolean;\n public supportedNotificationTypes: number[];\n public serialize(ctx: CCEncodingContext): Promise<Bytes> {\n const bitMask = encodeBitMask(this.supportedNotificationTypes, Math.max(...this.supportedNotificationTypes), 0);\n this.payload = Bytes.concat([\n [\n (this.supportsV1Alarm ? 128 : 0) | bitMask.length,\n ],\n bitMask,\n ]);\n return super.serialize(ctx);\n }\n public toLogEntry(ctx?: GetValueDB): MessageOrCCLogEntry {\n return {\n ...super.toLogEntry(ctx),\n message: {\n \"supports V1 alarm\": this.supportsV1Alarm,\n \"supported notification types\": this.supportedNotificationTypes\n .map((t) => `\\n\u00B7 ${getNotificationName(t)}`)\n .join(\"\"),\n },\n };\n }\n}\n@CCCommand(NotificationCommand.SupportedGet)\n@expectedCCResponse(NotificationCCSupportedReport)\nexport class NotificationCCSupportedGet extends NotificationCC {\n}\n// @publicAPI\nexport interface NotificationCCEventSupportedReportOptions {\n notificationType: number;\n supportedEvents: number[];\n}\n@CCCommand(NotificationCommand.EventSupportedReport)\nexport class NotificationCCEventSupportedReport extends NotificationCC {\n public constructor(options: WithAddress<NotificationCCEventSupportedReportOptions>) {\n super(options);\n this.notificationType = options.notificationType;\n this.supportedEvents = options.supportedEvents;\n }\n public static from(raw: CCRaw, ctx: CCParsingContext): NotificationCCEventSupportedReport {\n validatePayload(raw.payload.length >= 1);\n const notificationType = raw.payload[0];\n const numBitMaskBytes = raw.payload[1] & 31;\n if (numBitMaskBytes === 0) {\n // Notification type is not supported\n return new this({\n nodeId: ctx.sourceNodeId,\n notificationType,\n supportedEvents: [],\n });\n }\n validatePayload(raw.payload.length >= 2 + numBitMaskBytes);\n const eventBitMask = raw.payload.subarray(2, 2 + numBitMaskBytes);\n const supportedEvents = parseBitMask(eventBitMask, \n // In this mask, bit 0 is ignored, but counting still starts at 1, so the first bit must have the value 0\n 0);\n return new this({\n nodeId: ctx.sourceNodeId,\n notificationType,\n supportedEvents,\n });\n }\n public persistValues(ctx: PersistValuesContext): boolean {\n if (!super.persistValues(ctx))\n return false;\n // Store which events this notification supports\n this.setValue(ctx, NotificationCCValues.supportedNotificationEvents(this.notificationType), this.supportedEvents);\n // For each event, predefine the value metadata\n const notification = getNotification(this.notificationType);\n if (!notification) {\n // This is an unknown notification\n this.setMetadata(ctx, NotificationCCValues.unknownNotificationType(this.notificationType));\n }\n else {\n // This is a standardized notification\n let isFirst = true;\n for (const value of this.supportedEvents) {\n // Find out which property we need to update\n const valueConfig = getNotificationValue(notification, value);\n if (valueConfig?.type === \"state\") {\n const notificationValue = NotificationCCValues\n .notificationVariable(notification.name, valueConfig.variableName);\n // After we've created the metadata initially, extend it\n const metadata = getNotificationValueMetadata(isFirst\n ? undefined\n : this.getMetadata(ctx, notificationValue), notification, valueConfig);\n this.setMetadata(ctx, notificationValue, metadata);\n isFirst = false;\n }\n }\n }\n return true;\n }\n public notificationType: number;\n public supportedEvents: number[];\n public serialize(ctx: CCEncodingContext): Promise<Bytes> {\n this.payload = Bytes.from([this.notificationType, 0]);\n if (this.supportedEvents.length > 0) {\n const bitMask = encodeBitMask(this.supportedEvents, Math.max(...this.supportedEvents), 0);\n this.payload[1] = bitMask.length;\n this.payload = Bytes.concat([this.payload, bitMask]);\n }\n return super.serialize(ctx);\n }\n public toLogEntry(ctx?: GetValueDB): MessageOrCCLogEntry {\n return {\n ...super.toLogEntry(ctx),\n message: {\n \"notification type\": getNotificationName(this.notificationType),\n \"supported events\": this.supportedEvents\n .map((e) => `\\n\u00B7 ${getNotificationValueName(this.notificationType, e)}`)\n .join(\"\"),\n },\n };\n }\n}\n// @publicAPI\nexport interface NotificationCCEventSupportedGetOptions {\n notificationType: number;\n}\n@CCCommand(NotificationCommand.EventSupportedGet)\n@expectedCCResponse(NotificationCCEventSupportedReport)\nexport class NotificationCCEventSupportedGet extends NotificationCC {\n public constructor(options: WithAddress<NotificationCCEventSupportedGetOptions>) {\n super(options);\n this.notificationType = options.notificationType;\n }\n public static from(raw: CCRaw, ctx: CCParsingContext): NotificationCCEventSupportedGet {\n validatePayload(raw.payload.length >= 1);\n const notificationType = raw.payload[0];\n return new this({\n nodeId: ctx.sourceNodeId,\n notificationType,\n });\n }\n public notificationType: number;\n public serialize(ctx: CCEncodingContext): Promise<Bytes> {\n this.payload = Bytes.from([this.notificationType]);\n return super.serialize(ctx);\n }\n public toLogEntry(ctx?: GetValueDB): MessageOrCCLogEntry {\n return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
"sources": ["../../../
|
|
4
|
-
"sourcesContent": [
|
|
3
|
+
"sources": ["../../../src_gen/cc/PowerlevelCC._validateArgs.ts"],
|
|
4
|
+
"sourcesContent": ["import * as v from \"@zwave-js/core/validation\";\n\nexport function validateArgs_PowerlevelCCAPI_setCustomPowerlevel() {\n\treturn <T extends Function>(__decoratedMethod: T, { kind }: ClassMethodDecoratorContext): T | void => {\n\t\tif (kind === \"method\") {\n\t\t\treturn function setCustomPowerlevel(this: any, powerlevel: unknown, timeout: unknown) {\n\t\t\t\tv.assert(\n\t\t\t\t\tv.enum({ kind: \"parameter\", name: \"powerlevel\" }, \"Powerlevel\", [0, 1, 2, 3, 4, 5, 6, 7, 8, 9])(powerlevel),\n\n\t\t\t\t\tv.primitive({ kind: \"parameter\", name: \"timeout\" }, \"number\")(timeout),\n\t\t\t\t);\n\t\t\t\treturn __decoratedMethod.call(this, powerlevel, timeout);\n\t\t\t} as unknown as T;\n\t\t}\n\t};\n}\n\nexport function validateArgs_PowerlevelCCAPI_reportPowerlevel() {\n\treturn <T extends Function>(__decoratedMethod: T, { kind }: ClassMethodDecoratorContext): T | void => {\n\t\tif (kind === \"method\") {\n\t\t\treturn function reportPowerlevel(this: any, options: unknown) {\n\t\t\t\tv.assert(\n\t\t\t\t\tv.oneOf({ kind: \"parameter\", name: \"options\" }, \"PowerlevelCCReportOptions\", v.object({ kind: \"parameter\", name: \"options\" }, '<anonymous object>', { \"powerlevel\": v.literal({ kind: \"property\", name: \"powerlevel\" }, 0), \"timeout\": v.undefined({ kind: \"property\", name: \"timeout\" }) }), v.object({ kind: \"parameter\", name: \"options\" }, '<anonymous object>', { \"powerlevel\": v.oneOf({ kind: \"property\", name: \"powerlevel\" }, undefined, v.literal({ kind: \"property\", name: \"powerlevel\" }, 1), v.literal({ kind: \"property\", name: \"powerlevel\" }, 2), v.literal({ kind: \"property\", name: \"powerlevel\" }, 3), v.literal({ kind: \"property\", name: \"powerlevel\" }, 4), v.literal({ kind: \"property\", name: \"powerlevel\" }, 5), v.literal({ kind: \"property\", name: \"powerlevel\" }, 6), v.literal({ kind: \"property\", name: \"powerlevel\" }, 7), v.literal({ kind: \"property\", name: \"powerlevel\" }, 8), v.literal({ kind: \"property\", name: \"powerlevel\" }, 9)), \"timeout\": v.primitive({ kind: \"property\", name: \"timeout\" }, \"number\") }))(options),\n\t\t\t\t);\n\t\t\t\treturn __decoratedMethod.call(this, options);\n\t\t\t} as unknown as T;\n\t\t}\n\t};\n}\n\nexport function validateArgs_PowerlevelCCAPI_startNodeTest() {\n\treturn <T extends Function>(__decoratedMethod: T, { kind }: ClassMethodDecoratorContext): T | void => {\n\t\tif (kind === \"method\") {\n\t\t\treturn function startNodeTest(this: any, testNodeId: unknown, powerlevel: unknown, testFrameCount: unknown) {\n\t\t\t\tv.assert(\n\t\t\t\t\tv.primitive({ kind: \"parameter\", name: \"testNodeId\" }, \"number\")(testNodeId),\n\n\t\t\t\t\tv.enum({ kind: \"parameter\", name: \"powerlevel\" }, \"Powerlevel\", [0, 1, 2, 3, 4, 5, 6, 7, 8, 9])(powerlevel),\n\n\t\t\t\t\tv.primitive({ kind: \"parameter\", name: \"testFrameCount\" }, \"number\")(testFrameCount),\n\t\t\t\t);\n\t\t\t\treturn __decoratedMethod.call(this, testNodeId, powerlevel, testFrameCount);\n\t\t\t} as unknown as T;\n\t\t}\n\t};\n}\n\nexport function validateArgs_PowerlevelCCAPI_sendNodeTestReport() {\n\treturn <T extends Function>(__decoratedMethod: T, { kind }: ClassMethodDecoratorContext): T | void => {\n\t\tif (kind === \"method\") {\n\t\t\treturn function sendNodeTestReport(this: any, options: unknown) {\n\t\t\t\tv.assert(\n\t\t\t\t\tv.object({ kind: \"parameter\", name: \"options\" }, 'PowerlevelCCTestNodeReportOptions', { \"testNodeId\": v.primitive({ kind: \"property\", name: \"testNodeId\" }, \"number\"), \"status\": v.enum({ kind: \"property\", name: \"status\" }, \"PowerlevelTestStatus\"), \"acknowledgedFrames\": v.primitive({ kind: \"property\", name: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+C;AAC9D,SAAO,CAAqB,mBAAsB,EAAE,KAAI,MAA6C;AACpG,QAAI,SAAS,UAAU;AACtB,aAAO,gCAAS,mBAA8B,SAAgB;AAC7D,UAAE,OACD,EAAE,OAAO,EAAE,MAAM,aAAa,MAAM,UAAS,GAAI,qCAAqC,EAAE,cAAc,EAAE,UAAU,EAAE,MAAM,YAAY,MAAM,aAAY,GAAI,QAAQ,GAAG,UAAU,EAAE,KAAK,EAAE,MAAM,YAAY,MAAM,SAAQ,GAAI,sBAAsB,GAAG,sBAAsB,EAAE,UAAU,EAAE,MAAM,YAAY,MAAM,qBAAoB,GAAI,QAAQ,EAAC,CAAE,EAAE,OAAO,CAAC;AAEjW,eAAO,kBAAkB,KAAK,MAAM,OAAO;MAC5C,GALO;IAMR;EACD;AACD;AAXgB;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import type { CCEncodingContext, CCParsingContext } from "@zwave-js/cc";
|
|
2
1
|
import { type GetValueDB, type MaybeNotKnown, type MessageOrCCLogEntry, type SupervisionResult, type WithAddress } from "@zwave-js/core";
|
|
3
2
|
import { Bytes } from "@zwave-js/shared";
|
|
4
3
|
import { PhysicalCCAPI } from "../lib/API.js";
|
|
5
4
|
import { type CCRaw, CommandClass } from "../lib/CommandClass.js";
|
|
6
5
|
import { Powerlevel, PowerlevelCommand, PowerlevelTestStatus } from "../lib/_Types.js";
|
|
6
|
+
import type { CCEncodingContext, CCParsingContext } from "../lib/traits.js";
|
|
7
7
|
export declare class PowerlevelCCAPI extends PhysicalCCAPI {
|
|
8
8
|
supportsCommand(cmd: PowerlevelCommand): MaybeNotKnown<boolean>;
|
|
9
9
|
setNormalPowerlevel(): Promise<SupervisionResult | undefined>;
|
|
@@ -107,9 +107,9 @@ let PowerlevelCCAPI = (() => {
|
|
|
107
107
|
}
|
|
108
108
|
static {
|
|
109
109
|
const _metadata = typeof Symbol === "function" && Symbol.metadata ? Object.create(_classSuper[Symbol.metadata] ?? null) : void 0;
|
|
110
|
-
_setCustomPowerlevel_decorators = [validateArgs_PowerlevelCCAPI_setCustomPowerlevel(
|
|
110
|
+
_setCustomPowerlevel_decorators = [validateArgs_PowerlevelCCAPI_setCustomPowerlevel()];
|
|
111
111
|
_reportPowerlevel_decorators = [validateArgs_PowerlevelCCAPI_reportPowerlevel()];
|
|
112
|
-
_startNodeTest_decorators = [validateArgs_PowerlevelCCAPI_startNodeTest(
|
|
112
|
+
_startNodeTest_decorators = [validateArgs_PowerlevelCCAPI_startNodeTest()];
|
|
113
113
|
_sendNodeTestReport_decorators = [validateArgs_PowerlevelCCAPI_sendNodeTestReport()];
|
|
114
114
|
__esDecorate(this, null, _setCustomPowerlevel_decorators, { kind: "method", name: "setCustomPowerlevel", static: false, private: false, access: { has: /* @__PURE__ */ __name((obj) => "setCustomPowerlevel" in obj, "has"), get: /* @__PURE__ */ __name((obj) => obj.setCustomPowerlevel, "get") }, metadata: _metadata }, null, _instanceExtraInitializers);
|
|
115
115
|
__esDecorate(this, null, _reportPowerlevel_decorators, { kind: "method", name: "reportPowerlevel", static: false, private: false, access: { has: /* @__PURE__ */ __name((obj) => "reportPowerlevel" in obj, "has"), get: /* @__PURE__ */ __name((obj) => obj.reportPowerlevel, "get") }, metadata: _metadata }, null, _instanceExtraInitializers);
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
|
-
"sources": ["../../../
|
|
4
|
-
"sourcesContent": ["import type { CCEncodingContext, CCParsingContext } from \"@zwave-js/cc\";\nimport {\n\tCommandClasses,\n\ttype GetValueDB,\n\ttype MaybeNotKnown,\n\ttype MessageOrCCLogEntry,\n\ttype MessageRecord,\n\tNodeStatus,\n\ttype SupervisionResult,\n\ttype WithAddress,\n\tZWaveError,\n\tZWaveErrorCodes,\n\tvalidatePayload,\n} from \"@zwave-js/core\";\nimport { Bytes, getEnumMemberName, pick } from \"@zwave-js/shared\";\nimport { validateArgs } from \"@zwave-js/transformers\";\nimport { PhysicalCCAPI } from \"../lib/API.js\";\nimport { type CCRaw, CommandClass } from \"../lib/CommandClass.js\";\nimport {\n\tAPI,\n\tCCCommand,\n\tcommandClass,\n\texpectedCCResponse,\n\timplementedVersion,\n\tuseSupervision,\n} from \"../lib/CommandClassDecorators.js\";\nimport {\n\tPowerlevel,\n\tPowerlevelCommand,\n\tPowerlevelTestStatus,\n} from \"../lib/_Types.js\";\n\n@API(CommandClasses.Powerlevel)\nexport class PowerlevelCCAPI extends PhysicalCCAPI {\n\tpublic supportsCommand(cmd: PowerlevelCommand): MaybeNotKnown<boolean> {\n\t\tswitch (cmd) {\n\t\t\tcase PowerlevelCommand.Get:\n\t\t\tcase PowerlevelCommand.Report:\n\t\t\tcase PowerlevelCommand.TestNodeGet:\n\t\t\tcase PowerlevelCommand.TestNodeReport:\n\t\t\t\treturn this.isSinglecast();\n\n\t\t\tcase PowerlevelCommand.Set:\n\t\t\tcase PowerlevelCommand.TestNodeSet:\n\t\t\t\treturn true;\n\t\t}\n\t\treturn super.supportsCommand(cmd);\n\t}\n\n\tpublic async setNormalPowerlevel(): Promise<SupervisionResult | undefined> {\n\t\tthis.assertSupportsCommand(PowerlevelCommand, PowerlevelCommand.Set);\n\n\t\tconst cc = new PowerlevelCCSet({\n\t\t\tnodeId: this.endpoint.nodeId,\n\t\t\tendpointIndex: this.endpoint.index,\n\t\t\tpowerlevel: Powerlevel[\"Normal Power\"],\n\t\t});\n\t\treturn this.host.sendCommand(cc, this.commandOptions);\n\t}\n\n\t@validateArgs({ strictEnums: true })\n\tpublic async setCustomPowerlevel(\n\t\tpowerlevel: Powerlevel,\n\t\ttimeout: number,\n\t): Promise<SupervisionResult | undefined> {\n\t\tthis.assertSupportsCommand(PowerlevelCommand, PowerlevelCommand.Set);\n\n\t\tconst cc = new PowerlevelCCSet({\n\t\t\tnodeId: this.endpoint.nodeId,\n\t\t\tendpointIndex: this.endpoint.index,\n\t\t\tpowerlevel,\n\t\t\ttimeout,\n\t\t});\n\t\treturn this.host.sendCommand(cc, this.commandOptions);\n\t}\n\n\tpublic async getPowerlevel(): Promise<\n\t\tMaybeNotKnown<Pick<PowerlevelCCReport, \"powerlevel\" | \"timeout\">>\n\t> {\n\t\tthis.assertSupportsCommand(PowerlevelCommand, PowerlevelCommand.Get);\n\n\t\tconst cc = new PowerlevelCCGet({\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<PowerlevelCCReport>(\n\t\t\tcc,\n\t\t\tthis.commandOptions,\n\t\t);\n\t\tif (response) {\n\t\t\treturn pick(response, [\"powerlevel\", \"timeout\"]);\n\t\t}\n\t}\n\n\t@validateArgs()\n\tpublic async reportPowerlevel(\n\t\toptions: PowerlevelCCReportOptions,\n\t): Promise<void> {\n\t\tthis.assertSupportsCommand(PowerlevelCommand, PowerlevelCommand.Report);\n\n\t\tconst cc = new PowerlevelCCReport({\n\t\t\tnodeId: this.endpoint.nodeId,\n\t\t\tendpointIndex: this.endpoint.index,\n\t\t\t...options,\n\t\t});\n\t\tawait this.host.sendCommand(cc, this.commandOptions);\n\t}\n\n\t@validateArgs({ strictEnums: true })\n\tpublic async startNodeTest(\n\t\ttestNodeId: number,\n\t\tpowerlevel: Powerlevel,\n\t\ttestFrameCount: number,\n\t): Promise<SupervisionResult | undefined> {\n\t\tthis.assertSupportsCommand(\n\t\t\tPowerlevelCommand,\n\t\t\tPowerlevelCommand.TestNodeSet,\n\t\t);\n\n\t\tif (testNodeId === this.endpoint.nodeId) {\n\t\t\tthrow new ZWaveError(\n\t\t\t\t`For a powerlevel test, the test node ID must different from the source node ID.`,\n\t\t\t\tZWaveErrorCodes.Argument_Invalid,\n\t\t\t);\n\t\t}\n\t\tconst testNode = this.host.getNodeOrThrow(testNodeId);\n\t\tif (testNode.isFrequentListening) {\n\t\t\tthrow new ZWaveError(\n\t\t\t\t`Node ${testNodeId} is FLiRS and therefore cannot be used for a powerlevel test.`,\n\t\t\t\tZWaveErrorCodes.PowerlevelCC_UnsupportedTestNode,\n\t\t\t);\n\t\t}\n\t\tif (testNode.canSleep && testNode.status !== NodeStatus.Awake) {\n\t\t\tthrow new ZWaveError(\n\t\t\t\t`Node ${testNodeId} is not awake and therefore cannot be used for a powerlevel test.`,\n\t\t\t\tZWaveErrorCodes.PowerlevelCC_UnsupportedTestNode,\n\t\t\t);\n\t\t}\n\n\t\tconst cc = new PowerlevelCCTestNodeSet({\n\t\t\tnodeId: this.endpoint.nodeId,\n\t\t\tendpointIndex: this.endpoint.index,\n\t\t\ttestNodeId,\n\t\t\tpowerlevel,\n\t\t\ttestFrameCount,\n\t\t});\n\t\treturn this.host.sendCommand(cc, this.commandOptions);\n\t}\n\n\tpublic async getNodeTestStatus(): Promise<\n\t\tMaybeNotKnown<\n\t\t\tPick<\n\t\t\t\tPowerlevelCCTestNodeReport,\n\t\t\t\t\"testNodeId\" | \"status\" | \"acknowledgedFrames\"\n\t\t\t>\n\t\t>\n\t> {\n\t\tthis.assertSupportsCommand(\n\t\t\tPowerlevelCommand,\n\t\t\tPowerlevelCommand.TestNodeGet,\n\t\t);\n\n\t\tconst cc = new PowerlevelCCTestNodeGet({\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\tPowerlevelCCTestNodeReport\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\"testNodeId\",\n\t\t\t\t\"status\",\n\t\t\t\t\"acknowledgedFrames\",\n\t\t\t]);\n\t\t}\n\t}\n\n\t@validateArgs()\n\tpublic async sendNodeTestReport(\n\t\toptions: PowerlevelCCTestNodeReportOptions,\n\t): Promise<void> {\n\t\tthis.assertSupportsCommand(\n\t\t\tPowerlevelCommand,\n\t\t\tPowerlevelCommand.TestNodeReport,\n\t\t);\n\n\t\tconst cc = new PowerlevelCCTestNodeReport({\n\t\t\tnodeId: this.endpoint.nodeId,\n\t\t\tendpointIndex: this.endpoint.index,\n\t\t\t...options,\n\t\t});\n\t\tawait this.host.sendCommand(cc, this.commandOptions);\n\t}\n}\n\n@commandClass(CommandClasses.Powerlevel)\n@implementedVersion(1)\nexport class PowerlevelCC extends CommandClass {\n\tdeclare ccCommand: PowerlevelCommand;\n}\n\n// @publicAPI\nexport type PowerlevelCCSetOptions =\n\t| {\n\t\tpowerlevel: Powerlevel;\n\t\ttimeout: number;\n\t}\n\t| {\n\t\tpowerlevel: (typeof Powerlevel)[\"Normal Power\"];\n\t\ttimeout?: undefined;\n\t};\n\n@CCCommand(PowerlevelCommand.Set)\n@useSupervision()\nexport class PowerlevelCCSet extends PowerlevelCC {\n\tpublic constructor(\n\t\toptions: WithAddress<PowerlevelCCSetOptions>,\n\t) {\n\t\tsuper(options);\n\t\tthis.powerlevel = options.powerlevel;\n\t\tif (options.powerlevel !== Powerlevel[\"Normal Power\"]) {\n\t\t\tif (options.timeout < 1 || options.timeout > 255) {\n\t\t\t\tthrow new ZWaveError(\n\t\t\t\t\t`The timeout parameter must be between 1 and 255.`,\n\t\t\t\t\tZWaveErrorCodes.Argument_Invalid,\n\t\t\t\t);\n\t\t\t}\n\t\t\tthis.timeout = options.timeout;\n\t\t}\n\t}\n\n\tpublic static from(raw: CCRaw, ctx: CCParsingContext): PowerlevelCCSet {\n\t\tvalidatePayload(raw.payload.length >= 1);\n\t\tconst powerlevel: Powerlevel = raw.payload[0];\n\n\t\tif (powerlevel === Powerlevel[\"Normal Power\"]) {\n\t\t\treturn new this({\n\t\t\t\tnodeId: ctx.sourceNodeId,\n\t\t\t\tpowerlevel,\n\t\t\t});\n\t\t} else {\n\t\t\tvalidatePayload(raw.payload.length >= 2);\n\t\t\tconst timeout = raw.payload[1];\n\t\t\treturn new this({\n\t\t\t\tnodeId: ctx.sourceNodeId,\n\t\t\t\tpowerlevel,\n\t\t\t\ttimeout,\n\t\t\t});\n\t\t}\n\t}\n\n\tpublic powerlevel: Powerlevel;\n\tpublic timeout?: number;\n\n\tpublic serialize(ctx: CCEncodingContext): Promise<Bytes> {\n\t\tthis.payload = Bytes.from([this.powerlevel, this.timeout ?? 0x00]);\n\t\treturn super.serialize(ctx);\n\t}\n\n\tpublic toLogEntry(ctx?: GetValueDB): MessageOrCCLogEntry {\n\t\tconst message: MessageRecord = {\n\t\t\t\"power level\": getEnumMemberName(Powerlevel, this.powerlevel),\n\t\t};\n\t\tif (this.timeout != undefined) {\n\t\t\tmessage.timeout = `${this.timeout} s`;\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 type PowerlevelCCReportOptions = {\n\tpowerlevel: typeof Powerlevel[\"Normal Power\"];\n\ttimeout?: undefined;\n} | {\n\tpowerlevel: Exclude<Powerlevel, typeof Powerlevel[\"Normal Power\"]>;\n\ttimeout: number;\n};\n\n@CCCommand(PowerlevelCommand.Report)\nexport class PowerlevelCCReport extends PowerlevelCC {\n\tpublic constructor(\n\t\toptions: WithAddress<PowerlevelCCReportOptions>,\n\t) {\n\t\tsuper(options);\n\n\t\tthis.powerlevel = options.powerlevel;\n\t\tthis.timeout = options.timeout;\n\t}\n\n\tpublic static from(raw: CCRaw, ctx: CCParsingContext): PowerlevelCCReport {\n\t\tvalidatePayload(raw.payload.length >= 1);\n\t\tconst powerlevel: Powerlevel = raw.payload[0];\n\n\t\tif (powerlevel === Powerlevel[\"Normal Power\"]) {\n\t\t\treturn new this({\n\t\t\t\tnodeId: ctx.sourceNodeId,\n\t\t\t\tpowerlevel,\n\t\t\t});\n\t\t} else {\n\t\t\tvalidatePayload(raw.payload.length >= 2);\n\t\t\tconst timeout = raw.payload[1];\n\t\t\treturn new this({\n\t\t\t\tnodeId: ctx.sourceNodeId,\n\t\t\t\tpowerlevel,\n\t\t\t\ttimeout,\n\t\t\t});\n\t\t}\n\t}\n\n\tpublic readonly powerlevel: Powerlevel;\n\tpublic readonly timeout?: number;\n\n\tpublic serialize(ctx: CCEncodingContext): Promise<Bytes> {\n\t\tthis.payload = Bytes.from([this.powerlevel, this.timeout ?? 0x00]);\n\t\treturn super.serialize(ctx);\n\t}\n\n\tpublic toLogEntry(ctx?: GetValueDB): MessageOrCCLogEntry {\n\t\tconst message: MessageRecord = {\n\t\t\t\"power level\": getEnumMemberName(Powerlevel, this.powerlevel),\n\t\t};\n\t\tif (this.timeout != undefined) {\n\t\t\tmessage.timeout = `${this.timeout} s`;\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@CCCommand(PowerlevelCommand.Get)\n@expectedCCResponse(PowerlevelCCReport)\nexport class PowerlevelCCGet extends PowerlevelCC {}\n\n// @publicAPI\nexport interface PowerlevelCCTestNodeSetOptions {\n\ttestNodeId: number;\n\tpowerlevel: Powerlevel;\n\ttestFrameCount: number;\n}\n\n@CCCommand(PowerlevelCommand.TestNodeSet)\n@useSupervision()\nexport class PowerlevelCCTestNodeSet extends PowerlevelCC {\n\tpublic constructor(\n\t\toptions: WithAddress<PowerlevelCCTestNodeSetOptions>,\n\t) {\n\t\tsuper(options);\n\t\tthis.testNodeId = options.testNodeId;\n\t\tthis.powerlevel = options.powerlevel;\n\t\tthis.testFrameCount = options.testFrameCount;\n\t}\n\n\tpublic static from(\n\t\traw: CCRaw,\n\t\tctx: CCParsingContext,\n\t): PowerlevelCCTestNodeSet {\n\t\tvalidatePayload(raw.payload.length >= 4);\n\t\tconst testNodeId = raw.payload[0];\n\t\tconst powerlevel: Powerlevel = raw.payload[1];\n\t\tconst testFrameCount = raw.payload.readUInt16BE(2);\n\n\t\treturn new this({\n\t\t\tnodeId: ctx.sourceNodeId,\n\t\t\ttestNodeId,\n\t\t\tpowerlevel,\n\t\t\ttestFrameCount,\n\t\t});\n\t}\n\n\tpublic testNodeId: number;\n\tpublic powerlevel: Powerlevel;\n\tpublic testFrameCount: number;\n\n\tpublic serialize(ctx: CCEncodingContext): Promise<Bytes> {\n\t\tthis.payload = Bytes.from([this.testNodeId, this.powerlevel, 0, 0]);\n\t\tthis.payload.writeUInt16BE(this.testFrameCount, 2);\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\"test node id\": this.testNodeId,\n\t\t\t\t\"power level\": getEnumMemberName(Powerlevel, this.powerlevel),\n\t\t\t\t\"test frame count\": this.testFrameCount,\n\t\t\t},\n\t\t};\n\t}\n}\n\n// @publicAPI\nexport interface PowerlevelCCTestNodeReportOptions {\n\ttestNodeId: number;\n\tstatus: PowerlevelTestStatus;\n\tacknowledgedFrames: number;\n}\n\n@CCCommand(PowerlevelCommand.TestNodeReport)\nexport class PowerlevelCCTestNodeReport extends PowerlevelCC {\n\tpublic constructor(\n\t\toptions: WithAddress<PowerlevelCCTestNodeReportOptions>,\n\t) {\n\t\tsuper(options);\n\n\t\tthis.testNodeId = options.testNodeId;\n\t\tthis.status = options.status;\n\t\tthis.acknowledgedFrames = options.acknowledgedFrames;\n\t}\n\n\tpublic static from(\n\t\traw: CCRaw,\n\t\tctx: CCParsingContext,\n\t): PowerlevelCCTestNodeReport {\n\t\tvalidatePayload(raw.payload.length >= 4);\n\t\tconst testNodeId = raw.payload[0];\n\t\tconst status: PowerlevelTestStatus = raw.payload[1];\n\t\tconst acknowledgedFrames = raw.payload.readUInt16BE(2);\n\n\t\treturn new this({\n\t\t\tnodeId: ctx.sourceNodeId,\n\t\t\ttestNodeId,\n\t\t\tstatus,\n\t\t\tacknowledgedFrames,\n\t\t});\n\t}\n\n\tpublic testNodeId: number;\n\tpublic status: PowerlevelTestStatus;\n\tpublic acknowledgedFrames: number;\n\n\tpublic serialize(ctx: CCEncodingContext): Promise<Bytes> {\n\t\tthis.payload = Bytes.from([\n\t\t\tthis.testNodeId,\n\t\t\tthis.status,\n\t\t\t// Placeholder for acknowledged frames\n\t\t\t0,\n\t\t\t0,\n\t\t]);\n\t\tthis.payload.writeUInt16BE(this.acknowledgedFrames, 2);\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\"test node id\": this.testNodeId,\n\t\t\t\tstatus: getEnumMemberName(PowerlevelTestStatus, this.status),\n\t\t\t\t\"acknowledged frames\": this.acknowledgedFrames,\n\t\t\t},\n\t\t};\n\t}\n}\n\n@CCCommand(PowerlevelCommand.TestNodeGet)\n@expectedCCResponse(PowerlevelCCTestNodeReport)\nexport class PowerlevelCCTestNodeGet extends PowerlevelCC {}\n"],
|
|
5
|
-
"mappings": "
|
|
3
|
+
"sources": ["../../../src_gen/cc/PowerlevelCC.ts"],
|
|
4
|
+
"sourcesContent": ["import * as __validateArgs from \"./PowerlevelCC._validateArgs.js\";\nconst { validateArgs_PowerlevelCCAPI_setCustomPowerlevel, validateArgs_PowerlevelCCAPI_reportPowerlevel, validateArgs_PowerlevelCCAPI_startNodeTest, validateArgs_PowerlevelCCAPI_sendNodeTestReport } = __validateArgs;\nimport { CommandClasses, type GetValueDB, type MaybeNotKnown, type MessageOrCCLogEntry, type MessageRecord, NodeStatus, type SupervisionResult, type WithAddress, ZWaveError, ZWaveErrorCodes, validatePayload, } from \"@zwave-js/core\";\nimport { Bytes, getEnumMemberName, pick } from \"@zwave-js/shared\";\nimport { PhysicalCCAPI } from \"../lib/API.js\";\nimport { type CCRaw, CommandClass } from \"../lib/CommandClass.js\";\nimport { API, CCCommand, commandClass, expectedCCResponse, implementedVersion, useSupervision, } from \"../lib/CommandClassDecorators.js\";\nimport { Powerlevel, PowerlevelCommand, PowerlevelTestStatus, } from \"../lib/_Types.js\";\nimport type { CCEncodingContext, CCParsingContext } from \"../lib/traits.js\";\n@API(CommandClasses.Powerlevel)\nexport class PowerlevelCCAPI extends PhysicalCCAPI {\n public supportsCommand(cmd: PowerlevelCommand): MaybeNotKnown<boolean> {\n switch (cmd) {\n case PowerlevelCommand.Get:\n case PowerlevelCommand.Report:\n case PowerlevelCommand.TestNodeGet:\n case PowerlevelCommand.TestNodeReport:\n return this.isSinglecast();\n case PowerlevelCommand.Set:\n case PowerlevelCommand.TestNodeSet:\n return true;\n }\n return super.supportsCommand(cmd);\n }\n public async setNormalPowerlevel(): Promise<SupervisionResult | undefined> {\n this.assertSupportsCommand(PowerlevelCommand, PowerlevelCommand.Set);\n const cc = new PowerlevelCCSet({\n nodeId: this.endpoint.nodeId,\n endpointIndex: this.endpoint.index,\n powerlevel: Powerlevel[\"Normal Power\"],\n });\n return this.host.sendCommand(cc, this.commandOptions);\n }\n @validateArgs_PowerlevelCCAPI_setCustomPowerlevel()\n public async setCustomPowerlevel(powerlevel: Powerlevel, timeout: number): Promise<SupervisionResult | undefined> {\n this.assertSupportsCommand(PowerlevelCommand, PowerlevelCommand.Set);\n const cc = new PowerlevelCCSet({\n nodeId: this.endpoint.nodeId,\n endpointIndex: this.endpoint.index,\n powerlevel,\n timeout,\n });\n return this.host.sendCommand(cc, this.commandOptions);\n }\n public async getPowerlevel(): Promise<MaybeNotKnown<Pick<PowerlevelCCReport, \"powerlevel\" | \"timeout\">>> {\n this.assertSupportsCommand(PowerlevelCommand, PowerlevelCommand.Get);\n const cc = new PowerlevelCCGet({\n nodeId: this.endpoint.nodeId,\n endpointIndex: this.endpoint.index,\n });\n const response = await this.host.sendCommand<PowerlevelCCReport>(cc, this.commandOptions);\n if (response) {\n return pick(response, [\"powerlevel\", \"timeout\"]);\n }\n }\n @validateArgs_PowerlevelCCAPI_reportPowerlevel()\n public async reportPowerlevel(options: PowerlevelCCReportOptions): Promise<void> {\n this.assertSupportsCommand(PowerlevelCommand, PowerlevelCommand.Report);\n const cc = new PowerlevelCCReport({\n nodeId: this.endpoint.nodeId,\n endpointIndex: this.endpoint.index,\n ...options,\n });\n await this.host.sendCommand(cc, this.commandOptions);\n }\n @validateArgs_PowerlevelCCAPI_startNodeTest()\n public async startNodeTest(testNodeId: number, powerlevel: Powerlevel, testFrameCount: number): Promise<SupervisionResult | undefined> {\n this.assertSupportsCommand(PowerlevelCommand, PowerlevelCommand.TestNodeSet);\n if (testNodeId === this.endpoint.nodeId) {\n throw new ZWaveError(`For a powerlevel test, the test node ID must different from the source node ID.`, ZWaveErrorCodes.Argument_Invalid);\n }\n const testNode = this.host.getNodeOrThrow(testNodeId);\n if (testNode.isFrequentListening) {\n throw new ZWaveError(`Node ${testNodeId} is FLiRS and therefore cannot be used for a powerlevel test.`, ZWaveErrorCodes.PowerlevelCC_UnsupportedTestNode);\n }\n if (testNode.canSleep && testNode.status !== NodeStatus.Awake) {\n throw new ZWaveError(`Node ${testNodeId} is not awake and therefore cannot be used for a powerlevel test.`, ZWaveErrorCodes.PowerlevelCC_UnsupportedTestNode);\n }\n const cc = new PowerlevelCCTestNodeSet({\n nodeId: this.endpoint.nodeId,\n endpointIndex: this.endpoint.index,\n testNodeId,\n powerlevel,\n testFrameCount,\n });\n return this.host.sendCommand(cc, this.commandOptions);\n }\n public async getNodeTestStatus(): Promise<MaybeNotKnown<Pick<PowerlevelCCTestNodeReport, \"testNodeId\" | \"status\" | \"acknowledgedFrames\">>> {\n this.assertSupportsCommand(PowerlevelCommand, PowerlevelCommand.TestNodeGet);\n const cc = new PowerlevelCCTestNodeGet({\n nodeId: this.endpoint.nodeId,\n endpointIndex: this.endpoint.index,\n });\n const response = await this.host.sendCommand<PowerlevelCCTestNodeReport>(cc, this.commandOptions);\n if (response) {\n return pick(response, [\n \"testNodeId\",\n \"status\",\n \"acknowledgedFrames\",\n ]);\n }\n }\n @validateArgs_PowerlevelCCAPI_sendNodeTestReport()\n public async sendNodeTestReport(options: PowerlevelCCTestNodeReportOptions): Promise<void> {\n this.assertSupportsCommand(PowerlevelCommand, PowerlevelCommand.TestNodeReport);\n const cc = new PowerlevelCCTestNodeReport({\n nodeId: this.endpoint.nodeId,\n endpointIndex: this.endpoint.index,\n ...options,\n });\n await this.host.sendCommand(cc, this.commandOptions);\n }\n}\n@commandClass(CommandClasses.Powerlevel)\n@implementedVersion(1)\nexport class PowerlevelCC extends CommandClass {\n declare ccCommand: PowerlevelCommand;\n}\n// @publicAPI\nexport type PowerlevelCCSetOptions = {\n powerlevel: Powerlevel;\n timeout: number;\n} | {\n powerlevel: (typeof Powerlevel)[\"Normal Power\"];\n timeout?: undefined;\n};\n@CCCommand(PowerlevelCommand.Set)\n@useSupervision()\nexport class PowerlevelCCSet extends PowerlevelCC {\n public constructor(options: WithAddress<PowerlevelCCSetOptions>) {\n super(options);\n this.powerlevel = options.powerlevel;\n if (options.powerlevel !== Powerlevel[\"Normal Power\"]) {\n if (options.timeout < 1 || options.timeout > 255) {\n throw new ZWaveError(`The timeout parameter must be between 1 and 255.`, ZWaveErrorCodes.Argument_Invalid);\n }\n this.timeout = options.timeout;\n }\n }\n public static from(raw: CCRaw, ctx: CCParsingContext): PowerlevelCCSet {\n validatePayload(raw.payload.length >= 1);\n const powerlevel: Powerlevel = raw.payload[0];\n if (powerlevel === Powerlevel[\"Normal Power\"]) {\n return new this({\n nodeId: ctx.sourceNodeId,\n powerlevel,\n });\n }\n else {\n validatePayload(raw.payload.length >= 2);\n const timeout = raw.payload[1];\n return new this({\n nodeId: ctx.sourceNodeId,\n powerlevel,\n timeout,\n });\n }\n }\n public powerlevel: Powerlevel;\n public timeout?: number;\n public serialize(ctx: CCEncodingContext): Promise<Bytes> {\n this.payload = Bytes.from([this.powerlevel, this.timeout ?? 0x00]);\n return super.serialize(ctx);\n }\n public toLogEntry(ctx?: GetValueDB): MessageOrCCLogEntry {\n const message: MessageRecord = {\n \"power level\": getEnumMemberName(Powerlevel, this.powerlevel),\n };\n if (this.timeout != undefined) {\n message.timeout = `${this.timeout} s`;\n }\n return {\n ...super.toLogEntry(ctx),\n message,\n };\n }\n}\n// @publicAPI\nexport type PowerlevelCCReportOptions = {\n powerlevel: typeof Powerlevel[\"Normal Power\"];\n timeout?: undefined;\n} | {\n powerlevel: Exclude<Powerlevel, typeof Powerlevel[\"Normal Power\"]>;\n timeout: number;\n};\n@CCCommand(PowerlevelCommand.Report)\nexport class PowerlevelCCReport extends PowerlevelCC {\n public constructor(options: WithAddress<PowerlevelCCReportOptions>) {\n super(options);\n this.powerlevel = options.powerlevel;\n this.timeout = options.timeout;\n }\n public static from(raw: CCRaw, ctx: CCParsingContext): PowerlevelCCReport {\n validatePayload(raw.payload.length >= 1);\n const powerlevel: Powerlevel = raw.payload[0];\n if (powerlevel === Powerlevel[\"Normal Power\"]) {\n return new this({\n nodeId: ctx.sourceNodeId,\n powerlevel,\n });\n }\n else {\n validatePayload(raw.payload.length >= 2);\n const timeout = raw.payload[1];\n return new this({\n nodeId: ctx.sourceNodeId,\n powerlevel,\n timeout,\n });\n }\n }\n public readonly powerlevel: Powerlevel;\n public readonly timeout?: number;\n public serialize(ctx: CCEncodingContext): Promise<Bytes> {\n this.payload = Bytes.from([this.powerlevel, this.timeout ?? 0x00]);\n return super.serialize(ctx);\n }\n public toLogEntry(ctx?: GetValueDB): MessageOrCCLogEntry {\n const message: MessageRecord = {\n \"power level\": getEnumMemberName(Powerlevel, this.powerlevel),\n };\n if (this.timeout != undefined) {\n message.timeout = `${this.timeout} s`;\n }\n return {\n ...super.toLogEntry(ctx),\n message,\n };\n }\n}\n@CCCommand(PowerlevelCommand.Get)\n@expectedCCResponse(PowerlevelCCReport)\nexport class PowerlevelCCGet extends PowerlevelCC {\n}\n// @publicAPI\nexport interface PowerlevelCCTestNodeSetOptions {\n testNodeId: number;\n powerlevel: Powerlevel;\n testFrameCount: number;\n}\n@CCCommand(PowerlevelCommand.TestNodeSet)\n@useSupervision()\nexport class PowerlevelCCTestNodeSet extends PowerlevelCC {\n public constructor(options: WithAddress<PowerlevelCCTestNodeSetOptions>) {\n super(options);\n this.testNodeId = options.testNodeId;\n this.powerlevel = options.powerlevel;\n this.testFrameCount = options.testFrameCount;\n }\n public static from(raw: CCRaw, ctx: CCParsingContext): PowerlevelCCTestNodeSet {\n validatePayload(raw.payload.length >= 4);\n const testNodeId = raw.payload[0];\n const powerlevel: Powerlevel = raw.payload[1];\n const testFrameCount = raw.payload.readUInt16BE(2);\n return new this({\n nodeId: ctx.sourceNodeId,\n testNodeId,\n powerlevel,\n testFrameCount,\n });\n }\n public testNodeId: number;\n public powerlevel: Powerlevel;\n public testFrameCount: number;\n public serialize(ctx: CCEncodingContext): Promise<Bytes> {\n this.payload = Bytes.from([this.testNodeId, this.powerlevel, 0, 0]);\n this.payload.writeUInt16BE(this.testFrameCount, 2);\n return super.serialize(ctx);\n }\n public toLogEntry(ctx?: GetValueDB): MessageOrCCLogEntry {\n return {\n ...super.toLogEntry(ctx),\n message: {\n \"test node id\": this.testNodeId,\n \"power level\": getEnumMemberName(Powerlevel, this.powerlevel),\n \"test frame count\": this.testFrameCount,\n },\n };\n }\n}\n// @publicAPI\nexport interface PowerlevelCCTestNodeReportOptions {\n testNodeId: number;\n status: PowerlevelTestStatus;\n acknowledgedFrames: number;\n}\n@CCCommand(PowerlevelCommand.TestNodeReport)\nexport class PowerlevelCCTestNodeReport extends PowerlevelCC {\n public constructor(options: WithAddress<PowerlevelCCTestNodeReportOptions>) {\n super(options);\n this.testNodeId = options.testNodeId;\n this.status = options.status;\n this.acknowledgedFrames = options.acknowledgedFrames;\n }\n public static from(raw: CCRaw, ctx: CCParsingContext): PowerlevelCCTestNodeReport {\n validatePayload(raw.payload.length >= 4);\n const testNodeId = raw.payload[0];\n const status: PowerlevelTestStatus = raw.payload[1];\n const acknowledgedFrames = raw.payload.readUInt16BE(2);\n return new this({\n nodeId: ctx.sourceNodeId,\n testNodeId,\n status,\n acknowledgedFrames,\n });\n }\n public testNodeId: number;\n public status: PowerlevelTestStatus;\n public acknowledgedFrames: number;\n public serialize(ctx: CCEncodingContext): Promise<Bytes> {\n this.payload = Bytes.from([\n this.testNodeId,\n this.status,\n // Placeholder for acknowledged frames\n 0,\n 0,\n ]);\n this.payload.writeUInt16BE(this.acknowledgedFrames, 2);\n return super.serialize(ctx);\n }\n public toLogEntry(ctx?: GetValueDB): MessageOrCCLogEntry {\n return {\n ...super.toLogEntry(ctx),\n message: {\n \"test node id\": this.testNodeId,\n status: getEnumMemberName(PowerlevelTestStatus, this.status),\n \"acknowledged frames\": this.acknowledgedFrames,\n },\n };\n }\n}\n@CCCommand(PowerlevelCommand.TestNodeGet)\n@expectedCCResponse(PowerlevelCCTestNodeReport)\nexport class PowerlevelCCTestNodeGet extends PowerlevelCC {\n}\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,qBAAgC;AAEhC,kBAAuN;AACvN,oBAA+C;AAC/C,iBAA8B;AAC9B,0BAAyC;AACzC,oCAAsG;AACtG,mBAAqE;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AANrE,MAAM,EAAE,kDAAkD,+CAA+C,4CAA4C,gDAA+C,IAAK;IAS5L,mBAAe,MAAA;8BAD3B,mCAAI,2BAAe,UAAU,CAAC;;;;oBACM;;;;;;uCAAA,YAAa;WAAA;;;;;;;;yCAuB7C,iDAAgD,CAAE;sCAsBlD,8CAA6C,CAAE;mCAU/C,2CAA0C,CAAE;wCAqC5C,gDAA+C,CAAE;AApElD,mBAAA,MAAA,MAAA,iCAAA,EAAA,MAAA,UAAA,MAAA,uBAAA,QAAA,OAAA,SAAA,OAAA,QAAA,EAAA,KAAA,gCAAA,yBAAA,KAAA,QAAA,KAAA,gCAAA,IAAa,qBAAb,OAAgC,GAAA,UAAA,UAAA,GAAA,MAAA,0BAAA;AAsBhC,mBAAA,MAAA,MAAA,8BAAA,EAAA,MAAA,UAAA,MAAA,oBAAA,QAAA,OAAA,SAAA,OAAA,QAAA,EAAA,KAAA,gCAAA,sBAAA,KAAA,QAAA,KAAA,gCAAA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,CAAC;AACrD,aAAO,IAAI,KAAK;QACZ,QAAQ,IAAI;QACZ;QACA;QACA;OACH;IACL;IACO;IACA;IACA;IACA,UAAU,KAAsB;AACnC,WAAK,UAAU,oBAAM,KAAK;QACtB,KAAK;QACL,KAAK;;QAEL;QACA;OACH;AACD,WAAK,QAAQ,cAAc,KAAK,oBAAoB,CAAC;AACrD,aAAO,MAAM,UAAU,GAAG;IAC9B;IACO,WAAW,KAAgB;AAC9B,aAAO;QACH,GAAG,MAAM,WAAW,GAAG;QACvB,SAAS;UACL,gBAAgB,KAAK;UACrB,YAAQ,iCAAkB,mCAAsB,KAAK,MAAM;UAC3D,uBAAuB,KAAK;;;IAGxC;;;;IAIS,2BAAuB,MAAA;8BAFnC,yCAAU,+BAAkB,WAAW,OACvC,kDAAmB,0BAA0B,CAAC;;;;oBACF;+CAAA,YAAY;WAAA;;;;;;;;AAAzD,mBAAA,MAAA,mBAAA,EAAA,OAAA,WAAA,GAAA,kBAAA,EAAA,MAAA,SAAA,MAAA,WAAA,MAAA,UAAA,UAAA,GAAA,MAAA,uBAAA;;;AAAa,wBAAA,YAAA,uBAAA;;;;;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
|
-
"sources": ["../../../
|
|
4
|
-
"sourcesContent": [
|
|
3
|
+
"sources": ["../../../src_gen/cc/ProtectionCC._validateArgs.ts"],
|
|
4
|
+
"sourcesContent": ["import { Timeout } from \"@zwave-js/core\";\nimport * as v from \"@zwave-js/core/validation\";\n\nexport function validateArgs_ProtectionCCAPI_set() {\n\treturn <T extends Function>(__decoratedMethod: T, { kind }: ClassMethodDecoratorContext): T | void => {\n\t\tif (kind === \"method\") {\n\t\t\treturn function set(this: any, local: unknown, rf: unknown) {\n\t\t\t\tv.assert(\n\t\t\t\t\tv.enum({ kind: \"parameter\", name: \"local\" }, \"LocalProtectionState\", [0, 1, 2])(local),\n\n\t\t\t\t\tv.optional({ kind: \"parameter\", name: \"rf\" }, v.oneOf({ kind: \"parameter\", name: \"rf\" }, undefined, v.literal({ kind: \"parameter\", name: \"rf\" }, 0), v.literal({ kind: \"parameter\", name: \"rf\" }, 1), v.literal({ kind: \"parameter\", name: \"rf\" }, 2)))(rf),\n\t\t\t\t);\n\t\t\t\treturn __decoratedMethod.call(this, local, rf);\n\t\t\t} as unknown as T;\n\t\t}\n\t};\n}\n\nexport function validateArgs_ProtectionCCAPI_setExclusiveControl() {\n\treturn <T extends Function>(__decoratedMethod: T, { kind }: ClassMethodDecoratorContext): T | void => {\n\t\tif (kind === \"method\") {\n\t\t\treturn function setExclusiveControl(this: any, nodeId: unknown) {\n\t\t\t\tv.assert(\n\t\t\t\t\tv.primitive({ kind: \"parameter\", name: \"nodeId\" }, \"number\")(nodeId),\n\t\t\t\t);\n\t\t\t\treturn __decoratedMethod.call(this, nodeId);\n\t\t\t} as unknown as T;\n\t\t}\n\t};\n}\n\nexport function validateArgs_ProtectionCCAPI_setTimeout() {\n\treturn <T extends Function>(__decoratedMethod: T, { kind }: ClassMethodDecoratorContext): T | void => {\n\t\tif (kind === \"method\") {\n\t\t\treturn function setTimeout(this: any, timeout: unknown) {\n\t\t\t\tv.assert(\n\t\t\t\t\tv.class({ kind: \"parameter\", name: \"timeout\" }, \"Timeout\", Timeout)(timeout),\n\t\t\t\t);\n\t\t\t\treturn __decoratedMethod.call(this, timeout);\n\t\t\t} as unknown as T;\n\t\t}\n\t};\n}"],
|
|
5
5
|
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;;;;;;;AAAA,kBAAwB;AACxB,QAAmB;AAEb,SAAU,mCAAgC;AAC/C,SAAO,CAAqB,mBAAsB,EAAE,KAAI,MAA6C;AACpG,QAAI,SAAS,UAAU;AACtB,aAAO,gCAAS,IAAe,OAAgB,IAAW;AACzD,UAAE,OACD,EAAE,KAAK,EAAE,MAAM,aAAa,MAAM,QAAO,GAAI,wBAAwB,CA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