@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,3 +1,3 @@
|
|
|
1
|
-
export declare function validateArgs_FibaroCCAPI_fibaroVenetianBlindsSetPosition(): <T extends Function>(__decoratedMethod: T, { kind }: ClassMethodDecoratorContext) =>
|
|
2
|
-
export declare function validateArgs_FibaroCCAPI_fibaroVenetianBlindsSetTilt(): <T extends Function>(__decoratedMethod: T, { kind }: ClassMethodDecoratorContext) =>
|
|
1
|
+
export declare function validateArgs_FibaroCCAPI_fibaroVenetianBlindsSetPosition(): <T extends Function>(__decoratedMethod: T, { kind }: ClassMethodDecoratorContext<unknown, (this: unknown, ...args: any) => any>) => void | T;
|
|
2
|
+
export declare function validateArgs_FibaroCCAPI_fibaroVenetianBlindsSetTilt(): <T extends Function>(__decoratedMethod: T, { kind }: ClassMethodDecoratorContext<unknown, (this: unknown, ...args: any) => any>) => void | T;
|
|
3
3
|
//# sourceMappingURL=FibaroCC._validateArgs.d.ts.map
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { type GetValueDB, type MaybeUnknown, type MessageOrCCLogEntry, type ValueID, ValueMetadata, type WithAddress } from "@zwave-js/core";
|
|
2
2
|
import { Bytes } from "@zwave-js/shared";
|
|
3
3
|
import { POLL_VALUE, type PollValueImplementation, SET_VALUE, type SetValueImplementation } from "../../lib/API.js";
|
|
4
|
-
import type { CCRaw, CommandClassOptions, InterviewContext, PersistValuesContext, RefreshValuesContext } from "../../lib/CommandClass.js";
|
|
4
|
+
import type { CCRaw, CommandClassOptions, InterviewContext, PersistValuesContext, RefreshValuesContext, RefreshValuesOptions } from "../../lib/CommandClass.js";
|
|
5
5
|
import type { CCEncodingContext, CCParsingContext } from "../../lib/traits.js";
|
|
6
6
|
import { ManufacturerProprietaryCC, ManufacturerProprietaryCCAPI } from "../ManufacturerProprietaryCC.js";
|
|
7
7
|
export declare const MANUFACTURERID_FIBARO = 271;
|
|
@@ -29,7 +29,7 @@ export declare class FibaroCC extends ManufacturerProprietaryCC {
|
|
|
29
29
|
fibaroCCId?: number;
|
|
30
30
|
fibaroCCCommand?: number;
|
|
31
31
|
interview(ctx: InterviewContext): Promise<void>;
|
|
32
|
-
refreshValues(ctx: RefreshValuesContext): Promise<void>;
|
|
32
|
+
refreshValues(ctx: RefreshValuesContext, options?: RefreshValuesOptions): Promise<void>;
|
|
33
33
|
serialize(ctx: CCEncodingContext): Promise<Bytes>;
|
|
34
34
|
}
|
|
35
35
|
export declare enum FibaroVenetianBlindCCCommand {
|
|
@@ -42,7 +42,7 @@ export declare class FibaroVenetianBlindCC extends FibaroCC {
|
|
|
42
42
|
fibaroCCCommand: FibaroVenetianBlindCCCommand;
|
|
43
43
|
constructor(options: CommandClassOptions);
|
|
44
44
|
interview(ctx: InterviewContext): Promise<void>;
|
|
45
|
-
refreshValues(ctx: RefreshValuesContext): Promise<void>;
|
|
45
|
+
refreshValues(ctx: RefreshValuesContext, options?: RefreshValuesOptions): Promise<void>;
|
|
46
46
|
}
|
|
47
47
|
export type FibaroVenetianBlindCCSetOptions = {
|
|
48
48
|
position: number;
|
|
@@ -44,6 +44,7 @@ __export(FibaroCC_exports, {
|
|
|
44
44
|
getFibaroVenetianBlindTiltValueId: () => getFibaroVenetianBlindTiltValueId
|
|
45
45
|
});
|
|
46
46
|
module.exports = __toCommonJS(FibaroCC_exports);
|
|
47
|
+
var import_tslib = require("tslib");
|
|
47
48
|
var __validateArgs = __toESM(require("./FibaroCC._validateArgs.js"), 1);
|
|
48
49
|
var import_core = require("@zwave-js/core");
|
|
49
50
|
var import_shared = require("@zwave-js/shared");
|
|
@@ -52,46 +53,6 @@ var import_API = require("../../lib/API.js");
|
|
|
52
53
|
var import_CommandClassDecorators = require("../../lib/CommandClassDecorators.js");
|
|
53
54
|
var import_ManufacturerProprietaryCC = require("../ManufacturerProprietaryCC.js");
|
|
54
55
|
var import_Decorators = require("./Decorators.js");
|
|
55
|
-
var __runInitializers = function(thisArg, initializers, value) {
|
|
56
|
-
var useValue = arguments.length > 2;
|
|
57
|
-
for (var i = 0; i < initializers.length; i++) {
|
|
58
|
-
value = useValue ? initializers[i].call(thisArg, value) : initializers[i].call(thisArg);
|
|
59
|
-
}
|
|
60
|
-
return useValue ? value : void 0;
|
|
61
|
-
};
|
|
62
|
-
var __esDecorate = function(ctor, descriptorIn, decorators, contextIn, initializers, extraInitializers) {
|
|
63
|
-
function accept(f) {
|
|
64
|
-
if (f !== void 0 && typeof f !== "function") throw new TypeError("Function expected");
|
|
65
|
-
return f;
|
|
66
|
-
}
|
|
67
|
-
__name(accept, "accept");
|
|
68
|
-
var kind = contextIn.kind, key = kind === "getter" ? "get" : kind === "setter" ? "set" : "value";
|
|
69
|
-
var target = !descriptorIn && ctor ? contextIn["static"] ? ctor : ctor.prototype : null;
|
|
70
|
-
var descriptor = descriptorIn || (target ? Object.getOwnPropertyDescriptor(target, contextIn.name) : {});
|
|
71
|
-
var _, done = false;
|
|
72
|
-
for (var i = decorators.length - 1; i >= 0; i--) {
|
|
73
|
-
var context = {};
|
|
74
|
-
for (var p in contextIn) context[p] = p === "access" ? {} : contextIn[p];
|
|
75
|
-
for (var p in contextIn.access) context.access[p] = contextIn.access[p];
|
|
76
|
-
context.addInitializer = function(f) {
|
|
77
|
-
if (done) throw new TypeError("Cannot add initializers after decoration has completed");
|
|
78
|
-
extraInitializers.push(accept(f || null));
|
|
79
|
-
};
|
|
80
|
-
var result = (0, decorators[i])(kind === "accessor" ? { get: descriptor.get, set: descriptor.set } : descriptor[key], context);
|
|
81
|
-
if (kind === "accessor") {
|
|
82
|
-
if (result === void 0) continue;
|
|
83
|
-
if (result === null || typeof result !== "object") throw new TypeError("Object expected");
|
|
84
|
-
if (_ = accept(result.get)) descriptor.get = _;
|
|
85
|
-
if (_ = accept(result.set)) descriptor.set = _;
|
|
86
|
-
if (_ = accept(result.init)) initializers.unshift(_);
|
|
87
|
-
} else if (_ = accept(result)) {
|
|
88
|
-
if (kind === "field") initializers.unshift(_);
|
|
89
|
-
else descriptor[key] = _;
|
|
90
|
-
}
|
|
91
|
-
}
|
|
92
|
-
if (target) Object.defineProperty(target, contextIn.name, descriptor);
|
|
93
|
-
done = true;
|
|
94
|
-
};
|
|
95
56
|
const { validateArgs_FibaroCCAPI_fibaroVenetianBlindsSetPosition, validateArgs_FibaroCCAPI_fibaroVenetianBlindsSetTilt } = __validateArgs;
|
|
96
57
|
const MANUFACTURERID_FIBARO = 271;
|
|
97
58
|
function getFibaroVenetianBlindPositionValueId(endpoint) {
|
|
@@ -156,12 +117,12 @@ let FibaroCCAPI = (() => {
|
|
|
156
117
|
}
|
|
157
118
|
static {
|
|
158
119
|
const _metadata = typeof Symbol === "function" && Symbol.metadata ? Object.create(_classSuper[Symbol.metadata] ?? null) : void 0;
|
|
159
|
-
__esDecorate(this, null, _fibaroVenetianBlindsSetPosition_decorators, { kind: "method", name: "fibaroVenetianBlindsSetPosition", static: false, private: false, access: { has: /* @__PURE__ */ __name((obj) => "fibaroVenetianBlindsSetPosition" in obj, "has"), get: /* @__PURE__ */ __name((obj) => obj.fibaroVenetianBlindsSetPosition, "get") }, metadata: _metadata }, null, _instanceExtraInitializers);
|
|
160
|
-
__esDecorate(this, null, _fibaroVenetianBlindsSetTilt_decorators, { kind: "method", name: "fibaroVenetianBlindsSetTilt", static: false, private: false, access: { has: /* @__PURE__ */ __name((obj) => "fibaroVenetianBlindsSetTilt" in obj, "has"), get: /* @__PURE__ */ __name((obj) => obj.fibaroVenetianBlindsSetTilt, "get") }, metadata: _metadata }, null, _instanceExtraInitializers);
|
|
161
|
-
__esDecorate(null, _classDescriptor = { value: _classThis }, _classDecorators, { kind: "class", name: _classThis.name, metadata: _metadata }, null, _classExtraInitializers);
|
|
120
|
+
(0, import_tslib.__esDecorate)(this, null, _fibaroVenetianBlindsSetPosition_decorators, { kind: "method", name: "fibaroVenetianBlindsSetPosition", static: false, private: false, access: { has: /* @__PURE__ */ __name((obj) => "fibaroVenetianBlindsSetPosition" in obj, "has"), get: /* @__PURE__ */ __name((obj) => obj.fibaroVenetianBlindsSetPosition, "get") }, metadata: _metadata }, null, _instanceExtraInitializers);
|
|
121
|
+
(0, import_tslib.__esDecorate)(this, null, _fibaroVenetianBlindsSetTilt_decorators, { kind: "method", name: "fibaroVenetianBlindsSetTilt", static: false, private: false, access: { has: /* @__PURE__ */ __name((obj) => "fibaroVenetianBlindsSetTilt" in obj, "has"), get: /* @__PURE__ */ __name((obj) => obj.fibaroVenetianBlindsSetTilt, "get") }, metadata: _metadata }, null, _instanceExtraInitializers);
|
|
122
|
+
(0, import_tslib.__esDecorate)(null, _classDescriptor = { value: _classThis }, _classDecorators, { kind: "class", name: _classThis.name, metadata: _metadata }, null, _classExtraInitializers);
|
|
162
123
|
FibaroCCAPI2 = _classThis = _classDescriptor.value;
|
|
163
124
|
if (_metadata) Object.defineProperty(_classThis, Symbol.metadata, { enumerable: true, configurable: true, writable: true, value: _metadata });
|
|
164
|
-
__runInitializers(_classThis, _classExtraInitializers);
|
|
125
|
+
(0, import_tslib.__runInitializers)(_classThis, _classExtraInitializers);
|
|
165
126
|
}
|
|
166
127
|
// oxlint-disable-next-line typescript/explicit-module-boundary-types
|
|
167
128
|
async fibaroVenetianBlindsGet() {
|
|
@@ -231,7 +192,7 @@ let FibaroCCAPI = (() => {
|
|
|
231
192
|
}
|
|
232
193
|
constructor() {
|
|
233
194
|
super(...arguments);
|
|
234
|
-
__runInitializers(this, _instanceExtraInitializers);
|
|
195
|
+
(0, import_tslib.__runInitializers)(this, _instanceExtraInitializers);
|
|
235
196
|
}
|
|
236
197
|
};
|
|
237
198
|
return FibaroCCAPI2 = _classThis;
|
|
@@ -251,10 +212,10 @@ let FibaroCC = (() => {
|
|
|
251
212
|
}
|
|
252
213
|
static {
|
|
253
214
|
const _metadata = typeof Symbol === "function" && Symbol.metadata ? Object.create(_classSuper[Symbol.metadata] ?? null) : void 0;
|
|
254
|
-
__esDecorate(null, _classDescriptor = { value: _classThis }, _classDecorators, { kind: "class", name: _classThis.name, metadata: _metadata }, null, _classExtraInitializers);
|
|
215
|
+
(0, import_tslib.__esDecorate)(null, _classDescriptor = { value: _classThis }, _classDecorators, { kind: "class", name: _classThis.name, metadata: _metadata }, null, _classExtraInitializers);
|
|
255
216
|
FibaroCC2 = _classThis = _classDescriptor.value;
|
|
256
217
|
if (_metadata) Object.defineProperty(_classThis, Symbol.metadata, { enumerable: true, configurable: true, writable: true, value: _metadata });
|
|
257
|
-
__runInitializers(_classThis, _classExtraInitializers);
|
|
218
|
+
(0, import_tslib.__runInitializers)(_classThis, _classExtraInitializers);
|
|
258
219
|
}
|
|
259
220
|
constructor(options) {
|
|
260
221
|
super(options);
|
|
@@ -286,14 +247,14 @@ let FibaroCC = (() => {
|
|
|
286
247
|
}
|
|
287
248
|
}
|
|
288
249
|
}
|
|
289
|
-
async refreshValues(ctx) {
|
|
250
|
+
async refreshValues(ctx, options) {
|
|
290
251
|
const node = this.getNode(ctx);
|
|
291
252
|
const supportedFibaroCCIDs = getSupportedFibaroCCIDs(ctx, node.id);
|
|
292
253
|
for (const ccId of supportedFibaroCCIDs) {
|
|
293
254
|
const SubConstructor = (0, import_Decorators.getFibaroCCConstructor)(ccId);
|
|
294
255
|
if (SubConstructor) {
|
|
295
256
|
const instance = new SubConstructor({ nodeId: node.id });
|
|
296
|
-
await instance.refreshValues(ctx);
|
|
257
|
+
await instance.refreshValues(ctx, options);
|
|
297
258
|
}
|
|
298
259
|
}
|
|
299
260
|
}
|
|
@@ -333,10 +294,10 @@ let FibaroVenetianBlindCC = (() => {
|
|
|
333
294
|
}
|
|
334
295
|
static {
|
|
335
296
|
const _metadata = typeof Symbol === "function" && Symbol.metadata ? Object.create(_classSuper[Symbol.metadata] ?? null) : void 0;
|
|
336
|
-
__esDecorate(null, _classDescriptor = { value: _classThis }, _classDecorators, { kind: "class", name: _classThis.name, metadata: _metadata }, null, _classExtraInitializers);
|
|
297
|
+
(0, import_tslib.__esDecorate)(null, _classDescriptor = { value: _classThis }, _classDecorators, { kind: "class", name: _classThis.name, metadata: _metadata }, null, _classExtraInitializers);
|
|
337
298
|
FibaroVenetianBlindCC2 = _classThis = _classDescriptor.value;
|
|
338
299
|
if (_metadata) Object.defineProperty(_classThis, Symbol.metadata, { enumerable: true, configurable: true, writable: true, value: _metadata });
|
|
339
|
-
__runInitializers(_classThis, _classExtraInitializers);
|
|
300
|
+
(0, import_tslib.__runInitializers)(_classThis, _classExtraInitializers);
|
|
340
301
|
}
|
|
341
302
|
constructor(options) {
|
|
342
303
|
super(options);
|
|
@@ -351,7 +312,7 @@ let FibaroVenetianBlindCC = (() => {
|
|
|
351
312
|
});
|
|
352
313
|
await this.refreshValues(ctx);
|
|
353
314
|
}
|
|
354
|
-
async refreshValues(ctx) {
|
|
315
|
+
async refreshValues(ctx, options) {
|
|
355
316
|
const node = this.getNode(ctx);
|
|
356
317
|
ctx.logNode(node.id, {
|
|
357
318
|
message: "Requesting venetian blind position and tilt...",
|
|
@@ -360,7 +321,9 @@ let FibaroVenetianBlindCC = (() => {
|
|
|
360
321
|
const resp = await ctx.sendCommand(new FibaroVenetianBlindCCGet({
|
|
361
322
|
nodeId: this.nodeId,
|
|
362
323
|
endpointIndex: this.endpointIndex
|
|
363
|
-
})
|
|
324
|
+
}), {
|
|
325
|
+
priority: options?.priority
|
|
326
|
+
});
|
|
364
327
|
if (resp) {
|
|
365
328
|
const logMessage = `received venetian blind state:
|
|
366
329
|
position: ${resp.position}
|
|
@@ -389,10 +352,10 @@ let FibaroVenetianBlindCCSet = (() => {
|
|
|
389
352
|
}
|
|
390
353
|
static {
|
|
391
354
|
const _metadata = typeof Symbol === "function" && Symbol.metadata ? Object.create(_classSuper[Symbol.metadata] ?? null) : void 0;
|
|
392
|
-
__esDecorate(null, _classDescriptor = { value: _classThis }, _classDecorators, { kind: "class", name: _classThis.name, metadata: _metadata }, null, _classExtraInitializers);
|
|
355
|
+
(0, import_tslib.__esDecorate)(null, _classDescriptor = { value: _classThis }, _classDecorators, { kind: "class", name: _classThis.name, metadata: _metadata }, null, _classExtraInitializers);
|
|
393
356
|
FibaroVenetianBlindCCSet2 = _classThis = _classDescriptor.value;
|
|
394
357
|
if (_metadata) Object.defineProperty(_classThis, Symbol.metadata, { enumerable: true, configurable: true, writable: true, value: _metadata });
|
|
395
|
-
__runInitializers(_classThis, _classExtraInitializers);
|
|
358
|
+
(0, import_tslib.__runInitializers)(_classThis, _classExtraInitializers);
|
|
396
359
|
}
|
|
397
360
|
constructor(options) {
|
|
398
361
|
super(options);
|
|
@@ -447,10 +410,10 @@ let FibaroVenetianBlindCCReport = (() => {
|
|
|
447
410
|
}
|
|
448
411
|
static {
|
|
449
412
|
const _metadata = typeof Symbol === "function" && Symbol.metadata ? Object.create(_classSuper[Symbol.metadata] ?? null) : void 0;
|
|
450
|
-
__esDecorate(null, _classDescriptor = { value: _classThis }, _classDecorators, { kind: "class", name: _classThis.name, metadata: _metadata }, null, _classExtraInitializers);
|
|
413
|
+
(0, import_tslib.__esDecorate)(null, _classDescriptor = { value: _classThis }, _classDecorators, { kind: "class", name: _classThis.name, metadata: _metadata }, null, _classExtraInitializers);
|
|
451
414
|
FibaroVenetianBlindCCReport2 = _classThis = _classDescriptor.value;
|
|
452
415
|
if (_metadata) Object.defineProperty(_classThis, Symbol.metadata, { enumerable: true, configurable: true, writable: true, value: _metadata });
|
|
453
|
-
__runInitializers(_classThis, _classExtraInitializers);
|
|
416
|
+
(0, import_tslib.__runInitializers)(_classThis, _classExtraInitializers);
|
|
454
417
|
}
|
|
455
418
|
constructor(options) {
|
|
456
419
|
super(options);
|
|
@@ -529,10 +492,10 @@ let FibaroVenetianBlindCCGet = (() => {
|
|
|
529
492
|
}
|
|
530
493
|
static {
|
|
531
494
|
const _metadata = typeof Symbol === "function" && Symbol.metadata ? Object.create(_classSuper[Symbol.metadata] ?? null) : void 0;
|
|
532
|
-
__esDecorate(null, _classDescriptor = { value: _classThis }, _classDecorators, { kind: "class", name: _classThis.name, metadata: _metadata }, null, _classExtraInitializers);
|
|
495
|
+
(0, import_tslib.__esDecorate)(null, _classDescriptor = { value: _classThis }, _classDecorators, { kind: "class", name: _classThis.name, metadata: _metadata }, null, _classExtraInitializers);
|
|
533
496
|
FibaroVenetianBlindCCGet2 = _classThis = _classDescriptor.value;
|
|
534
497
|
if (_metadata) Object.defineProperty(_classThis, Symbol.metadata, { enumerable: true, configurable: true, writable: true, value: _metadata });
|
|
535
|
-
__runInitializers(_classThis, _classExtraInitializers);
|
|
498
|
+
(0, import_tslib.__runInitializers)(_classThis, _classExtraInitializers);
|
|
536
499
|
}
|
|
537
500
|
// @noLogEntry: This CC has no properties to log
|
|
538
501
|
constructor(options) {
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../../src_gen/cc/manufacturerProprietary/FibaroCC.ts"],
|
|
4
|
-
"sourcesContent": ["import * as __validateArgs from \"./FibaroCC._validateArgs.js\";\nconst { validateArgs_FibaroCCAPI_fibaroVenetianBlindsSetPosition, validateArgs_FibaroCCAPI_fibaroVenetianBlindsSetTilt } = __validateArgs;\nimport type { GetDeviceConfig } from \"@zwave-js/config\";\nimport { CommandClasses, type GetValueDB, type MaybeUnknown, type MessageOrCCLogEntry, type MessageRecord, type ValueID, ValueMetadata, type WithAddress, ZWaveError, ZWaveErrorCodes, parseMaybeNumber, validatePayload, } from \"@zwave-js/core\";\nimport { Bytes, pick } from \"@zwave-js/shared\";\nimport { isArray } from \"alcalzone-shared/typeguards\";\nimport { POLL_VALUE, type PollValueImplementation, SET_VALUE, type SetValueImplementation, throwMissingPropertyKey, throwUnsupportedProperty, throwUnsupportedPropertyKey, throwWrongValueType, } from \"../../lib/API.js\";\nimport type { CCRaw, CommandClassOptions, InterviewContext, PersistValuesContext, RefreshValuesContext, } from \"../../lib/CommandClass.js\";\nimport { expectedCCResponse } from \"../../lib/CommandClassDecorators.js\";\nimport type { CCEncodingContext, CCParsingContext } from \"../../lib/traits.js\";\nimport { ManufacturerProprietaryCC, ManufacturerProprietaryCCAPI, } from \"../ManufacturerProprietaryCC.js\";\nimport { fibaroCC, fibaroCCCommand, getFibaroCCCommand, getFibaroCCCommandConstructor, getFibaroCCConstructor, getFibaroCCId, manufacturerId, manufacturerProprietaryAPI, } from \"./Decorators.js\";\nexport const MANUFACTURERID_FIBARO = 0x10f;\n/** Returns the ValueID used to store the current venetian blind position */\nexport function getFibaroVenetianBlindPositionValueId(endpoint: number): ValueID {\n return {\n commandClass: CommandClasses[\"Manufacturer Proprietary\"],\n endpoint,\n property: \"fibaro\",\n propertyKey: \"venetianBlindsPosition\",\n };\n}\n/** Returns the value metadata for venetian blind position */\nexport function getFibaroVenetianBlindPositionMetadata(): ValueMetadata {\n return {\n ...ValueMetadata.Level,\n label: \"Venetian blinds position\",\n };\n}\n/** Returns the ValueID used to store the current venetian blind tilt */\nexport function getFibaroVenetianBlindTiltValueId(endpoint: number): ValueID {\n return {\n commandClass: CommandClasses[\"Manufacturer Proprietary\"],\n endpoint,\n property: \"fibaro\",\n propertyKey: \"venetianBlindsTilt\",\n };\n}\n/** Returns the value metadata for venetian blind tilt */\nexport function getFibaroVenetianBlindTiltMetadata(): ValueMetadata {\n return {\n ...ValueMetadata.Level,\n label: \"Venetian blinds tilt\",\n };\n}\nfunction getSupportedFibaroCCIDs(ctx: GetDeviceConfig, nodeId: number): FibaroCCIDs[] {\n const proprietaryConfig = ctx.getDeviceConfig?.(nodeId)?.proprietary;\n if (proprietaryConfig && isArray(proprietaryConfig.fibaroCCs)) {\n return proprietaryConfig.fibaroCCs as FibaroCCIDs[];\n }\n return [];\n}\nexport enum FibaroCCIDs {\n VenetianBlind = 0x26\n}\n@manufacturerProprietaryAPI(MANUFACTURERID_FIBARO)\nexport class FibaroCCAPI extends ManufacturerProprietaryCCAPI {\n // oxlint-disable-next-line typescript/explicit-module-boundary-types\n public async fibaroVenetianBlindsGet() {\n const cc = new FibaroVenetianBlindCCGet({\n nodeId: this.endpoint.nodeId,\n endpointIndex: this.endpoint.index,\n });\n const response = await this.host.sendCommand<FibaroVenetianBlindCCReport>(cc, this.commandOptions);\n if (response) {\n return pick(response, [\"position\", \"tilt\"]);\n }\n }\n @validateArgs_FibaroCCAPI_fibaroVenetianBlindsSetPosition()\n public async fibaroVenetianBlindsSetPosition(value: number): Promise<void> {\n const cc = new FibaroVenetianBlindCCSet({\n nodeId: this.endpoint.nodeId,\n endpointIndex: this.endpoint.index,\n position: value,\n });\n await this.host.sendCommand(cc, this.commandOptions);\n }\n @validateArgs_FibaroCCAPI_fibaroVenetianBlindsSetTilt()\n public async fibaroVenetianBlindsSetTilt(value: number): Promise<void> {\n const cc = new FibaroVenetianBlindCCSet({\n nodeId: this.endpoint.nodeId,\n endpointIndex: this.endpoint.index,\n tilt: value,\n });\n await this.host.sendCommand(cc, this.commandOptions);\n }\n protected override get [SET_VALUE](): SetValueImplementation {\n return async function (this: FibaroCCAPI, { property, propertyKey }, value) {\n if (property !== \"fibaro\") {\n throwUnsupportedProperty(this.ccId, property);\n }\n if (propertyKey === \"venetianBlindsPosition\") {\n if (typeof value !== \"number\") {\n throwWrongValueType(this.ccId, property, \"number\", typeof value);\n }\n await this.fibaroVenetianBlindsSetPosition(value);\n }\n else if (propertyKey === \"venetianBlindsTilt\") {\n if (typeof value !== \"number\") {\n throwWrongValueType(this.ccId, property, \"number\", typeof value);\n }\n await this.fibaroVenetianBlindsSetTilt(value);\n }\n else {\n // unsupported property key, ignore...\n return;\n }\n // Verify the current value after a delay\n this.schedulePoll({ property, propertyKey }, value);\n return undefined;\n };\n }\n protected get [POLL_VALUE](): PollValueImplementation {\n return async function (this: FibaroCCAPI, { property, propertyKey }) {\n if (property !== \"fibaro\") {\n throwUnsupportedProperty(this.ccId, property);\n }\n else if (propertyKey == undefined) {\n throwMissingPropertyKey(this.ccId, property);\n }\n switch (propertyKey) {\n case \"venetianBlindsPosition\":\n return (await this.fibaroVenetianBlindsGet())?.position;\n case \"venetianBlindsTilt\":\n return (await this.fibaroVenetianBlindsGet())?.tilt;\n default:\n throwUnsupportedPropertyKey(this.ccId, property, propertyKey);\n }\n };\n }\n}\n@manufacturerId(MANUFACTURERID_FIBARO)\nexport class FibaroCC extends ManufacturerProprietaryCC {\n public constructor(options: CommandClassOptions) {\n super(options);\n this.fibaroCCId = getFibaroCCId(this);\n this.fibaroCCCommand = getFibaroCCCommand(this);\n }\n public static from(raw: CCRaw, ctx: CCParsingContext): FibaroCC {\n validatePayload(raw.payload.length >= 2);\n const fibaroCCId = raw.payload[0];\n const fibaroCCCommand = raw.payload[1];\n const FibaroConstructor = getFibaroCCCommandConstructor(fibaroCCId, fibaroCCCommand);\n if (FibaroConstructor) {\n return FibaroConstructor.from(raw.withPayload(raw.payload.subarray(2)), ctx);\n }\n return new FibaroCC({\n nodeId: ctx.sourceNodeId,\n });\n }\n public fibaroCCId?: number;\n public fibaroCCCommand?: number;\n public async interview(ctx: InterviewContext): Promise<void> {\n const node = this.getNode(ctx)!;\n // Iterate through all supported Fibaro CCs and interview them\n const supportedFibaroCCIDs = getSupportedFibaroCCIDs(ctx, node.id);\n for (const ccId of supportedFibaroCCIDs) {\n const SubConstructor = getFibaroCCConstructor(ccId);\n if (SubConstructor) {\n const instance = new SubConstructor({ nodeId: node.id });\n await instance.interview(ctx);\n }\n }\n }\n public async refreshValues(ctx: RefreshValuesContext): Promise<void> {\n const node = this.getNode(ctx)!;\n // Iterate through all supported Fibaro CCs and let them refresh their values\n const supportedFibaroCCIDs = getSupportedFibaroCCIDs(ctx, node.id);\n for (const ccId of supportedFibaroCCIDs) {\n const SubConstructor = getFibaroCCConstructor(ccId);\n if (SubConstructor) {\n const instance = new SubConstructor({ nodeId: node.id });\n await instance.refreshValues(ctx);\n }\n }\n }\n public serialize(ctx: CCEncodingContext): Promise<Bytes> {\n if (this.fibaroCCId == undefined) {\n throw new ZWaveError(\"Cannot serialize a Fibaro CC without a Fibaro CC ID\", ZWaveErrorCodes.CC_Invalid);\n }\n else if (this.fibaroCCCommand == undefined) {\n throw new ZWaveError(\"Cannot serialize a Fibaro CC without a Fibaro CC Command\", ZWaveErrorCodes.CC_Invalid);\n }\n this.payload = Bytes.concat([\n [this.fibaroCCId, this.fibaroCCCommand],\n this.payload,\n ]);\n return super.serialize(ctx);\n }\n}\nexport enum FibaroVenetianBlindCCCommand {\n Set = 0x01,\n Get = 0x02,\n Report = 0x03\n}\n@fibaroCC(FibaroCCIDs.VenetianBlind)\nexport class FibaroVenetianBlindCC extends FibaroCC {\n declare fibaroCCId: FibaroCCIDs.VenetianBlind;\n declare fibaroCCCommand: FibaroVenetianBlindCCCommand;\n public constructor(options: CommandClassOptions) {\n super(options);\n this.fibaroCCId = FibaroCCIDs.VenetianBlind;\n }\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 Fibaro Venetian Blind CC...`,\n direction: \"none\",\n });\n // Nothing special, just get the values\n await this.refreshValues(ctx);\n }\n public async refreshValues(ctx: RefreshValuesContext): Promise<void> {\n const node = this.getNode(ctx)!;\n ctx.logNode(node.id, {\n message: \"Requesting venetian blind position and tilt...\",\n direction: \"outbound\",\n });\n const resp = await ctx.sendCommand<FibaroVenetianBlindCCReport>(new FibaroVenetianBlindCCGet({\n nodeId: this.nodeId,\n endpointIndex: this.endpointIndex,\n }));\n if (resp) {\n const logMessage = `received venetian blind state:\nposition: ${resp.position}\ntilt: ${resp.tilt}`;\n ctx.logNode(node.id, {\n message: logMessage,\n direction: \"inbound\",\n });\n }\n }\n}\n// @publicAPI\nexport type FibaroVenetianBlindCCSetOptions = {\n position: number;\n} | {\n tilt: number;\n} | {\n position: number;\n tilt: number;\n};\n@fibaroCCCommand(FibaroVenetianBlindCCCommand.Set)\nexport class FibaroVenetianBlindCCSet extends FibaroVenetianBlindCC {\n public constructor(options: WithAddress<FibaroVenetianBlindCCSetOptions>) {\n super(options);\n this.fibaroCCCommand = FibaroVenetianBlindCCCommand.Set;\n if (\"position\" in options)\n this.position = options.position;\n if (\"tilt\" in options)\n this.tilt = options.tilt;\n }\n public static from(_raw: CCRaw, _ctx: CCParsingContext): FibaroVenetianBlindCCSet {\n // TODO: Deserialize payload\n throw new ZWaveError(`${this.name}: deserialization not implemented`, ZWaveErrorCodes.Deserialization_NotImplemented);\n }\n public position: number | undefined;\n public tilt: number | undefined;\n public serialize(ctx: CCEncodingContext): Promise<Bytes> {\n const controlByte = (this.position != undefined ? 0b10 : 0)\n | (this.tilt != undefined ? 0b01 : 0);\n this.payload = Bytes.from([\n controlByte,\n this.position ?? 0,\n this.tilt ?? 0,\n ]);\n return super.serialize(ctx);\n }\n public toLogEntry(ctx?: GetValueDB): MessageOrCCLogEntry {\n const message: MessageRecord = {};\n if (this.position != undefined) {\n message.position = this.position;\n }\n if (this.tilt != undefined) {\n message.tilt = this.tilt;\n }\n return {\n ...super.toLogEntry(ctx),\n message,\n };\n }\n}\n// @publicAPI\nexport interface FibaroVenetianBlindCCReportOptions {\n position?: MaybeUnknown<number>;\n tilt?: MaybeUnknown<number>;\n}\n@fibaroCCCommand(FibaroVenetianBlindCCCommand.Report)\nexport class FibaroVenetianBlindCCReport extends FibaroVenetianBlindCC {\n public constructor(options: WithAddress<FibaroVenetianBlindCCReportOptions>) {\n super(options);\n this.fibaroCCCommand = FibaroVenetianBlindCCCommand.Report;\n // TODO: Check implementation:\n this.position = options.position;\n this.tilt = options.tilt;\n }\n public static from(raw: CCRaw, ctx: CCParsingContext): FibaroVenetianBlindCCReport {\n validatePayload(raw.payload.length >= 3);\n // When the node sends a report, payload[0] === 0b11. This is probably a\n // bit mask for position and tilt\n let position: MaybeUnknown<number> | undefined;\n if (!!(raw.payload[0] & 0b10)) {\n position = parseMaybeNumber(raw.payload[1]);\n }\n let tilt: MaybeUnknown<number> | undefined;\n if (!!(raw.payload[0] & 0b01)) {\n tilt = parseMaybeNumber(raw.payload[2]);\n }\n return new this({\n nodeId: ctx.sourceNodeId,\n position,\n tilt,\n });\n }\n public persistValues(ctx: PersistValuesContext): boolean {\n if (!super.persistValues(ctx))\n return false;\n const valueDB = this.getValueDB(ctx);\n if (this.position != undefined) {\n const positionValueId = getFibaroVenetianBlindPositionValueId(this.endpointIndex);\n valueDB.setMetadata(positionValueId, {\n ...ValueMetadata.Level,\n label: \"Venetian blinds position\",\n });\n valueDB.setValue(positionValueId, this.position);\n }\n if (this.tilt != undefined) {\n const tiltValueId = getFibaroVenetianBlindTiltValueId(this.endpointIndex);\n valueDB.setMetadata(tiltValueId, {\n ...ValueMetadata.Level,\n label: \"Venetian blinds tilt\",\n });\n valueDB.setValue(tiltValueId, this.tilt);\n }\n return true;\n }\n public position: MaybeUnknown<number> | undefined;\n public tilt: MaybeUnknown<number> | undefined;\n public toLogEntry(ctx?: GetValueDB): MessageOrCCLogEntry {\n const message: MessageRecord = {};\n if (this.position != undefined) {\n message.position = this.position;\n }\n if (this.tilt != undefined) {\n message.tilt = this.tilt;\n }\n return {\n ...super.toLogEntry(ctx),\n message,\n };\n }\n}\n@fibaroCCCommand(FibaroVenetianBlindCCCommand.Get)\n@expectedCCResponse(FibaroVenetianBlindCCReport)\nexport class FibaroVenetianBlindCCGet extends FibaroVenetianBlindCC {\n // @noLogEntry: This CC has no properties to log\n public constructor(options: CommandClassOptions) {\n super(options);\n this.fibaroCCCommand = FibaroVenetianBlindCCCommand.Get;\n }\n public static from(raw: CCRaw, ctx: CCParsingContext): FibaroVenetianBlindCCGet {\n return new this({\n nodeId: ctx.sourceNodeId,\n });\n }\n}\n"],
|
|
5
|
-
"mappings": "
|
|
4
|
+
"sourcesContent": ["import * as __validateArgs from \"./FibaroCC._validateArgs.js\";\nconst { validateArgs_FibaroCCAPI_fibaroVenetianBlindsSetPosition, validateArgs_FibaroCCAPI_fibaroVenetianBlindsSetTilt } = __validateArgs;\nimport type { GetDeviceConfig } from \"@zwave-js/config\";\nimport { CommandClasses, type GetValueDB, type MaybeUnknown, type MessageOrCCLogEntry, type MessageRecord, type ValueID, ValueMetadata, type WithAddress, ZWaveError, ZWaveErrorCodes, parseMaybeNumber, validatePayload, } from \"@zwave-js/core\";\nimport { Bytes, pick } from \"@zwave-js/shared\";\nimport { isArray } from \"alcalzone-shared/typeguards\";\nimport { POLL_VALUE, type PollValueImplementation, SET_VALUE, type SetValueImplementation, throwMissingPropertyKey, throwUnsupportedProperty, throwUnsupportedPropertyKey, throwWrongValueType, } from \"../../lib/API.js\";\nimport type { CCRaw, CommandClassOptions, InterviewContext, PersistValuesContext, RefreshValuesContext, RefreshValuesOptions, } from \"../../lib/CommandClass.js\";\nimport { expectedCCResponse } from \"../../lib/CommandClassDecorators.js\";\nimport type { CCEncodingContext, CCParsingContext } from \"../../lib/traits.js\";\nimport { ManufacturerProprietaryCC, ManufacturerProprietaryCCAPI, } from \"../ManufacturerProprietaryCC.js\";\nimport { fibaroCC, fibaroCCCommand, getFibaroCCCommand, getFibaroCCCommandConstructor, getFibaroCCConstructor, getFibaroCCId, manufacturerId, manufacturerProprietaryAPI, } from \"./Decorators.js\";\nexport const MANUFACTURERID_FIBARO = 0x10f;\n/** Returns the ValueID used to store the current venetian blind position */\nexport function getFibaroVenetianBlindPositionValueId(endpoint: number): ValueID {\n return {\n commandClass: CommandClasses[\"Manufacturer Proprietary\"],\n endpoint,\n property: \"fibaro\",\n propertyKey: \"venetianBlindsPosition\",\n };\n}\n/** Returns the value metadata for venetian blind position */\nexport function getFibaroVenetianBlindPositionMetadata(): ValueMetadata {\n return {\n ...ValueMetadata.Level,\n label: \"Venetian blinds position\",\n };\n}\n/** Returns the ValueID used to store the current venetian blind tilt */\nexport function getFibaroVenetianBlindTiltValueId(endpoint: number): ValueID {\n return {\n commandClass: CommandClasses[\"Manufacturer Proprietary\"],\n endpoint,\n property: \"fibaro\",\n propertyKey: \"venetianBlindsTilt\",\n };\n}\n/** Returns the value metadata for venetian blind tilt */\nexport function getFibaroVenetianBlindTiltMetadata(): ValueMetadata {\n return {\n ...ValueMetadata.Level,\n label: \"Venetian blinds tilt\",\n };\n}\nfunction getSupportedFibaroCCIDs(ctx: GetDeviceConfig, nodeId: number): FibaroCCIDs[] {\n const proprietaryConfig = ctx.getDeviceConfig?.(nodeId)?.proprietary;\n if (proprietaryConfig && isArray(proprietaryConfig.fibaroCCs)) {\n return proprietaryConfig.fibaroCCs as FibaroCCIDs[];\n }\n return [];\n}\nexport enum FibaroCCIDs {\n VenetianBlind = 0x26\n}\n@manufacturerProprietaryAPI(MANUFACTURERID_FIBARO)\nexport class FibaroCCAPI extends ManufacturerProprietaryCCAPI {\n // oxlint-disable-next-line typescript/explicit-module-boundary-types\n public async fibaroVenetianBlindsGet() {\n const cc = new FibaroVenetianBlindCCGet({\n nodeId: this.endpoint.nodeId,\n endpointIndex: this.endpoint.index,\n });\n const response = await this.host.sendCommand<FibaroVenetianBlindCCReport>(cc, this.commandOptions);\n if (response) {\n return pick(response, [\"position\", \"tilt\"]);\n }\n }\n @validateArgs_FibaroCCAPI_fibaroVenetianBlindsSetPosition()\n public async fibaroVenetianBlindsSetPosition(value: number): Promise<void> {\n const cc = new FibaroVenetianBlindCCSet({\n nodeId: this.endpoint.nodeId,\n endpointIndex: this.endpoint.index,\n position: value,\n });\n await this.host.sendCommand(cc, this.commandOptions);\n }\n @validateArgs_FibaroCCAPI_fibaroVenetianBlindsSetTilt()\n public async fibaroVenetianBlindsSetTilt(value: number): Promise<void> {\n const cc = new FibaroVenetianBlindCCSet({\n nodeId: this.endpoint.nodeId,\n endpointIndex: this.endpoint.index,\n tilt: value,\n });\n await this.host.sendCommand(cc, this.commandOptions);\n }\n protected override get [SET_VALUE](): SetValueImplementation {\n return async function (this: FibaroCCAPI, { property, propertyKey }, value) {\n if (property !== \"fibaro\") {\n throwUnsupportedProperty(this.ccId, property);\n }\n if (propertyKey === \"venetianBlindsPosition\") {\n if (typeof value !== \"number\") {\n throwWrongValueType(this.ccId, property, \"number\", typeof value);\n }\n await this.fibaroVenetianBlindsSetPosition(value);\n }\n else if (propertyKey === \"venetianBlindsTilt\") {\n if (typeof value !== \"number\") {\n throwWrongValueType(this.ccId, property, \"number\", typeof value);\n }\n await this.fibaroVenetianBlindsSetTilt(value);\n }\n else {\n // unsupported property key, ignore...\n return;\n }\n // Verify the current value after a delay\n this.schedulePoll({ property, propertyKey }, value);\n return undefined;\n };\n }\n protected get [POLL_VALUE](): PollValueImplementation {\n return async function (this: FibaroCCAPI, { property, propertyKey }) {\n if (property !== \"fibaro\") {\n throwUnsupportedProperty(this.ccId, property);\n }\n else if (propertyKey == undefined) {\n throwMissingPropertyKey(this.ccId, property);\n }\n switch (propertyKey) {\n case \"venetianBlindsPosition\":\n return (await this.fibaroVenetianBlindsGet())?.position;\n case \"venetianBlindsTilt\":\n return (await this.fibaroVenetianBlindsGet())?.tilt;\n default:\n throwUnsupportedPropertyKey(this.ccId, property, propertyKey);\n }\n };\n }\n}\n@manufacturerId(MANUFACTURERID_FIBARO)\nexport class FibaroCC extends ManufacturerProprietaryCC {\n public constructor(options: CommandClassOptions) {\n super(options);\n this.fibaroCCId = getFibaroCCId(this);\n this.fibaroCCCommand = getFibaroCCCommand(this);\n }\n public static from(raw: CCRaw, ctx: CCParsingContext): FibaroCC {\n validatePayload(raw.payload.length >= 2);\n const fibaroCCId = raw.payload[0];\n const fibaroCCCommand = raw.payload[1];\n const FibaroConstructor = getFibaroCCCommandConstructor(fibaroCCId, fibaroCCCommand);\n if (FibaroConstructor) {\n return FibaroConstructor.from(raw.withPayload(raw.payload.subarray(2)), ctx);\n }\n return new FibaroCC({\n nodeId: ctx.sourceNodeId,\n });\n }\n public fibaroCCId?: number;\n public fibaroCCCommand?: number;\n public async interview(ctx: InterviewContext): Promise<void> {\n const node = this.getNode(ctx)!;\n // Iterate through all supported Fibaro CCs and interview them\n const supportedFibaroCCIDs = getSupportedFibaroCCIDs(ctx, node.id);\n for (const ccId of supportedFibaroCCIDs) {\n const SubConstructor = getFibaroCCConstructor(ccId);\n if (SubConstructor) {\n const instance = new SubConstructor({ nodeId: node.id });\n await instance.interview(ctx);\n }\n }\n }\n public async refreshValues(ctx: RefreshValuesContext, options?: RefreshValuesOptions): Promise<void> {\n const node = this.getNode(ctx)!;\n // Iterate through all supported Fibaro CCs and let them refresh their values\n const supportedFibaroCCIDs = getSupportedFibaroCCIDs(ctx, node.id);\n for (const ccId of supportedFibaroCCIDs) {\n const SubConstructor = getFibaroCCConstructor(ccId);\n if (SubConstructor) {\n const instance = new SubConstructor({ nodeId: node.id });\n await instance.refreshValues(ctx, options);\n }\n }\n }\n public serialize(ctx: CCEncodingContext): Promise<Bytes> {\n if (this.fibaroCCId == undefined) {\n throw new ZWaveError(\"Cannot serialize a Fibaro CC without a Fibaro CC ID\", ZWaveErrorCodes.CC_Invalid);\n }\n else if (this.fibaroCCCommand == undefined) {\n throw new ZWaveError(\"Cannot serialize a Fibaro CC without a Fibaro CC Command\", ZWaveErrorCodes.CC_Invalid);\n }\n this.payload = Bytes.concat([\n [this.fibaroCCId, this.fibaroCCCommand],\n this.payload,\n ]);\n return super.serialize(ctx);\n }\n}\nexport enum FibaroVenetianBlindCCCommand {\n Set = 0x01,\n Get = 0x02,\n Report = 0x03\n}\n@fibaroCC(FibaroCCIDs.VenetianBlind)\nexport class FibaroVenetianBlindCC extends FibaroCC {\n declare fibaroCCId: FibaroCCIDs.VenetianBlind;\n declare fibaroCCCommand: FibaroVenetianBlindCCCommand;\n public constructor(options: CommandClassOptions) {\n super(options);\n this.fibaroCCId = FibaroCCIDs.VenetianBlind;\n }\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 Fibaro Venetian Blind CC...`,\n direction: \"none\",\n });\n // Nothing special, just get the values\n await this.refreshValues(ctx);\n }\n public async refreshValues(ctx: RefreshValuesContext, options?: RefreshValuesOptions): Promise<void> {\n const node = this.getNode(ctx)!;\n ctx.logNode(node.id, {\n message: \"Requesting venetian blind position and tilt...\",\n direction: \"outbound\",\n });\n const resp = await ctx.sendCommand<FibaroVenetianBlindCCReport>(new FibaroVenetianBlindCCGet({\n nodeId: this.nodeId,\n endpointIndex: this.endpointIndex,\n }), {\n priority: options?.priority,\n });\n if (resp) {\n const logMessage = `received venetian blind state:\nposition: ${resp.position}\ntilt: ${resp.tilt}`;\n ctx.logNode(node.id, {\n message: logMessage,\n direction: \"inbound\",\n });\n }\n }\n}\n// @publicAPI\nexport type FibaroVenetianBlindCCSetOptions = {\n position: number;\n} | {\n tilt: number;\n} | {\n position: number;\n tilt: number;\n};\n@fibaroCCCommand(FibaroVenetianBlindCCCommand.Set)\nexport class FibaroVenetianBlindCCSet extends FibaroVenetianBlindCC {\n public constructor(options: WithAddress<FibaroVenetianBlindCCSetOptions>) {\n super(options);\n this.fibaroCCCommand = FibaroVenetianBlindCCCommand.Set;\n if (\"position\" in options)\n this.position = options.position;\n if (\"tilt\" in options)\n this.tilt = options.tilt;\n }\n public static from(_raw: CCRaw, _ctx: CCParsingContext): FibaroVenetianBlindCCSet {\n // TODO: Deserialize payload\n throw new ZWaveError(`${this.name}: deserialization not implemented`, ZWaveErrorCodes.Deserialization_NotImplemented);\n }\n public position: number | undefined;\n public tilt: number | undefined;\n public serialize(ctx: CCEncodingContext): Promise<Bytes> {\n const controlByte = (this.position != undefined ? 0b10 : 0)\n | (this.tilt != undefined ? 0b01 : 0);\n this.payload = Bytes.from([\n controlByte,\n this.position ?? 0,\n this.tilt ?? 0,\n ]);\n return super.serialize(ctx);\n }\n public toLogEntry(ctx?: GetValueDB): MessageOrCCLogEntry {\n const message: MessageRecord = {};\n if (this.position != undefined) {\n message.position = this.position;\n }\n if (this.tilt != undefined) {\n message.tilt = this.tilt;\n }\n return {\n ...super.toLogEntry(ctx),\n message,\n };\n }\n}\n// @publicAPI\nexport interface FibaroVenetianBlindCCReportOptions {\n position?: MaybeUnknown<number>;\n tilt?: MaybeUnknown<number>;\n}\n@fibaroCCCommand(FibaroVenetianBlindCCCommand.Report)\nexport class FibaroVenetianBlindCCReport extends FibaroVenetianBlindCC {\n public constructor(options: WithAddress<FibaroVenetianBlindCCReportOptions>) {\n super(options);\n this.fibaroCCCommand = FibaroVenetianBlindCCCommand.Report;\n // TODO: Check implementation:\n this.position = options.position;\n this.tilt = options.tilt;\n }\n public static from(raw: CCRaw, ctx: CCParsingContext): FibaroVenetianBlindCCReport {\n validatePayload(raw.payload.length >= 3);\n // When the node sends a report, payload[0] === 0b11. This is probably a\n // bit mask for position and tilt\n let position: MaybeUnknown<number> | undefined;\n if (!!(raw.payload[0] & 0b10)) {\n position = parseMaybeNumber(raw.payload[1]);\n }\n let tilt: MaybeUnknown<number> | undefined;\n if (!!(raw.payload[0] & 0b01)) {\n tilt = parseMaybeNumber(raw.payload[2]);\n }\n return new this({\n nodeId: ctx.sourceNodeId,\n position,\n tilt,\n });\n }\n public persistValues(ctx: PersistValuesContext): boolean {\n if (!super.persistValues(ctx))\n return false;\n const valueDB = this.getValueDB(ctx);\n if (this.position != undefined) {\n const positionValueId = getFibaroVenetianBlindPositionValueId(this.endpointIndex);\n valueDB.setMetadata(positionValueId, {\n ...ValueMetadata.Level,\n label: \"Venetian blinds position\",\n });\n valueDB.setValue(positionValueId, this.position);\n }\n if (this.tilt != undefined) {\n const tiltValueId = getFibaroVenetianBlindTiltValueId(this.endpointIndex);\n valueDB.setMetadata(tiltValueId, {\n ...ValueMetadata.Level,\n label: \"Venetian blinds tilt\",\n });\n valueDB.setValue(tiltValueId, this.tilt);\n }\n return true;\n }\n public position: MaybeUnknown<number> | undefined;\n public tilt: MaybeUnknown<number> | undefined;\n public toLogEntry(ctx?: GetValueDB): MessageOrCCLogEntry {\n const message: MessageRecord = {};\n if (this.position != undefined) {\n message.position = this.position;\n }\n if (this.tilt != undefined) {\n message.tilt = this.tilt;\n }\n return {\n ...super.toLogEntry(ctx),\n message,\n };\n }\n}\n@fibaroCCCommand(FibaroVenetianBlindCCCommand.Get)\n@expectedCCResponse(FibaroVenetianBlindCCReport)\nexport class FibaroVenetianBlindCCGet extends FibaroVenetianBlindCC {\n // @noLogEntry: This CC has no properties to log\n public constructor(options: CommandClassOptions) {\n super(options);\n this.fibaroCCCommand = FibaroVenetianBlindCCCommand.Get;\n }\n public static from(raw: CCRaw, ctx: CCParsingContext): FibaroVenetianBlindCCGet {\n return new this({\n nodeId: ctx.sourceNodeId,\n });\n }\n}\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,qBAAgC;AAGhC,kBAAiO;AACjO,oBAA4B;AAC5B,wBAAwB;AACxB,iBAAuM;AAEvM,oCAAmC;AAEnC,uCAAyE;AACzE,wBAAiL;AAVjL,MAAM,EAAE,0DAA0D,qDAAoD,IAAK;AAWpH,MAAM,wBAAwB;AAE/B,SAAU,sCAAsC,UAAgB;AAClE,SAAO;IACH,cAAc,2BAAe,0BAA0B;IACvD;IACA,UAAU;IACV,aAAa;;AAErB;AAPgB;AASV,SAAU,yCAAsC;AAClD,SAAO;IACH,GAAG,0BAAc;IACjB,OAAO;;AAEf;AALgB;AAOV,SAAU,kCAAkC,UAAgB;AAC9D,SAAO;IACH,cAAc,2BAAe,0BAA0B;IACvD;IACA,UAAU;IACV,aAAa;;AAErB;AAPgB;AASV,SAAU,qCAAkC;AAC9C,SAAO;IACH,GAAG,0BAAc;IACjB,OAAO;;AAEf;AALgB;AAMhB,SAAS,wBAAwB,KAAsB,QAAc;AACjE,QAAM,oBAAoB,IAAI,kBAAkB,MAAM,GAAG;AACzD,MAAI,yBAAqB,2BAAQ,kBAAkB,SAAS,GAAG;AAC3D,WAAO,kBAAkB;EAC7B;AACA,SAAO,CAAA;AACX;AANS;AAOT,IAAY;CAAZ,SAAYA,cAAW;AACnB,EAAAA,aAAAA,aAAA,eAAA,IAAA,EAAA,IA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AC5B;AACA,UAAI,KAAK,QAAQ,QAAW;AACxB,gBAAQ,OAAO,KAAK;MACxB;AACA,aAAO;QACH,GAAG,MAAM,WAAW,GAAG;QACvB;;IAER;;;;IAIS,4BAAwB,MAAA;8BAFpC,mCAAgB,6BAA6B,GAAG,OAChD,kDAAmB,2BAA2B,CAAC;;;;oBACF;gDAAA,YAAqB;WAAA;;;;;;;;AAAnE,qCAAA,MAAA,mBAAA,EAAA,OAAA,WAAA,GAAA,kBAAA,EAAA,MAAA,SAAA,MAAA,WAAA,MAAA,UAAA,UAAA,GAAA,MAAA,uBAAA;;;AAAa,0CAAA,YAAA,uBAAA;;;IAET,YAAmB,SAA4B;AAC3C,YAAM,OAAO;AACb,WAAK,kBAAkB,6BAA6B;IACxD;IACO,OAAO,KAAK,KAAY,KAAqB;AAChD,aAAO,IAAI,KAAK;QACZ,QAAQ,IAAI;OACf;IACL;;;;",
|
|
6
6
|
"names": ["FibaroCCIDs", "fibaroCCCommand", "FibaroCC", "FibaroVenetianBlindCCCommand"]
|
|
7
7
|
}
|
package/build/cjs/lib/API.d.ts
CHANGED
|
@@ -15,6 +15,7 @@ export type SetValueImplementationHooks = AllOrNone<{
|
|
|
15
15
|
supervisionOnSuccess: () => void | Promise<void>;
|
|
16
16
|
supervisionOnFailure: () => void | Promise<void>;
|
|
17
17
|
}> & {
|
|
18
|
+
isSplitStateTargetValue?: boolean;
|
|
18
19
|
optimisticallyUpdateRelatedValues?: (supervisedAndSuccessful: boolean) => void;
|
|
19
20
|
forceVerifyChanges?: () => boolean;
|
|
20
21
|
verifyChanges?: (result?: SupervisionResult) => void | Promise<void>;
|
package/build/cjs/lib/API.js.map
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../src_gen/lib/API.ts"],
|
|
4
|
-
"sourcesContent": ["import type { CompatOverrideQueries, GetDeviceConfig } from \"@zwave-js/config\";\nimport {\n\tCommandClasses,\n\ttype ControlsCC,\n\ttype Duration,\n\ttype EndpointId,\n\ttype GetEndpoint,\n\ttype GetNode,\n\ttype GetSafeCCVersion,\n\ttype GetSupportedCCVersion,\n\ttype GetValueDB,\n\ttype HostIDs,\n\ttype ListenBehavior,\n\ttype LogNode,\n\ttype MaybeNotKnown,\n\tNODE_ID_BROADCAST,\n\tNODE_ID_BROADCAST_LR,\n\tNOT_KNOWN,\n\ttype NodeId,\n\ttype PhysicalNodes,\n\ttype QueryNodeInterviewStage,\n\ttype QueryNodeStatus,\n\ttype SecurityManagers,\n\ttype SendCommandOptions,\n\ttype SupervisionResult,\n\ttype SupportsCC,\n\ttype TXReport,\n\ttype ValueChangeOptions,\n\ttype ValueDB,\n\ttype ValueID,\n\ttype VirtualEndpointId,\n\tZWaveError,\n\tZWaveErrorCodes,\n\tgetCCName,\n\tstripUndefined,\n} from \"@zwave-js/core\";\nimport {\n\ttype AllOrNone,\n\ttype OnlyMethods,\n\tgetEnumMemberName,\n\tgetErrorMessage,\n\tnum2hex,\n} from \"@zwave-js/shared\";\nimport { isArray } from \"alcalzone-shared/typeguards\";\nimport {\n\tgetAPI,\n\tgetCCValues,\n\tgetCommandClass,\n\tgetImplementedVersion,\n} from \"./CommandClassDecorators.js\";\nimport type { CCValue, StaticCCValue } from \"./Values.js\";\nimport type { SendCommand } from \"./traits.js\";\nimport type {\n\tGetRefreshValueTimeouts,\n\tGetUserPreferences,\n\tSchedulePoll,\n} from \"./traits.js\";\n\n// Import and re-export generated types\nimport type { CCAPIs, CCNameMap } from \"./_CCAPI.generated.js\";\nexport type { CCAPIs, CCNameMap };\n\nexport type ValueIDProperties = Pick<ValueID, \"property\" | \"propertyKey\">;\n\n/** Used to identify the method on the CC API class that handles setting values on nodes directly */\nexport const SET_VALUE: unique symbol = Symbol.for(\"CCAPI_SET_VALUE\");\n\nexport type SetValueImplementation = (\n\tproperty: ValueIDProperties,\n\tvalue: unknown,\n\toptions?: SetValueAPIOptions,\n) => Promise<SupervisionResult | undefined>;\n\nexport const SET_VALUE_HOOKS: unique symbol = Symbol.for(\n\t\"CCAPI_SET_VALUE_HOOKS\",\n);\n\nexport type SetValueImplementationHooks =\n\t& AllOrNone<{\n\t\t// Opt-in to and handle delayed supervision updates\n\t\tsupervisionDelayedUpdates: boolean;\n\t\tsupervisionOnSuccess: () => void | Promise<void>;\n\t\tsupervisionOnFailure: () => void | Promise<void>;\n\t}>\n\t& {\n\t\t// Optimistically update related cached values (if allowed)\n\t\toptimisticallyUpdateRelatedValues?: (\n\t\t\tsupervisedAndSuccessful: boolean,\n\t\t) => void;\n\t\t// Check if a verification of the set value is required, even if the API response suggests otherwise\n\t\tforceVerifyChanges?: () => boolean;\n\t\t// Verify the changes\n\t\tverifyChanges?: (result?: SupervisionResult) => void | Promise<void>;\n\t};\n\nexport type SetValueImplementationHooksFactory = (\n\tproperty: ValueIDProperties,\n\tvalue: unknown,\n\toptions?: SetValueAPIOptions,\n) => SetValueImplementationHooks | undefined;\n\n/**\n * A generic options bag for the `setValue` API.\n * Each implementation will choose the options that are relevant for it, so you can use the same options everywhere.\n * @publicAPI\n */\nexport type SetValueAPIOptions =\n\t& Partial<ValueChangeOptions>\n\t& Pick<SendCommandOptions, \"onProgress\">;\n\n/** Used to identify the method on the CC API class that handles polling values from nodes */\nexport const POLL_VALUE: unique symbol = Symbol.for(\"CCAPI_POLL_VALUE\");\nexport type PollValueImplementation<T = unknown> = (\n\tproperty: ValueIDProperties,\n) => Promise<T | undefined>;\n\n// Since the setValue API is called from a point with very generic parameters,\n// we must do narrowing inside the API calls. These three methods are for convenience\nexport function throwUnsupportedProperty(\n\tcc: CommandClasses,\n\tproperty: string | number,\n): never {\n\tthrow new ZWaveError(\n\t\t`${CommandClasses[cc]}: \"${property}\" is not a supported property`,\n\t\tZWaveErrorCodes.Argument_Invalid,\n\t);\n}\n\nexport function throwUnsupportedPropertyKey(\n\tcc: CommandClasses,\n\tproperty: string | number,\n\tpropertyKey: string | number,\n): never {\n\tthrow new ZWaveError(\n\t\t`${\n\t\t\tCommandClasses[cc]\n\t\t}: \"${propertyKey}\" is not a supported property key for property \"${property}\"`,\n\t\tZWaveErrorCodes.Argument_Invalid,\n\t);\n}\n\nexport function throwMissingPropertyKey(\n\tcc: CommandClasses,\n\tproperty: string | number,\n): never {\n\tthrow new ZWaveError(\n\t\t`${\n\t\t\tCommandClasses[cc]\n\t\t}: property \"${property}\" requires a property key, but none was given`,\n\t\tZWaveErrorCodes.Argument_Invalid,\n\t);\n}\n\nexport function throwWrongValueType(\n\tcc: CommandClasses,\n\tproperty: string | number,\n\texpectedType: string,\n\treceivedType: string,\n): never {\n\tthrow new ZWaveError(\n\t\t`${\n\t\t\tCommandClasses[cc]\n\t\t}: \"${property}\" must be of type \"${expectedType}\", received \"${receivedType}\"`,\n\t\tZWaveErrorCodes.Argument_Invalid,\n\t);\n}\n\nexport interface CCAPISchedulePollOptions {\n\tduration?: Duration;\n\ttransition?: \"fast\" | \"slow\";\n}\n\n// Defines the necessary traits the host passed to a CC API must have\nexport type CCAPIHost<TNode extends CCAPINode = CCAPINode> =\n\t& HostIDs\n\t& GetNode<TNode>\n\t& GetValueDB\n\t& GetSupportedCCVersion\n\t& GetSafeCCVersion\n\t& SecurityManagers\n\t& GetDeviceConfig\n\t& SendCommand\n\t& GetRefreshValueTimeouts\n\t& GetUserPreferences\n\t& SchedulePoll\n\t& LogNode;\n\n// Defines the necessary traits a node passed to a CC API must have\nexport type CCAPINode =\n\t& NodeId\n\t& ListenBehavior\n\t& QueryNodeStatus\n\t& QueryNodeInterviewStage;\n\n// Defines the necessary traits an endpoint passed to a CC API must have\nexport type CCAPIEndpoint =\n\t& (\n\t\t| (\n\t\t\t// Physical endpoints must let us query their controlled CCs\n\t\t\tEndpointId & ControlsCC\n\t\t)\n\t\t| (\n\t\t\t// Virtual endpoints must let us query their physical nodes,\n\t\t\t// the CCs those nodes implement, and access the endpoints of those\n\t\t\t// physical nodes\n\t\t\tVirtualEndpointId & {\n\t\t\t\tnode: PhysicalNodes<\n\t\t\t\t\t& NodeId\n\t\t\t\t\t& SupportsCC\n\t\t\t\t\t& ControlsCC\n\t\t\t\t\t& GetEndpoint<EndpointId & SupportsCC & ControlsCC>\n\t\t\t\t>;\n\t\t\t}\n\t\t)\n\t)\n\t& SupportsCC;\n\nexport type PhysicalCCAPIEndpoint = CCAPIEndpoint & EndpointId;\nexport type VirtualCCAPIEndpoint = CCAPIEndpoint & VirtualEndpointId;\n\n/**\n * The base class for all CC APIs exposed via `Node.commandClasses.<CCName>`\n * @publicAPI\n */\nexport class CCAPI {\n\tpublic constructor(\n\t\tprotected readonly host: CCAPIHost,\n\t\tprotected readonly endpoint: CCAPIEndpoint,\n\t) {\n\t\tthis.ccId = getCommandClass(this);\n\t}\n\n\tpublic static create<T extends CommandClasses>(\n\t\tccId: T,\n\t\thost: CCAPIHost,\n\t\tendpoint: CCAPIEndpoint,\n\t\trequireSupport?: boolean,\n\t): CommandClasses extends T ? CCAPI : CCToAPI<T> {\n\t\tconst APIConstructor = getAPI(ccId);\n\t\tconst ccName = CommandClasses[ccId];\n\t\tif (APIConstructor == undefined) {\n\t\t\tthrow new ZWaveError(\n\t\t\t\t`Command Class ${ccName} (${\n\t\t\t\t\tnum2hex(\n\t\t\t\t\t\tccId,\n\t\t\t\t\t)\n\t\t\t\t}) has no associated API!`,\n\t\t\t\tZWaveErrorCodes.CC_NoAPI,\n\t\t\t);\n\t\t}\n\t\tconst apiInstance = new APIConstructor(host, endpoint);\n\n\t\t// Only require support for physical endpoints by default\n\t\trequireSupport ??= !endpoint.virtual;\n\n\t\tif (requireSupport) {\n\t\t\t// @ts-expect-error TS doesn't like assigning to conditional types\n\t\t\treturn new Proxy(apiInstance, {\n\t\t\t\tget: (target, property) => {\n\t\t\t\t\t// Forbid access to the API if it is not supported by the node\n\t\t\t\t\tif (\n\t\t\t\t\t\tproperty !== \"ccId\"\n\t\t\t\t\t\t&& property !== \"endpoint\"\n\t\t\t\t\t\t&& property !== \"isSupported\"\n\t\t\t\t\t\t&& property !== \"withOptions\"\n\t\t\t\t\t\t&& property !== \"commandOptions\"\n\t\t\t\t\t\t&& !target.isSupported()\n\t\t\t\t\t) {\n\t\t\t\t\t\tlet messageStart: string;\n\t\t\t\t\t\tif (endpoint.virtual) {\n\t\t\t\t\t\t\tconst hasNodeId =\n\t\t\t\t\t\t\t\ttypeof endpoint.nodeId === \"number\"\n\t\t\t\t\t\t\t\t&& endpoint.nodeId !== NODE_ID_BROADCAST\n\t\t\t\t\t\t\t\t&& endpoint.nodeId !== NODE_ID_BROADCAST_LR;\n\t\t\t\t\t\t\tmessageStart = `${\n\t\t\t\t\t\t\t\thasNodeId ? \"The\" : \"This\"\n\t\t\t\t\t\t\t} virtual node${\n\t\t\t\t\t\t\t\thasNodeId ? ` ${endpoint.nodeId}` : \"\"\n\t\t\t\t\t\t\t}`;\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tmessageStart = `Node ${endpoint.nodeId}`;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tthrow new ZWaveError(\n\t\t\t\t\t\t\t`${messageStart}${\n\t\t\t\t\t\t\t\tendpoint.index === 0\n\t\t\t\t\t\t\t\t\t? \"\"\n\t\t\t\t\t\t\t\t\t: ` (endpoint ${endpoint.index})`\n\t\t\t\t\t\t\t} does not support the Command Class ${ccName}!`,\n\t\t\t\t\t\t\tZWaveErrorCodes.CC_NotSupported,\n\t\t\t\t\t\t);\n\t\t\t\t\t}\n\n\t\t\t\t\t// If a device config defines overrides for an API call, return a wrapper method that applies them first before calling the actual method\n\t\t\t\t\tconst fallback = target[property as keyof CCAPI];\n\t\t\t\t\tif (\n\t\t\t\t\t\ttypeof property === \"string\"\n\t\t\t\t\t\t&& !endpoint.virtual\n\t\t\t\t\t\t&& typeof fallback === \"function\"\n\t\t\t\t\t) {\n\t\t\t\t\t\tconst overrides = host.getDeviceConfig?.(\n\t\t\t\t\t\t\tendpoint.nodeId,\n\t\t\t\t\t\t)?.compat?.overrideQueries;\n\t\t\t\t\t\tif (overrides?.hasOverride(ccId)) {\n\t\t\t\t\t\t\treturn overrideQueriesWrapper(\n\t\t\t\t\t\t\t\thost,\n\t\t\t\t\t\t\t\tendpoint,\n\t\t\t\t\t\t\t\tccId,\n\t\t\t\t\t\t\t\tproperty,\n\t\t\t\t\t\t\t\toverrides,\n\t\t\t\t\t\t\t\tfallback,\n\t\t\t\t\t\t\t);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\n\t\t\t\t\t// Else just access the property\n\t\t\t\t\treturn fallback;\n\t\t\t\t},\n\t\t\t});\n\t\t} else {\n\t\t\t// @ts-expect-error TS doesn't like assigning to conditional types\n\t\t\treturn apiInstance;\n\t\t}\n\t}\n\n\t/**\n\t * The identifier of the Command Class this API is for\n\t */\n\tpublic readonly ccId: CommandClasses;\n\n\tprotected get [SET_VALUE](): SetValueImplementation | undefined {\n\t\treturn undefined;\n\t}\n\n\t/**\n\t * Can be used on supported CC APIs to set a CC value by property name (and optionally the property key).\n\t * **WARNING:** This function is NOT bound to an API instance. It must be called with the correct `this` context!\n\t */\n\tpublic get setValue(): SetValueImplementation | undefined {\n\t\treturn this[SET_VALUE];\n\t}\n\n\tprotected [SET_VALUE_HOOKS]: SetValueImplementationHooksFactory | undefined;\n\t/**\n\t * Can be implemented by CC APIs to influence the behavior of the setValue API in regards to Supervision and verifying values.\n\t */\n\tpublic get setValueHooks(): SetValueImplementationHooksFactory | undefined {\n\t\treturn this[SET_VALUE_HOOKS];\n\t}\n\n\t/** Whether a successful setValue call should imply that the value was successfully updated */\n\t// oxlint-disable-next-line no-unused-vars\n\tpublic isSetValueOptimistic(valueId: ValueID): boolean {\n\t\treturn true;\n\t}\n\n\tprotected get [POLL_VALUE](): PollValueImplementation | undefined {\n\t\treturn undefined;\n\t}\n\t/**\n\t * Can be used on supported CC APIs to poll a CC value by property name (and optionally the property key)\n\t * **WARNING:** This function is NOT bound to an API instance. It must be called with the correct `this` context!\n\t */\n\tpublic get pollValue(): PollValueImplementation | undefined {\n\t\treturn this[POLL_VALUE];\n\t}\n\n\t/**\n\t * Schedules a value to be polled after a given time. Schedules are deduplicated on a per-property basis.\n\t * @returns `true` if the poll was scheduled, `false` otherwise\n\t */\n\tprotected schedulePoll(\n\t\t{ property, propertyKey }: ValueIDProperties,\n\t\texpectedValue: unknown,\n\t\t{ duration, transition = \"slow\" }: CCAPISchedulePollOptions = {},\n\t): boolean {\n\t\t// Figure out the delay. If a non-zero duration was given or this is a \"fast\" transition,\n\t\t// use/add the short delay. Otherwise, default to the long delay.\n\t\tconst durationMs = duration?.toMilliseconds() ?? 0;\n\t\tconst timeouts = this.host.getRefreshValueTimeouts();\n\t\tconst additionalDelay = !!durationMs || transition === \"fast\"\n\t\t\t? timeouts.refreshValueAfterTransition\n\t\t\t: timeouts.refreshValue;\n\t\tconst timeoutMs = durationMs + additionalDelay;\n\n\t\tif (this.isSinglecast()) {\n\t\t\tconst node = this.host.getNode(this.endpoint.nodeId);\n\t\t\tif (!node) return false;\n\n\t\t\treturn this.host.schedulePoll(\n\t\t\t\tnode.id,\n\t\t\t\t{\n\t\t\t\t\tcommandClass: this.ccId,\n\t\t\t\t\tendpoint: this.endpoint.index,\n\t\t\t\t\tproperty,\n\t\t\t\t\tpropertyKey,\n\t\t\t\t},\n\t\t\t\t{ timeoutMs, expectedValue },\n\t\t\t);\n\t\t} else if (this.isMulticast()) {\n\t\t\t// Only poll supporting nodes in multicast\n\t\t\tconst supportingNodes = this.endpoint.node.physicalNodes.filter(\n\t\t\t\t(node) =>\n\t\t\t\t\tnode\n\t\t\t\t\t\t.getEndpoint(this.endpoint.index)\n\t\t\t\t\t\t?.supportsCC(this.ccId),\n\t\t\t);\n\t\t\tlet ret = false;\n\t\t\tfor (const node of supportingNodes) {\n\t\t\t\tret ||= this.host.schedulePoll(\n\t\t\t\t\tnode.id,\n\t\t\t\t\t{\n\t\t\t\t\t\tcommandClass: this.ccId,\n\t\t\t\t\t\tendpoint: this.endpoint.index,\n\t\t\t\t\t\tproperty,\n\t\t\t\t\t\tpropertyKey,\n\t\t\t\t\t},\n\t\t\t\t\t{ timeoutMs, expectedValue },\n\t\t\t\t);\n\t\t\t}\n\t\t\treturn ret;\n\t\t} else {\n\t\t\t// Don't poll the broadcast node\n\t\t\treturn false;\n\t\t}\n\t}\n\n\t/**\n\t * Retrieves the version of the given CommandClass this endpoint implements\n\t */\n\tpublic get version(): number {\n\t\tif (this.isSinglecast()) {\n\t\t\treturn this.host.getSafeCCVersion(\n\t\t\t\tthis.ccId,\n\t\t\t\tthis.endpoint.nodeId,\n\t\t\t\tthis.endpoint.index,\n\t\t\t) ?? 0;\n\t\t} else {\n\t\t\treturn getImplementedVersion(this.ccId);\n\t\t}\n\t}\n\n\t/** Determines if this simplified API instance may be used. */\n\tpublic isSupported(): boolean {\n\t\treturn (\n\t\t\t// NoOperation is always supported\n\t\t\tthis.ccId === CommandClasses[\"No Operation\"]\n\t\t\t// Basic should always be supported. Since we are trying to hide it from library consumers\n\t\t\t// we cannot trust supportsCC to test it\n\t\t\t|| this.ccId === CommandClasses.Basic\n\t\t\t|| this.endpoint.supportsCC(this.ccId)\n\t\t);\n\t}\n\n\t/**\n\t * Determine whether the linked node supports a specific command of this command class.\n\t * {@link NOT_KNOWN} (`undefined`) means that the information has not been received yet\n\t */\n\t// oxlint-disable-next-line no-unused-vars\n\tpublic supportsCommand(command: number): MaybeNotKnown<boolean> {\n\t\t// This needs to be overwritten per command class. In the default implementation, we don't know anything!\n\t\treturn NOT_KNOWN;\n\t}\n\n\tprotected assertSupportsCommand(\n\t\tcommandEnum: unknown,\n\t\tcommand: number,\n\t): void {\n\t\tif (this.supportsCommand(command) !== true) {\n\t\t\tthrow new ZWaveError(\n\t\t\t\t`${\n\t\t\t\t\tthis.isSinglecast()\n\t\t\t\t\t\t? `Node #${this.endpoint.nodeId}`\n\t\t\t\t\t\t: \"This virtual node\"\n\t\t\t\t}${\n\t\t\t\t\tthis.endpoint.index > 0\n\t\t\t\t\t\t? ` (Endpoint ${this.endpoint.index})`\n\t\t\t\t\t\t: \"\"\n\t\t\t\t} does not support the command ${\n\t\t\t\t\tgetEnumMemberName(\n\t\t\t\t\t\tcommandEnum,\n\t\t\t\t\t\tcommand,\n\t\t\t\t\t)\n\t\t\t\t}!`,\n\t\t\t\tZWaveErrorCodes.CC_NotSupported,\n\t\t\t);\n\t\t}\n\t}\n\n\tprotected assertPhysicalEndpoint(\n\t\tendpoint: EndpointId | VirtualEndpointId,\n\t): asserts endpoint is EndpointId {\n\t\tif (endpoint.virtual) {\n\t\t\tthrow new ZWaveError(\n\t\t\t\t`This method is not supported for virtual nodes!`,\n\t\t\t\tZWaveErrorCodes.CC_NotSupported,\n\t\t\t);\n\t\t}\n\t}\n\n\t/** Returns the command options to use for sendCommand calls */\n\tprotected get commandOptions(): SendCommandOptions {\n\t\t// No default options\n\t\treturn {};\n\t}\n\n\t/** Creates an instance of this API, scoped to use the given options */\n\tpublic withOptions(options: SendCommandOptions): this {\n\t\tconst mergedOptions = {\n\t\t\t...this.commandOptions,\n\t\t\t...options,\n\t\t};\n\t\treturn new Proxy(this, {\n\t\t\tget: (target, property) => {\n\t\t\t\tif (property === \"commandOptions\") {\n\t\t\t\t\treturn mergedOptions;\n\t\t\t\t} else {\n\t\t\t\t\treturn (target as any)[property];\n\t\t\t\t}\n\t\t\t},\n\t\t});\n\t}\n\n\t/** Creates an instance of this API which (if supported) will return TX reports along with the result. */\n\tpublic withTXReport<T extends this>(): WithTXReport<T> {\n\t\tif (this.constructor === CCAPI) {\n\t\t\tthrow new ZWaveError(\n\t\t\t\t\"The withTXReport method may only be called on specific CC API implementations.\",\n\t\t\t\tZWaveErrorCodes.Driver_NotSupported,\n\t\t\t);\n\t\t}\n\n\t\t// Remember which properties need to be proxied\n\t\tconst proxiedProps = new Set([\n\t\t\t// These are the CC-specific methods\n\t\t\t...Object.getOwnPropertyNames(this.constructor.prototype),\n\t\t\t// as well as setValue and pollValue\n\t\t\t\"setValue\",\n\t\t\t\"pollValue\",\n\t\t]);\n\t\tproxiedProps.delete(\"constructor\");\n\n\t\tfunction wrapResult<T>(result: T, txReport: TXReport): any {\n\t\t\t// Both the result and the TX report may be undefined (no response, no support)\n\t\t\treturn stripUndefined({\n\t\t\t\tresult,\n\t\t\t\ttxReport,\n\t\t\t});\n\t\t}\n\n\t\treturn new Proxy(this, {\n\t\t\tget: (target, prop) => {\n\t\t\t\tif (prop === \"withTXReport\") return undefined;\n\n\t\t\t\tlet original: any = (target as any)[prop];\n\t\t\t\tif (\n\t\t\t\t\tproxiedProps.has(prop as string)\n\t\t\t\t\t&& typeof original === \"function\"\n\t\t\t\t) {\n\t\t\t\t\t// This is a method that only exists in the specific implementation\n\n\t\t\t\t\t// Wrap each call with its own API proxy, so we don't mix up TX reports\n\t\t\t\t\tlet txReport: TXReport;\n\t\t\t\t\tconst api = target.withOptions({\n\t\t\t\t\t\tonTXReport: (report) => {\n\t\t\t\t\t\t\t// Remember the last status report\n\t\t\t\t\t\t\ttxReport = report;\n\t\t\t\t\t\t},\n\t\t\t\t\t});\n\t\t\t\t\toriginal = (api as any)[prop].bind(api);\n\n\t\t\t\t\t// Return a wrapper function that will add the status report after the call is complete\n\t\t\t\t\treturn (...args: any) => {\n\t\t\t\t\t\tlet result = original(...args);\n\t\t\t\t\t\tif (result instanceof Promise) {\n\t\t\t\t\t\t\tresult = result.then((res) =>\n\t\t\t\t\t\t\t\twrapResult(res, txReport)\n\t\t\t\t\t\t\t);\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tresult = wrapResult(result, txReport);\n\t\t\t\t\t\t}\n\t\t\t\t\t\treturn result;\n\t\t\t\t\t};\n\t\t\t\t} else {\n\t\t\t\t\treturn original;\n\t\t\t\t}\n\t\t\t},\n\t\t}) as any;\n\t}\n\n\tprotected isSinglecast(): this is this & {\n\t\tendpoint: PhysicalCCAPIEndpoint;\n\t} {\n\t\treturn (\n\t\t\t!this.endpoint.virtual\n\t\t\t&& typeof this.endpoint.nodeId === \"number\"\n\t\t\t&& this.endpoint.nodeId !== NODE_ID_BROADCAST\n\t\t\t&& this.endpoint.nodeId !== NODE_ID_BROADCAST_LR\n\t\t);\n\t}\n\n\tprotected isMulticast(): this is this & {\n\t\tendpoint: VirtualCCAPIEndpoint & {\n\t\t\tnodeId: number[];\n\t\t};\n\t} {\n\t\treturn this.endpoint.virtual && isArray(this.endpoint.nodeId);\n\t}\n\n\tprotected isBroadcast(): this is this & {\n\t\tendpoint: VirtualCCAPIEndpoint & {\n\t\t\tnodeId: typeof NODE_ID_BROADCAST | typeof NODE_ID_BROADCAST_LR;\n\t\t};\n\t} {\n\t\treturn (\n\t\t\tthis.endpoint.virtual\n\t\t\t&& (this.endpoint.nodeId === NODE_ID_BROADCAST\n\t\t\t\t|| this.endpoint.nodeId === NODE_ID_BROADCAST_LR)\n\t\t);\n\t}\n\n\t/** Returns the value DB for this CC API's node (if it can be safely accessed) */\n\tprotected tryGetValueDB(): ValueDB | undefined {\n\t\tif (!this.isSinglecast()) return;\n\t\ttry {\n\t\t\treturn this.host.getValueDB(this.endpoint.nodeId);\n\t\t} catch {\n\t\t\treturn;\n\t\t}\n\t}\n\n\t/** Returns the value DB for this CC's node (or throws if it cannot be accessed) */\n\tprotected getValueDB(): ValueDB {\n\t\tif (this.isSinglecast()) {\n\t\t\ttry {\n\t\t\t\treturn this.host.getValueDB(this.endpoint.nodeId);\n\t\t\t} catch {\n\t\t\t\tthrow new ZWaveError(\n\t\t\t\t\t\"The node for this CC does not exist or the driver is not ready yet\",\n\t\t\t\t\tZWaveErrorCodes.Driver_NotReady,\n\t\t\t\t);\n\t\t\t}\n\t\t}\n\t\tthrow new ZWaveError(\n\t\t\t\"Cannot retrieve the value DB for non-singlecast CCs\",\n\t\t\tZWaveErrorCodes.CC_NoNodeID,\n\t\t);\n\t}\n}\n\nfunction overrideQueriesWrapper(\n\tctx: GetValueDB & LogNode,\n\tendpoint: PhysicalCCAPIEndpoint,\n\tccId: CommandClasses,\n\tmethod: string,\n\toverrides: CompatOverrideQueries,\n\tfallback: (...args: any[]) => any,\n): (...args: any[]) => any {\n\t// We must not capture the `this` context here, because the API methods are bound on use\n\treturn function(this: any, ...args: any[]) {\n\t\tconst match = overrides.matchOverride(\n\t\t\tccId,\n\t\t\tendpoint.index,\n\t\t\tmethod,\n\t\t\targs,\n\t\t);\n\t\tif (!match) return fallback.call(this, ...args);\n\n\t\tctx.logNode(endpoint.nodeId, {\n\t\t\tmessage: `API call ${method} for ${\n\t\t\t\tgetCCName(\n\t\t\t\t\tccId,\n\t\t\t\t)\n\t\t\t} CC overridden by a compat flag.`,\n\t\t\tlevel: \"debug\",\n\t\t\tdirection: \"none\",\n\t\t});\n\n\t\tconst ccValues = getCCValues(ccId);\n\t\tif (ccValues) {\n\t\t\tconst valueDB = ctx.getValueDB(endpoint.nodeId);\n\n\t\t\tconst prop2value = (prop: string): CCValue | undefined => {\n\t\t\t\t// We use a simplistic parser to support dynamic value IDs:\n\t\t\t\t// If end with round brackets with something inside, they are considered dynamic\n\t\t\t\t// Otherwise static\n\t\t\t\tconst argsMatch = prop.match(/^(.*)\\((.*)\\)$/);\n\t\t\t\tif (argsMatch) {\n\t\t\t\t\tconst methodName = argsMatch[1];\n\t\t\t\t\tconst methodArgs = JSON.parse(`[${argsMatch[2]}]`);\n\n\t\t\t\t\tconst dynValue = ccValues[methodName];\n\t\t\t\t\tif (typeof dynValue === \"function\") {\n\t\t\t\t\t\treturn dynValue(...methodArgs);\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\tconst staticValue = ccValues[prop] as\n\t\t\t\t\t\t| StaticCCValue\n\t\t\t\t\t\t| undefined;\n\t\t\t\t\tif (typeof staticValue?.endpoint === \"function\") {\n\t\t\t\t\t\treturn staticValue;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t};\n\n\t\t\t// Persist values if necessary\n\t\t\tif (match.persistValues) {\n\t\t\t\tfor (\n\t\t\t\t\tconst [prop, value] of Object.entries(\n\t\t\t\t\t\tmatch.persistValues,\n\t\t\t\t\t)\n\t\t\t\t) {\n\t\t\t\t\ttry {\n\t\t\t\t\t\tconst ccValue = prop2value(prop);\n\t\t\t\t\t\tif (ccValue) {\n\t\t\t\t\t\t\tvalueDB.setValue(\n\t\t\t\t\t\t\t\tccValue.endpoint(endpoint.index),\n\t\t\t\t\t\t\t\tvalue,\n\t\t\t\t\t\t\t);\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tctx.logNode(endpoint.nodeId, {\n\t\t\t\t\t\t\t\tmessage:\n\t\t\t\t\t\t\t\t\t`Failed to persist value ${prop} during overridden API call: value does not exist`,\n\t\t\t\t\t\t\t\tlevel: \"error\",\n\t\t\t\t\t\t\t\tdirection: \"none\",\n\t\t\t\t\t\t\t});\n\t\t\t\t\t\t}\n\t\t\t\t\t} catch (e) {\n\t\t\t\t\t\tctx.logNode(endpoint.nodeId, {\n\t\t\t\t\t\t\tmessage:\n\t\t\t\t\t\t\t\t`Failed to persist value ${prop} during overridden API call: ${\n\t\t\t\t\t\t\t\t\tgetErrorMessage(\n\t\t\t\t\t\t\t\t\t\te,\n\t\t\t\t\t\t\t\t\t)\n\t\t\t\t\t\t\t\t}`,\n\t\t\t\t\t\t\tlevel: \"error\",\n\t\t\t\t\t\t\tdirection: \"none\",\n\t\t\t\t\t\t});\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// As well as metadata\n\t\t\tif (match.extendMetadata) {\n\t\t\t\tfor (\n\t\t\t\t\tconst [prop, meta] of Object.entries(\n\t\t\t\t\t\tmatch.extendMetadata,\n\t\t\t\t\t)\n\t\t\t\t) {\n\t\t\t\t\ttry {\n\t\t\t\t\t\tconst ccValue = prop2value(prop);\n\t\t\t\t\t\tif (ccValue) {\n\t\t\t\t\t\t\tvalueDB.setMetadata(\n\t\t\t\t\t\t\t\tccValue.endpoint(endpoint.index),\n\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t...ccValue.meta,\n\t\t\t\t\t\t\t\t\t...meta,\n\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t);\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tctx.logNode(endpoint.nodeId, {\n\t\t\t\t\t\t\t\tmessage:\n\t\t\t\t\t\t\t\t\t`Failed to extend value metadata ${prop} during overridden API call: value does not exist`,\n\t\t\t\t\t\t\t\tlevel: \"error\",\n\t\t\t\t\t\t\t\tdirection: \"none\",\n\t\t\t\t\t\t\t});\n\t\t\t\t\t\t}\n\t\t\t\t\t} catch (e) {\n\t\t\t\t\t\tctx.logNode(endpoint.nodeId, {\n\t\t\t\t\t\t\tmessage:\n\t\t\t\t\t\t\t\t`Failed to extend value metadata ${prop} during overridden API call: ${\n\t\t\t\t\t\t\t\t\tgetErrorMessage(\n\t\t\t\t\t\t\t\t\t\te,\n\t\t\t\t\t\t\t\t\t)\n\t\t\t\t\t\t\t\t}`,\n\t\t\t\t\t\t\tlevel: \"error\",\n\t\t\t\t\t\t\tdirection: \"none\",\n\t\t\t\t\t\t});\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t// API methods are always async\n\t\treturn Promise.resolve(match.result);\n\t};\n}\n\n/** A CC API that is only available for physical endpoints */\nexport class PhysicalCCAPI extends CCAPI {\n\tpublic constructor(\n\t\thost: CCAPIHost,\n\t\tendpoint: CCAPIEndpoint,\n\t) {\n\t\tsuper(host, endpoint);\n\t\tthis.assertPhysicalEndpoint(endpoint);\n\t}\n\n\tdeclare protected readonly endpoint: PhysicalCCAPIEndpoint;\n}\n\nexport type APIConstructor<T extends CCAPI = CCAPI> = new (\n\thost: CCAPIHost,\n\tendpoint: CCAPIEndpoint,\n) => T;\n\nexport type CCToName<CC extends CommandClasses> = {\n\t[K in keyof CCNameMap]: CCNameMap[K] extends CC ? K : never;\n}[keyof CCNameMap];\n\nexport type CCNameOrId = CommandClasses | Extract<keyof CCAPIs, string>;\n\nexport type CCToAPI<CC extends CCNameOrId> = CC extends CommandClasses\n\t? CCToName<CC> extends keyof CCAPIs ? CCAPIs[CCToName<CC>]\n\t: never\n\t: CC extends keyof CCAPIs ? CCAPIs[CC]\n\t: never;\n\nexport type APIMethodsOf<CC extends CCNameOrId> = Omit<\n\tOnlyMethods<CCToAPI<CC>>,\n\t| \"ccId\"\n\t| \"getNode\"\n\t| \"tryGetNode\"\n\t| \"isSetValueOptimistic\"\n\t| \"isSupported\"\n\t| \"pollValue\"\n\t| \"setValue\"\n\t| \"version\"\n\t| \"supportsCommand\"\n\t| \"withOptions\"\n\t| \"withTXReport\"\n>;\n\nexport type OwnMethodsOf<API extends CCAPI> = Omit<\n\tOnlyMethods<API>,\n\tkeyof OnlyMethods<CCAPI>\n>;\n\n// Wraps the given type in an object that contains a TX report\nexport type WrapWithTXReport<T> = [T] extends [Promise<infer U>]\n\t? Promise<WrapWithTXReport<U>>\n\t: [T] extends [void] ? { txReport: TXReport | undefined }\n\t: { result: T; txReport: TXReport | undefined };\n\nexport type ReturnWithTXReport<T> = T extends (...args: any[]) => any\n\t? (...args: Parameters<T>) => WrapWithTXReport<ReturnType<T>>\n\t: undefined;\n\n// Converts the type of the given API implementation so the API methods return an object including the TX report\nexport type WithTXReport<API extends CCAPI> =\n\t& Omit<\n\t\tAPI,\n\t\tkeyof OwnMethodsOf<API> | \"withOptions\" | \"withTXReport\" | \"setValue\"\n\t>\n\t& {\n\t\t[\n\t\t\tK in\n\t\t\t\t| keyof OwnMethodsOf<API>\n\t\t\t\t| \"setValue\"\n\t\t\t\t| \"pollValue\"\n\t\t]: ReturnWithTXReport<API[K]>;\n\t};\n\nexport function normalizeCCNameOrId(\n\tccNameOrId: number | string,\n): CommandClasses | undefined {\n\tif (!(ccNameOrId in CommandClasses)) return undefined;\n\n\tlet ret: CommandClasses | undefined;\n\tif (typeof ccNameOrId === \"string\") {\n\t\tif (/^\\d+$/.test(ccNameOrId)) {\n\t\t\t// This can happen on property access\n\t\t\tret = +ccNameOrId;\n\t\t} else if (typeof (CommandClasses as any)[ccNameOrId] === \"number\") {\n\t\t\tret = (CommandClasses as any)[ccNameOrId];\n\t\t}\n\t} else {\n\t\tret = ccNameOrId;\n\t}\n\n\treturn ret;\n}\n"],
|
|
5
|
-
"mappings": ";;;;;;;;;;;;;;;;;;;AACA;;;;;;;;;;;;;;AAAA,kBAkCO;AACP,oBAMO;AACP,wBAAwB;AACxB,oCAKO;AAgBA,MAAM,YAA2B,OAAO,IAAI,iBAAiB;AAQ7D,MAAM,kBAAiC,OAAO,IACpD,uBAAuB;
|
|
4
|
+
"sourcesContent": ["import type { CompatOverrideQueries, GetDeviceConfig } from \"@zwave-js/config\";\nimport {\n\tCommandClasses,\n\ttype ControlsCC,\n\ttype Duration,\n\ttype EndpointId,\n\ttype GetEndpoint,\n\ttype GetNode,\n\ttype GetSafeCCVersion,\n\ttype GetSupportedCCVersion,\n\ttype GetValueDB,\n\ttype HostIDs,\n\ttype ListenBehavior,\n\ttype LogNode,\n\ttype MaybeNotKnown,\n\tNODE_ID_BROADCAST,\n\tNODE_ID_BROADCAST_LR,\n\tNOT_KNOWN,\n\ttype NodeId,\n\ttype PhysicalNodes,\n\ttype QueryNodeInterviewStage,\n\ttype QueryNodeStatus,\n\ttype SecurityManagers,\n\ttype SendCommandOptions,\n\ttype SupervisionResult,\n\ttype SupportsCC,\n\ttype TXReport,\n\ttype ValueChangeOptions,\n\ttype ValueDB,\n\ttype ValueID,\n\ttype VirtualEndpointId,\n\tZWaveError,\n\tZWaveErrorCodes,\n\tgetCCName,\n\tstripUndefined,\n} from \"@zwave-js/core\";\nimport {\n\ttype AllOrNone,\n\ttype OnlyMethods,\n\tgetEnumMemberName,\n\tgetErrorMessage,\n\tnum2hex,\n} from \"@zwave-js/shared\";\nimport { isArray } from \"alcalzone-shared/typeguards\";\nimport {\n\tgetAPI,\n\tgetCCValues,\n\tgetCommandClass,\n\tgetImplementedVersion,\n} from \"./CommandClassDecorators.js\";\nimport type { CCValue, StaticCCValue } from \"./Values.js\";\nimport type { SendCommand } from \"./traits.js\";\nimport type {\n\tGetRefreshValueTimeouts,\n\tGetUserPreferences,\n\tSchedulePoll,\n} from \"./traits.js\";\n\n// Import and re-export generated types\nimport type { CCAPIs, CCNameMap } from \"./_CCAPI.generated.js\";\nexport type { CCAPIs, CCNameMap };\n\nexport type ValueIDProperties = Pick<ValueID, \"property\" | \"propertyKey\">;\n\n/** Used to identify the method on the CC API class that handles setting values on nodes directly */\nexport const SET_VALUE: unique symbol = Symbol.for(\"CCAPI_SET_VALUE\");\n\nexport type SetValueImplementation = (\n\tproperty: ValueIDProperties,\n\tvalue: unknown,\n\toptions?: SetValueAPIOptions,\n) => Promise<SupervisionResult | undefined>;\n\nexport const SET_VALUE_HOOKS: unique symbol = Symbol.for(\n\t\"CCAPI_SET_VALUE_HOOKS\",\n);\n\nexport type SetValueImplementationHooks =\n\t& AllOrNone<{\n\t\t// Opt-in to and handle delayed supervision updates\n\t\tsupervisionDelayedUpdates: boolean;\n\t\tsupervisionOnSuccess: () => void | Promise<void>;\n\t\tsupervisionOnFailure: () => void | Promise<void>;\n\t}>\n\t& {\n\t\t// Whether the value is a target value for a CC using split\n\t\t// target/current values. If so, the value will be updated optimistically,\n\t\t// even if the device class does not support optimistic updates.\n\t\tisSplitStateTargetValue?: boolean;\n\t\t// Optimistically update related cached values (if allowed)\n\t\toptimisticallyUpdateRelatedValues?: (\n\t\t\tsupervisedAndSuccessful: boolean,\n\t\t) => void;\n\t\t// Check if a verification of the set value is required, even if the API response suggests otherwise\n\t\tforceVerifyChanges?: () => boolean;\n\t\t// Verify the changes\n\t\tverifyChanges?: (result?: SupervisionResult) => void | Promise<void>;\n\t};\n\nexport type SetValueImplementationHooksFactory = (\n\tproperty: ValueIDProperties,\n\tvalue: unknown,\n\toptions?: SetValueAPIOptions,\n) => SetValueImplementationHooks | undefined;\n\n/**\n * A generic options bag for the `setValue` API.\n * Each implementation will choose the options that are relevant for it, so you can use the same options everywhere.\n * @publicAPI\n */\nexport type SetValueAPIOptions =\n\t& Partial<ValueChangeOptions>\n\t& Pick<SendCommandOptions, \"onProgress\">;\n\n/** Used to identify the method on the CC API class that handles polling values from nodes */\nexport const POLL_VALUE: unique symbol = Symbol.for(\"CCAPI_POLL_VALUE\");\nexport type PollValueImplementation<T = unknown> = (\n\tproperty: ValueIDProperties,\n) => Promise<T | undefined>;\n\n// Since the setValue API is called from a point with very generic parameters,\n// we must do narrowing inside the API calls. These three methods are for convenience\nexport function throwUnsupportedProperty(\n\tcc: CommandClasses,\n\tproperty: string | number,\n): never {\n\tthrow new ZWaveError(\n\t\t`${CommandClasses[cc]}: \"${property}\" is not a supported property`,\n\t\tZWaveErrorCodes.Argument_Invalid,\n\t);\n}\n\nexport function throwUnsupportedPropertyKey(\n\tcc: CommandClasses,\n\tproperty: string | number,\n\tpropertyKey: string | number,\n): never {\n\tthrow new ZWaveError(\n\t\t`${\n\t\t\tCommandClasses[cc]\n\t\t}: \"${propertyKey}\" is not a supported property key for property \"${property}\"`,\n\t\tZWaveErrorCodes.Argument_Invalid,\n\t);\n}\n\nexport function throwMissingPropertyKey(\n\tcc: CommandClasses,\n\tproperty: string | number,\n): never {\n\tthrow new ZWaveError(\n\t\t`${\n\t\t\tCommandClasses[cc]\n\t\t}: property \"${property}\" requires a property key, but none was given`,\n\t\tZWaveErrorCodes.Argument_Invalid,\n\t);\n}\n\nexport function throwWrongValueType(\n\tcc: CommandClasses,\n\tproperty: string | number,\n\texpectedType: string,\n\treceivedType: string,\n): never {\n\tthrow new ZWaveError(\n\t\t`${\n\t\t\tCommandClasses[cc]\n\t\t}: \"${property}\" must be of type \"${expectedType}\", received \"${receivedType}\"`,\n\t\tZWaveErrorCodes.Argument_Invalid,\n\t);\n}\n\nexport interface CCAPISchedulePollOptions {\n\tduration?: Duration;\n\ttransition?: \"fast\" | \"slow\";\n}\n\n// Defines the necessary traits the host passed to a CC API must have\nexport type CCAPIHost<TNode extends CCAPINode = CCAPINode> =\n\t& HostIDs\n\t& GetNode<TNode>\n\t& GetValueDB\n\t& GetSupportedCCVersion\n\t& GetSafeCCVersion\n\t& SecurityManagers\n\t& GetDeviceConfig\n\t& SendCommand\n\t& GetRefreshValueTimeouts\n\t& GetUserPreferences\n\t& SchedulePoll\n\t& LogNode;\n\n// Defines the necessary traits a node passed to a CC API must have\nexport type CCAPINode =\n\t& NodeId\n\t& ListenBehavior\n\t& QueryNodeStatus\n\t& QueryNodeInterviewStage;\n\n// Defines the necessary traits an endpoint passed to a CC API must have\nexport type CCAPIEndpoint =\n\t& (\n\t\t| (\n\t\t\t// Physical endpoints must let us query their controlled CCs\n\t\t\tEndpointId & ControlsCC\n\t\t)\n\t\t| (\n\t\t\t// Virtual endpoints must let us query their physical nodes,\n\t\t\t// the CCs those nodes implement, and access the endpoints of those\n\t\t\t// physical nodes\n\t\t\tVirtualEndpointId & {\n\t\t\t\tnode: PhysicalNodes<\n\t\t\t\t\t& NodeId\n\t\t\t\t\t& SupportsCC\n\t\t\t\t\t& ControlsCC\n\t\t\t\t\t& GetEndpoint<EndpointId & SupportsCC & ControlsCC>\n\t\t\t\t>;\n\t\t\t}\n\t\t)\n\t)\n\t& SupportsCC;\n\nexport type PhysicalCCAPIEndpoint = CCAPIEndpoint & EndpointId;\nexport type VirtualCCAPIEndpoint = CCAPIEndpoint & VirtualEndpointId;\n\n/**\n * The base class for all CC APIs exposed via `Node.commandClasses.<CCName>`\n * @publicAPI\n */\nexport class CCAPI {\n\tpublic constructor(\n\t\tprotected readonly host: CCAPIHost,\n\t\tprotected readonly endpoint: CCAPIEndpoint,\n\t) {\n\t\tthis.ccId = getCommandClass(this);\n\t}\n\n\tpublic static create<T extends CommandClasses>(\n\t\tccId: T,\n\t\thost: CCAPIHost,\n\t\tendpoint: CCAPIEndpoint,\n\t\trequireSupport?: boolean,\n\t): CommandClasses extends T ? CCAPI : CCToAPI<T> {\n\t\tconst APIConstructor = getAPI(ccId);\n\t\tconst ccName = CommandClasses[ccId];\n\t\tif (APIConstructor == undefined) {\n\t\t\tthrow new ZWaveError(\n\t\t\t\t`Command Class ${ccName} (${\n\t\t\t\t\tnum2hex(\n\t\t\t\t\t\tccId,\n\t\t\t\t\t)\n\t\t\t\t}) has no associated API!`,\n\t\t\t\tZWaveErrorCodes.CC_NoAPI,\n\t\t\t);\n\t\t}\n\t\tconst apiInstance = new APIConstructor(host, endpoint);\n\n\t\t// Only require support for physical endpoints by default\n\t\trequireSupport ??= !endpoint.virtual;\n\n\t\tif (requireSupport) {\n\t\t\t// @ts-expect-error TS doesn't like assigning to conditional types\n\t\t\treturn new Proxy(apiInstance, {\n\t\t\t\tget: (target, property) => {\n\t\t\t\t\t// Forbid access to the API if it is not supported by the node\n\t\t\t\t\tif (\n\t\t\t\t\t\tproperty !== \"ccId\"\n\t\t\t\t\t\t&& property !== \"endpoint\"\n\t\t\t\t\t\t&& property !== \"isSupported\"\n\t\t\t\t\t\t&& property !== \"withOptions\"\n\t\t\t\t\t\t&& property !== \"commandOptions\"\n\t\t\t\t\t\t&& !target.isSupported()\n\t\t\t\t\t) {\n\t\t\t\t\t\tlet messageStart: string;\n\t\t\t\t\t\tif (endpoint.virtual) {\n\t\t\t\t\t\t\tconst hasNodeId =\n\t\t\t\t\t\t\t\ttypeof endpoint.nodeId === \"number\"\n\t\t\t\t\t\t\t\t&& endpoint.nodeId !== NODE_ID_BROADCAST\n\t\t\t\t\t\t\t\t&& endpoint.nodeId !== NODE_ID_BROADCAST_LR;\n\t\t\t\t\t\t\tmessageStart = `${\n\t\t\t\t\t\t\t\thasNodeId ? \"The\" : \"This\"\n\t\t\t\t\t\t\t} virtual node${\n\t\t\t\t\t\t\t\thasNodeId ? ` ${endpoint.nodeId}` : \"\"\n\t\t\t\t\t\t\t}`;\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tmessageStart = `Node ${endpoint.nodeId}`;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tthrow new ZWaveError(\n\t\t\t\t\t\t\t`${messageStart}${\n\t\t\t\t\t\t\t\tendpoint.index === 0\n\t\t\t\t\t\t\t\t\t? \"\"\n\t\t\t\t\t\t\t\t\t: ` (endpoint ${endpoint.index})`\n\t\t\t\t\t\t\t} does not support the Command Class ${ccName}!`,\n\t\t\t\t\t\t\tZWaveErrorCodes.CC_NotSupported,\n\t\t\t\t\t\t);\n\t\t\t\t\t}\n\n\t\t\t\t\t// If a device config defines overrides for an API call, return a wrapper method that applies them first before calling the actual method\n\t\t\t\t\tconst fallback = target[property as keyof CCAPI];\n\t\t\t\t\tif (\n\t\t\t\t\t\ttypeof property === \"string\"\n\t\t\t\t\t\t&& !endpoint.virtual\n\t\t\t\t\t\t&& typeof fallback === \"function\"\n\t\t\t\t\t) {\n\t\t\t\t\t\tconst overrides = host.getDeviceConfig?.(\n\t\t\t\t\t\t\tendpoint.nodeId,\n\t\t\t\t\t\t)?.compat?.overrideQueries;\n\t\t\t\t\t\tif (overrides?.hasOverride(ccId)) {\n\t\t\t\t\t\t\treturn overrideQueriesWrapper(\n\t\t\t\t\t\t\t\thost,\n\t\t\t\t\t\t\t\tendpoint,\n\t\t\t\t\t\t\t\tccId,\n\t\t\t\t\t\t\t\tproperty,\n\t\t\t\t\t\t\t\toverrides,\n\t\t\t\t\t\t\t\tfallback,\n\t\t\t\t\t\t\t);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\n\t\t\t\t\t// Else just access the property\n\t\t\t\t\treturn fallback;\n\t\t\t\t},\n\t\t\t});\n\t\t} else {\n\t\t\t// @ts-expect-error TS doesn't like assigning to conditional types\n\t\t\treturn apiInstance;\n\t\t}\n\t}\n\n\t/**\n\t * The identifier of the Command Class this API is for\n\t */\n\tpublic readonly ccId: CommandClasses;\n\n\tprotected get [SET_VALUE](): SetValueImplementation | undefined {\n\t\treturn undefined;\n\t}\n\n\t/**\n\t * Can be used on supported CC APIs to set a CC value by property name (and optionally the property key).\n\t * **WARNING:** This function is NOT bound to an API instance. It must be called with the correct `this` context!\n\t */\n\tpublic get setValue(): SetValueImplementation | undefined {\n\t\treturn this[SET_VALUE];\n\t}\n\n\tprotected [SET_VALUE_HOOKS]: SetValueImplementationHooksFactory | undefined;\n\t/**\n\t * Can be implemented by CC APIs to influence the behavior of the setValue API in regards to Supervision and verifying values.\n\t */\n\tpublic get setValueHooks(): SetValueImplementationHooksFactory | undefined {\n\t\treturn this[SET_VALUE_HOOKS];\n\t}\n\n\t/** Whether a successful setValue call should imply that the value was successfully updated */\n\t// oxlint-disable-next-line no-unused-vars\n\tpublic isSetValueOptimistic(valueId: ValueID): boolean {\n\t\treturn true;\n\t}\n\n\tprotected get [POLL_VALUE](): PollValueImplementation | undefined {\n\t\treturn undefined;\n\t}\n\t/**\n\t * Can be used on supported CC APIs to poll a CC value by property name (and optionally the property key)\n\t * **WARNING:** This function is NOT bound to an API instance. It must be called with the correct `this` context!\n\t */\n\tpublic get pollValue(): PollValueImplementation | undefined {\n\t\treturn this[POLL_VALUE];\n\t}\n\n\t/**\n\t * Schedules a value to be polled after a given time. Schedules are deduplicated on a per-property basis.\n\t * @returns `true` if the poll was scheduled, `false` otherwise\n\t */\n\tprotected schedulePoll(\n\t\t{ property, propertyKey }: ValueIDProperties,\n\t\texpectedValue: unknown,\n\t\t{ duration, transition = \"slow\" }: CCAPISchedulePollOptions = {},\n\t): boolean {\n\t\t// Figure out the delay. If a non-zero duration was given or this is a \"fast\" transition,\n\t\t// use/add the short delay. Otherwise, default to the long delay.\n\t\tconst durationMs = duration?.toMilliseconds() ?? 0;\n\t\tconst timeouts = this.host.getRefreshValueTimeouts();\n\t\tconst additionalDelay = !!durationMs || transition === \"fast\"\n\t\t\t? timeouts.refreshValueAfterTransition\n\t\t\t: timeouts.refreshValue;\n\t\tconst timeoutMs = durationMs + additionalDelay;\n\n\t\tif (this.isSinglecast()) {\n\t\t\tconst node = this.host.getNode(this.endpoint.nodeId);\n\t\t\tif (!node) return false;\n\n\t\t\treturn this.host.schedulePoll(\n\t\t\t\tnode.id,\n\t\t\t\t{\n\t\t\t\t\tcommandClass: this.ccId,\n\t\t\t\t\tendpoint: this.endpoint.index,\n\t\t\t\t\tproperty,\n\t\t\t\t\tpropertyKey,\n\t\t\t\t},\n\t\t\t\t{ timeoutMs, expectedValue },\n\t\t\t);\n\t\t} else if (this.isMulticast()) {\n\t\t\t// Only poll supporting nodes in multicast\n\t\t\tconst supportingNodes = this.endpoint.node.physicalNodes.filter(\n\t\t\t\t(node) =>\n\t\t\t\t\tnode\n\t\t\t\t\t\t.getEndpoint(this.endpoint.index)\n\t\t\t\t\t\t?.supportsCC(this.ccId),\n\t\t\t);\n\t\t\tlet ret = false;\n\t\t\tfor (const node of supportingNodes) {\n\t\t\t\tret ||= this.host.schedulePoll(\n\t\t\t\t\tnode.id,\n\t\t\t\t\t{\n\t\t\t\t\t\tcommandClass: this.ccId,\n\t\t\t\t\t\tendpoint: this.endpoint.index,\n\t\t\t\t\t\tproperty,\n\t\t\t\t\t\tpropertyKey,\n\t\t\t\t\t},\n\t\t\t\t\t{ timeoutMs, expectedValue },\n\t\t\t\t);\n\t\t\t}\n\t\t\treturn ret;\n\t\t} else {\n\t\t\t// Don't poll the broadcast node\n\t\t\treturn false;\n\t\t}\n\t}\n\n\t/**\n\t * Retrieves the version of the given CommandClass this endpoint implements\n\t */\n\tpublic get version(): number {\n\t\tif (this.isSinglecast()) {\n\t\t\treturn this.host.getSafeCCVersion(\n\t\t\t\tthis.ccId,\n\t\t\t\tthis.endpoint.nodeId,\n\t\t\t\tthis.endpoint.index,\n\t\t\t) ?? 0;\n\t\t} else {\n\t\t\treturn getImplementedVersion(this.ccId);\n\t\t}\n\t}\n\n\t/** Determines if this simplified API instance may be used. */\n\tpublic isSupported(): boolean {\n\t\treturn (\n\t\t\t// NoOperation is always supported\n\t\t\tthis.ccId === CommandClasses[\"No Operation\"]\n\t\t\t// Basic should always be supported. Since we are trying to hide it from library consumers\n\t\t\t// we cannot trust supportsCC to test it\n\t\t\t|| this.ccId === CommandClasses.Basic\n\t\t\t|| this.endpoint.supportsCC(this.ccId)\n\t\t);\n\t}\n\n\t/**\n\t * Determine whether the linked node supports a specific command of this command class.\n\t * {@link NOT_KNOWN} (`undefined`) means that the information has not been received yet\n\t */\n\t// oxlint-disable-next-line no-unused-vars\n\tpublic supportsCommand(command: number): MaybeNotKnown<boolean> {\n\t\t// This needs to be overwritten per command class. In the default implementation, we don't know anything!\n\t\treturn NOT_KNOWN;\n\t}\n\n\tprotected assertSupportsCommand(\n\t\tcommandEnum: unknown,\n\t\tcommand: number,\n\t): void {\n\t\tif (this.supportsCommand(command) !== true) {\n\t\t\tthrow new ZWaveError(\n\t\t\t\t`${\n\t\t\t\t\tthis.isSinglecast()\n\t\t\t\t\t\t? `Node #${this.endpoint.nodeId}`\n\t\t\t\t\t\t: \"This virtual node\"\n\t\t\t\t}${\n\t\t\t\t\tthis.endpoint.index > 0\n\t\t\t\t\t\t? ` (Endpoint ${this.endpoint.index})`\n\t\t\t\t\t\t: \"\"\n\t\t\t\t} does not support the command ${\n\t\t\t\t\tgetEnumMemberName(\n\t\t\t\t\t\tcommandEnum,\n\t\t\t\t\t\tcommand,\n\t\t\t\t\t)\n\t\t\t\t}!`,\n\t\t\t\tZWaveErrorCodes.CC_NotSupported,\n\t\t\t);\n\t\t}\n\t}\n\n\tprotected assertPhysicalEndpoint(\n\t\tendpoint: EndpointId | VirtualEndpointId,\n\t): asserts endpoint is EndpointId {\n\t\tif (endpoint.virtual) {\n\t\t\tthrow new ZWaveError(\n\t\t\t\t`This method is not supported for virtual nodes!`,\n\t\t\t\tZWaveErrorCodes.CC_NotSupported,\n\t\t\t);\n\t\t}\n\t}\n\n\t/** Returns the command options to use for sendCommand calls */\n\tprotected get commandOptions(): SendCommandOptions {\n\t\t// No default options\n\t\treturn {};\n\t}\n\n\t/** Creates an instance of this API, scoped to use the given options */\n\tpublic withOptions(options: SendCommandOptions): this {\n\t\tconst mergedOptions = {\n\t\t\t...this.commandOptions,\n\t\t\t...options,\n\t\t};\n\t\treturn new Proxy(this, {\n\t\t\tget: (target, property) => {\n\t\t\t\tif (property === \"commandOptions\") {\n\t\t\t\t\treturn mergedOptions;\n\t\t\t\t} else {\n\t\t\t\t\treturn (target as any)[property];\n\t\t\t\t}\n\t\t\t},\n\t\t});\n\t}\n\n\t/** Creates an instance of this API which (if supported) will return TX reports along with the result. */\n\tpublic withTXReport<T extends this>(): WithTXReport<T> {\n\t\tif (this.constructor === CCAPI) {\n\t\t\tthrow new ZWaveError(\n\t\t\t\t\"The withTXReport method may only be called on specific CC API implementations.\",\n\t\t\t\tZWaveErrorCodes.Driver_NotSupported,\n\t\t\t);\n\t\t}\n\n\t\t// Remember which properties need to be proxied\n\t\tconst proxiedProps = new Set([\n\t\t\t// These are the CC-specific methods\n\t\t\t...Object.getOwnPropertyNames(this.constructor.prototype),\n\t\t\t// as well as setValue and pollValue\n\t\t\t\"setValue\",\n\t\t\t\"pollValue\",\n\t\t]);\n\t\tproxiedProps.delete(\"constructor\");\n\n\t\tfunction wrapResult<T>(result: T, txReport: TXReport): any {\n\t\t\t// Both the result and the TX report may be undefined (no response, no support)\n\t\t\treturn stripUndefined({\n\t\t\t\tresult,\n\t\t\t\ttxReport,\n\t\t\t});\n\t\t}\n\n\t\treturn new Proxy(this, {\n\t\t\tget: (target, prop) => {\n\t\t\t\tif (prop === \"withTXReport\") return undefined;\n\n\t\t\t\tlet original: any = (target as any)[prop];\n\t\t\t\tif (\n\t\t\t\t\tproxiedProps.has(prop as string)\n\t\t\t\t\t&& typeof original === \"function\"\n\t\t\t\t) {\n\t\t\t\t\t// This is a method that only exists in the specific implementation\n\n\t\t\t\t\t// Wrap each call with its own API proxy, so we don't mix up TX reports\n\t\t\t\t\tlet txReport: TXReport;\n\t\t\t\t\tconst api = target.withOptions({\n\t\t\t\t\t\tonTXReport: (report) => {\n\t\t\t\t\t\t\t// Remember the last status report\n\t\t\t\t\t\t\ttxReport = report;\n\t\t\t\t\t\t},\n\t\t\t\t\t});\n\t\t\t\t\toriginal = (api as any)[prop].bind(api);\n\n\t\t\t\t\t// Return a wrapper function that will add the status report after the call is complete\n\t\t\t\t\treturn (...args: any) => {\n\t\t\t\t\t\tlet result = original(...args);\n\t\t\t\t\t\tif (result instanceof Promise) {\n\t\t\t\t\t\t\tresult = result.then((res) =>\n\t\t\t\t\t\t\t\twrapResult(res, txReport)\n\t\t\t\t\t\t\t);\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tresult = wrapResult(result, txReport);\n\t\t\t\t\t\t}\n\t\t\t\t\t\treturn result;\n\t\t\t\t\t};\n\t\t\t\t} else {\n\t\t\t\t\treturn original;\n\t\t\t\t}\n\t\t\t},\n\t\t}) as any;\n\t}\n\n\tprotected isSinglecast(): this is this & {\n\t\tendpoint: PhysicalCCAPIEndpoint;\n\t} {\n\t\treturn (\n\t\t\t!this.endpoint.virtual\n\t\t\t&& typeof this.endpoint.nodeId === \"number\"\n\t\t\t&& this.endpoint.nodeId !== NODE_ID_BROADCAST\n\t\t\t&& this.endpoint.nodeId !== NODE_ID_BROADCAST_LR\n\t\t);\n\t}\n\n\tprotected isMulticast(): this is this & {\n\t\tendpoint: VirtualCCAPIEndpoint & {\n\t\t\tnodeId: number[];\n\t\t};\n\t} {\n\t\treturn this.endpoint.virtual && isArray(this.endpoint.nodeId);\n\t}\n\n\tprotected isBroadcast(): this is this & {\n\t\tendpoint: VirtualCCAPIEndpoint & {\n\t\t\tnodeId: typeof NODE_ID_BROADCAST | typeof NODE_ID_BROADCAST_LR;\n\t\t};\n\t} {\n\t\treturn (\n\t\t\tthis.endpoint.virtual\n\t\t\t&& (this.endpoint.nodeId === NODE_ID_BROADCAST\n\t\t\t\t|| this.endpoint.nodeId === NODE_ID_BROADCAST_LR)\n\t\t);\n\t}\n\n\t/** Returns the value DB for this CC API's node (if it can be safely accessed) */\n\tprotected tryGetValueDB(): ValueDB | undefined {\n\t\tif (!this.isSinglecast()) return;\n\t\ttry {\n\t\t\treturn this.host.getValueDB(this.endpoint.nodeId);\n\t\t} catch {\n\t\t\treturn;\n\t\t}\n\t}\n\n\t/** Returns the value DB for this CC's node (or throws if it cannot be accessed) */\n\tprotected getValueDB(): ValueDB {\n\t\tif (this.isSinglecast()) {\n\t\t\ttry {\n\t\t\t\treturn this.host.getValueDB(this.endpoint.nodeId);\n\t\t\t} catch {\n\t\t\t\tthrow new ZWaveError(\n\t\t\t\t\t\"The node for this CC does not exist or the driver is not ready yet\",\n\t\t\t\t\tZWaveErrorCodes.Driver_NotReady,\n\t\t\t\t);\n\t\t\t}\n\t\t}\n\t\tthrow new ZWaveError(\n\t\t\t\"Cannot retrieve the value DB for non-singlecast CCs\",\n\t\t\tZWaveErrorCodes.CC_NoNodeID,\n\t\t);\n\t}\n}\n\nfunction overrideQueriesWrapper(\n\tctx: GetValueDB & LogNode,\n\tendpoint: PhysicalCCAPIEndpoint,\n\tccId: CommandClasses,\n\tmethod: string,\n\toverrides: CompatOverrideQueries,\n\tfallback: (...args: any[]) => any,\n): (...args: any[]) => any {\n\t// We must not capture the `this` context here, because the API methods are bound on use\n\treturn function(this: any, ...args: any[]) {\n\t\tconst match = overrides.matchOverride(\n\t\t\tccId,\n\t\t\tendpoint.index,\n\t\t\tmethod,\n\t\t\targs,\n\t\t);\n\t\tif (!match) return fallback.call(this, ...args);\n\n\t\tctx.logNode(endpoint.nodeId, {\n\t\t\tmessage: `API call ${method} for ${\n\t\t\t\tgetCCName(\n\t\t\t\t\tccId,\n\t\t\t\t)\n\t\t\t} CC overridden by a compat flag.`,\n\t\t\tlevel: \"debug\",\n\t\t\tdirection: \"none\",\n\t\t});\n\n\t\tconst ccValues = getCCValues(ccId);\n\t\tif (ccValues) {\n\t\t\tconst valueDB = ctx.getValueDB(endpoint.nodeId);\n\n\t\t\tconst prop2value = (prop: string): CCValue | undefined => {\n\t\t\t\t// We use a simplistic parser to support dynamic value IDs:\n\t\t\t\t// If end with round brackets with something inside, they are considered dynamic\n\t\t\t\t// Otherwise static\n\t\t\t\tconst argsMatch = prop.match(/^(.*)\\((.*)\\)$/);\n\t\t\t\tif (argsMatch) {\n\t\t\t\t\tconst methodName = argsMatch[1];\n\t\t\t\t\tconst methodArgs = JSON.parse(`[${argsMatch[2]}]`);\n\n\t\t\t\t\tconst dynValue = ccValues[methodName];\n\t\t\t\t\tif (typeof dynValue === \"function\") {\n\t\t\t\t\t\treturn dynValue(...methodArgs);\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\tconst staticValue = ccValues[prop] as\n\t\t\t\t\t\t| StaticCCValue\n\t\t\t\t\t\t| undefined;\n\t\t\t\t\tif (typeof staticValue?.endpoint === \"function\") {\n\t\t\t\t\t\treturn staticValue;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t};\n\n\t\t\t// Persist values if necessary\n\t\t\tif (match.persistValues) {\n\t\t\t\tfor (\n\t\t\t\t\tconst [prop, value] of Object.entries(\n\t\t\t\t\t\tmatch.persistValues,\n\t\t\t\t\t)\n\t\t\t\t) {\n\t\t\t\t\ttry {\n\t\t\t\t\t\tconst ccValue = prop2value(prop);\n\t\t\t\t\t\tif (ccValue) {\n\t\t\t\t\t\t\tvalueDB.setValue(\n\t\t\t\t\t\t\t\tccValue.endpoint(endpoint.index),\n\t\t\t\t\t\t\t\tvalue,\n\t\t\t\t\t\t\t);\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tctx.logNode(endpoint.nodeId, {\n\t\t\t\t\t\t\t\tmessage:\n\t\t\t\t\t\t\t\t\t`Failed to persist value ${prop} during overridden API call: value does not exist`,\n\t\t\t\t\t\t\t\tlevel: \"error\",\n\t\t\t\t\t\t\t\tdirection: \"none\",\n\t\t\t\t\t\t\t});\n\t\t\t\t\t\t}\n\t\t\t\t\t} catch (e) {\n\t\t\t\t\t\tctx.logNode(endpoint.nodeId, {\n\t\t\t\t\t\t\tmessage:\n\t\t\t\t\t\t\t\t`Failed to persist value ${prop} during overridden API call: ${\n\t\t\t\t\t\t\t\t\tgetErrorMessage(\n\t\t\t\t\t\t\t\t\t\te,\n\t\t\t\t\t\t\t\t\t)\n\t\t\t\t\t\t\t\t}`,\n\t\t\t\t\t\t\tlevel: \"error\",\n\t\t\t\t\t\t\tdirection: \"none\",\n\t\t\t\t\t\t});\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// As well as metadata\n\t\t\tif (match.extendMetadata) {\n\t\t\t\tfor (\n\t\t\t\t\tconst [prop, meta] of Object.entries(\n\t\t\t\t\t\tmatch.extendMetadata,\n\t\t\t\t\t)\n\t\t\t\t) {\n\t\t\t\t\ttry {\n\t\t\t\t\t\tconst ccValue = prop2value(prop);\n\t\t\t\t\t\tif (ccValue) {\n\t\t\t\t\t\t\tvalueDB.setMetadata(\n\t\t\t\t\t\t\t\tccValue.endpoint(endpoint.index),\n\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t...ccValue.meta,\n\t\t\t\t\t\t\t\t\t...meta,\n\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t);\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tctx.logNode(endpoint.nodeId, {\n\t\t\t\t\t\t\t\tmessage:\n\t\t\t\t\t\t\t\t\t`Failed to extend value metadata ${prop} during overridden API call: value does not exist`,\n\t\t\t\t\t\t\t\tlevel: \"error\",\n\t\t\t\t\t\t\t\tdirection: \"none\",\n\t\t\t\t\t\t\t});\n\t\t\t\t\t\t}\n\t\t\t\t\t} catch (e) {\n\t\t\t\t\t\tctx.logNode(endpoint.nodeId, {\n\t\t\t\t\t\t\tmessage:\n\t\t\t\t\t\t\t\t`Failed to extend value metadata ${prop} during overridden API call: ${\n\t\t\t\t\t\t\t\t\tgetErrorMessage(\n\t\t\t\t\t\t\t\t\t\te,\n\t\t\t\t\t\t\t\t\t)\n\t\t\t\t\t\t\t\t}`,\n\t\t\t\t\t\t\tlevel: \"error\",\n\t\t\t\t\t\t\tdirection: \"none\",\n\t\t\t\t\t\t});\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t// API methods are always async\n\t\treturn Promise.resolve(match.result);\n\t};\n}\n\n/** A CC API that is only available for physical endpoints */\nexport class PhysicalCCAPI extends CCAPI {\n\tpublic constructor(\n\t\thost: CCAPIHost,\n\t\tendpoint: CCAPIEndpoint,\n\t) {\n\t\tsuper(host, endpoint);\n\t\tthis.assertPhysicalEndpoint(endpoint);\n\t}\n\n\tdeclare protected readonly endpoint: PhysicalCCAPIEndpoint;\n}\n\nexport type APIConstructor<T extends CCAPI = CCAPI> = new (\n\thost: CCAPIHost,\n\tendpoint: CCAPIEndpoint,\n) => T;\n\nexport type CCToName<CC extends CommandClasses> = {\n\t[K in keyof CCNameMap]: CCNameMap[K] extends CC ? K : never;\n}[keyof CCNameMap];\n\nexport type CCNameOrId = CommandClasses | Extract<keyof CCAPIs, string>;\n\nexport type CCToAPI<CC extends CCNameOrId> = CC extends CommandClasses\n\t? CCToName<CC> extends keyof CCAPIs ? CCAPIs[CCToName<CC>]\n\t: never\n\t: CC extends keyof CCAPIs ? CCAPIs[CC]\n\t: never;\n\nexport type APIMethodsOf<CC extends CCNameOrId> = Omit<\n\tOnlyMethods<CCToAPI<CC>>,\n\t| \"ccId\"\n\t| \"getNode\"\n\t| \"tryGetNode\"\n\t| \"isSetValueOptimistic\"\n\t| \"isSupported\"\n\t| \"pollValue\"\n\t| \"setValue\"\n\t| \"version\"\n\t| \"supportsCommand\"\n\t| \"withOptions\"\n\t| \"withTXReport\"\n>;\n\nexport type OwnMethodsOf<API extends CCAPI> = Omit<\n\tOnlyMethods<API>,\n\tkeyof OnlyMethods<CCAPI>\n>;\n\n// Wraps the given type in an object that contains a TX report\nexport type WrapWithTXReport<T> = [T] extends [Promise<infer U>]\n\t? Promise<WrapWithTXReport<U>>\n\t: [T] extends [void] ? { txReport: TXReport | undefined }\n\t: { result: T; txReport: TXReport | undefined };\n\nexport type ReturnWithTXReport<T> = T extends (...args: any[]) => any\n\t? (...args: Parameters<T>) => WrapWithTXReport<ReturnType<T>>\n\t: undefined;\n\n// Converts the type of the given API implementation so the API methods return an object including the TX report\nexport type WithTXReport<API extends CCAPI> =\n\t& Omit<\n\t\tAPI,\n\t\tkeyof OwnMethodsOf<API> | \"withOptions\" | \"withTXReport\" | \"setValue\"\n\t>\n\t& {\n\t\t[\n\t\t\tK in\n\t\t\t\t| keyof OwnMethodsOf<API>\n\t\t\t\t| \"setValue\"\n\t\t\t\t| \"pollValue\"\n\t\t]: ReturnWithTXReport<API[K]>;\n\t};\n\nexport function normalizeCCNameOrId(\n\tccNameOrId: number | string,\n): CommandClasses | undefined {\n\tif (!(ccNameOrId in CommandClasses)) return undefined;\n\n\tlet ret: CommandClasses | undefined;\n\tif (typeof ccNameOrId === \"string\") {\n\t\tif (/^\\d+$/.test(ccNameOrId)) {\n\t\t\t// This can happen on property access\n\t\t\tret = +ccNameOrId;\n\t\t} else if (typeof (CommandClasses as any)[ccNameOrId] === \"number\") {\n\t\t\tret = (CommandClasses as any)[ccNameOrId];\n\t\t}\n\t} else {\n\t\tret = ccNameOrId;\n\t}\n\n\treturn ret;\n}\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;AACA;;;;;;;;;;;;;;AAAA,kBAkCO;AACP,oBAMO;AACP,wBAAwB;AACxB,oCAKO;AAgBA,MAAM,YAA2B,OAAO,IAAI,iBAAiB;AAQ7D,MAAM,kBAAiC,OAAO,IACpD,uBAAuB;AAyCjB,MAAM,aAA4B,OAAO,IAAI,kBAAkB;AAOhE,SAAU,yBACf,IACA,UAAyB;AAEzB,QAAM,IAAI,uBACT,GAAG,2BAAe,EAAE,CAAC,MAAM,QAAQ,iCACnC,4BAAgB,gBAAgB;AAElC;AARgB;AAUV,SAAU,4BACf,IACA,UACA,aAA4B;AAE5B,QAAM,IAAI,uBACT,GACC,2BAAe,EAAE,CAClB,MAAM,WAAW,mDAAmD,QAAQ,KAC5E,4BAAgB,gBAAgB;AAElC;AAXgB;AAaV,SAAU,wBACf,IACA,UAAyB;AAEzB,QAAM,IAAI,uBACT,GACC,2BAAe,EAAE,CAClB,eAAe,Q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AuB,UAAU,MAAM,UAAU;AACnE,YAAO,2BAAuB,UAAU;IACzC;EACD,OAAO;AACN,UAAM;EACP;AAEA,SAAO;AACR;AAlBgB;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { GetDeviceConfig, LookupManufacturer } from "@zwave-js/config";
|
|
2
|
-
import { type BroadcastCC, type CCAddress, type CCId, CommandClasses, type ControlsCC, EncapsulationFlags, type EndpointId, type FrameType, type GetAllEndpoints, type GetCCs, type GetEndpoint, type GetNode, type GetSupportedCCVersion, type GetValueDB, type HostIDs, type ListenBehavior, type LogNode, type MessageOrCCLogEntry, type ModifyCCs, type MulticastCC, type MulticastDestination, type NodeId, type QueryNodeStatus, type QuerySecurityClasses, type SetSecurityClass, type SinglecastCC, type SupportsCC, type ValueDB, type ValueID, type ValueMetadata, ZWaveErrorCodes } from "@zwave-js/core";
|
|
2
|
+
import { type BroadcastCC, type CCAddress, type CCId, CommandClasses, type ControlsCC, EncapsulationFlags, type EndpointId, type FrameType, type GetAllEndpoints, type GetCCs, type GetEndpoint, type GetNode, type GetSupportedCCVersion, type GetValueDB, type HostIDs, type ListenBehavior, type LogNode, type MessageOrCCLogEntry, type MessagePriority, type ModifyCCs, type MulticastCC, type MulticastDestination, type NodeId, type QueryNodeStatus, type QuerySecurityClasses, type SetSecurityClass, type SinglecastCC, type SupportsCC, type ValueDB, type ValueID, type ValueMetadata, ZWaveErrorCodes } from "@zwave-js/core";
|
|
3
3
|
import { Bytes, type BytesView, type JSONObject } from "@zwave-js/shared";
|
|
4
4
|
import type { CCAPIHost, CCAPINode, ValueIDProperties } from "./API.js";
|
|
5
5
|
import { type EncapsulatingCommandClass } from "./EncapsulatingCommandClass.js";
|
|
@@ -15,6 +15,10 @@ export type CCEndpoint = EndpointId & SupportsCC & ControlsCC & GetCCs & ModifyC
|
|
|
15
15
|
export type CCNode = NodeId & SupportsCC & ControlsCC & GetCCs & GetEndpoint<CCEndpoint> & GetAllEndpoints<CCEndpoint> & QuerySecurityClasses & SetSecurityClass & ListenBehavior & QueryNodeStatus;
|
|
16
16
|
export type InterviewContext = CCAPIHost<CCAPINode & GetCCs & SupportsCC & ControlsCC & QuerySecurityClasses & SetSecurityClass & GetEndpoint<EndpointId & GetCCs & SupportsCC & ControlsCC & ModifyCCs> & GetAllEndpoints<EndpointId & SupportsCC & ControlsCC>> & GetInterviewOptions & LookupManufacturer;
|
|
17
17
|
export type RefreshValuesContext = CCAPIHost<CCAPINode & GetEndpoint<EndpointId & SupportsCC & ControlsCC>>;
|
|
18
|
+
export interface RefreshValuesOptions {
|
|
19
|
+
/** The priority to use for the refresh value queries */
|
|
20
|
+
priority?: MessagePriority;
|
|
21
|
+
}
|
|
18
22
|
export type PersistValuesContext = HostIDs & GetValueDB & GetSupportedCCVersion & GetDeviceConfig & GetNode<NodeId & GetEndpoint<EndpointId & SupportsCC & ControlsCC>> & LogNode;
|
|
19
23
|
export declare function getEffectiveCCVersion(ctx: GetSupportedCCVersion, cc: CCId, defaultVersion?: number): number;
|
|
20
24
|
export declare class CCRaw {
|
|
@@ -81,7 +85,7 @@ export declare class CommandClass implements CCId {
|
|
|
81
85
|
/**
|
|
82
86
|
* Refreshes all dynamic values of this CC
|
|
83
87
|
*/
|
|
84
|
-
refreshValues(_ctx: RefreshValuesContext): Promise<void>;
|
|
88
|
+
refreshValues(_ctx: RefreshValuesContext, _options?: RefreshValuesOptions): Promise<void>;
|
|
85
89
|
/**
|
|
86
90
|
* Checks if the CC values need to be manually refreshed.
|
|
87
91
|
* This should be called regularly and when sleeping nodes wake up
|
|
@@ -260,7 +260,7 @@ class CommandClass {
|
|
|
260
260
|
/**
|
|
261
261
|
* Refreshes all dynamic values of this CC
|
|
262
262
|
*/
|
|
263
|
-
async refreshValues(_ctx) {
|
|
263
|
+
async refreshValues(_ctx, _options) {
|
|
264
264
|
}
|
|
265
265
|
/**
|
|
266
266
|
* Checks if the CC values need to be manually refreshed.
|
|
@@ -521,6 +521,7 @@ class CommandClass {
|
|
|
521
521
|
// Values are only persisted for singlecast, so we know nodeId is a number
|
|
522
522
|
this.nodeId,
|
|
523
523
|
this.endpointIndex
|
|
524
|
+
// If the version isn't known yet, limit the created values to V1
|
|
524
525
|
) || 1;
|
|
525
526
|
for (const [prop, _value] of (0, import_CommandClassDecorators.getCCValueProperties)(this)) {
|
|
526
527
|
const value = typeof _value === "function" ? _value(this) : _value;
|