@zwave-js/cc 15.21.1 → 15.22.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.d.ts +1 -1
- package/build/cjs/cc/AlarmSensorCC.d.ts +3 -3
- package/build/cjs/cc/AlarmSensorCC.js +18 -57
- package/build/cjs/cc/AlarmSensorCC.js.map +2 -2
- package/build/cjs/cc/ApplicationStatusCC.js +9 -48
- package/build/cjs/cc/ApplicationStatusCC.js.map +1 -1
- package/build/cjs/cc/AssociationCC._validateArgs.d.ts +8 -8
- package/build/cjs/cc/AssociationCC.d.ts +2 -2
- package/build/cjs/cc/AssociationCC.js +32 -71
- package/build/cjs/cc/AssociationCC.js.map +2 -2
- package/build/cjs/cc/AssociationGroupInfoCC._validateArgs.d.ts +6 -6
- package/build/cjs/cc/AssociationGroupInfoCC.d.ts +3 -3
- package/build/cjs/cc/AssociationGroupInfoCC.js +28 -65
- package/build/cjs/cc/AssociationGroupInfoCC.js.map +2 -2
- package/build/cjs/cc/BarrierOperatorCC._validateArgs.d.ts +4 -4
- package/build/cjs/cc/BarrierOperatorCC.d.ts +3 -3
- package/build/cjs/cc/BarrierOperatorCC.js +30 -67
- package/build/cjs/cc/BarrierOperatorCC.js.map +2 -2
- package/build/cjs/cc/BasicCC._validateArgs.d.ts +1 -1
- package/build/cjs/cc/BasicCC.d.ts +3 -3
- package/build/cjs/cc/BasicCC.js +17 -54
- package/build/cjs/cc/BasicCC.js.map +2 -2
- package/build/cjs/cc/BasicWindowCoveringCC._validateArgs.d.ts +2 -2
- package/build/cjs/cc/BasicWindowCoveringCC.js +12 -51
- package/build/cjs/cc/BasicWindowCoveringCC.js.map +1 -1
- package/build/cjs/cc/BatteryCC.d.ts +3 -3
- package/build/cjs/cc/BatteryCC.js +15 -54
- package/build/cjs/cc/BatteryCC.js.map +2 -2
- package/build/cjs/cc/BinarySensorCC._validateArgs.d.ts +3 -3
- package/build/cjs/cc/BinarySensorCC.d.ts +2 -2
- package/build/cjs/cc/BinarySensorCC.js +19 -58
- package/build/cjs/cc/BinarySensorCC.js.map +2 -2
- package/build/cjs/cc/BinarySwitchCC._validateArgs.d.ts +1 -1
- package/build/cjs/cc/BinarySwitchCC.d.ts +2 -2
- package/build/cjs/cc/BinarySwitchCC.js +17 -54
- package/build/cjs/cc/BinarySwitchCC.js.map +2 -2
- package/build/cjs/cc/CRC16CC.js +7 -46
- package/build/cjs/cc/CRC16CC.js.map +1 -1
- package/build/cjs/cc/CentralSceneCC._validateArgs.d.ts +1 -1
- package/build/cjs/cc/CentralSceneCC.d.ts +1 -1
- package/build/cjs/cc/CentralSceneCC.js +19 -58
- package/build/cjs/cc/CentralSceneCC.js.map +1 -1
- package/build/cjs/cc/ClimateControlScheduleCC._validateArgs.d.ts +3 -3
- package/build/cjs/cc/ClimateControlScheduleCC.js +25 -64
- package/build/cjs/cc/ClimateControlScheduleCC.js.map +1 -1
- package/build/cjs/cc/ClockCC._validateArgs.d.ts +1 -1
- package/build/cjs/cc/ClockCC.d.ts +3 -3
- package/build/cjs/cc/ClockCC.js +15 -54
- package/build/cjs/cc/ClockCC.js.map +2 -2
- package/build/cjs/cc/ColorSwitchCC._validateArgs.d.ts +4 -4
- package/build/cjs/cc/ColorSwitchCC.d.ts +3 -3
- package/build/cjs/cc/ColorSwitchCC.js +26 -65
- package/build/cjs/cc/ColorSwitchCC.js.map +2 -2
- package/build/cjs/cc/ConfigurationCC._validateArgs.d.ts +9 -9
- package/build/cjs/cc/ConfigurationCC.d.ts +3 -8
- package/build/cjs/cc/ConfigurationCC.js +43 -82
- package/build/cjs/cc/ConfigurationCC.js.map +2 -2
- package/build/cjs/cc/DeviceResetLocallyCC.js +7 -46
- package/build/cjs/cc/DeviceResetLocallyCC.js.map +1 -1
- package/build/cjs/cc/DoorLockCC._validateArgs.d.ts +2 -2
- package/build/cjs/cc/DoorLockCC.d.ts +5 -5
- package/build/cjs/cc/DoorLockCC.js +26 -65
- package/build/cjs/cc/DoorLockCC.js.map +2 -2
- package/build/cjs/cc/DoorLockLoggingCC._validateArgs.d.ts +1 -1
- package/build/cjs/cc/DoorLockLoggingCC.d.ts +2 -2
- package/build/cjs/cc/DoorLockLoggingCC.js +17 -56
- package/build/cjs/cc/DoorLockLoggingCC.js.map +2 -2
- package/build/cjs/cc/EnergyProductionCC._validateArgs.d.ts +1 -1
- package/build/cjs/cc/EnergyProductionCC.d.ts +2 -2
- package/build/cjs/cc/EnergyProductionCC.js +13 -52
- package/build/cjs/cc/EnergyProductionCC.js.map +2 -2
- package/build/cjs/cc/EntryControlCC._validateArgs.d.ts +1 -1
- package/build/cjs/cc/EntryControlCC.d.ts +3 -3
- package/build/cjs/cc/EntryControlCC.js +25 -64
- package/build/cjs/cc/EntryControlCC.js.map +2 -2
- package/build/cjs/cc/FirmwareUpdateMetaDataCC._validateArgs.d.ts +6 -6
- package/build/cjs/cc/FirmwareUpdateMetaDataCC.js +34 -73
- package/build/cjs/cc/FirmwareUpdateMetaDataCC.js.map +1 -1
- package/build/cjs/cc/HailCC.js +3 -42
- package/build/cjs/cc/HailCC.js.map +1 -1
- package/build/cjs/cc/HumidityControlModeCC._validateArgs.d.ts +1 -1
- package/build/cjs/cc/HumidityControlModeCC.d.ts +2 -2
- package/build/cjs/cc/HumidityControlModeCC.js +19 -58
- package/build/cjs/cc/HumidityControlModeCC.js.map +2 -2
- package/build/cjs/cc/HumidityControlOperatingStateCC.d.ts +2 -2
- package/build/cjs/cc/HumidityControlOperatingStateCC.js +11 -50
- package/build/cjs/cc/HumidityControlOperatingStateCC.js.map +2 -2
- package/build/cjs/cc/HumidityControlSetpointCC._validateArgs.d.ts +4 -4
- package/build/cjs/cc/HumidityControlSetpointCC.d.ts +2 -2
- package/build/cjs/cc/HumidityControlSetpointCC.js +30 -69
- package/build/cjs/cc/HumidityControlSetpointCC.js.map +2 -2
- package/build/cjs/cc/InclusionControllerCC.js +9 -48
- package/build/cjs/cc/InclusionControllerCC.js.map +1 -1
- package/build/cjs/cc/IndicatorCC._validateArgs.d.ts +9 -9
- package/build/cjs/cc/IndicatorCC.d.ts +2 -2
- package/build/cjs/cc/IndicatorCC.js +31 -70
- package/build/cjs/cc/IndicatorCC.js.map +2 -2
- package/build/cjs/cc/IrrigationCC._validateArgs.d.ts +10 -10
- package/build/cjs/cc/IrrigationCC.d.ts +7 -7
- package/build/cjs/cc/IrrigationCC.js +54 -93
- package/build/cjs/cc/IrrigationCC.js.map +2 -2
- package/build/cjs/cc/LanguageCC._validateArgs.d.ts +1 -1
- package/build/cjs/cc/LanguageCC.d.ts +3 -3
- package/build/cjs/cc/LanguageCC.js +15 -54
- package/build/cjs/cc/LanguageCC.js.map +2 -2
- package/build/cjs/cc/LockCC._validateArgs.d.ts +1 -1
- package/build/cjs/cc/LockCC.d.ts +2 -2
- package/build/cjs/cc/LockCC.js +15 -54
- package/build/cjs/cc/LockCC.js.map +2 -2
- package/build/cjs/cc/ManufacturerProprietaryCC._validateArgs.d.ts +2 -2
- package/build/cjs/cc/ManufacturerProprietaryCC.d.ts +2 -2
- package/build/cjs/cc/ManufacturerProprietaryCC.js +10 -49
- package/build/cjs/cc/ManufacturerProprietaryCC.js.map +2 -2
- package/build/cjs/cc/ManufacturerSpecificCC._validateArgs.d.ts +2 -2
- package/build/cjs/cc/ManufacturerSpecificCC.d.ts +1 -1
- package/build/cjs/cc/ManufacturerSpecificCC.js +16 -55
- package/build/cjs/cc/ManufacturerSpecificCC.js.map +1 -1
- package/build/cjs/cc/MeterCC._validateArgs.d.ts +5 -5
- package/build/cjs/cc/MeterCC.d.ts +3 -3
- package/build/cjs/cc/MeterCC.js +23 -62
- package/build/cjs/cc/MeterCC.js.map +2 -2
- package/build/cjs/cc/MultiChannelAssociationCC._validateArgs.d.ts +5 -5
- package/build/cjs/cc/MultiChannelAssociationCC.d.ts +3 -3
- package/build/cjs/cc/MultiChannelAssociationCC.js +26 -65
- package/build/cjs/cc/MultiChannelAssociationCC.js.map +2 -2
- package/build/cjs/cc/MultiChannelCC._validateArgs.d.ts +4 -4
- package/build/cjs/cc/MultiChannelCC.js +34 -73
- package/build/cjs/cc/MultiChannelCC.js.map +1 -1
- package/build/cjs/cc/MultiCommandCC._validateArgs.d.ts +1 -1
- package/build/cjs/cc/MultiCommandCC.js +9 -48
- package/build/cjs/cc/MultiCommandCC.js.map +1 -1
- package/build/cjs/cc/MultilevelSensorCC._validateArgs.d.ts +3 -3
- package/build/cjs/cc/MultilevelSensorCC.d.ts +2 -2
- package/build/cjs/cc/MultilevelSensorCC.js +23 -62
- package/build/cjs/cc/MultilevelSensorCC.js.map +2 -2
- package/build/cjs/cc/MultilevelSwitchCC._validateArgs.d.ts +2 -2
- package/build/cjs/cc/MultilevelSwitchCC.d.ts +3 -3
- package/build/cjs/cc/MultilevelSwitchCC.js +26 -63
- package/build/cjs/cc/MultilevelSwitchCC.js.map +2 -2
- package/build/cjs/cc/NoOperationCC.js +5 -44
- package/build/cjs/cc/NoOperationCC.js.map +1 -1
- package/build/cjs/cc/NodeNamingCC._validateArgs.d.ts +2 -2
- package/build/cjs/cc/NodeNamingCC.d.ts +2 -2
- package/build/cjs/cc/NodeNamingCC.js +22 -61
- package/build/cjs/cc/NodeNamingCC.js.map +2 -2
- package/build/cjs/cc/NotificationCC._validateArgs.d.ts +4 -4
- package/build/cjs/cc/NotificationCC.d.ts +22 -5
- package/build/cjs/cc/NotificationCC.js +141 -104
- package/build/cjs/cc/NotificationCC.js.map +2 -2
- package/build/cjs/cc/PowerlevelCC._validateArgs.d.ts +4 -4
- package/build/cjs/cc/PowerlevelCC.d.ts +2 -2
- package/build/cjs/cc/PowerlevelCC.js +22 -61
- package/build/cjs/cc/PowerlevelCC.js.map +1 -1
- package/build/cjs/cc/ProtectionCC._validateArgs.d.ts +3 -3
- package/build/cjs/cc/ProtectionCC.d.ts +3 -3
- package/build/cjs/cc/ProtectionCC.js +33 -72
- package/build/cjs/cc/ProtectionCC.js.map +2 -2
- package/build/cjs/cc/SceneActivationCC._validateArgs.d.ts +1 -1
- package/build/cjs/cc/SceneActivationCC.js +9 -48
- package/build/cjs/cc/SceneActivationCC.js.map +1 -1
- package/build/cjs/cc/SceneActuatorConfigurationCC._validateArgs.d.ts +2 -2
- package/build/cjs/cc/SceneActuatorConfigurationCC.js +14 -53
- package/build/cjs/cc/SceneActuatorConfigurationCC.js.map +1 -1
- package/build/cjs/cc/SceneControllerConfigurationCC._validateArgs.d.ts +3 -3
- package/build/cjs/cc/SceneControllerConfigurationCC.d.ts +2 -2
- package/build/cjs/cc/SceneControllerConfigurationCC.js +17 -56
- package/build/cjs/cc/SceneControllerConfigurationCC.js.map +2 -2
- package/build/cjs/cc/ScheduleEntryLockCC._validateArgs.d.ts +8 -8
- package/build/cjs/cc/ScheduleEntryLockCC.d.ts +1 -1
- package/build/cjs/cc/ScheduleEntryLockCC.js +46 -85
- package/build/cjs/cc/ScheduleEntryLockCC.js.map +1 -1
- package/build/cjs/cc/Security2CC.d.ts +1 -1
- package/build/cjs/cc/Security2CC.js +33 -72
- package/build/cjs/cc/Security2CC.js.map +1 -1
- package/build/cjs/cc/SecurityCC.d.ts +1 -1
- package/build/cjs/cc/SecurityCC.js +27 -66
- package/build/cjs/cc/SecurityCC.js.map +2 -2
- package/build/cjs/cc/SoundSwitchCC._validateArgs.d.ts +3 -3
- package/build/cjs/cc/SoundSwitchCC.d.ts +2 -2
- package/build/cjs/cc/SoundSwitchCC.js +29 -68
- package/build/cjs/cc/SoundSwitchCC.js.map +1 -1
- package/build/cjs/cc/SupervisionCC.js +9 -48
- package/build/cjs/cc/SupervisionCC.js.map +1 -1
- package/build/cjs/cc/ThermostatFanModeCC._validateArgs.d.ts +1 -1
- package/build/cjs/cc/ThermostatFanModeCC.d.ts +2 -2
- package/build/cjs/cc/ThermostatFanModeCC.js +19 -58
- package/build/cjs/cc/ThermostatFanModeCC.js.map +2 -2
- package/build/cjs/cc/ThermostatFanStateCC.d.ts +2 -2
- package/build/cjs/cc/ThermostatFanStateCC.js +11 -50
- package/build/cjs/cc/ThermostatFanStateCC.js.map +2 -2
- package/build/cjs/cc/ThermostatModeCC._validateArgs.d.ts +1 -1
- package/build/cjs/cc/ThermostatModeCC.d.ts +3 -3
- package/build/cjs/cc/ThermostatModeCC.js +19 -58
- package/build/cjs/cc/ThermostatModeCC.js.map +2 -2
- package/build/cjs/cc/ThermostatOperatingStateCC.d.ts +2 -2
- package/build/cjs/cc/ThermostatOperatingStateCC.js +11 -50
- package/build/cjs/cc/ThermostatOperatingStateCC.js.map +2 -2
- package/build/cjs/cc/ThermostatSetbackCC._validateArgs.d.ts +1 -1
- package/build/cjs/cc/ThermostatSetbackCC.d.ts +3 -3
- package/build/cjs/cc/ThermostatSetbackCC.js +15 -54
- package/build/cjs/cc/ThermostatSetbackCC.js.map +2 -2
- package/build/cjs/cc/ThermostatSetpointCC._validateArgs.d.ts +3 -3
- package/build/cjs/cc/ThermostatSetpointCC.d.ts +3 -3
- package/build/cjs/cc/ThermostatSetpointCC.js +25 -64
- package/build/cjs/cc/ThermostatSetpointCC.js.map +2 -2
- package/build/cjs/cc/TimeCC._validateArgs.d.ts +4 -4
- package/build/cjs/cc/TimeCC.d.ts +1 -1
- package/build/cjs/cc/TimeCC.js +24 -63
- package/build/cjs/cc/TimeCC.js.map +1 -1
- package/build/cjs/cc/TimeParametersCC._validateArgs.d.ts +1 -1
- package/build/cjs/cc/TimeParametersCC.js +13 -52
- package/build/cjs/cc/TimeParametersCC.js.map +1 -1
- package/build/cjs/cc/TransportServiceCC.js +13 -52
- package/build/cjs/cc/TransportServiceCC.js.map +1 -1
- package/build/cjs/cc/UserCodeCC._validateArgs.d.ts +6 -6
- package/build/cjs/cc/UserCodeCC.d.ts +7 -5
- package/build/cjs/cc/UserCodeCC.js +89 -98
- package/build/cjs/cc/UserCodeCC.js.map +2 -2
- package/build/cjs/cc/VersionCC._validateArgs.d.ts +3 -3
- package/build/cjs/cc/VersionCC.d.ts +2 -2
- package/build/cjs/cc/VersionCC.js +25 -64
- package/build/cjs/cc/VersionCC.js.map +1 -1
- package/build/cjs/cc/WakeUpCC._validateArgs.d.ts +1 -1
- package/build/cjs/cc/WakeUpCC.d.ts +1 -1
- package/build/cjs/cc/WakeUpCC.js +21 -60
- package/build/cjs/cc/WakeUpCC.js.map +1 -1
- package/build/cjs/cc/WindowCoveringCC._validateArgs.d.ts +4 -4
- package/build/cjs/cc/WindowCoveringCC.d.ts +3 -3
- package/build/cjs/cc/WindowCoveringCC.js +28 -65
- package/build/cjs/cc/WindowCoveringCC.js.map +2 -2
- package/build/cjs/cc/ZWaveLongRangeCC.js +3 -42
- package/build/cjs/cc/ZWaveLongRangeCC.js.map +1 -1
- package/build/cjs/cc/ZWavePlusCC._validateArgs.d.ts +1 -1
- package/build/cjs/cc/ZWavePlusCC.d.ts +1 -1
- package/build/cjs/cc/ZWavePlusCC.js +11 -50
- package/build/cjs/cc/ZWavePlusCC.js.map +1 -1
- package/build/cjs/cc/ZWaveProtocolCC.js +73 -112
- package/build/cjs/cc/ZWaveProtocolCC.js.map +1 -1
- package/build/cjs/cc/_CCValues.generated.d.ts +1173 -1049
- package/build/cjs/cc/_CCValues.generated.js +68 -5
- package/build/cjs/cc/_CCValues.generated.js.map +2 -2
- package/build/cjs/cc/manufacturerProprietary/FibaroCC._validateArgs.d.ts +2 -2
- package/build/cjs/cc/manufacturerProprietary/FibaroCC.d.ts +3 -3
- package/build/cjs/cc/manufacturerProprietary/FibaroCC.js +22 -59
- package/build/cjs/cc/manufacturerProprietary/FibaroCC.js.map +2 -2
- package/build/cjs/lib/API.d.ts +1 -0
- package/build/cjs/lib/API.js.map +2 -2
- package/build/cjs/lib/CommandClass.d.ts +6 -2
- package/build/cjs/lib/CommandClass.js +2 -1
- package/build/cjs/lib/CommandClass.js.map +2 -2
- package/build/cjs/lib/Security2/Extension.js +9 -48
- package/build/cjs/lib/Security2/Extension.js.map +1 -1
- package/build/cjs/lib/Values.d.ts +5 -5
- package/build/cjs/lib/Values.js.map +2 -2
- package/build/cjs/lib/_CCAPI.generated.d.ts +64 -64
- package/build/esm/cc/AlarmSensorCC._validateArgs.d.ts +1 -1
- package/build/esm/cc/AlarmSensorCC._validateArgs.d.ts.map +1 -1
- package/build/esm/cc/AlarmSensorCC.d.ts +3 -3
- package/build/esm/cc/AlarmSensorCC.d.ts.map +1 -1
- package/build/esm/cc/AlarmSensorCC.js +9 -38
- package/build/esm/cc/AlarmSensorCC.js.map +1 -1
- package/build/esm/cc/ApplicationStatusCC.d.ts.map +1 -1
- package/build/esm/cc/ApplicationStatusCC.js +1 -34
- package/build/esm/cc/ApplicationStatusCC.js.map +1 -1
- package/build/esm/cc/AssociationCC._validateArgs.d.ts +8 -8
- package/build/esm/cc/AssociationCC._validateArgs.d.ts.map +1 -1
- package/build/esm/cc/AssociationCC.d.ts +2 -2
- package/build/esm/cc/AssociationCC.d.ts.map +1 -1
- package/build/esm/cc/AssociationCC.js +3 -36
- package/build/esm/cc/AssociationCC.js.map +1 -1
- package/build/esm/cc/AssociationGroupInfoCC._validateArgs.d.ts +6 -6
- package/build/esm/cc/AssociationGroupInfoCC._validateArgs.d.ts.map +1 -1
- package/build/esm/cc/AssociationGroupInfoCC.d.ts +3 -3
- package/build/esm/cc/AssociationGroupInfoCC.d.ts.map +1 -1
- package/build/esm/cc/AssociationGroupInfoCC.js +5 -36
- package/build/esm/cc/AssociationGroupInfoCC.js.map +1 -1
- package/build/esm/cc/BarrierOperatorCC._validateArgs.d.ts +4 -4
- package/build/esm/cc/BarrierOperatorCC._validateArgs.d.ts.map +1 -1
- package/build/esm/cc/BarrierOperatorCC.d.ts +3 -3
- package/build/esm/cc/BarrierOperatorCC.d.ts.map +1 -1
- package/build/esm/cc/BarrierOperatorCC.js +5 -36
- package/build/esm/cc/BarrierOperatorCC.js.map +1 -1
- package/build/esm/cc/BasicCC._validateArgs.d.ts +1 -1
- package/build/esm/cc/BasicCC._validateArgs.d.ts.map +1 -1
- package/build/esm/cc/BasicCC.d.ts +3 -3
- package/build/esm/cc/BasicCC.d.ts.map +1 -1
- package/build/esm/cc/BasicCC.js +5 -36
- package/build/esm/cc/BasicCC.js.map +1 -1
- package/build/esm/cc/BasicWindowCoveringCC._validateArgs.d.ts +2 -2
- package/build/esm/cc/BasicWindowCoveringCC._validateArgs.d.ts.map +1 -1
- package/build/esm/cc/BasicWindowCoveringCC.d.ts.map +1 -1
- package/build/esm/cc/BasicWindowCoveringCC.js +1 -34
- package/build/esm/cc/BasicWindowCoveringCC.js.map +1 -1
- package/build/esm/cc/BatteryCC.d.ts +3 -3
- package/build/esm/cc/BatteryCC.d.ts.map +1 -1
- package/build/esm/cc/BatteryCC.js +3 -36
- package/build/esm/cc/BatteryCC.js.map +1 -1
- package/build/esm/cc/BinarySensorCC._validateArgs.d.ts +3 -3
- package/build/esm/cc/BinarySensorCC._validateArgs.d.ts.map +1 -1
- package/build/esm/cc/BinarySensorCC.d.ts +2 -2
- package/build/esm/cc/BinarySensorCC.d.ts.map +1 -1
- package/build/esm/cc/BinarySensorCC.js +3 -36
- package/build/esm/cc/BinarySensorCC.js.map +1 -1
- package/build/esm/cc/BinarySwitchCC._validateArgs.d.ts +1 -1
- package/build/esm/cc/BinarySwitchCC._validateArgs.d.ts.map +1 -1
- package/build/esm/cc/BinarySwitchCC.d.ts +2 -2
- package/build/esm/cc/BinarySwitchCC.d.ts.map +1 -1
- package/build/esm/cc/BinarySwitchCC.js +5 -36
- package/build/esm/cc/BinarySwitchCC.js.map +1 -1
- package/build/esm/cc/CRC16CC.d.ts.map +1 -1
- package/build/esm/cc/CRC16CC.js +1 -34
- package/build/esm/cc/CRC16CC.js.map +1 -1
- package/build/esm/cc/CentralSceneCC._validateArgs.d.ts +1 -1
- package/build/esm/cc/CentralSceneCC._validateArgs.d.ts.map +1 -1
- package/build/esm/cc/CentralSceneCC.d.ts +1 -1
- package/build/esm/cc/CentralSceneCC.d.ts.map +1 -1
- package/build/esm/cc/CentralSceneCC.js +1 -34
- package/build/esm/cc/CentralSceneCC.js.map +1 -1
- package/build/esm/cc/ClimateControlScheduleCC._validateArgs.d.ts +3 -3
- package/build/esm/cc/ClimateControlScheduleCC._validateArgs.d.ts.map +1 -1
- package/build/esm/cc/ClimateControlScheduleCC.d.ts.map +1 -1
- package/build/esm/cc/ClimateControlScheduleCC.js +1 -34
- package/build/esm/cc/ClimateControlScheduleCC.js.map +1 -1
- package/build/esm/cc/ClockCC._validateArgs.d.ts +1 -1
- package/build/esm/cc/ClockCC._validateArgs.d.ts.map +1 -1
- package/build/esm/cc/ClockCC.d.ts +3 -3
- package/build/esm/cc/ClockCC.d.ts.map +1 -1
- package/build/esm/cc/ClockCC.js +3 -36
- package/build/esm/cc/ClockCC.js.map +1 -1
- package/build/esm/cc/ColorSwitchCC._validateArgs.d.ts +4 -4
- package/build/esm/cc/ColorSwitchCC._validateArgs.d.ts.map +1 -1
- package/build/esm/cc/ColorSwitchCC.d.ts +3 -3
- package/build/esm/cc/ColorSwitchCC.d.ts.map +1 -1
- package/build/esm/cc/ColorSwitchCC.js +3 -36
- package/build/esm/cc/ColorSwitchCC.js.map +1 -1
- package/build/esm/cc/ConfigurationCC._validateArgs.d.ts +9 -9
- package/build/esm/cc/ConfigurationCC._validateArgs.d.ts.map +1 -1
- package/build/esm/cc/ConfigurationCC.d.ts +3 -8
- package/build/esm/cc/ConfigurationCC.d.ts.map +1 -1
- package/build/esm/cc/ConfigurationCC.js +3 -36
- package/build/esm/cc/ConfigurationCC.js.map +1 -1
- package/build/esm/cc/DeviceResetLocallyCC.d.ts.map +1 -1
- package/build/esm/cc/DeviceResetLocallyCC.js +1 -34
- package/build/esm/cc/DeviceResetLocallyCC.js.map +1 -1
- package/build/esm/cc/DoorLockCC._validateArgs.d.ts +2 -2
- package/build/esm/cc/DoorLockCC._validateArgs.d.ts.map +1 -1
- package/build/esm/cc/DoorLockCC.d.ts +5 -5
- package/build/esm/cc/DoorLockCC.d.ts.map +1 -1
- package/build/esm/cc/DoorLockCC.js +3 -36
- package/build/esm/cc/DoorLockCC.js.map +1 -1
- package/build/esm/cc/DoorLockLoggingCC._validateArgs.d.ts +1 -1
- package/build/esm/cc/DoorLockLoggingCC._validateArgs.d.ts.map +1 -1
- package/build/esm/cc/DoorLockLoggingCC.d.ts +2 -2
- package/build/esm/cc/DoorLockLoggingCC.d.ts.map +1 -1
- package/build/esm/cc/DoorLockLoggingCC.js +3 -36
- package/build/esm/cc/DoorLockLoggingCC.js.map +1 -1
- package/build/esm/cc/EnergyProductionCC._validateArgs.d.ts +1 -1
- package/build/esm/cc/EnergyProductionCC._validateArgs.d.ts.map +1 -1
- package/build/esm/cc/EnergyProductionCC.d.ts +2 -2
- package/build/esm/cc/EnergyProductionCC.d.ts.map +1 -1
- package/build/esm/cc/EnergyProductionCC.js +3 -36
- package/build/esm/cc/EnergyProductionCC.js.map +1 -1
- package/build/esm/cc/EntryControlCC._validateArgs.d.ts +1 -1
- package/build/esm/cc/EntryControlCC._validateArgs.d.ts.map +1 -1
- package/build/esm/cc/EntryControlCC.d.ts +3 -3
- package/build/esm/cc/EntryControlCC.d.ts.map +1 -1
- package/build/esm/cc/EntryControlCC.js +3 -36
- package/build/esm/cc/EntryControlCC.js.map +1 -1
- package/build/esm/cc/FirmwareUpdateMetaDataCC._validateArgs.d.ts +6 -6
- package/build/esm/cc/FirmwareUpdateMetaDataCC._validateArgs.d.ts.map +1 -1
- package/build/esm/cc/FirmwareUpdateMetaDataCC.d.ts.map +1 -1
- package/build/esm/cc/FirmwareUpdateMetaDataCC.js +1 -34
- package/build/esm/cc/FirmwareUpdateMetaDataCC.js.map +1 -1
- package/build/esm/cc/HailCC.js +1 -34
- package/build/esm/cc/HailCC.js.map +1 -1
- package/build/esm/cc/HumidityControlModeCC._validateArgs.d.ts +1 -1
- package/build/esm/cc/HumidityControlModeCC._validateArgs.d.ts.map +1 -1
- package/build/esm/cc/HumidityControlModeCC.d.ts +2 -2
- package/build/esm/cc/HumidityControlModeCC.d.ts.map +1 -1
- package/build/esm/cc/HumidityControlModeCC.js +3 -36
- package/build/esm/cc/HumidityControlModeCC.js.map +1 -1
- package/build/esm/cc/HumidityControlOperatingStateCC.d.ts +2 -2
- package/build/esm/cc/HumidityControlOperatingStateCC.d.ts.map +1 -1
- package/build/esm/cc/HumidityControlOperatingStateCC.js +3 -36
- package/build/esm/cc/HumidityControlOperatingStateCC.js.map +1 -1
- package/build/esm/cc/HumidityControlSetpointCC._validateArgs.d.ts +4 -4
- package/build/esm/cc/HumidityControlSetpointCC._validateArgs.d.ts.map +1 -1
- package/build/esm/cc/HumidityControlSetpointCC.d.ts +2 -2
- package/build/esm/cc/HumidityControlSetpointCC.d.ts.map +1 -1
- package/build/esm/cc/HumidityControlSetpointCC.js +3 -36
- package/build/esm/cc/HumidityControlSetpointCC.js.map +1 -1
- package/build/esm/cc/InclusionControllerCC.d.ts.map +1 -1
- package/build/esm/cc/InclusionControllerCC.js +1 -34
- package/build/esm/cc/InclusionControllerCC.js.map +1 -1
- package/build/esm/cc/IndicatorCC._validateArgs.d.ts +9 -9
- package/build/esm/cc/IndicatorCC._validateArgs.d.ts.map +1 -1
- package/build/esm/cc/IndicatorCC.d.ts +2 -2
- package/build/esm/cc/IndicatorCC.d.ts.map +1 -1
- package/build/esm/cc/IndicatorCC.js +3 -36
- package/build/esm/cc/IndicatorCC.js.map +1 -1
- package/build/esm/cc/IrrigationCC._validateArgs.d.ts +10 -10
- package/build/esm/cc/IrrigationCC._validateArgs.d.ts.map +1 -1
- package/build/esm/cc/IrrigationCC.d.ts +7 -7
- package/build/esm/cc/IrrigationCC.d.ts.map +1 -1
- package/build/esm/cc/IrrigationCC.js +3 -36
- package/build/esm/cc/IrrigationCC.js.map +1 -1
- package/build/esm/cc/LanguageCC._validateArgs.d.ts +1 -1
- package/build/esm/cc/LanguageCC._validateArgs.d.ts.map +1 -1
- package/build/esm/cc/LanguageCC.d.ts +3 -3
- package/build/esm/cc/LanguageCC.d.ts.map +1 -1
- package/build/esm/cc/LanguageCC.js +3 -36
- package/build/esm/cc/LanguageCC.js.map +1 -1
- package/build/esm/cc/LockCC._validateArgs.d.ts +1 -1
- package/build/esm/cc/LockCC._validateArgs.d.ts.map +1 -1
- package/build/esm/cc/LockCC.d.ts +2 -2
- package/build/esm/cc/LockCC.d.ts.map +1 -1
- package/build/esm/cc/LockCC.js +3 -36
- package/build/esm/cc/LockCC.js.map +1 -1
- package/build/esm/cc/ManufacturerProprietaryCC._validateArgs.d.ts +2 -2
- package/build/esm/cc/ManufacturerProprietaryCC._validateArgs.d.ts.map +1 -1
- package/build/esm/cc/ManufacturerProprietaryCC.d.ts +2 -2
- package/build/esm/cc/ManufacturerProprietaryCC.d.ts.map +1 -1
- package/build/esm/cc/ManufacturerProprietaryCC.js +3 -36
- package/build/esm/cc/ManufacturerProprietaryCC.js.map +1 -1
- package/build/esm/cc/ManufacturerSpecificCC._validateArgs.d.ts +2 -2
- package/build/esm/cc/ManufacturerSpecificCC._validateArgs.d.ts.map +1 -1
- package/build/esm/cc/ManufacturerSpecificCC.d.ts +1 -1
- package/build/esm/cc/ManufacturerSpecificCC.d.ts.map +1 -1
- package/build/esm/cc/ManufacturerSpecificCC.js +1 -34
- package/build/esm/cc/ManufacturerSpecificCC.js.map +1 -1
- package/build/esm/cc/MeterCC._validateArgs.d.ts +5 -5
- package/build/esm/cc/MeterCC._validateArgs.d.ts.map +1 -1
- package/build/esm/cc/MeterCC.d.ts +3 -3
- package/build/esm/cc/MeterCC.d.ts.map +1 -1
- package/build/esm/cc/MeterCC.js +3 -36
- package/build/esm/cc/MeterCC.js.map +1 -1
- package/build/esm/cc/MultiChannelAssociationCC._validateArgs.d.ts +5 -5
- package/build/esm/cc/MultiChannelAssociationCC._validateArgs.d.ts.map +1 -1
- package/build/esm/cc/MultiChannelAssociationCC.d.ts +3 -3
- package/build/esm/cc/MultiChannelAssociationCC.d.ts.map +1 -1
- package/build/esm/cc/MultiChannelAssociationCC.js +4 -37
- package/build/esm/cc/MultiChannelAssociationCC.js.map +1 -1
- package/build/esm/cc/MultiChannelCC._validateArgs.d.ts +4 -4
- package/build/esm/cc/MultiChannelCC._validateArgs.d.ts.map +1 -1
- package/build/esm/cc/MultiChannelCC.d.ts.map +1 -1
- package/build/esm/cc/MultiChannelCC.js +1 -34
- package/build/esm/cc/MultiChannelCC.js.map +1 -1
- package/build/esm/cc/MultiCommandCC._validateArgs.d.ts +1 -1
- package/build/esm/cc/MultiCommandCC._validateArgs.d.ts.map +1 -1
- package/build/esm/cc/MultiCommandCC.d.ts.map +1 -1
- package/build/esm/cc/MultiCommandCC.js +1 -34
- package/build/esm/cc/MultiCommandCC.js.map +1 -1
- package/build/esm/cc/MultilevelSensorCC._validateArgs.d.ts +3 -3
- package/build/esm/cc/MultilevelSensorCC._validateArgs.d.ts.map +1 -1
- package/build/esm/cc/MultilevelSensorCC.d.ts +2 -2
- package/build/esm/cc/MultilevelSensorCC.d.ts.map +1 -1
- package/build/esm/cc/MultilevelSensorCC.js +3 -36
- package/build/esm/cc/MultilevelSensorCC.js.map +1 -1
- package/build/esm/cc/MultilevelSwitchCC._validateArgs.d.ts +2 -2
- package/build/esm/cc/MultilevelSwitchCC._validateArgs.d.ts.map +1 -1
- package/build/esm/cc/MultilevelSwitchCC.d.ts +3 -3
- package/build/esm/cc/MultilevelSwitchCC.d.ts.map +1 -1
- package/build/esm/cc/MultilevelSwitchCC.js +5 -36
- 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 +1 -34
- package/build/esm/cc/NoOperationCC.js.map +1 -1
- package/build/esm/cc/NodeNamingCC._validateArgs.d.ts +2 -2
- package/build/esm/cc/NodeNamingCC._validateArgs.d.ts.map +1 -1
- package/build/esm/cc/NodeNamingCC.d.ts +2 -2
- package/build/esm/cc/NodeNamingCC.d.ts.map +1 -1
- package/build/esm/cc/NodeNamingCC.js +3 -36
- package/build/esm/cc/NodeNamingCC.js.map +1 -1
- package/build/esm/cc/NotificationCC._validateArgs.d.ts +4 -4
- package/build/esm/cc/NotificationCC._validateArgs.d.ts.map +1 -1
- package/build/esm/cc/NotificationCC.d.ts +22 -5
- package/build/esm/cc/NotificationCC.d.ts.map +1 -1
- package/build/esm/cc/NotificationCC.js +143 -89
- package/build/esm/cc/NotificationCC.js.map +1 -1
- package/build/esm/cc/PowerlevelCC._validateArgs.d.ts +4 -4
- package/build/esm/cc/PowerlevelCC._validateArgs.d.ts.map +1 -1
- package/build/esm/cc/PowerlevelCC.d.ts +2 -2
- package/build/esm/cc/PowerlevelCC.d.ts.map +1 -1
- package/build/esm/cc/PowerlevelCC.js +1 -34
- package/build/esm/cc/PowerlevelCC.js.map +1 -1
- package/build/esm/cc/ProtectionCC._validateArgs.d.ts +3 -3
- package/build/esm/cc/ProtectionCC._validateArgs.d.ts.map +1 -1
- package/build/esm/cc/ProtectionCC.d.ts +3 -3
- package/build/esm/cc/ProtectionCC.d.ts.map +1 -1
- package/build/esm/cc/ProtectionCC.js +3 -36
- package/build/esm/cc/ProtectionCC.js.map +1 -1
- package/build/esm/cc/SceneActivationCC._validateArgs.d.ts +1 -1
- package/build/esm/cc/SceneActivationCC._validateArgs.d.ts.map +1 -1
- package/build/esm/cc/SceneActivationCC.d.ts.map +1 -1
- package/build/esm/cc/SceneActivationCC.js +1 -34
- package/build/esm/cc/SceneActivationCC.js.map +1 -1
- package/build/esm/cc/SceneActuatorConfigurationCC._validateArgs.d.ts +2 -2
- package/build/esm/cc/SceneActuatorConfigurationCC._validateArgs.d.ts.map +1 -1
- package/build/esm/cc/SceneActuatorConfigurationCC.d.ts.map +1 -1
- package/build/esm/cc/SceneActuatorConfigurationCC.js +1 -34
- package/build/esm/cc/SceneActuatorConfigurationCC.js.map +1 -1
- package/build/esm/cc/SceneControllerConfigurationCC._validateArgs.d.ts +3 -3
- package/build/esm/cc/SceneControllerConfigurationCC._validateArgs.d.ts.map +1 -1
- package/build/esm/cc/SceneControllerConfigurationCC.d.ts +2 -2
- package/build/esm/cc/SceneControllerConfigurationCC.d.ts.map +1 -1
- package/build/esm/cc/SceneControllerConfigurationCC.js +3 -36
- package/build/esm/cc/SceneControllerConfigurationCC.js.map +1 -1
- package/build/esm/cc/ScheduleEntryLockCC._validateArgs.d.ts +8 -8
- package/build/esm/cc/ScheduleEntryLockCC._validateArgs.d.ts.map +1 -1
- package/build/esm/cc/ScheduleEntryLockCC.d.ts +1 -1
- package/build/esm/cc/ScheduleEntryLockCC.d.ts.map +1 -1
- package/build/esm/cc/ScheduleEntryLockCC.js +1 -34
- 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 +1 -34
- package/build/esm/cc/Security2CC.js.map +1 -1
- package/build/esm/cc/SecurityCC.d.ts +1 -1
- package/build/esm/cc/SecurityCC.d.ts.map +1 -1
- package/build/esm/cc/SecurityCC.js +2 -36
- package/build/esm/cc/SecurityCC.js.map +1 -1
- package/build/esm/cc/SoundSwitchCC._validateArgs.d.ts +3 -3
- package/build/esm/cc/SoundSwitchCC._validateArgs.d.ts.map +1 -1
- package/build/esm/cc/SoundSwitchCC.d.ts +2 -2
- package/build/esm/cc/SoundSwitchCC.d.ts.map +1 -1
- package/build/esm/cc/SoundSwitchCC.js +1 -34
- package/build/esm/cc/SoundSwitchCC.js.map +1 -1
- package/build/esm/cc/SupervisionCC.d.ts.map +1 -1
- package/build/esm/cc/SupervisionCC.js +1 -34
- package/build/esm/cc/SupervisionCC.js.map +1 -1
- package/build/esm/cc/ThermostatFanModeCC._validateArgs.d.ts +1 -1
- package/build/esm/cc/ThermostatFanModeCC._validateArgs.d.ts.map +1 -1
- package/build/esm/cc/ThermostatFanModeCC.d.ts +2 -2
- package/build/esm/cc/ThermostatFanModeCC.d.ts.map +1 -1
- package/build/esm/cc/ThermostatFanModeCC.js +3 -36
- package/build/esm/cc/ThermostatFanModeCC.js.map +1 -1
- package/build/esm/cc/ThermostatFanStateCC.d.ts +2 -2
- package/build/esm/cc/ThermostatFanStateCC.d.ts.map +1 -1
- package/build/esm/cc/ThermostatFanStateCC.js +3 -36
- package/build/esm/cc/ThermostatFanStateCC.js.map +1 -1
- package/build/esm/cc/ThermostatModeCC._validateArgs.d.ts +1 -1
- package/build/esm/cc/ThermostatModeCC._validateArgs.d.ts.map +1 -1
- package/build/esm/cc/ThermostatModeCC.d.ts +3 -3
- package/build/esm/cc/ThermostatModeCC.d.ts.map +1 -1
- package/build/esm/cc/ThermostatModeCC.js +3 -36
- package/build/esm/cc/ThermostatModeCC.js.map +1 -1
- package/build/esm/cc/ThermostatOperatingStateCC.d.ts +2 -2
- package/build/esm/cc/ThermostatOperatingStateCC.d.ts.map +1 -1
- package/build/esm/cc/ThermostatOperatingStateCC.js +3 -36
- package/build/esm/cc/ThermostatOperatingStateCC.js.map +1 -1
- package/build/esm/cc/ThermostatSetbackCC._validateArgs.d.ts +1 -1
- package/build/esm/cc/ThermostatSetbackCC._validateArgs.d.ts.map +1 -1
- package/build/esm/cc/ThermostatSetbackCC.d.ts +3 -3
- package/build/esm/cc/ThermostatSetbackCC.d.ts.map +1 -1
- package/build/esm/cc/ThermostatSetbackCC.js +3 -36
- package/build/esm/cc/ThermostatSetbackCC.js.map +1 -1
- package/build/esm/cc/ThermostatSetpointCC._validateArgs.d.ts +3 -3
- package/build/esm/cc/ThermostatSetpointCC._validateArgs.d.ts.map +1 -1
- package/build/esm/cc/ThermostatSetpointCC.d.ts +3 -3
- package/build/esm/cc/ThermostatSetpointCC.d.ts.map +1 -1
- package/build/esm/cc/ThermostatSetpointCC.js +3 -36
- package/build/esm/cc/ThermostatSetpointCC.js.map +1 -1
- package/build/esm/cc/TimeCC._validateArgs.d.ts +4 -4
- package/build/esm/cc/TimeCC._validateArgs.d.ts.map +1 -1
- package/build/esm/cc/TimeCC.d.ts +1 -1
- package/build/esm/cc/TimeCC.d.ts.map +1 -1
- package/build/esm/cc/TimeCC.js +1 -34
- package/build/esm/cc/TimeCC.js.map +1 -1
- package/build/esm/cc/TimeParametersCC._validateArgs.d.ts +1 -1
- package/build/esm/cc/TimeParametersCC._validateArgs.d.ts.map +1 -1
- package/build/esm/cc/TimeParametersCC.d.ts.map +1 -1
- package/build/esm/cc/TimeParametersCC.js +1 -34
- package/build/esm/cc/TimeParametersCC.js.map +1 -1
- package/build/esm/cc/TransportServiceCC.d.ts.map +1 -1
- package/build/esm/cc/TransportServiceCC.js +1 -34
- package/build/esm/cc/TransportServiceCC.js.map +1 -1
- package/build/esm/cc/UserCodeCC._validateArgs.d.ts +6 -6
- package/build/esm/cc/UserCodeCC._validateArgs.d.ts.map +1 -1
- package/build/esm/cc/UserCodeCC.d.ts +7 -5
- package/build/esm/cc/UserCodeCC.d.ts.map +1 -1
- package/build/esm/cc/UserCodeCC.js +55 -48
- package/build/esm/cc/UserCodeCC.js.map +1 -1
- package/build/esm/cc/VersionCC._validateArgs.d.ts +3 -3
- package/build/esm/cc/VersionCC._validateArgs.d.ts.map +1 -1
- package/build/esm/cc/VersionCC.d.ts +2 -2
- package/build/esm/cc/VersionCC.d.ts.map +1 -1
- package/build/esm/cc/VersionCC.js +1 -34
- package/build/esm/cc/VersionCC.js.map +1 -1
- package/build/esm/cc/WakeUpCC._validateArgs.d.ts +1 -1
- package/build/esm/cc/WakeUpCC._validateArgs.d.ts.map +1 -1
- package/build/esm/cc/WakeUpCC.d.ts +1 -1
- package/build/esm/cc/WakeUpCC.d.ts.map +1 -1
- package/build/esm/cc/WakeUpCC.js +1 -34
- package/build/esm/cc/WakeUpCC.js.map +1 -1
- package/build/esm/cc/WindowCoveringCC._validateArgs.d.ts +4 -4
- package/build/esm/cc/WindowCoveringCC._validateArgs.d.ts.map +1 -1
- package/build/esm/cc/WindowCoveringCC.d.ts +3 -3
- package/build/esm/cc/WindowCoveringCC.d.ts.map +1 -1
- package/build/esm/cc/WindowCoveringCC.js +5 -36
- package/build/esm/cc/WindowCoveringCC.js.map +1 -1
- package/build/esm/cc/ZWaveLongRangeCC.js +1 -34
- package/build/esm/cc/ZWaveLongRangeCC.js.map +1 -1
- package/build/esm/cc/ZWavePlusCC._validateArgs.d.ts +1 -1
- package/build/esm/cc/ZWavePlusCC._validateArgs.d.ts.map +1 -1
- package/build/esm/cc/ZWavePlusCC.d.ts +1 -1
- package/build/esm/cc/ZWavePlusCC.d.ts.map +1 -1
- package/build/esm/cc/ZWavePlusCC.js +1 -34
- package/build/esm/cc/ZWavePlusCC.js.map +1 -1
- package/build/esm/cc/ZWaveProtocolCC.d.ts.map +1 -1
- package/build/esm/cc/ZWaveProtocolCC.js +1 -34
- package/build/esm/cc/ZWaveProtocolCC.js.map +1 -1
- package/build/esm/cc/_CCValues.generated.d.ts +1173 -1049
- package/build/esm/cc/_CCValues.generated.d.ts.map +1 -1
- package/build/esm/cc/_CCValues.generated.js +71 -4
- package/build/esm/cc/_CCValues.generated.js.map +1 -1
- package/build/esm/cc/manufacturerProprietary/FibaroCC._validateArgs.d.ts +2 -2
- package/build/esm/cc/manufacturerProprietary/FibaroCC._validateArgs.d.ts.map +1 -1
- package/build/esm/cc/manufacturerProprietary/FibaroCC.d.ts +3 -3
- package/build/esm/cc/manufacturerProprietary/FibaroCC.d.ts.map +1 -1
- package/build/esm/cc/manufacturerProprietary/FibaroCC.js +7 -38
- package/build/esm/cc/manufacturerProprietary/FibaroCC.js.map +1 -1
- package/build/esm/lib/API.d.ts +1 -0
- package/build/esm/lib/API.d.ts.map +1 -1
- package/build/esm/lib/API.js.map +1 -1
- package/build/esm/lib/CommandClass.d.ts +6 -2
- package/build/esm/lib/CommandClass.d.ts.map +1 -1
- package/build/esm/lib/CommandClass.js +4 -2
- package/build/esm/lib/CommandClass.js.map +1 -1
- package/build/esm/lib/Security2/Extension.d.ts.map +1 -1
- package/build/esm/lib/Security2/Extension.js +1 -34
- package/build/esm/lib/Security2/Extension.js.map +1 -1
- package/build/esm/lib/Values.d.ts +5 -5
- package/build/esm/lib/Values.d.ts.map +1 -1
- package/build/esm/lib/Values.js +4 -1
- package/build/esm/lib/Values.js.map +1 -1
- package/build/esm/lib/_CCAPI.generated.d.ts +64 -64
- package/build/esm/lib/_CCAPI.generated.d.ts.map +1 -1
- package/build/esm/lib/serializers.js.map +1 -1
- package/package.json +17 -15
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export declare function validateArgs_BinarySensorCCAPI_get(): <T extends Function>(__decoratedMethod: T, { kind }: ClassMethodDecoratorContext) =>
|
|
2
|
-
export declare function validateArgs_BinarySensorCCAPI_sendReport(): <T extends Function>(__decoratedMethod: T, { kind }: ClassMethodDecoratorContext) =>
|
|
3
|
-
export declare function validateArgs_BinarySensorCCAPI_reportSupportedSensorTypes(): <T extends Function>(__decoratedMethod: T, { kind }: ClassMethodDecoratorContext) =>
|
|
1
|
+
export declare function validateArgs_BinarySensorCCAPI_get(): <T extends Function>(__decoratedMethod: T, { kind }: ClassMethodDecoratorContext<unknown, (this: unknown, ...args: any) => any>) => void | T;
|
|
2
|
+
export declare function validateArgs_BinarySensorCCAPI_sendReport(): <T extends Function>(__decoratedMethod: T, { kind }: ClassMethodDecoratorContext<unknown, (this: unknown, ...args: any) => any>) => void | T;
|
|
3
|
+
export declare function validateArgs_BinarySensorCCAPI_reportSupportedSensorTypes(): <T extends Function>(__decoratedMethod: T, { kind }: ClassMethodDecoratorContext<unknown, (this: unknown, ...args: any) => any>) => void | T;
|
|
4
4
|
//# sourceMappingURL=BinarySensorCC._validateArgs.d.ts.map
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { type EndpointId, type GetValueDB, type MaybeNotKnown, type MessageOrCCLogEntry, type SupervisionResult, type WithAddress } from "@zwave-js/core";
|
|
2
2
|
import { Bytes } from "@zwave-js/shared";
|
|
3
3
|
import { POLL_VALUE, PhysicalCCAPI, type PollValueImplementation } from "../lib/API.js";
|
|
4
|
-
import { type CCRaw, CommandClass, type InterviewContext, type PersistValuesContext, type RefreshValuesContext } from "../lib/CommandClass.js";
|
|
4
|
+
import { type CCRaw, CommandClass, type InterviewContext, type PersistValuesContext, type RefreshValuesContext, type RefreshValuesOptions } from "../lib/CommandClass.js";
|
|
5
5
|
import { BinarySensorCommand, BinarySensorType } from "../lib/_Types.js";
|
|
6
6
|
import type { CCEncodingContext, CCParsingContext } from "../lib/traits.js";
|
|
7
7
|
import { BinarySensorCCValues } from "./_CCValues.generated.js";
|
|
@@ -21,7 +21,7 @@ export declare class BinarySensorCCAPI extends PhysicalCCAPI {
|
|
|
21
21
|
export declare class BinarySensorCC extends CommandClass {
|
|
22
22
|
ccCommand: BinarySensorCommand;
|
|
23
23
|
interview(ctx: InterviewContext): Promise<void>;
|
|
24
|
-
refreshValues(ctx: RefreshValuesContext): Promise<void>;
|
|
24
|
+
refreshValues(ctx: RefreshValuesContext, options?: RefreshValuesOptions): Promise<void>;
|
|
25
25
|
/**
|
|
26
26
|
* Returns which sensor types are supported.
|
|
27
27
|
* This only works AFTER the interview process
|
|
@@ -38,6 +38,7 @@ __export(BinarySensorCC_exports, {
|
|
|
38
38
|
BinarySensorCCValues: () => import_CCValues_generated.BinarySensorCCValues
|
|
39
39
|
});
|
|
40
40
|
module.exports = __toCommonJS(BinarySensorCC_exports);
|
|
41
|
+
var import_tslib = require("tslib");
|
|
41
42
|
var __validateArgs = __toESM(require("./BinarySensorCC._validateArgs.js"), 1);
|
|
42
43
|
var import_core = require("@zwave-js/core");
|
|
43
44
|
var import_shared = require("@zwave-js/shared");
|
|
@@ -46,46 +47,6 @@ var import_CommandClass = require("../lib/CommandClass.js");
|
|
|
46
47
|
var import_CommandClassDecorators = require("../lib/CommandClassDecorators.js");
|
|
47
48
|
var import_Types = require("../lib/_Types.js");
|
|
48
49
|
var import_CCValues_generated = require("./_CCValues.generated.js");
|
|
49
|
-
var __runInitializers = function(thisArg, initializers, value) {
|
|
50
|
-
var useValue = arguments.length > 2;
|
|
51
|
-
for (var i = 0; i < initializers.length; i++) {
|
|
52
|
-
value = useValue ? initializers[i].call(thisArg, value) : initializers[i].call(thisArg);
|
|
53
|
-
}
|
|
54
|
-
return useValue ? value : void 0;
|
|
55
|
-
};
|
|
56
|
-
var __esDecorate = function(ctor, descriptorIn, decorators, contextIn, initializers, extraInitializers) {
|
|
57
|
-
function accept(f) {
|
|
58
|
-
if (f !== void 0 && typeof f !== "function") throw new TypeError("Function expected");
|
|
59
|
-
return f;
|
|
60
|
-
}
|
|
61
|
-
__name(accept, "accept");
|
|
62
|
-
var kind = contextIn.kind, key = kind === "getter" ? "get" : kind === "setter" ? "set" : "value";
|
|
63
|
-
var target = !descriptorIn && ctor ? contextIn["static"] ? ctor : ctor.prototype : null;
|
|
64
|
-
var descriptor = descriptorIn || (target ? Object.getOwnPropertyDescriptor(target, contextIn.name) : {});
|
|
65
|
-
var _, done = false;
|
|
66
|
-
for (var i = decorators.length - 1; i >= 0; i--) {
|
|
67
|
-
var context = {};
|
|
68
|
-
for (var p in contextIn) context[p] = p === "access" ? {} : contextIn[p];
|
|
69
|
-
for (var p in contextIn.access) context.access[p] = contextIn.access[p];
|
|
70
|
-
context.addInitializer = function(f) {
|
|
71
|
-
if (done) throw new TypeError("Cannot add initializers after decoration has completed");
|
|
72
|
-
extraInitializers.push(accept(f || null));
|
|
73
|
-
};
|
|
74
|
-
var result = (0, decorators[i])(kind === "accessor" ? { get: descriptor.get, set: descriptor.set } : descriptor[key], context);
|
|
75
|
-
if (kind === "accessor") {
|
|
76
|
-
if (result === void 0) continue;
|
|
77
|
-
if (result === null || typeof result !== "object") throw new TypeError("Object expected");
|
|
78
|
-
if (_ = accept(result.get)) descriptor.get = _;
|
|
79
|
-
if (_ = accept(result.set)) descriptor.set = _;
|
|
80
|
-
if (_ = accept(result.init)) initializers.unshift(_);
|
|
81
|
-
} else if (_ = accept(result)) {
|
|
82
|
-
if (kind === "field") initializers.unshift(_);
|
|
83
|
-
else descriptor[key] = _;
|
|
84
|
-
}
|
|
85
|
-
}
|
|
86
|
-
if (target) Object.defineProperty(target, contextIn.name, descriptor);
|
|
87
|
-
done = true;
|
|
88
|
-
};
|
|
89
50
|
const { validateArgs_BinarySensorCCAPI_get, validateArgs_BinarySensorCCAPI_sendReport, validateArgs_BinarySensorCCAPI_reportSupportedSensorTypes } = __validateArgs;
|
|
90
51
|
let BinarySensorCCAPI = (() => {
|
|
91
52
|
let _classDecorators = [(0, import_CommandClassDecorators.API)(import_core.CommandClasses["Binary Sensor"])];
|
|
@@ -109,13 +70,13 @@ let BinarySensorCCAPI = (() => {
|
|
|
109
70
|
_get_decorators = [validateArgs_BinarySensorCCAPI_get()];
|
|
110
71
|
_sendReport_decorators = [validateArgs_BinarySensorCCAPI_sendReport()];
|
|
111
72
|
_reportSupportedSensorTypes_decorators = [validateArgs_BinarySensorCCAPI_reportSupportedSensorTypes()];
|
|
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);
|
|
113
|
-
__esDecorate(this, null, _sendReport_decorators, { kind: "method", name: "sendReport", static: false, private: false, access: { has: /* @__PURE__ */ __name((obj) => "sendReport" in obj, "has"), get: /* @__PURE__ */ __name((obj) => obj.sendReport, "get") }, metadata: _metadata }, null, _instanceExtraInitializers);
|
|
114
|
-
__esDecorate(this, null, _reportSupportedSensorTypes_decorators, { kind: "method", name: "reportSupportedSensorTypes", static: false, private: false, access: { has: /* @__PURE__ */ __name((obj) => "reportSupportedSensorTypes" in obj, "has"), get: /* @__PURE__ */ __name((obj) => obj.reportSupportedSensorTypes, "get") }, metadata: _metadata }, null, _instanceExtraInitializers);
|
|
115
|
-
__esDecorate(null, _classDescriptor = { value: _classThis }, _classDecorators, { kind: "class", name: _classThis.name, metadata: _metadata }, null, _classExtraInitializers);
|
|
73
|
+
(0, import_tslib.__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);
|
|
74
|
+
(0, import_tslib.__esDecorate)(this, null, _sendReport_decorators, { kind: "method", name: "sendReport", static: false, private: false, access: { has: /* @__PURE__ */ __name((obj) => "sendReport" in obj, "has"), get: /* @__PURE__ */ __name((obj) => obj.sendReport, "get") }, metadata: _metadata }, null, _instanceExtraInitializers);
|
|
75
|
+
(0, import_tslib.__esDecorate)(this, null, _reportSupportedSensorTypes_decorators, { kind: "method", name: "reportSupportedSensorTypes", static: false, private: false, access: { has: /* @__PURE__ */ __name((obj) => "reportSupportedSensorTypes" in obj, "has"), get: /* @__PURE__ */ __name((obj) => obj.reportSupportedSensorTypes, "get") }, metadata: _metadata }, null, _instanceExtraInitializers);
|
|
76
|
+
(0, import_tslib.__esDecorate)(null, _classDescriptor = { value: _classThis }, _classDecorators, { kind: "class", name: _classThis.name, metadata: _metadata }, null, _classExtraInitializers);
|
|
116
77
|
BinarySensorCCAPI2 = _classThis = _classDescriptor.value;
|
|
117
78
|
if (_metadata) Object.defineProperty(_classThis, Symbol.metadata, { enumerable: true, configurable: true, writable: true, value: _metadata });
|
|
118
|
-
__runInitializers(_classThis, _classExtraInitializers);
|
|
79
|
+
(0, import_tslib.__runInitializers)(_classThis, _classExtraInitializers);
|
|
119
80
|
}
|
|
120
81
|
supportsCommand(cmd) {
|
|
121
82
|
switch (cmd) {
|
|
@@ -183,7 +144,7 @@ let BinarySensorCCAPI = (() => {
|
|
|
183
144
|
}
|
|
184
145
|
constructor() {
|
|
185
146
|
super(...arguments);
|
|
186
|
-
__runInitializers(this, _instanceExtraInitializers);
|
|
147
|
+
(0, import_tslib.__runInitializers)(this, _instanceExtraInitializers);
|
|
187
148
|
}
|
|
188
149
|
};
|
|
189
150
|
return BinarySensorCCAPI2 = _classThis;
|
|
@@ -203,10 +164,10 @@ let BinarySensorCC = (() => {
|
|
|
203
164
|
}
|
|
204
165
|
static {
|
|
205
166
|
const _metadata = typeof Symbol === "function" && Symbol.metadata ? Object.create(_classSuper[Symbol.metadata] ?? null) : void 0;
|
|
206
|
-
__esDecorate(null, _classDescriptor = { value: _classThis }, _classDecorators, { kind: "class", name: _classThis.name, metadata: _metadata }, null, _classExtraInitializers);
|
|
167
|
+
(0, import_tslib.__esDecorate)(null, _classDescriptor = { value: _classThis }, _classDecorators, { kind: "class", name: _classThis.name, metadata: _metadata }, null, _classExtraInitializers);
|
|
207
168
|
BinarySensorCC2 = _classThis = _classDescriptor.value;
|
|
208
169
|
if (_metadata) Object.defineProperty(_classThis, Symbol.metadata, { enumerable: true, configurable: true, writable: true, value: _metadata });
|
|
209
|
-
__runInitializers(_classThis, _classExtraInitializers);
|
|
170
|
+
(0, import_tslib.__runInitializers)(_classThis, _classExtraInitializers);
|
|
210
171
|
}
|
|
211
172
|
async interview(ctx) {
|
|
212
173
|
const node = this.getNode(ctx);
|
|
@@ -246,11 +207,11 @@ let BinarySensorCC = (() => {
|
|
|
246
207
|
await this.refreshValues(ctx);
|
|
247
208
|
this.setInterviewComplete(ctx, true);
|
|
248
209
|
}
|
|
249
|
-
async refreshValues(ctx) {
|
|
210
|
+
async refreshValues(ctx, options) {
|
|
250
211
|
const node = this.getNode(ctx);
|
|
251
212
|
const endpoint = this.getEndpoint(ctx);
|
|
252
213
|
const api = import_API.CCAPI.create(import_core.CommandClasses["Binary Sensor"], ctx, endpoint).withOptions({
|
|
253
|
-
priority: import_core.MessagePriority.NodeQuery
|
|
214
|
+
priority: options?.priority ?? import_core.MessagePriority.NodeQuery
|
|
254
215
|
});
|
|
255
216
|
if (api.version === 1) {
|
|
256
217
|
ctx.logNode(node.id, {
|
|
@@ -327,10 +288,10 @@ let BinarySensorCCReport = (() => {
|
|
|
327
288
|
}
|
|
328
289
|
static {
|
|
329
290
|
const _metadata = typeof Symbol === "function" && Symbol.metadata ? Object.create(_classSuper[Symbol.metadata] ?? null) : void 0;
|
|
330
|
-
__esDecorate(null, _classDescriptor = { value: _classThis }, _classDecorators, { kind: "class", name: _classThis.name, metadata: _metadata }, null, _classExtraInitializers);
|
|
291
|
+
(0, import_tslib.__esDecorate)(null, _classDescriptor = { value: _classThis }, _classDecorators, { kind: "class", name: _classThis.name, metadata: _metadata }, null, _classExtraInitializers);
|
|
331
292
|
BinarySensorCCReport2 = _classThis = _classDescriptor.value;
|
|
332
293
|
if (_metadata) Object.defineProperty(_classThis, Symbol.metadata, { enumerable: true, configurable: true, writable: true, value: _metadata });
|
|
333
|
-
__runInitializers(_classThis, _classExtraInitializers);
|
|
294
|
+
(0, import_tslib.__runInitializers)(_classThis, _classExtraInitializers);
|
|
334
295
|
}
|
|
335
296
|
constructor(options) {
|
|
336
297
|
super(options);
|
|
@@ -402,10 +363,10 @@ let BinarySensorCCGet = (() => {
|
|
|
402
363
|
}
|
|
403
364
|
static {
|
|
404
365
|
const _metadata = typeof Symbol === "function" && Symbol.metadata ? Object.create(_classSuper[Symbol.metadata] ?? null) : void 0;
|
|
405
|
-
__esDecorate(null, _classDescriptor = { value: _classThis }, _classDecorators, { kind: "class", name: _classThis.name, metadata: _metadata }, null, _classExtraInitializers);
|
|
366
|
+
(0, import_tslib.__esDecorate)(null, _classDescriptor = { value: _classThis }, _classDecorators, { kind: "class", name: _classThis.name, metadata: _metadata }, null, _classExtraInitializers);
|
|
406
367
|
BinarySensorCCGet2 = _classThis = _classDescriptor.value;
|
|
407
368
|
if (_metadata) Object.defineProperty(_classThis, Symbol.metadata, { enumerable: true, configurable: true, writable: true, value: _metadata });
|
|
408
|
-
__runInitializers(_classThis, _classExtraInitializers);
|
|
369
|
+
(0, import_tslib.__runInitializers)(_classThis, _classExtraInitializers);
|
|
409
370
|
}
|
|
410
371
|
constructor(options) {
|
|
411
372
|
super(options);
|
|
@@ -452,10 +413,10 @@ let BinarySensorCCSupportedReport = (() => {
|
|
|
452
413
|
}
|
|
453
414
|
static {
|
|
454
415
|
const _metadata = typeof Symbol === "function" && Symbol.metadata ? Object.create(_classSuper[Symbol.metadata] ?? null) : void 0;
|
|
455
|
-
__esDecorate(null, _classDescriptor = { value: _classThis }, _classDecorators, { kind: "class", name: _classThis.name, metadata: _metadata }, null, _classExtraInitializers);
|
|
416
|
+
(0, import_tslib.__esDecorate)(null, _classDescriptor = { value: _classThis }, _classDecorators, { kind: "class", name: _classThis.name, metadata: _metadata }, null, _classExtraInitializers);
|
|
456
417
|
BinarySensorCCSupportedReport2 = _classThis = _classDescriptor.value;
|
|
457
418
|
if (_metadata) Object.defineProperty(_classThis, Symbol.metadata, { enumerable: true, configurable: true, writable: true, value: _metadata });
|
|
458
|
-
__runInitializers(_classThis, _classExtraInitializers);
|
|
419
|
+
(0, import_tslib.__runInitializers)(_classThis, _classExtraInitializers);
|
|
459
420
|
}
|
|
460
421
|
constructor(options) {
|
|
461
422
|
super(options);
|
|
@@ -500,10 +461,10 @@ let BinarySensorCCSupportedGet = (() => {
|
|
|
500
461
|
}
|
|
501
462
|
static {
|
|
502
463
|
const _metadata = typeof Symbol === "function" && Symbol.metadata ? Object.create(_classSuper[Symbol.metadata] ?? null) : void 0;
|
|
503
|
-
__esDecorate(null, _classDescriptor = { value: _classThis }, _classDecorators, { kind: "class", name: _classThis.name, metadata: _metadata }, null, _classExtraInitializers);
|
|
464
|
+
(0, import_tslib.__esDecorate)(null, _classDescriptor = { value: _classThis }, _classDecorators, { kind: "class", name: _classThis.name, metadata: _metadata }, null, _classExtraInitializers);
|
|
504
465
|
BinarySensorCCSupportedGet2 = _classThis = _classDescriptor.value;
|
|
505
466
|
if (_metadata) Object.defineProperty(_classThis, Symbol.metadata, { enumerable: true, configurable: true, writable: true, value: _metadata });
|
|
506
|
-
__runInitializers(_classThis, _classExtraInitializers);
|
|
467
|
+
(0, import_tslib.__runInitializers)(_classThis, _classExtraInitializers);
|
|
507
468
|
}
|
|
508
469
|
};
|
|
509
470
|
return BinarySensorCCSupportedGet2 = _classThis;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
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": "
|
|
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, type RefreshValuesOptions, } 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, options?: RefreshValuesOptions): 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: options?.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,0BAAkJ;AAClJ,oCAAiH;AAEjH,mBAAsD;AAEtD,gCAAqC;AATrC,MAAM,EAAE,oCAAoC,2CAA2C,0DAAyD,IAAK;IAaxI,qBAAiB,MAAA;8BAD7B,mCAAI,2BAAe,eAAe,CAAC,CAAC;;;;oBACE;;;;;yCAAA,YAAa;WAAA;;;;;;;;yBA0B/C,mCAAkC,CAAE;gCAYpC,0CAAyC,CAAE;gDAqB3C,0DAAyD,CAAE;AAhC5D,qCAAA,MAAA,MAAA,iBAAA,EAAA,MAAA,UAAA,MAAA,OAAA,QAAA,OAAA,SAAA,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AA,YAAc;WAAA;;;;;;;;AAAjE,qCAAA,MAAA,mBAAA,EAAA,OAAA,WAAA,GAAA,kBAAA,EAAA,MAAA,SAAA,MAAA,WAAA,MAAA,UAAA,UAAA,GAAA,MAAA,uBAAA;;;AAAa,0CAAA,YAAA,uBAAA;;IACT,YAAmB,SAA0D;AACzE,YAAM,OAAO;AACb,WAAK,uBAAuB,QAAQ;IACxC;IACO,OAAO,KAAK,KAAY,KAAqB;AAChD,uCAAgB,IAAI,QAAQ,UAAU,CAAC;AAGvC,YAAM,2BAA2C,0BAAa,IAAI,SAAS,CAAC,EACvE,OAAO,CAAC,MAAM,MAAM,CAAC;AAC1B,aAAO,IAAI,KAAK;QACZ,QAAQ,IAAI;QACZ;OACH;IACL;IACO;IACA,UAAU,KAAsB;AACnC,WAAK,cAAU,2BAAc,KAAK,qBAAqB,OAAO,CAAC,MAAM,MAAM,8BAAiB,GAAG,GAAG,QAAW,CAAC;AAC9G,aAAO,MAAM,UAAU,GAAG;IAC9B;IACO,WAAW,KAAgB;AAC9B,aAAO;QACH,GAAG,MAAM,WAAW,GAAG;QACvB,SAAS;UACL,mBAAmB,KAAK,qBACnB,IAAI,CAAC,aAAS,iCAAkB,+BAAkB,IAAI,CAAC,EACvD,KAAK,IAAI;;;IAG1B;;;;IAIS,8BAA0B,MAAA;8BAFtC,yCAAU,iCAAoB,YAAY,OAC1C,kDAAmB,6BAA6B,CAAC;;;;oBACF;kDAAA,YAAc;WAAA;;;;;;;;AAA9D,qCAAA,MAAA,mBAAA,EAAA,OAAA,WAAA,GAAA,kBAAA,EAAA,MAAA,SAAA,MAAA,WAAA,MAAA,UAAA,UAAA,GAAA,MAAA,uBAAA;;;AAAa,0CAAA,YAAA,uBAAA;;;;;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export declare function validateArgs_BinarySwitchCCAPI_set(): <T extends Function>(__decoratedMethod: T, { kind }: ClassMethodDecoratorContext) =>
|
|
1
|
+
export declare function validateArgs_BinarySwitchCCAPI_set(): <T extends Function>(__decoratedMethod: T, { kind }: ClassMethodDecoratorContext<unknown, (this: unknown, ...args: any) => any>) => void | T;
|
|
2
2
|
//# sourceMappingURL=BinarySwitchCC._validateArgs.d.ts.map
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { Duration, type GetValueDB, type MaybeNotKnown, type MaybeUnknown, type MessageOrCCLogEntry, type SupervisionResult, type WithAddress } from "@zwave-js/core";
|
|
2
2
|
import { Bytes } from "@zwave-js/shared";
|
|
3
3
|
import { CCAPI, POLL_VALUE, type PollValueImplementation, SET_VALUE, SET_VALUE_HOOKS, type SetValueImplementation, type SetValueImplementationHooksFactory } from "../lib/API.js";
|
|
4
|
-
import { type CCRaw, CommandClass, type InterviewContext, type RefreshValuesContext } from "../lib/CommandClass.js";
|
|
4
|
+
import { type CCRaw, CommandClass, type InterviewContext, type RefreshValuesContext, type RefreshValuesOptions } from "../lib/CommandClass.js";
|
|
5
5
|
import { BinarySwitchCommand } from "../lib/_Types.js";
|
|
6
6
|
import type { CCEncodingContext, CCParsingContext } from "../lib/traits.js";
|
|
7
7
|
import { BinarySwitchCCValues } from "./_CCValues.generated.js";
|
|
@@ -26,7 +26,7 @@ export declare class BinarySwitchCCAPI extends CCAPI {
|
|
|
26
26
|
export declare class BinarySwitchCC extends CommandClass {
|
|
27
27
|
ccCommand: BinarySwitchCommand;
|
|
28
28
|
interview(ctx: InterviewContext): Promise<void>;
|
|
29
|
-
refreshValues(ctx: RefreshValuesContext): Promise<void>;
|
|
29
|
+
refreshValues(ctx: RefreshValuesContext, options?: RefreshValuesOptions): Promise<void>;
|
|
30
30
|
setMappedBasicValue(ctx: GetValueDB, value: number): boolean;
|
|
31
31
|
}
|
|
32
32
|
export interface BinarySwitchCCSetOptions {
|
|
@@ -37,6 +37,7 @@ __export(BinarySwitchCC_exports, {
|
|
|
37
37
|
BinarySwitchCCValues: () => import_CCValues_generated.BinarySwitchCCValues
|
|
38
38
|
});
|
|
39
39
|
module.exports = __toCommonJS(BinarySwitchCC_exports);
|
|
40
|
+
var import_tslib = require("tslib");
|
|
40
41
|
var __validateArgs = __toESM(require("./BinarySwitchCC._validateArgs.js"), 1);
|
|
41
42
|
var import_core = require("@zwave-js/core");
|
|
42
43
|
var import_shared = require("@zwave-js/shared");
|
|
@@ -45,46 +46,6 @@ var import_CommandClass = require("../lib/CommandClass.js");
|
|
|
45
46
|
var import_CommandClassDecorators = require("../lib/CommandClassDecorators.js");
|
|
46
47
|
var import_Types = require("../lib/_Types.js");
|
|
47
48
|
var import_CCValues_generated = require("./_CCValues.generated.js");
|
|
48
|
-
var __runInitializers = function(thisArg, initializers, value) {
|
|
49
|
-
var useValue = arguments.length > 2;
|
|
50
|
-
for (var i = 0; i < initializers.length; i++) {
|
|
51
|
-
value = useValue ? initializers[i].call(thisArg, value) : initializers[i].call(thisArg);
|
|
52
|
-
}
|
|
53
|
-
return useValue ? value : void 0;
|
|
54
|
-
};
|
|
55
|
-
var __esDecorate = function(ctor, descriptorIn, decorators, contextIn, initializers, extraInitializers) {
|
|
56
|
-
function accept(f) {
|
|
57
|
-
if (f !== void 0 && typeof f !== "function") throw new TypeError("Function expected");
|
|
58
|
-
return f;
|
|
59
|
-
}
|
|
60
|
-
__name(accept, "accept");
|
|
61
|
-
var kind = contextIn.kind, key = kind === "getter" ? "get" : kind === "setter" ? "set" : "value";
|
|
62
|
-
var target = !descriptorIn && ctor ? contextIn["static"] ? ctor : ctor.prototype : null;
|
|
63
|
-
var descriptor = descriptorIn || (target ? Object.getOwnPropertyDescriptor(target, contextIn.name) : {});
|
|
64
|
-
var _, done = false;
|
|
65
|
-
for (var i = decorators.length - 1; i >= 0; i--) {
|
|
66
|
-
var context = {};
|
|
67
|
-
for (var p in contextIn) context[p] = p === "access" ? {} : contextIn[p];
|
|
68
|
-
for (var p in contextIn.access) context.access[p] = contextIn.access[p];
|
|
69
|
-
context.addInitializer = function(f) {
|
|
70
|
-
if (done) throw new TypeError("Cannot add initializers after decoration has completed");
|
|
71
|
-
extraInitializers.push(accept(f || null));
|
|
72
|
-
};
|
|
73
|
-
var result = (0, decorators[i])(kind === "accessor" ? { get: descriptor.get, set: descriptor.set } : descriptor[key], context);
|
|
74
|
-
if (kind === "accessor") {
|
|
75
|
-
if (result === void 0) continue;
|
|
76
|
-
if (result === null || typeof result !== "object") throw new TypeError("Object expected");
|
|
77
|
-
if (_ = accept(result.get)) descriptor.get = _;
|
|
78
|
-
if (_ = accept(result.set)) descriptor.set = _;
|
|
79
|
-
if (_ = accept(result.init)) initializers.unshift(_);
|
|
80
|
-
} else if (_ = accept(result)) {
|
|
81
|
-
if (kind === "field") initializers.unshift(_);
|
|
82
|
-
else descriptor[key] = _;
|
|
83
|
-
}
|
|
84
|
-
}
|
|
85
|
-
if (target) Object.defineProperty(target, contextIn.name, descriptor);
|
|
86
|
-
done = true;
|
|
87
|
-
};
|
|
88
49
|
const { validateArgs_BinarySwitchCCAPI_set } = __validateArgs;
|
|
89
50
|
let BinarySwitchCCAPI = (() => {
|
|
90
51
|
let _classDecorators = [(0, import_CommandClassDecorators.API)(import_core.CommandClasses["Binary Switch"])];
|
|
@@ -103,11 +64,11 @@ let BinarySwitchCCAPI = (() => {
|
|
|
103
64
|
}
|
|
104
65
|
static {
|
|
105
66
|
const _metadata = typeof Symbol === "function" && Symbol.metadata ? Object.create(_classSuper[Symbol.metadata] ?? null) : void 0;
|
|
106
|
-
__esDecorate(this, null, _set_decorators, { kind: "method", name: "set", static: false, private: false, access: { has: /* @__PURE__ */ __name((obj) => "set" in obj, "has"), get: /* @__PURE__ */ __name((obj) => obj.set, "get") }, metadata: _metadata }, null, _instanceExtraInitializers);
|
|
107
|
-
__esDecorate(null, _classDescriptor = { value: _classThis }, _classDecorators, { kind: "class", name: _classThis.name, metadata: _metadata }, null, _classExtraInitializers);
|
|
67
|
+
(0, import_tslib.__esDecorate)(this, null, _set_decorators, { kind: "method", name: "set", static: false, private: false, access: { has: /* @__PURE__ */ __name((obj) => "set" in obj, "has"), get: /* @__PURE__ */ __name((obj) => obj.set, "get") }, metadata: _metadata }, null, _instanceExtraInitializers);
|
|
68
|
+
(0, import_tslib.__esDecorate)(null, _classDescriptor = { value: _classThis }, _classDecorators, { kind: "class", name: _classThis.name, metadata: _metadata }, null, _classExtraInitializers);
|
|
108
69
|
BinarySwitchCCAPI2 = _classThis = _classDescriptor.value;
|
|
109
70
|
if (_metadata) Object.defineProperty(_classThis, Symbol.metadata, { enumerable: true, configurable: true, writable: true, value: _metadata });
|
|
110
|
-
__runInitializers(_classThis, _classExtraInitializers);
|
|
71
|
+
(0, import_tslib.__runInitializers)(_classThis, _classExtraInitializers);
|
|
111
72
|
}
|
|
112
73
|
supportsCommand(cmd) {
|
|
113
74
|
switch (cmd) {
|
|
@@ -162,10 +123,12 @@ let BinarySwitchCCAPI = (() => {
|
|
|
162
123
|
return this.set(value, duration);
|
|
163
124
|
};
|
|
164
125
|
}
|
|
165
|
-
[import_API.SET_VALUE_HOOKS] = (__runInitializers(this, _instanceExtraInitializers), ({ property }, value, options) => {
|
|
126
|
+
[import_API.SET_VALUE_HOOKS] = ((0, import_tslib.__runInitializers)(this, _instanceExtraInitializers), ({ property }, value, options) => {
|
|
166
127
|
if (property === "targetValue") {
|
|
167
128
|
const currentValueValueId = import_CCValues_generated.BinarySwitchCCValues.currentValue.endpoint(this.endpoint.index);
|
|
168
129
|
return {
|
|
130
|
+
// This is the target value for a split target/current state pair.
|
|
131
|
+
isSplitStateTargetValue: true,
|
|
169
132
|
optimisticallyUpdateRelatedValues: /* @__PURE__ */ __name((_supervisedAndSuccessful) => {
|
|
170
133
|
if (this.isSinglecast()) {
|
|
171
134
|
this.tryGetValueDB()?.setValue(currentValueValueId, value);
|
|
@@ -219,10 +182,10 @@ let BinarySwitchCC = (() => {
|
|
|
219
182
|
}
|
|
220
183
|
static {
|
|
221
184
|
const _metadata = typeof Symbol === "function" && Symbol.metadata ? Object.create(_classSuper[Symbol.metadata] ?? null) : void 0;
|
|
222
|
-
__esDecorate(null, _classDescriptor = { value: _classThis }, _classDecorators, { kind: "class", name: _classThis.name, metadata: _metadata }, null, _classExtraInitializers);
|
|
185
|
+
(0, import_tslib.__esDecorate)(null, _classDescriptor = { value: _classThis }, _classDecorators, { kind: "class", name: _classThis.name, metadata: _metadata }, null, _classExtraInitializers);
|
|
223
186
|
BinarySwitchCC2 = _classThis = _classDescriptor.value;
|
|
224
187
|
if (_metadata) Object.defineProperty(_classThis, Symbol.metadata, { enumerable: true, configurable: true, writable: true, value: _metadata });
|
|
225
|
-
__runInitializers(_classThis, _classExtraInitializers);
|
|
188
|
+
(0, import_tslib.__runInitializers)(_classThis, _classExtraInitializers);
|
|
226
189
|
}
|
|
227
190
|
async interview(ctx) {
|
|
228
191
|
const node = this.getNode(ctx);
|
|
@@ -234,11 +197,11 @@ let BinarySwitchCC = (() => {
|
|
|
234
197
|
await this.refreshValues(ctx);
|
|
235
198
|
this.setInterviewComplete(ctx, true);
|
|
236
199
|
}
|
|
237
|
-
async refreshValues(ctx) {
|
|
200
|
+
async refreshValues(ctx, options) {
|
|
238
201
|
const node = this.getNode(ctx);
|
|
239
202
|
const endpoint = this.getEndpoint(ctx);
|
|
240
203
|
const api = import_API.CCAPI.create(import_core.CommandClasses["Binary Switch"], ctx, endpoint).withOptions({
|
|
241
|
-
priority: import_core.MessagePriority.NodeQuery
|
|
204
|
+
priority: options?.priority ?? import_core.MessagePriority.NodeQuery
|
|
242
205
|
});
|
|
243
206
|
ctx.logNode(node.id, {
|
|
244
207
|
endpoint: this.endpointIndex,
|
|
@@ -283,10 +246,10 @@ let BinarySwitchCCSet = (() => {
|
|
|
283
246
|
}
|
|
284
247
|
static {
|
|
285
248
|
const _metadata = typeof Symbol === "function" && Symbol.metadata ? Object.create(_classSuper[Symbol.metadata] ?? null) : void 0;
|
|
286
|
-
__esDecorate(null, _classDescriptor = { value: _classThis }, _classDecorators, { kind: "class", name: _classThis.name, metadata: _metadata }, null, _classExtraInitializers);
|
|
249
|
+
(0, import_tslib.__esDecorate)(null, _classDescriptor = { value: _classThis }, _classDecorators, { kind: "class", name: _classThis.name, metadata: _metadata }, null, _classExtraInitializers);
|
|
287
250
|
BinarySwitchCCSet2 = _classThis = _classDescriptor.value;
|
|
288
251
|
if (_metadata) Object.defineProperty(_classThis, Symbol.metadata, { enumerable: true, configurable: true, writable: true, value: _metadata });
|
|
289
|
-
__runInitializers(_classThis, _classExtraInitializers);
|
|
252
|
+
(0, import_tslib.__runInitializers)(_classThis, _classExtraInitializers);
|
|
290
253
|
}
|
|
291
254
|
constructor(options) {
|
|
292
255
|
super(options);
|
|
@@ -349,10 +312,10 @@ let BinarySwitchCCReport = (() => {
|
|
|
349
312
|
}
|
|
350
313
|
static {
|
|
351
314
|
const _metadata = typeof Symbol === "function" && Symbol.metadata ? Object.create(_classSuper[Symbol.metadata] ?? null) : void 0;
|
|
352
|
-
__esDecorate(null, _classDescriptor = { value: _classThis }, _classDecorators, { kind: "class", name: _classThis.name, metadata: _metadata }, null, _classExtraInitializers);
|
|
315
|
+
(0, import_tslib.__esDecorate)(null, _classDescriptor = { value: _classThis }, _classDecorators, { kind: "class", name: _classThis.name, metadata: _metadata }, null, _classExtraInitializers);
|
|
353
316
|
BinarySwitchCCReport2 = _classThis = _classDescriptor.value;
|
|
354
317
|
if (_metadata) Object.defineProperty(_classThis, Symbol.metadata, { enumerable: true, configurable: true, writable: true, value: _metadata });
|
|
355
|
-
__runInitializers(_classThis, _classExtraInitializers);
|
|
318
|
+
(0, import_tslib.__runInitializers)(_classThis, _classExtraInitializers);
|
|
356
319
|
}
|
|
357
320
|
constructor(options) {
|
|
358
321
|
super(options);
|
|
@@ -427,10 +390,10 @@ let BinarySwitchCCGet = (() => {
|
|
|
427
390
|
}
|
|
428
391
|
static {
|
|
429
392
|
const _metadata = typeof Symbol === "function" && Symbol.metadata ? Object.create(_classSuper[Symbol.metadata] ?? null) : void 0;
|
|
430
|
-
__esDecorate(null, _classDescriptor = { value: _classThis }, _classDecorators, { kind: "class", name: _classThis.name, metadata: _metadata }, null, _classExtraInitializers);
|
|
393
|
+
(0, import_tslib.__esDecorate)(null, _classDescriptor = { value: _classThis }, _classDecorators, { kind: "class", name: _classThis.name, metadata: _metadata }, null, _classExtraInitializers);
|
|
431
394
|
BinarySwitchCCGet2 = _classThis = _classDescriptor.value;
|
|
432
395
|
if (_metadata) Object.defineProperty(_classThis, Symbol.metadata, { enumerable: true, configurable: true, writable: true, value: _metadata });
|
|
433
|
-
__runInitializers(_classThis, _classExtraInitializers);
|
|
396
|
+
(0, import_tslib.__runInitializers)(_classThis, _classExtraInitializers);
|
|
434
397
|
}
|
|
435
398
|
};
|
|
436
399
|
return BinarySwitchCCGet2 = _classThis;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../src_gen/cc/BinarySwitchCC.ts"],
|
|
4
|
-
"sourcesContent": ["import * as __validateArgs from \"./BinarySwitchCC._validateArgs.js\";\nconst { validateArgs_BinarySwitchCCAPI_set } = __validateArgs;\nimport { CommandClasses, Duration, type GetValueDB, type MaybeNotKnown, type MaybeUnknown, type MessageOrCCLogEntry, MessagePriority, type MessageRecord, type SupervisionResult, UNKNOWN_STATE, ValueMetadata, type WithAddress, encodeMaybeBoolean, maybeUnknownToString, parseMaybeBoolean, validatePayload, } from \"@zwave-js/core\";\nimport { Bytes } from \"@zwave-js/shared\";\nimport { CCAPI, POLL_VALUE, type PollValueImplementation, SET_VALUE, SET_VALUE_HOOKS, type SetValueImplementation, type SetValueImplementationHooksFactory, throwUnsupportedProperty, throwWrongValueType, } from \"../lib/API.js\";\nimport { type CCRaw, CommandClass, type InterviewContext, type RefreshValuesContext, getEffectiveCCVersion, } from \"../lib/CommandClass.js\";\nimport { API, CCCommand, ccValueProperty, ccValues, commandClass, expectedCCResponse, implementedVersion, useSupervision, } from \"../lib/CommandClassDecorators.js\";\nimport { V } from \"../lib/Values.js\";\nimport { BinarySwitchCommand } from \"../lib/_Types.js\";\nimport type { CCEncodingContext, CCParsingContext } from \"../lib/traits.js\";\nimport { BinarySwitchCCValues } from \"./_CCValues.generated.js\";\nexport { BinarySwitchCCValues };\n@API(CommandClasses[\"Binary Switch\"])\nexport class BinarySwitchCCAPI extends CCAPI {\n public supportsCommand(cmd: BinarySwitchCommand): MaybeNotKnown<boolean> {\n switch (cmd) {\n case BinarySwitchCommand.Get:\n return this.isSinglecast();\n case BinarySwitchCommand.Set:\n return true;\n }\n return super.supportsCommand(cmd);\n }\n // oxlint-disable-next-line typescript/explicit-module-boundary-types\n public async get() {\n this.assertSupportsCommand(BinarySwitchCommand, BinarySwitchCommand.Get);\n const cc = new BinarySwitchCCGet({\n nodeId: this.endpoint.nodeId,\n endpointIndex: this.endpoint.index,\n });\n const response = await this.host.sendCommand<BinarySwitchCCReport>(cc, this.commandOptions);\n if (response) {\n return {\n // interpret unknown values as false\n currentValue: response.currentValue || false,\n targetValue: response.targetValue,\n duration: response.duration,\n };\n }\n }\n /**\n * Sets the switch to the given value\n * @param targetValue The target value to set\n * @param duration The duration after which the target value should be reached. Can be a Duration instance or a user-friendly duration string like `\"1m17s\"`. Only supported in V2 and above.\n */\n @validateArgs_BinarySwitchCCAPI_set()\n public async set(targetValue: boolean, duration?: Duration | string): Promise<SupervisionResult | undefined> {\n this.assertSupportsCommand(BinarySwitchCommand, BinarySwitchCommand.Set);\n const cc = new BinarySwitchCCSet({\n nodeId: this.endpoint.nodeId,\n endpointIndex: this.endpoint.index,\n targetValue,\n duration,\n });\n return this.host.sendCommand(cc, this.commandOptions);\n }\n protected override get [SET_VALUE](): SetValueImplementation {\n return async function (this: BinarySwitchCCAPI, { property }, value, options) {\n if (property !== \"targetValue\") {\n throwUnsupportedProperty(this.ccId, property);\n }\n if (typeof value !== \"boolean\") {\n throwWrongValueType(this.ccId, property, \"boolean\", typeof value);\n }\n const duration = Duration.from(options?.transitionDuration);\n return this.set(value, duration);\n };\n }\n protected [SET_VALUE_HOOKS]: SetValueImplementationHooksFactory = ({ property }, value, options) => {\n if (property === \"targetValue\") {\n const currentValueValueId = BinarySwitchCCValues.currentValue\n .endpoint(this.endpoint.index);\n return {\n optimisticallyUpdateRelatedValues: (_supervisedAndSuccessful) => {\n // After setting targetValue, optimistically update currentValue\n if (this.isSinglecast()) {\n this.tryGetValueDB()?.setValue(currentValueValueId, value);\n }\n else if (this.isMulticast()) {\n // Figure out which nodes were affected by this command\n const affectedNodes = this.endpoint.node.physicalNodes\n .filter((node) => node\n .getEndpoint(this.endpoint.index)\n ?.supportsCC(this.ccId));\n // and optimistically update the currentValue\n for (const node of affectedNodes) {\n this.host\n .tryGetValueDB(node.id)\n ?.setValue(currentValueValueId, value);\n }\n }\n },\n verifyChanges: () => {\n if (this.isSinglecast()) {\n // We query currentValue instead of targetValue to make sure that unsolicited updates cancel the scheduled poll\n this.schedulePoll(currentValueValueId, value, {\n duration: Duration.from(options?.transitionDuration),\n // on/off \"transitions\" are usually fast\n transition: \"fast\",\n });\n }\n else {\n // For multicasts, do not schedule a refresh - this could cause a LOT of traffic\n }\n },\n };\n }\n };\n protected get [POLL_VALUE](): PollValueImplementation {\n return async function (this: BinarySwitchCCAPI, { property }) {\n switch (property) {\n case \"currentValue\":\n case \"targetValue\":\n case \"duration\":\n return (await this.get())?.[property];\n default:\n throwUnsupportedProperty(this.ccId, property);\n }\n };\n }\n}\n@commandClass(CommandClasses[\"Binary Switch\"])\n@implementedVersion(2)\n@ccValues(BinarySwitchCCValues)\nexport class BinarySwitchCC extends CommandClass {\n declare ccCommand: BinarySwitchCommand;\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 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 Switch\"], ctx, endpoint).withOptions({\n priority: MessagePriority.NodeQuery,\n });\n // Query the current state\n ctx.logNode(node.id, {\n endpoint: this.endpointIndex,\n message: \"querying Binary Switch state...\",\n direction: \"outbound\",\n });\n const resp = await api.get();\n if (resp) {\n let logMessage = `received Binary Switch state:\ncurrent value: ${resp.currentValue}`;\n if (resp.targetValue != undefined) {\n logMessage += `\ntarget value: ${resp.targetValue}\nremaining duration: ${resp.duration?.toString() ?? \"undefined\"}`;\n }\n ctx.logNode(node.id, {\n endpoint: this.endpointIndex,\n message: logMessage,\n direction: \"inbound\",\n });\n }\n }\n public setMappedBasicValue(ctx: GetValueDB, value: number): boolean {\n this.setValue(ctx, BinarySwitchCCValues.currentValue, value > 0);\n return true;\n }\n}\n// @publicAPI\nexport interface BinarySwitchCCSetOptions {\n targetValue: boolean;\n duration?: Duration | string;\n}\n@CCCommand(BinarySwitchCommand.Set)\n@useSupervision()\nexport class BinarySwitchCCSet extends BinarySwitchCC {\n public constructor(options: WithAddress<BinarySwitchCCSetOptions>) {\n super(options);\n this.targetValue = options.targetValue;\n this.duration = Duration.from(options.duration);\n }\n public static from(raw: CCRaw, ctx: CCParsingContext): BinarySwitchCCSet {\n validatePayload(raw.payload.length >= 1);\n const targetValue = !!raw.payload[0];\n let duration: Duration | undefined;\n if (raw.payload.length >= 2) {\n duration = Duration.parseSet(raw.payload[1]);\n }\n return new this({\n nodeId: ctx.sourceNodeId,\n targetValue,\n duration,\n });\n }\n public targetValue: boolean;\n public duration: Duration | undefined;\n public serialize(ctx: CCEncodingContext): Promise<Bytes> {\n this.payload = Bytes.from([\n this.targetValue ? 0xff : 0x00,\n (this.duration ?? Duration.default()).serializeSet(),\n ]);\n const ccVersion = getEffectiveCCVersion(ctx, this);\n if (ccVersion < 2 && ctx.getDeviceConfig?.(this.nodeId as number)?.compat?.encodeCCsUsingTargetVersion) {\n // When forcing CC version 1, only send the target value\n this.payload = this.payload.subarray(0, 1);\n }\n return super.serialize(ctx);\n }\n public toLogEntry(ctx?: GetValueDB): MessageOrCCLogEntry {\n const message: MessageRecord = {\n \"target value\": this.targetValue,\n };\n if (this.duration != undefined) {\n message.duration = this.duration.toString();\n }\n return {\n ...super.toLogEntry(ctx),\n message,\n };\n }\n}\n// @publicAPI\nexport interface BinarySwitchCCReportOptions {\n currentValue?: MaybeUnknown<boolean>;\n targetValue?: MaybeUnknown<boolean>;\n duration?: Duration | string;\n}\n@CCCommand(BinarySwitchCommand.Report)\n@ccValueProperty(\"currentValue\", BinarySwitchCCValues.currentValue)\n@ccValueProperty(\"targetValue\", BinarySwitchCCValues.targetValue)\n@ccValueProperty(\"duration\", BinarySwitchCCValues.duration)\nexport class BinarySwitchCCReport extends BinarySwitchCC {\n public constructor(options: WithAddress<BinarySwitchCCReportOptions>) {\n super(options);\n this.currentValue = options.currentValue;\n this.targetValue = options.targetValue;\n this.duration = Duration.from(options.duration);\n }\n public static from(raw: CCRaw, ctx: CCParsingContext): BinarySwitchCCReport {\n validatePayload(raw.payload.length >= 1);\n const currentValue: MaybeUnknown<boolean> | undefined = parseMaybeBoolean(raw.payload[0]);\n let targetValue: MaybeUnknown<boolean> | undefined;\n let duration: Duration | undefined;\n if (raw.payload.length >= 3) {\n targetValue = parseMaybeBoolean(raw.payload[1]);\n duration = Duration.parseReport(raw.payload[2]);\n }\n return new this({\n nodeId: ctx.sourceNodeId,\n currentValue,\n targetValue,\n duration,\n });\n }\n public readonly currentValue: MaybeUnknown<boolean> | undefined;\n public readonly targetValue: MaybeUnknown<boolean> | undefined;\n public readonly duration: Duration | undefined;\n public serialize(ctx: CCEncodingContext): Promise<Bytes> {\n this.payload = Bytes.from([\n encodeMaybeBoolean(this.currentValue ?? UNKNOWN_STATE),\n ]);\n if (this.targetValue !== undefined) {\n this.payload = Bytes.concat([\n this.payload,\n [\n encodeMaybeBoolean(this.targetValue),\n (this.duration ?? Duration.default()).serializeReport(),\n ],\n ]);\n }\n return super.serialize(ctx);\n }\n public toLogEntry(ctx?: GetValueDB): MessageOrCCLogEntry {\n const message: MessageRecord = {\n \"current value\": maybeUnknownToString(this.currentValue),\n };\n if (this.targetValue !== undefined) {\n message[\"target value\"] = maybeUnknownToString(this.targetValue);\n }\n if (this.duration != undefined) {\n message.duration = this.duration.toString();\n }\n return {\n ...super.toLogEntry(ctx),\n message,\n };\n }\n}\n@CCCommand(BinarySwitchCommand.Get)\n@expectedCCResponse(BinarySwitchCCReport)\nexport class BinarySwitchCCGet extends BinarySwitchCC {\n}\n"],
|
|
5
|
-
"mappings": "
|
|
4
|
+
"sourcesContent": ["import * as __validateArgs from \"./BinarySwitchCC._validateArgs.js\";\nconst { validateArgs_BinarySwitchCCAPI_set } = __validateArgs;\nimport { CommandClasses, Duration, type GetValueDB, type MaybeNotKnown, type MaybeUnknown, type MessageOrCCLogEntry, MessagePriority, type MessageRecord, type SupervisionResult, UNKNOWN_STATE, ValueMetadata, type WithAddress, encodeMaybeBoolean, maybeUnknownToString, parseMaybeBoolean, validatePayload, } from \"@zwave-js/core\";\nimport { Bytes } from \"@zwave-js/shared\";\nimport { CCAPI, POLL_VALUE, type PollValueImplementation, SET_VALUE, SET_VALUE_HOOKS, type SetValueImplementation, type SetValueImplementationHooksFactory, throwUnsupportedProperty, throwWrongValueType, } from \"../lib/API.js\";\nimport { type CCRaw, CommandClass, type InterviewContext, type RefreshValuesContext, type RefreshValuesOptions, getEffectiveCCVersion, } from \"../lib/CommandClass.js\";\nimport { API, CCCommand, ccValueProperty, ccValues, commandClass, expectedCCResponse, implementedVersion, useSupervision, } from \"../lib/CommandClassDecorators.js\";\nimport { V } from \"../lib/Values.js\";\nimport { BinarySwitchCommand } from \"../lib/_Types.js\";\nimport type { CCEncodingContext, CCParsingContext } from \"../lib/traits.js\";\nimport { BinarySwitchCCValues } from \"./_CCValues.generated.js\";\nexport { BinarySwitchCCValues };\n@API(CommandClasses[\"Binary Switch\"])\nexport class BinarySwitchCCAPI extends CCAPI {\n public supportsCommand(cmd: BinarySwitchCommand): MaybeNotKnown<boolean> {\n switch (cmd) {\n case BinarySwitchCommand.Get:\n return this.isSinglecast();\n case BinarySwitchCommand.Set:\n return true;\n }\n return super.supportsCommand(cmd);\n }\n // oxlint-disable-next-line typescript/explicit-module-boundary-types\n public async get() {\n this.assertSupportsCommand(BinarySwitchCommand, BinarySwitchCommand.Get);\n const cc = new BinarySwitchCCGet({\n nodeId: this.endpoint.nodeId,\n endpointIndex: this.endpoint.index,\n });\n const response = await this.host.sendCommand<BinarySwitchCCReport>(cc, this.commandOptions);\n if (response) {\n return {\n // interpret unknown values as false\n currentValue: response.currentValue || false,\n targetValue: response.targetValue,\n duration: response.duration,\n };\n }\n }\n /**\n * Sets the switch to the given value\n * @param targetValue The target value to set\n * @param duration The duration after which the target value should be reached. Can be a Duration instance or a user-friendly duration string like `\"1m17s\"`. Only supported in V2 and above.\n */\n @validateArgs_BinarySwitchCCAPI_set()\n public async set(targetValue: boolean, duration?: Duration | string): Promise<SupervisionResult | undefined> {\n this.assertSupportsCommand(BinarySwitchCommand, BinarySwitchCommand.Set);\n const cc = new BinarySwitchCCSet({\n nodeId: this.endpoint.nodeId,\n endpointIndex: this.endpoint.index,\n targetValue,\n duration,\n });\n return this.host.sendCommand(cc, this.commandOptions);\n }\n protected override get [SET_VALUE](): SetValueImplementation {\n return async function (this: BinarySwitchCCAPI, { property }, value, options) {\n if (property !== \"targetValue\") {\n throwUnsupportedProperty(this.ccId, property);\n }\n if (typeof value !== \"boolean\") {\n throwWrongValueType(this.ccId, property, \"boolean\", typeof value);\n }\n const duration = Duration.from(options?.transitionDuration);\n return this.set(value, duration);\n };\n }\n protected [SET_VALUE_HOOKS]: SetValueImplementationHooksFactory = ({ property }, value, options) => {\n if (property === \"targetValue\") {\n const currentValueValueId = BinarySwitchCCValues.currentValue\n .endpoint(this.endpoint.index);\n return {\n // This is the target value for a split target/current state pair.\n isSplitStateTargetValue: true,\n optimisticallyUpdateRelatedValues: (_supervisedAndSuccessful) => {\n // After setting targetValue, optimistically update currentValue\n if (this.isSinglecast()) {\n this.tryGetValueDB()?.setValue(currentValueValueId, value);\n }\n else if (this.isMulticast()) {\n // Figure out which nodes were affected by this command\n const affectedNodes = this.endpoint.node.physicalNodes\n .filter((node) => node\n .getEndpoint(this.endpoint.index)\n ?.supportsCC(this.ccId));\n // and optimistically update the currentValue\n for (const node of affectedNodes) {\n this.host\n .tryGetValueDB(node.id)\n ?.setValue(currentValueValueId, value);\n }\n }\n },\n verifyChanges: () => {\n if (this.isSinglecast()) {\n // We query currentValue instead of targetValue to make sure that unsolicited updates cancel the scheduled poll\n this.schedulePoll(currentValueValueId, value, {\n duration: Duration.from(options?.transitionDuration),\n // on/off \"transitions\" are usually fast\n transition: \"fast\",\n });\n }\n else {\n // For multicasts, do not schedule a refresh - this could cause a LOT of traffic\n }\n },\n };\n }\n };\n protected get [POLL_VALUE](): PollValueImplementation {\n return async function (this: BinarySwitchCCAPI, { property }) {\n switch (property) {\n case \"currentValue\":\n case \"targetValue\":\n case \"duration\":\n return (await this.get())?.[property];\n default:\n throwUnsupportedProperty(this.ccId, property);\n }\n };\n }\n}\n@commandClass(CommandClasses[\"Binary Switch\"])\n@implementedVersion(2)\n@ccValues(BinarySwitchCCValues)\nexport class BinarySwitchCC extends CommandClass {\n declare ccCommand: BinarySwitchCommand;\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 await this.refreshValues(ctx);\n // Remember that the interview is complete\n this.setInterviewComplete(ctx, true);\n }\n public async refreshValues(ctx: RefreshValuesContext, options?: RefreshValuesOptions): Promise<void> {\n const node = this.getNode(ctx)!;\n const endpoint = this.getEndpoint(ctx)!;\n const api = CCAPI.create(CommandClasses[\"Binary Switch\"], ctx, endpoint).withOptions({\n priority: options?.priority ?? MessagePriority.NodeQuery,\n });\n // Query the current state\n ctx.logNode(node.id, {\n endpoint: this.endpointIndex,\n message: \"querying Binary Switch state...\",\n direction: \"outbound\",\n });\n const resp = await api.get();\n if (resp) {\n let logMessage = `received Binary Switch state:\ncurrent value: ${resp.currentValue}`;\n if (resp.targetValue != undefined) {\n logMessage += `\ntarget value: ${resp.targetValue}\nremaining duration: ${resp.duration?.toString() ?? \"undefined\"}`;\n }\n ctx.logNode(node.id, {\n endpoint: this.endpointIndex,\n message: logMessage,\n direction: \"inbound\",\n });\n }\n }\n public setMappedBasicValue(ctx: GetValueDB, value: number): boolean {\n this.setValue(ctx, BinarySwitchCCValues.currentValue, value > 0);\n return true;\n }\n}\n// @publicAPI\nexport interface BinarySwitchCCSetOptions {\n targetValue: boolean;\n duration?: Duration | string;\n}\n@CCCommand(BinarySwitchCommand.Set)\n@useSupervision()\nexport class BinarySwitchCCSet extends BinarySwitchCC {\n public constructor(options: WithAddress<BinarySwitchCCSetOptions>) {\n super(options);\n this.targetValue = options.targetValue;\n this.duration = Duration.from(options.duration);\n }\n public static from(raw: CCRaw, ctx: CCParsingContext): BinarySwitchCCSet {\n validatePayload(raw.payload.length >= 1);\n const targetValue = !!raw.payload[0];\n let duration: Duration | undefined;\n if (raw.payload.length >= 2) {\n duration = Duration.parseSet(raw.payload[1]);\n }\n return new this({\n nodeId: ctx.sourceNodeId,\n targetValue,\n duration,\n });\n }\n public targetValue: boolean;\n public duration: Duration | undefined;\n public serialize(ctx: CCEncodingContext): Promise<Bytes> {\n this.payload = Bytes.from([\n this.targetValue ? 0xff : 0x00,\n (this.duration ?? Duration.default()).serializeSet(),\n ]);\n const ccVersion = getEffectiveCCVersion(ctx, this);\n if (ccVersion < 2 && ctx.getDeviceConfig?.(this.nodeId as number)?.compat?.encodeCCsUsingTargetVersion) {\n // When forcing CC version 1, only send the target value\n this.payload = this.payload.subarray(0, 1);\n }\n return super.serialize(ctx);\n }\n public toLogEntry(ctx?: GetValueDB): MessageOrCCLogEntry {\n const message: MessageRecord = {\n \"target value\": this.targetValue,\n };\n if (this.duration != undefined) {\n message.duration = this.duration.toString();\n }\n return {\n ...super.toLogEntry(ctx),\n message,\n };\n }\n}\n// @publicAPI\nexport interface BinarySwitchCCReportOptions {\n currentValue?: MaybeUnknown<boolean>;\n targetValue?: MaybeUnknown<boolean>;\n duration?: Duration | string;\n}\n@CCCommand(BinarySwitchCommand.Report)\n@ccValueProperty(\"currentValue\", BinarySwitchCCValues.currentValue)\n@ccValueProperty(\"targetValue\", BinarySwitchCCValues.targetValue)\n@ccValueProperty(\"duration\", BinarySwitchCCValues.duration)\nexport class BinarySwitchCCReport extends BinarySwitchCC {\n public constructor(options: WithAddress<BinarySwitchCCReportOptions>) {\n super(options);\n this.currentValue = options.currentValue;\n this.targetValue = options.targetValue;\n this.duration = Duration.from(options.duration);\n }\n public static from(raw: CCRaw, ctx: CCParsingContext): BinarySwitchCCReport {\n validatePayload(raw.payload.length >= 1);\n const currentValue: MaybeUnknown<boolean> | undefined = parseMaybeBoolean(raw.payload[0]);\n let targetValue: MaybeUnknown<boolean> | undefined;\n let duration: Duration | undefined;\n if (raw.payload.length >= 3) {\n targetValue = parseMaybeBoolean(raw.payload[1]);\n duration = Duration.parseReport(raw.payload[2]);\n }\n return new this({\n nodeId: ctx.sourceNodeId,\n currentValue,\n targetValue,\n duration,\n });\n }\n public readonly currentValue: MaybeUnknown<boolean> | undefined;\n public readonly targetValue: MaybeUnknown<boolean> | undefined;\n public readonly duration: Duration | undefined;\n public serialize(ctx: CCEncodingContext): Promise<Bytes> {\n this.payload = Bytes.from([\n encodeMaybeBoolean(this.currentValue ?? UNKNOWN_STATE),\n ]);\n if (this.targetValue !== undefined) {\n this.payload = Bytes.concat([\n this.payload,\n [\n encodeMaybeBoolean(this.targetValue),\n (this.duration ?? Duration.default()).serializeReport(),\n ],\n ]);\n }\n return super.serialize(ctx);\n }\n public toLogEntry(ctx?: GetValueDB): MessageOrCCLogEntry {\n const message: MessageRecord = {\n \"current value\": maybeUnknownToString(this.currentValue),\n };\n if (this.targetValue !== undefined) {\n message[\"target value\"] = maybeUnknownToString(this.targetValue);\n }\n if (this.duration != undefined) {\n message.duration = this.duration.toString();\n }\n return {\n ...super.toLogEntry(ctx),\n message,\n };\n }\n}\n@CCCommand(BinarySwitchCommand.Get)\n@expectedCCResponse(BinarySwitchCCReport)\nexport class BinarySwitchCCGet extends BinarySwitchCC {\n}\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,qBAAgC;AAEhC,kBAAuT;AACvT,oBAAsB;AACtB,iBAAkN;AAClN,0BAA8I;AAC9I,oCAAiI;AAEjI,mBAAoC;AAEpC,gCAAqC;AATrC,MAAM,EAAE,mCAAkC,IAAK;IAYlC,qBAAiB,MAAA;8BAD7B,mCAAI,2BAAe,eAAe,CAAC,CAAC;;;;oBACE;;;yCAAA,YAAK;WAAA;;;;;;;;AAiCxC,qCAAA,MAAA,MAAA,iBAAA,EAAA,MAAA,UAAA,MAAA,OAAA,QAAA,OAAA,SAAA,OAAA,QAAA,EAAA,KAAA,gCAAA,SAAA,KAAA,QAAA,KAAA,gCAAA,IAAa,KAAb,OAAgB,GAAA,UAAA,UAAA,GAAA,MAAA,0BAAA;AAjCpB,qCAAA,MAAA,mBAAA,EAAA,OAAA,WAAA,GAAA,kBAAA,EAAA,MAAA,SAAA,MAAA,WAAA,MAAA,UAAA,UAAA,GAAA,MAAA,uBAAA;;;AAAa,0CAAA,YAAA,uBAAA;;IACF,gBAAgB,KAAwB;AAC3C,cAAQ,KAAK;QACT,KAAK,iCAAoB;AACrB,iBAAO,KAAK,aAAY;QAC5B,KAAK,iCAAoB;AACrB,iBAAO;MACf;AACA,aAAO,MAAM,gBAAgB,GAAG;IACpC;;IAEO,MAAM,MAAG;AACZ,WAAK,sBAAsB,kCAAqB,iCAAoB,GAAG;AACvE,YAAM,KAAK,IAAI,kBAAkB;QAC7B,QAAQ,KAAK,SAAS;QACt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