@zwave-js/cc 15.20.0 → 15.21.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- 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 +4 -56
- package/build/cjs/cc/NodeNamingCC.js +0 -1
- 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 +4 -56
- package/build/esm/cc/NodeNamingCC.d.ts.map +1 -1
- package/build/esm/cc/NodeNamingCC.js +1 -2
- 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, ParamInfoMap } from \"@zwave-js/config\";\nimport {\n\tCommandClasses,\n\tConfigValueFormat,\n\ttype ConfigurationMetadata,\n\ttype ControlsCC,\n\ttype EndpointId,\n\ttype GetEndpoint,\n\ttype GetNode,\n\ttype GetSupportedCCVersion,\n\ttype GetValueDB,\n\ttype MaybeNotKnown,\n\ttype MessageOrCCLogEntry,\n\tMessagePriority,\n\ttype MessageRecord,\n\ttype NodeId,\n\ttype SupervisionResult,\n\tSupervisionStatus,\n\ttype SupportsCC,\n\ttype ValueID,\n\tValueMetadata,\n\ttype WithAddress,\n\tZWaveError,\n\tZWaveErrorCodes,\n\tencodePartial,\n\tgetBitMaskWidth,\n\tgetIntegerLimits,\n\tgetMinIntegerSize,\n\tisConsecutiveArray,\n\tmergeSupervisionResults,\n\tparsePartial,\n\tstripUndefined,\n\tsupervisedCommandSucceeded,\n\tvalidatePayload,\n} from \"@zwave-js/core\";\nimport { Bytes, getEnumMemberName, num2hex, pick } from \"@zwave-js/shared\";\nimport { validateArgs } from \"@zwave-js/transformers\";\nimport { distinct } from \"alcalzone-shared/arrays\";\nimport {\n\tCCAPI,\n\ttype CCAPIEndpoint,\n\tPOLL_VALUE,\n\ttype PollValueImplementation,\n\tSET_VALUE,\n\ttype SetValueImplementation,\n\tthrowUnsupportedProperty,\n\tthrowUnsupportedPropertyKey,\n\tthrowWrongValueType,\n} from \"../lib/API.js\";\nimport {\n\ttype CCRaw,\n\tCommandClass,\n\ttype InterviewContext,\n\ttype PersistValuesContext,\n\ttype RefreshValuesContext,\n\tgetEffectiveCCVersion,\n} from \"../lib/CommandClass.js\";\nimport {\n\tAPI,\n\tCCCommand,\n\tccValues,\n\tcommandClass,\n\texpectedCCResponse,\n\timplementedVersion,\n\tuseSupervision,\n} from \"../lib/CommandClassDecorators.js\";\nimport { V } from \"../lib/Values.js\";\nimport { type ConfigValue, ConfigurationCommand } from \"../lib/_Types.js\";\n\nfunction configValueToString(value: ConfigValue): string {\n\tif (typeof value === \"number\") return value.toString();\n\telse return [...value].join(\", \");\n}\n\nexport class ConfigurationCCError extends ZWaveError {\n\tpublic constructor(\n\t\tpublic readonly message: string,\n\t\tpublic readonly code: ZWaveErrorCodes,\n\t\tpublic readonly argument: number,\n\t) {\n\t\tsuper(message, code);\n\n\t\t// We need to set the prototype explicitly\n\t\tObject.setPrototypeOf(this, ConfigurationCCError.prototype);\n\t}\n}\n\nexport const ConfigurationCCValues = V.defineCCValues(\n\tCommandClasses.Configuration,\n\t{\n\t\t...V.staticProperty(\n\t\t\t\"isParamInformationFromConfig\",\n\t\t\tundefined, // meta\n\t\t\t{ internal: true, supportsEndpoints: false }, // value options\n\t\t),\n\t\t...V.dynamicPropertyAndKeyWithName(\n\t\t\t\"paramInformation\",\n\t\t\t// oxlint-disable-next-line no-unused-vars\n\t\t\t(parameter: number, bitMask?: number) => parameter,\n\t\t\t(parameter: number, bitMask?: number) => bitMask,\n\t\t\t({ property, propertyKey }) =>\n\t\t\t\ttypeof property === \"number\"\n\t\t\t\t&& (typeof propertyKey === \"number\"\n\t\t\t\t\t|| propertyKey == undefined),\n\t\t\t// Metadata is determined dynamically depending on other factors\n\t\t\tundefined,\n\t\t),\n\t},\n);\n\n/** @publicAPI */\nexport type ConfigurationCCAPISetOptions =\n\t& {\n\t\tparameter: number;\n\t}\n\t& (\n\t\t| {\n\t\t\t// Variant 1: Normal parameter, defined in a config file\n\t\t\tbitMask?: undefined;\n\t\t\tvalue: ConfigValue;\n\t\t}\n\t\t| {\n\t\t\t// Variant 2: Normal parameter, not defined in a config file\n\t\t\tbitMask?: undefined;\n\t\t\tvalue: ConfigValue;\n\t\t\tvalueSize: 1 | 2 | 4;\n\t\t\tvalueFormat: ConfigValueFormat;\n\t\t}\n\t\t| {\n\t\t\t// Variant 3: Partial parameter, must be defined in a config file\n\t\t\tbitMask: number;\n\t\t\tvalue: number;\n\t\t}\n\t);\n\ntype NormalizedConfigurationCCAPISetOptions =\n\t& {\n\t\tparameter: number;\n\t\tvalueSize: 1 | 2 | 4;\n\t\tvalueFormat: ConfigValueFormat;\n\t}\n\t& (\n\t\t| { bitMask?: undefined; value: ConfigValue }\n\t\t| { bitMask: number; value: number }\n\t);\n\nfunction createConfigurationCCInstance(\n\tendpoint: CCAPIEndpoint,\n): ConfigurationCC {\n\treturn CommandClass.createInstanceUnchecked(\n\t\tendpoint.virtual ? endpoint.node.physicalNodes[0] : endpoint,\n\t\tConfigurationCC,\n\t)!;\n}\n\nfunction normalizeConfigurationCCAPISetOptions(\n\tctx: GetValueDB,\n\tendpoint: CCAPIEndpoint,\n\toptions: ConfigurationCCAPISetOptions,\n): NormalizedConfigurationCCAPISetOptions {\n\tif (\"bitMask\" in options && options.bitMask) {\n\t\t// Variant 3: Partial param, look it up in the device config\n\t\tconst ccc = createConfigurationCCInstance(endpoint);\n\t\tconst paramInfo = ccc.getParamInformation(\n\t\t\tctx,\n\t\t\toptions.parameter,\n\t\t\toptions.bitMask,\n\t\t);\n\t\tif (!paramInfo.isFromConfig) {\n\t\t\tthrow new ZWaveError(\n\t\t\t\t\"Setting a partial configuration parameter requires it to be defined in a device config file!\",\n\t\t\t\tZWaveErrorCodes.Argument_Invalid,\n\t\t\t);\n\t\t}\n\t\treturn {\n\t\t\tparameter: options.parameter,\n\t\t\tbitMask: options.bitMask,\n\t\t\tvalue: options.value,\n\t\t\tvalueSize: paramInfo.valueSize as any,\n\t\t\tvalueFormat: paramInfo.format!,\n\t\t};\n\t} else if (\"valueSize\" in options) {\n\t\t// Variant 2: Normal parameter, not defined in a config file\n\t\treturn pick(options, [\n\t\t\t\"parameter\",\n\t\t\t\"value\",\n\t\t\t\"valueSize\",\n\t\t\t\"valueFormat\",\n\t\t]);\n\t} else {\n\t\t// Variant 1: Normal parameter, defined in a config file\n\t\tconst ccc = createConfigurationCCInstance(endpoint);\n\t\tconst paramInfo = ccc.getParamInformation(\n\t\t\tctx,\n\t\t\toptions.parameter,\n\t\t\toptions.bitMask,\n\t\t);\n\t\tif (!paramInfo.isFromConfig) {\n\t\t\tthrow new ZWaveError(\n\t\t\t\t\"Setting a configuration parameter without specifying a value size and format requires it to be defined in a device config file!\",\n\t\t\t\tZWaveErrorCodes.Argument_Invalid,\n\t\t\t);\n\t\t}\n\t\treturn {\n\t\t\tparameter: options.parameter,\n\t\t\tvalue: options.value,\n\t\t\tvalueSize: paramInfo.valueSize as any,\n\t\t\tvalueFormat: paramInfo.format!,\n\t\t};\n\t}\n}\n\nfunction bulkMergePartialParamValues(\n\tctx: GetValueDB,\n\tendpoint: CCAPIEndpoint,\n\toptions: NormalizedConfigurationCCAPISetOptions[],\n): (NormalizedConfigurationCCAPISetOptions & { bitMask?: undefined })[] {\n\t// Merge partial parameters before doing anything else. Therefore, take the non-partials, ...\n\tconst allParams = options.filter((o) => o.bitMask == undefined);\n\t// ... group the partials by parameter\n\tconst unmergedPartials = new Map<\n\t\tnumber,\n\t\tNormalizedConfigurationCCAPISetOptions[]\n\t>();\n\tfor (const partial of options.filter((o) => o.bitMask != undefined)) {\n\t\tif (!unmergedPartials.has(partial.parameter)) {\n\t\t\tunmergedPartials.set(partial.parameter, []);\n\t\t}\n\t\tunmergedPartials.get(partial.parameter)!.push(partial);\n\t}\n\t// and push the merged result into the array we'll be working with\n\tif (unmergedPartials.size) {\n\t\tconst ccc = createConfigurationCCInstance(endpoint);\n\t\tfor (const [parameter, partials] of unmergedPartials) {\n\t\t\tallParams.push({\n\t\t\t\tparameter,\n\t\t\t\tvalue: ccc.composePartialParamValues(\n\t\t\t\t\tctx,\n\t\t\t\t\tparameter,\n\t\t\t\t\tpartials.map((p) => ({\n\t\t\t\t\t\tbitMask: p.bitMask!,\n\t\t\t\t\t\tpartialValue: p.value,\n\t\t\t\t\t})),\n\t\t\t\t),\n\t\t\t\tvalueSize: partials[0].valueSize,\n\t\t\t\tvalueFormat: partials[0].valueFormat,\n\t\t\t});\n\t\t}\n\t}\n\treturn allParams as any;\n}\n\n/** Determines whether a partial parameter needs to be interpreted as signed */\nfunction isSignedPartial(\n\tbitMask: number,\n\tformat: ConfigValueFormat | undefined,\n): boolean {\n\t// Only treat partial params as signed if they span more than 1 bit.\n\t// Otherwise we cannot model 0/1 properly.\n\treturn (\n\t\tgetBitMaskWidth(bitMask) > 1\n\t\t&& (format ?? ConfigValueFormat.SignedInteger)\n\t\t\t=== ConfigValueFormat.SignedInteger\n\t);\n}\n\nfunction reInterpretSignedValue(\n\tvalue: ConfigValue,\n\tvalueSize: number,\n\ttargetFormat: ConfigValueFormat,\n): ConfigValue {\n\t// Re-interpret the value with the new format\n\tconst raw = new Bytes(valueSize);\n\tserializeValue(raw, 0, valueSize, ConfigValueFormat.SignedInteger, value);\n\treturn parseValue(raw, valueSize, targetFormat);\n}\n\nfunction getParamInformationFromConfigFile(\n\tctx: GetDeviceConfig,\n\tnodeId: number,\n\tendpointIndex: number,\n): ParamInfoMap | undefined {\n\tconst deviceConfig = ctx.getDeviceConfig?.(nodeId);\n\tif (endpointIndex === 0) {\n\t\treturn (\n\t\t\tdeviceConfig?.paramInformation\n\t\t\t\t?? deviceConfig?.endpoints?.get(0)?.paramInformation\n\t\t);\n\t} else {\n\t\treturn deviceConfig?.endpoints?.get(endpointIndex)?.paramInformation;\n\t}\n}\n\n/**\n * Updates the stored metadata labels and descriptions from the device config file.\n */\nexport function refreshMetadataStringsFromConfigFile(\n\tctx: GetValueDB & GetDeviceConfig,\n\tnodeId: number,\n\tendpointIndex: number,\n): void {\n\tconst paramInfo = getParamInformationFromConfigFile(\n\t\tctx,\n\t\tnodeId,\n\t\tendpointIndex,\n\t);\n\tif (!paramInfo) return;\n\n\tconst valueDB = ctx.getValueDB(nodeId);\n\n\tfor (const [param, info] of paramInfo.entries()) {\n\t\tconst valueId = ConfigurationCCValues.paramInformation(\n\t\t\tparam.parameter,\n\t\t\tparam.valueBitMask,\n\t\t).endpoint(endpointIndex);\n\n\t\tconst existing = valueDB.getMetadata(valueId) as\n\t\t\t| ConfigurationMetadata\n\t\t\t| undefined;\n\n\t\tif (!existing) continue;\n\t\tif (!existing.isFromConfig) continue;\n\n\t\tlet didChange = false;\n\n\t\t// Update info, description and option labels and remember if something was changed\n\t\tif (info.label !== existing.label) {\n\t\t\texisting.label = info.label;\n\t\t\tdidChange = true;\n\t\t}\n\t\tif (info.description !== existing.description) {\n\t\t\texisting.description = info.description;\n\t\t\tdidChange = true;\n\t\t}\n\t\tif (info.recommendedValue !== existing.recommended) {\n\t\t\texisting.recommended = info.recommendedValue;\n\t\t\tdidChange = true;\n\t\t}\n\t\tif (existing.states) {\n\t\t\tfor (const option of info.options) {\n\t\t\t\tif (\n\t\t\t\t\toption.value in existing.states\n\t\t\t\t\t&& existing.states[option.value] !== option.label\n\t\t\t\t) {\n\t\t\t\t\texisting.states[option.value] = option.label;\n\t\t\t\t\tdidChange = true;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t// If something changed, update the metadata\n\t\tif (didChange) valueDB.setMetadata(valueId, existing);\n\t}\n}\n\n@API(CommandClasses.Configuration)\nexport class ConfigurationCCAPI extends CCAPI {\n\tpublic supportsCommand(cmd: ConfigurationCommand): MaybeNotKnown<boolean> {\n\t\tswitch (cmd) {\n\t\t\tcase ConfigurationCommand.Get:\n\t\t\tcase ConfigurationCommand.Set:\n\t\t\t\treturn true; // This is mandatory\n\n\t\t\tcase ConfigurationCommand.BulkGet:\n\t\t\tcase ConfigurationCommand.BulkSet:\n\t\t\t\treturn this.version >= 2;\n\n\t\t\tcase ConfigurationCommand.NameGet:\n\t\t\tcase ConfigurationCommand.InfoGet:\n\t\t\tcase ConfigurationCommand.PropertiesGet:\n\t\t\t\treturn this.version >= 3;\n\n\t\t\tcase ConfigurationCommand.DefaultReset:\n\t\t\t\treturn this.version >= 4;\n\t\t}\n\t\treturn super.supportsCommand(cmd);\n\t}\n\n\tprotected override get [SET_VALUE](): SetValueImplementation {\n\t\treturn async function(\n\t\t\tthis: ConfigurationCCAPI,\n\t\t\t{ property, propertyKey },\n\t\t\tvalue,\n\t\t) {\n\t\t\t// Config parameters are addressed with numeric properties/keys\n\t\t\tif (typeof property !== \"number\") {\n\t\t\t\tthrowUnsupportedProperty(this.ccId, property);\n\t\t\t}\n\t\t\tif (propertyKey != undefined && typeof propertyKey !== \"number\") {\n\t\t\t\tthrowUnsupportedPropertyKey(this.ccId, property, propertyKey);\n\t\t\t}\n\t\t\tif (typeof value !== \"number\") {\n\t\t\t\tthrowWrongValueType(\n\t\t\t\t\tthis.ccId,\n\t\t\t\t\tproperty,\n\t\t\t\t\t\"number\",\n\t\t\t\t\ttypeof value,\n\t\t\t\t);\n\t\t\t}\n\n\t\t\tlet ccInstance: ConfigurationCC;\n\t\t\tconst applHost = this.host;\n\n\t\t\tif (this.isSinglecast()) {\n\t\t\t\tccInstance = createConfigurationCCInstance(this.endpoint);\n\t\t\t} else if (this.isMulticast()) {\n\t\t\t\t// Multicast is only possible if the parameter definition is the same on all target nodes\n\t\t\t\tconst nodes = this.endpoint.node.physicalNodes;\n\t\t\t\tif (\n\t\t\t\t\t!nodes.every((node) =>\n\t\t\t\t\t\tnode\n\t\t\t\t\t\t\t.getEndpoint(this.endpoint.index)\n\t\t\t\t\t\t\t?.supportsCC(CommandClasses.Configuration)\n\t\t\t\t\t)\n\t\t\t\t) {\n\t\t\t\t\tthrow new ZWaveError(\n\t\t\t\t\t\t`The multicast setValue API for Configuration CC requires all virtual target endpoints to support Configuration CC!`,\n\t\t\t\t\t\tZWaveErrorCodes.CC_Invalid,\n\t\t\t\t\t);\n\t\t\t\t}\n\t\t\t\t// Figure out if all the relevant info is the same\n\t\t\t\tconst paramInfos = this.endpoint.node.physicalNodes.map(\n\t\t\t\t\t(node) =>\n\t\t\t\t\t\tcreateConfigurationCCInstance(\n\t\t\t\t\t\t\tnode.getEndpoint(this.endpoint.index)!,\n\t\t\t\t\t\t).getParamInformation(\n\t\t\t\t\t\t\tthis.host,\n\t\t\t\t\t\t\tproperty,\n\t\t\t\t\t\t\tpropertyKey,\n\t\t\t\t\t\t),\n\t\t\t\t);\n\t\t\t\tif (\n\t\t\t\t\t!paramInfos.length\n\t\t\t\t\t|| !paramInfos.every((info, index) => {\n\t\t\t\t\t\tif (index === 0) return true;\n\t\t\t\t\t\treturn (\n\t\t\t\t\t\t\tinfo.valueSize === paramInfos[0].valueSize\n\t\t\t\t\t\t\t&& info.format === paramInfos[0].format\n\t\t\t\t\t\t);\n\t\t\t\t\t})\n\t\t\t\t) {\n\t\t\t\t\tthrow new ZWaveError(\n\t\t\t\t\t\t`The multicast setValue API for Configuration CC requires all virtual target nodes to have the same parameter definition!`,\n\t\t\t\t\t\tZWaveErrorCodes.CC_Invalid,\n\t\t\t\t\t);\n\t\t\t\t}\n\t\t\t\t// If it is, just use the first node to create the CC instance\n\t\t\t\tccInstance = createConfigurationCCInstance(this.endpoint);\n\t\t\t} else {\n\t\t\t\tthrow new ZWaveError(\n\t\t\t\t\t`The setValue API for Configuration CC is not supported via broadcast!`,\n\t\t\t\t\tZWaveErrorCodes.CC_NotSupported,\n\t\t\t\t);\n\t\t\t}\n\n\t\t\tlet {\n\t\t\t\tvalueSize,\n\t\t\t\tformat: valueFormat = ConfigValueFormat.SignedInteger,\n\t\t\t} = ccInstance.getParamInformation(applHost, property);\n\n\t\t\tlet targetValue: number;\n\t\t\tif (propertyKey) {\n\t\t\t\t// This is a partial value, we need to update some bits only\n\t\t\t\t// Find out the correct value size\n\t\t\t\tif (!valueSize) {\n\t\t\t\t\tvalueSize = ccInstance.getParamInformation(\n\t\t\t\t\t\tapplHost,\n\t\t\t\t\t\tproperty,\n\t\t\t\t\t\tpropertyKey,\n\t\t\t\t\t).valueSize;\n\t\t\t\t}\n\t\t\t\t// Add the target value to the remaining partial values\n\t\t\t\ttargetValue = ccInstance.composePartialParamValue(\n\t\t\t\t\tapplHost,\n\t\t\t\t\tproperty,\n\t\t\t\t\tpropertyKey,\n\t\t\t\t\tvalue,\n\t\t\t\t);\n\t\t\t\t// Partial parameters are internally converted to unsigned values - update the valueFormat accordingly\n\t\t\t\tvalueFormat = ConfigValueFormat.UnsignedInteger;\n\t\t\t} else {\n\t\t\t\ttargetValue = value;\n\t\t\t}\n\n\t\t\tif (!valueSize) {\n\t\t\t\t// If there's no value size configured, figure out a matching value size\n\t\t\t\tvalueSize = getMinIntegerSize(\n\t\t\t\t\ttargetValue,\n\t\t\t\t\tvalueFormat === ConfigValueFormat.SignedInteger,\n\t\t\t\t);\n\t\t\t\t// Throw if the value is too large or too small\n\t\t\t\tif (!valueSize) {\n\t\t\t\t\tthrow new ZWaveError(\n\t\t\t\t\t\t`The value ${targetValue} is not valid for configuration parameters!`,\n\t\t\t\t\t\tZWaveErrorCodes.Argument_Invalid,\n\t\t\t\t\t);\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// Make sure that the given value fits into the value size\n\t\t\tif (!isSafeValue(targetValue, valueSize, valueFormat)) {\n\t\t\t\t// If there is a value size configured, check that the given value is compatible\n\t\t\t\tthrowInvalidValueError(\n\t\t\t\t\ttargetValue,\n\t\t\t\t\tproperty,\n\t\t\t\t\tvalueSize,\n\t\t\t\t\tvalueFormat,\n\t\t\t\t);\n\t\t\t}\n\n\t\t\tconst result = await this.set({\n\t\t\t\tparameter: property,\n\t\t\t\tvalue: targetValue,\n\t\t\t\tvalueSize: valueSize as any,\n\t\t\t\tvalueFormat,\n\t\t\t});\n\n\t\t\tif (\n\t\t\t\t!supervisedCommandSucceeded(result)\n\t\t\t\t&& (this as ConfigurationCCAPI).isSinglecast()\n\t\t\t) {\n\t\t\t\t// Verify the current value after a delay, unless the command was supervised and successful\n\t\t\t\t(this as ConfigurationCCAPI).schedulePoll(\n\t\t\t\t\t{ property, propertyKey },\n\t\t\t\t\ttargetValue,\n\t\t\t\t\t// Configuration changes are instant\n\t\t\t\t\t{ transition: \"fast\" },\n\t\t\t\t);\n\t\t\t}\n\n\t\t\treturn result;\n\t\t};\n\t}\n\n\tprotected get [POLL_VALUE](): PollValueImplementation {\n\t\treturn async function(\n\t\t\tthis: ConfigurationCCAPI,\n\t\t\t{ property, propertyKey },\n\t\t) {\n\t\t\t// Config parameters are addressed with numeric properties/keys\n\t\t\tif (typeof property !== \"number\") {\n\t\t\t\tthrowUnsupportedProperty(this.ccId, property);\n\t\t\t}\n\t\t\tif (propertyKey != undefined && typeof propertyKey !== \"number\") {\n\t\t\t\tthrowUnsupportedPropertyKey(this.ccId, property, propertyKey);\n\t\t\t}\n\n\t\t\treturn this.get(property, { valueBitMask: propertyKey });\n\t\t};\n\t}\n\n\t/**\n\t * Requests the current value of a given config parameter from the device.\n\t * This may timeout and return `undefined` if the node does not respond.\n\t * If the node replied with a different parameter number, a `ConfigurationCCError`\n\t * is thrown with the `argument` property set to the reported parameter number.\n\t */\n\t@validateArgs()\n\tpublic async get(\n\t\tparameter: number,\n\t\toptions?: {\n\t\t\tvalueBitMask?: number;\n\t\t\tallowUnexpectedResponse?: boolean;\n\t\t},\n\t): Promise<MaybeNotKnown<ConfigValue>> {\n\t\t// Get-type commands are only possible in singlecast\n\t\tthis.assertPhysicalEndpoint(this.endpoint);\n\n\t\t// Two-byte parameter numbers can only be read using the BulkGet command\n\t\tif (parameter > 255) {\n\t\t\tconst result = await this.getBulk([\n\t\t\t\t{\n\t\t\t\t\tparameter,\n\t\t\t\t\tbitMask: options?.valueBitMask,\n\t\t\t\t},\n\t\t\t]);\n\t\t\treturn result.find((r) => r.parameter === parameter)?.value;\n\t\t}\n\n\t\tthis.assertSupportsCommand(\n\t\t\tConfigurationCommand,\n\t\t\tConfigurationCommand.Get,\n\t\t);\n\n\t\tconst { valueBitMask, allowUnexpectedResponse } = options ?? {};\n\n\t\tconst cc = new ConfigurationCCGet({\n\t\t\tnodeId: this.endpoint.nodeId,\n\t\t\tendpointIndex: this.endpoint.index,\n\t\t\tparameter,\n\t\t\tallowUnexpectedResponse,\n\t\t});\n\t\tconst response = await this.host.sendCommand<ConfigurationCCReport>(\n\t\t\tcc,\n\t\t\tthis.commandOptions,\n\t\t);\n\t\tif (!response) return;\n\t\t// Nodes may respond with a different parameter, e.g. if we\n\t\t// requested a non-existing one\n\t\tif (response.parameter === parameter) {\n\t\t\tif (!valueBitMask) return response.value;\n\t\t\t// If a partial parameter was requested, extract that value\n\t\t\tconst paramInfo = cc.getParamInformation(\n\t\t\t\tthis.host,\n\t\t\t\tresponse.parameter,\n\t\t\t\tvalueBitMask,\n\t\t\t);\n\t\t\treturn parsePartial(\n\t\t\t\tresponse.value as any,\n\t\t\t\tvalueBitMask,\n\t\t\t\tisSignedPartial(valueBitMask, paramInfo.format),\n\t\t\t);\n\t\t}\n\t\tthis.host.logNode(this.endpoint.nodeId, {\n\t\t\tendpoint: this.endpoint.index,\n\t\t\tmessage:\n\t\t\t\t`Received unexpected ConfigurationReport (param = ${response.parameter}, value = ${response.value.toString()})`,\n\t\t\tdirection: \"inbound\",\n\t\t\tlevel: \"error\",\n\t\t});\n\t\tthrow new ConfigurationCCError(\n\t\t\t`The first existing parameter on this node is ${response.parameter}`,\n\t\t\tZWaveErrorCodes.ConfigurationCC_FirstParameterNumber,\n\t\t\tresponse.parameter,\n\t\t);\n\t}\n\n\t/**\n\t * Requests the current value of the config parameters from the device.\n\t * When the node does not respond due to a timeout, the `value` in the returned array will be `undefined`.\n\t */\n\t@validateArgs()\n\tpublic async getBulk(\n\t\toptions: {\n\t\t\tparameter: number;\n\t\t\tbitMask?: number;\n\t\t}[],\n\t): Promise<\n\t\t{\n\t\t\tparameter: number;\n\t\t\tbitMask?: number;\n\t\t\tvalue: MaybeNotKnown<ConfigValue>;\n\t\t}[]\n\t> {\n\t\t// Get-type commands are only possible in singlecast\n\t\tthis.assertPhysicalEndpoint(this.endpoint);\n\n\t\tlet values: ReadonlyMap<number, ConfigValue> | undefined;\n\n\t\t// If the parameters are consecutive, we may use BulkGet\n\t\tconst distinctParameters = distinct(options.map((o) => o.parameter));\n\t\tif (\n\t\t\tthis.supportsCommand(ConfigurationCommand.BulkGet)\n\t\t\t&& isConsecutiveArray(distinctParameters)\n\t\t) {\n\t\t\tconst cc = new ConfigurationCCBulkGet({\n\t\t\t\tnodeId: this.endpoint.nodeId,\n\t\t\t\tendpointIndex: this.endpoint.index,\n\t\t\t\tparameters: distinctParameters,\n\t\t\t});\n\t\t\tconst response = await this.host.sendCommand<\n\t\t\t\tConfigurationCCBulkReport\n\t\t\t>(\n\t\t\t\tcc,\n\t\t\t\tthis.commandOptions,\n\t\t\t);\n\t\t\tif (response) values = response.values;\n\t\t} else {\n\t\t\tthis.assertSupportsCommand(\n\t\t\t\tConfigurationCommand,\n\t\t\t\tConfigurationCommand.Get,\n\t\t\t);\n\n\t\t\tconst _values = new Map<number, ConfigValue>();\n\t\t\tfor (const parameter of distinctParameters) {\n\t\t\t\tconst cc = new ConfigurationCCGet({\n\t\t\t\t\tnodeId: this.endpoint.nodeId,\n\t\t\t\t\tendpointIndex: this.endpoint.index,\n\t\t\t\t\tparameter,\n\t\t\t\t});\n\t\t\t\tconst response = await this.host.sendCommand<\n\t\t\t\t\tConfigurationCCReport\n\t\t\t\t>(\n\t\t\t\t\tcc,\n\t\t\t\t\tthis.commandOptions,\n\t\t\t\t);\n\t\t\t\tif (response) {\n\t\t\t\t\t_values.set(response.parameter, response.value);\n\t\t\t\t}\n\t\t\t}\n\t\t\tvalues = _values;\n\t\t}\n\n\t\t// Combine the returned values with the requested ones\n\t\tconst cc = createConfigurationCCInstance(this.endpoint);\n\t\treturn options.map((o) => {\n\t\t\tlet value = values?.get(o.parameter);\n\t\t\tif (typeof value === \"number\" && o.bitMask) {\n\t\t\t\tconst paramInfo = cc.getParamInformation(\n\t\t\t\t\tthis.host,\n\t\t\t\t\to.parameter,\n\t\t\t\t\to.bitMask,\n\t\t\t\t);\n\t\t\t\tvalue = parsePartial(\n\t\t\t\t\tvalue,\n\t\t\t\t\to.bitMask,\n\t\t\t\t\tisSignedPartial(o.bitMask, paramInfo.format),\n\t\t\t\t);\n\t\t\t}\n\t\t\treturn { ...o, value };\n\t\t});\n\t}\n\n\t/**\n\t * Sets a new value for a given config parameter of the device.\n\t */\n\t@validateArgs({ strictEnums: true })\n\tpublic async set(\n\t\toptions: ConfigurationCCAPISetOptions,\n\t): Promise<SupervisionResult | undefined> {\n\t\t// Two-byte parameter numbers can only be set using the BulkSet command\n\t\tif (options.parameter > 255) {\n\t\t\treturn this.setBulk([options]);\n\t\t}\n\n\t\tthis.assertSupportsCommand(\n\t\t\tConfigurationCommand,\n\t\t\tConfigurationCommand.Set,\n\t\t);\n\n\t\tconst normalized = normalizeConfigurationCCAPISetOptions(\n\t\t\tthis.host,\n\t\t\tthis.endpoint,\n\t\t\toptions,\n\t\t);\n\t\tlet value = normalized.value;\n\t\tif (normalized.bitMask) {\n\t\t\tconst ccc = createConfigurationCCInstance(this.endpoint);\n\t\t\tvalue = ccc.composePartialParamValue(\n\t\t\t\tthis.host,\n\t\t\t\tnormalized.parameter,\n\t\t\t\tnormalized.bitMask,\n\t\t\t\tnormalized.value,\n\t\t\t);\n\t\t}\n\t\tconst cc = new ConfigurationCCSet({\n\t\t\tnodeId: this.endpoint.nodeId,\n\t\t\tendpointIndex: this.endpoint.index,\n\t\t\tresetToDefault: false,\n\t\t\tparameter: normalized.parameter,\n\t\t\tvalue,\n\t\t\tvalueSize: normalized.valueSize,\n\t\t\tvalueFormat: normalized.valueFormat,\n\t\t});\n\n\t\treturn this.host.sendCommand(cc, this.commandOptions);\n\t}\n\n\t/**\n\t * Sets new values for multiple config parameters of the device. Uses the `BulkSet` command if supported, otherwise falls back to individual `Set` commands.\n\t */\n\t@validateArgs({ strictEnums: true })\n\tpublic async setBulk(\n\t\tvalues: ConfigurationCCAPISetOptions[],\n\t): Promise<SupervisionResult | undefined> {\n\t\t// Normalize the values so we can better work with them\n\t\tconst normalized = values.map((v) =>\n\t\t\tnormalizeConfigurationCCAPISetOptions(\n\t\t\t\tthis.host,\n\t\t\t\tthis.endpoint,\n\t\t\t\tv,\n\t\t\t)\n\t\t);\n\t\t// And merge multiple partials that belong the same \"full\" value\n\t\tconst allParams = bulkMergePartialParamValues(\n\t\t\tthis.host,\n\t\t\tthis.endpoint,\n\t\t\tnormalized,\n\t\t);\n\n\t\tconst canUseBulkSet = this.supportsCommand(ConfigurationCommand.BulkSet)\n\t\t\t// For Bulk Set we need consecutive parameters\n\t\t\t&& isConsecutiveArray(allParams.map((v) => v.parameter))\n\t\t\t// and identical format\n\t\t\t&& new Set(allParams.map((v) => v.valueFormat)).size === 1\n\t\t\t// and identical size\n\t\t\t&& new Set(allParams.map((v) => v.valueSize)).size === 1;\n\n\t\tif (canUseBulkSet) {\n\t\t\tconst cc = new ConfigurationCCBulkSet({\n\t\t\t\tnodeId: this.endpoint.nodeId,\n\t\t\t\tendpointIndex: this.endpoint.index,\n\t\t\t\tparameters: allParams.map((v) => v.parameter),\n\t\t\t\tvalueSize: allParams[0].valueSize,\n\t\t\t\tvalueFormat: allParams[0].valueFormat,\n\t\t\t\tvalues: allParams.map((v) => v.value),\n\t\t\t\thandshake: true,\n\t\t\t});\n\t\t\t// The handshake flag is set, so we expect a BulkReport in response\n\t\t\tconst result = await this.host.sendCommand<\n\t\t\t\tConfigurationCCBulkReport\n\t\t\t>(\n\t\t\t\tcc,\n\t\t\t\tthis.commandOptions,\n\t\t\t);\n\n\t\t\t// If we did receive a response, we also received the updated parameters,\n\t\t\t// so if any one was not accepted, we know by looking at the values.\n\t\t\t// Translate the result into a SupervisionResult by comparing the values\n\t\t\tif (result) {\n\t\t\t\tconst sentValues = cc.values;\n\t\t\t\tconst receivedValues = [...result.values.values()];\n\t\t\t\tconst success = sentValues.length === receivedValues.length\n\t\t\t\t\t&& sentValues.every((v, i) => v === receivedValues[i]);\n\t\t\t\treturn {\n\t\t\t\t\tstatus: success\n\t\t\t\t\t\t? SupervisionStatus.Success\n\t\t\t\t\t\t: SupervisionStatus.Fail,\n\t\t\t\t};\n\t\t\t} else {\n\t\t\t\treturn undefined;\n\t\t\t}\n\t\t} else {\n\t\t\tthis.assertSupportsCommand(\n\t\t\t\tConfigurationCommand,\n\t\t\t\tConfigurationCommand.Set,\n\t\t\t);\n\n\t\t\tconst supervisionResults: (SupervisionResult | undefined)[] = [];\n\t\t\tfor (\n\t\t\t\tconst {\n\t\t\t\t\tparameter,\n\t\t\t\t\tvalue,\n\t\t\t\t\tvalueSize,\n\t\t\t\t\tvalueFormat,\n\t\t\t\t} of allParams\n\t\t\t) {\n\t\t\t\tconst cc = new ConfigurationCCSet({\n\t\t\t\t\tnodeId: this.endpoint.nodeId,\n\t\t\t\t\tendpointIndex: this.endpoint.index,\n\t\t\t\t\tparameter,\n\t\t\t\t\tvalue,\n\t\t\t\t\tvalueSize,\n\t\t\t\t\tvalueFormat,\n\t\t\t\t});\n\t\t\t\tsupervisionResults.push(\n\t\t\t\t\tawait this.host.sendCommand(cc, this.commandOptions),\n\t\t\t\t);\n\t\t\t}\n\t\t\treturn mergeSupervisionResults(supervisionResults);\n\t\t}\n\t}\n\n\t/**\n\t * Resets a configuration parameter to its default value.\n\t *\n\t * WARNING: This will throw on legacy devices (ConfigurationCC v3 and below)\n\t */\n\t@validateArgs()\n\tpublic async reset(\n\t\tparameter: number,\n\t): Promise<SupervisionResult | undefined> {\n\t\t// Two-byte parameter numbers can only be reset using the BulkSet command\n\t\tif (parameter > 255) {\n\t\t\treturn this.resetBulk([parameter]);\n\t\t}\n\n\t\t// According to SDS14223 this flag SHOULD NOT be set\n\t\t// Because we don't want to test the behavior, we enforce that it MUST not be set\n\t\t// on legacy nodes\n\t\tif (this.version <= 3) {\n\t\t\tthrow new ZWaveError(\n\t\t\t\t`Resetting configuration parameters to default MUST not be done on nodes implementing ConfigurationCC V3 or below!`,\n\t\t\t\tZWaveErrorCodes\n\t\t\t\t\t.ConfigurationCC_NoResetToDefaultOnLegacyDevices,\n\t\t\t);\n\t\t}\n\n\t\tthis.assertSupportsCommand(\n\t\t\tConfigurationCommand,\n\t\t\tConfigurationCommand.Set,\n\t\t);\n\n\t\tconst cc = new ConfigurationCCSet({\n\t\t\tnodeId: this.endpoint.nodeId,\n\t\t\tendpointIndex: this.endpoint.index,\n\t\t\tparameter,\n\t\t\tresetToDefault: true,\n\t\t});\n\t\treturn this.host.sendCommand(cc, this.commandOptions);\n\t}\n\n\t/**\n\t * Resets multiple configuration parameters to their default value. Uses BulkSet if supported, otherwise falls back to individual Set commands.\n\t *\n\t * WARNING: This will throw on legacy devices (ConfigurationCC v3 and below)\n\t */\n\t@validateArgs()\n\tpublic async resetBulk(\n\t\tparameters: number[],\n\t): Promise<SupervisionResult | undefined> {\n\t\tif (\n\t\t\tisConsecutiveArray(parameters)\n\t\t\t&& this.supportsCommand(ConfigurationCommand.BulkSet)\n\t\t) {\n\t\t\tconst cc = new ConfigurationCCBulkSet({\n\t\t\t\tnodeId: this.endpoint.nodeId,\n\t\t\t\tendpointIndex: this.endpoint.index,\n\t\t\t\tparameters,\n\t\t\t\tresetToDefault: true,\n\t\t\t});\n\t\t\treturn this.host.sendCommand(cc, this.commandOptions);\n\t\t} else {\n\t\t\tthis.assertSupportsCommand(\n\t\t\t\tConfigurationCommand,\n\t\t\t\tConfigurationCommand.Set,\n\t\t\t);\n\t\t\tconst CCs = distinct(parameters).map(\n\t\t\t\t(parameter) =>\n\t\t\t\t\tnew ConfigurationCCSet({\n\t\t\t\t\t\tnodeId: this.endpoint.nodeId,\n\t\t\t\t\t\tendpointIndex: this.endpoint.index,\n\t\t\t\t\t\tparameter,\n\t\t\t\t\t\tresetToDefault: true,\n\t\t\t\t\t}),\n\t\t\t);\n\t\t\tfor (const cc of CCs) {\n\t\t\t\tawait this.host.sendCommand(cc, this.commandOptions);\n\t\t\t}\n\t\t}\n\t}\n\n\t/** Resets all configuration parameters to their default value */\n\tpublic async resetAll(): Promise<void> {\n\t\t// This is dangerous - don't allow resetting all parameters via multicast\n\t\tthis.assertPhysicalEndpoint(this.endpoint);\n\n\t\tthis.assertSupportsCommand(\n\t\t\tConfigurationCommand,\n\t\t\tConfigurationCommand.DefaultReset,\n\t\t);\n\n\t\tconst cc = new ConfigurationCCDefaultReset({\n\t\t\tnodeId: this.endpoint.nodeId,\n\t\t\tendpointIndex: this.endpoint.index,\n\t\t});\n\t\tawait 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 getProperties(parameter: number) {\n\t\t// Get-type commands are only possible in singlecast\n\t\tthis.assertPhysicalEndpoint(this.endpoint);\n\n\t\tconst cc = new ConfigurationCCPropertiesGet({\n\t\t\tnodeId: this.endpoint.nodeId,\n\t\t\tendpointIndex: this.endpoint.index,\n\t\t\tparameter,\n\t\t});\n\t\tconst response = await this.host.sendCommand<\n\t\t\tConfigurationCCPropertiesReport\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\"valueSize\",\n\t\t\t\t\"valueFormat\",\n\t\t\t\t\"minValue\",\n\t\t\t\t\"maxValue\",\n\t\t\t\t\"defaultValue\",\n\t\t\t\t\"nextParameter\",\n\t\t\t\t\"altersCapabilities\",\n\t\t\t\t\"isReadonly\",\n\t\t\t\t\"isAdvanced\",\n\t\t\t\t\"noBulkSupport\",\n\t\t\t]);\n\t\t}\n\t}\n\n\t/** Requests the name of a configuration parameter from the node */\n\t@validateArgs()\n\tpublic async getName(parameter: number): Promise<MaybeNotKnown<string>> {\n\t\t// Get-type commands are only possible in singlecast\n\t\tthis.assertPhysicalEndpoint(this.endpoint);\n\n\t\tconst cc = new ConfigurationCCNameGet({\n\t\t\tnodeId: this.endpoint.nodeId,\n\t\t\tendpointIndex: this.endpoint.index,\n\t\t\tparameter,\n\t\t});\n\t\tconst response = await this.host.sendCommand<\n\t\t\tConfigurationCCNameReport\n\t\t>(\n\t\t\tcc,\n\t\t\tthis.commandOptions,\n\t\t);\n\t\treturn response?.name;\n\t}\n\n\t/** Requests usage info for a configuration parameter from the node */\n\t@validateArgs()\n\tpublic async getInfo(parameter: number): Promise<MaybeNotKnown<string>> {\n\t\t// Get-type commands are only possible in singlecast\n\t\tthis.assertPhysicalEndpoint(this.endpoint);\n\n\t\tconst cc = new ConfigurationCCInfoGet({\n\t\t\tnodeId: this.endpoint.nodeId,\n\t\t\tendpointIndex: this.endpoint.index,\n\t\t\tparameter,\n\t\t});\n\t\tconst response = await this.host.sendCommand<\n\t\t\tConfigurationCCInfoReport\n\t\t>(\n\t\t\tcc,\n\t\t\tthis.commandOptions,\n\t\t);\n\t\treturn response?.info;\n\t}\n\n\t/**\n\t * This scans the node for the existing parameters. Found parameters will be reported\n\t * through the `value added` and `value updated` events.\n\t *\n\t * WARNING: This method throws for newer devices.\n\t *\n\t * WARNING: On nodes implementing V1 and V2, this process may take\n\t * **up to an hour**, depending on the configured timeout.\n\t *\n\t * WARNING: On nodes implementing V2, all parameters after 255 will be ignored.\n\t */\n\tpublic async scanParametersLegacy(): Promise<void> {\n\t\tif (this.version >= 3) {\n\t\t\tthrow new ZWaveError(\n\t\t\t\t\"Use ConfigurationCC.interview instead of scanning parameters for versions 3 and above.\",\n\t\t\t\tZWaveErrorCodes.ConfigurationCC_NoLegacyScanOnNewDevices,\n\t\t\t);\n\t\t}\n\n\t\t// Get-type commands are only possible in singlecast\n\t\tthis.assertPhysicalEndpoint(this.endpoint);\n\n\t\t// TODO: Reduce the priority of the messages\n\t\tthis.host.logNode(this.endpoint.nodeId, {\n\t\t\tendpoint: this.endpoint.index,\n\t\t\tmessage: `Scanning available parameters...`,\n\t\t});\n\t\tconst ccInstance = createConfigurationCCInstance(this.endpoint);\n\t\tfor (let param = 1; param <= 255; param++) {\n\t\t\t// Check if the parameter is readable\n\t\t\tlet originalValue: ConfigValue | undefined;\n\t\t\tthis.host.logNode(this.endpoint.nodeId, {\n\t\t\t\tendpoint: this.endpoint.index,\n\t\t\t\tmessage: ` trying param ${param}...`,\n\t\t\t\tdirection: \"outbound\",\n\t\t\t});\n\t\t\ttry {\n\t\t\t\toriginalValue = await this.get(param, {\n\t\t\t\t\t// When requesting a non-existing parameter, a node SHOULD respond with the\n\t\t\t\t\t// first available parameter. We use this for the first param only,\n\t\t\t\t\t// because delayed responses might otherwise confuse the interview process\n\t\t\t\t\tallowUnexpectedResponse: param === 1,\n\t\t\t\t});\n\t\t\t\tif (originalValue != undefined) {\n\t\t\t\t\tconst logMessage = ` Param ${param}:\n readable = true\n valueSize = ${\n\t\t\t\t\t\tccInstance.getParamInformation(this.host, param)\n\t\t\t\t\t\t\t.valueSize\n\t\t\t\t\t}\n value = ${originalValue.toString()}`;\n\t\t\t\t\tthis.host.logNode(this.endpoint.nodeId, {\n\t\t\t\t\t\tendpoint: this.endpoint.index,\n\t\t\t\t\t\tmessage: logMessage,\n\t\t\t\t\t\tdirection: \"inbound\",\n\t\t\t\t\t});\n\t\t\t\t}\n\t\t\t} catch (e) {\n\t\t\t\tif (\n\t\t\t\t\te instanceof ConfigurationCCError\n\t\t\t\t\t&& e.code\n\t\t\t\t\t\t=== ZWaveErrorCodes.ConfigurationCC_FirstParameterNumber\n\t\t\t\t) {\n\t\t\t\t\t// Continue iterating with the next param\n\t\t\t\t\tif (e.argument - 1 > param) param = e.argument - 1;\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\t\t\t\tthrow e;\n\t\t\t}\n\t\t}\n\t}\n}\n\n@commandClass(CommandClasses.Configuration)\n@implementedVersion(4)\n@ccValues(ConfigurationCCValues)\nexport class ConfigurationCC extends CommandClass {\n\tdeclare ccCommand: ConfigurationCommand;\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.Configuration,\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\tconst deviceConfig = ctx.getDeviceConfig?.(node.id);\n\t\tconst paramInfo = getParamInformationFromConfigFile(\n\t\t\tctx,\n\t\t\tnode.id,\n\t\t\tthis.endpointIndex,\n\t\t);\n\t\tif (paramInfo) {\n\t\t\tctx.logNode(node.id, {\n\t\t\t\tendpoint: this.endpointIndex,\n\t\t\t\tmessage:\n\t\t\t\t\t`${this.constructor.name}: Loading configuration parameters from device config`,\n\t\t\t\tdirection: \"none\",\n\t\t\t});\n\t\t\tthis.deserializeParamInformationFromConfig(ctx, paramInfo);\n\t\t}\n\t\tconst documentedParamNumbers = new Set(\n\t\t\tArray.from(paramInfo?.keys() ?? []).map((k) => k.parameter),\n\t\t);\n\n\t\tif (api.version >= 3) {\n\t\t\tctx.logNode(node.id, {\n\t\t\t\tendpoint: this.endpointIndex,\n\t\t\t\tmessage: \"finding first configuration parameter...\",\n\t\t\t\tdirection: \"outbound\",\n\t\t\t});\n\t\t\tconst param0props = await api.getProperties(0);\n\t\t\tlet param: number;\n\t\t\tif (param0props) {\n\t\t\t\tparam = param0props.nextParameter;\n\t\t\t\tif (param === 0) {\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`didn't report any config params, trying #1 just to be sure...`,\n\t\t\t\t\t\tdirection: \"inbound\",\n\t\t\t\t\t});\n\t\t\t\t\tparam = 1;\n\t\t\t\t}\n\t\t\t} else {\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\"Finding first configuration parameter 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\n\t\t\twhile (param > 0) {\n\t\t\t\tctx.logNode(node.id, {\n\t\t\t\t\tendpoint: this.endpointIndex,\n\t\t\t\t\tmessage: `querying parameter #${param} information...`,\n\t\t\t\t\tdirection: \"outbound\",\n\t\t\t\t});\n\n\t\t\t\t// Query properties and the next param\n\t\t\t\tconst props = await api.getProperties(param).catch(\n\t\t\t\t\t// If querying the properties fails, don't abort the entire interview\n\t\t\t\t\t() => undefined,\n\t\t\t\t);\n\t\t\t\tif (!props) {\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 parameter #${param} information timed out, skipping scan...`,\n\t\t\t\t\t\tlevel: \"warn\",\n\t\t\t\t\t});\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\tconst { nextParameter, ...properties } = props;\n\n\t\t\t\tlet logMessage: string;\n\t\t\t\tif (properties.valueSize === 0) {\n\t\t\t\t\tlogMessage =\n\t\t\t\t\t\t`Parameter #${param} is unsupported. Next parameter: ${nextParameter}`;\n\t\t\t\t} else {\n\t\t\t\t\tlet name: string | undefined;\n\t\t\t\t\t// Query the name and info for parameters that are NOT defined in a config file\n\t\t\t\t\tif (!documentedParamNumbers.has(param)) {\n\t\t\t\t\t\t// Skip the name query for bugged devices\n\t\t\t\t\t\tif (!deviceConfig?.compat?.skipConfigurationNameQuery) {\n\t\t\t\t\t\t\tname = await api.getName(param).catch(\n\t\t\t\t\t\t\t\t// If querying the name fails, don't abort the entire interview\n\t\t\t\t\t\t\t\t() => undefined,\n\t\t\t\t\t\t\t);\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\t// Skip the info query for bugged devices\n\t\t\t\t\t\tif (!deviceConfig?.compat?.skipConfigurationInfoQuery) {\n\t\t\t\t\t\t\tawait api.getInfo(param).catch(\n\t\t\t\t\t\t\t\t// If querying the info fails, don't abort the entire interview\n\t\t\t\t\t\t\t\t() => undefined,\n\t\t\t\t\t\t\t);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\n\t\t\t\t\tlogMessage =\n\t\t\t\t\t\t`received information for parameter #${param}:`;\n\t\t\t\t\tif (name) {\n\t\t\t\t\t\tlogMessage += `\nparameter name: ${name}`;\n\t\t\t\t\t}\n\t\t\t\t\tlogMessage += `\nvalue format: ${\n\t\t\t\t\t\tgetEnumMemberName(\n\t\t\t\t\t\t\tConfigValueFormat,\n\t\t\t\t\t\t\tproperties.valueFormat,\n\t\t\t\t\t\t)\n\t\t\t\t\t}\nvalue size: ${properties.valueSize} bytes\nmin value: ${properties.minValue?.toString() ?? \"undefined\"}\nmax value: ${properties.maxValue?.toString() ?? \"undefined\"}\ndefault value: ${properties.defaultValue?.toString() ?? \"undefined\"}\nis read-only: ${!!properties.isReadonly}\nis advanced (UI): ${!!properties.isAdvanced}\nhas bulk support: ${!properties.noBulkSupport}\nalters capabilities: ${!!properties.altersCapabilities}`;\n\t\t\t\t}\n\t\t\t\tctx.logNode(node.id, {\n\t\t\t\t\tendpoint: this.endpointIndex,\n\t\t\t\t\tmessage: logMessage,\n\t\t\t\t\tdirection: \"inbound\",\n\t\t\t\t});\n\n\t\t\t\t// Some devices report their parameter 1 instead of 0 as the next one\n\t\t\t\t// when reaching the end. To avoid infinite loops, stop scanning\n\t\t\t\t// once the next parameter is lower than the current one\n\t\t\t\tif (nextParameter > param) {\n\t\t\t\t\tparam = nextParameter;\n\t\t\t\t} else {\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tawait this.refreshValues(ctx);\n\n\t\t// Apply recommended values from device config\n\t\tif (\n\t\t\tparamInfo !== undefined\n\t\t\t&& ctx.getInterviewOptions().applyRecommendedConfigParamValues\n\t\t\t\t=== true\n\t\t) {\n\t\t\tawait this.applyRecommendedValues(ctx, node, paramInfo, api);\n\t\t}\n\n\t\t// Remember that the interview is complete\n\t\tthis.setInterviewComplete(ctx, true);\n\t}\n\n\t/**\n\t * Applies all recommended values from the device config to this node\n\t * Applies only if the current value is still the default value and\n\t * the recommended value is different\n\t */\n\tprivate async applyRecommendedValues(\n\t\tctx: InterviewContext,\n\t\tnode: NodeId,\n\t\tparamInfo: ParamInfoMap,\n\t\tapi: ConfigurationCCAPI,\n\t): Promise<void> {\n\t\tconst parametersNeededUpdate: ConfigurationCCAPISetOptions[] = [];\n\n\t\t// Find parameters for which current value doesn't match the recommended value\n\t\tfor (const [paramKey, param] of paramInfo) {\n\t\t\tif (\n\t\t\t\tparam.recommendedValue === undefined\n\t\t\t\t|| param.defaultValue === param.recommendedValue\n\t\t\t) continue;\n\n\t\t\t// Get the current value of this parameter from the device\n\t\t\tconst currentValue = this.getValue(\n\t\t\t\tctx,\n\t\t\t\tConfigurationCCValues.paramInformation(\n\t\t\t\t\tparamKey.parameter,\n\t\t\t\t\tparamKey.valueBitMask,\n\t\t\t\t),\n\t\t\t);\n\n\t\t\t// If the current value is the default value (i.e. it was never changed by the user)\n\t\t\t// and the recommended value is different, we should update it\n\t\t\tif (\n\t\t\t\tcurrentValue === param.defaultValue\n\t\t\t\t&& currentValue !== param.recommendedValue\n\t\t\t) {\n\t\t\t\tconst baseParam = {\n\t\t\t\t\tparameter: paramKey.parameter,\n\t\t\t\t\tvalue: param.recommendedValue,\n\t\t\t\t};\n\n\t\t\t\tparametersNeededUpdate.push(\n\t\t\t\t\tparam.valueBitMask !== undefined\n\t\t\t\t\t\t? { ...baseParam, bitMask: param.valueBitMask }\n\t\t\t\t\t\t: baseParam,\n\t\t\t\t);\n\t\t\t}\n\t\t}\n\n\t\tif (parametersNeededUpdate.length === 0) return;\n\n\t\t// Log what we're about to do\n\t\tlet message =\n\t\t\t`Applying recommended config parameter values during interview:`;\n\t\tfor (const param of parametersNeededUpdate) {\n\t\t\tconst formatterBitMask = param.bitMask\n\t\t\t\t? `[0x${num2hex(param.bitMask)}]`\n\t\t\t\t: \"\";\n\t\t\tconst fullParamKey = `${param.parameter}${formatterBitMask}`;\n\t\t\tmessage += `\\n\u00B7 #${fullParamKey} => ${param.value}`;\n\t\t}\n\n\t\tctx.logNode(node.id, {\n\t\t\tendpoint: this.endpointIndex,\n\t\t\tmessage,\n\t\t\tdirection: \"none\",\n\t\t});\n\n\t\tawait api.setBulk(parametersNeededUpdate);\n\t\tawait api.getBulk(parametersNeededUpdate.map((param) => ({\n\t\t\tparameter: param.parameter,\n\t\t\tbitMask: param.bitMask,\n\t\t})));\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.Configuration,\n\t\t\tctx,\n\t\t\tendpoint,\n\t\t).withOptions({\n\t\t\tpriority: MessagePriority.NodeQuery,\n\t\t});\n\n\t\tif (api.version < 3) {\n\t\t\t// V1/V2: Query all values defined in the config file\n\t\t\tconst paramInfo = getParamInformationFromConfigFile(\n\t\t\t\tctx,\n\t\t\t\tnode.id,\n\t\t\t\tthis.endpointIndex,\n\t\t\t);\n\t\t\tif (paramInfo?.size) {\n\t\t\t\t// Because partial params share the same parameter number,\n\t\t\t\t// we need to remember which ones we have already queried.\n\t\t\t\tconst alreadyQueried = new Set<number>();\n\t\t\t\tfor (const param of paramInfo.keys()) {\n\t\t\t\t\t// No need to query writeonly params\n\t\t\t\t\tif (paramInfo.get(param)?.writeOnly) continue;\n\t\t\t\t\t// Don't double-query params\n\t\t\t\t\tif (alreadyQueried.has(param.parameter)) continue;\n\t\t\t\t\talreadyQueried.add(param.parameter);\n\n\t\t\t\t\t// Query the current value\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 parameter #${param.parameter} value...`,\n\t\t\t\t\t\tdirection: \"outbound\",\n\t\t\t\t\t});\n\t\t\t\t\t// ... at least try to\n\t\t\t\t\tconst paramValue = await api.get(param.parameter);\n\t\t\t\t\tif (typeof paramValue === \"number\") {\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`parameter #${param.parameter} has value: ${paramValue}`,\n\t\t\t\t\t\t\tdirection: \"inbound\",\n\t\t\t\t\t\t});\n\t\t\t\t\t} else if (!paramValue) {\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 no value for parameter #${param.parameter}`,\n\t\t\t\t\t\t\tdirection: \"inbound\",\n\t\t\t\t\t\t\tlevel: \"warn\",\n\t\t\t\t\t\t});\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t} else {\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`${this.constructor.name}: skipping interview because CC version is < 3 and there is no config file`,\n\t\t\t\t\tdirection: \"none\",\n\t\t\t\t});\n\t\t\t}\n\t\t} else {\n\t\t\t// V3+: Query the values of discovered parameters\n\t\t\tconst parameters = distinct(\n\t\t\t\tthis.getDefinedValueIDs(ctx)\n\t\t\t\t\t.map((v) => v.property)\n\t\t\t\t\t.filter((p) => typeof p === \"number\"),\n\t\t\t);\n\t\t\tfor (const param of parameters) {\n\t\t\t\tif (\n\t\t\t\t\tthis.getParamInformation(ctx, param).readable !== false\n\t\t\t\t) {\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: `querying parameter #${param} value...`,\n\t\t\t\t\t\tdirection: \"outbound\",\n\t\t\t\t\t});\n\t\t\t\t\tawait api.get(param);\n\t\t\t\t} else {\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`not querying parameter #${param} value, because it is writeonly`,\n\t\t\t\t\t\tdirection: \"none\",\n\t\t\t\t\t});\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\n\t/**\n\t * Whether this node's param information was loaded from a config file.\n\t * If this is true, we don't trust what the node reports\n\t */\n\tprotected paramExistsInConfigFile(\n\t\tctx: GetValueDB & GetDeviceConfig,\n\t\tparameter: number,\n\t\tvalueBitMask?: number,\n\t): boolean {\n\t\tif (\n\t\t\tthis.getValue(\n\t\t\t\tctx,\n\t\t\t\tConfigurationCCValues.isParamInformationFromConfig,\n\t\t\t) !== true\n\t\t) {\n\t\t\treturn false;\n\t\t}\n\t\tconst paramInformation = getParamInformationFromConfigFile(\n\t\t\tctx,\n\t\t\tthis.nodeId as number,\n\t\t\tthis.endpointIndex,\n\t\t);\n\t\tif (!paramInformation) return false;\n\n\t\t// Check if the param is defined in the config file, either as a normal param or a partial\n\t\tif (paramInformation.has({ parameter, valueBitMask })) {\n\t\t\treturn true;\n\t\t} else if (valueBitMask == undefined) {\n\t\t\t// Also consider partials when looking for plain params\n\t\t\tfor (const key of paramInformation.keys()) {\n\t\t\t\tif (key.parameter === parameter) return true;\n\t\t\t}\n\t\t}\n\n\t\treturn false;\n\t}\n\n\t/**\n\t * @internal\n\t * Stores config parameter metadata for this CC's node\n\t */\n\tpublic extendParamInformation(\n\t\tctx: GetValueDB & GetDeviceConfig,\n\t\tparameter: number,\n\t\tvalueBitMask: number | undefined,\n\t\tinfo: Partial<ConfigurationMetadata>,\n\t): void {\n\t\t// Don't trust param information that a node reports if we have already loaded it from a config file\n\t\tif (\n\t\t\tvalueBitMask === undefined\n\t\t\t&& this.paramExistsInConfigFile(ctx, parameter)\n\t\t) {\n\t\t\treturn;\n\t\t}\n\n\t\t// Retrieve the base metadata\n\t\tconst metadata = this.getParamInformation(\n\t\t\tctx,\n\t\t\tparameter,\n\t\t\tvalueBitMask,\n\t\t);\n\t\t// Override it with new data\n\t\tObject.assign(metadata, info);\n\t\t// And store it back\n\t\tthis.setMetadata(\n\t\t\tctx,\n\t\t\tConfigurationCCValues.paramInformation(parameter, valueBitMask),\n\t\t\tmetadata,\n\t\t);\n\t}\n\n\t/**\n\t * @internal\n\t * Returns stored config parameter metadata for this CC's node\n\t */\n\tpublic getParamInformation(\n\t\tctx: GetValueDB,\n\t\tparameter: number,\n\t\tvalueBitMask?: number,\n\t): ConfigurationMetadata {\n\t\treturn (\n\t\t\tthis.getMetadata(\n\t\t\t\tctx,\n\t\t\t\tConfigurationCCValues.paramInformation(parameter, valueBitMask),\n\t\t\t) ?? {\n\t\t\t\t...ValueMetadata.Any,\n\t\t\t}\n\t\t);\n\t}\n\n\t/**\n\t * **INTERNAL:** Returns the param info that was queried for this node. This returns the information that was returned by the node\n\t * and does not include partial parameters.\n\t */\n\tpublic getQueriedParamInfos(\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): Record<number, ConfigurationMetadata> {\n\t\tconst parameters = distinct(\n\t\t\tthis.getDefinedValueIDs(ctx)\n\t\t\t\t.map((v) => v.property)\n\t\t\t\t.filter((p) => typeof p === \"number\"),\n\t\t);\n\t\treturn Object.fromEntries(\n\t\t\tparameters.map((p) => [\n\t\t\t\tp as any,\n\t\t\t\tthis.getParamInformation(ctx, p),\n\t\t\t]),\n\t\t);\n\t}\n\n\t/**\n\t * Returns stored config parameter metadata for all partial config params addressed with the given parameter number\n\t */\n\tpublic getPartialParamInfos(\n\t\tctx: GetValueDB,\n\t\tparameter: number,\n\t): (ValueID & { metadata: ConfigurationMetadata })[] {\n\t\tconst valueDB = this.getValueDB(ctx);\n\t\treturn valueDB.findMetadata(\n\t\t\t(id) =>\n\t\t\t\tid.commandClass === this.ccId\n\t\t\t\t&& (id.endpoint ?? 0) === this.endpointIndex\n\t\t\t\t&& id.property === parameter\n\t\t\t\t&& id.propertyKey != undefined,\n\t\t) as (ValueID & { metadata: ConfigurationMetadata })[];\n\t}\n\n\t/**\n\t * Computes the full value of a parameter after applying a partial param value\n\t */\n\tpublic composePartialParamValue(\n\t\tctx: GetValueDB,\n\t\tparameter: number,\n\t\tbitMask: number,\n\t\tpartialValue: number,\n\t): number {\n\t\treturn this.composePartialParamValues(ctx, parameter, [\n\t\t\t{ bitMask, partialValue },\n\t\t]);\n\t}\n\n\t/**\n\t * Computes the full value of a parameter after applying multiple partial param values\n\t */\n\tpublic composePartialParamValues(\n\t\tctx: GetValueDB,\n\t\tparameter: number,\n\t\tpartials: {\n\t\t\tbitMask: number;\n\t\t\tpartialValue: number;\n\t\t}[],\n\t): number {\n\t\tconst valueDB = this.getValueDB(ctx);\n\t\t// Add the other values together\n\t\tconst otherValues = valueDB.findValues(\n\t\t\t(id) =>\n\t\t\t\tid.commandClass === this.ccId\n\t\t\t\t&& (id.endpoint ?? 0) === this.endpointIndex\n\t\t\t\t&& id.property === parameter\n\t\t\t\t&& id.propertyKey != undefined\n\t\t\t\t&& !partials.some((p) => id.propertyKey === p.bitMask),\n\t\t);\n\t\tlet ret = 0;\n\t\tfor (\n\t\t\tconst {\n\t\t\t\tpropertyKey: bitMask,\n\t\t\t\tvalue: partialValue,\n\t\t\t} of otherValues\n\t\t) {\n\t\t\tret = encodePartial(ret, partialValue as number, bitMask as number);\n\t\t}\n\t\tfor (const { bitMask, partialValue } of partials) {\n\t\t\tret = encodePartial(ret, partialValue, bitMask);\n\t\t}\n\t\treturn ret;\n\t}\n\n\t/** Deserializes the config parameter info from a config file */\n\tpublic deserializeParamInformationFromConfig(\n\t\tctx: GetValueDB & GetDeviceConfig,\n\t\tconfig: ParamInfoMap,\n\t): void {\n\t\tconst valueDB = this.getValueDB(ctx);\n\n\t\t// Clear old param information\n\t\tfor (const meta of valueDB.getAllMetadata(this.ccId)) {\n\t\t\tif (\n\t\t\t\ttypeof meta.property === \"number\"\n\t\t\t\t&& (meta.endpoint ?? 0) === this.endpointIndex\n\t\t\t) {\n\t\t\t\t// this is a param information, delete it\n\t\t\t\tvalueDB.setMetadata(\n\t\t\t\t\tmeta,\n\t\t\t\t\tundefined,\n\t\t\t\t\t// Don't emit the added/updated events, as this will spam applications with untranslated events\n\t\t\t\t\t{ noEvent: true },\n\t\t\t\t);\n\t\t\t}\n\t\t}\n\n\t\t// Allow overwriting the param info (mark it as unloaded)\n\t\tthis.setValue(\n\t\t\tctx,\n\t\t\tConfigurationCCValues.isParamInformationFromConfig,\n\t\t\tfalse,\n\t\t);\n\n\t\tfor (const [param, info] of config.entries()) {\n\t\t\t// Skip hidden parameters entirely - don't create metadata or persist values\n\t\t\tif (info.hidden) {\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\t// We need to make the config information compatible with the\n\t\t\t// format that ConfigurationCC reports\n\t\t\tconst paramInfo: Partial<ConfigurationMetadata> = stripUndefined({\n\t\t\t\t// TODO: Make this smarter! (0...1 ==> boolean)\n\t\t\t\ttype: \"number\",\n\t\t\t\tvalueSize: info.valueSize,\n\t\t\t\tmin: info.minValue,\n\t\t\t\tmax: info.maxValue,\n\t\t\t\tallowed: info.allowed,\n\t\t\t\tdefault: info.defaultValue,\n\t\t\t\trecommended: info.recommendedValue,\n\t\t\t\tunit: info.unit,\n\t\t\t\tformat: info.unsigned\n\t\t\t\t\t? ConfigValueFormat.UnsignedInteger\n\t\t\t\t\t: ConfigValueFormat.SignedInteger,\n\t\t\t\treadable: !info.writeOnly,\n\t\t\t\twriteable: !info.readOnly,\n\t\t\t\tallowManualEntry: info.allowManualEntry,\n\t\t\t\tstates: info.options.length > 0\n\t\t\t\t\t? Object.fromEntries(\n\t\t\t\t\t\tinfo.options.map(({ label, value }) => [\n\t\t\t\t\t\t\tvalue.toString(),\n\t\t\t\t\t\t\tlabel,\n\t\t\t\t\t\t]),\n\t\t\t\t\t)\n\t\t\t\t\t: undefined,\n\t\t\t\tlabel: info.label,\n\t\t\t\tdescription: info.description,\n\t\t\t\tisFromConfig: true,\n\t\t\t\tdestructive: info.destructive,\n\t\t\t});\n\t\t\tthis.extendParamInformation(\n\t\t\t\tctx,\n\t\t\t\tparam.parameter,\n\t\t\t\tparam.valueBitMask,\n\t\t\t\tparamInfo,\n\t\t\t);\n\t\t}\n\n\t\t// Remember that we loaded the param information from a config file\n\t\tthis.setValue(\n\t\t\tctx,\n\t\t\tConfigurationCCValues.isParamInformationFromConfig,\n\t\t\ttrue,\n\t\t);\n\t}\n\n\tpublic translatePropertyKey(\n\t\tctx: GetValueDB,\n\t\tproperty: string | number,\n\t\tpropertyKey?: string | number,\n\t): string | undefined {\n\t\tif (\n\t\t\ttypeof property === \"number\"\n\t\t\t&& (propertyKey == undefined || typeof propertyKey === \"number\")\n\t\t) {\n\t\t\t// This CC names all configuration parameters differently,\n\t\t\t// so no name for the property key is required\n\t\t\treturn undefined;\n\t\t}\n\t\treturn super.translateProperty(ctx, property, propertyKey);\n\t}\n\n\tpublic translateProperty(\n\t\tctx: GetValueDB,\n\t\tproperty: string | number,\n\t\tpropertyKey?: string | number,\n\t): string {\n\t\t// Try to retrieve the configured param label\n\t\tif (\n\t\t\ttypeof property === \"number\"\n\t\t\t&& (propertyKey == undefined || typeof propertyKey === \"number\")\n\t\t) {\n\t\t\tconst paramInfo = this.getParamInformation(\n\t\t\t\tctx,\n\t\t\t\tproperty,\n\t\t\t\tpropertyKey,\n\t\t\t);\n\t\t\tif (paramInfo.label) return paramInfo.label;\n\t\t\t// fall back to paramXYZ[_key] if none is defined\n\t\t\tlet ret = `param${property.toString().padStart(3, \"0\")}`;\n\t\t\tif (propertyKey != undefined) {\n\t\t\t\tret += \"_\" + propertyKey.toString();\n\t\t\t}\n\t\t\treturn ret;\n\t\t}\n\t\treturn super.translateProperty(ctx, property, propertyKey);\n\t}\n}\n\n/** @publicAPI */\nexport interface ConfigurationCCReportOptions {\n\tparameter: number;\n\tvalue: ConfigValue;\n\tvalueSize: number;\n\tvalueFormat?: ConfigValueFormat;\n}\n\n@CCCommand(ConfigurationCommand.Report)\nexport class ConfigurationCCReport extends ConfigurationCC {\n\tpublic constructor(\n\t\toptions: WithAddress<ConfigurationCCReportOptions>,\n\t) {\n\t\tsuper(options);\n\n\t\tthis.parameter = options.parameter;\n\t\tthis.value = options.value;\n\t\tthis.valueSize = options.valueSize;\n\t\tthis.valueFormat = options.valueFormat;\n\t}\n\n\tpublic static from(\n\t\traw: CCRaw,\n\t\tctx: CCParsingContext,\n\t): ConfigurationCCReport {\n\t\t// All fields must be present\n\t\tvalidatePayload(raw.payload.length > 2);\n\t\tconst parameter = raw.payload[0];\n\t\tconst valueSize = raw.payload[1] & 0b111;\n\n\t\t// Ensure we received a valid report\n\t\tvalidatePayload(\n\t\t\tvalueSize >= 1,\n\t\t\tvalueSize <= 4,\n\t\t\traw.payload.length >= 2 + valueSize,\n\t\t);\n\t\t// Default to parsing the value as SignedInteger, like the specs say.\n\t\t// We try to re-interpret the value in persistValues()\n\t\tconst value = parseValue(\n\t\t\traw.payload.subarray(2),\n\t\t\tvalueSize,\n\t\t\tConfigValueFormat.SignedInteger,\n\t\t);\n\n\t\treturn new this({\n\t\t\tnodeId: ctx.sourceNodeId,\n\t\t\tparameter,\n\t\t\tvalueSize,\n\t\t\tvalue,\n\t\t});\n\t}\n\n\tpublic parameter: number;\n\tpublic value: ConfigValue;\n\tpublic valueSize: number;\n\tprivate valueFormat?: ConfigValueFormat; // only used for serialization\n\n\tpublic persistValues(ctx: PersistValuesContext): boolean {\n\t\tif (!super.persistValues(ctx)) return false;\n\n\t\t// Skip hidden parameters entirely - don't persist values\n\t\tconst paramInfo = getParamInformationFromConfigFile(\n\t\t\tctx,\n\t\t\tthis.nodeId as number,\n\t\t\tthis.endpointIndex,\n\t\t);\n\t\tif (paramInfo?.get({ parameter: this.parameter })?.hidden) {\n\t\t\treturn true;\n\t\t}\n\n\t\tconst ccVersion = getEffectiveCCVersion(ctx, this);\n\n\t\t// This parameter may be a partial param in the following cases:\n\t\t// * a config file defines it as such\n\t\t// * it was reported by the device as a bit field\n\t\tconst partialParams = this.getPartialParamInfos(\n\t\t\tctx,\n\t\t\tthis.parameter,\n\t\t);\n\n\t\tlet cachedValueFormat: ConfigValueFormat | undefined;\n\n\t\tif (partialParams.length > 0) {\n\t\t\t// This is a partial param. All definitions should have the same format, so we just take the first one\n\t\t\tcachedValueFormat = partialParams[0].metadata.format;\n\t\t} else {\n\t\t\t// Check if the initial assumption of SignedInteger holds true\n\t\t\tconst oldParamInformation = this.getParamInformation(\n\t\t\t\tctx,\n\t\t\t\tthis.parameter,\n\t\t\t);\n\t\t\tcachedValueFormat = oldParamInformation.format;\n\n\t\t\t// On older CC versions, these reports may be the only way we can retrieve the value size\n\t\t\t// Therefore we store it here\n\t\t\tthis.extendParamInformation(ctx, this.parameter, undefined, {\n\t\t\t\tvalueSize: this.valueSize,\n\t\t\t});\n\t\t\tif (\n\t\t\t\tccVersion < 3\n\t\t\t\t&& !this.paramExistsInConfigFile(ctx, this.parameter)\n\t\t\t\t&& oldParamInformation.min == undefined\n\t\t\t\t&& oldParamInformation.max == undefined\n\t\t\t) {\n\t\t\t\tconst isSigned = oldParamInformation.format == undefined\n\t\t\t\t\t|| oldParamInformation.format\n\t\t\t\t\t\t=== ConfigValueFormat.SignedInteger;\n\t\t\t\tthis.extendParamInformation(\n\t\t\t\t\tctx,\n\t\t\t\t\tthis.parameter,\n\t\t\t\t\tundefined,\n\t\t\t\t\tgetIntegerLimits(this.valueSize as any, isSigned),\n\t\t\t\t);\n\t\t\t}\n\t\t}\n\n\t\t// We may have to re-interpret the value as unsigned, depending on the cached value format\n\t\tif (\n\t\t\tcachedValueFormat != undefined\n\t\t\t&& cachedValueFormat !== ConfigValueFormat.SignedInteger\n\t\t) {\n\t\t\t// Re-interpret the value with the new format\n\t\t\tthis.value = reInterpretSignedValue(\n\t\t\t\tthis.value,\n\t\t\t\tthis.valueSize,\n\t\t\t\tcachedValueFormat,\n\t\t\t);\n\t\t}\n\n\t\t// And store the value itself\n\t\t// If we have partial config params defined, we need to split the value\n\t\tif (partialParams.length > 0) {\n\t\t\tfor (const param of partialParams) {\n\t\t\t\tif (typeof param.propertyKey === \"number\") {\n\t\t\t\t\tthis.setValue(\n\t\t\t\t\t\tctx,\n\t\t\t\t\t\tConfigurationCCValues.paramInformation(\n\t\t\t\t\t\t\tthis.parameter,\n\t\t\t\t\t\t\tparam.propertyKey,\n\t\t\t\t\t\t),\n\t\t\t\t\t\tparsePartial(\n\t\t\t\t\t\t\tthis.value as any,\n\t\t\t\t\t\t\tparam.propertyKey,\n\t\t\t\t\t\t\tisSignedPartial(\n\t\t\t\t\t\t\t\tparam.propertyKey,\n\t\t\t\t\t\t\t\tparam.metadata.format,\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} else {\n\t\t\t// This is a single param\n\t\t\tthis.setValue(\n\t\t\t\tctx,\n\t\t\t\tConfigurationCCValues.paramInformation(this.parameter),\n\t\t\t\tthis.value,\n\t\t\t);\n\t\t}\n\t\treturn true;\n\t}\n\n\tpublic serialize(ctx: CCEncodingContext): Promise<Bytes> {\n\t\tthis.payload = Bytes.concat([\n\t\t\t[this.parameter, this.valueSize & 0b111],\n\t\t\tnew Bytes(this.valueSize),\n\t\t]);\n\t\tserializeValue(\n\t\t\tthis.payload,\n\t\t\t2,\n\t\t\tthis.valueSize,\n\t\t\tthis.valueFormat ?? ConfigValueFormat.SignedInteger,\n\t\t\tthis.value,\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\"parameter #\": this.parameter,\n\t\t\t\t\"value size\": this.valueSize,\n\t\t\t\tvalue: configValueToString(this.value),\n\t\t\t},\n\t\t};\n\t}\n}\n\nfunction testResponseForConfigurationGet(\n\tsent: ConfigurationCCGet,\n\treceived: ConfigurationCCReport,\n) {\n\t// We expect a Configuration Report that matches the requested parameter\n\treturn (\n\t\tsent.parameter === received.parameter || sent.allowUnexpectedResponse\n\t);\n}\n\n// @publicAPI\nexport interface ConfigurationCCGetOptions {\n\tparameter: number;\n\t/**\n\t * If this is `true`, responses with different parameters than expected are accepted\n\t * and treated as hints for the first parameter number.\n\t */\n\tallowUnexpectedResponse?: boolean;\n}\n\n@CCCommand(ConfigurationCommand.Get)\n@expectedCCResponse(ConfigurationCCReport, testResponseForConfigurationGet)\nexport class ConfigurationCCGet extends ConfigurationCC {\n\tpublic constructor(\n\t\toptions: WithAddress<ConfigurationCCGetOptions>,\n\t) {\n\t\tsuper(options);\n\t\tthis.parameter = options.parameter;\n\t\tthis.allowUnexpectedResponse = options.allowUnexpectedResponse\n\t\t\t?? false;\n\t}\n\n\tpublic static from(raw: CCRaw, ctx: CCParsingContext): ConfigurationCCGet {\n\t\tvalidatePayload(raw.payload.length >= 1);\n\t\tconst parameter = raw.payload[0];\n\n\t\treturn new this({\n\t\t\tnodeId: ctx.sourceNodeId,\n\t\t\tparameter,\n\t\t});\n\t}\n\n\tpublic parameter: number;\n\tpublic allowUnexpectedResponse: boolean;\n\n\tpublic serialize(ctx: CCEncodingContext): Promise<Bytes> {\n\t\tthis.payload = Bytes.from([this.parameter]);\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: { \"parameter #\": this.parameter },\n\t\t};\n\t}\n}\n\n// @publicAPI\nexport type ConfigurationCCSetOptions =\n\t| {\n\t\tparameter: number;\n\t\tresetToDefault: true;\n\t}\n\t| {\n\t\tparameter: number;\n\t\tresetToDefault?: false;\n\t\tvalueSize: number;\n\t\t/** How the value is encoded. Defaults to SignedInteger */\n\t\tvalueFormat?: ConfigValueFormat;\n\t\tvalue: ConfigValue;\n\t};\n\n@CCCommand(ConfigurationCommand.Set)\n@useSupervision()\nexport class ConfigurationCCSet extends ConfigurationCC {\n\tpublic constructor(\n\t\toptions: WithAddress<ConfigurationCCSetOptions>,\n\t) {\n\t\tsuper(options);\n\t\tthis.parameter = options.parameter;\n\t\tthis.resetToDefault = !!options.resetToDefault;\n\t\tif (!options.resetToDefault) {\n\t\t\t// TODO: Default to the stored value size\n\t\t\tthis.valueSize = options.valueSize;\n\t\t\tthis.valueFormat = options.valueFormat\n\t\t\t\t?? ConfigValueFormat.SignedInteger;\n\t\t\tthis.value = options.value;\n\t\t}\n\t}\n\n\tpublic static from(raw: CCRaw, ctx: CCParsingContext): ConfigurationCCSet {\n\t\tvalidatePayload(raw.payload.length >= 2);\n\t\tconst parameter = raw.payload[0];\n\t\tconst resetToDefault = !!(raw.payload[1] & 0b1000_0000);\n\t\tconst valueSize: number | undefined = raw.payload[1] & 0b111;\n\n\t\t// Ensure we received a valid report\n\t\tvalidatePayload(\n\t\t\tvalueSize >= 1,\n\t\t\tvalueSize <= 4,\n\t\t\traw.payload.length >= 2 + valueSize,\n\t\t);\n\t\t// Parse the value as signed integer. We don't know the format here.\n\t\tconst value: number | undefined = parseValue(\n\t\t\traw.payload.subarray(2),\n\t\t\tvalueSize,\n\t\t\tConfigValueFormat.SignedInteger,\n\t\t);\n\n\t\treturn new this({\n\t\t\tnodeId: ctx.sourceNodeId,\n\t\t\tparameter,\n\t\t\tresetToDefault,\n\t\t\tvalueSize,\n\t\t\tvalue,\n\t\t});\n\t}\n\n\tpublic resetToDefault: boolean;\n\tpublic parameter: number;\n\tpublic valueSize: number | undefined;\n\tpublic valueFormat: ConfigValueFormat | undefined;\n\tpublic value: ConfigValue | undefined;\n\n\tpublic serialize(ctx: CCEncodingContext): Promise<Bytes> {\n\t\tconst valueSize = this.resetToDefault ? 1 : this.valueSize!;\n\t\tconst payloadLength = 2 + valueSize;\n\t\tthis.payload = Bytes.alloc(payloadLength, 0);\n\t\tthis.payload[0] = this.parameter;\n\t\tthis.payload[1] = (this.resetToDefault ? 0b1000_0000 : 0)\n\t\t\t| (valueSize & 0b111);\n\t\tif (!this.resetToDefault) {\n\t\t\t// Make sure that the given value fits into the value size\n\t\t\tif (\n\t\t\t\ttypeof this.value === \"number\"\n\t\t\t\t&& !isSafeValue(this.value, valueSize, this.valueFormat!)\n\t\t\t) {\n\t\t\t\t// If there is a value size configured, check that the given value is compatible\n\t\t\t\tthrowInvalidValueError(\n\t\t\t\t\tthis.value,\n\t\t\t\t\tthis.parameter,\n\t\t\t\t\tvalueSize,\n\t\t\t\t\tthis.valueFormat!,\n\t\t\t\t);\n\t\t\t}\n\n\t\t\ttry {\n\t\t\t\tserializeValue(\n\t\t\t\t\tthis.payload,\n\t\t\t\t\t2,\n\t\t\t\t\tvalueSize,\n\t\t\t\t\tthis.valueFormat!,\n\t\t\t\t\tthis.value!,\n\t\t\t\t);\n\t\t\t} catch (e) {\n\t\t\t\ttryCatchOutOfBoundsError(\n\t\t\t\t\te as Error,\n\t\t\t\t\tthis.value,\n\t\t\t\t\tthis.parameter,\n\t\t\t\t\tvalueSize,\n\t\t\t\t\tthis.valueFormat!,\n\t\t\t\t);\n\t\t\t}\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\t\t\"parameter #\": this.parameter,\n\t\t\t\"reset to default\": this.resetToDefault,\n\t\t};\n\t\tif (this.valueSize != undefined) {\n\t\t\tmessage[\"value size\"] = this.valueSize;\n\t\t}\n\t\tif (this.valueFormat != undefined) {\n\t\t\tmessage[\"value format\"] = getEnumMemberName(\n\t\t\t\tConfigValueFormat,\n\t\t\t\tthis.valueFormat,\n\t\t\t);\n\t\t}\n\t\tif (this.value != undefined) {\n\t\t\tmessage.value = configValueToString(this.value);\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 ConfigurationCCBulkSetOptions =\n\t& {\n\t\tparameters: number[];\n\t\thandshake?: boolean;\n\t}\n\t& (\n\t\t| {\n\t\t\tresetToDefault: true;\n\t\t}\n\t\t| {\n\t\t\tresetToDefault?: false;\n\t\t\tvalueSize: number;\n\t\t\tvalueFormat?: ConfigValueFormat;\n\t\t\tvalues: number[];\n\t\t}\n\t);\n\nfunction getResponseForBulkSet(\n\tctx: GetNode<NodeId & SupportsCC>,\n\tcc: ConfigurationCCBulkSet,\n) {\n\treturn cc.handshake ? ConfigurationCCBulkReport : undefined;\n}\n\n@CCCommand(ConfigurationCommand.BulkSet)\n@expectedCCResponse(getResponseForBulkSet)\n@useSupervision()\nexport class ConfigurationCCBulkSet extends ConfigurationCC {\n\tpublic constructor(\n\t\toptions: WithAddress<ConfigurationCCBulkSetOptions>,\n\t) {\n\t\tsuper(options);\n\t\tthis._parameters = options.parameters;\n\t\tif (this._parameters.length < 1) {\n\t\t\tthrow new ZWaveError(\n\t\t\t\t`In a ConfigurationCC.BulkSet, parameters must be a non-empty array`,\n\t\t\t\tZWaveErrorCodes.CC_Invalid,\n\t\t\t);\n\t\t} else if (!isConsecutiveArray(this._parameters)) {\n\t\t\tthrow new ZWaveError(\n\t\t\t\t`A ConfigurationCC.BulkSet can only be used for consecutive parameters`,\n\t\t\t\tZWaveErrorCodes.CC_Invalid,\n\t\t\t);\n\t\t}\n\t\tthis._handshake = !!options.handshake;\n\t\tthis._resetToDefault = !!options.resetToDefault;\n\t\tif (!!options.resetToDefault) {\n\t\t\tthis._valueSize = 1;\n\t\t\tthis._valueFormat = ConfigValueFormat.SignedInteger;\n\t\t\tthis._values = this._parameters.map(() => 0);\n\t\t} else {\n\t\t\tthis._valueSize = options.valueSize;\n\t\t\tthis._valueFormat = options.valueFormat\n\t\t\t\t?? ConfigValueFormat.SignedInteger;\n\t\t\tthis._values = options.values;\n\t\t}\n\t}\n\n\tpublic static from(\n\t\t_raw: CCRaw,\n\t\t_ctx: CCParsingContext,\n\t): ConfigurationCCBulkSet {\n\t\t// TODO: Deserialize payload\n\t\tthrow new ZWaveError(\n\t\t\t`${this.name}: deserialization not implemented`,\n\t\t\tZWaveErrorCodes.Deserialization_NotImplemented,\n\t\t);\n\n\t\t// return new ConfigurationCCBulkSet({\n\t\t// \tnodeId: ctx.sourceNodeId,\n\t\t// });\n\t}\n\n\tprivate _parameters: number[];\n\tpublic get parameters(): number[] {\n\t\treturn this._parameters;\n\t}\n\tprivate _resetToDefault: boolean;\n\tpublic get resetToDefault(): boolean {\n\t\treturn this._resetToDefault;\n\t}\n\tprivate _valueSize: number;\n\tpublic get valueSize(): number {\n\t\treturn this._valueSize;\n\t}\n\tprivate _valueFormat: ConfigValueFormat;\n\tpublic get valueFormat(): ConfigValueFormat {\n\t\treturn this._valueFormat;\n\t}\n\tprivate _values: number[];\n\tpublic get values(): number[] {\n\t\treturn this._values;\n\t}\n\tprivate _handshake: boolean;\n\tpublic get handshake(): boolean {\n\t\treturn this._handshake;\n\t}\n\n\tpublic serialize(ctx: CCEncodingContext): Promise<Bytes> {\n\t\tconst valueSize = this._resetToDefault ? 1 : this.valueSize;\n\t\tconst payloadLength = 4 + valueSize * this.parameters.length;\n\t\tthis.payload = Bytes.alloc(payloadLength, 0);\n\t\tthis.payload.writeUInt16BE(this.parameters[0], 0);\n\t\tthis.payload[2] = this.parameters.length;\n\t\tthis.payload[3] = (this._resetToDefault ? 0b1000_0000 : 0)\n\t\t\t| (this.handshake ? 0b0100_0000 : 0)\n\t\t\t| (valueSize & 0b111);\n\t\tif (!this._resetToDefault) {\n\t\t\tfor (let i = 0; i < this.parameters.length; i++) {\n\t\t\t\tconst value = this._values[i];\n\t\t\t\tconst param = this._parameters[i];\n\n\t\t\t\t// Make sure that the given value fits into the value size\n\t\t\t\tif (!isSafeValue(value, valueSize, this._valueFormat)) {\n\t\t\t\t\t// If there is a value size configured, check that the given value is compatible\n\t\t\t\t\tthrowInvalidValueError(\n\t\t\t\t\t\tvalue,\n\t\t\t\t\t\tparam,\n\t\t\t\t\t\tvalueSize,\n\t\t\t\t\t\tthis._valueFormat,\n\t\t\t\t\t);\n\t\t\t\t}\n\n\t\t\t\ttry {\n\t\t\t\t\tserializeValue(\n\t\t\t\t\t\tthis.payload,\n\t\t\t\t\t\t4 + i * valueSize,\n\t\t\t\t\t\tvalueSize,\n\t\t\t\t\t\tthis._valueFormat,\n\t\t\t\t\t\tvalue,\n\t\t\t\t\t);\n\t\t\t\t} catch (e) {\n\t\t\t\t\ttryCatchOutOfBoundsError(\n\t\t\t\t\t\te as Error,\n\t\t\t\t\t\tvalue,\n\t\t\t\t\t\tparam,\n\t\t\t\t\t\tvalueSize,\n\t\t\t\t\t\tthis._valueFormat,\n\t\t\t\t\t);\n\t\t\t\t}\n\t\t\t}\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\t\thandshake: this.handshake,\n\t\t\t\"reset to default\": this.resetToDefault,\n\t\t\t\"value size\": this.valueSize,\n\t\t};\n\t\tif (this._values.length > 0) {\n\t\t\tmessage.values = this._values\n\t\t\t\t.map(\n\t\t\t\t\t(value, i) =>\n\t\t\t\t\t\t`\\n\u00B7 #${this._parameters[i]}: ${\n\t\t\t\t\t\t\tconfigValueToString(\n\t\t\t\t\t\t\t\tvalue,\n\t\t\t\t\t\t\t)\n\t\t\t\t\t\t}`,\n\t\t\t\t)\n\t\t\t\t.join(\"\");\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 ConfigurationCCBulkReportOptions {\n\treportsToFollow: number;\n\tdefaultValues: boolean;\n\tisHandshakeResponse: boolean;\n\tvalueSize: number;\n\tvalues: Record<number, ConfigValue>;\n}\n\n@CCCommand(ConfigurationCommand.BulkReport)\nexport class ConfigurationCCBulkReport extends ConfigurationCC {\n\tpublic constructor(\n\t\toptions: WithAddress<ConfigurationCCBulkReportOptions>,\n\t) {\n\t\tsuper(options);\n\n\t\t// TODO: Check implementation:\n\t\tthis.reportsToFollow = options.reportsToFollow;\n\t\tthis.defaultValues = options.defaultValues;\n\t\tthis.isHandshakeResponse = options.isHandshakeResponse;\n\t\tthis.valueSize = options.valueSize;\n\t\tfor (const [param, value] of Object.entries(options.values)) {\n\t\t\tthis._values.set(parseInt(param), value);\n\t\t}\n\t}\n\n\tpublic static from(\n\t\traw: CCRaw,\n\t\tctx: CCParsingContext,\n\t): ConfigurationCCBulkReport {\n\t\t// Ensure we received enough bytes for the preamble\n\t\tvalidatePayload(raw.payload.length >= 5);\n\t\tconst firstParameter = raw.payload.readUInt16BE(0);\n\t\tconst numParams = raw.payload[2];\n\t\tconst reportsToFollow = raw.payload[3];\n\t\tconst defaultValues = !!(raw.payload[4] & 0b1000_0000);\n\t\tconst isHandshakeResponse = !!(raw.payload[4] & 0b0100_0000);\n\t\tconst valueSize = raw.payload[4] & 0b111;\n\t\t// Ensure the payload is long enough for all reported values\n\t\tvalidatePayload(raw.payload.length >= 5 + numParams * valueSize);\n\t\tconst values: Record<number, ConfigValue> = {};\n\t\tfor (let i = 0; i < numParams; i++) {\n\t\t\tconst param = firstParameter + i;\n\t\t\t// Default to parsing the value as SignedInteger, like the specs say.\n\t\t\t// We try to re-interpret the value in persistValues()\n\t\t\tvalues[param] = parseValue(\n\t\t\t\traw.payload.subarray(5 + i * valueSize),\n\t\t\t\tvalueSize,\n\t\t\t\tConfigValueFormat.SignedInteger,\n\t\t\t);\n\t\t}\n\n\t\treturn new this({\n\t\t\tnodeId: ctx.sourceNodeId,\n\t\t\treportsToFollow,\n\t\t\tdefaultValues,\n\t\t\tisHandshakeResponse,\n\t\t\tvalueSize,\n\t\t\tvalues,\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 every received parameter\n\n\t\tfor (let [parameter, value] of this._values.entries()) {\n\t\t\t// Check if the initial assumption of SignedInteger holds true\n\t\t\tconst oldParamInformation = this.getParamInformation(\n\t\t\t\tctx,\n\t\t\t\tparameter,\n\t\t\t);\n\t\t\tif (\n\t\t\t\toldParamInformation.format != undefined\n\t\t\t\t&& oldParamInformation.format\n\t\t\t\t\t!== ConfigValueFormat.SignedInteger\n\t\t\t) {\n\t\t\t\t// Re-interpret the value with the new format\n\t\t\t\tvalue = reInterpretSignedValue(\n\t\t\t\t\tvalue,\n\t\t\t\t\tthis.valueSize,\n\t\t\t\t\toldParamInformation.format,\n\t\t\t\t);\n\t\t\t\tthis._values.set(parameter, value);\n\t\t\t}\n\n\t\t\tthis.setValue(\n\t\t\t\tctx,\n\t\t\t\tConfigurationCCValues.paramInformation(parameter),\n\t\t\t\tvalue,\n\t\t\t);\n\t\t}\n\n\t\treturn true;\n\t}\n\n\tpublic reportsToFollow: number;\n\tpublic defaultValues: boolean;\n\tpublic isHandshakeResponse: boolean;\n\tpublic valueSize: number;\n\n\tprivate _values = new Map<number, ConfigValue>();\n\tpublic get values(): ReadonlyMap<number, ConfigValue> {\n\t\treturn this._values;\n\t}\n\n\tpublic getPartialCCSessionId(): Record<string, any> | undefined {\n\t\t// We don't expect the applHost to merge CCs but we want to wait until all reports have been received\n\t\treturn {};\n\t}\n\n\tpublic expectMoreMessages(): boolean {\n\t\treturn this.reportsToFollow > 0;\n\t}\n\n\tpublic toLogEntry(ctx?: GetValueDB): MessageOrCCLogEntry {\n\t\tconst message: MessageRecord = {\n\t\t\t\"handshake response\": this.isHandshakeResponse,\n\t\t\t\"default values\": this.defaultValues,\n\t\t\t\"value size\": this.valueSize,\n\t\t\t\"reports to follow\": this.reportsToFollow,\n\t\t};\n\t\tif (this._values.size > 0) {\n\t\t\tmessage.values = [...this._values]\n\t\t\t\t.map(\n\t\t\t\t\t([param, value]) => `\n\u00B7 #${param}: ${configValueToString(value)}`,\n\t\t\t\t)\n\t\t\t\t.join(\"\");\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 ConfigurationCCBulkGetOptions {\n\tparameters: number[];\n}\n\n@CCCommand(ConfigurationCommand.BulkGet)\n@expectedCCResponse(ConfigurationCCBulkReport)\nexport class ConfigurationCCBulkGet extends ConfigurationCC {\n\tpublic constructor(\n\t\toptions: WithAddress<ConfigurationCCBulkGetOptions>,\n\t) {\n\t\tsuper(options);\n\t\tthis._parameters = options.parameters.toSorted((a, b) => a - b);\n\t\tif (!isConsecutiveArray(this.parameters)) {\n\t\t\tthrow new ZWaveError(\n\t\t\t\t`A ConfigurationCC.BulkGet can only be used for consecutive parameters`,\n\t\t\t\tZWaveErrorCodes.CC_Invalid,\n\t\t\t);\n\t\t}\n\t}\n\n\tpublic static from(\n\t\t_raw: CCRaw,\n\t\t_ctx: CCParsingContext,\n\t): ConfigurationCCBulkGet {\n\t\t// TODO: Deserialize payload\n\t\tthrow new ZWaveError(\n\t\t\t`${this.name}: deserialization not implemented`,\n\t\t\tZWaveErrorCodes.Deserialization_NotImplemented,\n\t\t);\n\n\t\t// return new ConfigurationCCBulkGet({\n\t\t// \tnodeId: ctx.sourceNodeId,\n\t\t// });\n\t}\n\n\tprivate _parameters: number[];\n\tpublic get parameters(): number[] {\n\t\treturn this._parameters;\n\t}\n\n\tpublic serialize(ctx: CCEncodingContext): Promise<Bytes> {\n\t\tthis.payload = new Bytes(3);\n\t\tthis.payload.writeUInt16BE(this.parameters[0], 0);\n\t\tthis.payload[2] = this.parameters.length;\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: { parameters: this.parameters.join(\", \") },\n\t\t};\n\t}\n}\n\n/** @publicAPI */\nexport interface ConfigurationCCNameReportOptions {\n\tparameter: number;\n\tname: string;\n\treportsToFollow: number;\n}\n\n@CCCommand(ConfigurationCommand.NameReport)\nexport class ConfigurationCCNameReport extends ConfigurationCC {\n\tpublic constructor(\n\t\toptions: WithAddress<ConfigurationCCNameReportOptions>,\n\t) {\n\t\tsuper(options);\n\n\t\tthis.parameter = options.parameter;\n\t\tthis.name = options.name;\n\t\tthis.reportsToFollow = options.reportsToFollow;\n\t}\n\n\tpublic static from(\n\t\traw: CCRaw,\n\t\tctx: CCParsingContext,\n\t): ConfigurationCCNameReport {\n\t\t// Parameter and # of reports must be present\n\t\tvalidatePayload(raw.payload.length >= 3);\n\t\tconst parameter = raw.payload.readUInt16BE(0);\n\t\tconst reportsToFollow = raw.payload[2];\n\n\t\tif (reportsToFollow > 0) {\n\t\t\t// If more reports follow, the info must at least be one byte\n\t\t\tvalidatePayload(raw.payload.length >= 4);\n\t\t}\n\t\tconst name: string = raw.payload.subarray(3).toString(\"utf8\");\n\n\t\treturn new this({\n\t\t\tnodeId: ctx.sourceNodeId,\n\t\t\tparameter,\n\t\t\treportsToFollow,\n\t\t\tname,\n\t\t});\n\t}\n\n\tpublic readonly parameter: number;\n\tpublic name: string;\n\tpublic readonly reportsToFollow: number;\n\n\tpublic persistValues(ctx: PersistValuesContext): boolean {\n\t\tif (!super.persistValues(ctx)) return false;\n\n\t\t// Bitfield parameters that are not documented in a config file\n\t\t// are split into multiple partial parameters. We need to set the name for\n\t\t// all of them.\n\t\tconst partialParams = this.getPartialParamInfos(\n\t\t\tctx,\n\t\t\tthis.parameter,\n\t\t);\n\n\t\tif (partialParams.length === 0) {\n\t\t\tthis.extendParamInformation(ctx, this.parameter, undefined, {\n\t\t\t\tlabel: this.name,\n\t\t\t});\n\t\t} else {\n\t\t\tfor (const param of partialParams) {\n\t\t\t\tconst paramNumber = param.property as number;\n\t\t\t\tconst bitMask = param.propertyKey as number;\n\t\t\t\tconst bitNumber = Math.log2(bitMask) % 1 === 0\n\t\t\t\t\t? Math.log2(bitMask)\n\t\t\t\t\t: undefined;\n\n\t\t\t\tlet label = `${this.name} - ${bitMask}`;\n\t\t\t\tif (bitNumber != undefined) {\n\t\t\t\t\tlabel += ` (bit ${bitNumber})`;\n\t\t\t\t}\n\t\t\t\tthis.extendParamInformation(ctx, paramNumber, bitMask, {\n\t\t\t\t\tlabel,\n\t\t\t\t});\n\t\t\t}\n\t\t}\n\n\t\treturn true;\n\t}\n\n\tpublic serialize(ctx: CCEncodingContext): Promise<Bytes> {\n\t\tconst nameBuffer = Bytes.from(this.name, \"utf8\");\n\t\tthis.payload = new Bytes(3 + nameBuffer.length);\n\t\tthis.payload.writeUInt16BE(this.parameter, 0);\n\t\tthis.payload[2] = this.reportsToFollow;\n\t\tthis.payload.set(nameBuffer, 3);\n\n\t\treturn super.serialize(ctx);\n\t}\n\n\tpublic getPartialCCSessionId(): Record<string, any> | undefined {\n\t\t// Distinguish sessions by the parameter number\n\t\treturn { parameter: this.parameter };\n\t}\n\n\tpublic expectMoreMessages(): boolean {\n\t\treturn this.reportsToFollow > 0;\n\t}\n\n\tpublic mergePartialCCs(\n\t\tpartials: ConfigurationCCNameReport[],\n\t\t_ctx: CCParsingContext,\n\t): Promise<void> {\n\t\t// Concat the name\n\t\tthis.name = [...partials, this]\n\t\t\t.map((report) => report.name)\n\t\t\t.reduce((prev, cur) => prev + cur, \"\");\n\t\treturn Promise.resolve();\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\"parameter #\": this.parameter,\n\t\t\t\tname: this.name,\n\t\t\t\t\"reports to follow\": this.reportsToFollow,\n\t\t\t},\n\t\t};\n\t}\n}\n\n@CCCommand(ConfigurationCommand.NameGet)\n@expectedCCResponse(ConfigurationCCNameReport)\nexport class ConfigurationCCNameGet extends ConfigurationCC {\n\tpublic constructor(\n\t\toptions: WithAddress<ConfigurationCCGetOptions>,\n\t) {\n\t\tsuper(options);\n\t\tthis.parameter = options.parameter;\n\t}\n\n\tpublic static from(\n\t\traw: CCRaw,\n\t\tctx: CCParsingContext,\n\t): ConfigurationCCNameGet {\n\t\tvalidatePayload(raw.payload.length >= 2);\n\t\tconst parameter = raw.payload.readUInt16BE(0);\n\n\t\treturn new this({\n\t\t\tnodeId: ctx.sourceNodeId,\n\t\t\tparameter,\n\t\t});\n\t}\n\n\tpublic parameter: number;\n\n\tpublic serialize(ctx: CCEncodingContext): Promise<Bytes> {\n\t\tthis.payload = new Bytes(2);\n\t\tthis.payload.writeUInt16BE(this.parameter, 0);\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: { \"parameter #\": this.parameter },\n\t\t};\n\t}\n}\n\n/** @publicAPI */\nexport interface ConfigurationCCInfoReportOptions {\n\tparameter: number;\n\tinfo: string;\n\treportsToFollow: number;\n}\n\n@CCCommand(ConfigurationCommand.InfoReport)\nexport class ConfigurationCCInfoReport extends ConfigurationCC {\n\tpublic constructor(\n\t\toptions: WithAddress<ConfigurationCCInfoReportOptions>,\n\t) {\n\t\tsuper(options);\n\n\t\tthis.parameter = options.parameter;\n\t\tthis.info = options.info;\n\t\tthis.reportsToFollow = options.reportsToFollow;\n\t}\n\n\tpublic static from(\n\t\traw: CCRaw,\n\t\tctx: CCParsingContext,\n\t): ConfigurationCCInfoReport {\n\t\t// Parameter and # of reports must be present\n\t\tvalidatePayload(raw.payload.length >= 3);\n\t\tconst parameter = raw.payload.readUInt16BE(0);\n\t\tconst reportsToFollow = raw.payload[2];\n\n\t\tif (reportsToFollow > 0) {\n\t\t\t// If more reports follow, the info must at least be one byte\n\t\t\tvalidatePayload(raw.payload.length >= 4);\n\t\t}\n\t\tconst info: string = raw.payload.subarray(3).toString(\"utf8\");\n\n\t\treturn new this({\n\t\t\tnodeId: ctx.sourceNodeId,\n\t\t\tparameter,\n\t\t\treportsToFollow,\n\t\t\tinfo,\n\t\t});\n\t}\n\n\tpublic readonly parameter: number;\n\tpublic info: string;\n\tpublic readonly reportsToFollow: number;\n\n\tpublic persistValues(ctx: PersistValuesContext): boolean {\n\t\tif (!super.persistValues(ctx)) return false;\n\n\t\t// Bitfield parameters that are not documented in a config file\n\t\t// are split into multiple partial parameters. We need to set the description for\n\t\t// all of them. However, these can get very long, so we put the reported\n\t\t// description on the first partial param, and refer to it from the others\n\t\tconst partialParams = this.getPartialParamInfos(\n\t\t\tctx,\n\t\t\tthis.parameter,\n\t\t).toSorted(\n\t\t\t(a, b) =>\n\t\t\t\t((a.propertyKey as number) ?? 0)\n\t\t\t\t- ((b.propertyKey as number) ?? 0),\n\t\t);\n\n\t\tif (partialParams.length === 0) {\n\t\t\tthis.extendParamInformation(ctx, this.parameter, undefined, {\n\t\t\t\tdescription: this.info,\n\t\t\t});\n\t\t} else {\n\t\t\tlet firstParamLabel: string | undefined;\n\n\t\t\tfor (const param of partialParams) {\n\t\t\t\tconst paramNumber = param.property as number;\n\t\t\t\tconst bitMask = param.propertyKey as number;\n\n\t\t\t\t// We put the description on the first partial param\n\t\t\t\tconst description = firstParamLabel\n\t\t\t\t\t? `Refer to ${firstParamLabel}`\n\t\t\t\t\t: this.info;\n\n\t\t\t\tthis.extendParamInformation(ctx, paramNumber, bitMask, {\n\t\t\t\t\tdescription,\n\t\t\t\t});\n\n\t\t\t\t// Then we store the name of the first param to refer to it on the\n\t\t\t\t// following partial params\n\t\t\t\tif (firstParamLabel == undefined) {\n\t\t\t\t\tfirstParamLabel =\n\t\t\t\t\t\tthis.getParamInformation(ctx, paramNumber, bitMask)\n\t\t\t\t\t\t\t.label ?? `parameter ${paramNumber} - ${bitMask}`;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\treturn true;\n\t}\n\n\tpublic serialize(ctx: CCEncodingContext): Promise<Bytes> {\n\t\tconst infoBuffer = Bytes.from(this.info, \"utf8\");\n\t\tthis.payload = new Bytes(3 + infoBuffer.length);\n\t\tthis.payload.writeUInt16BE(this.parameter, 0);\n\t\tthis.payload[2] = this.reportsToFollow;\n\t\tthis.payload.set(infoBuffer, 3);\n\n\t\treturn super.serialize(ctx);\n\t}\n\n\tpublic getPartialCCSessionId(): Record<string, any> | undefined {\n\t\t// Distinguish sessions by the parameter number\n\t\treturn { parameter: this.parameter };\n\t}\n\n\tpublic expectMoreMessages(): boolean {\n\t\treturn this.reportsToFollow > 0;\n\t}\n\n\tpublic mergePartialCCs(\n\t\tpartials: ConfigurationCCInfoReport[],\n\t\t_ctx: CCParsingContext,\n\t): Promise<void> {\n\t\t// Concat the info\n\t\tthis.info = [...partials, this]\n\t\t\t.map((report) => report.info)\n\t\t\t.reduce((prev, cur) => prev + cur, \"\");\n\t\treturn Promise.resolve();\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\"parameter #\": this.parameter,\n\t\t\t\tinfo: this.info,\n\t\t\t\t\"reports to follow\": this.reportsToFollow,\n\t\t\t},\n\t\t};\n\t}\n}\n\n@CCCommand(ConfigurationCommand.InfoGet)\n@expectedCCResponse(ConfigurationCCInfoReport)\nexport class ConfigurationCCInfoGet extends ConfigurationCC {\n\tpublic constructor(\n\t\toptions: WithAddress<ConfigurationCCGetOptions>,\n\t) {\n\t\tsuper(options);\n\t\tthis.parameter = options.parameter;\n\t}\n\n\tpublic static from(\n\t\traw: CCRaw,\n\t\tctx: CCParsingContext,\n\t): ConfigurationCCInfoGet {\n\t\tvalidatePayload(raw.payload.length >= 2);\n\t\tconst parameter = raw.payload.readUInt16BE(0);\n\n\t\treturn new this({\n\t\t\tnodeId: ctx.sourceNodeId,\n\t\t\tparameter,\n\t\t});\n\t}\n\n\tpublic parameter: number;\n\n\tpublic serialize(ctx: CCEncodingContext): Promise<Bytes> {\n\t\tthis.payload = new Bytes(2);\n\t\tthis.payload.writeUInt16BE(this.parameter, 0);\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: { \"parameter #\": this.parameter },\n\t\t};\n\t}\n}\n\n/** @publicAPI */\nexport interface ConfigurationCCPropertiesReportOptions {\n\tparameter: number;\n\tvalueSize: number;\n\tvalueFormat: ConfigValueFormat;\n\tminValue?: ConfigValue;\n\tmaxValue?: ConfigValue;\n\tdefaultValue?: ConfigValue;\n\tnextParameter: number;\n\taltersCapabilities?: boolean;\n\tisReadonly?: boolean;\n\tisAdvanced?: boolean;\n\tnoBulkSupport?: boolean;\n}\n\n@CCCommand(ConfigurationCommand.PropertiesReport)\nexport class ConfigurationCCPropertiesReport extends ConfigurationCC {\n\tpublic constructor(\n\t\toptions: WithAddress<ConfigurationCCPropertiesReportOptions>,\n\t) {\n\t\tsuper(options);\n\n\t\tthis.parameter = options.parameter;\n\t\tthis.valueSize = options.valueSize;\n\t\tthis.valueFormat = options.valueFormat;\n\t\tif (this.valueSize > 0) {\n\t\t\tif (options.minValue == undefined) {\n\t\t\t\tthrow new ZWaveError(\n\t\t\t\t\t\"The minimum value must be set when the value size is non-zero\",\n\t\t\t\t\tZWaveErrorCodes.Argument_Invalid,\n\t\t\t\t);\n\t\t\t} else if (options.maxValue == undefined) {\n\t\t\t\tthrow new ZWaveError(\n\t\t\t\t\t\"The maximum value must be set when the value size is non-zero\",\n\t\t\t\t\tZWaveErrorCodes.Argument_Invalid,\n\t\t\t\t);\n\t\t\t} else if (options.defaultValue == undefined) {\n\t\t\t\tthrow new ZWaveError(\n\t\t\t\t\t\"The default value must be set when the value size is non-zero\",\n\t\t\t\t\tZWaveErrorCodes.Argument_Invalid,\n\t\t\t\t);\n\t\t\t}\n\t\t\tthis.minValue = options.minValue;\n\t\t\tthis.maxValue = options.maxValue;\n\t\t\tthis.defaultValue = options.defaultValue;\n\t\t}\n\t\tthis.nextParameter = options.nextParameter;\n\t\tthis.altersCapabilities = options.altersCapabilities;\n\t\tthis.isReadonly = options.isReadonly;\n\t\tthis.isAdvanced = options.isAdvanced;\n\t\tthis.noBulkSupport = options.noBulkSupport;\n\t}\n\n\tpublic static from(\n\t\traw: CCRaw,\n\t\tctx: CCParsingContext,\n\t): ConfigurationCCPropertiesReport {\n\t\tvalidatePayload(raw.payload.length >= 3);\n\t\tconst parameter = raw.payload.readUInt16BE(0);\n\t\tconst valueFormat: ConfigValueFormat = (raw.payload[2] & 0b111000)\n\t\t\t>>> 3;\n\t\tconst valueSize = raw.payload[2] & 0b111;\n\n\t\t// GH#1309 Some devices don't tell us the first parameter if we query #0\n\t\t// Instead, they contain 0x000000\n\t\tlet nextParameter;\n\n\t\tif (valueSize === 0 && raw.payload.length < 5) {\n\t\t\tnextParameter = 0;\n\t\t\treturn new this({\n\t\t\t\tnodeId: ctx.sourceNodeId,\n\t\t\t\tparameter,\n\t\t\t\tvalueFormat,\n\t\t\t\tvalueSize,\n\t\t\t\tnextParameter,\n\t\t\t});\n\t\t}\n\n\t\t// Ensure the payload contains the two bytes for next parameter\n\t\tconst nextParameterOffset = 3 + 3 * valueSize;\n\t\tvalidatePayload(raw.payload.length >= nextParameterOffset + 2);\n\n\t\tlet minValue: MaybeNotKnown<number>;\n\t\tlet maxValue: MaybeNotKnown<number>;\n\t\tlet defaultValue: MaybeNotKnown<number>;\n\n\t\tif (valueSize > 0) {\n\t\t\tif (valueFormat === ConfigValueFormat.BitField) {\n\t\t\t\tminValue = 0;\n\t\t\t} else {\n\t\t\t\tminValue = parseValue(\n\t\t\t\t\traw.payload.subarray(3),\n\t\t\t\t\tvalueSize,\n\t\t\t\t\tvalueFormat,\n\t\t\t\t);\n\t\t\t}\n\t\t\tmaxValue = parseValue(\n\t\t\t\traw.payload.subarray(3 + valueSize),\n\t\t\t\tvalueSize,\n\t\t\t\tvalueFormat,\n\t\t\t);\n\t\t\tdefaultValue = parseValue(\n\t\t\t\traw.payload.subarray(3 + 2 * valueSize),\n\t\t\t\tvalueSize,\n\t\t\t\tvalueFormat,\n\t\t\t);\n\t\t}\n\n\t\tnextParameter = raw.payload.readUInt16BE(\n\t\t\tnextParameterOffset,\n\t\t);\n\n\t\tlet altersCapabilities: MaybeNotKnown<boolean>;\n\t\tlet isReadonly: MaybeNotKnown<boolean>;\n\t\tlet isAdvanced: MaybeNotKnown<boolean>;\n\t\tlet noBulkSupport: MaybeNotKnown<boolean>;\n\n\t\tif (raw.payload.length >= nextParameterOffset + 3) {\n\t\t\t// V4 adds an options byte after the next parameter and two bits in byte 2\n\t\t\tconst options1 = raw.payload[2];\n\t\t\tconst options2 = raw.payload[3 + 3 * valueSize + 2];\n\t\t\taltersCapabilities = !!(options1 & 0b1000_0000);\n\t\t\tisReadonly = !!(options1 & 0b0100_0000);\n\t\t\tisAdvanced = !!(options2 & 0b1);\n\t\t\tnoBulkSupport = !!(options2 & 0b10);\n\t\t}\n\n\t\treturn new this({\n\t\t\tnodeId: ctx.sourceNodeId,\n\t\t\tparameter,\n\t\t\tvalueFormat,\n\t\t\tvalueSize,\n\t\t\tnextParameter,\n\t\t\tminValue,\n\t\t\tmaxValue,\n\t\t\tdefaultValue,\n\t\t\taltersCapabilities,\n\t\t\tisReadonly,\n\t\t\tisAdvanced,\n\t\t\tnoBulkSupport,\n\t\t});\n\t}\n\n\tpublic persistValues(ctx: PersistValuesContext): boolean {\n\t\tif (!super.persistValues(ctx)) return false;\n\n\t\t// If we actually received parameter info, store it\n\t\tif (this.valueSize > 0) {\n\t\t\tconst baseInfo = {\n\t\t\t\ttype: \"number\",\n\t\t\t\tformat: this.valueFormat,\n\t\t\t\tvalueSize: this.valueSize,\n\t\t\t\trequiresReInclusion: this.altersCapabilities,\n\t\t\t\treadable: true,\n\t\t\t\twriteable: !this.isReadonly,\n\t\t\t\tallowManualEntry: true,\n\t\t\t\tisAdvanced: this.isAdvanced,\n\t\t\t\tnoBulkSupport: this.noBulkSupport,\n\t\t\t\tisFromConfig: false,\n\t\t\t} as const;\n\n\t\t\tif (this.valueFormat !== ConfigValueFormat.BitField) {\n\t\t\t\t// Do not override param information from a config file\n\t\t\t\tif (!this.paramExistsInConfigFile(ctx, this.parameter)) {\n\t\t\t\t\tconst paramInfo = stripUndefined(\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t...baseInfo,\n\t\t\t\t\t\t\tmin: this.minValue,\n\t\t\t\t\t\t\tmax: this.maxValue,\n\t\t\t\t\t\t\tdefault: this.defaultValue,\n\t\t\t\t\t\t} as const satisfies ConfigurationMetadata,\n\t\t\t\t\t);\n\n\t\t\t\t\tthis.extendParamInformation(\n\t\t\t\t\t\tctx,\n\t\t\t\t\t\tthis.parameter,\n\t\t\t\t\t\tundefined,\n\t\t\t\t\t\tparamInfo,\n\t\t\t\t\t);\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\t// Bit fields are split into multiple single-bit partial parameters\n\t\t\t\tconst bits = this.maxValue!;\n\t\t\t\tlet mask = 1;\n\t\t\t\twhile (mask <= bits) {\n\t\t\t\t\tif (\n\t\t\t\t\t\t// Only create partials that exist\n\t\t\t\t\t\t!!(mask & bits)\n\t\t\t\t\t\t// Do not override param information from a config file\n\t\t\t\t\t\t&& !this.paramExistsInConfigFile(\n\t\t\t\t\t\t\tctx,\n\t\t\t\t\t\t\tthis.parameter,\n\t\t\t\t\t\t\tmask,\n\t\t\t\t\t\t)\n\t\t\t\t\t) {\n\t\t\t\t\t\tconst paramInfo = stripUndefined(\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t...baseInfo,\n\t\t\t\t\t\t\t\tmin: 0,\n\t\t\t\t\t\t\t\tmax: 1,\n\t\t\t\t\t\t\t\tdefault: this.defaultValue! & mask ? 1 : 0,\n\t\t\t\t\t\t\t} as const satisfies ConfigurationMetadata,\n\t\t\t\t\t\t);\n\n\t\t\t\t\t\tthis.extendParamInformation(\n\t\t\t\t\t\t\tctx,\n\t\t\t\t\t\t\tthis.parameter,\n\t\t\t\t\t\t\tmask,\n\t\t\t\t\t\t\tparamInfo,\n\t\t\t\t\t\t);\n\t\t\t\t\t}\n\n\t\t\t\t\t// We must use multiplication here, as bitwise shifting works on signed 32-bit integers in JS\n\t\t\t\t\t// which would create an infinite loop if maxValue === 0xffff_ffff\n\t\t\t\t\tmask *= 2;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\treturn true;\n\t}\n\n\tpublic parameter: number;\n\tpublic valueSize: number;\n\tpublic valueFormat: ConfigValueFormat;\n\tpublic minValue: MaybeNotKnown<ConfigValue>;\n\tpublic maxValue: MaybeNotKnown<ConfigValue>;\n\tpublic defaultValue: MaybeNotKnown<ConfigValue>;\n\tpublic nextParameter: number;\n\tpublic altersCapabilities: MaybeNotKnown<boolean>;\n\tpublic isReadonly: MaybeNotKnown<boolean>;\n\tpublic isAdvanced: MaybeNotKnown<boolean>;\n\tpublic noBulkSupport: MaybeNotKnown<boolean>;\n\n\tpublic serialize(ctx: CCEncodingContext): Promise<Bytes> {\n\t\tthis.payload = new Bytes(\n\t\t\t3 // preamble\n\t\t\t\t+ 3 * this.valueSize // min, max, default value\n\t\t\t\t+ 2 // next parameter\n\t\t\t\t+ 1, // options2\n\t\t);\n\t\tthis.payload.writeUInt16BE(this.parameter, 0);\n\t\tconst options1 = (this.altersCapabilities ? 0b1000_0000 : 0)\n\t\t\t| (this.isReadonly ? 0b0100_0000 : 0)\n\t\t\t| ((this.valueFormat & 0b111) << 3)\n\t\t\t| (this.valueSize & 0b111);\n\t\tthis.payload[2] = options1;\n\n\t\tlet offset = 3;\n\t\tif (this.valueSize > 0) {\n\t\t\tserializeValue(\n\t\t\t\tthis.payload,\n\t\t\t\toffset,\n\t\t\t\tthis.valueSize,\n\t\t\t\tthis.valueFormat,\n\t\t\t\tthis.minValue!,\n\t\t\t);\n\t\t\toffset += this.valueSize;\n\t\t\tserializeValue(\n\t\t\t\tthis.payload,\n\t\t\t\toffset,\n\t\t\t\tthis.valueSize,\n\t\t\t\tthis.valueFormat,\n\t\t\t\tthis.maxValue!,\n\t\t\t);\n\t\t\toffset += this.valueSize;\n\t\t\tserializeValue(\n\t\t\t\tthis.payload,\n\t\t\t\toffset,\n\t\t\t\tthis.valueSize,\n\t\t\t\tthis.valueFormat,\n\t\t\t\tthis.defaultValue!,\n\t\t\t);\n\t\t\toffset += this.valueSize;\n\t\t}\n\t\tthis.payload.writeUInt16BE(this.nextParameter, offset);\n\t\toffset += 2;\n\n\t\tconst options2 = (this.isAdvanced ? 0b1 : 0)\n\t\t\t| (this.noBulkSupport ? 0b10 : 0);\n\t\tthis.payload[offset] = options2;\n\n\t\treturn super.serialize(ctx);\n\t}\n\n\tpublic toLogEntry(ctx?: GetValueDB): MessageOrCCLogEntry {\n\t\tconst message: MessageRecord = {\n\t\t\t\"parameter #\": this.parameter,\n\t\t\t\"next param #\": this.nextParameter,\n\t\t\t\"value size\": this.valueSize,\n\t\t\t\"value format\": getEnumMemberName(\n\t\t\t\tConfigValueFormat,\n\t\t\t\tthis.valueFormat,\n\t\t\t),\n\t\t};\n\t\tif (this.minValue != undefined) {\n\t\t\tmessage[\"min value\"] = configValueToString(this.minValue);\n\t\t}\n\t\tif (this.maxValue != undefined) {\n\t\t\tmessage[\"max value\"] = configValueToString(this.maxValue);\n\t\t}\n\t\tif (this.defaultValue != undefined) {\n\t\t\tmessage[\"default value\"] = configValueToString(this.defaultValue);\n\t\t}\n\t\tif (this.altersCapabilities != undefined) {\n\t\t\tmessage[\"alters capabilities\"] = this.altersCapabilities;\n\t\t}\n\t\tif (this.isReadonly != undefined) {\n\t\t\tmessage.readonly = this.isReadonly;\n\t\t}\n\t\tif (this.isAdvanced != undefined) {\n\t\t\tmessage.advanced = this.isAdvanced;\n\t\t}\n\t\tif (this.noBulkSupport != undefined) {\n\t\t\tmessage[\"bulk support\"] = !this.noBulkSupport;\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(ConfigurationCommand.PropertiesGet)\n@expectedCCResponse(ConfigurationCCPropertiesReport)\nexport class ConfigurationCCPropertiesGet extends ConfigurationCC {\n\tpublic constructor(\n\t\toptions: WithAddress<ConfigurationCCGetOptions>,\n\t) {\n\t\tsuper(options);\n\t\tthis.parameter = options.parameter;\n\t}\n\n\tpublic static from(\n\t\traw: CCRaw,\n\t\tctx: CCParsingContext,\n\t): ConfigurationCCPropertiesGet {\n\t\tvalidatePayload(raw.payload.length >= 2);\n\t\tconst parameter = raw.payload.readUInt16BE(0);\n\n\t\treturn new this({\n\t\t\tnodeId: ctx.sourceNodeId,\n\t\t\tparameter,\n\t\t});\n\t}\n\n\tpublic parameter: number;\n\n\tpublic serialize(ctx: CCEncodingContext): Promise<Bytes> {\n\t\tthis.payload = new Bytes(2);\n\t\tthis.payload.writeUInt16BE(this.parameter, 0);\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: { \"parameter #\": this.parameter },\n\t\t};\n\t}\n}\n\n@CCCommand(ConfigurationCommand.DefaultReset)\n@useSupervision()\nexport class ConfigurationCCDefaultReset extends ConfigurationCC {}\n\nfunction isSafeValue(\n\tvalue: number,\n\tsize: number,\n\tformat: ConfigValueFormat,\n): boolean {\n\tlet minValue: number;\n\tlet maxValue: number;\n\tswitch (format) {\n\t\tcase ConfigValueFormat.SignedInteger:\n\t\t\tminValue = -Math.pow(2, 8 * size - 1);\n\t\t\tmaxValue = Math.pow(2, 8 * size - 1) - 1;\n\t\t\tbreak;\n\t\tcase ConfigValueFormat.UnsignedInteger:\n\t\tcase ConfigValueFormat.Enumerated:\n\t\tcase ConfigValueFormat.BitField:\n\t\t\tminValue = 0;\n\t\t\tmaxValue = Math.pow(2, 8 * size);\n\t\t\tbreak;\n\t\tdefault:\n\t\t\tthrow new Error(\"not implemented\");\n\t}\n\treturn minValue <= value && value <= maxValue;\n}\n\n/** Interprets values from the payload depending on the value format */\nfunction parseValue(\n\traw: Bytes,\n\tsize: number,\n\tformat: ConfigValueFormat,\n): ConfigValue {\n\tswitch (format) {\n\t\tcase ConfigValueFormat.SignedInteger:\n\t\t\treturn raw.readIntBE(0, size);\n\t\tcase ConfigValueFormat.UnsignedInteger:\n\t\tcase ConfigValueFormat.Enumerated:\n\t\tcase ConfigValueFormat.BitField:\n\t\t\treturn raw.readUIntBE(0, size);\n\t}\n}\n\nfunction throwInvalidValueError(\n\tvalue: any,\n\tparameter: number,\n\tvalueSize: number,\n\tvalueFormat: ConfigValueFormat,\n): never {\n\tthrow new ZWaveError(\n\t\t`The value ${value} is invalid for configuration parameter ${parameter} (size = ${valueSize}, format = ${\n\t\t\tgetEnumMemberName(\n\t\t\t\tConfigValueFormat,\n\t\t\t\tvalueFormat,\n\t\t\t)\n\t\t})!`,\n\t\tZWaveErrorCodes.Argument_Invalid,\n\t);\n}\n\nfunction tryCatchOutOfBoundsError(\n\te: Error,\n\tvalue: any,\n\tparameter: number,\n\tvalueSize: number,\n\tvalueFormat: ConfigValueFormat,\n): void {\n\tif (e.message.includes(\"out of bounds\")) {\n\t\tthrowInvalidValueError(value, parameter, valueSize, valueFormat);\n\t} else {\n\t\tthrow e;\n\t}\n}\n\n/** Serializes values into the payload according to the value format */\nfunction serializeValue(\n\tpayload: Bytes,\n\toffset: number,\n\tsize: number,\n\tformat: ConfigValueFormat,\n\tvalue: ConfigValue,\n): void {\n\tswitch (format) {\n\t\tcase ConfigValueFormat.SignedInteger:\n\t\t\tpayload.writeIntBE(value, offset, size);\n\t\t\treturn;\n\t\tcase ConfigValueFormat.UnsignedInteger:\n\t\tcase ConfigValueFormat.Enumerated:\n\t\tcase ConfigValueFormat.BitField:\n\t\t\tpayload.writeUIntBE(value, offset, size);\n\t\t\treturn;\n\t}\n}\n"],
|
|
5
|
-
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAEA,kBAiCO;AACP,oBAAwD;AAExD,oBAAyB;AACzB,iBAUO;AACP,0BAOO;AACP,oCAQO;AACP,oBAAkB;AAClB,mBAAuD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAEvD,SAAS,oBAAoB,OAAkB;AAC9C,MAAI,OAAO,UAAU;AAAU,WAAO,MAAM,SAAQ;;AAC/C,WAAO,CAAC,GAAG,KAAK,EAAE,KAAK,IAAI;AACjC;AAHS;AAKH,MAAO,6BAA6B,uBAAU;SAAA;;;EAElC;EACA;EACA;EAHjB,YACiB,SACA,MACA,UAAgB;AAEhC,UAAM,SAAS,IAAI;AAJH,SAAA,UAAA;AACA,SAAA,OAAA;AACA,SAAA,WAAA;AAKhB,WAAO,eAAe,MAAM,qBAAqB,SAAS;EAC3D;;AA8DD,SAAS,8BACR,UAAuB;AAEvB,SAAO,iCAAa,wBACnB,SAAS,UAAU,SAAS,KAAK,cAAc,CAAC,IAAI,UACpD,eAAe;AAEjB;AAPS;AAST,SAAS,sCACR,KACA,UACA,SAAqC;AAErC,MAAI,aAAa,WAAW,QAAQ,SAAS;AAE5C,UAAM,MAAM,8BAA8B,QAAQ;AAClD,UAAM,YAAY,IAAI,oBACrB,KACA,QAAQ,WACR,QAAQ,OAAO;AAEhB,QAAI,CAAC,UAAU,cAAc;AAC5B,YAAM,IAAI,uBACT,gGACA,4BAAgB,gBAAgB;IAElC;AACA,W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AI,UAAU,GAAG,IAAI;IAC7B,KAAK,8BAAkB;IACvB,KAAK,8BAAkB;IACvB,KAAK,8BAAkB;AACtB,aAAO,IAAI,WAAW,GAAG,IAAI;EAC/B;AACD;AAbS;AAeT,SAAS,uBACR,OACA,WACA,WACA,aAA8B;AAE9B,QAAM,IAAI,uBACT,aAAa,KAAK,2CAA2C,SAAS,YAAY,SAAS,kBAC1F,iCACC,+BACA,WAAW,CAEb,MACA,4BAAgB,gBAAgB;AAElC;AAfS;AAiBT,SAAS,yBACR,GACA,OACA,WACA,WACA,aAA8B;AAE9B,MAAI,EAAE,QAAQ,SAAS,eAAe,GAAG;AACxC,2BAAuB,OAAO,WAAW,WAAW,WAAW;EAChE,OAAO;AACN,UAAM;EACP;AACD;AAZS;AAeT,SAAS,eACR,SACA,QACA,MACA,QACA,OAAkB;AAElB,UAAQ,QAAQ;IACf,KAAK,8BAAkB;AACtB,cAAQ,WAAW,OAAO,QAAQ,IAAI;AACtC;IACD,KAAK,8BAAkB;IACvB,KAAK,8BAAkB;IACvB,KAAK,8BAAkB;AACtB,cAAQ,YAAY,OAAO,QAAQ,IAAI;AACvC;EACF;AACD;AAjBS;",
|
|
3
|
+
"sources": ["../../../src_gen/cc/ConfigurationCC.ts"],
|
|
4
|
+
"sourcesContent": ["import * as __validateArgs from \"./ConfigurationCC._validateArgs.js\";\nconst { validateArgs_ConfigurationCCAPI_get, validateArgs_ConfigurationCCAPI_getBulk, validateArgs_ConfigurationCCAPI_set, validateArgs_ConfigurationCCAPI_setBulk, validateArgs_ConfigurationCCAPI_reset, validateArgs_ConfigurationCCAPI_resetBulk, validateArgs_ConfigurationCCAPI_getProperties, validateArgs_ConfigurationCCAPI_getName, validateArgs_ConfigurationCCAPI_getInfo } = __validateArgs;\nimport type { GetDeviceConfig, ParamInfoMap, ParamInformation, } from \"@zwave-js/config\";\nimport { CommandClasses, ConfigValueFormat, type ConfigurationMetadata, type ControlsCC, type EndpointId, type GetEndpoint, type GetNode, type GetSupportedCCVersion, type GetValueDB, type MaybeNotKnown, type MessageOrCCLogEntry, MessagePriority, type MessageRecord, type NodeId, type SupervisionResult, SupervisionStatus, type SupportsCC, type ValueID, ValueMetadata, type WithAddress, ZWaveError, ZWaveErrorCodes, encodePartial, getBitMaskWidth, getIntegerLimits, getMinIntegerSize, isConsecutiveArray, mergeSupervisionResults, parsePartial, stripUndefined, supervisedCommandSucceeded, validatePayload, } from \"@zwave-js/core\";\nimport { Bytes, getEnumMemberName, num2hex, pick } from \"@zwave-js/shared\";\nimport { distinct } from \"alcalzone-shared/arrays\";\nimport { CCAPI, type CCAPIEndpoint, POLL_VALUE, type PollValueImplementation, SET_VALUE, type SetValueImplementation, throwUnsupportedProperty, throwUnsupportedPropertyKey, throwWrongValueType, } from \"../lib/API.js\";\nimport { type CCRaw, CommandClass, type InterviewContext, type PersistValuesContext, type RefreshValuesContext, getEffectiveCCVersion, } from \"../lib/CommandClass.js\";\nimport { API, CCCommand, ccValues, commandClass, expectedCCResponse, implementedVersion, useSupervision, } from \"../lib/CommandClassDecorators.js\";\nimport { V } from \"../lib/Values.js\";\nimport { type ConfigValue, ConfigurationCommand } from \"../lib/_Types.js\";\nimport type { CCEncodingContext, CCParsingContext } from \"../lib/traits.js\";\nfunction configValueToString(value: ConfigValue): string {\n if (typeof value === \"number\")\n return value.toString();\n else\n return [...value].join(\", \");\n}\nexport class ConfigurationCCError extends ZWaveError {\n public constructor(public readonly message: string, public readonly code: ZWaveErrorCodes, public readonly argument: number) {\n super(message, code);\n // We need to set the prototype explicitly\n Object.setPrototypeOf(this, ConfigurationCCError.prototype);\n }\n}\nimport { ConfigurationCCValues } from \"./_CCValues.generated.js\";\nexport { ConfigurationCCValues };\n/** @publicAPI */\nexport type ConfigurationCCAPISetOptions = {\n parameter: number;\n} & ({\n // Variant 1: Normal parameter, defined in a config file\n bitMask?: undefined;\n value: ConfigValue;\n} | {\n // Variant 2: Normal parameter, not defined in a config file\n bitMask?: undefined;\n value: ConfigValue;\n valueSize: 1 | 2 | 4;\n valueFormat: ConfigValueFormat;\n} | {\n // Variant 3: Partial parameter, must be defined in a config file\n bitMask: number;\n value: number;\n});\ntype NormalizedConfigurationCCAPISetOptions = {\n parameter: number;\n valueSize: 1 | 2 | 4;\n valueFormat: ConfigValueFormat;\n} & ({\n bitMask?: undefined;\n value: ConfigValue;\n} | {\n bitMask: number;\n value: number;\n});\nfunction createConfigurationCCInstance(endpoint: CCAPIEndpoint): ConfigurationCC {\n return CommandClass.createInstanceUnchecked(endpoint.virtual ? endpoint.node.physicalNodes[0] : endpoint, ConfigurationCC)!;\n}\nfunction normalizeConfigurationCCAPISetOptions(ctx: GetValueDB, endpoint: CCAPIEndpoint, options: ConfigurationCCAPISetOptions): NormalizedConfigurationCCAPISetOptions {\n if (\"bitMask\" in options && options.bitMask) {\n // Variant 3: Partial param, look it up in the device config\n const ccc = createConfigurationCCInstance(endpoint);\n const paramInfo = ccc.getParamInformation(ctx, options.parameter, options.bitMask);\n if (!paramInfo.isFromConfig) {\n throw new ZWaveError(\"Setting a partial configuration parameter requires it to be defined in a device config file!\", ZWaveErrorCodes.Argument_Invalid);\n }\n return {\n parameter: options.parameter,\n bitMask: options.bitMask,\n value: options.value,\n valueSize: paramInfo.valueSize as any,\n valueFormat: paramInfo.format!,\n };\n }\n else if (\"valueSize\" in options) {\n // Variant 2: Normal parameter, not defined in a config file\n return pick(options, [\n \"parameter\",\n \"value\",\n \"valueSize\",\n \"valueFormat\",\n ]);\n }\n else {\n // Variant 1: Normal parameter, defined in a config file\n const ccc = createConfigurationCCInstance(endpoint);\n const paramInfo = ccc.getParamInformation(ctx, options.parameter, options.bitMask);\n if (!paramInfo.isFromConfig) {\n throw new ZWaveError(\"Setting a configuration parameter without specifying a value size and format requires it to be defined in a device config file!\", ZWaveErrorCodes.Argument_Invalid);\n }\n return {\n parameter: options.parameter,\n value: options.value,\n valueSize: paramInfo.valueSize as any,\n valueFormat: paramInfo.format!,\n };\n }\n}\nfunction bulkMergePartialParamValues(ctx: GetValueDB, endpoint: CCAPIEndpoint, options: NormalizedConfigurationCCAPISetOptions[]): (NormalizedConfigurationCCAPISetOptions & {\n bitMask?: undefined;\n})[] {\n // Merge partial parameters before doing anything else. Therefore, take the non-partials, ...\n const allParams = options.filter((o) => o.bitMask == undefined);\n // ... group the partials by parameter\n const unmergedPartials = new Map<number, NormalizedConfigurationCCAPISetOptions[]>();\n for (const partial of options.filter((o) => o.bitMask != undefined)) {\n if (!unmergedPartials.has(partial.parameter)) {\n unmergedPartials.set(partial.parameter, []);\n }\n unmergedPartials.get(partial.parameter)!.push(partial);\n }\n // and push the merged result into the array we'll be working with\n if (unmergedPartials.size) {\n const ccc = createConfigurationCCInstance(endpoint);\n for (const [parameter, partials] of unmergedPartials) {\n allParams.push({\n parameter,\n value: ccc.composePartialParamValues(ctx, parameter, partials.map((p) => ({\n bitMask: p.bitMask!,\n partialValue: p.value,\n }))),\n valueSize: partials[0].valueSize,\n valueFormat: partials[0].valueFormat,\n });\n }\n }\n return allParams as any;\n}\n/** Determines whether a partial parameter needs to be interpreted as signed */\nfunction isSignedPartial(bitMask: number, format: ConfigValueFormat | undefined): boolean {\n // Only treat partial params as signed if they span more than 1 bit.\n // Otherwise we cannot model 0/1 properly.\n return (getBitMaskWidth(bitMask) > 1\n && (format ?? ConfigValueFormat.SignedInteger)\n === ConfigValueFormat.SignedInteger);\n}\nfunction reInterpretSignedValue(value: ConfigValue, valueSize: number, targetFormat: ConfigValueFormat): ConfigValue {\n // Re-interpret the value with the new format\n const raw = new Bytes(valueSize);\n serializeValue(raw, 0, valueSize, ConfigValueFormat.SignedInteger, value);\n return parseValue(raw, valueSize, targetFormat);\n}\nfunction getParamInformationFromConfigFile(ctx: GetDeviceConfig, nodeId: number, endpointIndex: number): ParamInfoMap | undefined {\n const deviceConfig = ctx.getDeviceConfig?.(nodeId);\n if (endpointIndex === 0) {\n return (deviceConfig?.paramInformation\n ?? deviceConfig?.endpoints?.get(0)?.paramInformation);\n }\n else {\n return deviceConfig?.endpoints?.get(endpointIndex)?.paramInformation;\n }\n}\n/** Builds a ConfigurationMetadata object from a ParamInformation entry */\nfunction configParamInfoToMetadata(info: ParamInformation): ConfigurationMetadata {\n return stripUndefined({\n // TODO: Make this smarter! (0...1 ==> boolean)\n type: \"number\",\n valueSize: info.valueSize,\n min: info.minValue,\n max: info.maxValue,\n allowed: info.allowed,\n default: info.defaultValue,\n recommended: info.recommendedValue,\n unit: info.unit,\n format: info.unsigned\n ? ConfigValueFormat.UnsignedInteger\n : ConfigValueFormat.SignedInteger,\n readable: !info.writeOnly,\n writeable: !info.readOnly,\n allowManualEntry: info.allowManualEntry,\n states: info.options.length > 0\n ? Object.fromEntries(info.options.map(({ label, value }) => [\n value.toString(),\n label,\n ]))\n : undefined,\n label: info.label,\n description: info.description,\n isFromConfig: true,\n destructive: info.destructive,\n purpose: info.purpose,\n } satisfies ConfigurationMetadata) as unknown as ConfigurationMetadata;\n}\n/**\n * Refreshes all stored configuration parameter metadata from the device config file.\n * This handles updates to existing params, addition of new params,\n * and removal/hiding of old params.\n */\nexport function refreshConfigParamMetadataFromConfigFile(ctx: GetValueDB & GetDeviceConfig, nodeId: number, endpointIndex: number): void {\n const paramInfo = getParamInformationFromConfigFile(ctx, nodeId, endpointIndex);\n const valueDB = ctx.getValueDB(nodeId);\n // Track which param keys exist in the current config\n const configParamKeys = new Set<string>();\n if (paramInfo) {\n for (const [param, info] of paramInfo.entries()) {\n const paramKey = `${param.parameter}:${param.valueBitMask ?? \"\"}`;\n configParamKeys.add(paramKey);\n const valueId = ConfigurationCCValues.paramInformation(param.parameter, param.valueBitMask).endpoint(endpointIndex);\n const existing = valueDB.getMetadata(valueId) as ConfigurationMetadata | undefined;\n if (info.hidden) {\n // Param is now hidden - remove metadata and value\n if (existing) {\n valueDB.setMetadata(valueId, undefined);\n valueDB.removeValue(valueId);\n }\n continue;\n }\n const newMeta = configParamInfoToMetadata(info);\n if (!existing || existing.isFromConfig) {\n // New param, or existing parameter that was previously populated\n // from the configuration file. Replace it entirely\n valueDB.setMetadata(valueId, newMeta);\n }\n else {\n // Device-reported param - overwrite informational fields\n // but preserve the device-reported valueSize and format\n const merged: ConfigurationMetadata = {\n ...existing,\n ...newMeta,\n valueSize: existing.valueSize,\n format: existing.format,\n };\n valueDB.setMetadata(valueId, merged);\n }\n }\n }\n // Remove params that are in ValueDB with isFromConfig but no longer in config\n for (const meta of valueDB.getAllMetadata(CommandClasses.Configuration)) {\n if (typeof meta.property !== \"number\"\n || (meta.endpoint ?? 0) !== endpointIndex) {\n continue;\n }\n const existing = meta.metadata as ConfigurationMetadata;\n if (!existing.isFromConfig)\n continue;\n const paramKey = `${meta.property}:${meta.propertyKey ?? \"\"}`;\n if (!configParamKeys.has(paramKey)) {\n valueDB.setMetadata(meta, undefined);\n valueDB.removeValue(meta);\n }\n }\n}\n@API(CommandClasses.Configuration)\nexport class ConfigurationCCAPI extends CCAPI {\n public supportsCommand(cmd: ConfigurationCommand): MaybeNotKnown<boolean> {\n switch (cmd) {\n case ConfigurationCommand.Get:\n case ConfigurationCommand.Set:\n return true; // This is mandatory\n case ConfigurationCommand.BulkGet:\n case ConfigurationCommand.BulkSet:\n return this.version >= 2;\n case ConfigurationCommand.NameGet:\n case ConfigurationCommand.InfoGet:\n case ConfigurationCommand.PropertiesGet:\n return this.version >= 3;\n case ConfigurationCommand.DefaultReset:\n return this.version >= 4;\n }\n return super.supportsCommand(cmd);\n }\n protected override get [SET_VALUE](): SetValueImplementation {\n return async function (this: ConfigurationCCAPI, { property, propertyKey }, value) {\n // Config parameters are addressed with numeric properties/keys\n if (typeof property !== \"number\") {\n throwUnsupportedProperty(this.ccId, property);\n }\n if (propertyKey != undefined && typeof propertyKey !== \"number\") {\n throwUnsupportedPropertyKey(this.ccId, property, propertyKey);\n }\n if (typeof value !== \"number\") {\n throwWrongValueType(this.ccId, property, \"number\", typeof value);\n }\n let ccInstance: ConfigurationCC;\n const applHost = this.host;\n if (this.isSinglecast()) {\n ccInstance = createConfigurationCCInstance(this.endpoint);\n }\n else if (this.isMulticast()) {\n // Multicast is only possible if the parameter definition is the same on all target nodes\n const nodes = this.endpoint.node.physicalNodes;\n if (!nodes.every((node) => node\n .getEndpoint(this.endpoint.index)\n ?.supportsCC(CommandClasses.Configuration))) {\n throw new ZWaveError(`The multicast setValue API for Configuration CC requires all virtual target endpoints to support Configuration CC!`, ZWaveErrorCodes.CC_Invalid);\n }\n // Figure out if all the relevant info is the same\n const paramInfos = this.endpoint.node.physicalNodes.map((node) => createConfigurationCCInstance(node.getEndpoint(this.endpoint.index)!).getParamInformation(this.host, property, propertyKey));\n if (!paramInfos.length\n || !paramInfos.every((info, index) => {\n if (index === 0)\n return true;\n return (info.valueSize === paramInfos[0].valueSize\n && info.format === paramInfos[0].format);\n })) {\n throw new ZWaveError(`The multicast setValue API for Configuration CC requires all virtual target nodes to have the same parameter definition!`, ZWaveErrorCodes.CC_Invalid);\n }\n // If it is, just use the first node to create the CC instance\n ccInstance = createConfigurationCCInstance(this.endpoint);\n }\n else {\n throw new ZWaveError(`The setValue API for Configuration CC is not supported via broadcast!`, ZWaveErrorCodes.CC_NotSupported);\n }\n let { valueSize, format: valueFormat = ConfigValueFormat.SignedInteger, } = ccInstance.getParamInformation(applHost, property);\n let targetValue: number;\n if (propertyKey) {\n // This is a partial value, we need to update some bits only\n // Find out the correct value size\n if (!valueSize) {\n valueSize = ccInstance.getParamInformation(applHost, property, propertyKey).valueSize;\n }\n // Add the target value to the remaining partial values\n targetValue = ccInstance.composePartialParamValue(applHost, property, propertyKey, value);\n // Partial parameters are internally converted to unsigned values - update the valueFormat accordingly\n valueFormat = ConfigValueFormat.UnsignedInteger;\n }\n else {\n targetValue = value;\n }\n if (!valueSize) {\n // If there's no value size configured, figure out a matching value size\n valueSize = getMinIntegerSize(targetValue, valueFormat === ConfigValueFormat.SignedInteger);\n // Throw if the value is too large or too small\n if (!valueSize) {\n throw new ZWaveError(`The value ${targetValue} is not valid for configuration parameters!`, ZWaveErrorCodes.Argument_Invalid);\n }\n }\n // Make sure that the given value fits into the value size\n if (!isSafeValue(targetValue, valueSize, valueFormat)) {\n // If there is a value size configured, check that the given value is compatible\n throwInvalidValueError(targetValue, property, valueSize, valueFormat);\n }\n const result = await this.set({\n parameter: property,\n value: targetValue,\n valueSize: valueSize as any,\n valueFormat,\n });\n if (!supervisedCommandSucceeded(result)\n && (this as ConfigurationCCAPI).isSinglecast()) {\n // Verify the current value after a delay, unless the command was supervised and successful\n (this as ConfigurationCCAPI).schedulePoll({ property, propertyKey }, targetValue, \n // Configuration changes are instant\n { transition: \"fast\" });\n }\n return result;\n };\n }\n protected get [POLL_VALUE](): PollValueImplementation {\n return async function (this: ConfigurationCCAPI, { property, propertyKey }) {\n // Config parameters are addressed with numeric properties/keys\n if (typeof property !== \"number\") {\n throwUnsupportedProperty(this.ccId, property);\n }\n if (propertyKey != undefined && typeof propertyKey !== \"number\") {\n throwUnsupportedPropertyKey(this.ccId, property, propertyKey);\n }\n return this.get(property, { valueBitMask: propertyKey });\n };\n }\n /**\n * Requests the current value of a given config parameter from the device.\n * This may timeout and return `undefined` if the node does not respond.\n * If the node replied with a different parameter number, a `ConfigurationCCError`\n * is thrown with the `argument` property set to the reported parameter number.\n */\n @validateArgs_ConfigurationCCAPI_get()\n public async get(parameter: number, options?: {\n valueBitMask?: number;\n allowUnexpectedResponse?: boolean;\n }): Promise<MaybeNotKnown<ConfigValue>> {\n // Get-type commands are only possible in singlecast\n this.assertPhysicalEndpoint(this.endpoint);\n // Two-byte parameter numbers can only be read using the BulkGet command\n if (parameter > 255) {\n const result = await this.getBulk([\n {\n parameter,\n bitMask: options?.valueBitMask,\n },\n ]);\n return result.find((r) => r.parameter === parameter)?.value;\n }\n this.assertSupportsCommand(ConfigurationCommand, ConfigurationCommand.Get);\n const { valueBitMask, allowUnexpectedResponse } = options ?? {};\n const cc = new ConfigurationCCGet({\n nodeId: this.endpoint.nodeId,\n endpointIndex: this.endpoint.index,\n parameter,\n allowUnexpectedResponse,\n });\n const response = await this.host.sendCommand<ConfigurationCCReport>(cc, this.commandOptions);\n if (!response)\n return;\n // Nodes may respond with a different parameter, e.g. if we\n // requested a non-existing one\n if (response.parameter === parameter) {\n if (!valueBitMask)\n return response.value;\n // If a partial parameter was requested, extract that value\n const paramInfo = cc.getParamInformation(this.host, response.parameter, valueBitMask);\n return parsePartial(response.value as any, valueBitMask, isSignedPartial(valueBitMask, paramInfo.format));\n }\n this.host.logNode(this.endpoint.nodeId, {\n endpoint: this.endpoint.index,\n message: `Received unexpected ConfigurationReport (param = ${response.parameter}, value = ${response.value.toString()})`,\n direction: \"inbound\",\n level: \"error\",\n });\n throw new ConfigurationCCError(`The first existing parameter on this node is ${response.parameter}`, ZWaveErrorCodes.ConfigurationCC_FirstParameterNumber, response.parameter);\n }\n /**\n * Requests the current value of the config parameters from the device.\n * When the node does not respond due to a timeout, the `value` in the returned array will be `undefined`.\n */\n @validateArgs_ConfigurationCCAPI_getBulk()\n public async getBulk(options: {\n parameter: number;\n bitMask?: number;\n }[]): Promise<{\n parameter: number;\n bitMask?: number;\n value: MaybeNotKnown<ConfigValue>;\n }[]> {\n // Get-type commands are only possible in singlecast\n this.assertPhysicalEndpoint(this.endpoint);\n let values: ReadonlyMap<number, ConfigValue> | undefined;\n // If the parameters are consecutive, we may use BulkGet\n const distinctParameters = distinct(options.map((o) => o.parameter));\n if (this.supportsCommand(ConfigurationCommand.BulkGet)\n && isConsecutiveArray(distinctParameters)) {\n const cc = new ConfigurationCCBulkGet({\n nodeId: this.endpoint.nodeId,\n endpointIndex: this.endpoint.index,\n parameters: distinctParameters,\n });\n const response = await this.host.sendCommand<ConfigurationCCBulkReport>(cc, this.commandOptions);\n if (response)\n values = response.values;\n }\n else {\n this.assertSupportsCommand(ConfigurationCommand, ConfigurationCommand.Get);\n const _values = new Map<number, ConfigValue>();\n for (const parameter of distinctParameters) {\n const cc = new ConfigurationCCGet({\n nodeId: this.endpoint.nodeId,\n endpointIndex: this.endpoint.index,\n parameter,\n });\n const response = await this.host.sendCommand<ConfigurationCCReport>(cc, this.commandOptions);\n if (response) {\n _values.set(response.parameter, response.value);\n }\n }\n values = _values;\n }\n // Combine the returned values with the requested ones\n const cc = createConfigurationCCInstance(this.endpoint);\n return options.map((o) => {\n let value = values?.get(o.parameter);\n if (typeof value === \"number\" && o.bitMask) {\n const paramInfo = cc.getParamInformation(this.host, o.parameter, o.bitMask);\n value = parsePartial(value, o.bitMask, isSignedPartial(o.bitMask, paramInfo.format));\n }\n return { ...o, value };\n });\n }\n /**\n * Sets a new value for a given config parameter of the device.\n */\n @validateArgs_ConfigurationCCAPI_set()\n public async set(options: ConfigurationCCAPISetOptions): Promise<SupervisionResult | undefined> {\n // Two-byte parameter numbers can only be set using the BulkSet command\n if (options.parameter > 255) {\n return this.setBulk([options]);\n }\n this.assertSupportsCommand(ConfigurationCommand, ConfigurationCommand.Set);\n const normalized = normalizeConfigurationCCAPISetOptions(this.host, this.endpoint, options);\n let value = normalized.value;\n if (normalized.bitMask) {\n const ccc = createConfigurationCCInstance(this.endpoint);\n value = ccc.composePartialParamValue(this.host, normalized.parameter, normalized.bitMask, normalized.value);\n }\n const cc = new ConfigurationCCSet({\n nodeId: this.endpoint.nodeId,\n endpointIndex: this.endpoint.index,\n resetToDefault: false,\n parameter: normalized.parameter,\n value,\n valueSize: normalized.valueSize,\n valueFormat: normalized.valueFormat,\n });\n return this.host.sendCommand(cc, this.commandOptions);\n }\n /**\n * Sets new values for multiple config parameters of the device. Uses the `BulkSet` command if supported, otherwise falls back to individual `Set` commands.\n */\n @validateArgs_ConfigurationCCAPI_setBulk()\n public async setBulk(values: ConfigurationCCAPISetOptions[]): Promise<SupervisionResult | undefined> {\n // Normalize the values so we can better work with them\n const normalized = values.map((v) => normalizeConfigurationCCAPISetOptions(this.host, this.endpoint, v));\n // And merge multiple partials that belong the same \"full\" value\n const allParams = bulkMergePartialParamValues(this.host, this.endpoint, normalized);\n const canUseBulkSet = this.supportsCommand(ConfigurationCommand.BulkSet)\n // For Bulk Set we need consecutive parameters\n && isConsecutiveArray(allParams.map((v) => v.parameter))\n // and identical format\n && new Set(allParams.map((v) => v.valueFormat)).size === 1\n // and identical size\n && new Set(allParams.map((v) => v.valueSize)).size === 1;\n if (canUseBulkSet) {\n const cc = new ConfigurationCCBulkSet({\n nodeId: this.endpoint.nodeId,\n endpointIndex: this.endpoint.index,\n parameters: allParams.map((v) => v.parameter),\n valueSize: allParams[0].valueSize,\n valueFormat: allParams[0].valueFormat,\n values: allParams.map((v) => v.value),\n handshake: true,\n });\n // The handshake flag is set, so we expect a BulkReport in response\n const result = await this.host.sendCommand<ConfigurationCCBulkReport>(cc, this.commandOptions);\n // If we did receive a response, we also received the updated parameters,\n // so if any one was not accepted, we know by looking at the values.\n // Translate the result into a SupervisionResult by comparing the values\n if (result) {\n const sentValues = cc.values;\n const receivedValues = [...result.values.values()];\n const success = sentValues.length === receivedValues.length\n && sentValues.every((v, i) => v === receivedValues[i]);\n return {\n status: success\n ? SupervisionStatus.Success\n : SupervisionStatus.Fail,\n };\n }\n else {\n return undefined;\n }\n }\n else {\n this.assertSupportsCommand(ConfigurationCommand, ConfigurationCommand.Set);\n const supervisionResults: (SupervisionResult | undefined)[] = [];\n for (const { parameter, value, valueSize, valueFormat, } of allParams) {\n const cc = new ConfigurationCCSet({\n nodeId: this.endpoint.nodeId,\n endpointIndex: this.endpoint.index,\n parameter,\n value,\n valueSize,\n valueFormat,\n });\n supervisionResults.push(await this.host.sendCommand(cc, this.commandOptions));\n }\n return mergeSupervisionResults(supervisionResults);\n }\n }\n /**\n * Resets a configuration parameter to its default value.\n *\n * WARNING: This will throw on legacy devices (ConfigurationCC v3 and below)\n */\n @validateArgs_ConfigurationCCAPI_reset()\n public async reset(parameter: number): Promise<SupervisionResult | undefined> {\n // Two-byte parameter numbers can only be reset using the BulkSet command\n if (parameter > 255) {\n return this.resetBulk([parameter]);\n }\n // According to SDS14223 this flag SHOULD NOT be set\n // Because we don't want to test the behavior, we enforce that it MUST not be set\n // on legacy nodes\n if (this.version <= 3) {\n throw new ZWaveError(`Resetting configuration parameters to default MUST not be done on nodes implementing ConfigurationCC V3 or below!`, ZWaveErrorCodes\n .ConfigurationCC_NoResetToDefaultOnLegacyDevices);\n }\n this.assertSupportsCommand(ConfigurationCommand, ConfigurationCommand.Set);\n const cc = new ConfigurationCCSet({\n nodeId: this.endpoint.nodeId,\n endpointIndex: this.endpoint.index,\n parameter,\n resetToDefault: true,\n });\n return this.host.sendCommand(cc, this.commandOptions);\n }\n /**\n * Resets multiple configuration parameters to their default value. Uses BulkSet if supported, otherwise falls back to individual Set commands.\n *\n * WARNING: This will throw on legacy devices (ConfigurationCC v3 and below)\n */\n @validateArgs_ConfigurationCCAPI_resetBulk()\n public async resetBulk(parameters: number[]): Promise<SupervisionResult | undefined> {\n if (isConsecutiveArray(parameters)\n && this.supportsCommand(ConfigurationCommand.BulkSet)) {\n const cc = new ConfigurationCCBulkSet({\n nodeId: this.endpoint.nodeId,\n endpointIndex: this.endpoint.index,\n parameters,\n resetToDefault: true,\n });\n return this.host.sendCommand(cc, this.commandOptions);\n }\n else {\n this.assertSupportsCommand(ConfigurationCommand, ConfigurationCommand.Set);\n const CCs = distinct(parameters).map((parameter) => new ConfigurationCCSet({\n nodeId: this.endpoint.nodeId,\n endpointIndex: this.endpoint.index,\n parameter,\n resetToDefault: true,\n }));\n for (const cc of CCs) {\n await this.host.sendCommand(cc, this.commandOptions);\n }\n }\n }\n /** Resets all configuration parameters to their default value */\n public async resetAll(): Promise<void> {\n // This is dangerous - don't allow resetting all parameters via multicast\n this.assertPhysicalEndpoint(this.endpoint);\n this.assertSupportsCommand(ConfigurationCommand, ConfigurationCommand.DefaultReset);\n const cc = new ConfigurationCCDefaultReset({\n nodeId: this.endpoint.nodeId,\n endpointIndex: this.endpoint.index,\n });\n await this.host.sendCommand(cc, this.commandOptions);\n }\n @validateArgs_ConfigurationCCAPI_getProperties()\n // oxlint-disable-next-line typescript/explicit-module-boundary-types\n public async getProperties(parameter: number) {\n // Get-type commands are only possible in singlecast\n this.assertPhysicalEndpoint(this.endpoint);\n const cc = new ConfigurationCCPropertiesGet({\n nodeId: this.endpoint.nodeId,\n endpointIndex: this.endpoint.index,\n parameter,\n });\n const response = await this.host.sendCommand<ConfigurationCCPropertiesReport>(cc, this.commandOptions);\n if (response) {\n return pick(response, [\n \"valueSize\",\n \"valueFormat\",\n \"minValue\",\n \"maxValue\",\n \"defaultValue\",\n \"nextParameter\",\n \"altersCapabilities\",\n \"isReadonly\",\n \"isAdvanced\",\n \"noBulkSupport\",\n ]);\n }\n }\n /** Requests the name of a configuration parameter from the node */\n @validateArgs_ConfigurationCCAPI_getName()\n public async getName(parameter: number): Promise<MaybeNotKnown<string>> {\n // Get-type commands are only possible in singlecast\n this.assertPhysicalEndpoint(this.endpoint);\n const cc = new ConfigurationCCNameGet({\n nodeId: this.endpoint.nodeId,\n endpointIndex: this.endpoint.index,\n parameter,\n });\n const response = await this.host.sendCommand<ConfigurationCCNameReport>(cc, this.commandOptions);\n return response?.name;\n }\n /** Requests usage info for a configuration parameter from the node */\n @validateArgs_ConfigurationCCAPI_getInfo()\n public async getInfo(parameter: number): Promise<MaybeNotKnown<string>> {\n // Get-type commands are only possible in singlecast\n this.assertPhysicalEndpoint(this.endpoint);\n const cc = new ConfigurationCCInfoGet({\n nodeId: this.endpoint.nodeId,\n endpointIndex: this.endpoint.index,\n parameter,\n });\n const response = await this.host.sendCommand<ConfigurationCCInfoReport>(cc, this.commandOptions);\n return response?.info;\n }\n /**\n * This scans the node for the existing parameters. Found parameters will be reported\n * through the `value added` and `value updated` events.\n *\n * WARNING: This method throws for newer devices.\n *\n * WARNING: On nodes implementing V1 and V2, this process may take\n * **up to an hour**, depending on the configured timeout.\n *\n * WARNING: On nodes implementing V2, all parameters after 255 will be ignored.\n */\n public async scanParametersLegacy(): Promise<void> {\n if (this.version >= 3) {\n throw new ZWaveError(\"Use ConfigurationCC.interview instead of scanning parameters for versions 3 and above.\", ZWaveErrorCodes.ConfigurationCC_NoLegacyScanOnNewDevices);\n }\n // Get-type commands are only possible in singlecast\n this.assertPhysicalEndpoint(this.endpoint);\n // TODO: Reduce the priority of the messages\n this.host.logNode(this.endpoint.nodeId, {\n endpoint: this.endpoint.index,\n message: `Scanning available parameters...`,\n });\n const ccInstance = createConfigurationCCInstance(this.endpoint);\n for (let param = 1; param <= 255; param++) {\n // Check if the parameter is readable\n let originalValue: ConfigValue | undefined;\n this.host.logNode(this.endpoint.nodeId, {\n endpoint: this.endpoint.index,\n message: ` trying param ${param}...`,\n direction: \"outbound\",\n });\n try {\n originalValue = await this.get(param, {\n // When requesting a non-existing parameter, a node SHOULD respond with the\n // first available parameter. We use this for the first param only,\n // because delayed responses might otherwise confuse the interview process\n allowUnexpectedResponse: param === 1,\n });\n if (originalValue != undefined) {\n const logMessage = ` Param ${param}:\n readable = true\n valueSize = ${ccInstance.getParamInformation(this.host, param)\n .valueSize}\n value = ${originalValue.toString()}`;\n this.host.logNode(this.endpoint.nodeId, {\n endpoint: this.endpoint.index,\n message: logMessage,\n direction: \"inbound\",\n });\n }\n }\n catch (e) {\n if (e instanceof ConfigurationCCError\n && e.code\n === ZWaveErrorCodes.ConfigurationCC_FirstParameterNumber) {\n // Continue iterating with the next param\n if (e.argument - 1 > param)\n param = e.argument - 1;\n continue;\n }\n throw e;\n }\n }\n }\n}\n@commandClass(CommandClasses.Configuration)\n@implementedVersion(4)\n@ccValues(ConfigurationCCValues)\nexport class ConfigurationCC extends CommandClass {\n declare ccCommand: ConfigurationCommand;\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.Configuration, 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 const deviceConfig = ctx.getDeviceConfig?.(node.id);\n const paramInfo = getParamInformationFromConfigFile(ctx, node.id, this.endpointIndex);\n if (paramInfo) {\n ctx.logNode(node.id, {\n endpoint: this.endpointIndex,\n message: `${this.constructor.name}: Loading configuration parameters from device config`,\n direction: \"none\",\n });\n this.deserializeParamInformationFromConfig(ctx, paramInfo);\n }\n const documentedParamNumbers = new Set(Array.from(paramInfo?.keys() ?? []).map((k) => k.parameter));\n if (api.version >= 3) {\n ctx.logNode(node.id, {\n endpoint: this.endpointIndex,\n message: \"finding first configuration parameter...\",\n direction: \"outbound\",\n });\n const param0props = await api.getProperties(0);\n let param: number;\n if (param0props) {\n param = param0props.nextParameter;\n if (param === 0) {\n ctx.logNode(node.id, {\n endpoint: this.endpointIndex,\n message: `didn't report any config params, trying #1 just to be sure...`,\n direction: \"inbound\",\n });\n param = 1;\n }\n }\n else {\n ctx.logNode(node.id, {\n endpoint: this.endpointIndex,\n message: \"Finding first configuration parameter timed out, skipping interview...\",\n level: \"warn\",\n });\n return;\n }\n while (param > 0) {\n ctx.logNode(node.id, {\n endpoint: this.endpointIndex,\n message: `querying parameter #${param} information...`,\n direction: \"outbound\",\n });\n // Query properties and the next param\n const props = await api.getProperties(param).catch(\n // If querying the properties fails, don't abort the entire interview\n () => undefined);\n if (!props) {\n ctx.logNode(node.id, {\n endpoint: this.endpointIndex,\n message: `Querying parameter #${param} information timed out, skipping scan...`,\n level: \"warn\",\n });\n break;\n }\n const { nextParameter, ...properties } = props;\n let logMessage: string;\n if (properties.valueSize === 0) {\n logMessage =\n `Parameter #${param} is unsupported. Next parameter: ${nextParameter}`;\n }\n else {\n let name: string | undefined;\n // Query the name and info for parameters that are NOT defined in a config file\n if (!documentedParamNumbers.has(param)) {\n // Skip the name query for bugged devices\n if (!deviceConfig?.compat?.skipConfigurationNameQuery) {\n name = await api.getName(param).catch(\n // If querying the name fails, don't abort the entire interview\n () => undefined);\n }\n // Skip the info query for bugged devices\n if (!deviceConfig?.compat?.skipConfigurationInfoQuery) {\n await api.getInfo(param).catch(\n // If querying the info fails, don't abort the entire interview\n () => undefined);\n }\n }\n logMessage =\n `received information for parameter #${param}:`;\n if (name) {\n logMessage += `\nparameter name: ${name}`;\n }\n logMessage += `\nvalue format: ${getEnumMemberName(ConfigValueFormat, properties.valueFormat)}\nvalue size: ${properties.valueSize} bytes\nmin value: ${properties.minValue?.toString() ?? \"undefined\"}\nmax value: ${properties.maxValue?.toString() ?? \"undefined\"}\ndefault value: ${properties.defaultValue?.toString() ?? \"undefined\"}\nis read-only: ${!!properties.isReadonly}\nis advanced (UI): ${!!properties.isAdvanced}\nhas bulk support: ${!properties.noBulkSupport}\nalters capabilities: ${!!properties.altersCapabilities}`;\n }\n ctx.logNode(node.id, {\n endpoint: this.endpointIndex,\n message: logMessage,\n direction: \"inbound\",\n });\n // Some devices report their parameter 1 instead of 0 as the next one\n // when reaching the end. To avoid infinite loops, stop scanning\n // once the next parameter is lower than the current one\n if (nextParameter > param) {\n param = nextParameter;\n }\n else {\n break;\n }\n }\n }\n await this.refreshValues(ctx);\n // Apply recommended values from device config\n if (paramInfo !== undefined\n && ctx.getInterviewOptions().applyRecommendedConfigParamValues\n === true) {\n await this.applyRecommendedValues(ctx, node, paramInfo, api);\n }\n // Remember that the interview is complete\n this.setInterviewComplete(ctx, true);\n }\n /**\n * Applies all recommended values from the device config to this node\n * Applies only if the current value is still the default value and\n * the recommended value is different\n */\n private async applyRecommendedValues(ctx: InterviewContext, node: NodeId, paramInfo: ParamInfoMap, api: ConfigurationCCAPI): Promise<void> {\n const parametersNeededUpdate: ConfigurationCCAPISetOptions[] = [];\n // Find parameters for which current value doesn't match the recommended value\n for (const [paramKey, param] of paramInfo) {\n if (param.recommendedValue === undefined\n || param.defaultValue === param.recommendedValue)\n continue;\n // Get the current value of this parameter from the device\n const currentValue = this.getValue(ctx, ConfigurationCCValues.paramInformation(paramKey.parameter, paramKey.valueBitMask));\n // If the current value is the default value (i.e. it was never changed by the user)\n // and the recommended value is different, we should update it\n if (currentValue === param.defaultValue\n && currentValue !== param.recommendedValue) {\n const baseParam = {\n parameter: paramKey.parameter,\n value: param.recommendedValue,\n };\n parametersNeededUpdate.push(param.valueBitMask !== undefined\n ? { ...baseParam, bitMask: param.valueBitMask }\n : baseParam);\n }\n }\n if (parametersNeededUpdate.length === 0)\n return;\n // Log what we're about to do\n let message = `Applying recommended config parameter values during interview:`;\n for (const param of parametersNeededUpdate) {\n const formatterBitMask = param.bitMask\n ? `[0x${num2hex(param.bitMask)}]`\n : \"\";\n const fullParamKey = `${param.parameter}${formatterBitMask}`;\n message += `\\n\u00B7 #${fullParamKey} => ${param.value}`;\n }\n ctx.logNode(node.id, {\n endpoint: this.endpointIndex,\n message,\n direction: \"none\",\n });\n await api.setBulk(parametersNeededUpdate);\n await api.getBulk(parametersNeededUpdate.map((param) => ({\n parameter: param.parameter,\n bitMask: param.bitMask,\n })));\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.Configuration, ctx, endpoint).withOptions({\n priority: MessagePriority.NodeQuery,\n });\n if (api.version < 3) {\n // V1/V2: Query all values defined in the config file\n const paramInfo = getParamInformationFromConfigFile(ctx, node.id, this.endpointIndex);\n if (paramInfo?.size) {\n // Because partial params share the same parameter number,\n // we need to remember which ones we have already queried.\n const alreadyQueried = new Set<number>();\n for (const param of paramInfo.keys()) {\n // No need to query writeonly params\n if (paramInfo.get(param)?.writeOnly)\n continue;\n // Don't double-query params\n if (alreadyQueried.has(param.parameter))\n continue;\n alreadyQueried.add(param.parameter);\n // Query the current value\n ctx.logNode(node.id, {\n endpoint: this.endpointIndex,\n message: `querying parameter #${param.parameter} value...`,\n direction: \"outbound\",\n });\n // ... at least try to\n const paramValue = await api.get(param.parameter);\n if (typeof paramValue === \"number\") {\n ctx.logNode(node.id, {\n endpoint: this.endpointIndex,\n message: `parameter #${param.parameter} has value: ${paramValue}`,\n direction: \"inbound\",\n });\n }\n else if (!paramValue) {\n ctx.logNode(node.id, {\n endpoint: this.endpointIndex,\n message: `received no value for parameter #${param.parameter}`,\n direction: \"inbound\",\n level: \"warn\",\n });\n }\n }\n }\n else {\n ctx.logNode(node.id, {\n endpoint: this.endpointIndex,\n message: `${this.constructor.name}: skipping interview because CC version is < 3 and there is no config file`,\n direction: \"none\",\n });\n }\n }\n else {\n // V3+: Query the values of discovered parameters\n const parameters = distinct(this.getDefinedValueIDs(ctx)\n .map((v) => v.property)\n .filter((p) => typeof p === \"number\"));\n for (const param of parameters) {\n if (this.getParamInformation(ctx, param).readable !== false) {\n ctx.logNode(node.id, {\n endpoint: this.endpointIndex,\n message: `querying parameter #${param} value...`,\n direction: \"outbound\",\n });\n await api.get(param);\n }\n else {\n ctx.logNode(node.id, {\n endpoint: this.endpointIndex,\n message: `not querying parameter #${param} value, because it is writeonly`,\n direction: \"none\",\n });\n }\n }\n }\n }\n /**\n * Whether this node's param information was loaded from a config file.\n * If this is true, we don't trust what the node reports\n */\n protected paramExistsInConfigFile(ctx: GetValueDB & GetDeviceConfig, parameter: number, valueBitMask?: number): boolean {\n if (this.getValue(ctx, ConfigurationCCValues.isParamInformationFromConfig) !== true) {\n return false;\n }\n const paramInformation = getParamInformationFromConfigFile(ctx, this.nodeId as number, this.endpointIndex);\n if (!paramInformation)\n return false;\n // Check if the param is defined in the config file, either as a normal param or a partial\n if (paramInformation.has({ parameter, valueBitMask })) {\n return true;\n }\n else if (valueBitMask == undefined) {\n // Also consider partials when looking for plain params\n for (const key of paramInformation.keys()) {\n if (key.parameter === parameter)\n return true;\n }\n }\n return false;\n }\n /**\n * @internal\n * Stores config parameter metadata for this CC's node\n */\n public extendParamInformation(ctx: GetValueDB & GetDeviceConfig, parameter: number, valueBitMask: number | undefined, info: Partial<ConfigurationMetadata>): void {\n // Don't trust param information that a node reports if we have already loaded it from a config file\n if (valueBitMask === undefined\n && this.paramExistsInConfigFile(ctx, parameter)) {\n return;\n }\n // Retrieve the base metadata\n const metadata = this.getParamInformation(ctx, parameter, valueBitMask);\n // Override it with new data\n Object.assign(metadata, info);\n // And store it back\n this.setMetadata(ctx, ConfigurationCCValues.paramInformation(parameter, valueBitMask), metadata);\n }\n /**\n * @internal\n * Returns stored config parameter metadata for this CC's node\n */\n public getParamInformation(ctx: GetValueDB, parameter: number, valueBitMask?: number): ConfigurationMetadata {\n return (this.getMetadata(ctx, ConfigurationCCValues.paramInformation(parameter, valueBitMask)) ?? {\n ...ValueMetadata.Number,\n });\n }\n /**\n * **INTERNAL:** Returns the param info that was queried for this node. This returns the information that was returned by the node\n * and does not include partial parameters.\n */\n public getQueriedParamInfos(ctx: GetValueDB & GetSupportedCCVersion & GetDeviceConfig & GetNode<NodeId & GetEndpoint<EndpointId & SupportsCC & ControlsCC>>): Record<number, ConfigurationMetadata> {\n const parameters = distinct(this.getDefinedValueIDs(ctx)\n .map((v) => v.property)\n .filter((p) => typeof p === \"number\"));\n return Object.fromEntries(parameters.map((p) => [\n p as any,\n this.getParamInformation(ctx, p),\n ]));\n }\n /**\n * Returns stored config parameter metadata for all partial config params addressed with the given parameter number\n */\n public getPartialParamInfos(ctx: GetValueDB, parameter: number): (ValueID & {\n metadata: ConfigurationMetadata;\n })[] {\n const valueDB = this.getValueDB(ctx);\n return valueDB.findMetadata((id) => id.commandClass === this.ccId\n && (id.endpoint ?? 0) === this.endpointIndex\n && id.property === parameter\n && id.propertyKey != undefined) as (ValueID & {\n metadata: ConfigurationMetadata;\n })[];\n }\n /**\n * Computes the full value of a parameter after applying a partial param value\n */\n public composePartialParamValue(ctx: GetValueDB, parameter: number, bitMask: number, partialValue: number): number {\n return this.composePartialParamValues(ctx, parameter, [\n { bitMask, partialValue },\n ]);\n }\n /**\n * Computes the full value of a parameter after applying multiple partial param values\n */\n public composePartialParamValues(ctx: GetValueDB, parameter: number, partials: {\n bitMask: number;\n partialValue: number;\n }[]): number {\n const valueDB = this.getValueDB(ctx);\n // Add the other values together\n const otherValues = valueDB.findValues((id) => id.commandClass === this.ccId\n && (id.endpoint ?? 0) === this.endpointIndex\n && id.property === parameter\n && id.propertyKey != undefined\n && !partials.some((p) => id.propertyKey === p.bitMask));\n let ret = 0;\n for (const { propertyKey: bitMask, value: partialValue, } of otherValues) {\n ret = encodePartial(ret, partialValue as number, bitMask as number);\n }\n for (const { bitMask, partialValue } of partials) {\n ret = encodePartial(ret, partialValue, bitMask);\n }\n return ret;\n }\n /** Deserializes the config parameter info from a config file */\n public deserializeParamInformationFromConfig(ctx: GetValueDB & GetDeviceConfig, config: ParamInfoMap): void {\n const valueDB = this.getValueDB(ctx);\n // Clear old param information\n for (const meta of valueDB.getAllMetadata(this.ccId)) {\n if (typeof meta.property === \"number\"\n && (meta.endpoint ?? 0) === this.endpointIndex) {\n // this is a param information, delete it\n valueDB.setMetadata(meta, undefined, \n // Don't emit the added/updated events, as this will spam applications with untranslated events\n { noEvent: true });\n }\n }\n // Allow overwriting the param info (mark it as unloaded)\n this.setValue(ctx, ConfigurationCCValues.isParamInformationFromConfig, false);\n for (const [param, info] of config.entries()) {\n // Skip hidden parameters entirely - don't create metadata or persist values\n if (info.hidden) {\n continue;\n }\n const paramInfo = configParamInfoToMetadata(info);\n this.extendParamInformation(ctx, param.parameter, param.valueBitMask, paramInfo);\n }\n // Remember that we loaded the param information from a config file\n this.setValue(ctx, ConfigurationCCValues.isParamInformationFromConfig, true);\n }\n public translatePropertyKey(ctx: GetValueDB, property: string | number, propertyKey?: string | number): string | undefined {\n if (typeof property === \"number\"\n && (propertyKey == undefined || typeof propertyKey === \"number\")) {\n // This CC names all configuration parameters differently,\n // so no name for the property key is required\n return undefined;\n }\n return super.translateProperty(ctx, property, propertyKey);\n }\n public translateProperty(ctx: GetValueDB, property: string | number, propertyKey?: string | number): string {\n // Try to retrieve the configured param label\n if (typeof property === \"number\"\n && (propertyKey == undefined || typeof propertyKey === \"number\")) {\n const paramInfo = this.getParamInformation(ctx, property, propertyKey);\n if (paramInfo.label)\n return paramInfo.label;\n // fall back to paramXYZ[_key] if none is defined\n let ret = `param${property.toString().padStart(3, \"0\")}`;\n if (propertyKey != undefined) {\n ret += \"_\" + propertyKey.toString();\n }\n return ret;\n }\n return super.translateProperty(ctx, property, propertyKey);\n }\n}\n/** @publicAPI */\nexport interface ConfigurationCCReportOptions {\n parameter: number;\n value: ConfigValue;\n valueSize: number;\n valueFormat?: ConfigValueFormat;\n}\n@CCCommand(ConfigurationCommand.Report)\nexport class ConfigurationCCReport extends ConfigurationCC {\n public constructor(options: WithAddress<ConfigurationCCReportOptions>) {\n super(options);\n this.parameter = options.parameter;\n this.value = options.value;\n this.valueSize = options.valueSize;\n this.valueFormat = options.valueFormat;\n }\n public static from(raw: CCRaw, ctx: CCParsingContext): ConfigurationCCReport {\n // All fields must be present\n validatePayload(raw.payload.length > 2);\n const parameter = raw.payload[0];\n const valueSize = raw.payload[1] & 0b111;\n // Ensure we received a valid report\n validatePayload(valueSize >= 1, valueSize <= 4, raw.payload.length >= 2 + valueSize);\n // Default to parsing the value as SignedInteger, like the specs say.\n // We try to re-interpret the value in persistValues()\n const value = parseValue(raw.payload.subarray(2), valueSize, ConfigValueFormat.SignedInteger);\n return new this({\n nodeId: ctx.sourceNodeId,\n parameter,\n valueSize,\n value,\n });\n }\n public parameter: number;\n public value: ConfigValue;\n public valueSize: number;\n private valueFormat?: ConfigValueFormat; // only used for serialization\n public persistValues(ctx: PersistValuesContext): boolean {\n if (!super.persistValues(ctx))\n return false;\n // Skip hidden parameters entirely - don't persist values\n const paramInfo = getParamInformationFromConfigFile(ctx, this.nodeId as number, this.endpointIndex);\n if (paramInfo?.get({ parameter: this.parameter })?.hidden) {\n return true;\n }\n const ccVersion = getEffectiveCCVersion(ctx, this);\n // This parameter may be a partial param in the following cases:\n // * a config file defines it as such\n // * it was reported by the device as a bit field\n const partialParams = this.getPartialParamInfos(ctx, this.parameter);\n let cachedValueFormat: ConfigValueFormat | undefined;\n if (partialParams.length > 0) {\n // This is a partial param. All definitions should have the same format, so we just take the first one\n cachedValueFormat = partialParams[0].metadata.format;\n }\n else {\n // Check if the initial assumption of SignedInteger holds true\n const oldParamInformation = this.getParamInformation(ctx, this.parameter);\n cachedValueFormat = oldParamInformation.format;\n // On older CC versions, these reports may be the only way we can retrieve the value size\n // Therefore we store it here\n this.extendParamInformation(ctx, this.parameter, undefined, {\n valueSize: this.valueSize,\n });\n if (ccVersion < 3\n && !this.paramExistsInConfigFile(ctx, this.parameter)\n && oldParamInformation.min == undefined\n && oldParamInformation.max == undefined) {\n const isSigned = oldParamInformation.format == undefined\n || oldParamInformation.format\n === ConfigValueFormat.SignedInteger;\n this.extendParamInformation(ctx, this.parameter, undefined, getIntegerLimits(this.valueSize as any, isSigned));\n }\n }\n // We may have to re-interpret the value as unsigned, depending on the cached value format\n if (cachedValueFormat != undefined\n && cachedValueFormat !== ConfigValueFormat.SignedInteger) {\n // Re-interpret the value with the new format\n this.value = reInterpretSignedValue(this.value, this.valueSize, cachedValueFormat);\n }\n // And store the value itself\n // If we have partial config params defined, we need to split the value\n if (partialParams.length > 0) {\n for (const param of partialParams) {\n if (typeof param.propertyKey === \"number\") {\n this.setValue(ctx, ConfigurationCCValues.paramInformation(this.parameter, param.propertyKey), parsePartial(this.value as any, param.propertyKey, isSignedPartial(param.propertyKey, param.metadata.format)));\n }\n }\n }\n else {\n // This is a single param\n this.setValue(ctx, ConfigurationCCValues.paramInformation(this.parameter), this.value);\n }\n return true;\n }\n public serialize(ctx: CCEncodingContext): Promise<Bytes> {\n this.payload = Bytes.concat([\n [this.parameter, this.valueSize & 0b111],\n new Bytes(this.valueSize),\n ]);\n serializeValue(this.payload, 2, this.valueSize, this.valueFormat ?? ConfigValueFormat.SignedInteger, this.value);\n return super.serialize(ctx);\n }\n public toLogEntry(ctx?: GetValueDB): MessageOrCCLogEntry {\n return {\n ...super.toLogEntry(ctx),\n message: {\n \"parameter #\": this.parameter,\n \"value size\": this.valueSize,\n value: configValueToString(this.value),\n },\n };\n }\n}\nfunction testResponseForConfigurationGet(sent: ConfigurationCCGet, received: ConfigurationCCReport) {\n // We expect a Configuration Report that matches the requested parameter\n return (sent.parameter === received.parameter || sent.allowUnexpectedResponse);\n}\n// @publicAPI\nexport interface ConfigurationCCGetOptions {\n parameter: number;\n /**\n * If this is `true`, responses with different parameters than expected are accepted\n * and treated as hints for the first parameter number.\n */\n allowUnexpectedResponse?: boolean;\n}\n@CCCommand(ConfigurationCommand.Get)\n@expectedCCResponse(ConfigurationCCReport, testResponseForConfigurationGet)\nexport class ConfigurationCCGet extends ConfigurationCC {\n public constructor(options: WithAddress<ConfigurationCCGetOptions>) {\n super(options);\n this.parameter = options.parameter;\n this.allowUnexpectedResponse = options.allowUnexpectedResponse\n ?? false;\n }\n public static from(raw: CCRaw, ctx: CCParsingContext): ConfigurationCCGet {\n validatePayload(raw.payload.length >= 1);\n const parameter = raw.payload[0];\n return new this({\n nodeId: ctx.sourceNodeId,\n parameter,\n });\n }\n public parameter: number;\n public allowUnexpectedResponse: boolean;\n public serialize(ctx: CCEncodingContext): Promise<Bytes> {\n this.payload = Bytes.from([this.parameter]);\n return super.serialize(ctx);\n }\n public toLogEntry(ctx?: GetValueDB): MessageOrCCLogEntry {\n return {\n ...super.toLogEntry(ctx),\n message: { \"parameter #\": this.parameter },\n };\n }\n}\n// @publicAPI\nexport type ConfigurationCCSetOptions = {\n parameter: number;\n resetToDefault: true;\n} | {\n parameter: number;\n resetToDefault?: false;\n valueSize: number;\n /** How the value is encoded. Defaults to SignedInteger */\n valueFormat?: ConfigValueFormat;\n value: ConfigValue;\n};\n@CCCommand(ConfigurationCommand.Set)\n@useSupervision()\nexport class ConfigurationCCSet extends ConfigurationCC {\n public constructor(options: WithAddress<ConfigurationCCSetOptions>) {\n super(options);\n this.parameter = options.parameter;\n this.resetToDefault = !!options.resetToDefault;\n if (!options.resetToDefault) {\n // TODO: Default to the stored value size\n this.valueSize = options.valueSize;\n this.valueFormat = options.valueFormat\n ?? ConfigValueFormat.SignedInteger;\n this.value = options.value;\n }\n }\n public static from(raw: CCRaw, ctx: CCParsingContext): ConfigurationCCSet {\n validatePayload(raw.payload.length >= 2);\n const parameter = raw.payload[0];\n const resetToDefault = !!(raw.payload[1] & 128);\n const valueSize: number | undefined = raw.payload[1] & 0b111;\n // Ensure we received a valid report\n validatePayload(valueSize >= 1, valueSize <= 4, raw.payload.length >= 2 + valueSize);\n // Parse the value as signed integer. We don't know the format here.\n const value: number | undefined = parseValue(raw.payload.subarray(2), valueSize, ConfigValueFormat.SignedInteger);\n return new this({\n nodeId: ctx.sourceNodeId,\n parameter,\n resetToDefault,\n valueSize,\n value,\n });\n }\n public resetToDefault: boolean;\n public parameter: number;\n public valueSize: number | undefined;\n public valueFormat: ConfigValueFormat | undefined;\n public value: ConfigValue | undefined;\n public serialize(ctx: CCEncodingContext): Promise<Bytes> {\n const valueSize = this.resetToDefault ? 1 : this.valueSize!;\n const payloadLength = 2 + valueSize;\n this.payload = Bytes.alloc(payloadLength, 0);\n this.payload[0] = this.parameter;\n this.payload[1] = (this.resetToDefault ? 128 : 0)\n | (valueSize & 0b111);\n if (!this.resetToDefault) {\n // Make sure that the given value fits into the value size\n if (typeof this.value === \"number\"\n && !isSafeValue(this.value, valueSize, this.valueFormat!)) {\n // If there is a value size configured, check that the given value is compatible\n throwInvalidValueError(this.value, this.parameter, valueSize, this.valueFormat!);\n }\n try {\n serializeValue(this.payload, 2, valueSize, this.valueFormat!, this.value!);\n }\n catch (e) {\n tryCatchOutOfBoundsError(e as Error, this.value, this.parameter, valueSize, this.valueFormat!);\n }\n }\n return super.serialize(ctx);\n }\n public toLogEntry(ctx?: GetValueDB): MessageOrCCLogEntry {\n const message: MessageRecord = {\n \"parameter #\": this.parameter,\n \"reset to default\": this.resetToDefault,\n };\n if (this.valueSize != undefined) {\n message[\"value size\"] = this.valueSize;\n }\n if (this.valueFormat != undefined) {\n message[\"value format\"] = getEnumMemberName(ConfigValueFormat, this.valueFormat);\n }\n if (this.value != undefined) {\n message.value = configValueToString(this.value);\n }\n return {\n ...super.toLogEntry(ctx),\n message,\n };\n }\n}\n// @publicAPI\nexport type ConfigurationCCBulkSetOptions = {\n parameters: number[];\n handshake?: boolean;\n} & ({\n resetToDefault: true;\n} | {\n resetToDefault?: false;\n valueSize: number;\n valueFormat?: ConfigValueFormat;\n values: number[];\n});\nfunction getResponseForBulkSet(ctx: GetNode<NodeId & SupportsCC>, cc: ConfigurationCCBulkSet) {\n return cc.handshake ? ConfigurationCCBulkReport : undefined;\n}\n@CCCommand(ConfigurationCommand.BulkSet)\n@expectedCCResponse(getResponseForBulkSet)\n@useSupervision()\nexport class ConfigurationCCBulkSet extends ConfigurationCC {\n public constructor(options: WithAddress<ConfigurationCCBulkSetOptions>) {\n super(options);\n this._parameters = options.parameters;\n if (this._parameters.length < 1) {\n throw new ZWaveError(`In a ConfigurationCC.BulkSet, parameters must be a non-empty array`, ZWaveErrorCodes.CC_Invalid);\n }\n else if (!isConsecutiveArray(this._parameters)) {\n throw new ZWaveError(`A ConfigurationCC.BulkSet can only be used for consecutive parameters`, ZWaveErrorCodes.CC_Invalid);\n }\n this._handshake = !!options.handshake;\n this._resetToDefault = !!options.resetToDefault;\n if (!!options.resetToDefault) {\n this._valueSize = 1;\n this._valueFormat = ConfigValueFormat.SignedInteger;\n this._values = this._parameters.map(() => 0);\n }\n else {\n this._valueSize = options.valueSize;\n this._valueFormat = options.valueFormat\n ?? ConfigValueFormat.SignedInteger;\n this._values = options.values;\n }\n }\n public static from(_raw: CCRaw, _ctx: CCParsingContext): ConfigurationCCBulkSet {\n // TODO: Deserialize payload\n throw new ZWaveError(`${this.name}: deserialization not implemented`, ZWaveErrorCodes.Deserialization_NotImplemented);\n // return new ConfigurationCCBulkSet({\n // \tnodeId: ctx.sourceNodeId,\n // });\n }\n private _parameters: number[];\n public get parameters(): number[] {\n return this._parameters;\n }\n private _resetToDefault: boolean;\n public get resetToDefault(): boolean {\n return this._resetToDefault;\n }\n private _valueSize: number;\n public get valueSize(): number {\n return this._valueSize;\n }\n private _valueFormat: ConfigValueFormat;\n public get valueFormat(): ConfigValueFormat {\n return this._valueFormat;\n }\n private _values: number[];\n public get values(): number[] {\n return this._values;\n }\n private _handshake: boolean;\n public get handshake(): boolean {\n return this._handshake;\n }\n public serialize(ctx: CCEncodingContext): Promise<Bytes> {\n const valueSize = this._resetToDefault ? 1 : this.valueSize;\n const payloadLength = 4 + valueSize * this.parameters.length;\n this.payload = Bytes.alloc(payloadLength, 0);\n this.payload.writeUInt16BE(this.parameters[0], 0);\n this.payload[2] = this.parameters.length;\n this.payload[3] = (this._resetToDefault ? 128 : 0)\n | (this.handshake ? 64 : 0)\n | (valueSize & 0b111);\n if (!this._resetToDefault) {\n for (let i = 0; i < this.parameters.length; i++) {\n const value = this._values[i];\n const param = this._parameters[i];\n // Make sure that the given value fits into the value size\n if (!isSafeValue(value, valueSize, this._valueFormat)) {\n // If there is a value size configured, check that the given value is compatible\n throwInvalidValueError(value, param, valueSize, this._valueFormat);\n }\n try {\n serializeValue(this.payload, 4 + i * valueSize, valueSize, this._valueFormat, value);\n }\n catch (e) {\n tryCatchOutOfBoundsError(e as Error, value, param, valueSize, this._valueFormat);\n }\n }\n }\n return super.serialize(ctx);\n }\n public toLogEntry(ctx?: GetValueDB): MessageOrCCLogEntry {\n const message: MessageRecord = {\n handshake: this.handshake,\n \"reset to default\": this.resetToDefault,\n \"value size\": this.valueSize,\n };\n if (this._values.length > 0) {\n message.values = this._values\n .map((value, i) => `\\n\u00B7 #${this._parameters[i]}: ${configValueToString(value)}`)\n .join(\"\");\n }\n return {\n ...super.toLogEntry(ctx),\n message,\n };\n }\n}\n// @publicAPI\nexport interface ConfigurationCCBulkReportOptions {\n reportsToFollow: number;\n defaultValues: boolean;\n isHandshakeResponse: boolean;\n valueSize: number;\n values: Record<number, ConfigValue>;\n}\n@CCCommand(ConfigurationCommand.BulkReport)\nexport class ConfigurationCCBulkReport extends ConfigurationCC {\n public constructor(options: WithAddress<ConfigurationCCBulkReportOptions>) {\n super(options);\n // TODO: Check implementation:\n this.reportsToFollow = options.reportsToFollow;\n this.defaultValues = options.defaultValues;\n this.isHandshakeResponse = options.isHandshakeResponse;\n this.valueSize = options.valueSize;\n for (const [param, value] of Object.entries(options.values)) {\n this._values.set(parseInt(param), value);\n }\n }\n public static from(raw: CCRaw, ctx: CCParsingContext): ConfigurationCCBulkReport {\n // Ensure we received enough bytes for the preamble\n validatePayload(raw.payload.length >= 5);\n const firstParameter = raw.payload.readUInt16BE(0);\n const numParams = raw.payload[2];\n const reportsToFollow = raw.payload[3];\n const defaultValues = !!(raw.payload[4] & 128);\n const isHandshakeResponse = !!(raw.payload[4] & 64);\n const valueSize = raw.payload[4] & 0b111;\n // Ensure the payload is long enough for all reported values\n validatePayload(raw.payload.length >= 5 + numParams * valueSize);\n const values: Record<number, ConfigValue> = {};\n for (let i = 0; i < numParams; i++) {\n const param = firstParameter + i;\n // Default to parsing the value as SignedInteger, like the specs say.\n // We try to re-interpret the value in persistValues()\n values[param] = parseValue(raw.payload.subarray(5 + i * valueSize), valueSize, ConfigValueFormat.SignedInteger);\n }\n return new this({\n nodeId: ctx.sourceNodeId,\n reportsToFollow,\n defaultValues,\n isHandshakeResponse,\n valueSize,\n values,\n });\n }\n public persistValues(ctx: PersistValuesContext): boolean {\n if (!super.persistValues(ctx))\n return false;\n // Store every received parameter\n for (let [parameter, value] of this._values.entries()) {\n // Check if the initial assumption of SignedInteger holds true\n const oldParamInformation = this.getParamInformation(ctx, parameter);\n if (oldParamInformation.format != undefined\n && oldParamInformation.format\n !== ConfigValueFormat.SignedInteger) {\n // Re-interpret the value with the new format\n value = reInterpretSignedValue(value, this.valueSize, oldParamInformation.format);\n this._values.set(parameter, value);\n }\n this.setValue(ctx, ConfigurationCCValues.paramInformation(parameter), value);\n }\n return true;\n }\n public reportsToFollow: number;\n public defaultValues: boolean;\n public isHandshakeResponse: boolean;\n public valueSize: number;\n private _values = new Map<number, ConfigValue>();\n public get values(): ReadonlyMap<number, ConfigValue> {\n return this._values;\n }\n public getPartialCCSessionId(): Record<string, any> | undefined {\n // We don't expect the applHost to merge CCs but we want to wait until all reports have been received\n return {};\n }\n public expectMoreMessages(): boolean {\n return this.reportsToFollow > 0;\n }\n public toLogEntry(ctx?: GetValueDB): MessageOrCCLogEntry {\n const message: MessageRecord = {\n \"handshake response\": this.isHandshakeResponse,\n \"default values\": this.defaultValues,\n \"value size\": this.valueSize,\n \"reports to follow\": this.reportsToFollow,\n };\n if (this._values.size > 0) {\n message.values = [...this._values]\n .map(([param, value]) => `\n\u00B7 #${param}: ${configValueToString(value)}`)\n .join(\"\");\n }\n return {\n ...super.toLogEntry(ctx),\n message,\n };\n }\n}\n// @publicAPI\nexport interface ConfigurationCCBulkGetOptions {\n parameters: number[];\n}\n@CCCommand(ConfigurationCommand.BulkGet)\n@expectedCCResponse(ConfigurationCCBulkReport)\nexport class ConfigurationCCBulkGet extends ConfigurationCC {\n public constructor(options: WithAddress<ConfigurationCCBulkGetOptions>) {\n super(options);\n this._parameters = options.parameters.toSorted((a, b) => a - b);\n if (!isConsecutiveArray(this.parameters)) {\n throw new ZWaveError(`A ConfigurationCC.BulkGet can only be used for consecutive parameters`, ZWaveErrorCodes.CC_Invalid);\n }\n }\n public static from(_raw: CCRaw, _ctx: CCParsingContext): ConfigurationCCBulkGet {\n // TODO: Deserialize payload\n throw new ZWaveError(`${this.name}: deserialization not implemented`, ZWaveErrorCodes.Deserialization_NotImplemented);\n // return new ConfigurationCCBulkGet({\n // \tnodeId: ctx.sourceNodeId,\n // });\n }\n private _parameters: number[];\n public get parameters(): number[] {\n return this._parameters;\n }\n public serialize(ctx: CCEncodingContext): Promise<Bytes> {\n this.payload = new Bytes(3);\n this.payload.writeUInt16BE(this.parameters[0], 0);\n this.payload[2] = this.parameters.length;\n return super.serialize(ctx);\n }\n public toLogEntry(ctx?: GetValueDB): MessageOrCCLogEntry {\n return {\n ...super.toLogEntry(ctx),\n message: { parameters: this.parameters.join(\", \") },\n };\n }\n}\n/** @publicAPI */\nexport interface ConfigurationCCNameReportOptions {\n parameter: number;\n name: string;\n reportsToFollow: number;\n}\n@CCCommand(ConfigurationCommand.NameReport)\nexport class ConfigurationCCNameReport extends ConfigurationCC {\n public constructor(options: WithAddress<ConfigurationCCNameReportOptions>) {\n super(options);\n this.parameter = options.parameter;\n this.name = options.name;\n this.reportsToFollow = options.reportsToFollow;\n }\n public static from(raw: CCRaw, ctx: CCParsingContext): ConfigurationCCNameReport {\n // Parameter and # of reports must be present\n validatePayload(raw.payload.length >= 3);\n const parameter = raw.payload.readUInt16BE(0);\n const reportsToFollow = raw.payload[2];\n if (reportsToFollow > 0) {\n // If more reports follow, the info must at least be one byte\n validatePayload(raw.payload.length >= 4);\n }\n const name: string = raw.payload.subarray(3).toString(\"utf8\");\n return new this({\n nodeId: ctx.sourceNodeId,\n parameter,\n reportsToFollow,\n name,\n });\n }\n public readonly parameter: number;\n public name: string;\n public readonly reportsToFollow: number;\n public persistValues(ctx: PersistValuesContext): boolean {\n if (!super.persistValues(ctx))\n return false;\n // Bitfield parameters that are not documented in a config file\n // are split into multiple partial parameters. We need to set the name for\n // all of them.\n const partialParams = this.getPartialParamInfos(ctx, this.parameter);\n if (partialParams.length === 0) {\n this.extendParamInformation(ctx, this.parameter, undefined, {\n label: this.name,\n });\n }\n else {\n for (const param of partialParams) {\n const paramNumber = param.property as number;\n const bitMask = param.propertyKey as number;\n const bitNumber = Math.log2(bitMask) % 1 === 0\n ? Math.log2(bitMask)\n : undefined;\n let label = `${this.name} - ${bitMask}`;\n if (bitNumber != undefined) {\n label += ` (bit ${bitNumber})`;\n }\n this.extendParamInformation(ctx, paramNumber, bitMask, {\n label,\n });\n }\n }\n return true;\n }\n public serialize(ctx: CCEncodingContext): Promise<Bytes> {\n const nameBuffer = Bytes.from(this.name, \"utf8\");\n this.payload = new Bytes(3 + nameBuffer.length);\n this.payload.writeUInt16BE(this.parameter, 0);\n this.payload[2] = this.reportsToFollow;\n this.payload.set(nameBuffer, 3);\n return super.serialize(ctx);\n }\n public getPartialCCSessionId(): Record<string, any> | undefined {\n // Distinguish sessions by the parameter number\n return { parameter: this.parameter };\n }\n public expectMoreMessages(): boolean {\n return this.reportsToFollow > 0;\n }\n public mergePartialCCs(partials: ConfigurationCCNameReport[], _ctx: CCParsingContext): Promise<void> {\n // Concat the name\n this.name = [...partials, this]\n .map((report) => report.name)\n .reduce((prev, cur) => prev + cur, \"\");\n return Promise.resolve();\n }\n public toLogEntry(ctx?: GetValueDB): MessageOrCCLogEntry {\n return {\n ...super.toLogEntry(ctx),\n message: {\n \"parameter #\": this.parameter,\n name: this.name,\n \"reports to follow\": this.reportsToFollow,\n },\n };\n }\n}\n@CCCommand(ConfigurationCommand.NameGet)\n@expectedCCResponse(ConfigurationCCNameReport)\nexport class ConfigurationCCNameGet extends ConfigurationCC {\n public constructor(options: WithAddress<ConfigurationCCGetOptions>) {\n super(options);\n this.parameter = options.parameter;\n }\n public static from(raw: CCRaw, ctx: CCParsingContext): ConfigurationCCNameGet {\n validatePayload(raw.payload.length >= 2);\n const parameter = raw.payload.readUInt16BE(0);\n return new this({\n nodeId: ctx.sourceNodeId,\n parameter,\n });\n }\n public parameter: number;\n public serialize(ctx: CCEncodingContext): Promise<Bytes> {\n this.payload = new Bytes(2);\n this.payload.writeUInt16BE(this.parameter, 0);\n return super.serialize(ctx);\n }\n public toLogEntry(ctx?: GetValueDB): MessageOrCCLogEntry {\n return {\n ...super.toLogEntry(ctx),\n message: { \"parameter #\": this.parameter },\n };\n }\n}\n/** @publicAPI */\nexport interface ConfigurationCCInfoReportOptions {\n parameter: number;\n info: string;\n reportsToFollow: number;\n}\n@CCCommand(ConfigurationCommand.InfoReport)\nexport class ConfigurationCCInfoReport extends ConfigurationCC {\n public constructor(options: WithAddress<ConfigurationCCInfoReportOptions>) {\n super(options);\n this.parameter = options.parameter;\n this.info = options.info;\n this.reportsToFollow = options.reportsToFollow;\n }\n public static from(raw: CCRaw, ctx: CCParsingContext): ConfigurationCCInfoReport {\n // Parameter and # of reports must be present\n validatePayload(raw.payload.length >= 3);\n const parameter = raw.payload.readUInt16BE(0);\n const reportsToFollow = raw.payload[2];\n if (reportsToFollow > 0) {\n // If more reports follow, the info must at least be one byte\n validatePayload(raw.payload.length >= 4);\n }\n const info: string = raw.payload.subarray(3).toString(\"utf8\");\n return new this({\n nodeId: ctx.sourceNodeId,\n parameter,\n reportsToFollow,\n info,\n });\n }\n public readonly parameter: number;\n public info: string;\n public readonly reportsToFollow: number;\n public persistValues(ctx: PersistValuesContext): boolean {\n if (!super.persistValues(ctx))\n return false;\n // Bitfield parameters that are not documented in a config file\n // are split into multiple partial parameters. We need to set the description for\n // all of them. However, these can get very long, so we put the reported\n // description on the first partial param, and refer to it from the others\n const partialParams = this.getPartialParamInfos(ctx, this.parameter).toSorted((a, b) => ((a.propertyKey as number) ?? 0)\n - ((b.propertyKey as number) ?? 0));\n if (partialParams.length === 0) {\n this.extendParamInformation(ctx, this.parameter, undefined, {\n description: this.info,\n });\n }\n else {\n let firstParamLabel: string | undefined;\n for (const param of partialParams) {\n const paramNumber = param.property as number;\n const bitMask = param.propertyKey as number;\n // We put the description on the first partial param\n const description = firstParamLabel\n ? `Refer to ${firstParamLabel}`\n : this.info;\n this.extendParamInformation(ctx, paramNumber, bitMask, {\n description,\n });\n // Then we store the name of the first param to refer to it on the\n // following partial params\n if (firstParamLabel == undefined) {\n firstParamLabel =\n this.getParamInformation(ctx, paramNumber, bitMask)\n .label ?? `parameter ${paramNumber} - ${bitMask}`;\n }\n }\n }\n return true;\n }\n public serialize(ctx: CCEncodingContext): Promise<Bytes> {\n const infoBuffer = Bytes.from(this.info, \"utf8\");\n this.payload = new Bytes(3 + infoBuffer.length);\n this.payload.writeUInt16BE(this.parameter, 0);\n this.payload[2] = this.reportsToFollow;\n this.payload.set(infoBuffer, 3);\n return super.serialize(ctx);\n }\n public getPartialCCSessionId(): Record<string, any> | undefined {\n // Distinguish sessions by the parameter number\n return { parameter: this.parameter };\n }\n public expectMoreMessages(): boolean {\n return this.reportsToFollow > 0;\n }\n public mergePartialCCs(partials: ConfigurationCCInfoReport[], _ctx: CCParsingContext): Promise<void> {\n // Concat the info\n this.info = [...partials, this]\n .map((report) => report.info)\n .reduce((prev, cur) => prev + cur, \"\");\n return Promise.resolve();\n }\n public toLogEntry(ctx?: GetValueDB): MessageOrCCLogEntry {\n return {\n ...super.toLogEntry(ctx),\n message: {\n \"parameter #\": this.parameter,\n info: this.info,\n \"reports to follow\": this.reportsToFollow,\n },\n };\n }\n}\n@CCCommand(ConfigurationCommand.InfoGet)\n@expectedCCResponse(ConfigurationCCInfoReport)\nexport class ConfigurationCCInfoGet extends ConfigurationCC {\n public constructor(options: WithAddress<ConfigurationCCGetOptions>) {\n super(options);\n this.parameter = options.parameter;\n }\n public static from(raw: CCRaw, ctx: CCParsingContext): ConfigurationCCInfoGet {\n validatePayload(raw.payload.length >= 2);\n const parameter = raw.payload.readUInt16BE(0);\n return new this({\n nodeId: ctx.sourceNodeId,\n parameter,\n });\n }\n public parameter: number;\n public serialize(ctx: CCEncodingContext): Promise<Bytes> {\n this.payload = new Bytes(2);\n this.payload.writeUInt16BE(this.parameter, 0);\n return super.serialize(ctx);\n }\n public toLogEntry(ctx?: GetValueDB): MessageOrCCLogEntry {\n return {\n ...super.toLogEntry(ctx),\n message: { \"parameter #\": this.parameter },\n };\n }\n}\n/** @publicAPI */\nexport interface ConfigurationCCPropertiesReportOptions {\n parameter: number;\n valueSize: number;\n valueFormat: ConfigValueFormat;\n minValue?: ConfigValue;\n maxValue?: ConfigValue;\n defaultValue?: ConfigValue;\n nextParameter: number;\n altersCapabilities?: boolean;\n isReadonly?: boolean;\n isAdvanced?: boolean;\n noBulkSupport?: boolean;\n}\n@CCCommand(ConfigurationCommand.PropertiesReport)\nexport class ConfigurationCCPropertiesReport extends ConfigurationCC {\n public constructor(options: WithAddress<ConfigurationCCPropertiesReportOptions>) {\n super(options);\n this.parameter = options.parameter;\n this.valueSize = options.valueSize;\n this.valueFormat = options.valueFormat;\n if (this.valueSize > 0) {\n if (options.minValue == undefined) {\n throw new ZWaveError(\"The minimum value must be set when the value size is non-zero\", ZWaveErrorCodes.Argument_Invalid);\n }\n else if (options.maxValue == undefined) {\n throw new ZWaveError(\"The maximum value must be set when the value size is non-zero\", ZWaveErrorCodes.Argument_Invalid);\n }\n else if (options.defaultValue == undefined) {\n throw new ZWaveError(\"The default value must be set when the value size is non-zero\", ZWaveErrorCodes.Argument_Invalid);\n }\n this.minValue = options.minValue;\n this.maxValue = options.maxValue;\n this.defaultValue = options.defaultValue;\n }\n this.nextParameter = options.nextParameter;\n this.altersCapabilities = options.altersCapabilities;\n this.isReadonly = options.isReadonly;\n this.isAdvanced = options.isAdvanced;\n this.noBulkSupport = options.noBulkSupport;\n }\n public static from(raw: CCRaw, ctx: CCParsingContext): ConfigurationCCPropertiesReport {\n validatePayload(raw.payload.length >= 3);\n const parameter = raw.payload.readUInt16BE(0);\n const valueFormat: ConfigValueFormat = (raw.payload[2] & 0b111000)\n >>> 3;\n const valueSize = raw.payload[2] & 0b111;\n // GH#1309 Some devices don't tell us the first parameter if we query #0\n // Instead, they contain 0x000000\n let nextParameter;\n if (valueSize === 0 && raw.payload.length < 5) {\n nextParameter = 0;\n return new this({\n nodeId: ctx.sourceNodeId,\n parameter,\n valueFormat,\n valueSize,\n nextParameter,\n });\n }\n // Ensure the payload contains the two bytes for next parameter\n const nextParameterOffset = 3 + 3 * valueSize;\n validatePayload(raw.payload.length >= nextParameterOffset + 2);\n let minValue: MaybeNotKnown<number>;\n let maxValue: MaybeNotKnown<number>;\n let defaultValue: MaybeNotKnown<number>;\n if (valueSize > 0) {\n if (valueFormat === ConfigValueFormat.BitField) {\n minValue = 0;\n }\n else {\n minValue = parseValue(raw.payload.subarray(3), valueSize, valueFormat);\n }\n maxValue = parseValue(raw.payload.subarray(3 + valueSize), valueSize, valueFormat);\n defaultValue = parseValue(raw.payload.subarray(3 + 2 * valueSize), valueSize, valueFormat);\n }\n nextParameter = raw.payload.readUInt16BE(nextParameterOffset);\n let altersCapabilities: MaybeNotKnown<boolean>;\n let isReadonly: MaybeNotKnown<boolean>;\n let isAdvanced: MaybeNotKnown<boolean>;\n let noBulkSupport: MaybeNotKnown<boolean>;\n if (raw.payload.length >= nextParameterOffset + 3) {\n // V4 adds an options byte after the next parameter and two bits in byte 2\n const options1 = raw.payload[2];\n const options2 = raw.payload[3 + 3 * valueSize + 2];\n altersCapabilities = !!(options1 & 128);\n isReadonly = !!(options1 & 64);\n isAdvanced = !!(options2 & 0b1);\n noBulkSupport = !!(options2 & 0b10);\n }\n return new this({\n nodeId: ctx.sourceNodeId,\n parameter,\n valueFormat,\n valueSize,\n nextParameter,\n minValue,\n maxValue,\n defaultValue,\n altersCapabilities,\n isReadonly,\n isAdvanced,\n noBulkSupport,\n });\n }\n public persistValues(ctx: PersistValuesContext): boolean {\n if (!super.persistValues(ctx))\n return false;\n // If we actually received parameter info, store it\n if (this.valueSize > 0) {\n const baseInfo = {\n type: \"number\",\n format: this.valueFormat,\n valueSize: this.valueSize,\n requiresReInclusion: this.altersCapabilities,\n readable: true,\n writeable: !this.isReadonly,\n allowManualEntry: true,\n isAdvanced: this.isAdvanced,\n noBulkSupport: this.noBulkSupport,\n isFromConfig: false,\n } as const;\n if (this.valueFormat !== ConfigValueFormat.BitField) {\n // Do not override param information from a config file\n if (!this.paramExistsInConfigFile(ctx, this.parameter)) {\n const paramInfo = stripUndefined({\n ...baseInfo,\n min: this.minValue,\n max: this.maxValue,\n default: this.defaultValue,\n } as const satisfies ConfigurationMetadata);\n this.extendParamInformation(ctx, this.parameter, undefined, paramInfo);\n }\n }\n else {\n // Bit fields are split into multiple single-bit partial parameters\n const bits = this.maxValue!;\n let mask = 1;\n while (mask <= bits) {\n if (\n // Only create partials that exist\n !!(mask & bits)\n // Do not override param information from a config file\n && !this.paramExistsInConfigFile(ctx, this.parameter, mask)) {\n const paramInfo = stripUndefined({\n ...baseInfo,\n min: 0,\n max: 1,\n default: this.defaultValue! & mask ? 1 : 0,\n } as const satisfies ConfigurationMetadata);\n this.extendParamInformation(ctx, this.parameter, mask, paramInfo);\n }\n // We must use multiplication here, as bitwise shifting works on signed 32-bit integers in JS\n // which would create an infinite loop if maxValue === 0xffff_ffff\n mask *= 2;\n }\n }\n }\n return true;\n }\n public parameter: number;\n public valueSize: number;\n public valueFormat: ConfigValueFormat;\n public minValue: MaybeNotKnown<ConfigValue>;\n public maxValue: MaybeNotKnown<ConfigValue>;\n public defaultValue: MaybeNotKnown<ConfigValue>;\n public nextParameter: number;\n public altersCapabilities: MaybeNotKnown<boolean>;\n public isReadonly: MaybeNotKnown<boolean>;\n public isAdvanced: MaybeNotKnown<boolean>;\n public noBulkSupport: MaybeNotKnown<boolean>;\n public serialize(ctx: CCEncodingContext): Promise<Bytes> {\n this.payload = new Bytes(3 // preamble\n + 3 * this.valueSize // min, max, default value\n + 2 // next parameter\n + 1);\n this.payload.writeUInt16BE(this.parameter, 0);\n const options1 = (this.altersCapabilities ? 128 : 0)\n | (this.isReadonly ? 64 : 0)\n | ((this.valueFormat & 0b111) << 3)\n | (this.valueSize & 0b111);\n this.payload[2] = options1;\n let offset = 3;\n if (this.valueSize > 0) {\n serializeValue(this.payload, offset, this.valueSize, this.valueFormat, this.minValue!);\n offset += this.valueSize;\n serializeValue(this.payload, offset, this.valueSize, this.valueFormat, this.maxValue!);\n offset += this.valueSize;\n serializeValue(this.payload, offset, this.valueSize, this.valueFormat, this.defaultValue!);\n offset += this.valueSize;\n }\n this.payload.writeUInt16BE(this.nextParameter, offset);\n offset += 2;\n const options2 = (this.isAdvanced ? 0b1 : 0)\n | (this.noBulkSupport ? 0b10 : 0);\n this.payload[offset] = options2;\n return super.serialize(ctx);\n }\n public toLogEntry(ctx?: GetValueDB): MessageOrCCLogEntry {\n const message: MessageRecord = {\n \"parameter #\": this.parameter,\n \"next param #\": this.nextParameter,\n \"value size\": this.valueSize,\n \"value format\": getEnumMemberName(ConfigValueFormat, this.valueFormat),\n };\n if (this.minValue != undefined) {\n message[\"min value\"] = configValueToString(this.minValue);\n }\n if (this.maxValue != undefined) {\n message[\"max value\"] = configValueToString(this.maxValue);\n }\n if (this.defaultValue != undefined) {\n message[\"default value\"] = configValueToString(this.defaultValue);\n }\n if (this.altersCapabilities != undefined) {\n message[\"alters capabilities\"] = this.altersCapabilities;\n }\n if (this.isReadonly != undefined) {\n message.readonly = this.isReadonly;\n }\n if (this.isAdvanced != undefined) {\n message.advanced = this.isAdvanced;\n }\n if (this.noBulkSupport != undefined) {\n message[\"bulk support\"] = !this.noBulkSupport;\n }\n return {\n ...super.toLogEntry(ctx),\n message,\n };\n }\n}\n@CCCommand(ConfigurationCommand.PropertiesGet)\n@expectedCCResponse(ConfigurationCCPropertiesReport)\nexport class ConfigurationCCPropertiesGet extends ConfigurationCC {\n public constructor(options: WithAddress<ConfigurationCCGetOptions>) {\n super(options);\n this.parameter = options.parameter;\n }\n public static from(raw: CCRaw, ctx: CCParsingContext): ConfigurationCCPropertiesGet {\n validatePayload(raw.payload.length >= 2);\n const parameter = raw.payload.readUInt16BE(0);\n return new this({\n nodeId: ctx.sourceNodeId,\n parameter,\n });\n }\n public parameter: number;\n public serialize(ctx: CCEncodingContext): Promise<Bytes> {\n this.payload = new Bytes(2);\n this.payload.writeUInt16BE(this.parameter, 0);\n return super.serialize(ctx);\n }\n public toLogEntry(ctx?: GetValueDB): MessageOrCCLogEntry {\n return {\n ...super.toLogEntry(ctx),\n message: { \"parameter #\": this.parameter },\n };\n }\n}\n@CCCommand(ConfigurationCommand.DefaultReset)\n@useSupervision()\nexport class ConfigurationCCDefaultReset extends ConfigurationCC {\n}\nfunction isSafeValue(value: number, size: number, format: ConfigValueFormat): boolean {\n let minValue: number;\n let maxValue: number;\n switch (format) {\n case ConfigValueFormat.SignedInteger:\n minValue = -Math.pow(2, 8 * size - 1);\n maxValue = Math.pow(2, 8 * size - 1) - 1;\n break;\n case ConfigValueFormat.UnsignedInteger:\n case ConfigValueFormat.Enumerated:\n case ConfigValueFormat.BitField:\n minValue = 0;\n maxValue = Math.pow(2, 8 * size);\n break;\n default:\n throw new Error(\"not implemented\");\n }\n return minValue <= value && value <= maxValue;\n}\n/** Interprets values from the payload depending on the value format */\nfunction parseValue(raw: Bytes, size: number, format: ConfigValueFormat): ConfigValue {\n switch (format) {\n case ConfigValueFormat.SignedInteger:\n return raw.readIntBE(0, size);\n case ConfigValueFormat.UnsignedInteger:\n case ConfigValueFormat.Enumerated:\n case ConfigValueFormat.BitField:\n return raw.readUIntBE(0, size);\n }\n}\nfunction throwInvalidValueError(value: any, parameter: number, valueSize: number, valueFormat: ConfigValueFormat): never {\n throw new ZWaveError(`The value ${value} is invalid for configuration parameter ${parameter} (size = ${valueSize}, format = ${getEnumMemberName(ConfigValueFormat, valueFormat)})!`, ZWaveErrorCodes.Argument_Invalid);\n}\nfunction tryCatchOutOfBoundsError(e: Error, value: any, parameter: number, valueSize: number, valueFormat: ConfigValueFormat): void {\n if (e.message.includes(\"out of bounds\")) {\n throwInvalidValueError(value, parameter, valueSize, valueFormat);\n }\n else {\n throw e;\n }\n}\n/** Serializes values into the payload according to the value format */\nfunction serializeValue(payload: Bytes, offset: number, size: number, format: ConfigValueFormat, value: ConfigValue): void {\n switch (format) {\n case ConfigValueFormat.SignedInteger:\n payload.writeIntBE(value, offset, size);\n return;\n case ConfigValueFormat.UnsignedInteger:\n case ConfigValueFormat.Enumerated:\n case ConfigValueFormat.BitField:\n payload.writeUIntBE(value, offset, size);\n return;\n }\n}\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,qBAAgC;AAGhC,kBAAmmB;AACnmB,oBAAwD;AACxD,oBAAyB;AACzB,iBAAyM;AACzM,0BAA8I;AAC9I,oCAAgH;AAEhH,mBAAuD;AAevD,gCAAsC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAxBtC,MAAM,EAAE,qCAAqC,yCAAyC,qCAAqC,y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