@zwave-js/cc 15.20.1 → 15.21.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/build/cjs/cc/AlarmSensorCC._validateArgs.js.map +2 -2
- package/build/cjs/cc/AlarmSensorCC.d.ts +4 -131
- package/build/cjs/cc/AlarmSensorCC.js +1 -2
- package/build/cjs/cc/AlarmSensorCC.js.map +3 -3
- package/build/cjs/cc/ApplicationStatusCC.d.ts +1 -1
- package/build/cjs/cc/ApplicationStatusCC.js.map +3 -3
- package/build/cjs/cc/AssociationCC._validateArgs.js.map +2 -2
- package/build/cjs/cc/AssociationCC.d.ts +3 -109
- package/build/cjs/cc/AssociationCC.js +0 -1
- package/build/cjs/cc/AssociationCC.js.map +3 -3
- package/build/cjs/cc/AssociationGroupInfoCC._validateArgs.js.map +2 -2
- package/build/cjs/cc/AssociationGroupInfoCC.d.ts +3 -112
- package/build/cjs/cc/AssociationGroupInfoCC.js +0 -1
- package/build/cjs/cc/AssociationGroupInfoCC.js.map +3 -3
- package/build/cjs/cc/BarrierOperatorCC._validateArgs.js.map +2 -2
- package/build/cjs/cc/BarrierOperatorCC.d.ts +4 -148
- package/build/cjs/cc/BarrierOperatorCC.js +1 -2
- package/build/cjs/cc/BarrierOperatorCC.js.map +3 -3
- package/build/cjs/cc/BasicCC._validateArgs.js.map +2 -2
- package/build/cjs/cc/BasicCC.d.ts +4 -143
- package/build/cjs/cc/BasicCC.js +0 -1
- package/build/cjs/cc/BasicCC.js.map +3 -3
- package/build/cjs/cc/BasicWindowCoveringCC._validateArgs.js.map +2 -2
- package/build/cjs/cc/BasicWindowCoveringCC.d.ts +3 -63
- package/build/cjs/cc/BasicWindowCoveringCC.js +2 -3
- package/build/cjs/cc/BasicWindowCoveringCC.js.map +3 -3
- package/build/cjs/cc/BatteryCC.d.ts +4 -305
- package/build/cjs/cc/BatteryCC.js +39 -15
- package/build/cjs/cc/BatteryCC.js.map +3 -3
- package/build/cjs/cc/BinarySensorCC._validateArgs.js.map +2 -2
- package/build/cjs/cc/BinarySensorCC.d.ts +4 -59
- package/build/cjs/cc/BinarySensorCC.js +12 -3
- package/build/cjs/cc/BinarySensorCC.js.map +3 -3
- package/build/cjs/cc/BinarySwitchCC._validateArgs.js.map +2 -2
- package/build/cjs/cc/BinarySwitchCC.d.ts +4 -83
- package/build/cjs/cc/BinarySwitchCC.js +0 -1
- package/build/cjs/cc/BinarySwitchCC.js.map +3 -3
- package/build/cjs/cc/CRC16CC.d.ts +1 -1
- package/build/cjs/cc/CRC16CC.js.map +3 -3
- package/build/cjs/cc/CentralSceneCC._validateArgs.js.map +2 -2
- package/build/cjs/cc/CentralSceneCC.d.ts +3 -136
- package/build/cjs/cc/CentralSceneCC.js +0 -1
- package/build/cjs/cc/CentralSceneCC.js.map +3 -3
- package/build/cjs/cc/ClimateControlScheduleCC._validateArgs.js.map +2 -2
- package/build/cjs/cc/ClimateControlScheduleCC.d.ts +4 -87
- package/build/cjs/cc/ClimateControlScheduleCC.js +3 -4
- package/build/cjs/cc/ClimateControlScheduleCC.js.map +3 -3
- package/build/cjs/cc/ClockCC._validateArgs.js.map +2 -2
- package/build/cjs/cc/ClockCC.d.ts +1 -1
- package/build/cjs/cc/ClockCC.js +1 -1
- package/build/cjs/cc/ClockCC.js.map +3 -3
- package/build/cjs/cc/ColorSwitchCC._validateArgs.js.map +2 -2
- package/build/cjs/cc/ColorSwitchCC.d.ts +4 -227
- package/build/cjs/cc/ColorSwitchCC.js +3 -3
- package/build/cjs/cc/ColorSwitchCC.js.map +3 -3
- package/build/cjs/cc/ConfigurationCC._validateArgs.js.map +2 -2
- package/build/cjs/cc/ConfigurationCC.d.ts +9 -60
- package/build/cjs/cc/ConfigurationCC.js +71 -59
- package/build/cjs/cc/ConfigurationCC.js.map +3 -3
- package/build/cjs/cc/DeviceResetLocallyCC.d.ts +1 -1
- package/build/cjs/cc/DeviceResetLocallyCC.js.map +3 -3
- package/build/cjs/cc/DoorLockCC._validateArgs.js.map +2 -2
- package/build/cjs/cc/DoorLockCC.d.ts +4 -688
- package/build/cjs/cc/DoorLockCC.js +1 -2
- package/build/cjs/cc/DoorLockCC.js.map +3 -3
- package/build/cjs/cc/DoorLockLoggingCC._validateArgs.js.map +2 -2
- package/build/cjs/cc/DoorLockLoggingCC.d.ts +4 -29
- package/build/cjs/cc/DoorLockLoggingCC.js +0 -1
- package/build/cjs/cc/DoorLockLoggingCC.js.map +3 -3
- package/build/cjs/cc/EnergyProductionCC._validateArgs.js.map +2 -2
- package/build/cjs/cc/EnergyProductionCC.d.ts +4 -33
- package/build/cjs/cc/EnergyProductionCC.js +1 -2
- package/build/cjs/cc/EnergyProductionCC.js.map +3 -3
- package/build/cjs/cc/EntryControlCC._validateArgs.js.map +2 -2
- package/build/cjs/cc/EntryControlCC.d.ts +3 -137
- package/build/cjs/cc/EntryControlCC.js +0 -1
- package/build/cjs/cc/EntryControlCC.js.map +3 -3
- package/build/cjs/cc/FirmwareUpdateMetaDataCC._validateArgs.js.map +2 -2
- package/build/cjs/cc/FirmwareUpdateMetaDataCC.d.ts +4 -154
- package/build/cjs/cc/FirmwareUpdateMetaDataCC.js +0 -1
- package/build/cjs/cc/FirmwareUpdateMetaDataCC.js.map +3 -3
- package/build/cjs/cc/HailCC.js.map +3 -3
- package/build/cjs/cc/HumidityControlModeCC._validateArgs.js.map +2 -2
- package/build/cjs/cc/HumidityControlModeCC.d.ts +4 -58
- package/build/cjs/cc/HumidityControlModeCC.js +1 -2
- package/build/cjs/cc/HumidityControlModeCC.js.map +3 -3
- package/build/cjs/cc/HumidityControlOperatingStateCC.d.ts +4 -33
- package/build/cjs/cc/HumidityControlOperatingStateCC.js +0 -1
- package/build/cjs/cc/HumidityControlOperatingStateCC.js.map +3 -3
- package/build/cjs/cc/HumidityControlSetpointCC._validateArgs.js.map +2 -2
- package/build/cjs/cc/HumidityControlSetpointCC.d.ts +4 -92
- package/build/cjs/cc/HumidityControlSetpointCC.js +0 -1
- package/build/cjs/cc/HumidityControlSetpointCC.js.map +3 -3
- package/build/cjs/cc/InclusionControllerCC.d.ts +1 -1
- package/build/cjs/cc/InclusionControllerCC.js.map +3 -3
- package/build/cjs/cc/IndicatorCC._validateArgs.js.map +2 -2
- package/build/cjs/cc/IndicatorCC.d.ts +4 -207
- package/build/cjs/cc/IndicatorCC.js +0 -1
- package/build/cjs/cc/IndicatorCC.js.map +3 -3
- package/build/cjs/cc/IrrigationCC._validateArgs.js.map +2 -2
- package/build/cjs/cc/IrrigationCC.d.ts +4 -1186
- package/build/cjs/cc/IrrigationCC.js +1 -3
- package/build/cjs/cc/IrrigationCC.js.map +3 -3
- package/build/cjs/cc/LanguageCC._validateArgs.js.map +2 -2
- package/build/cjs/cc/LanguageCC.d.ts +4 -56
- package/build/cjs/cc/LanguageCC.js +0 -1
- package/build/cjs/cc/LanguageCC.js.map +3 -3
- package/build/cjs/cc/LockCC._validateArgs.js.map +2 -2
- package/build/cjs/cc/LockCC.d.ts +4 -31
- package/build/cjs/cc/LockCC.js +0 -1
- package/build/cjs/cc/LockCC.js.map +3 -3
- package/build/cjs/cc/ManufacturerProprietaryCC._validateArgs.js.map +2 -2
- package/build/cjs/cc/ManufacturerProprietaryCC.d.ts +1 -1
- package/build/cjs/cc/ManufacturerProprietaryCC.js.map +3 -3
- package/build/cjs/cc/ManufacturerSpecificCC._validateArgs.js.map +2 -2
- package/build/cjs/cc/ManufacturerSpecificCC.d.ts +3 -116
- package/build/cjs/cc/ManufacturerSpecificCC.js +0 -1
- package/build/cjs/cc/ManufacturerSpecificCC.js.map +3 -3
- package/build/cjs/cc/MeterCC._validateArgs.js.map +2 -2
- package/build/cjs/cc/MeterCC.d.ts +4 -203
- package/build/cjs/cc/MeterCC.js +0 -2
- package/build/cjs/cc/MeterCC.js.map +3 -3
- package/build/cjs/cc/MultiChannelAssociationCC._validateArgs.js.map +2 -2
- package/build/cjs/cc/MultiChannelAssociationCC.d.ts +3 -112
- package/build/cjs/cc/MultiChannelAssociationCC.js +0 -1
- package/build/cjs/cc/MultiChannelAssociationCC.js.map +3 -3
- package/build/cjs/cc/MultiChannelCC._validateArgs.js.map +2 -2
- package/build/cjs/cc/MultiChannelCC.d.ts +3 -207
- package/build/cjs/cc/MultiChannelCC.js +0 -1
- package/build/cjs/cc/MultiChannelCC.js.map +3 -3
- package/build/cjs/cc/MultiCommandCC._validateArgs.js.map +2 -2
- package/build/cjs/cc/MultiCommandCC.d.ts +1 -1
- package/build/cjs/cc/MultiCommandCC.js.map +3 -3
- package/build/cjs/cc/MultilevelSensorCC._validateArgs.js.map +2 -2
- package/build/cjs/cc/MultilevelSensorCC.d.ts +4 -84
- package/build/cjs/cc/MultilevelSensorCC.js +0 -1
- package/build/cjs/cc/MultilevelSensorCC.js.map +3 -3
- package/build/cjs/cc/MultilevelSwitchCC._validateArgs.js.map +2 -2
- package/build/cjs/cc/MultilevelSwitchCC.d.ts +5 -264
- package/build/cjs/cc/MultilevelSwitchCC.js +34 -1
- package/build/cjs/cc/MultilevelSwitchCC.js.map +3 -3
- package/build/cjs/cc/NoOperationCC.js.map +3 -3
- package/build/cjs/cc/NodeNamingCC._validateArgs.js.map +2 -2
- package/build/cjs/cc/NodeNamingCC.d.ts +8 -58
- package/build/cjs/cc/NodeNamingCC.js +48 -25
- package/build/cjs/cc/NodeNamingCC.js.map +3 -3
- package/build/cjs/cc/NotificationCC._validateArgs.js.map +2 -2
- package/build/cjs/cc/NotificationCC.d.ts +5 -357
- package/build/cjs/cc/NotificationCC.js +2 -2
- package/build/cjs/cc/NotificationCC.js.map +3 -3
- package/build/cjs/cc/PowerlevelCC._validateArgs.js.map +2 -2
- package/build/cjs/cc/PowerlevelCC.d.ts +1 -1
- package/build/cjs/cc/PowerlevelCC.js +2 -2
- package/build/cjs/cc/PowerlevelCC.js.map +3 -3
- package/build/cjs/cc/ProtectionCC._validateArgs.js.map +2 -2
- package/build/cjs/cc/ProtectionCC.d.ts +4 -212
- package/build/cjs/cc/ProtectionCC.js +1 -2
- package/build/cjs/cc/ProtectionCC.js.map +3 -3
- package/build/cjs/cc/SceneActivationCC._validateArgs.js.map +2 -2
- package/build/cjs/cc/SceneActivationCC.d.ts +4 -59
- package/build/cjs/cc/SceneActivationCC.js +0 -1
- package/build/cjs/cc/SceneActivationCC.js.map +3 -3
- package/build/cjs/cc/SceneActuatorConfigurationCC._validateArgs.js.map +2 -2
- package/build/cjs/cc/SceneActuatorConfigurationCC.d.ts +4 -65
- package/build/cjs/cc/SceneActuatorConfigurationCC.js +0 -1
- package/build/cjs/cc/SceneActuatorConfigurationCC.js.map +3 -3
- package/build/cjs/cc/SceneControllerConfigurationCC._validateArgs.js.map +2 -2
- package/build/cjs/cc/SceneControllerConfigurationCC.d.ts +3 -64
- package/build/cjs/cc/SceneControllerConfigurationCC.js +0 -1
- package/build/cjs/cc/SceneControllerConfigurationCC.js.map +3 -3
- package/build/cjs/cc/ScheduleEntryLockCC._validateArgs.js.map +2 -2
- package/build/cjs/cc/ScheduleEntryLockCC.d.ts +4 -163
- package/build/cjs/cc/ScheduleEntryLockCC.js +0 -1
- package/build/cjs/cc/ScheduleEntryLockCC.js.map +3 -3
- package/build/cjs/cc/Security2CC.d.ts +1 -1
- package/build/cjs/cc/Security2CC.js.map +3 -3
- package/build/cjs/cc/SecurityCC.d.ts +4 -2
- package/build/cjs/cc/SecurityCC.js.map +3 -3
- package/build/cjs/cc/SoundSwitchCC._validateArgs.js.map +2 -2
- package/build/cjs/cc/SoundSwitchCC.d.ts +4 -123
- package/build/cjs/cc/SoundSwitchCC.js +6 -2
- package/build/cjs/cc/SoundSwitchCC.js.map +3 -3
- package/build/cjs/cc/SupervisionCC.d.ts +3 -31
- package/build/cjs/cc/SupervisionCC.js +4 -2
- package/build/cjs/cc/SupervisionCC.js.map +3 -3
- package/build/cjs/cc/ThermostatFanModeCC._validateArgs.js.map +2 -2
- package/build/cjs/cc/ThermostatFanModeCC.d.ts +4 -84
- package/build/cjs/cc/ThermostatFanModeCC.js +1 -2
- package/build/cjs/cc/ThermostatFanModeCC.js.map +3 -3
- package/build/cjs/cc/ThermostatFanStateCC.d.ts +4 -33
- package/build/cjs/cc/ThermostatFanStateCC.js +0 -1
- package/build/cjs/cc/ThermostatFanStateCC.js.map +3 -3
- package/build/cjs/cc/ThermostatModeCC._validateArgs.js.map +2 -2
- package/build/cjs/cc/ThermostatModeCC.d.ts +4 -84
- package/build/cjs/cc/ThermostatModeCC.js +1 -2
- package/build/cjs/cc/ThermostatModeCC.js.map +3 -3
- package/build/cjs/cc/ThermostatOperatingStateCC.d.ts +4 -33
- package/build/cjs/cc/ThermostatOperatingStateCC.js +0 -1
- package/build/cjs/cc/ThermostatOperatingStateCC.js.map +3 -3
- package/build/cjs/cc/ThermostatSetbackCC._validateArgs.js.map +2 -2
- package/build/cjs/cc/ThermostatSetbackCC.d.ts +1 -1
- package/build/cjs/cc/ThermostatSetbackCC.js.map +3 -3
- package/build/cjs/cc/ThermostatSetpointCC._validateArgs.js.map +2 -2
- package/build/cjs/cc/ThermostatSetpointCC.d.ts +5 -90
- package/build/cjs/cc/ThermostatSetpointCC.js +0 -1
- package/build/cjs/cc/ThermostatSetpointCC.js.map +3 -3
- package/build/cjs/cc/TimeCC._validateArgs.js.map +2 -2
- package/build/cjs/cc/TimeCC.d.ts +2 -2
- package/build/cjs/cc/TimeCC.js.map +3 -3
- package/build/cjs/cc/TimeParametersCC._validateArgs.js.map +2 -2
- package/build/cjs/cc/TimeParametersCC.d.ts +4 -30
- package/build/cjs/cc/TimeParametersCC.js +0 -1
- package/build/cjs/cc/TimeParametersCC.js.map +3 -3
- package/build/cjs/cc/TransportServiceCC.d.ts +1 -1
- package/build/cjs/cc/TransportServiceCC.js.map +3 -3
- package/build/cjs/cc/UserCodeCC._validateArgs.js.map +2 -2
- package/build/cjs/cc/UserCodeCC.d.ts +4 -415
- package/build/cjs/cc/UserCodeCC.js +1 -2
- package/build/cjs/cc/UserCodeCC.js.map +3 -3
- package/build/cjs/cc/VersionCC._validateArgs.js.map +2 -2
- package/build/cjs/cc/VersionCC.d.ts +3 -367
- package/build/cjs/cc/VersionCC.js +0 -1
- package/build/cjs/cc/VersionCC.js.map +3 -3
- package/build/cjs/cc/WakeUpCC._validateArgs.js.map +2 -2
- package/build/cjs/cc/WakeUpCC.d.ts +4 -83
- package/build/cjs/cc/WakeUpCC.js +11 -4
- package/build/cjs/cc/WakeUpCC.js.map +3 -3
- package/build/cjs/cc/WindowCoveringCC._validateArgs.js.map +2 -2
- package/build/cjs/cc/WindowCoveringCC.d.ts +4 -207
- package/build/cjs/cc/WindowCoveringCC.js +3 -5
- package/build/cjs/cc/WindowCoveringCC.js.map +3 -3
- package/build/cjs/cc/ZWaveLongRangeCC.js.map +3 -3
- package/build/cjs/cc/ZWavePlusCC._validateArgs.js.map +2 -2
- package/build/cjs/cc/ZWavePlusCC.d.ts +4 -129
- package/build/cjs/cc/ZWavePlusCC.js +0 -1
- package/build/cjs/cc/ZWavePlusCC.js.map +3 -3
- package/build/cjs/cc/ZWaveProtocolCC.d.ts +1 -1
- package/build/cjs/cc/ZWaveProtocolCC.js.map +3 -3
- package/build/cjs/cc/_CCValues.generated.js.map +1 -1
- package/build/cjs/cc/index.js.map +1 -1
- package/build/cjs/cc/manufacturerProprietary/Decorators.js.map +1 -1
- package/build/cjs/cc/manufacturerProprietary/FibaroCC._validateArgs.js.map +2 -2
- package/build/cjs/cc/manufacturerProprietary/FibaroCC.d.ts +1 -1
- package/build/cjs/cc/manufacturerProprietary/FibaroCC.js.map +3 -3
- package/build/cjs/index.js.map +1 -1
- package/build/cjs/index_browser.js.map +1 -1
- package/build/cjs/index_safe.js.map +1 -1
- package/build/cjs/lib/API.d.ts +3 -135
- package/build/cjs/lib/API.js.map +3 -3
- package/build/cjs/lib/CCValueUtils.js.map +1 -1
- package/build/cjs/lib/CommandClass.d.ts +1 -1
- package/build/cjs/lib/CommandClass.js.map +3 -3
- package/build/cjs/lib/CommandClassDecorators.js.map +1 -1
- package/build/cjs/lib/EncapsulatingCommandClass.js.map +1 -1
- package/build/cjs/lib/NotificationEventPayload.js.map +1 -1
- package/build/cjs/lib/Security2/Extension.js.map +1 -1
- package/build/cjs/lib/Security2/shared.js.map +1 -1
- package/build/cjs/lib/SetValueResult.js.map +1 -1
- package/build/cjs/lib/Values.js.map +1 -1
- package/build/cjs/lib/_CCAPI.generated.d.ts +136 -0
- package/build/cjs/lib/_CCAPI.generated.js +17 -0
- package/build/cjs/lib/_CCAPI.generated.js.map +7 -0
- package/build/cjs/lib/_Types.js.map +1 -1
- package/build/cjs/lib/serializers.js.map +1 -1
- package/build/cjs/lib/utils.js.map +1 -1
- package/build/esm/cc/AlarmSensorCC._validateArgs.d.ts.map +1 -1
- package/build/esm/cc/AlarmSensorCC._validateArgs.js.map +1 -1
- package/build/esm/cc/AlarmSensorCC.d.ts +4 -131
- package/build/esm/cc/AlarmSensorCC.d.ts.map +1 -1
- package/build/esm/cc/AlarmSensorCC.js +2 -3
- package/build/esm/cc/AlarmSensorCC.js.map +1 -1
- package/build/esm/cc/ApplicationStatusCC.d.ts +1 -1
- package/build/esm/cc/ApplicationStatusCC.d.ts.map +1 -1
- package/build/esm/cc/ApplicationStatusCC.js.map +1 -1
- package/build/esm/cc/AssociationCC._validateArgs.d.ts.map +1 -1
- package/build/esm/cc/AssociationCC._validateArgs.js.map +1 -1
- package/build/esm/cc/AssociationCC.d.ts +3 -109
- package/build/esm/cc/AssociationCC.d.ts.map +1 -1
- package/build/esm/cc/AssociationCC.js +0 -1
- package/build/esm/cc/AssociationCC.js.map +1 -1
- package/build/esm/cc/AssociationGroupInfoCC._validateArgs.d.ts.map +1 -1
- package/build/esm/cc/AssociationGroupInfoCC._validateArgs.js.map +1 -1
- package/build/esm/cc/AssociationGroupInfoCC.d.ts +3 -112
- package/build/esm/cc/AssociationGroupInfoCC.d.ts.map +1 -1
- package/build/esm/cc/AssociationGroupInfoCC.js +12 -13
- package/build/esm/cc/AssociationGroupInfoCC.js.map +1 -1
- package/build/esm/cc/BarrierOperatorCC._validateArgs.d.ts.map +1 -1
- package/build/esm/cc/BarrierOperatorCC._validateArgs.js.map +1 -1
- package/build/esm/cc/BarrierOperatorCC.d.ts +4 -148
- package/build/esm/cc/BarrierOperatorCC.d.ts.map +1 -1
- package/build/esm/cc/BarrierOperatorCC.js +2 -3
- package/build/esm/cc/BarrierOperatorCC.js.map +1 -1
- package/build/esm/cc/BasicCC._validateArgs.d.ts.map +1 -1
- package/build/esm/cc/BasicCC._validateArgs.js.map +1 -1
- package/build/esm/cc/BasicCC.d.ts +4 -143
- package/build/esm/cc/BasicCC.d.ts.map +1 -1
- package/build/esm/cc/BasicCC.js +1 -2
- package/build/esm/cc/BasicCC.js.map +1 -1
- package/build/esm/cc/BasicWindowCoveringCC._validateArgs.d.ts.map +1 -1
- package/build/esm/cc/BasicWindowCoveringCC._validateArgs.js.map +1 -1
- package/build/esm/cc/BasicWindowCoveringCC.d.ts +3 -63
- package/build/esm/cc/BasicWindowCoveringCC.d.ts.map +1 -1
- package/build/esm/cc/BasicWindowCoveringCC.js +5 -6
- package/build/esm/cc/BasicWindowCoveringCC.js.map +1 -1
- package/build/esm/cc/BatteryCC.d.ts +4 -305
- package/build/esm/cc/BatteryCC.d.ts.map +1 -1
- package/build/esm/cc/BatteryCC.js +67 -26
- package/build/esm/cc/BatteryCC.js.map +1 -1
- package/build/esm/cc/BinarySensorCC._validateArgs.d.ts.map +1 -1
- package/build/esm/cc/BinarySensorCC._validateArgs.js.map +1 -1
- package/build/esm/cc/BinarySensorCC.d.ts +4 -59
- package/build/esm/cc/BinarySensorCC.d.ts.map +1 -1
- package/build/esm/cc/BinarySensorCC.js +24 -4
- package/build/esm/cc/BinarySensorCC.js.map +1 -1
- package/build/esm/cc/BinarySwitchCC._validateArgs.d.ts.map +1 -1
- package/build/esm/cc/BinarySwitchCC._validateArgs.js.map +1 -1
- package/build/esm/cc/BinarySwitchCC.d.ts +4 -83
- package/build/esm/cc/BinarySwitchCC.d.ts.map +1 -1
- package/build/esm/cc/BinarySwitchCC.js +1 -2
- package/build/esm/cc/BinarySwitchCC.js.map +1 -1
- package/build/esm/cc/CRC16CC.d.ts +1 -1
- package/build/esm/cc/CRC16CC.d.ts.map +1 -1
- package/build/esm/cc/CRC16CC.js.map +1 -1
- package/build/esm/cc/CentralSceneCC._validateArgs.d.ts.map +1 -1
- package/build/esm/cc/CentralSceneCC._validateArgs.js.map +1 -1
- package/build/esm/cc/CentralSceneCC.d.ts +3 -136
- package/build/esm/cc/CentralSceneCC.d.ts.map +1 -1
- package/build/esm/cc/CentralSceneCC.js +5 -6
- package/build/esm/cc/CentralSceneCC.js.map +1 -1
- package/build/esm/cc/ClimateControlScheduleCC._validateArgs.d.ts.map +1 -1
- package/build/esm/cc/ClimateControlScheduleCC._validateArgs.js.map +1 -1
- package/build/esm/cc/ClimateControlScheduleCC.d.ts +4 -87
- package/build/esm/cc/ClimateControlScheduleCC.d.ts.map +1 -1
- package/build/esm/cc/ClimateControlScheduleCC.js +4 -5
- package/build/esm/cc/ClimateControlScheduleCC.js.map +1 -1
- package/build/esm/cc/ClockCC._validateArgs.d.ts.map +1 -1
- package/build/esm/cc/ClockCC._validateArgs.js.map +1 -1
- package/build/esm/cc/ClockCC.d.ts +1 -1
- package/build/esm/cc/ClockCC.d.ts.map +1 -1
- package/build/esm/cc/ClockCC.js +1 -1
- package/build/esm/cc/ClockCC.js.map +1 -1
- package/build/esm/cc/ColorSwitchCC._validateArgs.d.ts.map +1 -1
- package/build/esm/cc/ColorSwitchCC._validateArgs.js.map +1 -1
- package/build/esm/cc/ColorSwitchCC.d.ts +4 -227
- package/build/esm/cc/ColorSwitchCC.d.ts.map +1 -1
- package/build/esm/cc/ColorSwitchCC.js +8 -8
- package/build/esm/cc/ColorSwitchCC.js.map +1 -1
- package/build/esm/cc/ConfigurationCC._validateArgs.d.ts.map +1 -1
- package/build/esm/cc/ConfigurationCC._validateArgs.js.map +1 -1
- package/build/esm/cc/ConfigurationCC.d.ts +9 -60
- package/build/esm/cc/ConfigurationCC.d.ts.map +1 -1
- package/build/esm/cc/ConfigurationCC.js +94 -76
- package/build/esm/cc/ConfigurationCC.js.map +1 -1
- package/build/esm/cc/DeviceResetLocallyCC.d.ts +1 -1
- package/build/esm/cc/DeviceResetLocallyCC.d.ts.map +1 -1
- package/build/esm/cc/DeviceResetLocallyCC.js.map +1 -1
- package/build/esm/cc/DoorLockCC._validateArgs.d.ts.map +1 -1
- package/build/esm/cc/DoorLockCC._validateArgs.js.map +1 -1
- package/build/esm/cc/DoorLockCC.d.ts +4 -688
- package/build/esm/cc/DoorLockCC.d.ts.map +1 -1
- package/build/esm/cc/DoorLockCC.js +14 -15
- package/build/esm/cc/DoorLockCC.js.map +1 -1
- package/build/esm/cc/DoorLockLoggingCC._validateArgs.d.ts.map +1 -1
- package/build/esm/cc/DoorLockLoggingCC._validateArgs.js.map +1 -1
- package/build/esm/cc/DoorLockLoggingCC.d.ts +4 -29
- package/build/esm/cc/DoorLockLoggingCC.d.ts.map +1 -1
- package/build/esm/cc/DoorLockLoggingCC.js +0 -1
- package/build/esm/cc/DoorLockLoggingCC.js.map +1 -1
- package/build/esm/cc/EnergyProductionCC._validateArgs.d.ts.map +1 -1
- package/build/esm/cc/EnergyProductionCC._validateArgs.js.map +1 -1
- package/build/esm/cc/EnergyProductionCC.d.ts +4 -33
- package/build/esm/cc/EnergyProductionCC.d.ts.map +1 -1
- package/build/esm/cc/EnergyProductionCC.js +2 -3
- package/build/esm/cc/EnergyProductionCC.js.map +1 -1
- package/build/esm/cc/EntryControlCC._validateArgs.d.ts.map +1 -1
- package/build/esm/cc/EntryControlCC._validateArgs.js.map +1 -1
- package/build/esm/cc/EntryControlCC.d.ts +3 -137
- package/build/esm/cc/EntryControlCC.d.ts.map +1 -1
- package/build/esm/cc/EntryControlCC.js +1 -2
- package/build/esm/cc/EntryControlCC.js.map +1 -1
- package/build/esm/cc/FirmwareUpdateMetaDataCC._validateArgs.d.ts.map +1 -1
- package/build/esm/cc/FirmwareUpdateMetaDataCC._validateArgs.js.map +1 -1
- package/build/esm/cc/FirmwareUpdateMetaDataCC.d.ts +4 -154
- package/build/esm/cc/FirmwareUpdateMetaDataCC.d.ts.map +1 -1
- package/build/esm/cc/FirmwareUpdateMetaDataCC.js +0 -1
- package/build/esm/cc/FirmwareUpdateMetaDataCC.js.map +1 -1
- package/build/esm/cc/HailCC.d.ts.map +1 -1
- package/build/esm/cc/HailCC.js.map +1 -1
- package/build/esm/cc/HumidityControlModeCC._validateArgs.d.ts.map +1 -1
- package/build/esm/cc/HumidityControlModeCC._validateArgs.js.map +1 -1
- package/build/esm/cc/HumidityControlModeCC.d.ts +4 -58
- package/build/esm/cc/HumidityControlModeCC.d.ts.map +1 -1
- package/build/esm/cc/HumidityControlModeCC.js +2 -3
- package/build/esm/cc/HumidityControlModeCC.js.map +1 -1
- package/build/esm/cc/HumidityControlOperatingStateCC.d.ts +4 -33
- package/build/esm/cc/HumidityControlOperatingStateCC.d.ts.map +1 -1
- package/build/esm/cc/HumidityControlOperatingStateCC.js +1 -2
- package/build/esm/cc/HumidityControlOperatingStateCC.js.map +1 -1
- package/build/esm/cc/HumidityControlSetpointCC._validateArgs.d.ts.map +1 -1
- package/build/esm/cc/HumidityControlSetpointCC._validateArgs.js.map +1 -1
- package/build/esm/cc/HumidityControlSetpointCC.d.ts +4 -92
- package/build/esm/cc/HumidityControlSetpointCC.d.ts.map +1 -1
- package/build/esm/cc/HumidityControlSetpointCC.js +1 -2
- package/build/esm/cc/HumidityControlSetpointCC.js.map +1 -1
- package/build/esm/cc/InclusionControllerCC.d.ts +1 -1
- package/build/esm/cc/InclusionControllerCC.d.ts.map +1 -1
- package/build/esm/cc/InclusionControllerCC.js.map +1 -1
- package/build/esm/cc/IndicatorCC._validateArgs.d.ts.map +1 -1
- package/build/esm/cc/IndicatorCC._validateArgs.js.map +1 -1
- package/build/esm/cc/IndicatorCC.d.ts +4 -207
- package/build/esm/cc/IndicatorCC.d.ts.map +1 -1
- package/build/esm/cc/IndicatorCC.js +0 -1
- package/build/esm/cc/IndicatorCC.js.map +1 -1
- package/build/esm/cc/IrrigationCC._validateArgs.d.ts.map +1 -1
- package/build/esm/cc/IrrigationCC._validateArgs.js.map +1 -1
- package/build/esm/cc/IrrigationCC.d.ts +4 -1186
- package/build/esm/cc/IrrigationCC.d.ts.map +1 -1
- package/build/esm/cc/IrrigationCC.js +6 -8
- package/build/esm/cc/IrrigationCC.js.map +1 -1
- package/build/esm/cc/LanguageCC._validateArgs.d.ts.map +1 -1
- package/build/esm/cc/LanguageCC._validateArgs.js.map +1 -1
- package/build/esm/cc/LanguageCC.d.ts +4 -56
- package/build/esm/cc/LanguageCC.d.ts.map +1 -1
- package/build/esm/cc/LanguageCC.js +1 -2
- package/build/esm/cc/LanguageCC.js.map +1 -1
- package/build/esm/cc/LockCC._validateArgs.d.ts.map +1 -1
- package/build/esm/cc/LockCC._validateArgs.js.map +1 -1
- package/build/esm/cc/LockCC.d.ts +4 -31
- package/build/esm/cc/LockCC.d.ts.map +1 -1
- package/build/esm/cc/LockCC.js +1 -2
- package/build/esm/cc/LockCC.js.map +1 -1
- package/build/esm/cc/ManufacturerProprietaryCC._validateArgs.d.ts.map +1 -1
- package/build/esm/cc/ManufacturerProprietaryCC._validateArgs.js.map +1 -1
- package/build/esm/cc/ManufacturerProprietaryCC.d.ts +1 -1
- package/build/esm/cc/ManufacturerProprietaryCC.d.ts.map +1 -1
- package/build/esm/cc/ManufacturerProprietaryCC.js.map +1 -1
- package/build/esm/cc/ManufacturerSpecificCC._validateArgs.d.ts.map +1 -1
- package/build/esm/cc/ManufacturerSpecificCC._validateArgs.js.map +1 -1
- package/build/esm/cc/ManufacturerSpecificCC.d.ts +3 -116
- package/build/esm/cc/ManufacturerSpecificCC.d.ts.map +1 -1
- package/build/esm/cc/ManufacturerSpecificCC.js +1 -2
- package/build/esm/cc/ManufacturerSpecificCC.js.map +1 -1
- package/build/esm/cc/MeterCC._validateArgs.d.ts.map +1 -1
- package/build/esm/cc/MeterCC._validateArgs.js.map +1 -1
- package/build/esm/cc/MeterCC.d.ts +4 -203
- package/build/esm/cc/MeterCC.d.ts.map +1 -1
- package/build/esm/cc/MeterCC.js +17 -19
- package/build/esm/cc/MeterCC.js.map +1 -1
- package/build/esm/cc/MultiChannelAssociationCC._validateArgs.d.ts.map +1 -1
- package/build/esm/cc/MultiChannelAssociationCC._validateArgs.js.map +1 -1
- package/build/esm/cc/MultiChannelAssociationCC.d.ts +3 -112
- package/build/esm/cc/MultiChannelAssociationCC.d.ts.map +1 -1
- package/build/esm/cc/MultiChannelAssociationCC.js +4 -5
- package/build/esm/cc/MultiChannelAssociationCC.js.map +1 -1
- package/build/esm/cc/MultiChannelCC._validateArgs.d.ts.map +1 -1
- package/build/esm/cc/MultiChannelCC._validateArgs.js.map +1 -1
- package/build/esm/cc/MultiChannelCC.d.ts +3 -207
- package/build/esm/cc/MultiChannelCC.d.ts.map +1 -1
- package/build/esm/cc/MultiChannelCC.js +9 -10
- package/build/esm/cc/MultiChannelCC.js.map +1 -1
- package/build/esm/cc/MultiCommandCC._validateArgs.d.ts.map +1 -1
- package/build/esm/cc/MultiCommandCC._validateArgs.js.map +1 -1
- package/build/esm/cc/MultiCommandCC.d.ts +1 -1
- package/build/esm/cc/MultiCommandCC.d.ts.map +1 -1
- package/build/esm/cc/MultiCommandCC.js.map +1 -1
- package/build/esm/cc/MultilevelSensorCC._validateArgs.d.ts.map +1 -1
- package/build/esm/cc/MultilevelSensorCC._validateArgs.js.map +1 -1
- package/build/esm/cc/MultilevelSensorCC.d.ts +4 -84
- package/build/esm/cc/MultilevelSensorCC.d.ts.map +1 -1
- package/build/esm/cc/MultilevelSensorCC.js +1 -2
- package/build/esm/cc/MultilevelSensorCC.js.map +1 -1
- package/build/esm/cc/MultilevelSwitchCC._validateArgs.d.ts.map +1 -1
- package/build/esm/cc/MultilevelSwitchCC._validateArgs.js.map +1 -1
- package/build/esm/cc/MultilevelSwitchCC.d.ts +5 -264
- package/build/esm/cc/MultilevelSwitchCC.d.ts.map +1 -1
- package/build/esm/cc/MultilevelSwitchCC.js +44 -6
- package/build/esm/cc/MultilevelSwitchCC.js.map +1 -1
- package/build/esm/cc/NoOperationCC.d.ts.map +1 -1
- package/build/esm/cc/NoOperationCC.js.map +1 -1
- package/build/esm/cc/NodeNamingCC._validateArgs.d.ts.map +1 -1
- package/build/esm/cc/NodeNamingCC._validateArgs.js.map +1 -1
- package/build/esm/cc/NodeNamingCC.d.ts +8 -58
- package/build/esm/cc/NodeNamingCC.d.ts.map +1 -1
- package/build/esm/cc/NodeNamingCC.js +49 -38
- package/build/esm/cc/NodeNamingCC.js.map +1 -1
- package/build/esm/cc/NotificationCC._validateArgs.d.ts.map +1 -1
- package/build/esm/cc/NotificationCC._validateArgs.js.map +1 -1
- package/build/esm/cc/NotificationCC.d.ts +5 -357
- package/build/esm/cc/NotificationCC.d.ts.map +1 -1
- package/build/esm/cc/NotificationCC.js +9 -9
- package/build/esm/cc/NotificationCC.js.map +1 -1
- package/build/esm/cc/PowerlevelCC._validateArgs.d.ts.map +1 -1
- package/build/esm/cc/PowerlevelCC._validateArgs.js.map +1 -1
- package/build/esm/cc/PowerlevelCC.d.ts +1 -1
- package/build/esm/cc/PowerlevelCC.d.ts.map +1 -1
- package/build/esm/cc/PowerlevelCC.js +2 -2
- package/build/esm/cc/PowerlevelCC.js.map +1 -1
- package/build/esm/cc/ProtectionCC._validateArgs.d.ts.map +1 -1
- package/build/esm/cc/ProtectionCC._validateArgs.js.map +1 -1
- package/build/esm/cc/ProtectionCC.d.ts +4 -212
- package/build/esm/cc/ProtectionCC.d.ts.map +1 -1
- package/build/esm/cc/ProtectionCC.js +2 -3
- package/build/esm/cc/ProtectionCC.js.map +1 -1
- package/build/esm/cc/SceneActivationCC._validateArgs.d.ts.map +1 -1
- package/build/esm/cc/SceneActivationCC._validateArgs.js.map +1 -1
- package/build/esm/cc/SceneActivationCC.d.ts +4 -59
- package/build/esm/cc/SceneActivationCC.d.ts.map +1 -1
- package/build/esm/cc/SceneActivationCC.js +1 -2
- package/build/esm/cc/SceneActivationCC.js.map +1 -1
- package/build/esm/cc/SceneActuatorConfigurationCC._validateArgs.d.ts.map +1 -1
- package/build/esm/cc/SceneActuatorConfigurationCC._validateArgs.js.map +1 -1
- package/build/esm/cc/SceneActuatorConfigurationCC.d.ts +4 -65
- package/build/esm/cc/SceneActuatorConfigurationCC.d.ts.map +1 -1
- package/build/esm/cc/SceneActuatorConfigurationCC.js +2 -3
- package/build/esm/cc/SceneActuatorConfigurationCC.js.map +1 -1
- package/build/esm/cc/SceneControllerConfigurationCC._validateArgs.d.ts.map +1 -1
- package/build/esm/cc/SceneControllerConfigurationCC._validateArgs.js.map +1 -1
- package/build/esm/cc/SceneControllerConfigurationCC.d.ts +3 -64
- package/build/esm/cc/SceneControllerConfigurationCC.d.ts.map +1 -1
- package/build/esm/cc/SceneControllerConfigurationCC.js +1 -2
- package/build/esm/cc/SceneControllerConfigurationCC.js.map +1 -1
- package/build/esm/cc/ScheduleEntryLockCC._validateArgs.d.ts.map +1 -1
- package/build/esm/cc/ScheduleEntryLockCC._validateArgs.js.map +1 -1
- package/build/esm/cc/ScheduleEntryLockCC.d.ts +4 -163
- package/build/esm/cc/ScheduleEntryLockCC.d.ts.map +1 -1
- package/build/esm/cc/ScheduleEntryLockCC.js +0 -1
- package/build/esm/cc/ScheduleEntryLockCC.js.map +1 -1
- package/build/esm/cc/Security2CC.d.ts +1 -1
- package/build/esm/cc/Security2CC.d.ts.map +1 -1
- package/build/esm/cc/Security2CC.js +2 -2
- package/build/esm/cc/Security2CC.js.map +1 -1
- package/build/esm/cc/SecurityCC.d.ts +4 -2
- package/build/esm/cc/SecurityCC.d.ts.map +1 -1
- package/build/esm/cc/SecurityCC.js +2 -2
- package/build/esm/cc/SecurityCC.js.map +1 -1
- package/build/esm/cc/SoundSwitchCC._validateArgs.d.ts.map +1 -1
- package/build/esm/cc/SoundSwitchCC._validateArgs.js.map +1 -1
- package/build/esm/cc/SoundSwitchCC.d.ts +4 -123
- package/build/esm/cc/SoundSwitchCC.d.ts.map +1 -1
- package/build/esm/cc/SoundSwitchCC.js +7 -3
- package/build/esm/cc/SoundSwitchCC.js.map +1 -1
- package/build/esm/cc/SupervisionCC.d.ts +3 -31
- package/build/esm/cc/SupervisionCC.d.ts.map +1 -1
- package/build/esm/cc/SupervisionCC.js +9 -7
- package/build/esm/cc/SupervisionCC.js.map +1 -1
- package/build/esm/cc/ThermostatFanModeCC._validateArgs.d.ts.map +1 -1
- package/build/esm/cc/ThermostatFanModeCC._validateArgs.js.map +1 -1
- package/build/esm/cc/ThermostatFanModeCC.d.ts +4 -84
- package/build/esm/cc/ThermostatFanModeCC.d.ts.map +1 -1
- package/build/esm/cc/ThermostatFanModeCC.js +4 -5
- package/build/esm/cc/ThermostatFanModeCC.js.map +1 -1
- package/build/esm/cc/ThermostatFanStateCC.d.ts +4 -33
- package/build/esm/cc/ThermostatFanStateCC.d.ts.map +1 -1
- package/build/esm/cc/ThermostatFanStateCC.js +1 -2
- package/build/esm/cc/ThermostatFanStateCC.js.map +1 -1
- package/build/esm/cc/ThermostatModeCC._validateArgs.d.ts.map +1 -1
- package/build/esm/cc/ThermostatModeCC._validateArgs.js.map +1 -1
- package/build/esm/cc/ThermostatModeCC.d.ts +4 -84
- package/build/esm/cc/ThermostatModeCC.d.ts.map +1 -1
- package/build/esm/cc/ThermostatModeCC.js +2 -3
- package/build/esm/cc/ThermostatModeCC.js.map +1 -1
- package/build/esm/cc/ThermostatOperatingStateCC.d.ts +4 -33
- package/build/esm/cc/ThermostatOperatingStateCC.d.ts.map +1 -1
- package/build/esm/cc/ThermostatOperatingStateCC.js +1 -2
- package/build/esm/cc/ThermostatOperatingStateCC.js.map +1 -1
- package/build/esm/cc/ThermostatSetbackCC._validateArgs.d.ts.map +1 -1
- package/build/esm/cc/ThermostatSetbackCC._validateArgs.js.map +1 -1
- package/build/esm/cc/ThermostatSetbackCC.d.ts +1 -1
- package/build/esm/cc/ThermostatSetbackCC.d.ts.map +1 -1
- package/build/esm/cc/ThermostatSetbackCC.js.map +1 -1
- package/build/esm/cc/ThermostatSetpointCC._validateArgs.d.ts.map +1 -1
- package/build/esm/cc/ThermostatSetpointCC._validateArgs.js.map +1 -1
- package/build/esm/cc/ThermostatSetpointCC.d.ts +5 -90
- package/build/esm/cc/ThermostatSetpointCC.d.ts.map +1 -1
- package/build/esm/cc/ThermostatSetpointCC.js +1 -2
- package/build/esm/cc/ThermostatSetpointCC.js.map +1 -1
- package/build/esm/cc/TimeCC._validateArgs.d.ts.map +1 -1
- package/build/esm/cc/TimeCC._validateArgs.js.map +1 -1
- package/build/esm/cc/TimeCC.d.ts +2 -2
- package/build/esm/cc/TimeCC.d.ts.map +1 -1
- package/build/esm/cc/TimeCC.js.map +1 -1
- package/build/esm/cc/TimeParametersCC._validateArgs.d.ts.map +1 -1
- package/build/esm/cc/TimeParametersCC._validateArgs.js.map +1 -1
- package/build/esm/cc/TimeParametersCC.d.ts +4 -30
- package/build/esm/cc/TimeParametersCC.d.ts.map +1 -1
- package/build/esm/cc/TimeParametersCC.js +1 -2
- package/build/esm/cc/TimeParametersCC.js.map +1 -1
- package/build/esm/cc/TransportServiceCC.d.ts +1 -1
- package/build/esm/cc/TransportServiceCC.d.ts.map +1 -1
- package/build/esm/cc/TransportServiceCC.js +2 -2
- package/build/esm/cc/TransportServiceCC.js.map +1 -1
- package/build/esm/cc/UserCodeCC._validateArgs.d.ts.map +1 -1
- package/build/esm/cc/UserCodeCC._validateArgs.js.map +1 -1
- package/build/esm/cc/UserCodeCC.d.ts +4 -415
- package/build/esm/cc/UserCodeCC.d.ts.map +1 -1
- package/build/esm/cc/UserCodeCC.js +17 -18
- package/build/esm/cc/UserCodeCC.js.map +1 -1
- package/build/esm/cc/VersionCC._validateArgs.d.ts.map +1 -1
- package/build/esm/cc/VersionCC._validateArgs.js.map +1 -1
- package/build/esm/cc/VersionCC.d.ts +3 -367
- package/build/esm/cc/VersionCC.d.ts.map +1 -1
- package/build/esm/cc/VersionCC.js +1 -2
- package/build/esm/cc/VersionCC.js.map +1 -1
- package/build/esm/cc/WakeUpCC._validateArgs.d.ts.map +1 -1
- package/build/esm/cc/WakeUpCC._validateArgs.js.map +1 -1
- package/build/esm/cc/WakeUpCC.d.ts +4 -83
- package/build/esm/cc/WakeUpCC.d.ts.map +1 -1
- package/build/esm/cc/WakeUpCC.js +10 -3
- package/build/esm/cc/WakeUpCC.js.map +1 -1
- package/build/esm/cc/WindowCoveringCC._validateArgs.d.ts.map +1 -1
- package/build/esm/cc/WindowCoveringCC._validateArgs.js.map +1 -1
- package/build/esm/cc/WindowCoveringCC.d.ts +4 -207
- package/build/esm/cc/WindowCoveringCC.d.ts.map +1 -1
- package/build/esm/cc/WindowCoveringCC.js +6 -8
- package/build/esm/cc/WindowCoveringCC.js.map +1 -1
- package/build/esm/cc/ZWaveLongRangeCC.d.ts.map +1 -1
- package/build/esm/cc/ZWaveLongRangeCC.js.map +1 -1
- package/build/esm/cc/ZWavePlusCC._validateArgs.d.ts.map +1 -1
- package/build/esm/cc/ZWavePlusCC._validateArgs.js.map +1 -1
- package/build/esm/cc/ZWavePlusCC.d.ts +4 -129
- package/build/esm/cc/ZWavePlusCC.d.ts.map +1 -1
- package/build/esm/cc/ZWavePlusCC.js +0 -1
- package/build/esm/cc/ZWavePlusCC.js.map +1 -1
- package/build/esm/cc/ZWaveProtocolCC.d.ts +1 -1
- package/build/esm/cc/ZWaveProtocolCC.d.ts.map +1 -1
- package/build/esm/cc/ZWaveProtocolCC.js +4 -4
- package/build/esm/cc/ZWaveProtocolCC.js.map +1 -1
- package/build/esm/cc/_CCValues.generated.d.ts.map +1 -1
- package/build/esm/cc/_CCValues.generated.js.map +1 -1
- package/build/esm/cc/index.d.ts.map +1 -1
- package/build/esm/cc/index.js.map +1 -1
- package/build/esm/cc/manufacturerProprietary/Decorators.d.ts.map +1 -1
- package/build/esm/cc/manufacturerProprietary/Decorators.js.map +1 -1
- package/build/esm/cc/manufacturerProprietary/FibaroCC._validateArgs.d.ts.map +1 -1
- package/build/esm/cc/manufacturerProprietary/FibaroCC._validateArgs.js.map +1 -1
- package/build/esm/cc/manufacturerProprietary/FibaroCC.d.ts +1 -1
- package/build/esm/cc/manufacturerProprietary/FibaroCC.d.ts.map +1 -1
- package/build/esm/cc/manufacturerProprietary/FibaroCC.js.map +1 -1
- package/build/esm/index.d.ts.map +1 -1
- package/build/esm/index.js.map +1 -1
- package/build/esm/index_browser.d.ts.map +1 -1
- package/build/esm/index_browser.js.map +1 -1
- package/build/esm/index_safe.d.ts.map +1 -1
- package/build/esm/index_safe.js.map +1 -1
- package/build/esm/lib/API.d.ts +3 -135
- package/build/esm/lib/API.d.ts.map +1 -1
- package/build/esm/lib/API.js.map +1 -1
- package/build/esm/lib/CCValueUtils.d.ts.map +1 -1
- package/build/esm/lib/CCValueUtils.js.map +1 -1
- package/build/esm/lib/CommandClass.d.ts +1 -1
- package/build/esm/lib/CommandClass.d.ts.map +1 -1
- package/build/esm/lib/CommandClass.js.map +1 -1
- package/build/esm/lib/CommandClassDecorators.d.ts.map +1 -1
- package/build/esm/lib/CommandClassDecorators.js.map +1 -1
- package/build/esm/lib/EncapsulatingCommandClass.d.ts.map +1 -1
- package/build/esm/lib/EncapsulatingCommandClass.js.map +1 -1
- package/build/esm/lib/NotificationEventPayload.d.ts.map +1 -1
- package/build/esm/lib/NotificationEventPayload.js.map +1 -1
- package/build/esm/lib/Security2/Extension.d.ts.map +1 -1
- package/build/esm/lib/Security2/Extension.js.map +1 -1
- package/build/esm/lib/Security2/shared.d.ts.map +1 -1
- package/build/esm/lib/Security2/shared.js.map +1 -1
- package/build/esm/lib/SetValueResult.d.ts.map +1 -1
- package/build/esm/lib/SetValueResult.js.map +1 -1
- package/build/esm/lib/Values.d.ts.map +1 -1
- package/build/esm/lib/Values.js.map +1 -1
- package/build/esm/lib/_CCAPI.generated.d.ts +136 -0
- package/build/esm/lib/_CCAPI.generated.d.ts.map +1 -0
- package/build/esm/lib/_CCAPI.generated.js +4 -0
- package/build/esm/lib/_CCAPI.generated.js.map +1 -0
- package/build/esm/lib/_Types.d.ts.map +1 -1
- package/build/esm/lib/_Types.js.map +1 -1
- package/build/esm/lib/serializers.d.ts.map +1 -1
- package/build/esm/lib/serializers.js.map +1 -1
- package/build/esm/lib/traits.d.ts.map +1 -1
- package/build/esm/lib/traits.js.map +1 -1
- package/build/esm/lib/utils.d.ts.map +1 -1
- package/build/esm/lib/utils.js.map +1 -1
- package/package.json +11 -11
|
@@ -33,7 +33,6 @@ var import_shared = require("@zwave-js/shared");
|
|
|
33
33
|
var import_API = require("../lib/API.js");
|
|
34
34
|
var import_CommandClass = require("../lib/CommandClass.js");
|
|
35
35
|
var import_CommandClassDecorators = require("../lib/CommandClassDecorators.js");
|
|
36
|
-
var import_Values = require("../lib/Values.js");
|
|
37
36
|
var import_Types = require("../lib/_Types.js");
|
|
38
37
|
var import_NotificationCC = require("./NotificationCC.js");
|
|
39
38
|
var import_CCValues_generated = require("./_CCValues.generated.js");
|
|
@@ -208,18 +207,26 @@ let BatteryCC = (() => {
|
|
|
208
207
|
});
|
|
209
208
|
const batteryStatus = await api.get();
|
|
210
209
|
if (batteryStatus) {
|
|
211
|
-
let logMessage =
|
|
210
|
+
let logMessage = "received response for battery information:";
|
|
211
|
+
if (batteryStatus.disconnected) {
|
|
212
|
+
logMessage += `
|
|
213
|
+
is disconnected: true`;
|
|
214
|
+
} else {
|
|
215
|
+
logMessage += `
|
|
212
216
|
level: ${batteryStatus.level === 255 ? "low" : batteryStatus.level + " %"}`;
|
|
217
|
+
}
|
|
213
218
|
if (api.version >= 2) {
|
|
219
|
+
if (!batteryStatus.disconnected) {
|
|
220
|
+
logMessage += `
|
|
221
|
+
status: ${import_Types.BatteryChargingStatus[batteryStatus.chargingStatus]}`;
|
|
222
|
+
}
|
|
214
223
|
logMessage += `
|
|
215
|
-
status: ${import_Types.BatteryChargingStatus[batteryStatus.chargingStatus]}
|
|
216
224
|
rechargeable: ${batteryStatus.rechargeable}
|
|
217
225
|
is backup: ${batteryStatus.backup}
|
|
218
226
|
is overheating: ${batteryStatus.overheating}
|
|
219
227
|
fluid is low: ${batteryStatus.lowFluid}
|
|
220
228
|
needs to be replaced or charged: ${import_Types.BatteryReplacementStatus[batteryStatus.rechargeOrReplace]}
|
|
221
|
-
is low temperature ${batteryStatus.lowTemperatureStatus}
|
|
222
|
-
is disconnected: ${batteryStatus.disconnected}`;
|
|
229
|
+
is low temperature ${batteryStatus.lowTemperatureStatus}`;
|
|
223
230
|
}
|
|
224
231
|
ctx.logNode(node.id, {
|
|
225
232
|
endpoint: this.endpointIndex,
|
|
@@ -326,14 +333,25 @@ let BatteryCCReport = (() => {
|
|
|
326
333
|
});
|
|
327
334
|
}
|
|
328
335
|
persistValues(ctx) {
|
|
329
|
-
if (this.
|
|
336
|
+
if (this.disconnected) {
|
|
337
|
+
const savedLevel = this.level;
|
|
338
|
+
const savedChargingStatus = this.chargingStatus;
|
|
339
|
+
this.level = void 0;
|
|
340
|
+
this.chargingStatus = void 0;
|
|
341
|
+
const ret = super.persistValues(ctx);
|
|
342
|
+
this.level = savedLevel;
|
|
343
|
+
this.chargingStatus = savedChargingStatus;
|
|
344
|
+
this.removeValue(ctx, import_CCValues_generated.BatteryCCValues.level);
|
|
345
|
+
this.removeValue(ctx, import_CCValues_generated.BatteryCCValues.chargingStatus);
|
|
346
|
+
return ret;
|
|
347
|
+
} else if (this.level === 255) {
|
|
330
348
|
this.level = void 0;
|
|
349
|
+
const ret = super.persistValues(ctx);
|
|
350
|
+
this.level = 255;
|
|
351
|
+
return ret;
|
|
331
352
|
}
|
|
332
353
|
if (!super.persistValues(ctx))
|
|
333
354
|
return false;
|
|
334
|
-
if (this.level === void 0) {
|
|
335
|
-
this.level = 255;
|
|
336
|
-
}
|
|
337
355
|
if (this.level >= 90) {
|
|
338
356
|
const notificationCCVersion = ctx.getSupportedCCVersion(import_core.CommandClasses.Notification, this.nodeId, this.endpointIndex);
|
|
339
357
|
if (
|
|
@@ -358,7 +376,9 @@ let BatteryCCReport = (() => {
|
|
|
358
376
|
disconnected;
|
|
359
377
|
lowTemperatureStatus;
|
|
360
378
|
serialize(ctx) {
|
|
361
|
-
this.payload = import_shared.Bytes.from([
|
|
379
|
+
this.payload = import_shared.Bytes.from([
|
|
380
|
+
this.disconnected ? 0 : this.level
|
|
381
|
+
]);
|
|
362
382
|
if (this.chargingStatus != void 0) {
|
|
363
383
|
this.payload = import_shared.Bytes.concat([
|
|
364
384
|
this.payload,
|
|
@@ -371,8 +391,15 @@ let BatteryCCReport = (() => {
|
|
|
371
391
|
return super.serialize(ctx);
|
|
372
392
|
}
|
|
373
393
|
toLogEntry(ctx) {
|
|
374
|
-
const message =
|
|
375
|
-
if (this.
|
|
394
|
+
const message = {};
|
|
395
|
+
if (this.disconnected) {
|
|
396
|
+
message.disconnected = true;
|
|
397
|
+
} else if (this.level === 255) {
|
|
398
|
+
message["is low"] = true;
|
|
399
|
+
} else {
|
|
400
|
+
message.level = this.level;
|
|
401
|
+
}
|
|
402
|
+
if (!this.disconnected && this.chargingStatus != void 0) {
|
|
376
403
|
message["charging status"] = (0, import_shared.getEnumMemberName)(import_Types.BatteryChargingStatus, this.chargingStatus);
|
|
377
404
|
}
|
|
378
405
|
if (this.rechargeable != void 0) {
|
|
@@ -393,9 +420,6 @@ let BatteryCCReport = (() => {
|
|
|
393
420
|
if (this.lowTemperatureStatus != void 0) {
|
|
394
421
|
message.lowTemperatureStatus = this.lowTemperatureStatus;
|
|
395
422
|
}
|
|
396
|
-
if (this.disconnected != void 0) {
|
|
397
|
-
message.disconnected = this.disconnected;
|
|
398
|
-
}
|
|
399
423
|
return {
|
|
400
424
|
...super.toLogEntry(ctx),
|
|
401
425
|
message
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
|
-
"sources": ["../../../
|
|
4
|
-
"sourcesContent": ["import type { CCEncodingContext, CCParsingContext } from \"@zwave-js/cc\";\nimport type { GetDeviceConfig } from \"@zwave-js/config\";\nimport {\n\tCommandClasses,\n\ttype ControlsCC,\n\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 SinglecastCC,\n\ttype SupportsCC,\n\tValueMetadata,\n\ttype WithAddress,\n\tencodeFloatWithScale,\n\tenumValuesToMetadataStates,\n\tparseFloatWithScale,\n\ttimespan,\n\tvalidatePayload,\n} from \"@zwave-js/core\";\nimport {\n\ttype AllOrNone,\n\tBytes,\n\tgetEnumMemberName,\n\tpick,\n} from \"@zwave-js/shared\";\nimport {\n\tCCAPI,\n\tPOLL_VALUE,\n\tPhysicalCCAPI,\n\ttype PollValueImplementation,\n\tthrowUnsupportedProperty,\n} from \"../lib/API.js\";\nimport {\n\ttype CCRaw,\n\tCommandClass,\n\ttype InterviewContext,\n\ttype PersistValuesContext,\n\ttype RefreshValuesContext,\n} from \"../lib/CommandClass.js\";\nimport {\n\tAPI,\n\tCCCommand,\n\tccValueProperty,\n\tccValues,\n\tcommandClass,\n\texpectedCCResponse,\n\timplementedVersion,\n} from \"../lib/CommandClassDecorators.js\";\nimport { V } from \"../lib/Values.js\";\nimport {\n\tBatteryChargingStatus,\n\tBatteryCommand,\n\tBatteryReplacementStatus,\n} from \"../lib/_Types.js\";\nimport { NotificationCCValues } from \"./NotificationCC.js\";\n\nexport const BatteryCCValues = V.defineCCValues(CommandClasses.Battery, {\n\t...V.staticProperty(\n\t\t\"level\",\n\t\t{\n\t\t\t...ValueMetadata.ReadOnlyUInt8,\n\t\t\tmax: 100,\n\t\t\tunit: \"%\",\n\t\t\tlabel: \"Battery level\",\n\t\t} as const,\n\t),\n\n\t...V.staticProperty(\n\t\t\"maximumCapacity\",\n\t\t{\n\t\t\t...ValueMetadata.ReadOnlyUInt8,\n\t\t\tmax: 100,\n\t\t\tunit: \"%\",\n\t\t\tlabel: \"Maximum capacity\",\n\t\t} as const,\n\t\t{\n\t\t\tminVersion: 2,\n\t\t} as const,\n\t),\n\n\t...V.staticProperty(\n\t\t\"temperature\",\n\t\t{\n\t\t\t...ValueMetadata.ReadOnlyInt8,\n\t\t\tlabel: \"Temperature\",\n\t\t\t// For now, only \u00B0C is specified as a valid unit\n\t\t\t// If this ever changes, update the unit in persistValues on the fly\n\t\t\tunit: \"\u00B0C\",\n\t\t} as const,\n\t\t{\n\t\t\tminVersion: 2,\n\t\t} as const,\n\t),\n\n\t...V.staticProperty(\n\t\t\"chargingStatus\",\n\t\t{\n\t\t\t...ValueMetadata.ReadOnlyUInt8,\n\t\t\tlabel: \"Charging status\",\n\t\t\tstates: enumValuesToMetadataStates(BatteryChargingStatus),\n\t\t} as const,\n\t\t{\n\t\t\tminVersion: 2,\n\t\t} as const,\n\t),\n\n\t...V.staticProperty(\n\t\t\"rechargeable\",\n\t\t{\n\t\t\t...ValueMetadata.ReadOnlyBoolean,\n\t\t\tlabel: \"Rechargeable\",\n\t\t} as const,\n\t\t{\n\t\t\tminVersion: 2,\n\t\t} as const,\n\t),\n\n\t...V.staticProperty(\n\t\t\"backup\",\n\t\t{\n\t\t\t...ValueMetadata.ReadOnlyBoolean,\n\t\t\tlabel: \"Used as backup\",\n\t\t} as const,\n\t\t{\n\t\t\tminVersion: 2,\n\t\t} as const,\n\t),\n\n\t...V.staticProperty(\n\t\t\"overheating\",\n\t\t{\n\t\t\t...ValueMetadata.ReadOnlyBoolean,\n\t\t\tlabel: \"Overheating\",\n\t\t} as const,\n\t\t{\n\t\t\tminVersion: 2,\n\t\t} as const,\n\t),\n\n\t...V.staticProperty(\n\t\t\"lowFluid\",\n\t\t{\n\t\t\t...ValueMetadata.ReadOnlyBoolean,\n\t\t\tlabel: \"Fluid is low\",\n\t\t} as const,\n\t\t{\n\t\t\tminVersion: 2,\n\t\t} as const,\n\t),\n\n\t...V.staticProperty(\n\t\t\"rechargeOrReplace\",\n\t\t{\n\t\t\t...ValueMetadata.ReadOnlyUInt8,\n\t\t\tlabel: \"Recharge or replace\",\n\t\t\tstates: enumValuesToMetadataStates(BatteryReplacementStatus),\n\t\t} as const,\n\t\t{\n\t\t\tminVersion: 2,\n\t\t} as const,\n\t),\n\n\t...V.staticProperty(\n\t\t\"disconnected\",\n\t\t{\n\t\t\t...ValueMetadata.ReadOnlyBoolean,\n\t\t\tlabel: \"Battery is disconnected\",\n\t\t} as const,\n\t\t{\n\t\t\tminVersion: 2,\n\t\t} as const,\n\t),\n\n\t...V.staticProperty(\n\t\t\"lowTemperatureStatus\",\n\t\t{\n\t\t\t...ValueMetadata.ReadOnlyBoolean,\n\t\t\tlabel: \"Battery temperature is low\",\n\t\t} as const,\n\t\t{\n\t\t\tminVersion: 3,\n\t\t} as const,\n\t),\n});\n\n// @noSetValueAPI This CC is read-only\n\n@API(CommandClasses.Battery)\nexport class BatteryCCAPI extends PhysicalCCAPI {\n\tpublic supportsCommand(cmd: BatteryCommand): MaybeNotKnown<boolean> {\n\t\tswitch (cmd) {\n\t\t\tcase BatteryCommand.Get:\n\t\t\t\treturn true; // This is mandatory\n\t\t\tcase BatteryCommand.HealthGet:\n\t\t\t\treturn this.version >= 2;\n\t\t}\n\t\treturn super.supportsCommand(cmd);\n\t}\n\n\tprotected get [POLL_VALUE](): PollValueImplementation {\n\t\treturn async function(this: BatteryCCAPI, { property }) {\n\t\t\tswitch (property) {\n\t\t\t\tcase \"level\":\n\t\t\t\tcase \"chargingStatus\":\n\t\t\t\tcase \"rechargeable\":\n\t\t\t\tcase \"backup\":\n\t\t\t\tcase \"overheating\":\n\t\t\t\tcase \"lowFluid\":\n\t\t\t\tcase \"rechargeOrReplace\":\n\t\t\t\tcase \"lowTemperatureStatus\":\n\t\t\t\tcase \"disconnected\":\n\t\t\t\t\treturn (await this.get())?.[property];\n\n\t\t\t\tcase \"maximumCapacity\":\n\t\t\t\tcase \"temperature\":\n\t\t\t\t\treturn (await this.getHealth())?.[property];\n\n\t\t\t\tdefault:\n\t\t\t\t\tthrowUnsupportedProperty(this.ccId, property);\n\t\t\t}\n\t\t};\n\t}\n\n\t// oxlint-disable-next-line typescript/explicit-module-boundary-types\n\tpublic async get() {\n\t\tthis.assertSupportsCommand(BatteryCommand, BatteryCommand.Get);\n\n\t\tconst cc = new BatteryCCGet({\n\t\t\tnodeId: this.endpoint.nodeId,\n\t\t\tendpointIndex: this.endpoint.index,\n\t\t});\n\t\tconst response = await this.host.sendCommand<BatteryCCReport>(\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\"level\",\n\t\t\t\t\"chargingStatus\",\n\t\t\t\t\"rechargeable\",\n\t\t\t\t\"backup\",\n\t\t\t\t\"overheating\",\n\t\t\t\t\"lowFluid\",\n\t\t\t\t\"rechargeOrReplace\",\n\t\t\t\t\"lowTemperatureStatus\",\n\t\t\t\t\"disconnected\",\n\t\t\t]);\n\t\t}\n\t}\n\n\t// oxlint-disable-next-line typescript/explicit-module-boundary-types\n\tpublic async getHealth() {\n\t\tthis.assertSupportsCommand(BatteryCommand, BatteryCommand.HealthGet);\n\n\t\tconst cc = new BatteryCCHealthGet({\n\t\t\tnodeId: this.endpoint.nodeId,\n\t\t\tendpointIndex: this.endpoint.index,\n\t\t});\n\t\tconst response = await this.host.sendCommand<BatteryCCHealthReport>(\n\t\t\tcc,\n\t\t\tthis.commandOptions,\n\t\t);\n\t\tif (response) {\n\t\t\treturn pick(response, [\"maximumCapacity\", \"temperature\"]);\n\t\t}\n\t}\n}\n\n@commandClass(CommandClasses.Battery)\n@implementedVersion(3)\n@ccValues(BatteryCCValues)\nexport class BatteryCC extends CommandClass {\n\tdeclare ccCommand: BatteryCommand;\n\n\tpublic async interview(\n\t\tctx: InterviewContext,\n\t): Promise<void> {\n\t\tconst node = this.getNode(ctx)!;\n\n\t\tctx.logNode(node.id, {\n\t\t\tendpoint: this.endpointIndex,\n\t\t\tmessage: `Interviewing ${this.ccName}...`,\n\t\t\tdirection: \"none\",\n\t\t});\n\n\t\t// Query the Battery status\n\t\tawait this.refreshValues(ctx);\n\n\t\t// Remember that the interview is complete\n\t\tthis.setInterviewComplete(ctx, true);\n\t}\n\n\tpublic async refreshValues(\n\t\tctx: RefreshValuesContext,\n\t): Promise<void> {\n\t\tconst node = this.getNode(ctx)!;\n\t\tconst endpoint = this.getEndpoint(ctx)!;\n\t\tconst api = CCAPI.create(\n\t\t\tCommandClasses.Battery,\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: \"querying battery status...\",\n\t\t\tdirection: \"outbound\",\n\t\t});\n\n\t\tconst batteryStatus = await api.get();\n\t\tif (batteryStatus) {\n\t\t\tlet logMessage = `received response for battery information:\nlevel: ${\n\t\t\t\tbatteryStatus.level === 0xff\n\t\t\t\t\t? \"low\"\n\t\t\t\t\t: (batteryStatus.level + \" %\")\n\t\t\t}`;\n\t\t\tif (api.version >= 2) {\n\t\t\t\tlogMessage += `\nstatus: ${\n\t\t\t\t\tBatteryChargingStatus[batteryStatus.chargingStatus!]\n\t\t\t\t}\nrechargeable: ${batteryStatus.rechargeable}\nis backup: ${batteryStatus.backup}\nis overheating: ${batteryStatus.overheating}\nfluid is low: ${batteryStatus.lowFluid}\nneeds to be replaced or charged: ${\n\t\t\t\t\tBatteryReplacementStatus[batteryStatus.rechargeOrReplace!]\n\t\t\t\t}\nis low temperature ${batteryStatus.lowTemperatureStatus}\nis disconnected: ${batteryStatus.disconnected}`;\n\t\t\t}\n\t\t\tctx.logNode(node.id, {\n\t\t\t\tendpoint: this.endpointIndex,\n\t\t\t\tmessage: logMessage,\n\t\t\t\tdirection: \"inbound\",\n\t\t\t});\n\t\t}\n\n\t\tif (api.version >= 2) {\n\t\t\t// always query the health\n\t\t\tctx.logNode(node.id, {\n\t\t\t\tendpoint: this.endpointIndex,\n\t\t\t\tmessage: \"querying battery health...\",\n\t\t\t\tdirection: \"outbound\",\n\t\t\t});\n\n\t\t\tconst batteryHealth = await api.getHealth();\n\t\t\tif (batteryHealth) {\n\t\t\t\tconst logMessage = `received response for battery health:\nmax. capacity: ${batteryHealth.maximumCapacity} %\ntemperature: ${batteryHealth.temperature} \u00B0C`;\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\t\t\t}\n\t\t}\n\t}\n\n\tpublic shouldRefreshValues(\n\t\tthis: SinglecastCC<this>,\n\t\tctx:\n\t\t\t& GetValueDB\n\t\t\t& GetSupportedCCVersion\n\t\t\t& GetDeviceConfig\n\t\t\t& GetNode<\n\t\t\t\tNodeId & GetEndpoint<EndpointId & SupportsCC & ControlsCC>\n\t\t\t>,\n\t): boolean {\n\t\t// Check when the battery state was last updated\n\t\tconst valueDB = ctx.tryGetValueDB(this.nodeId);\n\t\tif (!valueDB) return true;\n\n\t\tconst lastUpdated = valueDB.getTimestamp(\n\t\t\tBatteryCCValues.level.endpoint(this.endpointIndex),\n\t\t);\n\t\treturn (\n\t\t\tlastUpdated == undefined\n\t\t\t// The specs say once per month, but that's a bit too unfrequent IMO\n\t\t\t// Also the maximum that setInterval supports is ~24.85 days\n\t\t\t|| Date.now() - lastUpdated > timespan.days(7)\n\t\t);\n\t}\n}\n\n// @publicAPI\nexport type BatteryCCReportOptions =\n\t& {\n\t\tlevel: number | \"low\";\n\t}\n\t& AllOrNone<{\n\t\t// V2+\n\t\tchargingStatus: BatteryChargingStatus;\n\t\trechargeable: boolean;\n\t\tbackup: boolean;\n\t\toverheating: boolean;\n\t\tlowFluid: boolean;\n\t\trechargeOrReplace: BatteryReplacementStatus;\n\t\tdisconnected: boolean;\n\t}>\n\t& AllOrNone<{\n\t\t// V3+\n\t\tlowTemperatureStatus: boolean;\n\t}>;\n\n@CCCommand(BatteryCommand.Report)\n@ccValueProperty(\"level\", BatteryCCValues.level)\n@ccValueProperty(\"chargingStatus\", BatteryCCValues.chargingStatus)\n@ccValueProperty(\"rechargeable\", BatteryCCValues.rechargeable)\n@ccValueProperty(\"backup\", BatteryCCValues.backup)\n@ccValueProperty(\"overheating\", BatteryCCValues.overheating)\n@ccValueProperty(\"lowFluid\", BatteryCCValues.lowFluid)\n@ccValueProperty(\"rechargeOrReplace\", BatteryCCValues.rechargeOrReplace)\n@ccValueProperty(\"disconnected\", BatteryCCValues.disconnected)\n@ccValueProperty(\"lowTemperatureStatus\", BatteryCCValues.lowTemperatureStatus)\nexport class BatteryCCReport extends BatteryCC {\n\tpublic constructor(\n\t\toptions: WithAddress<BatteryCCReportOptions>,\n\t) {\n\t\tsuper(options);\n\n\t\tthis.level = typeof options.level === \"number\" ? options.level : 0xff;\n\t\tthis.chargingStatus = options.chargingStatus;\n\t\tthis.rechargeable = options.rechargeable;\n\t\tthis.backup = options.backup;\n\t\tthis.overheating = options.overheating;\n\t\tthis.lowFluid = options.lowFluid;\n\t\tthis.rechargeOrReplace = options.rechargeOrReplace;\n\t\tthis.disconnected = options.disconnected;\n\t\tthis.lowTemperatureStatus = options.lowTemperatureStatus;\n\t}\n\n\tpublic static from(raw: CCRaw, ctx: CCParsingContext): BatteryCCReport {\n\t\tlet ccOptions: BatteryCCReportOptions;\n\n\t\tvalidatePayload(raw.payload.length >= 1);\n\t\tconst level = raw.payload[0];\n\t\tvalidatePayload.withReason(`Invalid battery level ${level}`)(\n\t\t\t// This field MUST be in the range 0x00..0x64 or set to 0xFF\n\t\t\tlevel <= 100 || level === 0xff,\n\t\t);\n\n\t\tccOptions = {\n\t\t\tlevel,\n\t\t};\n\n\t\tif (raw.payload.length >= 3) {\n\t\t\t// Starting with V2\n\t\t\tconst chargingStatus: BatteryChargingStatus = raw.payload[1] >>> 6;\n\t\t\tconst rechargeable = !!(raw.payload[1] & 0b0010_0000);\n\t\t\tconst backup = !!(raw.payload[1] & 0b0001_0000);\n\t\t\tconst overheating = !!(raw.payload[1] & 0b1000);\n\t\t\tconst lowFluid = !!(raw.payload[1] & 0b0100);\n\t\t\tconst rechargeOrReplace: BatteryReplacementStatus =\n\t\t\t\t!!(raw.payload[1] & 0b10)\n\t\t\t\t\t? BatteryReplacementStatus.Now\n\t\t\t\t\t: !!(raw.payload[1] & 0b1)\n\t\t\t\t\t? BatteryReplacementStatus.Soon\n\t\t\t\t\t: BatteryReplacementStatus.No;\n\t\t\tconst lowTemperatureStatus = !!(raw.payload[2] & 0b10);\n\t\t\tconst disconnected = !!(raw.payload[2] & 0b1);\n\n\t\t\tccOptions = {\n\t\t\t\t...ccOptions,\n\t\t\t\tchargingStatus,\n\t\t\t\trechargeable,\n\t\t\t\tbackup,\n\t\t\t\toverheating,\n\t\t\t\tlowFluid,\n\t\t\t\trechargeOrReplace,\n\t\t\t\tlowTemperatureStatus,\n\t\t\t\tdisconnected,\n\t\t\t};\n\t\t}\n\n\t\treturn new this({\n\t\t\tnodeId: ctx.sourceNodeId,\n\t\t\t...ccOptions,\n\t\t});\n\t}\n\n\tpublic persistValues(ctx: PersistValuesContext): boolean {\n\t\t// This is a bit hacky, but we need to avoid persisting 0xff as the battery level\n\t\t// because the report is meant as a notification in that case.\n\t\tif (this.level === 0xff) {\n\t\t\t// @ts-expect-error\n\t\t\tthis.level = undefined;\n\t\t}\n\n\t\tif (!super.persistValues(ctx)) return false;\n\n\t\tif (this.level === undefined) {\n\t\t\t// @ts-expect-error\n\t\t\tthis.level = 0xff;\n\t\t}\n\n\t\t// Na\u00EFve heuristic for a full battery\n\t\tif (this.level >= 90) {\n\t\t\t// Some devices send Notification CC Reports with battery information,\n\t\t\t// or this information is mapped from legacy V1 alarm values.\n\t\t\t// We may need to idle the corresponding values when the battery is full\n\t\t\tconst notificationCCVersion = ctx.getSupportedCCVersion(\n\t\t\t\tCommandClasses.Notification,\n\t\t\t\tthis.nodeId as number,\n\t\t\t\tthis.endpointIndex,\n\t\t\t);\n\t\t\tif (\n\t\t\t\t// supported\n\t\t\t\tnotificationCCVersion > 0\n\t\t\t\t// but idling is not required\n\t\t\t\t&& notificationCCVersion < 8\n\t\t\t) {\n\t\t\t\tconst batteryLevelStatusValue = NotificationCCValues\n\t\t\t\t\t.notificationVariable(\n\t\t\t\t\t\t\"Power Management\",\n\t\t\t\t\t\t\"Battery level status\",\n\t\t\t\t\t);\n\t\t\t\t// If not undefined and not idle\n\t\t\t\tif (this.getValue(ctx, batteryLevelStatusValue)) {\n\t\t\t\t\tthis.setValue(\n\t\t\t\t\t\tctx,\n\t\t\t\t\t\tbatteryLevelStatusValue,\n\t\t\t\t\t\t0, /* idle */\n\t\t\t\t\t);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\treturn true;\n\t}\n\n\tpublic readonly level: number;\n\n\tpublic readonly chargingStatus: BatteryChargingStatus | undefined;\n\n\tpublic readonly rechargeable: boolean | undefined;\n\n\tpublic readonly backup: boolean | undefined;\n\n\tpublic readonly overheating: boolean | undefined;\n\n\tpublic readonly lowFluid: boolean | undefined;\n\n\tpublic readonly rechargeOrReplace: BatteryReplacementStatus | undefined;\n\n\tpublic readonly disconnected: boolean | undefined;\n\n\tpublic readonly lowTemperatureStatus: boolean | undefined;\n\n\tpublic serialize(ctx: CCEncodingContext): Promise<Bytes> {\n\t\tthis.payload = Bytes.from([this.level]);\n\t\tif (this.chargingStatus != undefined) {\n\t\t\tthis.payload = Bytes.concat([\n\t\t\t\tthis.payload,\n\t\t\t\t[\n\t\t\t\t\t(this.chargingStatus << 6)\n\t\t\t\t\t+ (this.rechargeable ? 0b0010_0000 : 0)\n\t\t\t\t\t+ (this.backup ? 0b0001_0000 : 0)\n\t\t\t\t\t+ (this.overheating ? 0b1000 : 0)\n\t\t\t\t\t+ (this.lowFluid ? 0b0100 : 0)\n\t\t\t\t\t+ (this.rechargeOrReplace === BatteryReplacementStatus.Now\n\t\t\t\t\t\t? 0b10\n\t\t\t\t\t\t: this.rechargeOrReplace\n\t\t\t\t\t\t\t\t=== BatteryReplacementStatus.Soon\n\t\t\t\t\t\t? 0b1\n\t\t\t\t\t\t: 0),\n\t\t\t\t\t(this.lowTemperatureStatus ? 0b10 : 0)\n\t\t\t\t\t+ (this.disconnected ? 0b1 : 0),\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 = this.level === 0xff\n\t\t\t? { \"is low\": true }\n\t\t\t: { level: this.level };\n\n\t\tif (this.chargingStatus != undefined) {\n\t\t\tmessage[\"charging status\"] = getEnumMemberName(\n\t\t\t\tBatteryChargingStatus,\n\t\t\t\tthis.chargingStatus,\n\t\t\t);\n\t\t}\n\t\tif (this.rechargeable != undefined) {\n\t\t\tmessage.rechargeable = this.rechargeable;\n\t\t}\n\t\tif (this.backup != undefined) {\n\t\t\tmessage.backup = this.backup;\n\t\t}\n\t\tif (this.overheating != undefined) {\n\t\t\tmessage.overheating = this.overheating;\n\t\t}\n\t\tif (this.lowFluid != undefined) {\n\t\t\tmessage[\"low fluid\"] = this.lowFluid;\n\t\t}\n\t\tif (this.rechargeOrReplace != undefined) {\n\t\t\tmessage[\"recharge or replace\"] = getEnumMemberName(\n\t\t\t\tBatteryReplacementStatus,\n\t\t\t\tthis.rechargeOrReplace,\n\t\t\t);\n\t\t}\n\t\tif (this.lowTemperatureStatus != undefined) {\n\t\t\tmessage.lowTemperatureStatus = this.lowTemperatureStatus;\n\t\t}\n\t\tif (this.disconnected != undefined) {\n\t\t\tmessage.disconnected = this.disconnected;\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(BatteryCommand.Get)\n@expectedCCResponse(BatteryCCReport)\nexport class BatteryCCGet extends BatteryCC {}\n\n// @publicAPI\nexport interface BatteryCCHealthReportOptions {\n\tmaximumCapacity?: number;\n\ttemperature?: number;\n\ttemperatureScale?: number;\n}\n\n@CCCommand(BatteryCommand.HealthReport)\n@ccValueProperty(\"maximumCapacity\", BatteryCCValues.maximumCapacity)\n@ccValueProperty(\"temperature\", BatteryCCValues.temperature)\nexport class BatteryCCHealthReport extends BatteryCC {\n\tpublic constructor(\n\t\toptions: WithAddress<BatteryCCHealthReportOptions>,\n\t) {\n\t\tsuper(options);\n\n\t\t// TODO: Check implementation:\n\t\tthis.maximumCapacity = options.maximumCapacity;\n\t\tthis.temperature = options.temperature;\n\t\tthis.temperatureScale = options.temperatureScale;\n\t}\n\n\tpublic static from(\n\t\traw: CCRaw,\n\t\tctx: CCParsingContext,\n\t): BatteryCCHealthReport {\n\t\tvalidatePayload(raw.payload.length >= 2);\n\t\t// Parse maximum capacity. 0xff means unknown\n\t\tlet maximumCapacity: number | undefined = raw.payload[0];\n\t\tif (maximumCapacity === 0xff) maximumCapacity = undefined;\n\t\tconst {\n\t\t\tvalue: temperature,\n\t\t\tscale: temperatureScale,\n\t\t} = parseFloatWithScale(\n\t\t\traw.payload.subarray(1),\n\t\t\ttrue, // The temperature field may be omitted\n\t\t);\n\n\t\treturn new this({\n\t\t\tnodeId: ctx.sourceNodeId,\n\t\t\tmaximumCapacity,\n\t\t\ttemperature,\n\t\t\ttemperatureScale,\n\t\t});\n\t}\n\n\tpublic readonly maximumCapacity: number | undefined;\n\tpublic readonly temperature: number | undefined;\n\tprivate readonly temperatureScale: number | undefined;\n\n\tpublic serialize(ctx: CCEncodingContext): Promise<Bytes> {\n\t\tconst temperature = this.temperature != undefined\n\t\t\t? encodeFloatWithScale(\n\t\t\t\tthis.temperature,\n\t\t\t\tthis.temperatureScale ?? 0x00,\n\t\t\t)\n\t\t\t// size, precision and scale must be 0 if the temperature is omitted\n\t\t\t: Bytes.from([0x00]);\n\n\t\tthis.payload = Bytes.concat([\n\t\t\t[this.maximumCapacity ?? 0xff],\n\t\t\ttemperature,\n\t\t]);\n\t\treturn super.serialize(ctx);\n\t}\n\n\tpublic toLogEntry(ctx?: GetValueDB): MessageOrCCLogEntry {\n\t\treturn {\n\t\t\t...super.toLogEntry(ctx),\n\t\t\tmessage: {\n\t\t\t\ttemperature: this.temperature != undefined\n\t\t\t\t\t? this.temperature\n\t\t\t\t\t: \"unknown\",\n\t\t\t\t\"max capacity\": this.maximumCapacity != undefined\n\t\t\t\t\t? `${this.maximumCapacity} %`\n\t\t\t\t\t: \"unknown\",\n\t\t\t},\n\t\t};\n\t}\n}\n\n@CCCommand(BatteryCommand.HealthGet)\n@expectedCCResponse(BatteryCCHealthReport)\nexport class BatteryCCHealthGet extends BatteryCC {}\n"],
|
|
5
|
-
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
|
3
|
+
"sources": ["../../../src_gen/cc/BatteryCC.ts"],
|
|
4
|
+
"sourcesContent": ["import type { GetDeviceConfig } from \"@zwave-js/config\";\nimport { CommandClasses, type ControlsCC, type EndpointId, type GetEndpoint, type GetNode, type GetSupportedCCVersion, type GetValueDB, type MaybeNotKnown, type MessageOrCCLogEntry, MessagePriority, type MessageRecord, type NodeId, type SinglecastCC, type SupportsCC, ValueMetadata, type WithAddress, encodeFloatWithScale, enumValuesToMetadataStates, parseFloatWithScale, timespan, validatePayload, } from \"@zwave-js/core\";\nimport { type AllOrNone, Bytes, getEnumMemberName, pick, } from \"@zwave-js/shared\";\nimport { CCAPI, POLL_VALUE, PhysicalCCAPI, type PollValueImplementation, throwUnsupportedProperty, } from \"../lib/API.js\";\nimport { type CCRaw, CommandClass, type InterviewContext, type PersistValuesContext, type RefreshValuesContext, } from \"../lib/CommandClass.js\";\nimport { API, CCCommand, ccValueProperty, ccValues, commandClass, expectedCCResponse, implementedVersion, } from \"../lib/CommandClassDecorators.js\";\nimport { V } from \"../lib/Values.js\";\nimport { BatteryChargingStatus, BatteryCommand, BatteryReplacementStatus, } from \"../lib/_Types.js\";\nimport type { CCEncodingContext, CCParsingContext } from \"../lib/traits.js\";\nimport { NotificationCCValues } from \"./NotificationCC.js\";\nimport { BatteryCCValues } from \"./_CCValues.generated.js\";\nexport { BatteryCCValues };\n// @noSetValueAPI This CC is read-only\n@API(CommandClasses.Battery)\nexport class BatteryCCAPI extends PhysicalCCAPI {\n public supportsCommand(cmd: BatteryCommand): MaybeNotKnown<boolean> {\n switch (cmd) {\n case BatteryCommand.Get:\n return true; // This is mandatory\n case BatteryCommand.HealthGet:\n return this.version >= 2;\n }\n return super.supportsCommand(cmd);\n }\n protected get [POLL_VALUE](): PollValueImplementation {\n return async function (this: BatteryCCAPI, { property }) {\n switch (property) {\n case \"level\":\n case \"chargingStatus\":\n case \"rechargeable\":\n case \"backup\":\n case \"overheating\":\n case \"lowFluid\":\n case \"rechargeOrReplace\":\n case \"lowTemperatureStatus\":\n case \"disconnected\":\n return (await this.get())?.[property];\n case \"maximumCapacity\":\n case \"temperature\":\n return (await this.getHealth())?.[property];\n default:\n throwUnsupportedProperty(this.ccId, property);\n }\n };\n }\n // oxlint-disable-next-line typescript/explicit-module-boundary-types\n public async get() {\n this.assertSupportsCommand(BatteryCommand, BatteryCommand.Get);\n const cc = new BatteryCCGet({\n nodeId: this.endpoint.nodeId,\n endpointIndex: this.endpoint.index,\n });\n const response = await this.host.sendCommand<BatteryCCReport>(cc, this.commandOptions);\n if (response) {\n return pick(response, [\n \"level\",\n \"chargingStatus\",\n \"rechargeable\",\n \"backup\",\n \"overheating\",\n \"lowFluid\",\n \"rechargeOrReplace\",\n \"lowTemperatureStatus\",\n \"disconnected\",\n ]);\n }\n }\n // oxlint-disable-next-line typescript/explicit-module-boundary-types\n public async getHealth() {\n this.assertSupportsCommand(BatteryCommand, BatteryCommand.HealthGet);\n const cc = new BatteryCCHealthGet({\n nodeId: this.endpoint.nodeId,\n endpointIndex: this.endpoint.index,\n });\n const response = await this.host.sendCommand<BatteryCCHealthReport>(cc, this.commandOptions);\n if (response) {\n return pick(response, [\"maximumCapacity\", \"temperature\"]);\n }\n }\n}\n@commandClass(CommandClasses.Battery)\n@implementedVersion(3)\n@ccValues(BatteryCCValues)\nexport class BatteryCC extends CommandClass {\n declare ccCommand: BatteryCommand;\n public async interview(ctx: InterviewContext): Promise<void> {\n const node = this.getNode(ctx)!;\n ctx.logNode(node.id, {\n endpoint: this.endpointIndex,\n message: `Interviewing ${this.ccName}...`,\n direction: \"none\",\n });\n // Query the Battery status\n await this.refreshValues(ctx);\n // Remember that the interview is complete\n this.setInterviewComplete(ctx, true);\n }\n public async refreshValues(ctx: RefreshValuesContext): Promise<void> {\n const node = this.getNode(ctx)!;\n const endpoint = this.getEndpoint(ctx)!;\n const api = CCAPI.create(CommandClasses.Battery, ctx, endpoint).withOptions({\n priority: MessagePriority.NodeQuery,\n });\n ctx.logNode(node.id, {\n endpoint: this.endpointIndex,\n message: \"querying battery status...\",\n direction: \"outbound\",\n });\n const batteryStatus = await api.get();\n if (batteryStatus) {\n let logMessage = \"received response for battery information:\";\n if (batteryStatus.disconnected) {\n logMessage += `\nis disconnected: true`;\n }\n else {\n logMessage += `\nlevel: ${batteryStatus.level === 0xff\n ? \"low\"\n : (batteryStatus.level + \" %\")}`;\n }\n if (api.version >= 2) {\n if (!batteryStatus.disconnected) {\n logMessage += `\nstatus: ${BatteryChargingStatus[batteryStatus.chargingStatus!]}`;\n }\n logMessage += `\nrechargeable: ${batteryStatus.rechargeable}\nis backup: ${batteryStatus.backup}\nis overheating: ${batteryStatus.overheating}\nfluid is low: ${batteryStatus.lowFluid}\nneeds to be replaced or charged: ${BatteryReplacementStatus[batteryStatus.rechargeOrReplace!]}\nis low temperature ${batteryStatus.lowTemperatureStatus}`;\n }\n ctx.logNode(node.id, {\n endpoint: this.endpointIndex,\n message: logMessage,\n direction: \"inbound\",\n });\n }\n if (api.version >= 2) {\n // always query the health\n ctx.logNode(node.id, {\n endpoint: this.endpointIndex,\n message: \"querying battery health...\",\n direction: \"outbound\",\n });\n const batteryHealth = await api.getHealth();\n if (batteryHealth) {\n const logMessage = `received response for battery health:\nmax. capacity: ${batteryHealth.maximumCapacity} %\ntemperature: ${batteryHealth.temperature} \u00B0C`;\n ctx.logNode(node.id, {\n endpoint: this.endpointIndex,\n message: logMessage,\n direction: \"inbound\",\n });\n }\n }\n }\n public shouldRefreshValues(this: SinglecastCC<this>, ctx: GetValueDB & GetSupportedCCVersion & GetDeviceConfig & GetNode<NodeId & GetEndpoint<EndpointId & SupportsCC & ControlsCC>>): boolean {\n // Check when the battery state was last updated\n const valueDB = ctx.tryGetValueDB(this.nodeId);\n if (!valueDB)\n return true;\n const lastUpdated = valueDB.getTimestamp(BatteryCCValues.level.endpoint(this.endpointIndex));\n return (lastUpdated == undefined\n // The specs say once per month, but that's a bit too unfrequent IMO\n // Also the maximum that setInterval supports is ~24.85 days\n || Date.now() - lastUpdated > timespan.days(7));\n }\n}\n// @publicAPI\nexport type BatteryCCReportOptions = {\n level: number | \"low\";\n} & AllOrNone<{\n // V2+\n chargingStatus: BatteryChargingStatus;\n rechargeable: boolean;\n backup: boolean;\n overheating: boolean;\n lowFluid: boolean;\n rechargeOrReplace: BatteryReplacementStatus;\n disconnected: boolean;\n}> & AllOrNone<{\n // V3+\n lowTemperatureStatus: boolean;\n}>;\n@CCCommand(BatteryCommand.Report)\n@ccValueProperty(\"level\", BatteryCCValues.level)\n@ccValueProperty(\"chargingStatus\", BatteryCCValues.chargingStatus)\n@ccValueProperty(\"rechargeable\", BatteryCCValues.rechargeable)\n@ccValueProperty(\"backup\", BatteryCCValues.backup)\n@ccValueProperty(\"overheating\", BatteryCCValues.overheating)\n@ccValueProperty(\"lowFluid\", BatteryCCValues.lowFluid)\n@ccValueProperty(\"rechargeOrReplace\", BatteryCCValues.rechargeOrReplace)\n@ccValueProperty(\"disconnected\", BatteryCCValues.disconnected)\n@ccValueProperty(\"lowTemperatureStatus\", BatteryCCValues.lowTemperatureStatus)\nexport class BatteryCCReport extends BatteryCC {\n public constructor(options: WithAddress<BatteryCCReportOptions>) {\n super(options);\n this.level = typeof options.level === \"number\" ? options.level : 0xff;\n this.chargingStatus = options.chargingStatus;\n this.rechargeable = options.rechargeable;\n this.backup = options.backup;\n this.overheating = options.overheating;\n this.lowFluid = options.lowFluid;\n this.rechargeOrReplace = options.rechargeOrReplace;\n this.disconnected = options.disconnected;\n this.lowTemperatureStatus = options.lowTemperatureStatus;\n }\n public static from(raw: CCRaw, ctx: CCParsingContext): BatteryCCReport {\n let ccOptions: BatteryCCReportOptions;\n validatePayload(raw.payload.length >= 1);\n const level = raw.payload[0];\n validatePayload.withReason(`Invalid battery level ${level}`)(\n // This field MUST be in the range 0x00..0x64 or set to 0xFF\n level <= 100 || level === 0xff);\n ccOptions = {\n level,\n };\n if (raw.payload.length >= 3) {\n // Starting with V2\n const chargingStatus: BatteryChargingStatus = raw.payload[1] >>> 6;\n const rechargeable = !!(raw.payload[1] & 32);\n const backup = !!(raw.payload[1] & 16);\n const overheating = !!(raw.payload[1] & 0b1000);\n const lowFluid = !!(raw.payload[1] & 0b0100);\n const rechargeOrReplace: BatteryReplacementStatus = !!(raw.payload[1] & 0b10)\n ? BatteryReplacementStatus.Now\n : !!(raw.payload[1] & 0b1)\n ? BatteryReplacementStatus.Soon\n : BatteryReplacementStatus.No;\n const lowTemperatureStatus = !!(raw.payload[2] & 0b10);\n const disconnected = !!(raw.payload[2] & 0b1);\n ccOptions = {\n ...ccOptions,\n chargingStatus,\n rechargeable,\n backup,\n overheating,\n lowFluid,\n rechargeOrReplace,\n lowTemperatureStatus,\n disconnected,\n };\n }\n return new this({\n nodeId: ctx.sourceNodeId,\n ...ccOptions,\n });\n }\n public persistValues(ctx: PersistValuesContext): boolean {\n // Setting the values to undefined is a bit hacky, but we need to avoid persisting\n // them in these special cases, and I don't like copy-pasting what persistValues does.\n if (this.disconnected) {\n // Level and chargingStatus are meaningless when disconnected.\n // Suppress persisting them, then remove any previously stored values.\n const savedLevel = this.level;\n const savedChargingStatus = this.chargingStatus;\n // @ts-expect-error\n this.level = undefined;\n // @ts-expect-error\n this.chargingStatus = undefined;\n const ret = super.persistValues(ctx);\n // Add the values back to the CC instance, so they can be evaluated downstream if needed\n // @ts-expect-error\n this.level = savedLevel;\n // @ts-expect-error\n this.chargingStatus = savedChargingStatus;\n this.removeValue(ctx, BatteryCCValues.level);\n this.removeValue(ctx, BatteryCCValues.chargingStatus);\n return ret;\n }\n else if (this.level === 0xff) {\n // 0xff is a \"low battery\" notification, not an actual level\n // @ts-expect-error\n this.level = undefined;\n const ret = super.persistValues(ctx);\n // Add the value back to the CC instance, so it can be evaluated downstream if needed\n // @ts-expect-error\n this.level = 0xff;\n return ret;\n }\n // Default behavior for all other cases\n if (!super.persistValues(ctx))\n return false;\n // Na\u00EFve heuristic for a full battery\n if (this.level >= 90) {\n // Some devices send Notification CC Reports with battery information,\n // or this information is mapped from legacy V1 alarm values.\n // We may need to idle the corresponding values when the battery is full\n const notificationCCVersion = ctx.getSupportedCCVersion(CommandClasses.Notification, this.nodeId as number, this.endpointIndex);\n if (\n // supported\n notificationCCVersion > 0\n // but idling is not required\n && notificationCCVersion < 8) {\n const batteryLevelStatusValue = NotificationCCValues\n .notificationVariable(\"Power Management\", \"Battery level status\");\n // If not undefined and not idle\n if (this.getValue(ctx, batteryLevelStatusValue)) {\n this.setValue(ctx, batteryLevelStatusValue, 0);\n }\n }\n }\n return true;\n }\n public readonly level: number;\n public readonly chargingStatus: BatteryChargingStatus | undefined;\n public readonly rechargeable: boolean | undefined;\n public readonly backup: boolean | undefined;\n public readonly overheating: boolean | undefined;\n public readonly lowFluid: boolean | undefined;\n public readonly rechargeOrReplace: BatteryReplacementStatus | undefined;\n public readonly disconnected: boolean | undefined;\n public readonly lowTemperatureStatus: boolean | undefined;\n public serialize(ctx: CCEncodingContext): Promise<Bytes> {\n this.payload = Bytes.from([\n this.disconnected\n // CC:0080.02.03.11.010\n // If this field is set to 1, the Battery Level field MUST\n // be set to 0x00.\n ? 0\n : this.level,\n ]);\n if (this.chargingStatus != undefined) {\n this.payload = Bytes.concat([\n this.payload,\n [\n (this.chargingStatus << 6)\n + (this.rechargeable ? 32 : 0)\n + (this.backup ? 16 : 0)\n + (this.overheating ? 0b1000 : 0)\n + (this.lowFluid ? 0b0100 : 0)\n + (this.rechargeOrReplace === BatteryReplacementStatus.Now\n ? 0b10\n : this.rechargeOrReplace\n === BatteryReplacementStatus.Soon\n ? 0b1\n : 0),\n (this.lowTemperatureStatus ? 0b10 : 0)\n + (this.disconnected ? 0b1 : 0),\n ],\n ]);\n }\n return super.serialize(ctx);\n }\n public toLogEntry(ctx?: GetValueDB): MessageOrCCLogEntry {\n const message: MessageRecord = {};\n if (this.disconnected) {\n message.disconnected = true;\n }\n else if (this.level === 0xff) {\n message[\"is low\"] = true;\n }\n else {\n message.level = this.level;\n }\n if (!this.disconnected && this.chargingStatus != undefined) {\n message[\"charging status\"] = getEnumMemberName(BatteryChargingStatus, this.chargingStatus);\n }\n if (this.rechargeable != undefined) {\n message.rechargeable = this.rechargeable;\n }\n if (this.backup != undefined) {\n message.backup = this.backup;\n }\n if (this.overheating != undefined) {\n message.overheating = this.overheating;\n }\n if (this.lowFluid != undefined) {\n message[\"low fluid\"] = this.lowFluid;\n }\n if (this.rechargeOrReplace != undefined) {\n message[\"recharge or replace\"] = getEnumMemberName(BatteryReplacementStatus, this.rechargeOrReplace);\n }\n if (this.lowTemperatureStatus != undefined) {\n message.lowTemperatureStatus = this.lowTemperatureStatus;\n }\n return {\n ...super.toLogEntry(ctx),\n message,\n };\n }\n}\n@CCCommand(BatteryCommand.Get)\n@expectedCCResponse(BatteryCCReport)\nexport class BatteryCCGet extends BatteryCC {\n}\n// @publicAPI\nexport interface BatteryCCHealthReportOptions {\n maximumCapacity?: number;\n temperature?: number;\n temperatureScale?: number;\n}\n@CCCommand(BatteryCommand.HealthReport)\n@ccValueProperty(\"maximumCapacity\", BatteryCCValues.maximumCapacity)\n@ccValueProperty(\"temperature\", BatteryCCValues.temperature)\nexport class BatteryCCHealthReport extends BatteryCC {\n public constructor(options: WithAddress<BatteryCCHealthReportOptions>) {\n super(options);\n // TODO: Check implementation:\n this.maximumCapacity = options.maximumCapacity;\n this.temperature = options.temperature;\n this.temperatureScale = options.temperatureScale;\n }\n public static from(raw: CCRaw, ctx: CCParsingContext): BatteryCCHealthReport {\n validatePayload(raw.payload.length >= 2);\n // Parse maximum capacity. 0xff means unknown\n let maximumCapacity: number | undefined = raw.payload[0];\n if (maximumCapacity === 0xff)\n maximumCapacity = undefined;\n const { value: temperature, scale: temperatureScale, } = parseFloatWithScale(raw.payload.subarray(1), true);\n return new this({\n nodeId: ctx.sourceNodeId,\n maximumCapacity,\n temperature,\n temperatureScale,\n });\n }\n public readonly maximumCapacity: number | undefined;\n public readonly temperature: number | undefined;\n private readonly temperatureScale: number | undefined;\n public serialize(ctx: CCEncodingContext): Promise<Bytes> {\n const temperature = this.temperature != undefined\n ? encodeFloatWithScale(this.temperature, this.temperatureScale ?? 0x00)\n // size, precision and scale must be 0 if the temperature is omitted\n : Bytes.from([0x00]);\n this.payload = Bytes.concat([\n [this.maximumCapacity ?? 0xff],\n temperature,\n ]);\n return super.serialize(ctx);\n }\n public toLogEntry(ctx?: GetValueDB): MessageOrCCLogEntry {\n return {\n ...super.toLogEntry(ctx),\n message: {\n temperature: this.temperature != undefined\n ? this.temperature\n : \"unknown\",\n \"max capacity\": this.maximumCapacity != undefined\n ? `${this.maximumCapacity} %`\n : \"unknown\",\n },\n };\n }\n}\n@CCCommand(BatteryCommand.HealthGet)\n@expectedCCResponse(BatteryCCHealthReport)\nexport class BatteryCCHealthGet extends BatteryCC {\n}\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AACA,kBAAsZ;AACtZ,oBAAgE;AAChE,iBAA0G;AAC1G,0BAAuH;AACvH,oCAAiH;AAEjH,mBAAiF;AAEjF,4BAAqC;AACrC,gCAAgC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;I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BAAkB,MAAA;8BAF9B,yCAAU,4BAAe,SAAS,OAClC,kDAAmB,qBAAqB,CAAC;;;;oBACF;0CAAA,YAAS;WAAA;;;;;;;;AAAjD,mBAAA,MAAA,mBAAA,EAAA,OAAA,WAAA,GAAA,kBAAA,EAAA,MAAA,SAAA,MAAA,WAAA,MAAA,UAAA,UAAA,GAAA,MAAA,uBAAA;;;AAAa,wBAAA,YAAA,uBAAA;;;;;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
|
-
"sources": ["../../../
|
|
4
|
-
"sourcesContent": [
|
|
3
|
+
"sources": ["../../../src_gen/cc/BinarySensorCC._validateArgs.ts"],
|
|
4
|
+
"sourcesContent": ["import * as v from \"@zwave-js/core/validation\";\n\nexport function validateArgs_BinarySensorCCAPI_get() {\n\treturn <T extends Function>(__decoratedMethod: T, { kind }: ClassMethodDecoratorContext): T | void => {\n\t\tif (kind === \"method\") {\n\t\t\treturn function get(this: any, sensorType: unknown) {\n\t\t\t\tv.assert(\n\t\t\t\t\tv.optional({ kind: \"parameter\", name: \"sensorType\" }, v.oneOf({ kind: \"parameter\", name: \"sensorType\" }, undefined, v.literal({ kind: \"parameter\", name: \"sensorType\" }, 1), v.literal({ kind: \"parameter\", name: \"sensorType\" }, 2), v.literal({ kind: \"parameter\", name: \"sensorType\" }, 3), v.literal({ kind: \"parameter\", name: \"sensorType\" }, 4), v.literal({ kind: \"parameter\", name: \"sensorType\" }, 5), v.literal({ kind: \"parameter\", name: \"sensorType\" }, 6), v.literal({ kind: \"parameter\", name: \"sensorType\" }, 7), v.literal({ kind: \"parameter\", name: \"sensorType\" }, 8), v.literal({ kind: \"parameter\", name: \"sensorType\" }, 9), v.literal({ kind: \"parameter\", name: \"sensorType\" }, 10), v.literal({ kind: \"parameter\", name: \"sensorType\" }, 11), v.literal({ kind: \"parameter\", name: \"sensorType\" }, 12), v.literal({ kind: \"parameter\", name: \"sensorType\" }, 13), v.literal({ kind: \"parameter\", name: \"sensorType\" }, 255)))(sensorType),\n\t\t\t\t);\n\t\t\t\treturn __decoratedMethod.call(this, sensorType);\n\t\t\t} as unknown as T;\n\t\t}\n\t};\n}\n\nexport function validateArgs_BinarySensorCCAPI_sendReport() {\n\treturn <T extends Function>(__decoratedMethod: T, { kind }: ClassMethodDecoratorContext): T | void => {\n\t\tif (kind === \"method\") {\n\t\t\treturn function sendReport(this: any, value: unknown, sensorType: unknown) {\n\t\t\t\tv.assert(\n\t\t\t\t\tv.primitive({ kind: \"parameter\", name: \"value\" }, \"boolean\")(value),\n\n\t\t\t\t\tv.optional({ kind: \"parameter\", name: \"sensorType\" }, v.oneOf({ kind: \"parameter\", name: \"sensorType\" }, undefined, v.literal({ kind: \"parameter\", name: \"sensorType\" }, 1), v.literal({ kind: \"parameter\", name: \"sensorType\" }, 2), v.literal({ kind: \"parameter\", name: \"sensorType\" }, 3), v.literal({ kind: \"parameter\", name: \"sensorType\" }, 4), v.literal({ kind: \"parameter\", name: \"sensorType\" }, 5), v.literal({ kind: \"parameter\", name: \"sensorType\" }, 6), v.literal({ kind: \"parameter\", name: \"sensorType\" }, 7), v.literal({ kind: \"parameter\", name: \"sensorType\" }, 8), v.literal({ kind: \"parameter\", name: \"sensorType\" }, 9), v.literal({ kind: \"parameter\", name: \"sensorType\" }, 10), v.literal({ kind: \"parameter\", name: \"sensorType\" }, 11), v.literal({ kind: \"parameter\", name: \"sensorType\" }, 12), v.literal({ kind: \"parameter\", name: \"sensorType\" }, 13), v.literal({ kind: \"parameter\", name: \"sensorType\" }, 255)))(sensorType),\n\t\t\t\t);\n\t\t\t\treturn __decoratedMethod.call(this, value, sensorType);\n\t\t\t} as unknown as T;\n\t\t}\n\t};\n}\n\nexport function validateArgs_BinarySensorCCAPI_reportSupportedSensorTypes() {\n\treturn <T extends Function>(__decoratedMethod: T, { kind }: ClassMethodDecoratorContext): T | void => {\n\t\tif (kind === \"method\") {\n\t\t\treturn function reportSupportedSensorTypes(this: any, supported: unknown) {\n\t\t\t\tv.assert(\n\t\t\t\t\tv.array({ kind: \"parameter\", name: \"supported\" }, 'BinarySensorType', v.enum({ kind: \"item\", name: \"supported\" }, \"BinarySensorType\"))(supported),\n\t\t\t\t);\n\t\t\t\treturn __decoratedMethod.call(this, supported);\n\t\t\t} as unknown as T;\n\t\t}\n\t};\n}"],
|
|
5
5
|
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;;;;;;;AAAA,QAAmB;AAEb,SAAU,qCAAkC;AACjD,SAAO,CAAqB,mBAAsB,EAAE,KAAI,MAA6C;AACpG,QAAI,SAAS,UAAU;AACtB,aAAO,gCAAS,IAAe,YAAmB;AACjD,UAAE,OACD,EAAE,SAAS,EAAE,MAAM,aAAa,MAAM,aAAY,GAAI,EAAE,MAAM,EAAE,MAAM,aAAa,MAAM,aAAY,GAAI,QAAW,EAAE,QAAQ,EAAE,MAAM,aAAa,MAAM,aAAY,GAAI,CAAC,GAAG,EAAE,QAAQ,EAAE,MAAM,aAAa,MAAM,aAAY,GAAI,CAAC,GAAG,EAAE,QAAQ,EAAE,MAAM,aAAa,MAAM,aAAY,GAAI,CAAC,GAAG,EAAE,QAAQ,EAAE,MAAM,aAAa,MAAM,aAAY,GAAI,CAAC,GAAG,EAAE,QAAQ,EAAE,MAAM,aAAa,MAAM,aAAY,GAAI,CAAC,GAAG,EAAE,QAAQ,EAAE,MAAM,aAAa,MAAM,aAAY,GAAI,CAAC,GAAG,EAAE,QAAQ,EAAE,MAAM,aAAa,MAAM,aAAY,GAAI,CAAC,GAAG,EAAE,QAAQ,EAAE,MAAM,aAAa,MAAM,aAAY,GAAI,CAAC,GAAG,EAAE,QAAQ,EAAE,MAAM,aAAa,MAAM,aAAY,GAAI,CAAC,GAAG,EAAE,QAAQ,EAAE,MAAM,aAAa,MAAM,aAAY,GAAI,EAAE,GAAG,EAAE,QAAQ,EAAE,MAAM,aAAa,MAAM,aAAY,G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GAAG,EAAE,QAAQ,EAAE,MAAM,aAAa,MAAM,aAAY,GAAI,EAAE,GAAG,EAAE,QAAQ,EAAE,MAAM,aAAa,MAAM,aAAY,GAAI,EAAE,GAAG,EAAE,QAAQ,EAAE,MAAM,aAAa,MAAM,aAAY,GAAI,EAAE,GAAG,EAAE,QAAQ,EAAE,MAAM,aAAa,MAAM,aAAY,GAAI,GAAG,CAAC,CAAC,EAAE,UAAU,CAAC;AAEr6B,eAAO,kBAAkB,KAAK,MAAM,OAAO,UAAU;MACtD,GAPO;IAQR;EACD;AACD;AAbgB;AAeV,SAAU,4DAAyD;AACxE,SAAO,CAAqB,mBAAsB,EAAE,KAAI,MAA6C;AACpG,QAAI,SAAS,UAAU;AACtB,aAAO,gCAAS,2BAAsC,WAAkB;AACvE,UAAE,OACD,EAAE,MAAM,EAAE,MAAM,aAAa,MAAM,YAAW,GAAI,oBAAoB,EAAE,KAAK,EAAE,MAAM,QAAQ,MAAM,YAAW,GAAI,kBAAkB,CAAC,EAAE,SAAS,CAAC;AAElJ,eAAO,kBAAkB,KAAK,MAAM,SAAS;MAC9C,GALO;IAMR;EACD;AACD;AAXgB;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
|
@@ -1,66 +1,11 @@
|
|
|
1
|
-
import type
|
|
2
|
-
import { CommandClasses, type EndpointId, type GetValueDB, type MaybeNotKnown, type MessageOrCCLogEntry, type SupervisionResult, type WithAddress } from "@zwave-js/core";
|
|
1
|
+
import { type EndpointId, type GetValueDB, type MaybeNotKnown, type MessageOrCCLogEntry, type SupervisionResult, type WithAddress } from "@zwave-js/core";
|
|
3
2
|
import { Bytes } from "@zwave-js/shared";
|
|
4
3
|
import { POLL_VALUE, PhysicalCCAPI, type PollValueImplementation } from "../lib/API.js";
|
|
5
4
|
import { type CCRaw, CommandClass, type InterviewContext, type PersistValuesContext, type RefreshValuesContext } from "../lib/CommandClass.js";
|
|
6
5
|
import { BinarySensorCommand, BinarySensorType } from "../lib/_Types.js";
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
readonly commandClass: (typeof CommandClasses)["Binary Sensor"];
|
|
11
|
-
readonly property: "supportedSensorTypes";
|
|
12
|
-
};
|
|
13
|
-
endpoint: (endpoint?: number) => {
|
|
14
|
-
readonly commandClass: (typeof CommandClasses)["Binary Sensor"];
|
|
15
|
-
readonly endpoint: number;
|
|
16
|
-
readonly property: "supportedSensorTypes";
|
|
17
|
-
};
|
|
18
|
-
is: (valueId: import("@zwave-js/core").ValueID) => boolean;
|
|
19
|
-
readonly meta: Readonly<{
|
|
20
|
-
readonly type: "any";
|
|
21
|
-
readonly readable: true;
|
|
22
|
-
readonly writeable: true;
|
|
23
|
-
}>;
|
|
24
|
-
options: {
|
|
25
|
-
readonly internal: true;
|
|
26
|
-
readonly minVersion: 1;
|
|
27
|
-
readonly secret: false;
|
|
28
|
-
readonly stateful: true;
|
|
29
|
-
readonly supportsEndpoints: true;
|
|
30
|
-
readonly autoCreate: true;
|
|
31
|
-
};
|
|
32
|
-
};
|
|
33
|
-
state: ((sensorType: BinarySensorType) => {
|
|
34
|
-
id: {
|
|
35
|
-
readonly commandClass: (typeof CommandClasses)["Binary Sensor"];
|
|
36
|
-
readonly property: string;
|
|
37
|
-
};
|
|
38
|
-
endpoint: (endpoint?: number) => {
|
|
39
|
-
readonly commandClass: (typeof CommandClasses)["Binary Sensor"];
|
|
40
|
-
readonly endpoint: number;
|
|
41
|
-
readonly property: string;
|
|
42
|
-
};
|
|
43
|
-
readonly meta: {
|
|
44
|
-
readonly label: `Sensor state (${string})`;
|
|
45
|
-
readonly ccSpecific: {
|
|
46
|
-
readonly sensorType: BinarySensorType;
|
|
47
|
-
};
|
|
48
|
-
readonly writeable: false;
|
|
49
|
-
readonly type: "boolean";
|
|
50
|
-
readonly readable: true;
|
|
51
|
-
};
|
|
52
|
-
}) & {
|
|
53
|
-
is: (valueId: import("@zwave-js/core").ValueID) => boolean;
|
|
54
|
-
options: {
|
|
55
|
-
readonly internal: false;
|
|
56
|
-
readonly minVersion: 1;
|
|
57
|
-
readonly secret: false;
|
|
58
|
-
readonly stateful: true;
|
|
59
|
-
readonly supportsEndpoints: true;
|
|
60
|
-
readonly autoCreate: true;
|
|
61
|
-
};
|
|
62
|
-
};
|
|
63
|
-
}>;
|
|
6
|
+
import type { CCEncodingContext, CCParsingContext } from "../lib/traits.js";
|
|
7
|
+
import { BinarySensorCCValues } from "./_CCValues.generated.js";
|
|
8
|
+
export { BinarySensorCCValues };
|
|
64
9
|
export declare class BinarySensorCCAPI extends PhysicalCCAPI {
|
|
65
10
|
supportsCommand(cmd: BinarySensorCommand): MaybeNotKnown<boolean>;
|
|
66
11
|
protected get [POLL_VALUE](): PollValueImplementation;
|
|
@@ -44,7 +44,6 @@ var import_shared = require("@zwave-js/shared");
|
|
|
44
44
|
var import_API = require("../lib/API.js");
|
|
45
45
|
var import_CommandClass = require("../lib/CommandClass.js");
|
|
46
46
|
var import_CommandClassDecorators = require("../lib/CommandClassDecorators.js");
|
|
47
|
-
var import_Values = require("../lib/Values.js");
|
|
48
47
|
var import_Types = require("../lib/_Types.js");
|
|
49
48
|
var import_CCValues_generated = require("./_CCValues.generated.js");
|
|
50
49
|
var __runInitializers = function(thisArg, initializers, value) {
|
|
@@ -107,7 +106,7 @@ let BinarySensorCCAPI = (() => {
|
|
|
107
106
|
}
|
|
108
107
|
static {
|
|
109
108
|
const _metadata = typeof Symbol === "function" && Symbol.metadata ? Object.create(_classSuper[Symbol.metadata] ?? null) : void 0;
|
|
110
|
-
_get_decorators = [validateArgs_BinarySensorCCAPI_get(
|
|
109
|
+
_get_decorators = [validateArgs_BinarySensorCCAPI_get()];
|
|
111
110
|
_sendReport_decorators = [validateArgs_BinarySensorCCAPI_sendReport()];
|
|
112
111
|
_reportSupportedSensorTypes_decorators = [validateArgs_BinarySensorCCAPI_reportSupportedSensorTypes()];
|
|
113
112
|
__esDecorate(this, null, _get_decorators, { kind: "method", name: "get", static: false, private: false, access: { has: /* @__PURE__ */ __name((obj) => "get" in obj, "has"), get: /* @__PURE__ */ __name((obj) => obj.get, "get") }, metadata: _metadata }, null, _instanceExtraInitializers);
|
|
@@ -297,7 +296,17 @@ let BinarySensorCC = (() => {
|
|
|
297
296
|
return ctx.getValueDB(endpoint.nodeId).getValue(import_CCValues_generated.BinarySensorCCValues.supportedSensorTypes.endpoint(endpoint.index));
|
|
298
297
|
}
|
|
299
298
|
setMappedBasicValue(ctx, value) {
|
|
300
|
-
this.
|
|
299
|
+
const valueDB = this.getValueDB(ctx);
|
|
300
|
+
const anyValueId = import_CCValues_generated.BinarySensorCCValues.state(import_Types.BinarySensorType.Any).endpoint(this.endpointIndex);
|
|
301
|
+
let sensorType;
|
|
302
|
+
if (valueDB.hasMetadata(anyValueId)) {
|
|
303
|
+
sensorType = import_Types.BinarySensorType.Any;
|
|
304
|
+
} else {
|
|
305
|
+
const existingSensorTypes = valueDB.getAllMetadata(import_core.CommandClasses["Binary Sensor"]).filter((v) => v.endpoint === this.endpointIndex && import_CCValues_generated.BinarySensorCCValues.state.is(v)).map((v) => v.metadata?.ccSpecific?.sensorType).filter((t) => t != void 0).toSorted((a, b) => a - b);
|
|
306
|
+
sensorType = existingSensorTypes[0] ?? import_Types.BinarySensorType.Any;
|
|
307
|
+
}
|
|
308
|
+
const binarySensorValue = import_CCValues_generated.BinarySensorCCValues.state(sensorType);
|
|
309
|
+
this.setValue(ctx, binarySensorValue, value > 0);
|
|
301
310
|
return true;
|
|
302
311
|
}
|
|
303
312
|
};
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
|
-
"sources": ["../../../
|
|
4
|
-
"sourcesContent": ["import type { CCEncodingContext, CCParsingContext } from \"@zwave-js/cc\";\nimport {\n\tCommandClasses,\n\ttype EndpointId,\n\ttype GetValueDB,\n\ttype MaybeNotKnown,\n\ttype MessageOrCCLogEntry,\n\tMessagePriority,\n\ttype SupervisionResult,\n\tValueMetadata,\n\ttype WithAddress,\n\tencodeBitMask,\n\tparseBitMask,\n\tvalidatePayload,\n} from \"@zwave-js/core\";\nimport { Bytes, getEnumMemberName, isEnumMember } from \"@zwave-js/shared\";\nimport { validateArgs } from \"@zwave-js/transformers\";\nimport {\n\tCCAPI,\n\tPOLL_VALUE,\n\tPhysicalCCAPI,\n\ttype PollValueImplementation,\n\tthrowUnsupportedProperty,\n} from \"../lib/API.js\";\nimport {\n\ttype CCRaw,\n\tCommandClass,\n\ttype InterviewContext,\n\ttype PersistValuesContext,\n\ttype RefreshValuesContext,\n} from \"../lib/CommandClass.js\";\nimport {\n\tAPI,\n\tCCCommand,\n\tccValueProperty,\n\tccValues,\n\tcommandClass,\n\texpectedCCResponse,\n\timplementedVersion,\n} from \"../lib/CommandClassDecorators.js\";\nimport { V } from \"../lib/Values.js\";\nimport { BinarySensorCommand, BinarySensorType } from \"../lib/_Types.js\";\n\nexport const BinarySensorCCValues = V.defineCCValues(\n\tCommandClasses[\"Binary Sensor\"],\n\t{\n\t\t...V.staticProperty(\"supportedSensorTypes\", undefined, {\n\t\t\tinternal: true,\n\t\t}),\n\n\t\t...V.dynamicPropertyWithName(\n\t\t\t\"state\",\n\t\t\t/* property */ (sensorType: BinarySensorType) =>\n\t\t\t\tgetEnumMemberName(BinarySensorType, sensorType),\n\t\t\t({ property }) =>\n\t\t\t\ttypeof property === \"string\" && property in BinarySensorType,\n\t\t\t/* meta */ (sensorType: BinarySensorType) => ({\n\t\t\t\t...ValueMetadata.ReadOnlyBoolean,\n\t\t\t\tlabel: `Sensor state (${\n\t\t\t\t\tgetEnumMemberName(\n\t\t\t\t\t\tBinarySensorType,\n\t\t\t\t\t\tsensorType,\n\t\t\t\t\t)\n\t\t\t\t})`,\n\t\t\t\tccSpecific: { sensorType },\n\t\t\t} as const),\n\t\t),\n\t},\n);\n\n// @noSetValueAPI This CC is read-only\n\n@API(CommandClasses[\"Binary Sensor\"])\nexport class BinarySensorCCAPI extends PhysicalCCAPI {\n\tpublic supportsCommand(cmd: BinarySensorCommand): MaybeNotKnown<boolean> {\n\t\tswitch (cmd) {\n\t\t\tcase BinarySensorCommand.Get:\n\t\t\tcase BinarySensorCommand.Report:\n\t\t\t\treturn true; // This is mandatory\n\t\t\tcase BinarySensorCommand.SupportedGet:\n\t\t\tcase BinarySensorCommand.SupportedReport:\n\t\t\t\treturn this.version >= 2;\n\t\t}\n\t\treturn super.supportsCommand(cmd);\n\t}\n\n\tprotected get [POLL_VALUE](): PollValueImplementation {\n\t\treturn async function(this: BinarySensorCCAPI, { property }) {\n\t\t\tif (typeof property === \"string\") {\n\t\t\t\tconst sensorType = (BinarySensorType as any)[property] as\n\t\t\t\t\t| BinarySensorType\n\t\t\t\t\t| undefined;\n\t\t\t\tif (sensorType) return this.get(sensorType);\n\t\t\t}\n\t\t\tthrowUnsupportedProperty(this.ccId, property);\n\t\t};\n\t}\n\n\t/**\n\t * Retrieves the current value from this sensor\n\t * @param sensorType The (optional) sensor type to retrieve the value for\n\t */\n\t@validateArgs({ strictEnums: true })\n\tpublic async get(\n\t\tsensorType?: BinarySensorType,\n\t): Promise<MaybeNotKnown<boolean>> {\n\t\tthis.assertSupportsCommand(\n\t\t\tBinarySensorCommand,\n\t\t\tBinarySensorCommand.Get,\n\t\t);\n\n\t\tconst cc = new BinarySensorCCGet({\n\t\t\tnodeId: this.endpoint.nodeId,\n\t\t\tendpointIndex: this.endpoint.index,\n\t\t\tsensorType,\n\t\t});\n\t\tconst response = await this.host.sendCommand<BinarySensorCCReport>(\n\t\t\tcc,\n\t\t\tthis.commandOptions,\n\t\t);\n\t\t// We don't want to repeat the sensor type\n\t\treturn response?.value;\n\t}\n\n\t@validateArgs()\n\tpublic async sendReport(\n\t\tvalue: boolean,\n\t\tsensorType?: BinarySensorType,\n\t): Promise<SupervisionResult | undefined> {\n\t\tthis.assertSupportsCommand(\n\t\t\tBinarySensorCommand,\n\t\t\tBinarySensorCommand.Report,\n\t\t);\n\n\t\tconst cc = new BinarySensorCCReport({\n\t\t\tnodeId: this.endpoint.nodeId,\n\t\t\tendpointIndex: this.endpoint.index,\n\t\t\tvalue,\n\t\t\ttype: sensorType,\n\t\t});\n\t\treturn this.host.sendCommand(cc, this.commandOptions);\n\t}\n\n\tpublic async getSupportedSensorTypes(): Promise<\n\t\treadonly BinarySensorType[] | undefined\n\t> {\n\t\tthis.assertSupportsCommand(\n\t\t\tBinarySensorCommand,\n\t\t\tBinarySensorCommand.SupportedGet,\n\t\t);\n\n\t\tconst cc = new BinarySensorCCSupportedGet({\n\t\t\tnodeId: this.endpoint.nodeId,\n\t\t\tendpointIndex: this.endpoint.index,\n\t\t});\n\t\tconst response = await this.host.sendCommand<\n\t\t\tBinarySensorCCSupportedReport\n\t\t>(\n\t\t\tcc,\n\t\t\tthis.commandOptions,\n\t\t);\n\t\t// We don't want to repeat the sensor type\n\t\treturn response?.supportedSensorTypes;\n\t}\n\n\t@validateArgs()\n\tpublic async reportSupportedSensorTypes(\n\t\tsupported: BinarySensorType[],\n\t): Promise<SupervisionResult | undefined> {\n\t\tthis.assertSupportsCommand(\n\t\t\tBinarySensorCommand,\n\t\t\tBinarySensorCommand.SupportedReport,\n\t\t);\n\n\t\tconst cc = new BinarySensorCCSupportedReport({\n\t\t\tnodeId: this.endpoint.nodeId,\n\t\t\tendpointIndex: this.endpoint.index,\n\t\t\tsupportedSensorTypes: supported,\n\t\t});\n\t\treturn this.host.sendCommand(cc, this.commandOptions);\n\t}\n}\n\n@commandClass(CommandClasses[\"Binary Sensor\"])\n@implementedVersion(2)\n@ccValues(BinarySensorCCValues)\nexport class BinarySensorCC extends CommandClass {\n\tdeclare ccCommand: BinarySensorCommand;\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[\"Binary Sensor\"],\n\t\t\tctx,\n\t\t\tendpoint,\n\t\t).withOptions({\n\t\t\tpriority: MessagePriority.NodeQuery,\n\t\t});\n\n\t\tctx.logNode(node.id, {\n\t\t\tendpoint: this.endpointIndex,\n\t\t\tmessage: `Interviewing ${this.ccName}...`,\n\t\t\tdirection: \"none\",\n\t\t});\n\n\t\t// Find out which sensor types this sensor supports\n\t\tif (api.version >= 2) {\n\t\t\tctx.logNode(node.id, {\n\t\t\t\tendpoint: this.endpointIndex,\n\t\t\t\tmessage: \"querying supported sensor types...\",\n\t\t\t\tdirection: \"outbound\",\n\t\t\t});\n\t\t\tconst supportedSensorTypes = await api.getSupportedSensorTypes();\n\t\t\tif (supportedSensorTypes) {\n\t\t\t\tconst logMessage = `received supported sensor types: ${\n\t\t\t\t\tsupportedSensorTypes\n\t\t\t\t\t\t.map((type) =>\n\t\t\t\t\t\t\tgetEnumMemberName(BinarySensorType, type)\n\t\t\t\t\t\t)\n\t\t\t\t\t\t.map((name) => `\\n\u00B7 ${name}`)\n\t\t\t\t\t\t.join(\"\")\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\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\"Querying supported sensor types timed out, skipping interview...\",\n\t\t\t\t\tlevel: \"warn\",\n\t\t\t\t});\n\t\t\t\treturn;\n\t\t\t}\n\t\t}\n\n\t\tawait this.refreshValues(ctx);\n\n\t\t// Remember that the interview is complete\n\t\tthis.setInterviewComplete(ctx, true);\n\t}\n\n\tpublic async refreshValues(\n\t\tctx: RefreshValuesContext,\n\t): Promise<void> {\n\t\tconst node = this.getNode(ctx)!;\n\t\tconst endpoint = this.getEndpoint(ctx)!;\n\t\tconst api = CCAPI.create(\n\t\t\tCommandClasses[\"Binary Sensor\"],\n\t\t\tctx,\n\t\t\tendpoint,\n\t\t).withOptions({\n\t\t\tpriority: MessagePriority.NodeQuery,\n\t\t});\n\n\t\t// Query (all of) the sensor's current value(s)\n\t\tif (api.version === 1) {\n\t\t\tctx.logNode(node.id, {\n\t\t\t\tendpoint: this.endpointIndex,\n\t\t\t\tmessage: \"querying current value...\",\n\t\t\t\tdirection: \"outbound\",\n\t\t\t});\n\t\t\tconst currentValue = await api.get();\n\t\t\tif (currentValue != undefined) {\n\t\t\t\tctx.logNode(node.id, {\n\t\t\t\t\tendpoint: this.endpointIndex,\n\t\t\t\t\tmessage: `received current value: ${currentValue}`,\n\t\t\t\t\tdirection: \"inbound\",\n\t\t\t\t});\n\t\t\t}\n\t\t} else {\n\t\t\tconst supportedSensorTypes: readonly BinarySensorType[] =\n\t\t\t\tthis.getValue(\n\t\t\t\t\tctx,\n\t\t\t\t\tBinarySensorCCValues.supportedSensorTypes,\n\t\t\t\t) ?? [];\n\n\t\t\tfor (const type of supportedSensorTypes) {\n\t\t\t\t// Some devices report invalid sensor types, but the CC API checks\n\t\t\t\t// for valid values and throws otherwise.\n\t\t\t\tif (!isEnumMember(BinarySensorType, type)) continue;\n\n\t\t\t\tconst sensorName = getEnumMemberName(BinarySensorType, type);\n\t\t\t\tctx.logNode(node.id, {\n\t\t\t\t\tendpoint: this.endpointIndex,\n\t\t\t\t\tmessage: `querying current value for ${sensorName}...`,\n\t\t\t\t\tdirection: \"outbound\",\n\t\t\t\t});\n\t\t\t\tconst currentValue = await api.get(type);\n\t\t\t\tif (currentValue != undefined) {\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`received current value for ${sensorName}: ${currentValue}`,\n\t\t\t\t\t\tdirection: \"inbound\",\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 * Returns which sensor types are supported.\n\t * This only works AFTER the interview process\n\t */\n\tpublic static getSupportedSensorTypesCached(\n\t\tctx: GetValueDB,\n\t\tendpoint: EndpointId,\n\t): MaybeNotKnown<BinarySensorType[]> {\n\t\treturn ctx\n\t\t\t.getValueDB(endpoint.nodeId)\n\t\t\t.getValue(\n\t\t\t\tBinarySensorCCValues.supportedSensorTypes.endpoint(\n\t\t\t\t\tendpoint.index,\n\t\t\t\t),\n\t\t\t);\n\t}\n\n\tpublic setMappedBasicValue(\n\t\tctx: GetValueDB,\n\t\tvalue: number,\n\t): boolean {\n\t\tthis.setValue(\n\t\t\tctx,\n\t\t\tBinarySensorCCValues.state(BinarySensorType.Any),\n\t\t\tvalue > 0,\n\t\t);\n\t\treturn true;\n\t}\n}\n\n// @publicAPI\nexport interface BinarySensorCCReportOptions {\n\ttype?: BinarySensorType;\n\tvalue: boolean;\n}\n\n@CCCommand(BinarySensorCommand.Report)\nexport class BinarySensorCCReport extends BinarySensorCC {\n\tpublic constructor(\n\t\toptions: WithAddress<BinarySensorCCReportOptions>,\n\t) {\n\t\tsuper(options);\n\n\t\tthis.type = options.type ?? BinarySensorType.Any;\n\t\tthis.value = options.value;\n\t}\n\n\tpublic static from(\n\t\traw: CCRaw,\n\t\tctx: CCParsingContext,\n\t): BinarySensorCCReport {\n\t\tvalidatePayload(raw.payload.length >= 1);\n\t\tconst value = raw.payload[0] === 0xff;\n\t\tlet type: BinarySensorType = BinarySensorType.Any;\n\n\t\tif (raw.payload.length >= 2) {\n\t\t\ttype = raw.payload[1];\n\t\t}\n\n\t\treturn new this({\n\t\t\tnodeId: ctx.sourceNodeId,\n\t\t\tvalue,\n\t\t\ttype,\n\t\t});\n\t}\n\n\tpublic persistValues(ctx: PersistValuesContext): boolean {\n\t\tif (!super.persistValues(ctx)) return false;\n\n\t\t// Workaround for devices reporting with sensor type Any -> find first supported sensor type and use that\n\t\tlet sensorType = this.type;\n\t\tif (sensorType === BinarySensorType.Any) {\n\t\t\tconst supportedSensorTypes = this.getValue<BinarySensorType[]>(\n\t\t\t\tctx,\n\t\t\t\tBinarySensorCCValues.supportedSensorTypes,\n\t\t\t);\n\t\t\tif (supportedSensorTypes?.length) {\n\t\t\t\tsensorType = supportedSensorTypes[0];\n\t\t\t}\n\t\t}\n\n\t\tconst binarySensorValue = BinarySensorCCValues.state(sensorType);\n\t\tthis.setMetadata(ctx, binarySensorValue, binarySensorValue.meta);\n\t\tthis.setValue(ctx, binarySensorValue, this.value);\n\n\t\treturn true;\n\t}\n\n\tpublic type: BinarySensorType;\n\tpublic value: boolean;\n\n\tpublic serialize(ctx: CCEncodingContext): Promise<Bytes> {\n\t\tthis.payload = Bytes.from([this.value ? 0xff : 0x00, this.type]);\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\ttype: getEnumMemberName(BinarySensorType, this.type),\n\t\t\t\tvalue: this.value,\n\t\t\t},\n\t\t};\n\t}\n}\n\nfunction testResponseForBinarySensorGet(\n\tsent: BinarySensorCCGet,\n\treceived: BinarySensorCCReport,\n) {\n\t// We expect a Binary Sensor Report that matches the requested sensor type (if a type was requested)\n\treturn (\n\t\tsent.sensorType == undefined\n\t\t|| sent.sensorType === BinarySensorType.Any\n\t\t|| received.type === sent.sensorType\n\t\t// This is technically not correct, but some devices do this anyways\n\t\t|| received.type === BinarySensorType.Any\n\t);\n}\n\n// @publicAPI\nexport interface BinarySensorCCGetOptions {\n\tsensorType?: BinarySensorType;\n}\n\n@CCCommand(BinarySensorCommand.Get)\n@expectedCCResponse(BinarySensorCCReport, testResponseForBinarySensorGet)\nexport class BinarySensorCCGet extends BinarySensorCC {\n\tpublic constructor(\n\t\toptions: WithAddress<BinarySensorCCGetOptions>,\n\t) {\n\t\tsuper(options);\n\t\tthis.sensorType = options.sensorType;\n\t}\n\n\tpublic static from(raw: CCRaw, ctx: CCParsingContext): BinarySensorCCGet {\n\t\tlet sensorType: BinarySensorType | undefined;\n\n\t\tif (raw.payload.length >= 1) {\n\t\t\tsensorType = raw.payload[0];\n\t\t}\n\n\t\treturn new this({\n\t\t\tnodeId: ctx.sourceNodeId,\n\t\t\tsensorType,\n\t\t});\n\t}\n\n\tpublic sensorType: BinarySensorType | undefined;\n\n\tpublic serialize(ctx: CCEncodingContext): Promise<Bytes> {\n\t\tthis.payload = Bytes.from([this.sensorType ?? BinarySensorType.Any]);\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\ttype: getEnumMemberName(\n\t\t\t\t\tBinarySensorType,\n\t\t\t\t\tthis.sensorType ?? BinarySensorType.Any,\n\t\t\t\t),\n\t\t\t},\n\t\t};\n\t}\n}\n\n// @publicAPI\nexport interface BinarySensorCCSupportedReportOptions {\n\tsupportedSensorTypes: BinarySensorType[];\n}\n\n@CCCommand(BinarySensorCommand.SupportedReport)\n@ccValueProperty(\n\t\"supportedSensorTypes\",\n\tBinarySensorCCValues.supportedSensorTypes,\n)\nexport class BinarySensorCCSupportedReport extends BinarySensorCC {\n\tpublic constructor(\n\t\toptions: WithAddress<BinarySensorCCSupportedReportOptions>,\n\t) {\n\t\tsuper(options);\n\n\t\tthis.supportedSensorTypes = options.supportedSensorTypes;\n\t}\n\n\tpublic static from(\n\t\traw: CCRaw,\n\t\tctx: CCParsingContext,\n\t): BinarySensorCCSupportedReport {\n\t\tvalidatePayload(raw.payload.length >= 1);\n\t\t// The enumeration starts at 1, but the first (reserved) bit is included\n\t\t// in the report\n\t\tconst supportedSensorTypes: BinarySensorType[] = parseBitMask(\n\t\t\traw.payload,\n\t\t\t0,\n\t\t)\n\t\t\t.filter(\n\t\t\t\t(t) => t !== 0,\n\t\t\t);\n\n\t\treturn new this({\n\t\t\tnodeId: ctx.sourceNodeId,\n\t\t\tsupportedSensorTypes,\n\t\t});\n\t}\n\n\tpublic supportedSensorTypes: BinarySensorType[];\n\n\tpublic serialize(ctx: CCEncodingContext): Promise<Bytes> {\n\t\tthis.payload = encodeBitMask(\n\t\t\tthis.supportedSensorTypes.filter((t) => t !== BinarySensorType.Any),\n\t\t\tundefined,\n\t\t\t0,\n\t\t);\n\t\treturn super.serialize(ctx);\n\t}\n\n\tpublic toLogEntry(ctx?: GetValueDB): MessageOrCCLogEntry {\n\t\treturn {\n\t\t\t...super.toLogEntry(ctx),\n\t\t\tmessage: {\n\t\t\t\t\"supported types\": this.supportedSensorTypes\n\t\t\t\t\t.map((type) => getEnumMemberName(BinarySensorType, type))\n\t\t\t\t\t.join(\", \"),\n\t\t\t},\n\t\t};\n\t}\n}\n\n@CCCommand(BinarySensorCommand.SupportedGet)\n@expectedCCResponse(BinarySensorCCSupportedReport)\nexport class BinarySensorCCSupportedGet extends BinarySensorCC {}\n"],
|
|
5
|
-
"mappings": "
|
|
3
|
+
"sources": ["../../../src_gen/cc/BinarySensorCC.ts"],
|
|
4
|
+
"sourcesContent": ["import * as __validateArgs from \"./BinarySensorCC._validateArgs.js\";\nconst { validateArgs_BinarySensorCCAPI_get, validateArgs_BinarySensorCCAPI_sendReport, validateArgs_BinarySensorCCAPI_reportSupportedSensorTypes } = __validateArgs;\nimport { CommandClasses, type EndpointId, type GetValueDB, type MaybeNotKnown, type MessageOrCCLogEntry, MessagePriority, type SupervisionResult, ValueMetadata, type WithAddress, encodeBitMask, parseBitMask, validatePayload, } from \"@zwave-js/core\";\nimport { Bytes, getEnumMemberName, isEnumMember } from \"@zwave-js/shared\";\nimport { CCAPI, POLL_VALUE, PhysicalCCAPI, type PollValueImplementation, throwUnsupportedProperty, } from \"../lib/API.js\";\nimport { type CCRaw, CommandClass, type InterviewContext, type PersistValuesContext, type RefreshValuesContext, } from \"../lib/CommandClass.js\";\nimport { API, CCCommand, ccValueProperty, ccValues, commandClass, expectedCCResponse, implementedVersion, } from \"../lib/CommandClassDecorators.js\";\nimport { V } from \"../lib/Values.js\";\nimport { BinarySensorCommand, BinarySensorType } from \"../lib/_Types.js\";\nimport type { CCEncodingContext, CCParsingContext } from \"../lib/traits.js\";\nimport { BinarySensorCCValues } from \"./_CCValues.generated.js\";\nexport { BinarySensorCCValues };\n// @noSetValueAPI This CC is read-only\n@API(CommandClasses[\"Binary Sensor\"])\nexport class BinarySensorCCAPI extends PhysicalCCAPI {\n public supportsCommand(cmd: BinarySensorCommand): MaybeNotKnown<boolean> {\n switch (cmd) {\n case BinarySensorCommand.Get:\n case BinarySensorCommand.Report:\n return true; // This is mandatory\n case BinarySensorCommand.SupportedGet:\n case BinarySensorCommand.SupportedReport:\n return this.version >= 2;\n }\n return super.supportsCommand(cmd);\n }\n protected get [POLL_VALUE](): PollValueImplementation {\n return async function (this: BinarySensorCCAPI, { property }) {\n if (typeof property === \"string\") {\n const sensorType = (BinarySensorType as any)[property] as BinarySensorType | undefined;\n if (sensorType)\n return this.get(sensorType);\n }\n throwUnsupportedProperty(this.ccId, property);\n };\n }\n /**\n * Retrieves the current value from this sensor\n * @param sensorType The (optional) sensor type to retrieve the value for\n */\n @validateArgs_BinarySensorCCAPI_get()\n public async get(sensorType?: BinarySensorType): Promise<MaybeNotKnown<boolean>> {\n this.assertSupportsCommand(BinarySensorCommand, BinarySensorCommand.Get);\n const cc = new BinarySensorCCGet({\n nodeId: this.endpoint.nodeId,\n endpointIndex: this.endpoint.index,\n sensorType,\n });\n const response = await this.host.sendCommand<BinarySensorCCReport>(cc, this.commandOptions);\n // We don't want to repeat the sensor type\n return response?.value;\n }\n @validateArgs_BinarySensorCCAPI_sendReport()\n public async sendReport(value: boolean, sensorType?: BinarySensorType): Promise<SupervisionResult | undefined> {\n this.assertSupportsCommand(BinarySensorCommand, BinarySensorCommand.Report);\n const cc = new BinarySensorCCReport({\n nodeId: this.endpoint.nodeId,\n endpointIndex: this.endpoint.index,\n value,\n type: sensorType,\n });\n return this.host.sendCommand(cc, this.commandOptions);\n }\n public async getSupportedSensorTypes(): Promise<readonly BinarySensorType[] | undefined> {\n this.assertSupportsCommand(BinarySensorCommand, BinarySensorCommand.SupportedGet);\n const cc = new BinarySensorCCSupportedGet({\n nodeId: this.endpoint.nodeId,\n endpointIndex: this.endpoint.index,\n });\n const response = await this.host.sendCommand<BinarySensorCCSupportedReport>(cc, this.commandOptions);\n // We don't want to repeat the sensor type\n return response?.supportedSensorTypes;\n }\n @validateArgs_BinarySensorCCAPI_reportSupportedSensorTypes()\n public async reportSupportedSensorTypes(supported: BinarySensorType[]): Promise<SupervisionResult | undefined> {\n this.assertSupportsCommand(BinarySensorCommand, BinarySensorCommand.SupportedReport);\n const cc = new BinarySensorCCSupportedReport({\n nodeId: this.endpoint.nodeId,\n endpointIndex: this.endpoint.index,\n supportedSensorTypes: supported,\n });\n return this.host.sendCommand(cc, this.commandOptions);\n }\n}\n@commandClass(CommandClasses[\"Binary Sensor\"])\n@implementedVersion(2)\n@ccValues(BinarySensorCCValues)\nexport class BinarySensorCC extends CommandClass {\n declare ccCommand: BinarySensorCommand;\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[\"Binary Sensor\"], 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 // Find out which sensor types this sensor supports\n if (api.version >= 2) {\n ctx.logNode(node.id, {\n endpoint: this.endpointIndex,\n message: \"querying supported sensor types...\",\n direction: \"outbound\",\n });\n const supportedSensorTypes = await api.getSupportedSensorTypes();\n if (supportedSensorTypes) {\n const logMessage = `received supported sensor types: ${supportedSensorTypes\n .map((type) => getEnumMemberName(BinarySensorType, type))\n .map((name) => `\\n\u00B7 ${name}`)\n .join(\"\")}`;\n ctx.logNode(node.id, {\n endpoint: this.endpointIndex,\n message: logMessage,\n direction: \"inbound\",\n });\n }\n else {\n ctx.logNode(node.id, {\n endpoint: this.endpointIndex,\n message: \"Querying supported sensor types timed out, skipping interview...\",\n level: \"warn\",\n });\n return;\n }\n }\n await this.refreshValues(ctx);\n // Remember that the interview is complete\n this.setInterviewComplete(ctx, true);\n }\n public async refreshValues(ctx: RefreshValuesContext): Promise<void> {\n const node = this.getNode(ctx)!;\n const endpoint = this.getEndpoint(ctx)!;\n const api = CCAPI.create(CommandClasses[\"Binary Sensor\"], ctx, endpoint).withOptions({\n priority: MessagePriority.NodeQuery,\n });\n // Query (all of) the sensor's current value(s)\n if (api.version === 1) {\n ctx.logNode(node.id, {\n endpoint: this.endpointIndex,\n message: \"querying current value...\",\n direction: \"outbound\",\n });\n const currentValue = await api.get();\n if (currentValue != undefined) {\n ctx.logNode(node.id, {\n endpoint: this.endpointIndex,\n message: `received current value: ${currentValue}`,\n direction: \"inbound\",\n });\n }\n }\n else {\n const supportedSensorTypes: readonly BinarySensorType[] = this.getValue(ctx, BinarySensorCCValues.supportedSensorTypes) ?? [];\n for (const type of supportedSensorTypes) {\n // Some devices report invalid sensor types, but the CC API checks\n // for valid values and throws otherwise.\n if (!isEnumMember(BinarySensorType, type))\n continue;\n const sensorName = getEnumMemberName(BinarySensorType, type);\n ctx.logNode(node.id, {\n endpoint: this.endpointIndex,\n message: `querying current value for ${sensorName}...`,\n direction: \"outbound\",\n });\n const currentValue = await api.get(type);\n if (currentValue != undefined) {\n ctx.logNode(node.id, {\n endpoint: this.endpointIndex,\n message: `received current value for ${sensorName}: ${currentValue}`,\n direction: \"inbound\",\n });\n }\n }\n }\n }\n /**\n * Returns which sensor types are supported.\n * This only works AFTER the interview process\n */\n public static getSupportedSensorTypesCached(ctx: GetValueDB, endpoint: EndpointId): MaybeNotKnown<BinarySensorType[]> {\n return ctx\n .getValueDB(endpoint.nodeId)\n .getValue(BinarySensorCCValues.supportedSensorTypes.endpoint(endpoint.index));\n }\n public setMappedBasicValue(ctx: GetValueDB, value: number): boolean {\n // Prefer setting an existing value to avoid creating a spurious \"Any\" sensor type.\n // Check for the Any type first (backwards compat), then the first one that\n // already exists in the value DB. Fall back to Any if none exist.\n const valueDB = this.getValueDB(ctx);\n const anyValueId = BinarySensorCCValues.state(BinarySensorType.Any)\n .endpoint(this.endpointIndex);\n let sensorType: BinarySensorType;\n if (valueDB.hasMetadata(anyValueId)) {\n sensorType = BinarySensorType.Any;\n }\n else {\n const existingSensorTypes = valueDB\n .getAllMetadata(CommandClasses[\"Binary Sensor\"])\n .filter((v) => v.endpoint === this.endpointIndex\n && BinarySensorCCValues.state.is(v))\n .map((v) => (v.metadata as {\n ccSpecific?: {\n sensorType?: BinarySensorType;\n };\n })?.ccSpecific?.sensorType)\n .filter((t): t is BinarySensorType => t != undefined)\n .toSorted((a, b) => a - b);\n sensorType = existingSensorTypes[0] ?? BinarySensorType.Any;\n }\n const binarySensorValue = BinarySensorCCValues.state(sensorType);\n this.setValue(ctx, binarySensorValue, value > 0);\n return true;\n }\n}\n// @publicAPI\nexport interface BinarySensorCCReportOptions {\n type?: BinarySensorType;\n value: boolean;\n}\n@CCCommand(BinarySensorCommand.Report)\nexport class BinarySensorCCReport extends BinarySensorCC {\n public constructor(options: WithAddress<BinarySensorCCReportOptions>) {\n super(options);\n this.type = options.type ?? BinarySensorType.Any;\n this.value = options.value;\n }\n public static from(raw: CCRaw, ctx: CCParsingContext): BinarySensorCCReport {\n validatePayload(raw.payload.length >= 1);\n const value = raw.payload[0] === 0xff;\n let type: BinarySensorType = BinarySensorType.Any;\n if (raw.payload.length >= 2) {\n type = raw.payload[1];\n }\n return new this({\n nodeId: ctx.sourceNodeId,\n value,\n type,\n });\n }\n public persistValues(ctx: PersistValuesContext): boolean {\n if (!super.persistValues(ctx))\n return false;\n // Workaround for devices reporting with sensor type Any -> find first supported sensor type and use that\n let sensorType = this.type;\n if (sensorType === BinarySensorType.Any) {\n const supportedSensorTypes = this.getValue<BinarySensorType[]>(ctx, BinarySensorCCValues.supportedSensorTypes);\n if (supportedSensorTypes?.length) {\n sensorType = supportedSensorTypes[0];\n }\n }\n const binarySensorValue = BinarySensorCCValues.state(sensorType);\n this.setMetadata(ctx, binarySensorValue, binarySensorValue.meta);\n this.setValue(ctx, binarySensorValue, this.value);\n return true;\n }\n public type: BinarySensorType;\n public value: boolean;\n public serialize(ctx: CCEncodingContext): Promise<Bytes> {\n this.payload = Bytes.from([this.value ? 0xff : 0x00, this.type]);\n return super.serialize(ctx);\n }\n public toLogEntry(ctx?: GetValueDB): MessageOrCCLogEntry {\n return {\n ...super.toLogEntry(ctx),\n message: {\n type: getEnumMemberName(BinarySensorType, this.type),\n value: this.value,\n },\n };\n }\n}\nfunction testResponseForBinarySensorGet(sent: BinarySensorCCGet, received: BinarySensorCCReport) {\n // We expect a Binary Sensor Report that matches the requested sensor type (if a type was requested)\n return (sent.sensorType == undefined\n || sent.sensorType === BinarySensorType.Any\n || received.type === sent.sensorType\n // This is technically not correct, but some devices do this anyways\n || received.type === BinarySensorType.Any);\n}\n// @publicAPI\nexport interface BinarySensorCCGetOptions {\n sensorType?: BinarySensorType;\n}\n@CCCommand(BinarySensorCommand.Get)\n@expectedCCResponse(BinarySensorCCReport, testResponseForBinarySensorGet)\nexport class BinarySensorCCGet extends BinarySensorCC {\n public constructor(options: WithAddress<BinarySensorCCGetOptions>) {\n super(options);\n this.sensorType = options.sensorType;\n }\n public static from(raw: CCRaw, ctx: CCParsingContext): BinarySensorCCGet {\n let sensorType: BinarySensorType | undefined;\n if (raw.payload.length >= 1) {\n sensorType = raw.payload[0];\n }\n return new this({\n nodeId: ctx.sourceNodeId,\n sensorType,\n });\n }\n public sensorType: BinarySensorType | undefined;\n public serialize(ctx: CCEncodingContext): Promise<Bytes> {\n this.payload = Bytes.from([this.sensorType ?? BinarySensorType.Any]);\n return super.serialize(ctx);\n }\n public toLogEntry(ctx?: GetValueDB): MessageOrCCLogEntry {\n return {\n ...super.toLogEntry(ctx),\n message: {\n type: getEnumMemberName(BinarySensorType, this.sensorType ?? BinarySensorType.Any),\n },\n };\n }\n}\n// @publicAPI\nexport interface BinarySensorCCSupportedReportOptions {\n supportedSensorTypes: BinarySensorType[];\n}\n@CCCommand(BinarySensorCommand.SupportedReport)\n@ccValueProperty(\"supportedSensorTypes\", BinarySensorCCValues.supportedSensorTypes)\nexport class BinarySensorCCSupportedReport extends BinarySensorCC {\n public constructor(options: WithAddress<BinarySensorCCSupportedReportOptions>) {\n super(options);\n this.supportedSensorTypes = options.supportedSensorTypes;\n }\n public static from(raw: CCRaw, ctx: CCParsingContext): BinarySensorCCSupportedReport {\n validatePayload(raw.payload.length >= 1);\n // The enumeration starts at 1, but the first (reserved) bit is included\n // in the report\n const supportedSensorTypes: BinarySensorType[] = parseBitMask(raw.payload, 0)\n .filter((t) => t !== 0);\n return new this({\n nodeId: ctx.sourceNodeId,\n supportedSensorTypes,\n });\n }\n public supportedSensorTypes: BinarySensorType[];\n public serialize(ctx: CCEncodingContext): Promise<Bytes> {\n this.payload = encodeBitMask(this.supportedSensorTypes.filter((t) => t !== BinarySensorType.Any), undefined, 0);\n return super.serialize(ctx);\n }\n public toLogEntry(ctx?: GetValueDB): MessageOrCCLogEntry {\n return {\n ...super.toLogEntry(ctx),\n message: {\n \"supported types\": this.supportedSensorTypes\n .map((type) => getEnumMemberName(BinarySensorType, type))\n .join(\", \"),\n },\n };\n }\n}\n@CCCommand(BinarySensorCommand.SupportedGet)\n@expectedCCResponse(BinarySensorCCSupportedReport)\nexport class BinarySensorCCSupportedGet extends BinarySensorCC {\n}\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,qBAAgC;AAEhC,kBAAwO;AACxO,oBAAuD;AACvD,iBAA0G;AAC1G,0BAAuH;AACvH,oCAAiH;AAEjH,mBAAsD;AAEtD,gCAAqC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AATrC,MAAM,EAAE,oCAAoC,2CAA2C,0DAAyD,IAAK;IAaxI,qBAAiB,MAAA;8BAD7B,mCAAI,2BAAe,e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AAA;;;AAAa,wBAAA,YAAA,uBAAA;;;;;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
|
-
"sources": ["../../../
|
|
4
|
-
"sourcesContent": [
|
|
3
|
+
"sources": ["../../../src_gen/cc/BinarySwitchCC._validateArgs.ts"],
|
|
4
|
+
"sourcesContent": ["import { Duration } from \"@zwave-js/core\";\nimport * as v from \"@zwave-js/core/validation\";\n\nexport function validateArgs_BinarySwitchCCAPI_set() {\n\treturn <T extends Function>(__decoratedMethod: T, { kind }: ClassMethodDecoratorContext): T | void => {\n\t\tif (kind === \"method\") {\n\t\t\treturn function set(this: any, targetValue: unknown, duration: unknown) {\n\t\t\t\tv.assert(\n\t\t\t\t\tv.primitive({ kind: \"parameter\", name: \"targetValue\" }, \"boolean\")(targetValue),\n\n\t\t\t\t\tv.optional({ kind: \"parameter\", name: \"duration\" }, v.oneOf({ kind: \"parameter\", name: \"duration\" }, undefined, v.primitive({ kind: \"parameter\", name: \"duration\" }, \"string\"), v.class({ kind: \"parameter\", name: \"duration\" }, \"Duration\", Duration)))(duration),\n\t\t\t\t);\n\t\t\t\treturn __decoratedMethod.call(this, targetValue, duration);\n\t\t\t} as unknown as T;\n\t\t}\n\t};\n}"],
|
|
5
5
|
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;;;;;AAAA,kBAAyB;AACzB,QAAmB;AAEb,SAAU,qCAAkC;AACjD,SAAO,CAAqB,mBAAsB,EAAE,KAAI,MAA6C;AACpG,QAAI,SAAS,UAAU;AACtB,aAAO,gCAAS,IAAe,aAAsB,UAAiB;AACrE,UAAE,OACD,EAAE,UAAU,EAAE,MAAM,aAAa,MAAM,cAAa,GAAI,SAAS,EAAE,WAAW,GAE9E,EAAE,SAAS,EAAE,MAAM,aAAa,MAAM,WAAU,GAAI,EAAE,MAAM,EAAE,MAAM,aAAa,MAAM,WAAU,GAAI,QAAW,EAAE,UAAU,EAAE,MAAM,aAAa,MAAM,WAAU,GAAI,QAAQ,GAAG,EAAE,MAAM,EAAE,MAAM,aAAa,MAAM,WAAU,GAAI,YAAY,oBAAQ,CAAC,CAAC,EAAE,QAAQ,CAAC;AAEnQ,eAAO,kBAAkB,KAAK,MAAM,aAAa,QAAQ;MAC1D,GAPO;IAQR;EACD;AACD;AAbgB;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|