@zwave-js/cc 15.0.0-beta.0 → 15.0.0-beta.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.d.ts +79 -161
- package/build/cjs/cc/AlarmSensorCC.js +12 -50
- package/build/cjs/cc/AlarmSensorCC.js.map +2 -2
- package/build/cjs/cc/AssociationCC.d.ts +63 -199
- package/build/cjs/cc/AssociationCC.js +9 -22
- package/build/cjs/cc/AssociationCC.js.map +2 -2
- package/build/cjs/cc/AssociationGroupInfoCC.d.ts +66 -166
- package/build/cjs/cc/AssociationGroupInfoCC.js +11 -22
- package/build/cjs/cc/AssociationGroupInfoCC.js.map +2 -2
- package/build/cjs/cc/BarrierOperatorCC.d.ts +86 -294
- package/build/cjs/cc/BarrierOperatorCC.js +12 -44
- package/build/cjs/cc/BarrierOperatorCC.js.map +2 -2
- package/build/cjs/cc/BasicCC.d.ts +85 -331
- package/build/cjs/cc/BasicCC.js +15 -46
- package/build/cjs/cc/BasicCC.js.map +2 -2
- package/build/cjs/cc/BatteryCC.d.ts +237 -835
- package/build/cjs/cc/BatteryCC.js +7 -84
- package/build/cjs/cc/BatteryCC.js.map +2 -2
- package/build/cjs/cc/BinarySensorCC.d.ts +34 -99
- package/build/cjs/cc/BinarySensorCC.js +9 -29
- package/build/cjs/cc/BinarySensorCC.js.map +2 -2
- package/build/cjs/cc/BinarySwitchCC.d.ts +45 -197
- package/build/cjs/cc/BinarySwitchCC.js +6 -22
- package/build/cjs/cc/BinarySwitchCC.js.map +2 -2
- package/build/cjs/cc/CentralSceneCC.d.ts +77 -296
- package/build/cjs/cc/CentralSceneCC.js +7 -30
- package/build/cjs/cc/CentralSceneCC.js.map +2 -2
- package/build/cjs/cc/ClimateControlScheduleCC.d.ts +45 -160
- package/build/cjs/cc/ClimateControlScheduleCC.js +5 -24
- package/build/cjs/cc/ClimateControlScheduleCC.js.map +2 -2
- package/build/cjs/cc/ColorSwitchCC.d.ts +130 -457
- package/build/cjs/cc/ColorSwitchCC.js +23 -75
- package/build/cjs/cc/ColorSwitchCC.js.map +2 -2
- package/build/cjs/cc/ConfigurationCC.d.ts +32 -100
- package/build/cjs/cc/ConfigurationCC.js +11 -31
- package/build/cjs/cc/ConfigurationCC.js.map +2 -2
- package/build/cjs/cc/DoorLockCC.d.ts +512 -1823
- package/build/cjs/cc/DoorLockCC.js +51 -156
- package/build/cjs/cc/DoorLockCC.js.map +2 -2
- package/build/cjs/cc/DoorLockLoggingCC.d.ts +11 -63
- package/build/cjs/cc/DoorLockLoggingCC.js +4 -8
- package/build/cjs/cc/DoorLockLoggingCC.js.map +2 -2
- package/build/cjs/cc/EnergyProductionCC.d.ts +14 -29
- package/build/cjs/cc/EnergyProductionCC.js +5 -17
- package/build/cjs/cc/EnergyProductionCC.js.map +2 -2
- package/build/cjs/cc/EntryControlCC.d.ts +73 -324
- package/build/cjs/cc/EntryControlCC.js +9 -36
- package/build/cjs/cc/EntryControlCC.js.map +2 -2
- package/build/cjs/cc/FirmwareUpdateMetaDataCC.d.ts +78 -390
- package/build/cjs/cc/FirmwareUpdateMetaDataCC.js +5 -26
- package/build/cjs/cc/FirmwareUpdateMetaDataCC.js.map +2 -2
- package/build/cjs/cc/HumidityControlModeCC.d.ts +31 -131
- package/build/cjs/cc/HumidityControlModeCC.js +6 -15
- package/build/cjs/cc/HumidityControlModeCC.js.map +2 -2
- package/build/cjs/cc/HumidityControlOperatingStateCC.d.ts +17 -65
- package/build/cjs/cc/HumidityControlOperatingStateCC.js +4 -12
- package/build/cjs/cc/HumidityControlOperatingStateCC.js.map +2 -2
- package/build/cjs/cc/HumidityControlSetpointCC.d.ts +51 -128
- package/build/cjs/cc/HumidityControlSetpointCC.js +10 -28
- package/build/cjs/cc/HumidityControlSetpointCC.js.map +2 -2
- package/build/cjs/cc/IndicatorCC.d.ts +123 -365
- package/build/cjs/cc/IndicatorCC.js +15 -61
- package/build/cjs/cc/IndicatorCC.js.map +2 -2
- package/build/cjs/cc/IrrigationCC.d.ts +826 -2317
- package/build/cjs/cc/IrrigationCC.js +29 -233
- package/build/cjs/cc/IrrigationCC.js.map +2 -2
- package/build/cjs/cc/LanguageCC.d.ts +31 -133
- package/build/cjs/cc/LanguageCC.js +4 -15
- package/build/cjs/cc/LanguageCC.js.map +2 -2
- package/build/cjs/cc/LockCC.d.ts +14 -64
- package/build/cjs/cc/LockCC.js +4 -12
- package/build/cjs/cc/LockCC.js.map +2 -2
- package/build/cjs/cc/ManufacturerProprietaryCC.js.map +2 -2
- package/build/cjs/cc/ManufacturerSpecificCC.d.ts +77 -239
- package/build/cjs/cc/ManufacturerSpecificCC.js +5 -26
- package/build/cjs/cc/ManufacturerSpecificCC.js.map +2 -2
- package/build/cjs/cc/MeterCC.d.ts +119 -393
- package/build/cjs/cc/MeterCC.js +25 -69
- package/build/cjs/cc/MeterCC.js.map +2 -2
- package/build/cjs/cc/MultiChannelAssociationCC.d.ts +66 -166
- package/build/cjs/cc/MultiChannelAssociationCC.js +10 -23
- package/build/cjs/cc/MultiChannelAssociationCC.js.map +2 -2
- package/build/cjs/cc/MultiChannelCC.d.ts +119 -499
- package/build/cjs/cc/MultiChannelCC.js +18 -46
- package/build/cjs/cc/MultiChannelCC.js.map +2 -2
- package/build/cjs/cc/MultilevelSensorCC.d.ts +46 -130
- package/build/cjs/cc/MultilevelSensorCC.js +12 -33
- package/build/cjs/cc/MultilevelSensorCC.js.map +2 -2
- package/build/cjs/cc/MultilevelSwitchCC.d.ts +160 -525
- package/build/cjs/cc/MultilevelSwitchCC.js +13 -107
- package/build/cjs/cc/MultilevelSwitchCC.js.map +2 -2
- package/build/cjs/cc/NodeNamingCC.d.ts +33 -135
- package/build/cjs/cc/NodeNamingCC.js +5 -16
- package/build/cjs/cc/NodeNamingCC.js.map +2 -2
- package/build/cjs/cc/NotificationCC.d.ts +262 -702
- package/build/cjs/cc/NotificationCC.js +29 -112
- package/build/cjs/cc/NotificationCC.js.map +2 -2
- package/build/cjs/cc/ProtectionCC.d.ts +118 -524
- package/build/cjs/cc/ProtectionCC.js +15 -50
- package/build/cjs/cc/ProtectionCC.js.map +2 -2
- package/build/cjs/cc/SceneActivationCC.d.ts +33 -132
- package/build/cjs/cc/SceneActivationCC.js +4 -17
- package/build/cjs/cc/SceneActivationCC.js.map +2 -2
- package/build/cjs/cc/SceneActuatorConfigurationCC.d.ts +34 -61
- package/build/cjs/cc/SceneActuatorConfigurationCC.js +9 -21
- package/build/cjs/cc/SceneActuatorConfigurationCC.js.map +2 -2
- package/build/cjs/cc/SceneControllerConfigurationCC.d.ts +34 -61
- package/build/cjs/cc/SceneControllerConfigurationCC.js +10 -22
- package/build/cjs/cc/SceneControllerConfigurationCC.js.map +2 -2
- package/build/cjs/cc/ScheduleEntryLockCC.d.ts +95 -299
- package/build/cjs/cc/ScheduleEntryLockCC.js +13 -30
- package/build/cjs/cc/ScheduleEntryLockCC.js.map +2 -2
- package/build/cjs/cc/SoundSwitchCC.d.ts +72 -261
- package/build/cjs/cc/SoundSwitchCC.js +11 -43
- package/build/cjs/cc/SoundSwitchCC.js.map +2 -2
- package/build/cjs/cc/SupervisionCC.d.ts +17 -33
- package/build/cjs/cc/SupervisionCC.js +4 -9
- package/build/cjs/cc/SupervisionCC.js.map +2 -2
- package/build/cjs/cc/ThermostatFanModeCC.d.ts +44 -195
- package/build/cjs/cc/ThermostatFanModeCC.js +8 -21
- package/build/cjs/cc/ThermostatFanModeCC.js.map +2 -2
- package/build/cjs/cc/ThermostatFanStateCC.d.ts +17 -65
- package/build/cjs/cc/ThermostatFanStateCC.js +4 -12
- package/build/cjs/cc/ThermostatFanStateCC.js.map +2 -2
- package/build/cjs/cc/ThermostatModeCC.d.ts +44 -195
- package/build/cjs/cc/ThermostatModeCC.js +8 -21
- package/build/cjs/cc/ThermostatModeCC.js.map +2 -2
- package/build/cjs/cc/ThermostatOperatingStateCC.d.ts +17 -65
- package/build/cjs/cc/ThermostatOperatingStateCC.js +4 -12
- package/build/cjs/cc/ThermostatOperatingStateCC.js.map +2 -2
- package/build/cjs/cc/ThermostatSetpointCC.d.ts +49 -129
- package/build/cjs/cc/ThermostatSetpointCC.js +10 -25
- package/build/cjs/cc/ThermostatSetpointCC.js.map +2 -2
- package/build/cjs/cc/TimeParametersCC.d.ts +12 -63
- package/build/cjs/cc/TimeParametersCC.js +4 -11
- package/build/cjs/cc/TimeParametersCC.js.map +2 -2
- package/build/cjs/cc/UserCodeCC.d.ts +311 -1066
- package/build/cjs/cc/UserCodeCC.js +33 -98
- package/build/cjs/cc/UserCodeCC.js.map +2 -2
- package/build/cjs/cc/VersionCC.d.ts +289 -1003
- package/build/cjs/cc/VersionCC.js +7 -98
- package/build/cjs/cc/VersionCC.js.map +2 -2
- package/build/cjs/cc/WakeUpCC.d.ts +49 -201
- package/build/cjs/cc/WakeUpCC.js +6 -26
- package/build/cjs/cc/WakeUpCC.js.map +2 -2
- package/build/cjs/cc/WindowCoveringCC.d.ts +126 -220
- package/build/cjs/cc/WindowCoveringCC.js +16 -128
- package/build/cjs/cc/WindowCoveringCC.js.map +2 -2
- package/build/cjs/cc/ZWavePlusCC.d.ts +69 -329
- package/build/cjs/cc/ZWavePlusCC.js +4 -25
- package/build/cjs/cc/ZWavePlusCC.js.map +2 -2
- package/build/cjs/cc/_CCValues.generated.d.ts +15814 -0
- package/build/cjs/cc/_CCValues.generated.js +8723 -0
- package/build/cjs/cc/_CCValues.generated.js.map +7 -0
- package/build/cjs/lib/CCValueUtils.d.ts +14 -0
- package/build/cjs/lib/CCValueUtils.js +93 -0
- package/build/cjs/lib/CCValueUtils.js.map +7 -0
- package/build/cjs/lib/Values.d.ts +6 -105
- package/build/cjs/lib/Values.js +13 -107
- package/build/cjs/lib/Values.js.map +3 -3
- package/build/esm/cc/AlarmSensorCC.d.ts +79 -161
- package/build/esm/cc/AlarmSensorCC.d.ts.map +1 -1
- package/build/esm/cc/AlarmSensorCC.js +2 -39
- package/build/esm/cc/AlarmSensorCC.js.map +1 -1
- package/build/esm/cc/AssociationCC.d.ts +63 -199
- package/build/esm/cc/AssociationCC.d.ts.map +1 -1
- package/build/esm/cc/AssociationCC.js +2 -14
- package/build/esm/cc/AssociationCC.js.map +1 -1
- package/build/esm/cc/AssociationGroupInfoCC.d.ts +66 -166
- package/build/esm/cc/AssociationGroupInfoCC.d.ts.map +1 -1
- package/build/esm/cc/AssociationGroupInfoCC.js +2 -13
- package/build/esm/cc/AssociationGroupInfoCC.js.map +1 -1
- package/build/esm/cc/BarrierOperatorCC.d.ts +86 -294
- package/build/esm/cc/BarrierOperatorCC.d.ts.map +1 -1
- package/build/esm/cc/BarrierOperatorCC.js +2 -34
- package/build/esm/cc/BarrierOperatorCC.js.map +1 -1
- package/build/esm/cc/BasicCC.d.ts +85 -331
- package/build/esm/cc/BasicCC.d.ts.map +1 -1
- package/build/esm/cc/BasicCC.js +2 -32
- package/build/esm/cc/BasicCC.js.map +1 -1
- package/build/esm/cc/BatteryCC.d.ts +237 -835
- package/build/esm/cc/BatteryCC.d.ts.map +1 -1
- package/build/esm/cc/BatteryCC.js +2 -78
- package/build/esm/cc/BatteryCC.js.map +1 -1
- package/build/esm/cc/BinarySensorCC.d.ts +34 -99
- package/build/esm/cc/BinarySensorCC.d.ts.map +1 -1
- package/build/esm/cc/BinarySensorCC.js +2 -16
- package/build/esm/cc/BinarySensorCC.js.map +1 -1
- package/build/esm/cc/BinarySwitchCC.d.ts +45 -197
- package/build/esm/cc/BinarySwitchCC.d.ts.map +1 -1
- package/build/esm/cc/BinarySwitchCC.js +2 -17
- package/build/esm/cc/BinarySwitchCC.js.map +1 -1
- package/build/esm/cc/CentralSceneCC.d.ts +77 -296
- package/build/esm/cc/CentralSceneCC.d.ts.map +1 -1
- package/build/esm/cc/CentralSceneCC.js +2 -26
- package/build/esm/cc/CentralSceneCC.js.map +1 -1
- package/build/esm/cc/ClimateControlScheduleCC.d.ts +45 -160
- package/build/esm/cc/ClimateControlScheduleCC.d.ts.map +1 -1
- package/build/esm/cc/ClimateControlScheduleCC.js +2 -23
- package/build/esm/cc/ClimateControlScheduleCC.js.map +1 -1
- package/build/esm/cc/ColorSwitchCC.d.ts +130 -457
- package/build/esm/cc/ColorSwitchCC.d.ts.map +1 -1
- package/build/esm/cc/ColorSwitchCC.js +2 -52
- package/build/esm/cc/ColorSwitchCC.js.map +1 -1
- package/build/esm/cc/ConfigurationCC.d.ts +32 -100
- package/build/esm/cc/ConfigurationCC.d.ts.map +1 -1
- package/build/esm/cc/ConfigurationCC.js +2 -15
- package/build/esm/cc/ConfigurationCC.js.map +1 -1
- package/build/esm/cc/DoorLockCC.d.ts +512 -1823
- package/build/esm/cc/DoorLockCC.d.ts.map +1 -1
- package/build/esm/cc/DoorLockCC.js +9 -127
- package/build/esm/cc/DoorLockCC.js.map +1 -1
- package/build/esm/cc/DoorLockLoggingCC.d.ts +11 -63
- package/build/esm/cc/DoorLockLoggingCC.d.ts.map +1 -1
- package/build/esm/cc/DoorLockLoggingCC.js +2 -5
- package/build/esm/cc/DoorLockLoggingCC.js.map +1 -1
- package/build/esm/cc/EnergyProductionCC.d.ts +14 -29
- package/build/esm/cc/EnergyProductionCC.d.ts.map +1 -1
- package/build/esm/cc/EnergyProductionCC.js +2 -13
- package/build/esm/cc/EnergyProductionCC.js.map +1 -1
- package/build/esm/cc/EntryControlCC.d.ts +73 -324
- package/build/esm/cc/EntryControlCC.d.ts.map +1 -1
- package/build/esm/cc/EntryControlCC.js +2 -28
- package/build/esm/cc/EntryControlCC.js.map +1 -1
- package/build/esm/cc/FirmwareUpdateMetaDataCC.d.ts +78 -390
- package/build/esm/cc/FirmwareUpdateMetaDataCC.d.ts.map +1 -1
- package/build/esm/cc/FirmwareUpdateMetaDataCC.js +2 -23
- package/build/esm/cc/FirmwareUpdateMetaDataCC.js.map +1 -1
- package/build/esm/cc/HumidityControlModeCC.d.ts +31 -131
- package/build/esm/cc/HumidityControlModeCC.d.ts.map +1 -1
- package/build/esm/cc/HumidityControlModeCC.js +2 -10
- package/build/esm/cc/HumidityControlModeCC.js.map +1 -1
- package/build/esm/cc/HumidityControlOperatingStateCC.d.ts +17 -65
- package/build/esm/cc/HumidityControlOperatingStateCC.d.ts.map +1 -1
- package/build/esm/cc/HumidityControlOperatingStateCC.js +2 -9
- package/build/esm/cc/HumidityControlOperatingStateCC.js.map +1 -1
- package/build/esm/cc/HumidityControlSetpointCC.d.ts +51 -128
- package/build/esm/cc/HumidityControlSetpointCC.d.ts.map +1 -1
- package/build/esm/cc/HumidityControlSetpointCC.js +2 -19
- package/build/esm/cc/HumidityControlSetpointCC.js.map +1 -1
- package/build/esm/cc/IndicatorCC.d.ts +123 -365
- package/build/esm/cc/IndicatorCC.d.ts.map +1 -1
- package/build/esm/cc/IndicatorCC.js +2 -43
- package/build/esm/cc/IndicatorCC.js.map +1 -1
- package/build/esm/cc/IrrigationCC.d.ts +826 -2317
- package/build/esm/cc/IrrigationCC.d.ts.map +1 -1
- package/build/esm/cc/IrrigationCC.js +3 -222
- package/build/esm/cc/IrrigationCC.js.map +1 -1
- package/build/esm/cc/LanguageCC.d.ts +31 -133
- package/build/esm/cc/LanguageCC.d.ts.map +1 -1
- package/build/esm/cc/LanguageCC.js +2 -12
- package/build/esm/cc/LanguageCC.js.map +1 -1
- package/build/esm/cc/LockCC.d.ts +14 -64
- package/build/esm/cc/LockCC.d.ts.map +1 -1
- package/build/esm/cc/LockCC.js +2 -9
- package/build/esm/cc/LockCC.js.map +1 -1
- package/build/esm/cc/ManufacturerProprietaryCC.d.ts.map +1 -1
- package/build/esm/cc/ManufacturerProprietaryCC.js +0 -1
- package/build/esm/cc/ManufacturerProprietaryCC.js.map +1 -1
- package/build/esm/cc/ManufacturerSpecificCC.d.ts +77 -239
- package/build/esm/cc/ManufacturerSpecificCC.d.ts.map +1 -1
- package/build/esm/cc/ManufacturerSpecificCC.js +2 -24
- package/build/esm/cc/ManufacturerSpecificCC.js.map +1 -1
- package/build/esm/cc/MeterCC.d.ts +119 -393
- package/build/esm/cc/MeterCC.d.ts.map +1 -1
- package/build/esm/cc/MeterCC.js +3 -49
- package/build/esm/cc/MeterCC.js.map +1 -1
- package/build/esm/cc/MultiChannelAssociationCC.d.ts +66 -166
- package/build/esm/cc/MultiChannelAssociationCC.d.ts.map +1 -1
- package/build/esm/cc/MultiChannelAssociationCC.js +2 -14
- package/build/esm/cc/MultiChannelAssociationCC.js.map +1 -1
- package/build/esm/cc/MultiChannelCC.d.ts +119 -499
- package/build/esm/cc/MultiChannelCC.d.ts.map +1 -1
- package/build/esm/cc/MultiChannelCC.js +2 -30
- package/build/esm/cc/MultiChannelCC.js.map +1 -1
- package/build/esm/cc/MultilevelSensorCC.d.ts +46 -130
- package/build/esm/cc/MultilevelSensorCC.d.ts.map +1 -1
- package/build/esm/cc/MultilevelSensorCC.js +2 -22
- package/build/esm/cc/MultilevelSensorCC.js.map +1 -1
- package/build/esm/cc/MultilevelSwitchCC.d.ts +160 -525
- package/build/esm/cc/MultilevelSwitchCC.d.ts.map +1 -1
- package/build/esm/cc/MultilevelSwitchCC.js +5 -101
- package/build/esm/cc/MultilevelSwitchCC.js.map +1 -1
- package/build/esm/cc/NodeNamingCC.d.ts +33 -135
- package/build/esm/cc/NodeNamingCC.d.ts.map +1 -1
- package/build/esm/cc/NodeNamingCC.js +2 -12
- package/build/esm/cc/NodeNamingCC.js.map +1 -1
- package/build/esm/cc/NotificationCC.d.ts +262 -702
- package/build/esm/cc/NotificationCC.d.ts.map +1 -1
- package/build/esm/cc/NotificationCC.js +3 -85
- package/build/esm/cc/NotificationCC.js.map +1 -1
- package/build/esm/cc/ProtectionCC.d.ts +118 -524
- package/build/esm/cc/ProtectionCC.d.ts.map +1 -1
- package/build/esm/cc/ProtectionCC.js +2 -36
- package/build/esm/cc/ProtectionCC.js.map +1 -1
- package/build/esm/cc/SceneActivationCC.d.ts +33 -132
- package/build/esm/cc/SceneActivationCC.d.ts.map +1 -1
- package/build/esm/cc/SceneActivationCC.js +2 -14
- package/build/esm/cc/SceneActivationCC.js.map +1 -1
- package/build/esm/cc/SceneActuatorConfigurationCC.d.ts +34 -61
- package/build/esm/cc/SceneActuatorConfigurationCC.d.ts.map +1 -1
- package/build/esm/cc/SceneActuatorConfigurationCC.js +2 -14
- package/build/esm/cc/SceneActuatorConfigurationCC.js.map +1 -1
- package/build/esm/cc/SceneControllerConfigurationCC.d.ts +34 -61
- package/build/esm/cc/SceneControllerConfigurationCC.d.ts.map +1 -1
- package/build/esm/cc/SceneControllerConfigurationCC.js +2 -14
- package/build/esm/cc/SceneControllerConfigurationCC.js.map +1 -1
- package/build/esm/cc/ScheduleEntryLockCC.d.ts +95 -299
- package/build/esm/cc/ScheduleEntryLockCC.d.ts.map +1 -1
- package/build/esm/cc/ScheduleEntryLockCC.js +2 -17
- package/build/esm/cc/ScheduleEntryLockCC.js.map +1 -1
- package/build/esm/cc/SoundSwitchCC.d.ts +72 -261
- package/build/esm/cc/SoundSwitchCC.d.ts.map +1 -1
- package/build/esm/cc/SoundSwitchCC.js +2 -33
- package/build/esm/cc/SoundSwitchCC.js.map +1 -1
- package/build/esm/cc/SupervisionCC.d.ts +17 -33
- package/build/esm/cc/SupervisionCC.d.ts.map +1 -1
- package/build/esm/cc/SupervisionCC.js +2 -7
- package/build/esm/cc/SupervisionCC.js.map +1 -1
- package/build/esm/cc/ThermostatFanModeCC.d.ts +44 -195
- package/build/esm/cc/ThermostatFanModeCC.d.ts.map +1 -1
- package/build/esm/cc/ThermostatFanModeCC.js +2 -14
- package/build/esm/cc/ThermostatFanModeCC.js.map +1 -1
- package/build/esm/cc/ThermostatFanStateCC.d.ts +17 -65
- package/build/esm/cc/ThermostatFanStateCC.d.ts.map +1 -1
- package/build/esm/cc/ThermostatFanStateCC.js +2 -9
- package/build/esm/cc/ThermostatFanStateCC.js.map +1 -1
- package/build/esm/cc/ThermostatModeCC.d.ts +44 -195
- package/build/esm/cc/ThermostatModeCC.d.ts.map +1 -1
- package/build/esm/cc/ThermostatModeCC.js +2 -14
- package/build/esm/cc/ThermostatModeCC.js.map +1 -1
- package/build/esm/cc/ThermostatOperatingStateCC.d.ts +17 -65
- package/build/esm/cc/ThermostatOperatingStateCC.d.ts.map +1 -1
- package/build/esm/cc/ThermostatOperatingStateCC.js +2 -9
- package/build/esm/cc/ThermostatOperatingStateCC.js.map +1 -1
- package/build/esm/cc/ThermostatSetpointCC.d.ts +49 -129
- package/build/esm/cc/ThermostatSetpointCC.d.ts.map +1 -1
- package/build/esm/cc/ThermostatSetpointCC.js +2 -16
- package/build/esm/cc/ThermostatSetpointCC.js.map +1 -1
- package/build/esm/cc/TimeParametersCC.d.ts +12 -63
- package/build/esm/cc/TimeParametersCC.d.ts.map +1 -1
- package/build/esm/cc/TimeParametersCC.js +2 -8
- package/build/esm/cc/TimeParametersCC.js.map +1 -1
- package/build/esm/cc/UserCodeCC.d.ts +311 -1066
- package/build/esm/cc/UserCodeCC.d.ts.map +1 -1
- package/build/esm/cc/UserCodeCC.js +2 -60
- package/build/esm/cc/UserCodeCC.js.map +1 -1
- package/build/esm/cc/VersionCC.d.ts +289 -1003
- package/build/esm/cc/VersionCC.d.ts.map +1 -1
- package/build/esm/cc/VersionCC.js +2 -92
- package/build/esm/cc/VersionCC.js.map +1 -1
- package/build/esm/cc/WakeUpCC.d.ts +49 -201
- package/build/esm/cc/WakeUpCC.d.ts.map +1 -1
- package/build/esm/cc/WakeUpCC.js +2 -21
- package/build/esm/cc/WakeUpCC.js.map +1 -1
- package/build/esm/cc/WindowCoveringCC.d.ts +126 -220
- package/build/esm/cc/WindowCoveringCC.d.ts.map +1 -1
- package/build/esm/cc/WindowCoveringCC.js +3 -103
- package/build/esm/cc/WindowCoveringCC.js.map +1 -1
- package/build/esm/cc/ZWavePlusCC.d.ts +69 -329
- package/build/esm/cc/ZWavePlusCC.d.ts.map +1 -1
- package/build/esm/cc/ZWavePlusCC.js +2 -25
- package/build/esm/cc/ZWavePlusCC.js.map +1 -1
- package/build/esm/cc/_CCValues.generated.d.ts +15814 -0
- package/build/esm/cc/_CCValues.generated.d.ts.map +1 -0
- package/build/esm/cc/_CCValues.generated.js +9187 -0
- package/build/esm/cc/_CCValues.generated.js.map +1 -0
- package/build/esm/lib/CCValueUtils.d.ts +14 -0
- package/build/esm/lib/CCValueUtils.d.ts.map +1 -0
- package/build/esm/lib/CCValueUtils.js +62 -0
- package/build/esm/lib/CCValueUtils.js.map +1 -0
- package/build/esm/lib/Values.d.ts +6 -105
- package/build/esm/lib/Values.d.ts.map +1 -1
- package/build/esm/lib/Values.js +7 -104
- package/build/esm/lib/Values.js.map +1 -1
- package/package.json +9 -7
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { type RateType, type ValveId, WindowCoveringParameter } from "./_Types.js";
|
|
2
|
+
/**
|
|
3
|
+
* Translates a switch type into two actions that may be performed. Unknown types default to Down/Up
|
|
4
|
+
*/
|
|
5
|
+
export declare function multilevelSwitchTypeToActions(switchType: string): [down: string, up: string];
|
|
6
|
+
/**
|
|
7
|
+
* The property names are organized so that positive motions are at odd indices and negative motions at even indices
|
|
8
|
+
*/
|
|
9
|
+
export declare const multilevelSwitchTypeProperties: string[];
|
|
10
|
+
export declare function windowCoveringParameterToMetadataStates(parameter: WindowCoveringParameter): Record<number, string>;
|
|
11
|
+
export declare function windowCoveringParameterToLevelChangeLabel(parameter: WindowCoveringParameter, direction: "up" | "down"): string;
|
|
12
|
+
export declare function meterTypesToPropertyKey(meterType: number, rateType: RateType, scale: number): number;
|
|
13
|
+
export declare function irrigationValveIdToMetadataPrefix(valveId: ValveId): string;
|
|
14
|
+
//# sourceMappingURL=CCValueUtils.d.ts.map
|
|
@@ -0,0 +1,93 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __defProp = Object.defineProperty;
|
|
3
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
+
var __name = (target, value) => __defProp(target, "name", { value, configurable: true });
|
|
7
|
+
var __export = (target, all) => {
|
|
8
|
+
for (var name in all)
|
|
9
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
10
|
+
};
|
|
11
|
+
var __copyProps = (to, from, except, desc) => {
|
|
12
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
13
|
+
for (let key of __getOwnPropNames(from))
|
|
14
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
15
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
16
|
+
}
|
|
17
|
+
return to;
|
|
18
|
+
};
|
|
19
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
20
|
+
var CCValueUtils_exports = {};
|
|
21
|
+
__export(CCValueUtils_exports, {
|
|
22
|
+
irrigationValveIdToMetadataPrefix: () => irrigationValveIdToMetadataPrefix,
|
|
23
|
+
meterTypesToPropertyKey: () => meterTypesToPropertyKey,
|
|
24
|
+
multilevelSwitchTypeProperties: () => multilevelSwitchTypeProperties,
|
|
25
|
+
multilevelSwitchTypeToActions: () => multilevelSwitchTypeToActions,
|
|
26
|
+
windowCoveringParameterToLevelChangeLabel: () => windowCoveringParameterToLevelChangeLabel,
|
|
27
|
+
windowCoveringParameterToMetadataStates: () => windowCoveringParameterToMetadataStates
|
|
28
|
+
});
|
|
29
|
+
module.exports = __toCommonJS(CCValueUtils_exports);
|
|
30
|
+
var import_Types = require("./_Types.js");
|
|
31
|
+
function multilevelSwitchTypeToActions(switchType) {
|
|
32
|
+
if (!switchType.includes("/"))
|
|
33
|
+
switchType = import_Types.SwitchType[2];
|
|
34
|
+
return switchType.split("/", 2);
|
|
35
|
+
}
|
|
36
|
+
__name(multilevelSwitchTypeToActions, "multilevelSwitchTypeToActions");
|
|
37
|
+
const multilevelSwitchTypeProperties = Object.keys(import_Types.SwitchType).filter((key) => key.includes("/")).map((key) => multilevelSwitchTypeToActions(key)).reduce((acc, cur) => acc.concat(...cur), []);
|
|
38
|
+
function windowCoveringParameterToMetadataStates(parameter) {
|
|
39
|
+
switch (parameter) {
|
|
40
|
+
case import_Types.WindowCoveringParameter["Vertical Slats Angle (no position)"]:
|
|
41
|
+
case import_Types.WindowCoveringParameter["Vertical Slats Angle"]:
|
|
42
|
+
return {
|
|
43
|
+
0: "Closed (right inside)",
|
|
44
|
+
50: "Open",
|
|
45
|
+
99: "Closed (left inside)"
|
|
46
|
+
};
|
|
47
|
+
case import_Types.WindowCoveringParameter["Horizontal Slats Angle (no position)"]:
|
|
48
|
+
case import_Types.WindowCoveringParameter["Horizontal Slats Angle"]:
|
|
49
|
+
return {
|
|
50
|
+
0: "Closed (up inside)",
|
|
51
|
+
50: "Open",
|
|
52
|
+
99: "Closed (down inside)"
|
|
53
|
+
};
|
|
54
|
+
}
|
|
55
|
+
return {
|
|
56
|
+
0: "Closed",
|
|
57
|
+
99: "Open"
|
|
58
|
+
};
|
|
59
|
+
}
|
|
60
|
+
__name(windowCoveringParameterToMetadataStates, "windowCoveringParameterToMetadataStates");
|
|
61
|
+
function windowCoveringParameterToLevelChangeLabel(parameter, direction) {
|
|
62
|
+
switch (parameter) {
|
|
63
|
+
// For angle control, both directions are closed, so we specify it explicitly
|
|
64
|
+
case import_Types.WindowCoveringParameter["Vertical Slats Angle (no position)"]:
|
|
65
|
+
case import_Types.WindowCoveringParameter["Vertical Slats Angle"]:
|
|
66
|
+
return `Change tilt (${direction === "up" ? "left inside" : "right inside"})`;
|
|
67
|
+
case import_Types.WindowCoveringParameter["Horizontal Slats Angle (no position)"]:
|
|
68
|
+
case import_Types.WindowCoveringParameter["Horizontal Slats Angle"]:
|
|
69
|
+
return `Change tilt (${direction === "up" ? "down inside" : "up inside"})`;
|
|
70
|
+
}
|
|
71
|
+
return direction === "up" ? "Open" : "Close";
|
|
72
|
+
}
|
|
73
|
+
__name(windowCoveringParameterToLevelChangeLabel, "windowCoveringParameterToLevelChangeLabel");
|
|
74
|
+
function meterTypesToPropertyKey(meterType, rateType, scale) {
|
|
75
|
+
return meterType << 16 | scale << 8 | rateType;
|
|
76
|
+
}
|
|
77
|
+
__name(meterTypesToPropertyKey, "meterTypesToPropertyKey");
|
|
78
|
+
function irrigationValveIdToMetadataPrefix(valveId) {
|
|
79
|
+
if (valveId === "master")
|
|
80
|
+
return "Master valve";
|
|
81
|
+
return `Valve ${valveId.toString().padStart(3, "0")}`;
|
|
82
|
+
}
|
|
83
|
+
__name(irrigationValveIdToMetadataPrefix, "irrigationValveIdToMetadataPrefix");
|
|
84
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
85
|
+
0 && (module.exports = {
|
|
86
|
+
irrigationValveIdToMetadataPrefix,
|
|
87
|
+
meterTypesToPropertyKey,
|
|
88
|
+
multilevelSwitchTypeProperties,
|
|
89
|
+
multilevelSwitchTypeToActions,
|
|
90
|
+
windowCoveringParameterToLevelChangeLabel,
|
|
91
|
+
windowCoveringParameterToMetadataStates
|
|
92
|
+
});
|
|
93
|
+
//# sourceMappingURL=CCValueUtils.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../src/lib/CCValueUtils.ts"],
|
|
4
|
+
"sourcesContent": ["import {\n\ttype RateType,\n\tSwitchType,\n\ttype ValveId,\n\tWindowCoveringParameter,\n} from \"./_Types.js\";\n\n/**\n * Translates a switch type into two actions that may be performed. Unknown types default to Down/Up\n */\n\nexport function multilevelSwitchTypeToActions(\n\tswitchType: string,\n): [down: string, up: string] {\n\tif (!switchType.includes(\"/\")) switchType = SwitchType[0x02]; // Down/Up\n\treturn switchType.split(\"/\", 2) as any;\n}\n/**\n * The property names are organized so that positive motions are at odd indices and negative motions at even indices\n */\n\nexport const multilevelSwitchTypeProperties = Object.keys(SwitchType)\n\t.filter((key) => key.includes(\"/\"))\n\t.map((key) => multilevelSwitchTypeToActions(key))\n\t.reduce<string[]>((acc, cur) => acc.concat(...cur), []);\n\nexport function windowCoveringParameterToMetadataStates(\n\tparameter: WindowCoveringParameter,\n): Record<number, string> {\n\tswitch (parameter) {\n\t\tcase WindowCoveringParameter[\"Vertical Slats Angle (no position)\"]:\n\t\tcase WindowCoveringParameter[\"Vertical Slats Angle\"]:\n\t\t\treturn {\n\t\t\t\t0: \"Closed (right inside)\",\n\t\t\t\t50: \"Open\",\n\t\t\t\t99: \"Closed (left inside)\",\n\t\t\t};\n\n\t\tcase WindowCoveringParameter[\"Horizontal Slats Angle (no position)\"]:\n\t\tcase WindowCoveringParameter[\"Horizontal Slats Angle\"]:\n\t\t\treturn {\n\t\t\t\t0: \"Closed (up inside)\",\n\t\t\t\t50: \"Open\",\n\t\t\t\t99: \"Closed (down inside)\",\n\t\t\t};\n\t}\n\n\treturn {\n\t\t0: \"Closed\",\n\t\t99: \"Open\",\n\t};\n}\n\nexport function windowCoveringParameterToLevelChangeLabel(\n\tparameter: WindowCoveringParameter,\n\tdirection: \"up\" | \"down\",\n): string {\n\tswitch (parameter) {\n\t\t// For angle control, both directions are closed, so we specify it explicitly\n\t\tcase WindowCoveringParameter[\"Vertical Slats Angle (no position)\"]:\n\t\tcase WindowCoveringParameter[\"Vertical Slats Angle\"]:\n\t\t\treturn `Change tilt (${\n\t\t\t\tdirection === \"up\" ? \"left inside\" : \"right inside\"\n\t\t\t})`;\n\n\t\tcase WindowCoveringParameter[\"Horizontal Slats Angle (no position)\"]:\n\t\tcase WindowCoveringParameter[\"Horizontal Slats Angle\"]:\n\t\t\t// Horizontal slats refer to the position of the inner side of the slats\n\t\t\t// where a high level (99) actually means they face down\n\t\t\treturn `Change tilt (${\n\t\t\t\tdirection === \"up\" ? \"down inside\" : \"up inside\"\n\t\t\t})`;\n\t}\n\t// For all other parameters, refer to the amount of light that is let in\n\treturn direction === \"up\" ? \"Open\" : \"Close\";\n}\n\nexport function meterTypesToPropertyKey(\n\tmeterType: number,\n\trateType: RateType,\n\tscale: number,\n): number {\n\treturn (meterType << 16) | (scale << 8) | rateType;\n}\n\nexport function irrigationValveIdToMetadataPrefix(valveId: ValveId): string {\n\tif (valveId === \"master\") return \"Master valve\";\n\treturn `Valve ${valveId.toString().padStart(3, \"0\")}`;\n}\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;AAAA;;;;;;;;;;AAAA,mBAKO;AAMD,SAAU,8BACf,YAAkB;AAElB,MAAI,CAAC,WAAW,SAAS,GAAG;AAAG,iBAAa,wBAAW,CAAI;AAC3D,SAAO,WAAW,MAAM,KAAK,CAAC;AAC/B;AALgB;AAUT,MAAM,iCAAiC,OAAO,KAAK,uBAAU,EAClE,OAAO,CAAC,QAAQ,IAAI,SAAS,GAAG,CAAC,EACjC,IAAI,CAAC,QAAQ,8BAA8B,GAAG,CAAC,EAC/C,OAAiB,CAAC,KAAK,QAAQ,IAAI,OAAO,GAAG,GAAG,GAAG,CAAA,CAAE;AAEjD,SAAU,wCACf,WAAkC;AAElC,UAAQ,WAAW;IAClB,KAAK,qCAAwB,oCAAoC;IACjE,KAAK,qCAAwB,sBAAsB;AAClD,aAAO;QACN,GAAG;QACH,IAAI;QACJ,IAAI;;IAGN,KAAK,qCAAwB,sCAAsC;IACnE,KAAK,qCAAwB,wBAAwB;AACpD,aAAO;QACN,GAAG;QACH,IAAI;QACJ,IAAI;;EAEP;AAEA,SAAO;IACN,GAAG;IACH,IAAI;;AAEN;AAzBgB;AA2BV,SAAU,0CACf,WACA,WAAwB;AAExB,UAAQ,WAAW;;IAElB,KAAK,qCAAwB,oCAAoC;IACjE,KAAK,qCAAwB,sBAAsB;AAClD,aAAO,gBACN,cAAc,OAAO,gBAAgB,cACtC;IAED,KAAK,qCAAwB,sCAAsC;IACnE,KAAK,qCAAwB,wBAAwB;AAGpD,aAAO,gBACN,cAAc,OAAO,gBAAgB,WACtC;EACF;AAEA,SAAO,cAAc,OAAO,SAAS;AACtC;AAtBgB;AAwBV,SAAU,wBACf,WACA,UACA,OAAa;AAEb,SAAQ,aAAa,KAAO,SAAS,IAAK;AAC3C;AANgB;AAQV,SAAU,kCAAkC,SAAgB;AACjE,MAAI,YAAY;AAAU,WAAO;AACjC,SAAO,SAAS,QAAQ,SAAQ,EAAG,SAAS,GAAG,GAAG,CAAC;AACpD;AAHgB;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { type GetDeviceConfig } from "@zwave-js/config";
|
|
2
|
-
import { type CommandClasses, type EndpointId, type GetValueDB, type ValueID, ValueMetadata } from "@zwave-js/core/safe";
|
|
2
|
+
import { type CommandClasses, type EndpointId, type GetValueDB, type ValueID, type ValueMetadata } from "@zwave-js/core/safe";
|
|
3
3
|
import { type FnOrStatic, type ReturnTypeOrStatic } from "@zwave-js/shared/safe";
|
|
4
|
-
import type { Overwrite } from "alcalzone-shared/types";
|
|
5
4
|
import type { ValueIDProperties } from "./API.js";
|
|
5
|
+
declare function defineCCValues<T extends CommandClasses>(commandClass: T, _: Record<string, CCValueBlueprint | DynamicCCValueBlueprint<any[]>>): typeof import("../cc/_CCValues.generated.js").CCValues[T];
|
|
6
6
|
export interface CCValueOptions {
|
|
7
7
|
/**
|
|
8
8
|
* Whether the CC value is internal. Internal values are not exposed to the user.
|
|
@@ -36,7 +36,6 @@ export declare const defaultCCValueOptions: {
|
|
|
36
36
|
readonly supportsEndpoints: true;
|
|
37
37
|
readonly autoCreate: true;
|
|
38
38
|
};
|
|
39
|
-
type DefaultOptions = typeof defaultCCValueOptions;
|
|
40
39
|
export type ExpandRecursively<T> = T extends (...args: infer A) => infer R ? [keyof T] extends [never] ? (...args: A) => ExpandRecursively<R> : ((...args: A) => ExpandRecursively<R>) & {
|
|
41
40
|
[P in keyof T]: ExpandRecursively<T[P]>;
|
|
42
41
|
} : T extends object ? T extends infer O ? {
|
|
@@ -47,34 +46,19 @@ export type ExpandRecursivelySkipMeta<T> = T extends (...args: infer A) => infer
|
|
|
47
46
|
} : T extends ValueMetadata ? T : T extends object ? T extends infer O ? {
|
|
48
47
|
[K in keyof O]: ExpandRecursivelySkipMeta<O[K]>;
|
|
49
48
|
} : never : T;
|
|
50
|
-
type InferValueIDBase<TCommandClass extends CommandClasses, TBlueprint extends CCValueBlueprint, TWorker = {
|
|
51
|
-
commandClass: TCommandClass;
|
|
52
|
-
} & Pick<TBlueprint, "property" | "propertyKey">> = {
|
|
53
|
-
[K in keyof TWorker as unknown extends TWorker[K] ? never : K]: TWorker[K];
|
|
54
|
-
};
|
|
55
|
-
type ToStaticCCValues<TCommandClass extends CommandClasses, TValues extends Record<keyof TValues, CCValueBlueprint>> = Readonly<{
|
|
56
|
-
[K in keyof TValues]: ExpandRecursively<InferStaticCCValue<TCommandClass, TValues[K]>>;
|
|
57
|
-
}>;
|
|
58
|
-
type ToDynamicCCValues<TCommandClass extends CommandClasses, TValues extends Record<keyof TValues, DynamicCCValueBlueprint<any>>> = Readonly<{
|
|
59
|
-
[K in keyof TValues]: ExpandRecursively<InferDynamicCCValue<TCommandClass, TValues[K]>>;
|
|
60
|
-
}>;
|
|
61
49
|
type InferArgs<T extends FnOrStatic<any, any>[]> = T extends [
|
|
62
50
|
(...args: infer A) => any,
|
|
63
51
|
...any
|
|
64
52
|
] ? A : T extends [any, ...infer R] ? InferArgs<R> : [];
|
|
65
53
|
export declare const V: {
|
|
66
|
-
/** Defines multiple static CC values that belong to the same CC */
|
|
67
|
-
defineStaticCCValues<TCommandClass extends CommandClasses, TValues extends Record<keyof TValues, CCValueBlueprint>>(commandClass: TCommandClass, values: TValues): TValues extends Record<keyof TValues, CCValueBlueprint> ? ExpandRecursively<ToStaticCCValues<TCommandClass, TValues>> : never;
|
|
68
|
-
/** Defines multiple static CC values that belong to the same CC */
|
|
69
|
-
defineDynamicCCValues<TCommandClass extends CommandClasses, TValues extends Record<keyof TValues, DynamicCCValueBlueprint<any>>>(commandClass: TCommandClass, values: TValues): TValues extends Record<keyof TValues, DynamicCCValueBlueprint<any>> ? ExpandRecursively<ToDynamicCCValues<TCommandClass, TValues>> : never;
|
|
70
54
|
/** Returns a CC value definition that is named like the value `property` */
|
|
71
|
-
staticProperty<TProp extends string | number, TMeta extends ValueMetadata, TOptions extends CCValueOptions>(property: TProp, meta?: TMeta, options?: TOptions): { [K in TProp]: {
|
|
55
|
+
staticProperty<TProp extends string | number, const TMeta extends ValueMetadata, const TOptions extends CCValueOptions>(property: TProp, meta?: TMeta, options?: TOptions): { [K in TProp]: {
|
|
72
56
|
property: TProp;
|
|
73
57
|
meta: TMeta;
|
|
74
58
|
options: TOptions;
|
|
75
59
|
}; };
|
|
76
60
|
/** Returns a CC value definition with the given name and `property` */
|
|
77
|
-
staticPropertyWithName<TName extends string, TProp extends string | number, TMeta extends ValueMetadata, TOptions extends CCValueOptions>(name: TName, property: TProp, meta?: TMeta, options?: TOptions): { [K in TName]: {
|
|
61
|
+
staticPropertyWithName<TName extends string, TProp extends string | number, const TMeta extends ValueMetadata, const TOptions extends CCValueOptions>(name: TName, property: TProp, meta?: TMeta, options?: TOptions): { [K in TName]: {
|
|
78
62
|
property: TProp;
|
|
79
63
|
meta: TMeta;
|
|
80
64
|
options: TOptions;
|
|
@@ -96,7 +80,7 @@ export declare const V: {
|
|
|
96
80
|
options: TOptions;
|
|
97
81
|
}; };
|
|
98
82
|
/** Returns a CC value definition with the given name and a dynamic `property` */
|
|
99
|
-
dynamicPropertyAndKeyWithName<TName extends string, TProp extends FnOrStatic<any[], ValueIDProperties["property"]>, TKey extends FnOrStatic<any[], ValueIDProperties["propertyKey"]>,
|
|
83
|
+
dynamicPropertyAndKeyWithName<TName extends string, TProp extends FnOrStatic<any[], ValueIDProperties["property"]>, TKey extends FnOrStatic<any[], ValueIDProperties["propertyKey"]>, TOptions extends CCValueOptions, TMeta extends FnOrStatic<any[], ValueMetadata> = ValueMetadata>(name: TName, property: TProp, propertyKey: TKey, is: PartialCCValuePredicate, meta?: TMeta, options?: TOptions): { [K in TName]: {
|
|
100
84
|
(...args: InferArgs<[TProp, TKey, TMeta]>): {
|
|
101
85
|
property: ReturnTypeOrStatic<TProp>;
|
|
102
86
|
propertyKey: ReturnTypeOrStatic<TKey>;
|
|
@@ -105,6 +89,7 @@ export declare const V: {
|
|
|
105
89
|
is: PartialCCValuePredicate;
|
|
106
90
|
options: TOptions;
|
|
107
91
|
}; };
|
|
92
|
+
defineCCValues: typeof defineCCValues;
|
|
108
93
|
};
|
|
109
94
|
export interface CCValueBlueprint extends Readonly<ValueIDProperties> {
|
|
110
95
|
readonly meta?: Readonly<ValueMetadata>;
|
|
@@ -118,106 +103,22 @@ export interface DynamicCCValueBlueprint<TArgs extends any[]> {
|
|
|
118
103
|
is: PartialCCValuePredicate;
|
|
119
104
|
readonly options?: Readonly<CCValueOptions>;
|
|
120
105
|
}
|
|
121
|
-
type DropOptional<T> = {
|
|
122
|
-
[K in keyof T as [undefined] extends [T[K]] ? never : K]: T[K];
|
|
123
|
-
};
|
|
124
|
-
type MergeOptions<TOptions extends CCValueOptions> = DropOptional<CCValueOptions extends TOptions ? DefaultOptions : Overwrite<DefaultOptions, TOptions>>;
|
|
125
|
-
type MergeMeta<TMeta extends ValueMetadata> = DropOptional<ValueMetadata extends TMeta ? (typeof ValueMetadata)["Any"] : Overwrite<(typeof ValueMetadata)["Any"], TMeta>>;
|
|
126
106
|
/** The common base type of all CC value definitions */
|
|
127
107
|
export interface CCValue {
|
|
128
108
|
readonly id: Omit<ValueID, "endpoint">;
|
|
129
109
|
endpoint(endpoint?: number): ValueID;
|
|
130
110
|
readonly meta: ValueMetadata;
|
|
131
111
|
}
|
|
132
|
-
type AddCCValueProperties<TCommandClass extends CommandClasses, TBlueprint extends CCValueBlueprint, ValueIDBase extends Record<string, any> = InferValueIDBase<TCommandClass, TBlueprint>> = {
|
|
133
|
-
/** Returns the value ID of this CC value, without endpoint information */
|
|
134
|
-
get id(): ValueIDBase;
|
|
135
|
-
/** Returns the value ID, specialized to the given endpoint */
|
|
136
|
-
endpoint(endpoint?: number): Readonly<Pick<ValueIDBase, "commandClass"> & {
|
|
137
|
-
endpoint: number;
|
|
138
|
-
} & Omit<ValueIDBase, "commandClass">>;
|
|
139
|
-
/** Whether the given value ID matches this value definition */
|
|
140
|
-
is: CCValuePredicate;
|
|
141
|
-
/** Returns the metadata for this value ID */
|
|
142
|
-
get meta(): Readonly<MergeMeta<NonNullable<TBlueprint["meta"]>>>;
|
|
143
|
-
/** Returns the value options for this value ID */
|
|
144
|
-
get options(): Readonly<MergeOptions<NonNullable<TBlueprint["options"]>>>;
|
|
145
|
-
};
|
|
146
|
-
/** A CC value definition which depends on one or more parameters, transparently inferred from its arguments */
|
|
147
|
-
export type InferDynamicCCValue<TCommandClass extends CommandClasses, TBlueprint extends DynamicCCValueBlueprint<any[]>> = TBlueprint extends DynamicCCValueBlueprint<infer TArgs> ? {
|
|
148
|
-
(...args: TArgs): Omit<InferStaticCCValue<TCommandClass, ReturnType<TBlueprint>>, "options" | "is">;
|
|
149
|
-
/** Whether the given value ID matches this value definition */
|
|
150
|
-
is: CCValuePredicate;
|
|
151
|
-
readonly options: InferStaticCCValue<TCommandClass, ReturnType<TBlueprint> & {
|
|
152
|
-
options: TBlueprint["options"];
|
|
153
|
-
}>["options"];
|
|
154
|
-
} : never;
|
|
155
|
-
/** A static or evaluated CC value definition, transparently inferred from its arguments */
|
|
156
|
-
export type InferStaticCCValue<TCommandClass extends CommandClasses, TBlueprint extends CCValueBlueprint> = Readonly<AddCCValueProperties<TCommandClass, TBlueprint>>;
|
|
157
|
-
/** The generic variant of {@link InferStaticCCValue}, without inferring arguments */
|
|
158
112
|
export interface StaticCCValue extends CCValue {
|
|
159
113
|
/** Whether the given value ID matches this value definition */
|
|
160
114
|
is: CCValuePredicate;
|
|
161
115
|
readonly options: Required<CCValueOptions>;
|
|
162
116
|
}
|
|
163
|
-
/** The generic variant of {@link InferDynamicCCValue}, without inferring arguments */
|
|
164
117
|
export type DynamicCCValue<TArgs extends any[] = any[]> = ExpandRecursivelySkipMeta<(...args: TArgs) => CCValue> & {
|
|
165
118
|
/** Whether the given value ID matches this value definition */
|
|
166
119
|
is: CCValuePredicate;
|
|
167
120
|
readonly options: Required<CCValueOptions>;
|
|
168
121
|
};
|
|
169
122
|
export type StaticCCValueFactory<T> = (self: T) => StaticCCValue;
|
|
170
|
-
export interface CCValues {
|
|
171
|
-
"Alarm Sensor": typeof import("../cc/AlarmSensorCC.js").AlarmSensorCCValues;
|
|
172
|
-
Association: typeof import("../cc/AssociationCC.js").AssociationCCValues;
|
|
173
|
-
"Association Group Information": typeof import("../cc/AssociationGroupInfoCC.js").AssociationGroupInfoCCValues;
|
|
174
|
-
"Barrier Operator": typeof import("../cc/BarrierOperatorCC.js").BarrierOperatorCCValues;
|
|
175
|
-
Basic: typeof import("../cc/BasicCC.js").BasicCCValues;
|
|
176
|
-
Battery: typeof import("../cc/BatteryCC.js").BatteryCCValues;
|
|
177
|
-
"Binary Sensor": typeof import("../cc/BinarySensorCC.js").BinarySensorCCValues;
|
|
178
|
-
"Binary Switch": typeof import("../cc/BinarySwitchCC.js").BinarySwitchCCValues;
|
|
179
|
-
"Central Scene": typeof import("../cc/CentralSceneCC.js").CentralSceneCCValues;
|
|
180
|
-
"Climate Control Schedule": typeof import("../cc/ClimateControlScheduleCC.js").ClimateControlScheduleCCValues;
|
|
181
|
-
"Color Switch": typeof import("../cc/ColorSwitchCC.js").ColorSwitchCCValues;
|
|
182
|
-
Configuration: typeof import("../cc/ConfigurationCC.js").ConfigurationCCValues;
|
|
183
|
-
"Door Lock": typeof import("../cc/DoorLockCC.js").DoorLockCCValues;
|
|
184
|
-
"Door Lock Logging": typeof import("../cc/DoorLockLoggingCC.js").DoorLockLoggingCCValues;
|
|
185
|
-
"Energy Production": typeof import("../cc/EnergyProductionCC.js").EnergyProductionCCValues;
|
|
186
|
-
"Entry Control": typeof import("../cc/EntryControlCC.js").EntryControlCCValues;
|
|
187
|
-
"Firmware Update Meta Data": typeof import("../cc/FirmwareUpdateMetaDataCC.js").FirmwareUpdateMetaDataCCValues;
|
|
188
|
-
"Humidity Control Mode": typeof import("../cc/HumidityControlModeCC.js").HumidityControlModeCCValues;
|
|
189
|
-
"Humidity Control Operating State": typeof import("../cc/HumidityControlOperatingStateCC.js").HumidityControlOperatingStateCCValues;
|
|
190
|
-
"Humidity Control Setpoint": typeof import("../cc/HumidityControlSetpointCC.js").HumidityControlSetpointCCValues;
|
|
191
|
-
Indicator: typeof import("../cc/IndicatorCC.js").IndicatorCCValues;
|
|
192
|
-
Irrigation: typeof import("../cc/IrrigationCC.js").IrrigationCCValues;
|
|
193
|
-
Language: typeof import("../cc/LanguageCC.js").LanguageCCValues;
|
|
194
|
-
Lock: typeof import("../cc/LockCC.js").LockCCValues;
|
|
195
|
-
"Manufacturer Specific": typeof import("../cc/ManufacturerSpecificCC.js").ManufacturerSpecificCCValues;
|
|
196
|
-
Meter: typeof import("../cc/MeterCC.js").MeterCCValues;
|
|
197
|
-
"Multi Channel Association": typeof import("../cc/MultiChannelAssociationCC.js").MultiChannelAssociationCCValues;
|
|
198
|
-
"Multi Channel": typeof import("../cc/MultiChannelCC.js").MultiChannelCCValues;
|
|
199
|
-
"Multilevel Sensor": typeof import("../cc/MultilevelSensorCC.js").MultilevelSensorCCValues;
|
|
200
|
-
"Multilevel Switch": typeof import("../cc/MultilevelSwitchCC.js").MultilevelSwitchCCValues;
|
|
201
|
-
"Node Naming and Location": typeof import("../cc/NodeNamingCC.js").NodeNamingAndLocationCCValues;
|
|
202
|
-
Notification: typeof import("../cc/NotificationCC.js").NotificationCCValues;
|
|
203
|
-
Protection: typeof import("../cc/ProtectionCC.js").ProtectionCCValues;
|
|
204
|
-
"Scene Activation": typeof import("../cc/SceneActivationCC.js").SceneActivationCCValues;
|
|
205
|
-
"Scene Actuator Configuration": typeof import("../cc/SceneActuatorConfigurationCC.js").SceneActuatorConfigurationCCValues;
|
|
206
|
-
"Scene Controller Configuration": typeof import("../cc/SceneControllerConfigurationCC.js").SceneControllerConfigurationCCValues;
|
|
207
|
-
"Schedule Entry Lock": typeof import("../cc/ScheduleEntryLockCC.js").ScheduleEntryLockCCValues;
|
|
208
|
-
"Sound Switch": typeof import("../cc/SoundSwitchCC.js").SoundSwitchCCValues;
|
|
209
|
-
Supervision: typeof import("../cc/SupervisionCC.js").SupervisionCCValues;
|
|
210
|
-
"Thermostat Fan Mode": typeof import("../cc/ThermostatFanModeCC.js").ThermostatFanModeCCValues;
|
|
211
|
-
"Thermostat Fan State": typeof import("../cc/ThermostatFanStateCC.js").ThermostatFanStateCCValues;
|
|
212
|
-
"Thermostat Mode": typeof import("../cc/ThermostatModeCC.js").ThermostatModeCCValues;
|
|
213
|
-
"Thermostat Operating State": typeof import("../cc/ThermostatOperatingStateCC.js").ThermostatOperatingStateCCValues;
|
|
214
|
-
"Thermostat Setpoint": typeof import("../cc/ThermostatSetpointCC.js").ThermostatSetpointCCValues;
|
|
215
|
-
"Time Parameters": typeof import("../cc/TimeParametersCC.js").TimeParametersCCValues;
|
|
216
|
-
"User Code": typeof import("../cc/UserCodeCC.js").UserCodeCCValues;
|
|
217
|
-
Version: typeof import("../cc/VersionCC.js").VersionCCValues;
|
|
218
|
-
"Wake Up": typeof import("../cc/WakeUpCC.js").WakeUpCCValues;
|
|
219
|
-
"Window Covering": typeof import("../cc/WindowCoveringCC.js").WindowCoveringCCValues;
|
|
220
|
-
"Z-Wave Plus Info": typeof import("../cc/ZWavePlusCC.js").ZWavePlusCCValues;
|
|
221
|
-
}
|
|
222
123
|
export {};
|
|
223
124
|
//# sourceMappingURL=Values.d.ts.map
|
package/build/cjs/lib/Values.js
CHANGED
|
@@ -23,8 +23,12 @@ __export(Values_exports, {
|
|
|
23
23
|
defaultCCValueOptions: () => defaultCCValueOptions
|
|
24
24
|
});
|
|
25
25
|
module.exports = __toCommonJS(Values_exports);
|
|
26
|
-
var import_safe = require("@zwave-js/
|
|
27
|
-
var
|
|
26
|
+
var import_safe = require("@zwave-js/shared/safe");
|
|
27
|
+
var import_CCValues_generated = require("../cc/_CCValues.generated.js");
|
|
28
|
+
function defineCCValues(commandClass, _) {
|
|
29
|
+
return import_CCValues_generated.CCValues[commandClass];
|
|
30
|
+
}
|
|
31
|
+
__name(defineCCValues, "defineCCValues");
|
|
28
32
|
const defaultCCValueOptions = {
|
|
29
33
|
internal: false,
|
|
30
34
|
minVersion: 1,
|
|
@@ -33,106 +37,7 @@ const defaultCCValueOptions = {
|
|
|
33
37
|
supportsEndpoints: true,
|
|
34
38
|
autoCreate: true
|
|
35
39
|
};
|
|
36
|
-
function defineStaticCCValue(commandClass, blueprint) {
|
|
37
|
-
const _blueprint = {
|
|
38
|
-
...blueprint,
|
|
39
|
-
options: {
|
|
40
|
-
...defaultCCValueOptions,
|
|
41
|
-
...blueprint.options
|
|
42
|
-
}
|
|
43
|
-
};
|
|
44
|
-
const valueId = {
|
|
45
|
-
commandClass,
|
|
46
|
-
property: _blueprint.property,
|
|
47
|
-
propertyKey: _blueprint.propertyKey
|
|
48
|
-
};
|
|
49
|
-
if (valueId.propertyKey === void 0)
|
|
50
|
-
delete valueId.propertyKey;
|
|
51
|
-
const ret = {
|
|
52
|
-
get id() {
|
|
53
|
-
return { ...valueId };
|
|
54
|
-
},
|
|
55
|
-
endpoint: /* @__PURE__ */ __name((endpoint = 0) => {
|
|
56
|
-
if (!_blueprint.options.supportsEndpoints)
|
|
57
|
-
endpoint = 0;
|
|
58
|
-
return { ...valueId, endpoint };
|
|
59
|
-
}, "endpoint"),
|
|
60
|
-
is: /* @__PURE__ */ __name((testValueId) => {
|
|
61
|
-
return valueId.commandClass === testValueId.commandClass && valueId.property === testValueId.property && valueId.propertyKey === testValueId.propertyKey;
|
|
62
|
-
}, "is"),
|
|
63
|
-
get meta() {
|
|
64
|
-
return { ...import_safe.ValueMetadata.Any, ..._blueprint.meta };
|
|
65
|
-
},
|
|
66
|
-
get options() {
|
|
67
|
-
return { ..._blueprint.options };
|
|
68
|
-
}
|
|
69
|
-
};
|
|
70
|
-
return ret;
|
|
71
|
-
}
|
|
72
|
-
__name(defineStaticCCValue, "defineStaticCCValue");
|
|
73
|
-
function defineDynamicCCValue(commandClass, blueprint) {
|
|
74
|
-
const options = {
|
|
75
|
-
...defaultCCValueOptions,
|
|
76
|
-
...blueprint.options
|
|
77
|
-
};
|
|
78
|
-
const ret = /* @__PURE__ */ __name((...args) => {
|
|
79
|
-
const _blueprint = blueprint(...args);
|
|
80
|
-
const actualBlueprint = {
|
|
81
|
-
..._blueprint
|
|
82
|
-
};
|
|
83
|
-
const valueId = {
|
|
84
|
-
commandClass,
|
|
85
|
-
property: actualBlueprint.property,
|
|
86
|
-
propertyKey: actualBlueprint.propertyKey
|
|
87
|
-
};
|
|
88
|
-
if (valueId.propertyKey === void 0)
|
|
89
|
-
delete valueId.propertyKey;
|
|
90
|
-
const value = {
|
|
91
|
-
get id() {
|
|
92
|
-
return { ...valueId };
|
|
93
|
-
},
|
|
94
|
-
endpoint: /* @__PURE__ */ __name((endpoint = 0) => {
|
|
95
|
-
if (!options.supportsEndpoints)
|
|
96
|
-
endpoint = 0;
|
|
97
|
-
return { ...valueId, endpoint };
|
|
98
|
-
}, "endpoint"),
|
|
99
|
-
get meta() {
|
|
100
|
-
return { ...import_safe.ValueMetadata.Any, ...actualBlueprint.meta };
|
|
101
|
-
}
|
|
102
|
-
};
|
|
103
|
-
return value;
|
|
104
|
-
}, "ret");
|
|
105
|
-
Object.defineProperty(ret, "options", {
|
|
106
|
-
configurable: false,
|
|
107
|
-
enumerable: true,
|
|
108
|
-
get() {
|
|
109
|
-
return { ...options };
|
|
110
|
-
}
|
|
111
|
-
});
|
|
112
|
-
Object.defineProperty(ret, "is", {
|
|
113
|
-
configurable: false,
|
|
114
|
-
enumerable: false,
|
|
115
|
-
writable: false,
|
|
116
|
-
value: /* @__PURE__ */ __name((id) => id.commandClass === commandClass && blueprint.is(id), "value")
|
|
117
|
-
});
|
|
118
|
-
return ret;
|
|
119
|
-
}
|
|
120
|
-
__name(defineDynamicCCValue, "defineDynamicCCValue");
|
|
121
40
|
const V = {
|
|
122
|
-
/** Defines multiple static CC values that belong to the same CC */
|
|
123
|
-
defineStaticCCValues(commandClass, values) {
|
|
124
|
-
return Object.fromEntries(Object.entries(values).map(([key, blueprint]) => [
|
|
125
|
-
key,
|
|
126
|
-
defineStaticCCValue(commandClass, blueprint)
|
|
127
|
-
]));
|
|
128
|
-
},
|
|
129
|
-
/** Defines multiple static CC values that belong to the same CC */
|
|
130
|
-
defineDynamicCCValues(commandClass, values) {
|
|
131
|
-
return Object.fromEntries(Object.entries(values).map(([key, blueprint]) => [
|
|
132
|
-
key,
|
|
133
|
-
defineDynamicCCValue(commandClass, blueprint)
|
|
134
|
-
]));
|
|
135
|
-
},
|
|
136
41
|
/** Returns a CC value definition that is named like the value `property` */
|
|
137
42
|
staticProperty(property, meta, options) {
|
|
138
43
|
return {
|
|
@@ -168,8 +73,8 @@ const V = {
|
|
|
168
73
|
dynamicPropertyWithName(name, property, is, meta, options) {
|
|
169
74
|
return {
|
|
170
75
|
[name]: Object.assign((...args) => ({
|
|
171
|
-
property: (0,
|
|
172
|
-
meta: (0,
|
|
76
|
+
property: (0, import_safe.evalOrStatic)(property, ...args),
|
|
77
|
+
meta: (0, import_safe.evalOrStatic)(meta, ...args)
|
|
173
78
|
}), { is, options })
|
|
174
79
|
};
|
|
175
80
|
},
|
|
@@ -178,13 +83,14 @@ const V = {
|
|
|
178
83
|
return {
|
|
179
84
|
[name]: Object.assign((...args) => {
|
|
180
85
|
return {
|
|
181
|
-
property: (0,
|
|
182
|
-
propertyKey: (0,
|
|
183
|
-
meta: (0,
|
|
86
|
+
property: (0, import_safe.evalOrStatic)(property, ...args),
|
|
87
|
+
propertyKey: (0, import_safe.evalOrStatic)(propertyKey, ...args),
|
|
88
|
+
meta: (0, import_safe.evalOrStatic)(meta, ...args)
|
|
184
89
|
};
|
|
185
90
|
}, { is, options })
|
|
186
91
|
};
|
|
187
|
-
}
|
|
92
|
+
},
|
|
93
|
+
defineCCValues
|
|
188
94
|
};
|
|
189
95
|
// Annotate the CommonJS export names for ESM import in node:
|
|
190
96
|
0 && (module.exports = {
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../src/lib/Values.ts"],
|
|
4
|
-
"sourcesContent": ["import { type GetDeviceConfig } from \"@zwave-js/config\";\nimport {\n\ttype CommandClasses,\n\ttype EndpointId,\n\ttype GetValueDB,\n\ttype ValueID,\n\tValueMetadata,\n} from \"@zwave-js/core/safe\";\nimport {\n\ttype FnOrStatic,\n\ttype ReturnTypeOrStatic,\n\tevalOrStatic,\n} from \"@zwave-js/shared/safe\";\nimport type { Overwrite } from \"alcalzone-shared/types\";\nimport type { ValueIDProperties } from \"./API.js\";\n\n// HINT: To fully view types for definitions created by this, open\n// node_modules/typescript/lib/tsserver.js and change the definition of\n// ts.defaultMaximumTruncationLength = 160\n// to something higher like\n// ts.defaultMaximumTruncationLength = 1000\n// Then restart TS Server\n\nexport interface CCValueOptions {\n\t/**\n\t * Whether the CC value is internal. Internal values are not exposed to the user.\n\t */\n\tinternal?: boolean;\n\t/**\n\t * The minimum CC version required for this value to exist.\n\t */\n\tminVersion?: number;\n\t/**\n\t * Whether this value represents a state (`true`) or a notification/event (`false`). Default: `true`\n\t */\n\tstateful?: boolean;\n\t/**\n\t * Omit this value from value logs. Default: `false`\n\t */\n\tsecret?: boolean;\n\n\t/** Whether the CC value may exist on endpoints. Default: `true` */\n\tsupportsEndpoints?: boolean;\n\n\t/**\n\t * Can be used to dynamically decide if this value should be created automatically.\n\t * This is ignored for dynamic values and defaults to `true` if not given.\n\t */\n\tautoCreate?:\n\t\t| boolean\n\t\t| ((\n\t\t\tctx: GetValueDB & GetDeviceConfig,\n\t\t\tendpoint: EndpointId,\n\t\t) => boolean);\n}\n\nexport const defaultCCValueOptions = {\n\tinternal: false,\n\tminVersion: 1,\n\tsecret: false,\n\tstateful: true,\n\tsupportsEndpoints: true,\n\tautoCreate: true,\n} as const;\n\ntype DefaultOptions = typeof defaultCCValueOptions;\n\n// expands object types recursively\nexport type ExpandRecursively<T> =\n\t// Split functions with properties into the function and object parts\n\tT extends (...args: infer A) => infer R\n\t\t? [keyof T] extends [never] ? (...args: A) => ExpandRecursively<R>\n\t\t:\n\t\t\t& ((...args: A) => ExpandRecursively<R>)\n\t\t\t& {\n\t\t\t\t[P in keyof T]: ExpandRecursively<T[P]>;\n\t\t\t}\n\t\t// Expand object types\n\t\t: T extends object\n\t\t\t? T extends infer O ? { [K in keyof O]: ExpandRecursively<O[K]> }\n\t\t\t: never\n\t\t// Fallback to the type itself if no match\n\t\t: T;\n\nexport type ExpandRecursivelySkipMeta<T> =\n\t// Split functions with properties into the function and object parts\n\tT extends (...args: infer A) => infer R\n\t\t? [keyof T] extends [never]\n\t\t\t? (...args: A) => ExpandRecursivelySkipMeta<R>\n\t\t:\n\t\t\t& ((...args: A) => ExpandRecursivelySkipMeta<R>)\n\t\t\t& {\n\t\t\t\t[P in keyof T]: ExpandRecursivelySkipMeta<T[P]>;\n\t\t\t}\n\t\t// Ignore the ValueMetadata type\n\t\t: T extends ValueMetadata ? T\n\t\t// Expand object types\n\t\t: T extends object\n\t\t\t? T extends infer O\n\t\t\t\t? { [K in keyof O]: ExpandRecursivelySkipMeta<O[K]> }\n\t\t\t: never\n\t\t// Fallback to the type itself if no match\n\t\t: T;\n\ntype InferValueIDBase<\n\tTCommandClass extends CommandClasses,\n\tTBlueprint extends CCValueBlueprint,\n\tTWorker = {\n\t\tcommandClass: TCommandClass;\n\t} & Pick<TBlueprint, \"property\" | \"propertyKey\">,\n> = {\n\t[K in keyof TWorker as unknown extends TWorker[K] ? never : K]: TWorker[K];\n};\n\ntype ToStaticCCValues<\n\tTCommandClass extends CommandClasses,\n\tTValues extends Record<keyof TValues, CCValueBlueprint>,\n> = Readonly<\n\t{\n\t\t[K in keyof TValues]: ExpandRecursively<\n\t\t\tInferStaticCCValue<TCommandClass, TValues[K]>\n\t\t>;\n\t}\n>;\n\ntype ToDynamicCCValues<\n\tTCommandClass extends CommandClasses,\n\tTValues extends Record<keyof TValues, DynamicCCValueBlueprint<any>>,\n> = Readonly<\n\t{\n\t\t[K in keyof TValues]: ExpandRecursively<\n\t\t\tInferDynamicCCValue<TCommandClass, TValues[K]>\n\t\t>;\n\t}\n>;\n\ntype InferArgs<T extends FnOrStatic<any, any>[]> = T extends [\n\t(...args: infer A) => any,\n\t...any,\n] ? A\n\t: T extends [any, ...infer R] ? InferArgs<R>\n\t: [];\n\n/** Defines a single static CC values that belong to a CC */\nfunction defineStaticCCValue<\n\tTCommandClass extends CommandClasses,\n\tTBlueprint extends CCValueBlueprint,\n>(\n\tcommandClass: TCommandClass,\n\tblueprint: TBlueprint,\n): ExpandRecursively<InferStaticCCValue<TCommandClass, TBlueprint>> {\n\t// Normalize value options\n\tconst _blueprint = {\n\t\t...blueprint,\n\t\toptions: {\n\t\t\t...defaultCCValueOptions,\n\t\t\t...blueprint.options,\n\t\t},\n\t};\n\n\tconst valueId = {\n\t\tcommandClass,\n\t\tproperty: _blueprint.property,\n\t\tpropertyKey: _blueprint.propertyKey,\n\t};\n\tif (valueId.propertyKey === undefined) delete valueId.propertyKey;\n\n\tconst ret: InferStaticCCValue<TCommandClass, TBlueprint> = {\n\t\tget id() {\n\t\t\treturn { ...valueId };\n\t\t},\n\t\tendpoint: (endpoint: number = 0) => {\n\t\t\tif (!_blueprint.options.supportsEndpoints) endpoint = 0;\n\t\t\treturn { ...valueId, endpoint } as any;\n\t\t},\n\t\tis: (testValueId) => {\n\t\t\treturn (\n\t\t\t\tvalueId.commandClass === testValueId.commandClass\n\t\t\t\t&& valueId.property === testValueId.property\n\t\t\t\t&& valueId.propertyKey === testValueId.propertyKey\n\t\t\t);\n\t\t},\n\t\tget meta() {\n\t\t\treturn { ...ValueMetadata.Any, ..._blueprint.meta } as any;\n\t\t},\n\t\tget options() {\n\t\t\treturn { ..._blueprint.options } as any;\n\t\t},\n\t};\n\n\treturn ret as any;\n}\n\n/** Defines a single CC value which depends on one or more parameters */\nfunction defineDynamicCCValue<\n\tTCommandClass extends CommandClasses,\n\tTBlueprint extends DynamicCCValueBlueprint<any[]>,\n>(\n\tcommandClass: TCommandClass,\n\tblueprint: TBlueprint,\n): ExpandRecursively<InferDynamicCCValue<TCommandClass, TBlueprint>> {\n\tconst options = {\n\t\t...defaultCCValueOptions,\n\t\t...blueprint.options,\n\t};\n\n\tconst ret: ExpandRecursively<\n\t\tInferDynamicCCValue<TCommandClass, TBlueprint>\n\t> = ((...args: Parameters<TBlueprint>) => {\n\t\tconst _blueprint = blueprint(...args);\n\n\t\t// Normalize value options\n\t\tconst actualBlueprint = {\n\t\t\t..._blueprint,\n\t\t};\n\n\t\tconst valueId = {\n\t\t\tcommandClass,\n\t\t\tproperty: actualBlueprint.property,\n\t\t\tpropertyKey: actualBlueprint.propertyKey,\n\t\t};\n\t\tif (valueId.propertyKey === undefined) delete valueId.propertyKey;\n\n\t\tconst value: Omit<\n\t\t\tInferStaticCCValue<TCommandClass, ReturnType<TBlueprint>>,\n\t\t\t\"options\" | \"is\"\n\t\t> = {\n\t\t\tget id() {\n\t\t\t\treturn { ...valueId };\n\t\t\t},\n\t\t\tendpoint: (endpoint: number = 0) => {\n\t\t\t\tif (!options.supportsEndpoints) endpoint = 0;\n\t\t\t\treturn { ...valueId, endpoint } as any;\n\t\t\t},\n\t\t\tget meta() {\n\t\t\t\treturn { ...ValueMetadata.Any, ...actualBlueprint.meta } as any;\n\t\t\t},\n\t\t};\n\n\t\treturn value;\n\t}) as any;\n\n\tObject.defineProperty(ret, \"options\", {\n\t\tconfigurable: false,\n\t\tenumerable: true,\n\t\tget() {\n\t\t\treturn { ...options };\n\t\t},\n\t});\n\n\tObject.defineProperty(ret, \"is\", {\n\t\tconfigurable: false,\n\t\tenumerable: false,\n\t\twritable: false,\n\t\tvalue: (id: ValueID) =>\n\t\t\tid.commandClass === commandClass && blueprint.is(id),\n\t});\n\n\treturn ret;\n}\n\n// Namespace for utilities to define CC values\nexport const V = {\n\t/** Defines multiple static CC values that belong to the same CC */\n\tdefineStaticCCValues<\n\t\tTCommandClass extends CommandClasses,\n\t\tTValues extends Record<keyof TValues, CCValueBlueprint>,\n\t>(\n\t\tcommandClass: TCommandClass,\n\t\tvalues: TValues,\n\t): TValues extends Record<keyof TValues, CCValueBlueprint>\n\t\t? ExpandRecursively<ToStaticCCValues<TCommandClass, TValues>>\n\t\t: never\n\t{\n\t\treturn Object.fromEntries(\n\t\t\tObject.entries<CCValueBlueprint>(values).map(([key, blueprint]) => [\n\t\t\t\tkey,\n\t\t\t\tdefineStaticCCValue(commandClass, blueprint),\n\t\t\t]),\n\t\t) as any;\n\t},\n\n\t/** Defines multiple static CC values that belong to the same CC */\n\tdefineDynamicCCValues<\n\t\tTCommandClass extends CommandClasses,\n\t\tTValues extends Record<keyof TValues, DynamicCCValueBlueprint<any>>,\n\t>(\n\t\tcommandClass: TCommandClass,\n\t\tvalues: TValues,\n\t): TValues extends Record<keyof TValues, DynamicCCValueBlueprint<any>>\n\t\t? ExpandRecursively<ToDynamicCCValues<TCommandClass, TValues>>\n\t\t: never\n\t{\n\t\treturn Object.fromEntries(\n\t\t\tObject.entries<DynamicCCValueBlueprint<any>>(values).map(\n\t\t\t\t([key, blueprint]) => [\n\t\t\t\t\tkey,\n\t\t\t\t\tdefineDynamicCCValue(commandClass, blueprint),\n\t\t\t\t],\n\t\t\t),\n\t\t) as any;\n\t},\n\n\t/** Returns a CC value definition that is named like the value `property` */\n\tstaticProperty<\n\t\tTProp extends string | number,\n\t\tTMeta extends ValueMetadata,\n\t\tTOptions extends CCValueOptions,\n\t>(\n\t\tproperty: TProp,\n\t\tmeta?: TMeta,\n\t\toptions?: TOptions,\n\t): {\n\t\t[K in TProp]: {\n\t\t\tproperty: TProp;\n\t\t\tmeta: TMeta;\n\t\t\toptions: TOptions;\n\t\t};\n\t} {\n\t\treturn {\n\t\t\t[property]: {\n\t\t\t\tproperty,\n\t\t\t\tmeta,\n\t\t\t\toptions,\n\t\t\t},\n\t\t} as any;\n\t},\n\n\t/** Returns a CC value definition with the given name and `property` */\n\tstaticPropertyWithName<\n\t\tTName extends string,\n\t\tTProp extends string | number,\n\t\tTMeta extends ValueMetadata,\n\t\tTOptions extends CCValueOptions,\n\t>(\n\t\tname: TName,\n\t\tproperty: TProp,\n\t\tmeta?: TMeta,\n\t\toptions?: TOptions,\n\t): {\n\t\t[K in TName]: {\n\t\t\tproperty: TProp;\n\t\t\tmeta: TMeta;\n\t\t\toptions: TOptions;\n\t\t};\n\t} {\n\t\treturn {\n\t\t\t[name]: {\n\t\t\t\tproperty,\n\t\t\t\tmeta,\n\t\t\t\toptions,\n\t\t\t},\n\t\t} as any;\n\t},\n\n\t/** Returns a CC value definition with the given name, `property` and `propertyKey` */\n\tstaticPropertyAndKeyWithName<\n\t\tTName extends string,\n\t\tTProp extends string | number,\n\t\tTKey extends string | number,\n\t\tTMeta extends ValueMetadata,\n\t\tTOptions extends CCValueOptions,\n\t>(\n\t\tname: TName,\n\t\tproperty: TProp,\n\t\tpropertyKey: TKey,\n\t\tmeta?: TMeta,\n\t\toptions?: TOptions,\n\t): {\n\t\t[K in TName]: {\n\t\t\tproperty: TProp;\n\t\t\tpropertyKey: TKey;\n\t\t\tmeta: TMeta;\n\t\t\toptions: TOptions;\n\t\t};\n\t} {\n\t\treturn {\n\t\t\t[name]: {\n\t\t\t\tproperty,\n\t\t\t\tpropertyKey,\n\t\t\t\tmeta,\n\t\t\t\toptions,\n\t\t\t},\n\t\t} as any;\n\t},\n\n\t/** Returns a CC value definition with the given name and a dynamic `property` */\n\tdynamicPropertyWithName<\n\t\tTName extends string,\n\t\tTProp extends FnOrStatic<any[], ValueIDProperties[\"property\"]>,\n\t\tTMeta extends FnOrStatic<any[], ValueMetadata> = ValueMetadata,\n\t\tTOptions extends CCValueOptions = CCValueOptions,\n\t>(\n\t\tname: TName,\n\t\tproperty: TProp,\n\t\tis: PartialCCValuePredicate,\n\t\tmeta?: TMeta,\n\t\toptions?: TOptions,\n\t): {\n\t\t[K in TName]: {\n\t\t\t(...args: InferArgs<[TProp, TMeta]>): {\n\t\t\t\tproperty: ReturnTypeOrStatic<TProp>;\n\t\t\t\tmeta: ReturnTypeOrStatic<TMeta>;\n\t\t\t};\n\t\t\tis: PartialCCValuePredicate;\n\t\t\toptions: TOptions;\n\t\t};\n\t} {\n\t\treturn {\n\t\t\t[name]: Object.assign(\n\t\t\t\t(...args: InferArgs<[TProp, TMeta]>) => ({\n\t\t\t\t\tproperty: evalOrStatic(property, ...args),\n\t\t\t\t\tmeta: evalOrStatic(meta, ...args),\n\t\t\t\t}),\n\t\t\t\t{ is, options },\n\t\t\t),\n\t\t} as any;\n\t},\n\n\t/** Returns a CC value definition with the given name and a dynamic `property` */\n\tdynamicPropertyAndKeyWithName<\n\t\tTName extends string,\n\t\tTProp extends FnOrStatic<any[], ValueIDProperties[\"property\"]>,\n\t\tTKey extends FnOrStatic<any[], ValueIDProperties[\"propertyKey\"]>,\n\t\tTMeta extends FnOrStatic<any[], ValueMetadata> = ValueMetadata,\n\t\tTOptions extends FnOrStatic<any[], CCValueOptions> = CCValueOptions,\n\t>(\n\t\tname: TName,\n\t\tproperty: TProp,\n\t\tpropertyKey: TKey,\n\t\tis: PartialCCValuePredicate,\n\t\tmeta?: TMeta,\n\t\toptions?: TOptions,\n\t): {\n\t\t[K in TName]: {\n\t\t\t(...args: InferArgs<[TProp, TKey, TMeta]>): {\n\t\t\t\tproperty: ReturnTypeOrStatic<TProp>;\n\t\t\t\tpropertyKey: ReturnTypeOrStatic<TKey>;\n\t\t\t\tmeta: ReturnTypeOrStatic<TMeta>;\n\t\t\t};\n\t\t\tis: PartialCCValuePredicate;\n\t\t\toptions: TOptions;\n\t\t};\n\t} {\n\t\treturn {\n\t\t\t[name]: Object.assign(\n\t\t\t\t(...args: any[]) => {\n\t\t\t\t\treturn {\n\t\t\t\t\t\tproperty: evalOrStatic(property, ...args),\n\t\t\t\t\t\tpropertyKey: evalOrStatic(propertyKey, ...args),\n\t\t\t\t\t\tmeta: evalOrStatic(meta, ...args),\n\t\t\t\t\t};\n\t\t\t\t},\n\t\t\t\t{ is, options },\n\t\t\t),\n\t\t} as any;\n\t},\n};\n\nexport interface CCValueBlueprint extends Readonly<ValueIDProperties> {\n\treadonly meta?: Readonly<ValueMetadata>;\n\treadonly options?: Readonly<CCValueOptions>;\n}\n\nexport type CCValuePredicate = (valueId: ValueID) => boolean;\nexport type PartialCCValuePredicate = (\n\tproperties: ValueIDProperties,\n) => boolean;\n\n/** A blueprint for a CC value which depends on one or more parameters */\nexport interface DynamicCCValueBlueprint<TArgs extends any[]> {\n\t(...args: TArgs): Omit<CCValueBlueprint, \"options\">;\n\tis: PartialCCValuePredicate;\n\treadonly options?: Readonly<CCValueOptions>;\n}\n\ntype DropOptional<T> = {\n\t[K in keyof T as [undefined] extends [T[K]] ? never : K]: T[K];\n};\n\ntype MergeOptions<TOptions extends CCValueOptions> = DropOptional<\n\tCCValueOptions extends TOptions\n\t\t// When the type cannot be inferred exactly (not given), default to DefaultOptions\n\t\t? DefaultOptions\n\t\t: Overwrite<DefaultOptions, TOptions>\n>;\n\ntype MergeMeta<TMeta extends ValueMetadata> = DropOptional<\n\tValueMetadata extends TMeta\n\t\t// When the type cannot be inferred exactly (not given), default to ValueMetadata.Any\n\t\t? (typeof ValueMetadata)[\"Any\"]\n\t\t: Overwrite<(typeof ValueMetadata)[\"Any\"], TMeta>\n>;\n\n/** The common base type of all CC value definitions */\nexport interface CCValue {\n\treadonly id: Omit<ValueID, \"endpoint\">;\n\tendpoint(endpoint?: number): ValueID;\n\treadonly meta: ValueMetadata;\n}\n\ntype AddCCValueProperties<\n\tTCommandClass extends CommandClasses,\n\tTBlueprint extends CCValueBlueprint,\n\tValueIDBase extends Record<string, any> = InferValueIDBase<\n\t\tTCommandClass,\n\t\tTBlueprint\n\t>,\n> = {\n\t/** Returns the value ID of this CC value, without endpoint information */\n\tget id(): ValueIDBase;\n\n\t/** Returns the value ID, specialized to the given endpoint */\n\tendpoint(\n\t\tendpoint?: number,\n\t): Readonly<\n\t\t& Pick<ValueIDBase, \"commandClass\">\n\t\t& { endpoint: number }\n\t\t& Omit<\n\t\t\tValueIDBase,\n\t\t\t\"commandClass\"\n\t\t>\n\t>;\n\n\t/** Whether the given value ID matches this value definition */\n\tis: CCValuePredicate;\n\n\t/** Returns the metadata for this value ID */\n\tget meta(): Readonly<MergeMeta<NonNullable<TBlueprint[\"meta\"]>>>;\n\t/** Returns the value options for this value ID */\n\tget options(): Readonly<MergeOptions<NonNullable<TBlueprint[\"options\"]>>>;\n};\n\n/** A CC value definition which depends on one or more parameters, transparently inferred from its arguments */\nexport type InferDynamicCCValue<\n\tTCommandClass extends CommandClasses,\n\tTBlueprint extends DynamicCCValueBlueprint<any[]>,\n> = TBlueprint extends DynamicCCValueBlueprint<infer TArgs> ? {\n\t\t(...args: TArgs): Omit<\n\t\t\tInferStaticCCValue<TCommandClass, ReturnType<TBlueprint>>,\n\t\t\t\"options\" | \"is\"\n\t\t>;\n\n\t\t/** Whether the given value ID matches this value definition */\n\t\tis: CCValuePredicate;\n\n\t\treadonly options: InferStaticCCValue<\n\t\t\tTCommandClass,\n\t\t\tReturnType<TBlueprint> & { options: TBlueprint[\"options\"] }\n\t\t>[\"options\"];\n\t}\n\t: never;\n\n/** A static or evaluated CC value definition, transparently inferred from its arguments */\nexport type InferStaticCCValue<\n\tTCommandClass extends CommandClasses,\n\tTBlueprint extends CCValueBlueprint,\n> = Readonly<AddCCValueProperties<TCommandClass, TBlueprint>>;\n\n/** The generic variant of {@link InferStaticCCValue}, without inferring arguments */\nexport interface StaticCCValue extends CCValue {\n\t/** Whether the given value ID matches this value definition */\n\tis: CCValuePredicate;\n\treadonly options: Required<CCValueOptions>;\n}\n\n/** The generic variant of {@link InferDynamicCCValue}, without inferring arguments */\nexport type DynamicCCValue<TArgs extends any[] = any[]> =\n\t& ExpandRecursivelySkipMeta<(...args: TArgs) => CCValue>\n\t& {\n\t\t/** Whether the given value ID matches this value definition */\n\t\tis: CCValuePredicate;\n\t\treadonly options: Required<CCValueOptions>;\n\t};\n\nexport type StaticCCValueFactory<T> = (self: T) => StaticCCValue;\n\n// This interface is auto-generated by maintenance/generateCCValuesInterface.ts\n// Do not edit it by hand or your changes will be lost\nexport interface CCValues {\n\t// AUTO GENERATION BELOW\n\t\"Alarm Sensor\": typeof import(\"../cc/AlarmSensorCC.js\").AlarmSensorCCValues;\n\tAssociation: typeof import(\"../cc/AssociationCC.js\").AssociationCCValues;\n\t\"Association Group Information\":\n\t\ttypeof import(\"../cc/AssociationGroupInfoCC.js\").AssociationGroupInfoCCValues;\n\t\"Barrier Operator\":\n\t\ttypeof import(\"../cc/BarrierOperatorCC.js\").BarrierOperatorCCValues;\n\tBasic: typeof import(\"../cc/BasicCC.js\").BasicCCValues;\n\tBattery: typeof import(\"../cc/BatteryCC.js\").BatteryCCValues;\n\t\"Binary Sensor\":\n\t\ttypeof import(\"../cc/BinarySensorCC.js\").BinarySensorCCValues;\n\t\"Binary Switch\":\n\t\ttypeof import(\"../cc/BinarySwitchCC.js\").BinarySwitchCCValues;\n\t\"Central Scene\":\n\t\ttypeof import(\"../cc/CentralSceneCC.js\").CentralSceneCCValues;\n\t\"Climate Control Schedule\":\n\t\ttypeof import(\"../cc/ClimateControlScheduleCC.js\").ClimateControlScheduleCCValues;\n\t\"Color Switch\": typeof import(\"../cc/ColorSwitchCC.js\").ColorSwitchCCValues;\n\tConfiguration:\n\t\ttypeof import(\"../cc/ConfigurationCC.js\").ConfigurationCCValues;\n\t\"Door Lock\": typeof import(\"../cc/DoorLockCC.js\").DoorLockCCValues;\n\t\"Door Lock Logging\":\n\t\ttypeof import(\"../cc/DoorLockLoggingCC.js\").DoorLockLoggingCCValues;\n\t\"Energy Production\":\n\t\ttypeof import(\"../cc/EnergyProductionCC.js\").EnergyProductionCCValues;\n\t\"Entry Control\":\n\t\ttypeof import(\"../cc/EntryControlCC.js\").EntryControlCCValues;\n\t\"Firmware Update Meta Data\":\n\t\ttypeof import(\"../cc/FirmwareUpdateMetaDataCC.js\").FirmwareUpdateMetaDataCCValues;\n\t\"Humidity Control Mode\":\n\t\ttypeof import(\"../cc/HumidityControlModeCC.js\").HumidityControlModeCCValues;\n\t\"Humidity Control Operating State\":\n\t\ttypeof import(\"../cc/HumidityControlOperatingStateCC.js\").HumidityControlOperatingStateCCValues;\n\t\"Humidity Control Setpoint\":\n\t\ttypeof import(\"../cc/HumidityControlSetpointCC.js\").HumidityControlSetpointCCValues;\n\tIndicator: typeof import(\"../cc/IndicatorCC.js\").IndicatorCCValues;\n\tIrrigation: typeof import(\"../cc/IrrigationCC.js\").IrrigationCCValues;\n\tLanguage: typeof import(\"../cc/LanguageCC.js\").LanguageCCValues;\n\tLock: typeof import(\"../cc/LockCC.js\").LockCCValues;\n\t\"Manufacturer Specific\":\n\t\ttypeof import(\"../cc/ManufacturerSpecificCC.js\").ManufacturerSpecificCCValues;\n\tMeter: typeof import(\"../cc/MeterCC.js\").MeterCCValues;\n\t\"Multi Channel Association\":\n\t\ttypeof import(\"../cc/MultiChannelAssociationCC.js\").MultiChannelAssociationCCValues;\n\t\"Multi Channel\":\n\t\ttypeof import(\"../cc/MultiChannelCC.js\").MultiChannelCCValues;\n\t\"Multilevel Sensor\":\n\t\ttypeof import(\"../cc/MultilevelSensorCC.js\").MultilevelSensorCCValues;\n\t\"Multilevel Switch\":\n\t\ttypeof import(\"../cc/MultilevelSwitchCC.js\").MultilevelSwitchCCValues;\n\t\"Node Naming and Location\":\n\t\ttypeof import(\"../cc/NodeNamingCC.js\").NodeNamingAndLocationCCValues;\n\tNotification: typeof import(\"../cc/NotificationCC.js\").NotificationCCValues;\n\tProtection: typeof import(\"../cc/ProtectionCC.js\").ProtectionCCValues;\n\t\"Scene Activation\":\n\t\ttypeof import(\"../cc/SceneActivationCC.js\").SceneActivationCCValues;\n\t\"Scene Actuator Configuration\":\n\t\ttypeof import(\"../cc/SceneActuatorConfigurationCC.js\").SceneActuatorConfigurationCCValues;\n\t\"Scene Controller Configuration\":\n\t\ttypeof import(\"../cc/SceneControllerConfigurationCC.js\").SceneControllerConfigurationCCValues;\n\t\"Schedule Entry Lock\":\n\t\ttypeof import(\"../cc/ScheduleEntryLockCC.js\").ScheduleEntryLockCCValues;\n\t\"Sound Switch\": typeof import(\"../cc/SoundSwitchCC.js\").SoundSwitchCCValues;\n\tSupervision: typeof import(\"../cc/SupervisionCC.js\").SupervisionCCValues;\n\t\"Thermostat Fan Mode\":\n\t\ttypeof import(\"../cc/ThermostatFanModeCC.js\").ThermostatFanModeCCValues;\n\t\"Thermostat Fan State\":\n\t\ttypeof import(\"../cc/ThermostatFanStateCC.js\").ThermostatFanStateCCValues;\n\t\"Thermostat Mode\":\n\t\ttypeof import(\"../cc/ThermostatModeCC.js\").ThermostatModeCCValues;\n\t\"Thermostat Operating State\":\n\t\ttypeof import(\"../cc/ThermostatOperatingStateCC.js\").ThermostatOperatingStateCCValues;\n\t\"Thermostat Setpoint\":\n\t\ttypeof import(\"../cc/ThermostatSetpointCC.js\").ThermostatSetpointCCValues;\n\t\"Time Parameters\":\n\t\ttypeof import(\"../cc/TimeParametersCC.js\").TimeParametersCCValues;\n\t\"User Code\": typeof import(\"../cc/UserCodeCC.js\").UserCodeCCValues;\n\tVersion: typeof import(\"../cc/VersionCC.js\").VersionCCValues;\n\t\"Wake Up\": typeof import(\"../cc/WakeUpCC.js\").WakeUpCCValues;\n\t\"Window Covering\":\n\t\ttypeof import(\"../cc/WindowCoveringCC.js\").WindowCoveringCCValues;\n\t\"Z-Wave Plus Info\": typeof import(\"../cc/ZWavePlusCC.js\").ZWavePlusCCValues;\n}\n"],
|
|
5
|
-
"mappings": ";;;;;;;;;;;;;;;;;;;
|
|
6
|
-
"names": [
|
|
4
|
+
"sourcesContent": ["import { type GetDeviceConfig } from \"@zwave-js/config\";\nimport {\n\ttype CommandClasses,\n\ttype EndpointId,\n\ttype GetValueDB,\n\ttype ValueID,\n\ttype ValueMetadata,\n} from \"@zwave-js/core/safe\";\nimport {\n\ttype FnOrStatic,\n\ttype ReturnTypeOrStatic,\n\tevalOrStatic,\n} from \"@zwave-js/shared/safe\";\nimport type { ValueIDProperties } from \"./API.js\";\n\nimport { CCValues } from \"../cc/_CCValues.generated.js\";\n\nfunction defineCCValues<T extends CommandClasses>(\n\tcommandClass: T,\n\t_: Record<string, CCValueBlueprint | DynamicCCValueBlueprint<any[]>>,\n\t// eslint-disable-next-line @typescript-eslint/ban-ts-comment\n\t// @ts-ignore I know what I'm doing!\n): typeof import(\"../cc/_CCValues.generated.js\").CCValues[T] {\n\t// eslint-disable-next-line @typescript-eslint/ban-ts-comment\n\t// @ts-ignore I know what I'm doing!\n\treturn CCValues[commandClass];\n}\n\n// HINT: To fully view types for definitions created by this, open\n// node_modules/typescript/lib/tsserver.js and change the definition of\n// ts.defaultMaximumTruncationLength = 160\n// to something higher like\n// ts.defaultMaximumTruncationLength = 1000\n// Then restart TS Server\n\nexport interface CCValueOptions {\n\t/**\n\t * Whether the CC value is internal. Internal values are not exposed to the user.\n\t */\n\tinternal?: boolean;\n\t/**\n\t * The minimum CC version required for this value to exist.\n\t */\n\tminVersion?: number;\n\t/**\n\t * Whether this value represents a state (`true`) or a notification/event (`false`). Default: `true`\n\t */\n\tstateful?: boolean;\n\t/**\n\t * Omit this value from value logs. Default: `false`\n\t */\n\tsecret?: boolean;\n\n\t/** Whether the CC value may exist on endpoints. Default: `true` */\n\tsupportsEndpoints?: boolean;\n\n\t/**\n\t * Can be used to dynamically decide if this value should be created automatically.\n\t * This is ignored for dynamic values and defaults to `true` if not given.\n\t */\n\tautoCreate?:\n\t\t| boolean\n\t\t| ((\n\t\t\tctx: GetValueDB & GetDeviceConfig,\n\t\t\tendpoint: EndpointId,\n\t\t) => boolean);\n}\n\nexport const defaultCCValueOptions = {\n\tinternal: false,\n\tminVersion: 1,\n\tsecret: false,\n\tstateful: true,\n\tsupportsEndpoints: true,\n\tautoCreate: true,\n} as const;\n\n// expands object types recursively\nexport type ExpandRecursively<T> =\n\t// Split functions with properties into the function and object parts\n\tT extends (...args: infer A) => infer R\n\t\t? [keyof T] extends [never] ? (...args: A) => ExpandRecursively<R>\n\t\t:\n\t\t\t& ((...args: A) => ExpandRecursively<R>)\n\t\t\t& {\n\t\t\t\t[P in keyof T]: ExpandRecursively<T[P]>;\n\t\t\t}\n\t\t// Expand object types\n\t\t: T extends object\n\t\t\t? T extends infer O ? { [K in keyof O]: ExpandRecursively<O[K]> }\n\t\t\t: never\n\t\t// Fallback to the type itself if no match\n\t\t: T;\n\nexport type ExpandRecursivelySkipMeta<T> =\n\t// Split functions with properties into the function and object parts\n\tT extends (...args: infer A) => infer R\n\t\t? [keyof T] extends [never]\n\t\t\t? (...args: A) => ExpandRecursivelySkipMeta<R>\n\t\t:\n\t\t\t& ((...args: A) => ExpandRecursivelySkipMeta<R>)\n\t\t\t& {\n\t\t\t\t[P in keyof T]: ExpandRecursivelySkipMeta<T[P]>;\n\t\t\t}\n\t\t// Ignore the ValueMetadata type\n\t\t: T extends ValueMetadata ? T\n\t\t// Expand object types\n\t\t: T extends object\n\t\t\t? T extends infer O\n\t\t\t\t? { [K in keyof O]: ExpandRecursivelySkipMeta<O[K]> }\n\t\t\t: never\n\t\t// Fallback to the type itself if no match\n\t\t: T;\n\ntype InferArgs<T extends FnOrStatic<any, any>[]> = T extends [\n\t(...args: infer A) => any,\n\t...any,\n] ? A\n\t: T extends [any, ...infer R] ? InferArgs<R>\n\t: [];\n\n// Namespace for utilities to define CC values\nexport const V = {\n\t/** Returns a CC value definition that is named like the value `property` */\n\tstaticProperty<\n\t\tTProp extends string | number,\n\t\tconst TMeta extends ValueMetadata,\n\t\tconst TOptions extends CCValueOptions,\n\t>(\n\t\tproperty: TProp,\n\t\tmeta?: TMeta,\n\t\toptions?: TOptions,\n\t): {\n\t\t[K in TProp]: {\n\t\t\tproperty: TProp;\n\t\t\tmeta: TMeta;\n\t\t\toptions: TOptions;\n\t\t};\n\t} {\n\t\treturn {\n\t\t\t[property]: {\n\t\t\t\tproperty,\n\t\t\t\tmeta,\n\t\t\t\toptions,\n\t\t\t},\n\t\t} as any;\n\t},\n\n\t/** Returns a CC value definition with the given name and `property` */\n\tstaticPropertyWithName<\n\t\tTName extends string,\n\t\tTProp extends string | number,\n\t\tconst TMeta extends ValueMetadata,\n\t\tconst TOptions extends CCValueOptions,\n\t>(\n\t\tname: TName,\n\t\tproperty: TProp,\n\t\tmeta?: TMeta,\n\t\toptions?: TOptions,\n\t): {\n\t\t[K in TName]: {\n\t\t\tproperty: TProp;\n\t\t\tmeta: TMeta;\n\t\t\toptions: TOptions;\n\t\t};\n\t} {\n\t\treturn {\n\t\t\t[name]: {\n\t\t\t\tproperty,\n\t\t\t\tmeta,\n\t\t\t\toptions,\n\t\t\t},\n\t\t} as any;\n\t},\n\n\t/** Returns a CC value definition with the given name, `property` and `propertyKey` */\n\tstaticPropertyAndKeyWithName<\n\t\tTName extends string,\n\t\tTProp extends string | number,\n\t\tTKey extends string | number,\n\t\tTMeta extends ValueMetadata,\n\t\tTOptions extends CCValueOptions,\n\t>(\n\t\tname: TName,\n\t\tproperty: TProp,\n\t\tpropertyKey: TKey,\n\t\tmeta?: TMeta,\n\t\toptions?: TOptions,\n\t): {\n\t\t[K in TName]: {\n\t\t\tproperty: TProp;\n\t\t\tpropertyKey: TKey;\n\t\t\tmeta: TMeta;\n\t\t\toptions: TOptions;\n\t\t};\n\t} {\n\t\treturn {\n\t\t\t[name]: {\n\t\t\t\tproperty,\n\t\t\t\tpropertyKey,\n\t\t\t\tmeta,\n\t\t\t\toptions,\n\t\t\t},\n\t\t} as any;\n\t},\n\n\t/** Returns a CC value definition with the given name and a dynamic `property` */\n\tdynamicPropertyWithName<\n\t\tTName extends string,\n\t\tTProp extends FnOrStatic<any[], ValueIDProperties[\"property\"]>,\n\t\tTMeta extends FnOrStatic<any[], ValueMetadata> = ValueMetadata,\n\t\tTOptions extends CCValueOptions = CCValueOptions,\n\t>(\n\t\tname: TName,\n\t\tproperty: TProp,\n\t\tis: PartialCCValuePredicate,\n\t\tmeta?: TMeta,\n\t\toptions?: TOptions,\n\t): {\n\t\t[K in TName]: {\n\t\t\t(...args: InferArgs<[TProp, TMeta]>): {\n\t\t\t\tproperty: ReturnTypeOrStatic<TProp>;\n\t\t\t\tmeta: ReturnTypeOrStatic<TMeta>;\n\t\t\t};\n\t\t\tis: PartialCCValuePredicate;\n\t\t\toptions: TOptions;\n\t\t};\n\t} {\n\t\treturn {\n\t\t\t[name]: Object.assign(\n\t\t\t\t(...args: InferArgs<[TProp, TMeta]>) => ({\n\t\t\t\t\tproperty: evalOrStatic(property, ...args),\n\t\t\t\t\tmeta: evalOrStatic(meta, ...args),\n\t\t\t\t}),\n\t\t\t\t{ is, options },\n\t\t\t),\n\t\t} as any;\n\t},\n\n\t/** Returns a CC value definition with the given name and a dynamic `property` */\n\tdynamicPropertyAndKeyWithName<\n\t\tTName extends string,\n\t\tTProp extends FnOrStatic<any[], ValueIDProperties[\"property\"]>,\n\t\tTKey extends FnOrStatic<any[], ValueIDProperties[\"propertyKey\"]>,\n\t\tTOptions extends CCValueOptions,\n\t\tTMeta extends FnOrStatic<any[], ValueMetadata> = ValueMetadata,\n\t>(\n\t\tname: TName,\n\t\tproperty: TProp,\n\t\tpropertyKey: TKey,\n\t\tis: PartialCCValuePredicate,\n\t\tmeta?: TMeta,\n\t\toptions?: TOptions,\n\t): {\n\t\t[K in TName]: {\n\t\t\t(...args: InferArgs<[TProp, TKey, TMeta]>): {\n\t\t\t\tproperty: ReturnTypeOrStatic<TProp>;\n\t\t\t\tpropertyKey: ReturnTypeOrStatic<TKey>;\n\t\t\t\tmeta: ReturnTypeOrStatic<TMeta>;\n\t\t\t};\n\t\t\tis: PartialCCValuePredicate;\n\t\t\toptions: TOptions;\n\t\t};\n\t} {\n\t\treturn {\n\t\t\t[name]: Object.assign(\n\t\t\t\t(...args: any[]) => {\n\t\t\t\t\treturn {\n\t\t\t\t\t\tproperty: evalOrStatic(property, ...args),\n\t\t\t\t\t\tpropertyKey: evalOrStatic(propertyKey, ...args),\n\t\t\t\t\t\tmeta: evalOrStatic(meta, ...args),\n\t\t\t\t\t};\n\t\t\t\t},\n\t\t\t\t{ is, options },\n\t\t\t),\n\t\t} as any;\n\t},\n\n\tdefineCCValues,\n};\n\nexport interface CCValueBlueprint extends Readonly<ValueIDProperties> {\n\treadonly meta?: Readonly<ValueMetadata>;\n\treadonly options?: Readonly<CCValueOptions>;\n}\n\nexport type CCValuePredicate = (valueId: ValueID) => boolean;\nexport type PartialCCValuePredicate = (\n\tproperties: ValueIDProperties,\n) => boolean;\n\n/** A blueprint for a CC value which depends on one or more parameters */\nexport interface DynamicCCValueBlueprint<TArgs extends any[]> {\n\t(...args: TArgs): Omit<CCValueBlueprint, \"options\">;\n\tis: PartialCCValuePredicate;\n\treadonly options?: Readonly<CCValueOptions>;\n}\n\n/** The common base type of all CC value definitions */\nexport interface CCValue {\n\treadonly id: Omit<ValueID, \"endpoint\">;\n\tendpoint(endpoint?: number): ValueID;\n\treadonly meta: ValueMetadata;\n}\n\nexport interface StaticCCValue extends CCValue {\n\t/** Whether the given value ID matches this value definition */\n\tis: CCValuePredicate;\n\treadonly options: Required<CCValueOptions>;\n}\n\nexport type DynamicCCValue<TArgs extends any[] = any[]> =\n\t& ExpandRecursivelySkipMeta<(...args: TArgs) => CCValue>\n\t& {\n\t\t/** Whether the given value ID matches this value definition */\n\t\tis: CCValuePredicate;\n\t\treadonly options: Required<CCValueOptions>;\n\t};\n\nexport type StaticCCValueFactory<T> = (self: T) => StaticCCValue;\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;AAQA;;;;;;AAAA,kBAIO;AAGP,gCAAyB;AAEzB,SAAS,eACR,cACA,GAAoE;AAMpE,SAAO,mCAAS,YAAY;AAC7B;AATS;AAmDF,MAAM,wBAAwB;EACpC,UAAU;EACV,YAAY;EACZ,QAAQ;EACR,UAAU;EACV,mBAAmB;EACnB,YAAY;;AAgDN,MAAM,IAAI;;EAEhB,eAKC,UACA,MACA,SAAkB;AAQlB,WAAO;MACN,CAAC,QAAQ,GAAG;QACX;QACA;QACA;;;EAGH;;EAGA,uBAMC,MACA,UACA,MACA,SAAkB;AAQlB,WAAO;MACN,CAAC,IAAI,GAAG;QACP;QACA;QACA;;;EAGH;;EAGA,6BAOC,MACA,UACA,aACA,MACA,SAAkB;AASlB,WAAO;MACN,CAAC,IAAI,GAAG;QACP;QACA;QACA;QACA;;;EAGH;;EAGA,wBAMC,MACA,UACA,IACA,MACA,SAAkB;AAWlB,WAAO;MACN,CAAC,IAAI,GAAG,OAAO,OACd,IAAI,UAAqC;QACxC,cAAU,0BAAa,UAAU,GAAG,IAAI;QACxC,UAAM,0BAAa,MAAM,GAAG,IAAI;UAEjC,EAAE,IAAI,QAAO,CAAE;;EAGlB;;EAGA,8BAOC,MACA,UACA,aACA,IACA,MACA,SAAkB;AAYlB,WAAO;MACN,CAAC,IAAI,GAAG,OAAO,OACd,IAAI,SAAe;AAClB,eAAO;UACN,cAAU,0BAAa,UAAU,GAAG,IAAI;UACxC,iBAAa,0BAAa,aAAa,GAAG,IAAI;UAC9C,UAAM,0BAAa,MAAM,GAAG,IAAI;;MAElC,GACA,EAAE,IAAI,QAAO,CAAE;;EAGlB;EAEA;;",
|
|
6
|
+
"names": []
|
|
7
7
|
}
|