@zwave-js/cc 15.1.1 → 15.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/build/cjs/cc/AlarmSensorCC.d.ts +7 -7
- package/build/cjs/cc/AlarmSensorCC.js +22 -23
- package/build/cjs/cc/AlarmSensorCC.js.map +3 -3
- package/build/cjs/cc/AssociationCC.d.ts +8 -9
- package/build/cjs/cc/AssociationCC.js +29 -29
- package/build/cjs/cc/AssociationCC.js.map +3 -3
- package/build/cjs/cc/AssociationGroupInfoCC.d.ts +7 -7
- package/build/cjs/cc/AssociationGroupInfoCC.js +31 -32
- package/build/cjs/cc/AssociationGroupInfoCC.js.map +3 -3
- package/build/cjs/cc/BarrierOperatorCC.d.ts +8 -8
- package/build/cjs/cc/BarrierOperatorCC.js +35 -36
- package/build/cjs/cc/BarrierOperatorCC.js.map +3 -3
- package/build/cjs/cc/BasicCC.d.ts +4 -4
- package/build/cjs/cc/BasicCC.js +23 -24
- package/build/cjs/cc/BasicCC.js.map +3 -3
- package/build/cjs/cc/BasicWindowCoveringCC._validateArgs.d.ts +3 -0
- package/build/cjs/cc/BasicWindowCoveringCC._validateArgs.js +64 -0
- package/build/cjs/cc/BasicWindowCoveringCC._validateArgs.js.map +7 -0
- package/build/cjs/cc/BasicWindowCoveringCC.d.ts +90 -0
- package/build/cjs/cc/BasicWindowCoveringCC.js +273 -0
- package/build/cjs/cc/BasicWindowCoveringCC.js.map +7 -0
- package/build/cjs/cc/BatteryCC.d.ts +4 -7
- package/build/cjs/cc/BatteryCC.js +18 -20
- package/build/cjs/cc/BatteryCC.js.map +3 -3
- package/build/cjs/cc/BinarySensorCC.d.ts +5 -5
- package/build/cjs/cc/BinarySensorCC.js +20 -21
- package/build/cjs/cc/BinarySensorCC.js.map +3 -3
- package/build/cjs/cc/BinarySwitchCC._validateArgs.js +2 -2
- package/build/cjs/cc/BinarySwitchCC.d.ts +6 -6
- package/build/cjs/cc/BinarySwitchCC.js +26 -26
- package/build/cjs/cc/BinarySwitchCC.js.map +3 -3
- package/build/cjs/cc/CRC16CC.d.ts +3 -3
- package/build/cjs/cc/CRC16CC.js +15 -15
- package/build/cjs/cc/CRC16CC.js.map +3 -3
- package/build/cjs/cc/CentralSceneCC.d.ts +8 -8
- package/build/cjs/cc/CentralSceneCC.js +23 -24
- package/build/cjs/cc/CentralSceneCC.js.map +3 -3
- package/build/cjs/cc/ClimateControlScheduleCC.d.ts +6 -6
- package/build/cjs/cc/ClimateControlScheduleCC.js +19 -20
- package/build/cjs/cc/ClimateControlScheduleCC.js.map +3 -3
- package/build/cjs/cc/ClockCC.d.ts +3 -4
- package/build/cjs/cc/ClockCC.js +13 -14
- package/build/cjs/cc/ClockCC.js.map +3 -3
- package/build/cjs/cc/ColorSwitchCC.d.ts +3 -4
- package/build/cjs/cc/ColorSwitchCC.js +22 -24
- package/build/cjs/cc/ColorSwitchCC.js.map +3 -3
- package/build/cjs/cc/ConfigurationCC.d.ts +3 -3
- package/build/cjs/cc/ConfigurationCC.js +114 -115
- package/build/cjs/cc/ConfigurationCC.js.map +3 -3
- package/build/cjs/cc/DeviceResetLocallyCC.d.ts +2 -2
- package/build/cjs/cc/DeviceResetLocallyCC.js +5 -5
- package/build/cjs/cc/DeviceResetLocallyCC.js.map +1 -1
- package/build/cjs/cc/DoorLockCC.d.ts +29 -29
- package/build/cjs/cc/DoorLockCC.js +39 -40
- package/build/cjs/cc/DoorLockCC.js.map +3 -3
- package/build/cjs/cc/DoorLockLoggingCC.d.ts +4 -4
- package/build/cjs/cc/DoorLockLoggingCC.js +13 -14
- package/build/cjs/cc/DoorLockLoggingCC.js.map +3 -3
- package/build/cjs/cc/EnergyProductionCC.d.ts +2 -3
- package/build/cjs/cc/EnergyProductionCC.js.map +2 -2
- package/build/cjs/cc/EntryControlCC.d.ts +8 -8
- package/build/cjs/cc/EntryControlCC.js +41 -42
- package/build/cjs/cc/EntryControlCC.js.map +3 -3
- package/build/cjs/cc/FirmwareUpdateMetaDataCC.d.ts +9 -10
- package/build/cjs/cc/FirmwareUpdateMetaDataCC.js +52 -53
- package/build/cjs/cc/FirmwareUpdateMetaDataCC.js.map +3 -3
- package/build/cjs/cc/HailCC.js +2 -2
- package/build/cjs/cc/HailCC.js.map +1 -1
- package/build/cjs/cc/HumidityControlModeCC.d.ts +5 -5
- package/build/cjs/cc/HumidityControlModeCC.js +20 -21
- package/build/cjs/cc/HumidityControlModeCC.js.map +3 -3
- package/build/cjs/cc/HumidityControlOperatingStateCC.d.ts +3 -3
- package/build/cjs/cc/HumidityControlOperatingStateCC.js +9 -9
- package/build/cjs/cc/HumidityControlOperatingStateCC.js.map +3 -3
- package/build/cjs/cc/HumidityControlSetpointCC.d.ts +6 -6
- package/build/cjs/cc/HumidityControlSetpointCC.js +43 -44
- package/build/cjs/cc/HumidityControlSetpointCC.js.map +3 -3
- package/build/cjs/cc/InclusionControllerCC.d.ts +2 -3
- package/build/cjs/cc/InclusionControllerCC.js.map +2 -2
- package/build/cjs/cc/IndicatorCC.d.ts +3 -3
- package/build/cjs/cc/IndicatorCC.js +50 -52
- package/build/cjs/cc/IndicatorCC.js.map +3 -3
- package/build/cjs/cc/IrrigationCC.d.ts +3 -3
- package/build/cjs/cc/IrrigationCC.js +74 -75
- package/build/cjs/cc/IrrigationCC.js.map +3 -3
- package/build/cjs/cc/LanguageCC.d.ts +5 -6
- package/build/cjs/cc/LanguageCC.js +14 -15
- package/build/cjs/cc/LanguageCC.js.map +3 -3
- package/build/cjs/cc/LockCC.d.ts +4 -4
- package/build/cjs/cc/LockCC.js +10 -10
- package/build/cjs/cc/LockCC.js.map +3 -3
- package/build/cjs/cc/ManufacturerProprietaryCC.d.ts +3 -3
- package/build/cjs/cc/ManufacturerProprietaryCC.js +10 -10
- package/build/cjs/cc/ManufacturerProprietaryCC.js.map +3 -3
- package/build/cjs/cc/ManufacturerSpecificCC.d.ts +7 -8
- package/build/cjs/cc/ManufacturerSpecificCC.js +20 -21
- package/build/cjs/cc/ManufacturerSpecificCC.js.map +3 -3
- package/build/cjs/cc/MeterCC.d.ts +4 -6
- package/build/cjs/cc/MeterCC.js +52 -54
- package/build/cjs/cc/MeterCC.js.map +3 -3
- package/build/cjs/cc/MultiChannelAssociationCC.d.ts +7 -8
- package/build/cjs/cc/MultiChannelAssociationCC.js +34 -35
- package/build/cjs/cc/MultiChannelAssociationCC.js.map +3 -3
- package/build/cjs/cc/MultiChannelCC.d.ts +11 -11
- package/build/cjs/cc/MultiChannelCC.js +53 -53
- package/build/cjs/cc/MultiChannelCC.js.map +3 -3
- package/build/cjs/cc/MultiCommandCC.d.ts +3 -3
- package/build/cjs/cc/MultiCommandCC.js +13 -13
- package/build/cjs/cc/MultiCommandCC.js.map +3 -3
- package/build/cjs/cc/MultilevelSensorCC.d.ts +4 -7
- package/build/cjs/cc/MultilevelSensorCC.js +26 -28
- package/build/cjs/cc/MultilevelSensorCC.js.map +3 -3
- package/build/cjs/cc/MultilevelSwitchCC._validateArgs.js +3 -3
- package/build/cjs/cc/MultilevelSwitchCC.d.ts +13 -13
- package/build/cjs/cc/MultilevelSwitchCC.js +36 -37
- package/build/cjs/cc/MultilevelSwitchCC.js.map +3 -3
- package/build/cjs/cc/NoOperationCC.js +4 -4
- package/build/cjs/cc/NoOperationCC.js.map +1 -1
- package/build/cjs/cc/NodeNamingCC.d.ts +5 -5
- package/build/cjs/cc/NodeNamingCC.js +20 -20
- package/build/cjs/cc/NodeNamingCC.js.map +3 -3
- package/build/cjs/cc/NotificationCC.d.ts +4 -5
- package/build/cjs/cc/NotificationCC.js +66 -68
- package/build/cjs/cc/NotificationCC.js.map +3 -3
- package/build/cjs/cc/PowerlevelCC.d.ts +3 -3
- package/build/cjs/cc/PowerlevelCC.js +25 -26
- package/build/cjs/cc/PowerlevelCC.js.map +3 -3
- package/build/cjs/cc/ProtectionCC._validateArgs.js +2 -2
- package/build/cjs/cc/ProtectionCC.d.ts +11 -11
- package/build/cjs/cc/ProtectionCC.js +35 -36
- package/build/cjs/cc/ProtectionCC.js.map +3 -3
- package/build/cjs/cc/SceneActivationCC._validateArgs.js +2 -2
- package/build/cjs/cc/SceneActivationCC.d.ts +5 -6
- package/build/cjs/cc/SceneActivationCC.js +10 -10
- package/build/cjs/cc/SceneActivationCC.js.map +3 -3
- package/build/cjs/cc/SceneActuatorConfigurationCC._validateArgs.js +2 -2
- package/build/cjs/cc/SceneActuatorConfigurationCC.d.ts +5 -5
- package/build/cjs/cc/SceneActuatorConfigurationCC.js +19 -20
- package/build/cjs/cc/SceneActuatorConfigurationCC.js.map +3 -3
- package/build/cjs/cc/SceneControllerConfigurationCC._validateArgs.js +2 -2
- package/build/cjs/cc/SceneControllerConfigurationCC.d.ts +6 -6
- package/build/cjs/cc/SceneControllerConfigurationCC.js +25 -26
- package/build/cjs/cc/SceneControllerConfigurationCC.js.map +3 -3
- package/build/cjs/cc/ScheduleEntryLockCC.d.ts +2 -3
- package/build/cjs/cc/ScheduleEntryLockCC.js.map +2 -2
- package/build/cjs/cc/Security2CC.d.ts +3 -4
- package/build/cjs/cc/Security2CC.js +60 -62
- package/build/cjs/cc/Security2CC.js.map +3 -3
- package/build/cjs/cc/SecurityCC.d.ts +3 -4
- package/build/cjs/cc/SecurityCC.js +25 -26
- package/build/cjs/cc/SecurityCC.js.map +3 -3
- package/build/cjs/cc/SoundSwitchCC.d.ts +7 -7
- package/build/cjs/cc/SoundSwitchCC.js +28 -29
- package/build/cjs/cc/SoundSwitchCC.js.map +3 -3
- package/build/cjs/cc/SupervisionCC.d.ts +4 -4
- package/build/cjs/cc/SupervisionCC.js +28 -29
- package/build/cjs/cc/SupervisionCC.js.map +3 -3
- package/build/cjs/cc/ThermostatFanModeCC.d.ts +6 -6
- package/build/cjs/cc/ThermostatFanModeCC.js +21 -22
- package/build/cjs/cc/ThermostatFanModeCC.js.map +3 -3
- package/build/cjs/cc/ThermostatFanStateCC.d.ts +3 -3
- package/build/cjs/cc/ThermostatFanStateCC.js +9 -9
- package/build/cjs/cc/ThermostatFanStateCC.js.map +3 -3
- package/build/cjs/cc/ThermostatModeCC.d.ts +6 -6
- package/build/cjs/cc/ThermostatModeCC.js +30 -31
- package/build/cjs/cc/ThermostatModeCC.js.map +3 -3
- package/build/cjs/cc/ThermostatOperatingStateCC.d.ts +3 -4
- package/build/cjs/cc/ThermostatOperatingStateCC.js +9 -9
- package/build/cjs/cc/ThermostatOperatingStateCC.js.map +3 -3
- package/build/cjs/cc/ThermostatSetbackCC.d.ts +3 -3
- package/build/cjs/cc/ThermostatSetbackCC.js +14 -15
- package/build/cjs/cc/ThermostatSetbackCC.js.map +3 -3
- package/build/cjs/cc/ThermostatSetpointCC.d.ts +6 -6
- package/build/cjs/cc/ThermostatSetpointCC.js +48 -49
- package/build/cjs/cc/ThermostatSetpointCC.js.map +3 -3
- package/build/cjs/cc/TimeCC.d.ts +3 -4
- package/build/cjs/cc/TimeCC.js +9 -10
- package/build/cjs/cc/TimeCC.js.map +3 -3
- package/build/cjs/cc/TimeParametersCC.d.ts +3 -4
- package/build/cjs/cc/TimeParametersCC.js +2 -2
- package/build/cjs/cc/TimeParametersCC.js.map +2 -2
- package/build/cjs/cc/TransportServiceCC.d.ts +3 -3
- package/build/cjs/cc/TransportServiceCC.js +44 -45
- package/build/cjs/cc/TransportServiceCC.js.map +3 -3
- package/build/cjs/cc/UserCodeCC.d.ts +19 -19
- package/build/cjs/cc/UserCodeCC.js +102 -103
- package/build/cjs/cc/UserCodeCC.js.map +3 -3
- package/build/cjs/cc/VersionCC.d.ts +17 -17
- package/build/cjs/cc/VersionCC.js +46 -47
- package/build/cjs/cc/VersionCC.js.map +3 -3
- package/build/cjs/cc/WakeUpCC.d.ts +6 -6
- package/build/cjs/cc/WakeUpCC.js +16 -17
- package/build/cjs/cc/WakeUpCC.js.map +3 -3
- package/build/cjs/cc/WindowCoveringCC.d.ts +3 -4
- package/build/cjs/cc/WindowCoveringCC.js +17 -18
- package/build/cjs/cc/WindowCoveringCC.js.map +3 -3
- package/build/cjs/cc/ZWavePlusCC.d.ts +8 -8
- package/build/cjs/cc/ZWavePlusCC.js +15 -16
- package/build/cjs/cc/ZWavePlusCC.js.map +3 -3
- package/build/cjs/cc/ZWaveProtocolCC.d.ts +2 -2
- package/build/cjs/cc/ZWaveProtocolCC.js +35 -35
- package/build/cjs/cc/ZWaveProtocolCC.js.map +2 -2
- package/build/cjs/cc/_CCValues.generated.d.ts +124 -0
- package/build/cjs/cc/_CCValues.generated.js +93 -26
- package/build/cjs/cc/_CCValues.generated.js.map +3 -3
- package/build/cjs/cc/index.d.ts +2 -0
- package/build/cjs/cc/index.js +9 -0
- package/build/cjs/cc/index.js.map +2 -2
- package/build/cjs/cc/manufacturerProprietary/FibaroCC.d.ts +3 -3
- package/build/cjs/cc/manufacturerProprietary/FibaroCC.js +14 -14
- package/build/cjs/cc/manufacturerProprietary/FibaroCC.js.map +1 -1
- package/build/cjs/lib/API.d.ts +5 -3
- package/build/cjs/lib/API.js.map +2 -2
- package/build/cjs/lib/CommandClass.d.ts +5 -6
- package/build/cjs/lib/CommandClass.js +45 -45
- package/build/cjs/lib/CommandClass.js.map +3 -3
- package/build/cjs/lib/CommandClassDecorators.d.ts +2 -2
- package/build/cjs/lib/CommandClassDecorators.js +3 -3
- package/build/cjs/lib/CommandClassDecorators.js.map +2 -2
- package/build/cjs/lib/Security2/Extension.d.ts +2 -2
- package/build/cjs/lib/Security2/Extension.js +17 -17
- package/build/cjs/lib/Security2/Extension.js.map +3 -3
- package/build/cjs/lib/SetValueResult.d.ts +1 -1
- package/build/cjs/lib/SetValueResult.js.map +1 -1
- package/build/cjs/lib/Values.d.ts +3 -3
- package/build/cjs/lib/Values.js +6 -6
- package/build/cjs/lib/Values.js.map +2 -2
- package/build/cjs/lib/_Types.d.ts +6 -2
- package/build/cjs/lib/_Types.js +10 -3
- package/build/cjs/lib/_Types.js.map +3 -3
- package/build/cjs/lib/serializers.d.ts +1 -1
- package/build/cjs/lib/serializers.js +5 -5
- package/build/cjs/lib/serializers.js.map +2 -2
- package/build/cjs/lib/traits.d.ts +2 -2
- package/build/cjs/lib/utils.d.ts +2 -2
- package/build/cjs/lib/utils.js +60 -60
- package/build/cjs/lib/utils.js.map +3 -3
- package/build/esm/cc/AlarmSensorCC.d.ts +7 -7
- package/build/esm/cc/AlarmSensorCC.d.ts.map +1 -1
- package/build/esm/cc/AlarmSensorCC.js +2 -3
- package/build/esm/cc/AlarmSensorCC.js.map +1 -1
- package/build/esm/cc/AssociationCC.d.ts +8 -9
- package/build/esm/cc/AssociationCC.d.ts.map +1 -1
- package/build/esm/cc/AssociationCC.js +2 -2
- package/build/esm/cc/AssociationCC.js.map +1 -1
- package/build/esm/cc/AssociationGroupInfoCC.d.ts +7 -7
- package/build/esm/cc/AssociationGroupInfoCC.d.ts.map +1 -1
- package/build/esm/cc/AssociationGroupInfoCC.js +2 -3
- package/build/esm/cc/AssociationGroupInfoCC.js.map +1 -1
- package/build/esm/cc/BarrierOperatorCC.d.ts +8 -8
- package/build/esm/cc/BarrierOperatorCC.d.ts.map +1 -1
- package/build/esm/cc/BarrierOperatorCC.js +2 -3
- package/build/esm/cc/BarrierOperatorCC.js.map +1 -1
- package/build/esm/cc/BasicCC.d.ts +4 -4
- package/build/esm/cc/BasicCC.d.ts.map +1 -1
- package/build/esm/cc/BasicCC.js +2 -3
- package/build/esm/cc/BasicCC.js.map +1 -1
- package/build/esm/cc/BasicWindowCoveringCC._validateArgs.d.ts +3 -0
- package/build/esm/cc/BasicWindowCoveringCC._validateArgs.d.ts.map +1 -0
- package/build/esm/cc/BasicWindowCoveringCC._validateArgs.js +22 -0
- package/build/esm/cc/BasicWindowCoveringCC._validateArgs.js.map +1 -0
- package/build/esm/cc/BasicWindowCoveringCC.d.ts +90 -0
- package/build/esm/cc/BasicWindowCoveringCC.d.ts.map +1 -0
- package/build/esm/cc/BasicWindowCoveringCC.js +215 -0
- package/build/esm/cc/BasicWindowCoveringCC.js.map +1 -0
- package/build/esm/cc/BatteryCC.d.ts +4 -7
- package/build/esm/cc/BatteryCC.d.ts.map +1 -1
- package/build/esm/cc/BatteryCC.js +2 -4
- package/build/esm/cc/BatteryCC.js.map +1 -1
- package/build/esm/cc/BinarySensorCC.d.ts +5 -5
- package/build/esm/cc/BinarySensorCC.d.ts.map +1 -1
- package/build/esm/cc/BinarySensorCC.js +2 -3
- package/build/esm/cc/BinarySensorCC.js.map +1 -1
- package/build/esm/cc/BinarySwitchCC._validateArgs.js +1 -1
- package/build/esm/cc/BinarySwitchCC._validateArgs.js.map +1 -1
- package/build/esm/cc/BinarySwitchCC.d.ts +6 -6
- package/build/esm/cc/BinarySwitchCC.d.ts.map +1 -1
- package/build/esm/cc/BinarySwitchCC.js +2 -2
- package/build/esm/cc/BinarySwitchCC.js.map +1 -1
- package/build/esm/cc/CRC16CC.d.ts +3 -3
- package/build/esm/cc/CRC16CC.d.ts.map +1 -1
- package/build/esm/cc/CRC16CC.js +2 -2
- package/build/esm/cc/CRC16CC.js.map +1 -1
- package/build/esm/cc/CentralSceneCC.d.ts +8 -8
- package/build/esm/cc/CentralSceneCC.d.ts.map +1 -1
- package/build/esm/cc/CentralSceneCC.js +2 -3
- package/build/esm/cc/CentralSceneCC.js.map +1 -1
- package/build/esm/cc/ClimateControlScheduleCC.d.ts +6 -6
- package/build/esm/cc/ClimateControlScheduleCC.d.ts.map +1 -1
- package/build/esm/cc/ClimateControlScheduleCC.js +2 -3
- package/build/esm/cc/ClimateControlScheduleCC.js.map +1 -1
- package/build/esm/cc/ClockCC.d.ts +3 -4
- package/build/esm/cc/ClockCC.d.ts.map +1 -1
- package/build/esm/cc/ClockCC.js +2 -3
- package/build/esm/cc/ClockCC.js.map +1 -1
- package/build/esm/cc/ColorSwitchCC.d.ts +3 -4
- package/build/esm/cc/ColorSwitchCC.d.ts.map +1 -1
- package/build/esm/cc/ColorSwitchCC.js +2 -4
- package/build/esm/cc/ColorSwitchCC.js.map +1 -1
- package/build/esm/cc/ConfigurationCC.d.ts +3 -3
- package/build/esm/cc/ConfigurationCC.d.ts.map +1 -1
- package/build/esm/cc/ConfigurationCC.js +2 -3
- package/build/esm/cc/ConfigurationCC.js.map +1 -1
- package/build/esm/cc/DeviceResetLocallyCC.d.ts +2 -2
- package/build/esm/cc/DeviceResetLocallyCC.d.ts.map +1 -1
- package/build/esm/cc/DeviceResetLocallyCC.js +1 -1
- package/build/esm/cc/DeviceResetLocallyCC.js.map +1 -1
- package/build/esm/cc/DoorLockCC.d.ts +29 -29
- package/build/esm/cc/DoorLockCC.d.ts.map +1 -1
- package/build/esm/cc/DoorLockCC.js +2 -3
- package/build/esm/cc/DoorLockCC.js.map +1 -1
- package/build/esm/cc/DoorLockLoggingCC.d.ts +4 -4
- package/build/esm/cc/DoorLockLoggingCC.d.ts.map +1 -1
- package/build/esm/cc/DoorLockLoggingCC.js +2 -3
- package/build/esm/cc/DoorLockLoggingCC.js.map +1 -1
- package/build/esm/cc/EnergyProductionCC.d.ts +2 -3
- package/build/esm/cc/EnergyProductionCC.d.ts.map +1 -1
- package/build/esm/cc/EnergyProductionCC.js.map +1 -1
- package/build/esm/cc/EntryControlCC.d.ts +8 -8
- package/build/esm/cc/EntryControlCC.d.ts.map +1 -1
- package/build/esm/cc/EntryControlCC.js +2 -3
- package/build/esm/cc/EntryControlCC.js.map +1 -1
- package/build/esm/cc/FirmwareUpdateMetaDataCC.d.ts +9 -10
- package/build/esm/cc/FirmwareUpdateMetaDataCC.d.ts.map +1 -1
- package/build/esm/cc/FirmwareUpdateMetaDataCC.js +2 -3
- package/build/esm/cc/FirmwareUpdateMetaDataCC.js.map +1 -1
- package/build/esm/cc/HailCC.js +1 -1
- package/build/esm/cc/HailCC.js.map +1 -1
- package/build/esm/cc/HumidityControlModeCC.d.ts +5 -5
- package/build/esm/cc/HumidityControlModeCC.d.ts.map +1 -1
- package/build/esm/cc/HumidityControlModeCC.js +2 -3
- package/build/esm/cc/HumidityControlModeCC.js.map +1 -1
- package/build/esm/cc/HumidityControlOperatingStateCC.d.ts +3 -3
- package/build/esm/cc/HumidityControlOperatingStateCC.d.ts.map +1 -1
- package/build/esm/cc/HumidityControlOperatingStateCC.js +2 -2
- package/build/esm/cc/HumidityControlOperatingStateCC.js.map +1 -1
- package/build/esm/cc/HumidityControlSetpointCC.d.ts +6 -6
- package/build/esm/cc/HumidityControlSetpointCC.d.ts.map +1 -1
- package/build/esm/cc/HumidityControlSetpointCC.js +2 -3
- package/build/esm/cc/HumidityControlSetpointCC.js.map +1 -1
- package/build/esm/cc/InclusionControllerCC.d.ts +2 -3
- package/build/esm/cc/InclusionControllerCC.d.ts.map +1 -1
- package/build/esm/cc/InclusionControllerCC.js.map +1 -1
- package/build/esm/cc/IndicatorCC.d.ts +3 -3
- package/build/esm/cc/IndicatorCC.d.ts.map +1 -1
- package/build/esm/cc/IndicatorCC.js +2 -4
- package/build/esm/cc/IndicatorCC.js.map +1 -1
- package/build/esm/cc/IrrigationCC.d.ts +3 -3
- package/build/esm/cc/IrrigationCC.d.ts.map +1 -1
- package/build/esm/cc/IrrigationCC.js +2 -3
- package/build/esm/cc/IrrigationCC.js.map +1 -1
- package/build/esm/cc/LanguageCC.d.ts +5 -6
- package/build/esm/cc/LanguageCC.d.ts.map +1 -1
- package/build/esm/cc/LanguageCC.js +2 -3
- package/build/esm/cc/LanguageCC.js.map +1 -1
- package/build/esm/cc/LockCC.d.ts +4 -4
- package/build/esm/cc/LockCC.d.ts.map +1 -1
- package/build/esm/cc/LockCC.js +2 -2
- package/build/esm/cc/LockCC.js.map +1 -1
- package/build/esm/cc/ManufacturerProprietaryCC.d.ts +3 -3
- package/build/esm/cc/ManufacturerProprietaryCC.d.ts.map +1 -1
- package/build/esm/cc/ManufacturerProprietaryCC.js +2 -2
- package/build/esm/cc/ManufacturerProprietaryCC.js.map +1 -1
- package/build/esm/cc/ManufacturerSpecificCC.d.ts +7 -8
- package/build/esm/cc/ManufacturerSpecificCC.d.ts.map +1 -1
- package/build/esm/cc/ManufacturerSpecificCC.js +2 -3
- package/build/esm/cc/ManufacturerSpecificCC.js.map +1 -1
- package/build/esm/cc/MeterCC.d.ts +4 -6
- package/build/esm/cc/MeterCC.d.ts.map +1 -1
- package/build/esm/cc/MeterCC.js +2 -4
- package/build/esm/cc/MeterCC.js.map +1 -1
- package/build/esm/cc/MultiChannelAssociationCC.d.ts +7 -8
- package/build/esm/cc/MultiChannelAssociationCC.d.ts.map +1 -1
- package/build/esm/cc/MultiChannelAssociationCC.js +2 -3
- package/build/esm/cc/MultiChannelAssociationCC.js.map +1 -1
- package/build/esm/cc/MultiChannelCC.d.ts +11 -11
- package/build/esm/cc/MultiChannelCC.d.ts.map +1 -1
- package/build/esm/cc/MultiChannelCC.js +2 -2
- package/build/esm/cc/MultiChannelCC.js.map +1 -1
- package/build/esm/cc/MultiCommandCC.d.ts +3 -3
- package/build/esm/cc/MultiCommandCC.d.ts.map +1 -1
- package/build/esm/cc/MultiCommandCC.js +2 -2
- package/build/esm/cc/MultiCommandCC.js.map +1 -1
- package/build/esm/cc/MultilevelSensorCC.d.ts +4 -7
- package/build/esm/cc/MultilevelSensorCC.d.ts.map +1 -1
- package/build/esm/cc/MultilevelSensorCC.js +2 -4
- package/build/esm/cc/MultilevelSensorCC.js.map +1 -1
- package/build/esm/cc/MultilevelSwitchCC._validateArgs.js +1 -1
- package/build/esm/cc/MultilevelSwitchCC._validateArgs.js.map +1 -1
- package/build/esm/cc/MultilevelSwitchCC.d.ts +13 -13
- package/build/esm/cc/MultilevelSwitchCC.d.ts.map +1 -1
- package/build/esm/cc/MultilevelSwitchCC.js +2 -3
- package/build/esm/cc/MultilevelSwitchCC.js.map +1 -1
- package/build/esm/cc/NoOperationCC.js +1 -1
- package/build/esm/cc/NoOperationCC.js.map +1 -1
- package/build/esm/cc/NodeNamingCC.d.ts +5 -5
- package/build/esm/cc/NodeNamingCC.d.ts.map +1 -1
- package/build/esm/cc/NodeNamingCC.js +2 -2
- package/build/esm/cc/NodeNamingCC.js.map +1 -1
- package/build/esm/cc/NotificationCC.d.ts +4 -5
- package/build/esm/cc/NotificationCC.d.ts.map +1 -1
- package/build/esm/cc/NotificationCC.js +2 -4
- package/build/esm/cc/NotificationCC.js.map +1 -1
- package/build/esm/cc/PowerlevelCC.d.ts +3 -3
- package/build/esm/cc/PowerlevelCC.d.ts.map +1 -1
- package/build/esm/cc/PowerlevelCC.js +2 -3
- package/build/esm/cc/PowerlevelCC.js.map +1 -1
- package/build/esm/cc/ProtectionCC._validateArgs.js +1 -1
- package/build/esm/cc/ProtectionCC._validateArgs.js.map +1 -1
- package/build/esm/cc/ProtectionCC.d.ts +11 -11
- package/build/esm/cc/ProtectionCC.d.ts.map +1 -1
- package/build/esm/cc/ProtectionCC.js +2 -3
- package/build/esm/cc/ProtectionCC.js.map +1 -1
- package/build/esm/cc/SceneActivationCC._validateArgs.js +1 -1
- package/build/esm/cc/SceneActivationCC._validateArgs.js.map +1 -1
- package/build/esm/cc/SceneActivationCC.d.ts +5 -6
- package/build/esm/cc/SceneActivationCC.d.ts.map +1 -1
- package/build/esm/cc/SceneActivationCC.js +2 -2
- package/build/esm/cc/SceneActivationCC.js.map +1 -1
- package/build/esm/cc/SceneActuatorConfigurationCC._validateArgs.js +1 -1
- package/build/esm/cc/SceneActuatorConfigurationCC._validateArgs.js.map +1 -1
- package/build/esm/cc/SceneActuatorConfigurationCC.d.ts +5 -5
- package/build/esm/cc/SceneActuatorConfigurationCC.d.ts.map +1 -1
- package/build/esm/cc/SceneActuatorConfigurationCC.js +2 -3
- package/build/esm/cc/SceneActuatorConfigurationCC.js.map +1 -1
- package/build/esm/cc/SceneControllerConfigurationCC._validateArgs.js +1 -1
- package/build/esm/cc/SceneControllerConfigurationCC._validateArgs.js.map +1 -1
- package/build/esm/cc/SceneControllerConfigurationCC.d.ts +6 -6
- package/build/esm/cc/SceneControllerConfigurationCC.d.ts.map +1 -1
- package/build/esm/cc/SceneControllerConfigurationCC.js +2 -3
- package/build/esm/cc/SceneControllerConfigurationCC.js.map +1 -1
- package/build/esm/cc/ScheduleEntryLockCC.d.ts +2 -3
- package/build/esm/cc/ScheduleEntryLockCC.d.ts.map +1 -1
- package/build/esm/cc/ScheduleEntryLockCC.js.map +1 -1
- package/build/esm/cc/Security2CC.d.ts +3 -4
- package/build/esm/cc/Security2CC.d.ts.map +1 -1
- package/build/esm/cc/Security2CC.js +2 -4
- package/build/esm/cc/Security2CC.js.map +1 -1
- package/build/esm/cc/SecurityCC.d.ts +3 -4
- package/build/esm/cc/SecurityCC.d.ts.map +1 -1
- package/build/esm/cc/SecurityCC.js +1 -2
- package/build/esm/cc/SecurityCC.js.map +1 -1
- package/build/esm/cc/SoundSwitchCC.d.ts +7 -7
- package/build/esm/cc/SoundSwitchCC.d.ts.map +1 -1
- package/build/esm/cc/SoundSwitchCC.js +2 -3
- package/build/esm/cc/SoundSwitchCC.js.map +1 -1
- package/build/esm/cc/SupervisionCC.d.ts +4 -4
- package/build/esm/cc/SupervisionCC.d.ts.map +1 -1
- package/build/esm/cc/SupervisionCC.js +2 -3
- package/build/esm/cc/SupervisionCC.js.map +1 -1
- package/build/esm/cc/ThermostatFanModeCC.d.ts +6 -6
- package/build/esm/cc/ThermostatFanModeCC.d.ts.map +1 -1
- package/build/esm/cc/ThermostatFanModeCC.js +2 -3
- package/build/esm/cc/ThermostatFanModeCC.js.map +1 -1
- package/build/esm/cc/ThermostatFanStateCC.d.ts +3 -3
- package/build/esm/cc/ThermostatFanStateCC.d.ts.map +1 -1
- package/build/esm/cc/ThermostatFanStateCC.js +2 -2
- package/build/esm/cc/ThermostatFanStateCC.js.map +1 -1
- package/build/esm/cc/ThermostatModeCC.d.ts +6 -6
- package/build/esm/cc/ThermostatModeCC.d.ts.map +1 -1
- package/build/esm/cc/ThermostatModeCC.js +2 -3
- package/build/esm/cc/ThermostatModeCC.js.map +1 -1
- package/build/esm/cc/ThermostatOperatingStateCC.d.ts +3 -4
- package/build/esm/cc/ThermostatOperatingStateCC.d.ts.map +1 -1
- package/build/esm/cc/ThermostatOperatingStateCC.js +2 -2
- package/build/esm/cc/ThermostatOperatingStateCC.js.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 +2 -3
- package/build/esm/cc/ThermostatSetbackCC.js.map +1 -1
- package/build/esm/cc/ThermostatSetpointCC.d.ts +6 -6
- package/build/esm/cc/ThermostatSetpointCC.d.ts.map +1 -1
- package/build/esm/cc/ThermostatSetpointCC.js +2 -3
- package/build/esm/cc/ThermostatSetpointCC.js.map +1 -1
- package/build/esm/cc/TimeCC.d.ts +3 -4
- package/build/esm/cc/TimeCC.d.ts.map +1 -1
- package/build/esm/cc/TimeCC.js +1 -2
- package/build/esm/cc/TimeCC.js.map +1 -1
- package/build/esm/cc/TimeParametersCC.d.ts +3 -4
- package/build/esm/cc/TimeParametersCC.d.ts.map +1 -1
- package/build/esm/cc/TimeParametersCC.js +1 -1
- package/build/esm/cc/TimeParametersCC.js.map +1 -1
- package/build/esm/cc/TransportServiceCC.d.ts +3 -3
- package/build/esm/cc/TransportServiceCC.d.ts.map +1 -1
- package/build/esm/cc/TransportServiceCC.js +2 -3
- package/build/esm/cc/TransportServiceCC.js.map +1 -1
- package/build/esm/cc/UserCodeCC.d.ts +19 -19
- package/build/esm/cc/UserCodeCC.d.ts.map +1 -1
- package/build/esm/cc/UserCodeCC.js +2 -3
- package/build/esm/cc/UserCodeCC.js.map +1 -1
- package/build/esm/cc/VersionCC.d.ts +17 -17
- package/build/esm/cc/VersionCC.d.ts.map +1 -1
- package/build/esm/cc/VersionCC.js +2 -3
- package/build/esm/cc/VersionCC.js.map +1 -1
- package/build/esm/cc/WakeUpCC.d.ts +6 -6
- package/build/esm/cc/WakeUpCC.d.ts.map +1 -1
- package/build/esm/cc/WakeUpCC.js +2 -3
- package/build/esm/cc/WakeUpCC.js.map +1 -1
- package/build/esm/cc/WindowCoveringCC.d.ts +3 -4
- package/build/esm/cc/WindowCoveringCC.d.ts.map +1 -1
- package/build/esm/cc/WindowCoveringCC.js +1 -2
- package/build/esm/cc/WindowCoveringCC.js.map +1 -1
- package/build/esm/cc/ZWavePlusCC.d.ts +8 -8
- package/build/esm/cc/ZWavePlusCC.d.ts.map +1 -1
- package/build/esm/cc/ZWavePlusCC.js +2 -3
- package/build/esm/cc/ZWavePlusCC.js.map +1 -1
- package/build/esm/cc/ZWaveProtocolCC.d.ts +2 -2
- package/build/esm/cc/ZWaveProtocolCC.d.ts.map +1 -1
- package/build/esm/cc/ZWaveProtocolCC.js +1 -1
- package/build/esm/cc/ZWaveProtocolCC.js.map +1 -1
- package/build/esm/cc/_CCValues.generated.d.ts +124 -0
- package/build/esm/cc/_CCValues.generated.d.ts.map +1 -1
- package/build/esm/cc/_CCValues.generated.js +75 -4
- package/build/esm/cc/_CCValues.generated.js.map +1 -1
- package/build/esm/cc/index.d.ts +2 -0
- package/build/esm/cc/index.d.ts.map +1 -1
- package/build/esm/cc/index.js +1 -0
- package/build/esm/cc/index.js.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 +1 -1
- package/build/esm/cc/manufacturerProprietary/FibaroCC.js.map +1 -1
- package/build/esm/lib/API.d.ts +5 -3
- 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 +5 -6
- package/build/esm/lib/CommandClass.d.ts.map +1 -1
- package/build/esm/lib/CommandClass.js +2 -2
- package/build/esm/lib/CommandClass.js.map +1 -1
- package/build/esm/lib/CommandClassDecorators.d.ts +2 -2
- package/build/esm/lib/CommandClassDecorators.d.ts.map +1 -1
- package/build/esm/lib/CommandClassDecorators.js +1 -1
- package/build/esm/lib/CommandClassDecorators.js.map +1 -1
- package/build/esm/lib/Security2/Extension.d.ts +2 -2
- package/build/esm/lib/Security2/Extension.d.ts.map +1 -1
- package/build/esm/lib/Security2/Extension.js +2 -2
- package/build/esm/lib/Security2/Extension.js.map +1 -1
- package/build/esm/lib/SetValueResult.d.ts +1 -1
- package/build/esm/lib/SetValueResult.d.ts.map +1 -1
- package/build/esm/lib/Values.d.ts +3 -3
- package/build/esm/lib/Values.d.ts.map +1 -1
- package/build/esm/lib/Values.js +1 -1
- package/build/esm/lib/Values.js.map +1 -1
- package/build/esm/lib/_Types.d.ts +6 -2
- package/build/esm/lib/_Types.d.ts.map +1 -1
- package/build/esm/lib/_Types.js +6 -1
- package/build/esm/lib/_Types.js.map +1 -1
- package/build/esm/lib/serializers.d.ts +1 -1
- package/build/esm/lib/serializers.d.ts.map +1 -1
- package/build/esm/lib/serializers.js +1 -1
- package/build/esm/lib/serializers.js.map +1 -1
- package/build/esm/lib/traits.d.ts +2 -2
- package/build/esm/lib/traits.d.ts.map +1 -1
- package/build/esm/lib/utils.d.ts +2 -2
- package/build/esm/lib/utils.d.ts.map +1 -1
- package/build/esm/lib/utils.js +2 -2
- package/build/esm/lib/utils.js.map +1 -1
- package/package.json +6 -6
package/build/cjs/cc/WakeUpCC.js
CHANGED
|
@@ -42,9 +42,8 @@ __export(WakeUpCC_exports, {
|
|
|
42
42
|
});
|
|
43
43
|
module.exports = __toCommonJS(WakeUpCC_exports);
|
|
44
44
|
var __validateArgs = __toESM(require("./WakeUpCC._validateArgs.js"), 1);
|
|
45
|
-
var
|
|
46
|
-
var
|
|
47
|
-
var import_safe3 = require("@zwave-js/shared/safe");
|
|
45
|
+
var import_core = require("@zwave-js/core");
|
|
46
|
+
var import_shared = require("@zwave-js/shared");
|
|
48
47
|
var import_math = require("alcalzone-shared/math");
|
|
49
48
|
var import_API = require("../lib/API.js");
|
|
50
49
|
var import_CommandClass = require("../lib/CommandClass.js");
|
|
@@ -94,7 +93,7 @@ var __esDecorate = function(ctor, descriptorIn, decorators, contextIn, initializ
|
|
|
94
93
|
};
|
|
95
94
|
const { validateArgs_WakeUpCCAPI_setInterval } = __validateArgs;
|
|
96
95
|
let WakeUpCCAPI = (() => {
|
|
97
|
-
let _classDecorators = [(0, import_CommandClassDecorators.API)(
|
|
96
|
+
let _classDecorators = [(0, import_CommandClassDecorators.API)(import_core.CommandClasses["Wake Up"])];
|
|
98
97
|
let _classDescriptor;
|
|
99
98
|
let _classExtraInitializers = [];
|
|
100
99
|
let _classThis;
|
|
@@ -139,7 +138,7 @@ let WakeUpCCAPI = (() => {
|
|
|
139
138
|
(0, import_API.throwWrongValueType)(this.ccId, property, "number", typeof value);
|
|
140
139
|
}
|
|
141
140
|
const result = await this.setInterval(value, this.host.ownNodeId ?? 1);
|
|
142
|
-
if (this.isSinglecast() && !(0,
|
|
141
|
+
if (this.isSinglecast() && !(0, import_core.supervisedCommandSucceeded)(result)) {
|
|
143
142
|
this.schedulePoll({ property }, value, { transition: "fast" });
|
|
144
143
|
}
|
|
145
144
|
return result;
|
|
@@ -164,7 +163,7 @@ let WakeUpCCAPI = (() => {
|
|
|
164
163
|
});
|
|
165
164
|
const response = await this.host.sendCommand(cc, this.commandOptions);
|
|
166
165
|
if (response) {
|
|
167
|
-
return (0,
|
|
166
|
+
return (0, import_shared.pick)(response, ["wakeUpInterval", "controllerNodeId"]);
|
|
168
167
|
}
|
|
169
168
|
}
|
|
170
169
|
// eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types
|
|
@@ -176,7 +175,7 @@ let WakeUpCCAPI = (() => {
|
|
|
176
175
|
});
|
|
177
176
|
const response = await this.host.sendCommand(cc, this.commandOptions);
|
|
178
177
|
if (response) {
|
|
179
|
-
return (0,
|
|
178
|
+
return (0, import_shared.pick)(response, [
|
|
180
179
|
"defaultWakeUpInterval",
|
|
181
180
|
"minWakeUpInterval",
|
|
182
181
|
"maxWakeUpInterval",
|
|
@@ -204,12 +203,12 @@ let WakeUpCCAPI = (() => {
|
|
|
204
203
|
await this.host.sendCommand(cc, {
|
|
205
204
|
...this.commandOptions,
|
|
206
205
|
// This command must be sent as part of the wake up queue
|
|
207
|
-
priority:
|
|
206
|
+
priority: import_core.MessagePriority.WakeUp,
|
|
208
207
|
// Don't try to resend this - if we get no response, the node is most likely asleep
|
|
209
208
|
maxSendAttempts: 1,
|
|
210
209
|
// Also we don't want to wait for an ACK because this can lock up the network for seconds
|
|
211
210
|
// if the target node is asleep and doesn't respond to the command
|
|
212
|
-
transmitOptions:
|
|
211
|
+
transmitOptions: import_core.TransmitOptions.DEFAULT_NOACK
|
|
213
212
|
});
|
|
214
213
|
}
|
|
215
214
|
constructor() {
|
|
@@ -220,7 +219,7 @@ let WakeUpCCAPI = (() => {
|
|
|
220
219
|
return WakeUpCCAPI2 = _classThis;
|
|
221
220
|
})();
|
|
222
221
|
let WakeUpCC = (() => {
|
|
223
|
-
let _classDecorators = [(0, import_CommandClassDecorators.commandClass)(
|
|
222
|
+
let _classDecorators = [(0, import_CommandClassDecorators.commandClass)(import_core.CommandClasses["Wake Up"]), (0, import_CommandClassDecorators.implementedVersion)(3), (0, import_CommandClassDecorators.ccValues)(import_CCValues_generated.WakeUpCCValues)];
|
|
224
223
|
let _classDescriptor;
|
|
225
224
|
let _classExtraInitializers = [];
|
|
226
225
|
let _classThis;
|
|
@@ -242,8 +241,8 @@ let WakeUpCC = (() => {
|
|
|
242
241
|
async interview(ctx) {
|
|
243
242
|
const node = this.getNode(ctx);
|
|
244
243
|
const endpoint = this.getEndpoint(ctx);
|
|
245
|
-
const api = import_API.CCAPI.create(
|
|
246
|
-
priority:
|
|
244
|
+
const api = import_API.CCAPI.create(import_core.CommandClasses["Wake Up"], ctx, endpoint).withOptions({
|
|
245
|
+
priority: import_core.MessagePriority.NodeQuery
|
|
247
246
|
});
|
|
248
247
|
ctx.logNode(node.id, {
|
|
249
248
|
endpoint: this.endpointIndex,
|
|
@@ -349,7 +348,7 @@ let WakeUpCCIntervalSet = (() => {
|
|
|
349
348
|
this.controllerNodeId = options.controllerNodeId;
|
|
350
349
|
}
|
|
351
350
|
static from(raw, ctx) {
|
|
352
|
-
(0,
|
|
351
|
+
(0, import_core.validatePayload)(raw.payload.length >= 4);
|
|
353
352
|
const wakeUpInterval = raw.payload.readUIntBE(0, 3);
|
|
354
353
|
const controllerNodeId = raw.payload[3];
|
|
355
354
|
return new this({
|
|
@@ -361,7 +360,7 @@ let WakeUpCCIntervalSet = (() => {
|
|
|
361
360
|
wakeUpInterval;
|
|
362
361
|
controllerNodeId;
|
|
363
362
|
serialize(ctx) {
|
|
364
|
-
this.payload =
|
|
363
|
+
this.payload = import_shared.Bytes.from([
|
|
365
364
|
0,
|
|
366
365
|
0,
|
|
367
366
|
0,
|
|
@@ -409,7 +408,7 @@ let WakeUpCCIntervalReport = (() => {
|
|
|
409
408
|
this.controllerNodeId = options.controllerNodeId;
|
|
410
409
|
}
|
|
411
410
|
static from(raw, ctx) {
|
|
412
|
-
(0,
|
|
411
|
+
(0, import_core.validatePayload)(raw.payload.length >= 4);
|
|
413
412
|
const wakeUpInterval = raw.payload.readUIntBE(0, 3);
|
|
414
413
|
const controllerNodeId = raw.payload[3];
|
|
415
414
|
return new this({
|
|
@@ -530,7 +529,7 @@ let WakeUpCCIntervalCapabilitiesReport = (() => {
|
|
|
530
529
|
this.wakeUpOnDemandSupported = options.wakeUpOnDemandSupported;
|
|
531
530
|
}
|
|
532
531
|
static from(raw, ctx) {
|
|
533
|
-
(0,
|
|
532
|
+
(0, import_core.validatePayload)(raw.payload.length >= 12);
|
|
534
533
|
const minWakeUpInterval = raw.payload.readUIntBE(0, 3);
|
|
535
534
|
const maxWakeUpInterval = raw.payload.readUIntBE(3, 3);
|
|
536
535
|
const defaultWakeUpInterval = raw.payload.readUIntBE(6, 3);
|
|
@@ -557,7 +556,7 @@ let WakeUpCCIntervalCapabilitiesReport = (() => {
|
|
|
557
556
|
endpoint: this.endpointIndex,
|
|
558
557
|
property: "wakeUpInterval"
|
|
559
558
|
}, {
|
|
560
|
-
...
|
|
559
|
+
...import_core.ValueMetadata.WriteOnlyUInt24,
|
|
561
560
|
min: this.minWakeUpInterval,
|
|
562
561
|
max: this.maxWakeUpInterval,
|
|
563
562
|
steps: this.wakeUpIntervalSteps,
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../src/cc/WakeUpCC.ts"],
|
|
4
|
-
"sourcesContent": ["import { type CCEncodingContext, type CCParsingContext } from \"@zwave-js/cc\";\nimport {\n\tCommandClasses,\n\ttype GetValueDB,\n\ttype MaybeNotKnown,\n\ttype MessageOrCCLogEntry,\n\tMessagePriority,\n\ttype SupervisionResult,\n\tTransmitOptions,\n\tValueMetadata,\n\ttype WithAddress,\n\tsupervisedCommandSucceeded,\n\tvalidatePayload,\n} from \"@zwave-js/core/safe\";\nimport { Bytes } from \"@zwave-js/shared/safe\";\nimport { pick } from \"@zwave-js/shared/safe\";\nimport { validateArgs } from \"@zwave-js/transformers\";\nimport { clamp } from \"alcalzone-shared/math\";\nimport {\n\tCCAPI,\n\tPOLL_VALUE,\n\ttype PollValueImplementation,\n\tSET_VALUE,\n\ttype SetValueImplementation,\n\tthrowUnsupportedProperty,\n\tthrowWrongValueType,\n} from \"../lib/API.js\";\nimport {\n\ttype CCRaw,\n\tCommandClass,\n\ttype InterviewContext,\n\ttype PersistValuesContext,\n} from \"../lib/CommandClass.js\";\nimport {\n\tAPI,\n\tCCCommand,\n\tccValueProperty,\n\tccValues,\n\tcommandClass,\n\texpectedCCResponse,\n\timplementedVersion,\n\tuseSupervision,\n} from \"../lib/CommandClassDecorators.js\";\nimport { V } from \"../lib/Values.js\";\nimport { WakeUpCommand } from \"../lib/_Types.js\";\n\nexport const WakeUpCCValues = V.defineCCValues(CommandClasses[\"Wake Up\"], {\n\t...V.staticProperty(\n\t\t\"controllerNodeId\",\n\t\t{\n\t\t\t...ValueMetadata.ReadOnly,\n\t\t\tlabel: \"Node ID of the controller\",\n\t\t} as const,\n\t\t{\n\t\t\tsupportsEndpoints: false,\n\t\t},\n\t),\n\t...V.staticProperty(\n\t\t\"wakeUpInterval\",\n\t\t{\n\t\t\t...ValueMetadata.UInt24,\n\t\t\tlabel: \"Wake Up interval\",\n\t\t} as const,\n\t\t{\n\t\t\tsupportsEndpoints: false,\n\t\t},\n\t),\n\t...V.staticProperty(\"wakeUpOnDemandSupported\", undefined, {\n\t\tinternal: true,\n\t\tsupportsEndpoints: false,\n\t\tminVersion: 3,\n\t}),\n});\n\n@API(CommandClasses[\"Wake Up\"])\nexport class WakeUpCCAPI extends CCAPI {\n\tpublic supportsCommand(cmd: WakeUpCommand): MaybeNotKnown<boolean> {\n\t\tswitch (cmd) {\n\t\t\tcase WakeUpCommand.IntervalGet:\n\t\t\t\treturn this.isSinglecast();\n\t\t\tcase WakeUpCommand.IntervalSet:\n\t\t\tcase WakeUpCommand.NoMoreInformation:\n\t\t\t\treturn true; // This is mandatory\n\t\t\tcase WakeUpCommand.IntervalCapabilitiesGet:\n\t\t\t\treturn this.version >= 2 && this.isSinglecast();\n\t\t}\n\t\treturn super.supportsCommand(cmd);\n\t}\n\n\tprotected override get [SET_VALUE](): SetValueImplementation {\n\t\treturn async function(this: WakeUpCCAPI, { property }, value) {\n\t\t\tif (property !== \"wakeUpInterval\") {\n\t\t\t\tthrowUnsupportedProperty(this.ccId, property);\n\t\t\t}\n\t\t\tif (typeof value !== \"number\") {\n\t\t\t\tthrowWrongValueType(\n\t\t\t\t\tthis.ccId,\n\t\t\t\t\tproperty,\n\t\t\t\t\t\"number\",\n\t\t\t\t\ttypeof value,\n\t\t\t\t);\n\t\t\t}\n\t\t\tconst result = await this.setInterval(\n\t\t\t\tvalue,\n\t\t\t\tthis.host.ownNodeId ?? 1,\n\t\t\t);\n\n\t\t\t// Verify the change after a short delay, unless the command was supervised and successful\n\t\t\tif (this.isSinglecast() && !supervisedCommandSucceeded(result)) {\n\t\t\t\tthis.schedulePoll({ property }, value, { transition: \"fast\" });\n\t\t\t}\n\n\t\t\treturn result;\n\t\t};\n\t}\n\n\tprotected get [POLL_VALUE](): PollValueImplementation {\n\t\treturn async function(this: WakeUpCCAPI, { property }) {\n\t\t\tswitch (property) {\n\t\t\t\tcase \"wakeUpInterval\":\n\t\t\t\t\treturn (await this.getInterval())?.[property];\n\t\t\t\tdefault:\n\t\t\t\t\tthrowUnsupportedProperty(this.ccId, property);\n\t\t\t}\n\t\t};\n\t}\n\n\t// eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types\n\tpublic async getInterval() {\n\t\tthis.assertSupportsCommand(WakeUpCommand, WakeUpCommand.IntervalGet);\n\n\t\tconst cc = new WakeUpCCIntervalGet({\n\t\t\tnodeId: this.endpoint.nodeId,\n\t\t\tendpointIndex: this.endpoint.index,\n\t\t});\n\t\tconst response = await this.host.sendCommand<\n\t\t\tWakeUpCCIntervalReport\n\t\t>(\n\t\t\tcc,\n\t\t\tthis.commandOptions,\n\t\t);\n\t\tif (response) {\n\t\t\treturn pick(response, [\"wakeUpInterval\", \"controllerNodeId\"]);\n\t\t}\n\t}\n\n\t// eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types\n\tpublic async getIntervalCapabilities() {\n\t\tthis.assertSupportsCommand(\n\t\t\tWakeUpCommand,\n\t\t\tWakeUpCommand.IntervalCapabilitiesGet,\n\t\t);\n\n\t\tconst cc = new WakeUpCCIntervalCapabilitiesGet({\n\t\t\tnodeId: this.endpoint.nodeId,\n\t\t\tendpointIndex: this.endpoint.index,\n\t\t});\n\t\tconst response = await this.host.sendCommand<\n\t\t\tWakeUpCCIntervalCapabilitiesReport\n\t\t>(\n\t\t\tcc,\n\t\t\tthis.commandOptions,\n\t\t);\n\t\tif (response) {\n\t\t\treturn pick(response, [\n\t\t\t\t\"defaultWakeUpInterval\",\n\t\t\t\t\"minWakeUpInterval\",\n\t\t\t\t\"maxWakeUpInterval\",\n\t\t\t\t\"wakeUpIntervalSteps\",\n\t\t\t\t\"wakeUpOnDemandSupported\",\n\t\t\t]);\n\t\t}\n\t}\n\n\t@validateArgs()\n\tpublic async setInterval(\n\t\twakeUpInterval: number,\n\t\tcontrollerNodeId: number,\n\t): Promise<SupervisionResult | undefined> {\n\t\tthis.assertSupportsCommand(WakeUpCommand, WakeUpCommand.IntervalSet);\n\n\t\tconst cc = new WakeUpCCIntervalSet({\n\t\t\tnodeId: this.endpoint.nodeId,\n\t\t\tendpointIndex: this.endpoint.index,\n\t\t\twakeUpInterval,\n\t\t\tcontrollerNodeId,\n\t\t});\n\t\treturn this.host.sendCommand(cc, this.commandOptions);\n\t}\n\n\tpublic async sendNoMoreInformation(): Promise<void> {\n\t\tthis.assertSupportsCommand(\n\t\t\tWakeUpCommand,\n\t\t\tWakeUpCommand.NoMoreInformation,\n\t\t);\n\n\t\tconst cc = new WakeUpCCNoMoreInformation({\n\t\t\tnodeId: this.endpoint.nodeId,\n\t\t\tendpointIndex: this.endpoint.index,\n\t\t});\n\t\tawait this.host.sendCommand(cc, {\n\t\t\t...this.commandOptions,\n\t\t\t// This command must be sent as part of the wake up queue\n\t\t\tpriority: MessagePriority.WakeUp,\n\t\t\t// Don't try to resend this - if we get no response, the node is most likely asleep\n\t\t\tmaxSendAttempts: 1,\n\t\t\t// Also we don't want to wait for an ACK because this can lock up the network for seconds\n\t\t\t// if the target node is asleep and doesn't respond to the command\n\t\t\ttransmitOptions: TransmitOptions.DEFAULT_NOACK,\n\t\t});\n\t}\n}\n\n@commandClass(CommandClasses[\"Wake Up\"])\n@implementedVersion(3)\n@ccValues(WakeUpCCValues)\nexport class WakeUpCC extends CommandClass {\n\tdeclare ccCommand: WakeUpCommand;\n\n\tpublic async interview(\n\t\tctx: InterviewContext,\n\t): Promise<void> {\n\t\tconst node = this.getNode(ctx)!;\n\t\tconst endpoint = this.getEndpoint(ctx)!;\n\t\tconst api = CCAPI.create(\n\t\t\tCommandClasses[\"Wake Up\"],\n\t\t\tctx,\n\t\t\tendpoint,\n\t\t).withOptions({\n\t\t\tpriority: MessagePriority.NodeQuery,\n\t\t});\n\n\t\tctx.logNode(node.id, {\n\t\t\tendpoint: this.endpointIndex,\n\t\t\tmessage: `Interviewing ${this.ccName}...`,\n\t\t\tdirection: \"none\",\n\t\t});\n\n\t\tif (node.id === ctx.ownNodeId) {\n\t\t\tctx.logNode(\n\t\t\t\tnode.id,\n\t\t\t\t`skipping wakeup configuration for the controller`,\n\t\t\t);\n\t\t} else if (node.isFrequentListening) {\n\t\t\tctx.logNode(\n\t\t\t\tnode.id,\n\t\t\t\t`skipping wakeup configuration for frequent listening device`,\n\t\t\t);\n\t\t} else {\n\t\t\tlet desiredInterval: number;\n\t\t\tlet currentControllerNodeId: number;\n\t\t\tlet minInterval: number | undefined;\n\t\t\tlet maxInterval: number | undefined;\n\n\t\t\t// Retrieve the allowed wake up intervals and wake on demand support if possible\n\t\t\tif (api.version >= 2) {\n\t\t\t\tctx.logNode(node.id, {\n\t\t\t\t\tendpoint: this.endpointIndex,\n\t\t\t\t\tmessage:\n\t\t\t\t\t\t\"retrieving wakeup capabilities from the device...\",\n\t\t\t\t\tdirection: \"outbound\",\n\t\t\t\t});\n\t\t\t\tconst wakeupCaps = await api.getIntervalCapabilities();\n\t\t\t\tif (wakeupCaps) {\n\t\t\t\t\tconst logMessage = `received wakeup capabilities:\ndefault wakeup interval: ${wakeupCaps.defaultWakeUpInterval} seconds\nminimum wakeup interval: ${wakeupCaps.minWakeUpInterval} seconds\nmaximum wakeup interval: ${wakeupCaps.maxWakeUpInterval} seconds\nwakeup interval steps: ${wakeupCaps.wakeUpIntervalSteps} seconds\nwakeup on demand supported: ${wakeupCaps.wakeUpOnDemandSupported}`;\n\t\t\t\t\tctx.logNode(node.id, {\n\t\t\t\t\t\tendpoint: this.endpointIndex,\n\t\t\t\t\t\tmessage: logMessage,\n\t\t\t\t\t\tdirection: \"inbound\",\n\t\t\t\t\t});\n\t\t\t\t\tminInterval = wakeupCaps.minWakeUpInterval;\n\t\t\t\t\tmaxInterval = wakeupCaps.maxWakeUpInterval;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// SDS14223 prescribes a IntervalSet followed by a check\n\t\t\t// We have no intention of changing the interval (maybe some time in the future)\n\t\t\t// So for now get the current interval and just set the controller ID\n\n\t\t\tctx.logNode(node.id, {\n\t\t\t\tendpoint: this.endpointIndex,\n\t\t\t\tmessage: \"retrieving wakeup interval from the device...\",\n\t\t\t\tdirection: \"outbound\",\n\t\t\t});\n\t\t\tconst wakeupResp = await api.getInterval();\n\n\t\t\tif (wakeupResp) {\n\t\t\t\tconst logMessage = `received wakeup configuration:\nwakeup interval: ${wakeupResp.wakeUpInterval} seconds\ncontroller node: ${wakeupResp.controllerNodeId}`;\n\t\t\t\tctx.logNode(node.id, {\n\t\t\t\t\tendpoint: this.endpointIndex,\n\t\t\t\t\tmessage: logMessage,\n\t\t\t\t\tdirection: \"inbound\",\n\t\t\t\t});\n\n\t\t\t\tdesiredInterval = wakeupResp.wakeUpInterval;\n\t\t\t\tcurrentControllerNodeId = wakeupResp.controllerNodeId;\n\t\t\t} else {\n\t\t\t\t// Just guess, I guess\n\t\t\t\tdesiredInterval = 3600 * 6; // 6 hours\n\t\t\t\tcurrentControllerNodeId = 0; // assume not set\n\t\t\t}\n\n\t\t\tconst ownNodeId = ctx.ownNodeId;\n\t\t\t// Only change the destination if necessary\n\t\t\tif (currentControllerNodeId !== ownNodeId) {\n\t\t\t\t// Spec compliance: Limit the interval to the allowed range, but...\n\t\t\t\t// ...try and preserve a \"never wake up\" configuration (#6367)\n\t\t\t\tif (\n\t\t\t\t\tdesiredInterval !== 0\n\t\t\t\t\t&& minInterval != undefined\n\t\t\t\t\t&& maxInterval != undefined\n\t\t\t\t) {\n\t\t\t\t\tdesiredInterval = clamp(\n\t\t\t\t\t\tdesiredInterval,\n\t\t\t\t\t\tminInterval,\n\t\t\t\t\t\tmaxInterval,\n\t\t\t\t\t);\n\t\t\t\t}\n\n\t\t\t\tctx.logNode(node.id, {\n\t\t\t\t\tendpoint: this.endpointIndex,\n\t\t\t\t\tmessage: \"configuring wakeup destination node\",\n\t\t\t\t\tdirection: \"outbound\",\n\t\t\t\t});\n\t\t\t\tawait api.setInterval(desiredInterval, ownNodeId);\n\t\t\t\tthis.setValue(\n\t\t\t\t\tctx,\n\t\t\t\t\tWakeUpCCValues.controllerNodeId,\n\t\t\t\t\townNodeId,\n\t\t\t\t);\n\t\t\t\tctx.logNode(\n\t\t\t\t\tnode.id,\n\t\t\t\t\t\"wakeup destination node changed!\",\n\t\t\t\t);\n\t\t\t}\n\t\t}\n\n\t\t// Remember that the interview is complete\n\t\tthis.setInterviewComplete(ctx, true);\n\t}\n}\n\n// @publicAPI\nexport interface WakeUpCCIntervalSetOptions {\n\twakeUpInterval: number;\n\tcontrollerNodeId: number;\n}\n\n@CCCommand(WakeUpCommand.IntervalSet)\n@useSupervision()\nexport class WakeUpCCIntervalSet extends WakeUpCC {\n\tpublic constructor(\n\t\toptions: WithAddress<WakeUpCCIntervalSetOptions>,\n\t) {\n\t\tsuper(options);\n\t\tthis.wakeUpInterval = options.wakeUpInterval;\n\t\tthis.controllerNodeId = options.controllerNodeId;\n\t}\n\n\tpublic static from(raw: CCRaw, ctx: CCParsingContext): WakeUpCCIntervalSet {\n\t\tvalidatePayload(raw.payload.length >= 4);\n\t\tconst wakeUpInterval = raw.payload.readUIntBE(0, 3);\n\t\tconst controllerNodeId = raw.payload[3];\n\n\t\treturn new this({\n\t\t\tnodeId: ctx.sourceNodeId,\n\t\t\twakeUpInterval,\n\t\t\tcontrollerNodeId,\n\t\t});\n\t}\n\n\tpublic wakeUpInterval: number;\n\tpublic controllerNodeId: number;\n\n\tpublic serialize(ctx: CCEncodingContext): Promise<Bytes> {\n\t\tthis.payload = Bytes.from([\n\t\t\t0,\n\t\t\t0,\n\t\t\t0, // placeholder\n\t\t\tthis.controllerNodeId,\n\t\t]);\n\t\tthis.payload.writeUIntBE(this.wakeUpInterval, 0, 3);\n\t\treturn super.serialize(ctx);\n\t}\n\n\tpublic toLogEntry(ctx?: GetValueDB): MessageOrCCLogEntry {\n\t\treturn {\n\t\t\t...super.toLogEntry(ctx),\n\t\t\tmessage: {\n\t\t\t\t\"wake-up interval\": `${this.wakeUpInterval} seconds`,\n\t\t\t\t\"controller node id\": this.controllerNodeId,\n\t\t\t},\n\t\t};\n\t}\n}\n\n// @publicAPI\nexport interface WakeUpCCIntervalReportOptions {\n\twakeUpInterval: number;\n\tcontrollerNodeId: number;\n}\n\n@CCCommand(WakeUpCommand.IntervalReport)\n@ccValueProperty(\"wakeUpInterval\", WakeUpCCValues.wakeUpInterval)\n@ccValueProperty(\"controllerNodeId\", WakeUpCCValues.controllerNodeId)\nexport class WakeUpCCIntervalReport extends WakeUpCC {\n\tpublic constructor(\n\t\toptions: WithAddress<WakeUpCCIntervalReportOptions>,\n\t) {\n\t\tsuper(options);\n\n\t\t// TODO: Check implementation:\n\t\tthis.wakeUpInterval = options.wakeUpInterval;\n\t\tthis.controllerNodeId = options.controllerNodeId;\n\t}\n\n\tpublic static from(\n\t\traw: CCRaw,\n\t\tctx: CCParsingContext,\n\t): WakeUpCCIntervalReport {\n\t\tvalidatePayload(raw.payload.length >= 4);\n\t\tconst wakeUpInterval = raw.payload.readUIntBE(0, 3);\n\t\tconst controllerNodeId = raw.payload[3];\n\n\t\treturn new this({\n\t\t\tnodeId: ctx.sourceNodeId,\n\t\t\twakeUpInterval,\n\t\t\tcontrollerNodeId,\n\t\t});\n\t}\n\n\tpublic readonly wakeUpInterval: number;\n\n\tpublic readonly controllerNodeId: number;\n\n\tpublic toLogEntry(ctx?: GetValueDB): MessageOrCCLogEntry {\n\t\treturn {\n\t\t\t...super.toLogEntry(ctx),\n\t\t\tmessage: {\n\t\t\t\t\"wake-up interval\": `${this.wakeUpInterval} seconds`,\n\t\t\t\t\"controller node id\": this.controllerNodeId,\n\t\t\t},\n\t\t};\n\t}\n}\n\n@CCCommand(WakeUpCommand.IntervalGet)\n@expectedCCResponse(WakeUpCCIntervalReport)\nexport class WakeUpCCIntervalGet extends WakeUpCC {}\n\n@CCCommand(WakeUpCommand.WakeUpNotification)\nexport class WakeUpCCWakeUpNotification extends WakeUpCC {}\n\n@CCCommand(WakeUpCommand.NoMoreInformation)\nexport class WakeUpCCNoMoreInformation extends WakeUpCC {}\n\n// @publicAPI\nexport interface WakeUpCCIntervalCapabilitiesReportOptions {\n\tminWakeUpInterval: number;\n\tmaxWakeUpInterval: number;\n\tdefaultWakeUpInterval: number;\n\twakeUpIntervalSteps: number;\n\twakeUpOnDemandSupported: boolean;\n}\n\n@CCCommand(WakeUpCommand.IntervalCapabilitiesReport)\n@ccValueProperty(\n\t\"wakeUpOnDemandSupported\",\n\tWakeUpCCValues.wakeUpOnDemandSupported,\n)\nexport class WakeUpCCIntervalCapabilitiesReport extends WakeUpCC {\n\tpublic constructor(\n\t\toptions: WithAddress<WakeUpCCIntervalCapabilitiesReportOptions>,\n\t) {\n\t\tsuper(options);\n\n\t\t// TODO: Check implementation:\n\t\tthis.minWakeUpInterval = options.minWakeUpInterval;\n\t\tthis.maxWakeUpInterval = options.maxWakeUpInterval;\n\t\tthis.defaultWakeUpInterval = options.defaultWakeUpInterval;\n\t\tthis.wakeUpIntervalSteps = options.wakeUpIntervalSteps;\n\t\tthis.wakeUpOnDemandSupported = options.wakeUpOnDemandSupported;\n\t}\n\n\tpublic static from(\n\t\traw: CCRaw,\n\t\tctx: CCParsingContext,\n\t): WakeUpCCIntervalCapabilitiesReport {\n\t\tvalidatePayload(raw.payload.length >= 12);\n\t\tconst minWakeUpInterval = raw.payload.readUIntBE(0, 3);\n\t\tconst maxWakeUpInterval = raw.payload.readUIntBE(3, 3);\n\t\tconst defaultWakeUpInterval = raw.payload.readUIntBE(6, 3);\n\t\tconst wakeUpIntervalSteps = raw.payload.readUIntBE(9, 3);\n\t\tlet wakeUpOnDemandSupported = false;\n\t\tif (raw.payload.length >= 13) {\n\t\t\t// V3+\n\t\t\twakeUpOnDemandSupported = !!(raw.payload[12] & 0b1);\n\t\t}\n\n\t\treturn new this({\n\t\t\tnodeId: ctx.sourceNodeId,\n\t\t\tminWakeUpInterval,\n\t\t\tmaxWakeUpInterval,\n\t\t\tdefaultWakeUpInterval,\n\t\t\twakeUpIntervalSteps,\n\t\t\twakeUpOnDemandSupported,\n\t\t});\n\t}\n\n\tpublic persistValues(ctx: PersistValuesContext): boolean {\n\t\tif (!super.persistValues(ctx)) return false;\n\t\tconst valueDB = this.getValueDB(ctx);\n\n\t\t// Store the received information as metadata for the wake up interval\n\t\tvalueDB.setMetadata(\n\t\t\t{\n\t\t\t\tcommandClass: this.ccId,\n\t\t\t\tendpoint: this.endpointIndex,\n\t\t\t\tproperty: \"wakeUpInterval\",\n\t\t\t},\n\t\t\t{\n\t\t\t\t...ValueMetadata.WriteOnlyUInt24,\n\t\t\t\tmin: this.minWakeUpInterval,\n\t\t\t\tmax: this.maxWakeUpInterval,\n\t\t\t\tsteps: this.wakeUpIntervalSteps,\n\t\t\t\tdefault: this.defaultWakeUpInterval,\n\t\t\t},\n\t\t);\n\n\t\t// Store wakeUpOnDemandSupported in valueDB\n\n\t\treturn true;\n\t}\n\n\tpublic readonly minWakeUpInterval: number;\n\tpublic readonly maxWakeUpInterval: number;\n\tpublic readonly defaultWakeUpInterval: number;\n\tpublic readonly wakeUpIntervalSteps: number;\n\n\tpublic readonly wakeUpOnDemandSupported: boolean;\n\n\tpublic toLogEntry(ctx?: GetValueDB): MessageOrCCLogEntry {\n\t\treturn {\n\t\t\t...super.toLogEntry(ctx),\n\t\t\tmessage: {\n\t\t\t\t\"default interval\": `${this.defaultWakeUpInterval} seconds`,\n\t\t\t\t\"minimum interval\": `${this.minWakeUpInterval} seconds`,\n\t\t\t\t\"maximum interval\": `${this.maxWakeUpInterval} seconds`,\n\t\t\t\t\"interval steps\": `${this.wakeUpIntervalSteps} seconds`,\n\t\t\t\t\"wake up on demand supported\":\n\t\t\t\t\t`${this.wakeUpOnDemandSupported}`,\n\t\t\t},\n\t\t};\n\t}\n}\n\n@CCCommand(WakeUpCommand.IntervalCapabilitiesGet)\n@expectedCCResponse(WakeUpCCIntervalCapabilitiesReport)\nexport class WakeUpCCIntervalCapabilitiesGet extends WakeUpCC {}\n"],
|
|
5
|
-
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AACA,kBAYO;AACP,
|
|
6
|
-
"names": [
|
|
4
|
+
"sourcesContent": ["import type { CCEncodingContext, CCParsingContext } from \"@zwave-js/cc\";\nimport {\n\tCommandClasses,\n\ttype GetValueDB,\n\ttype MaybeNotKnown,\n\ttype MessageOrCCLogEntry,\n\tMessagePriority,\n\ttype SupervisionResult,\n\tTransmitOptions,\n\tValueMetadata,\n\ttype WithAddress,\n\tsupervisedCommandSucceeded,\n\tvalidatePayload,\n} from \"@zwave-js/core\";\nimport { Bytes, pick } from \"@zwave-js/shared\";\nimport { validateArgs } from \"@zwave-js/transformers\";\nimport { clamp } from \"alcalzone-shared/math\";\nimport {\n\tCCAPI,\n\tPOLL_VALUE,\n\ttype PollValueImplementation,\n\tSET_VALUE,\n\ttype SetValueImplementation,\n\tthrowUnsupportedProperty,\n\tthrowWrongValueType,\n} from \"../lib/API.js\";\nimport {\n\ttype CCRaw,\n\tCommandClass,\n\ttype InterviewContext,\n\ttype PersistValuesContext,\n} from \"../lib/CommandClass.js\";\nimport {\n\tAPI,\n\tCCCommand,\n\tccValueProperty,\n\tccValues,\n\tcommandClass,\n\texpectedCCResponse,\n\timplementedVersion,\n\tuseSupervision,\n} from \"../lib/CommandClassDecorators.js\";\nimport { V } from \"../lib/Values.js\";\nimport { WakeUpCommand } from \"../lib/_Types.js\";\n\nexport const WakeUpCCValues = V.defineCCValues(CommandClasses[\"Wake Up\"], {\n\t...V.staticProperty(\n\t\t\"controllerNodeId\",\n\t\t{\n\t\t\t...ValueMetadata.ReadOnly,\n\t\t\tlabel: \"Node ID of the controller\",\n\t\t} as const,\n\t\t{\n\t\t\tsupportsEndpoints: false,\n\t\t},\n\t),\n\t...V.staticProperty(\n\t\t\"wakeUpInterval\",\n\t\t{\n\t\t\t...ValueMetadata.UInt24,\n\t\t\tlabel: \"Wake Up interval\",\n\t\t} as const,\n\t\t{\n\t\t\tsupportsEndpoints: false,\n\t\t},\n\t),\n\t...V.staticProperty(\"wakeUpOnDemandSupported\", undefined, {\n\t\tinternal: true,\n\t\tsupportsEndpoints: false,\n\t\tminVersion: 3,\n\t}),\n});\n\n@API(CommandClasses[\"Wake Up\"])\nexport class WakeUpCCAPI extends CCAPI {\n\tpublic supportsCommand(cmd: WakeUpCommand): MaybeNotKnown<boolean> {\n\t\tswitch (cmd) {\n\t\t\tcase WakeUpCommand.IntervalGet:\n\t\t\t\treturn this.isSinglecast();\n\t\t\tcase WakeUpCommand.IntervalSet:\n\t\t\tcase WakeUpCommand.NoMoreInformation:\n\t\t\t\treturn true; // This is mandatory\n\t\t\tcase WakeUpCommand.IntervalCapabilitiesGet:\n\t\t\t\treturn this.version >= 2 && this.isSinglecast();\n\t\t}\n\t\treturn super.supportsCommand(cmd);\n\t}\n\n\tprotected override get [SET_VALUE](): SetValueImplementation {\n\t\treturn async function(this: WakeUpCCAPI, { property }, value) {\n\t\t\tif (property !== \"wakeUpInterval\") {\n\t\t\t\tthrowUnsupportedProperty(this.ccId, property);\n\t\t\t}\n\t\t\tif (typeof value !== \"number\") {\n\t\t\t\tthrowWrongValueType(\n\t\t\t\t\tthis.ccId,\n\t\t\t\t\tproperty,\n\t\t\t\t\t\"number\",\n\t\t\t\t\ttypeof value,\n\t\t\t\t);\n\t\t\t}\n\t\t\tconst result = await this.setInterval(\n\t\t\t\tvalue,\n\t\t\t\tthis.host.ownNodeId ?? 1,\n\t\t\t);\n\n\t\t\t// Verify the change after a short delay, unless the command was supervised and successful\n\t\t\tif (this.isSinglecast() && !supervisedCommandSucceeded(result)) {\n\t\t\t\tthis.schedulePoll({ property }, value, { transition: \"fast\" });\n\t\t\t}\n\n\t\t\treturn result;\n\t\t};\n\t}\n\n\tprotected get [POLL_VALUE](): PollValueImplementation {\n\t\treturn async function(this: WakeUpCCAPI, { property }) {\n\t\t\tswitch (property) {\n\t\t\t\tcase \"wakeUpInterval\":\n\t\t\t\t\treturn (await this.getInterval())?.[property];\n\t\t\t\tdefault:\n\t\t\t\t\tthrowUnsupportedProperty(this.ccId, property);\n\t\t\t}\n\t\t};\n\t}\n\n\t// eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types\n\tpublic async getInterval() {\n\t\tthis.assertSupportsCommand(WakeUpCommand, WakeUpCommand.IntervalGet);\n\n\t\tconst cc = new WakeUpCCIntervalGet({\n\t\t\tnodeId: this.endpoint.nodeId,\n\t\t\tendpointIndex: this.endpoint.index,\n\t\t});\n\t\tconst response = await this.host.sendCommand<\n\t\t\tWakeUpCCIntervalReport\n\t\t>(\n\t\t\tcc,\n\t\t\tthis.commandOptions,\n\t\t);\n\t\tif (response) {\n\t\t\treturn pick(response, [\"wakeUpInterval\", \"controllerNodeId\"]);\n\t\t}\n\t}\n\n\t// eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types\n\tpublic async getIntervalCapabilities() {\n\t\tthis.assertSupportsCommand(\n\t\t\tWakeUpCommand,\n\t\t\tWakeUpCommand.IntervalCapabilitiesGet,\n\t\t);\n\n\t\tconst cc = new WakeUpCCIntervalCapabilitiesGet({\n\t\t\tnodeId: this.endpoint.nodeId,\n\t\t\tendpointIndex: this.endpoint.index,\n\t\t});\n\t\tconst response = await this.host.sendCommand<\n\t\t\tWakeUpCCIntervalCapabilitiesReport\n\t\t>(\n\t\t\tcc,\n\t\t\tthis.commandOptions,\n\t\t);\n\t\tif (response) {\n\t\t\treturn pick(response, [\n\t\t\t\t\"defaultWakeUpInterval\",\n\t\t\t\t\"minWakeUpInterval\",\n\t\t\t\t\"maxWakeUpInterval\",\n\t\t\t\t\"wakeUpIntervalSteps\",\n\t\t\t\t\"wakeUpOnDemandSupported\",\n\t\t\t]);\n\t\t}\n\t}\n\n\t@validateArgs()\n\tpublic async setInterval(\n\t\twakeUpInterval: number,\n\t\tcontrollerNodeId: number,\n\t): Promise<SupervisionResult | undefined> {\n\t\tthis.assertSupportsCommand(WakeUpCommand, WakeUpCommand.IntervalSet);\n\n\t\tconst cc = new WakeUpCCIntervalSet({\n\t\t\tnodeId: this.endpoint.nodeId,\n\t\t\tendpointIndex: this.endpoint.index,\n\t\t\twakeUpInterval,\n\t\t\tcontrollerNodeId,\n\t\t});\n\t\treturn this.host.sendCommand(cc, this.commandOptions);\n\t}\n\n\tpublic async sendNoMoreInformation(): Promise<void> {\n\t\tthis.assertSupportsCommand(\n\t\t\tWakeUpCommand,\n\t\t\tWakeUpCommand.NoMoreInformation,\n\t\t);\n\n\t\tconst cc = new WakeUpCCNoMoreInformation({\n\t\t\tnodeId: this.endpoint.nodeId,\n\t\t\tendpointIndex: this.endpoint.index,\n\t\t});\n\t\tawait this.host.sendCommand(cc, {\n\t\t\t...this.commandOptions,\n\t\t\t// This command must be sent as part of the wake up queue\n\t\t\tpriority: MessagePriority.WakeUp,\n\t\t\t// Don't try to resend this - if we get no response, the node is most likely asleep\n\t\t\tmaxSendAttempts: 1,\n\t\t\t// Also we don't want to wait for an ACK because this can lock up the network for seconds\n\t\t\t// if the target node is asleep and doesn't respond to the command\n\t\t\ttransmitOptions: TransmitOptions.DEFAULT_NOACK,\n\t\t});\n\t}\n}\n\n@commandClass(CommandClasses[\"Wake Up\"])\n@implementedVersion(3)\n@ccValues(WakeUpCCValues)\nexport class WakeUpCC extends CommandClass {\n\tdeclare ccCommand: WakeUpCommand;\n\n\tpublic async interview(\n\t\tctx: InterviewContext,\n\t): Promise<void> {\n\t\tconst node = this.getNode(ctx)!;\n\t\tconst endpoint = this.getEndpoint(ctx)!;\n\t\tconst api = CCAPI.create(\n\t\t\tCommandClasses[\"Wake Up\"],\n\t\t\tctx,\n\t\t\tendpoint,\n\t\t).withOptions({\n\t\t\tpriority: MessagePriority.NodeQuery,\n\t\t});\n\n\t\tctx.logNode(node.id, {\n\t\t\tendpoint: this.endpointIndex,\n\t\t\tmessage: `Interviewing ${this.ccName}...`,\n\t\t\tdirection: \"none\",\n\t\t});\n\n\t\tif (node.id === ctx.ownNodeId) {\n\t\t\tctx.logNode(\n\t\t\t\tnode.id,\n\t\t\t\t`skipping wakeup configuration for the controller`,\n\t\t\t);\n\t\t} else if (node.isFrequentListening) {\n\t\t\tctx.logNode(\n\t\t\t\tnode.id,\n\t\t\t\t`skipping wakeup configuration for frequent listening device`,\n\t\t\t);\n\t\t} else {\n\t\t\tlet desiredInterval: number;\n\t\t\tlet currentControllerNodeId: number;\n\t\t\tlet minInterval: number | undefined;\n\t\t\tlet maxInterval: number | undefined;\n\n\t\t\t// Retrieve the allowed wake up intervals and wake on demand support if possible\n\t\t\tif (api.version >= 2) {\n\t\t\t\tctx.logNode(node.id, {\n\t\t\t\t\tendpoint: this.endpointIndex,\n\t\t\t\t\tmessage:\n\t\t\t\t\t\t\"retrieving wakeup capabilities from the device...\",\n\t\t\t\t\tdirection: \"outbound\",\n\t\t\t\t});\n\t\t\t\tconst wakeupCaps = await api.getIntervalCapabilities();\n\t\t\t\tif (wakeupCaps) {\n\t\t\t\t\tconst logMessage = `received wakeup capabilities:\ndefault wakeup interval: ${wakeupCaps.defaultWakeUpInterval} seconds\nminimum wakeup interval: ${wakeupCaps.minWakeUpInterval} seconds\nmaximum wakeup interval: ${wakeupCaps.maxWakeUpInterval} seconds\nwakeup interval steps: ${wakeupCaps.wakeUpIntervalSteps} seconds\nwakeup on demand supported: ${wakeupCaps.wakeUpOnDemandSupported}`;\n\t\t\t\t\tctx.logNode(node.id, {\n\t\t\t\t\t\tendpoint: this.endpointIndex,\n\t\t\t\t\t\tmessage: logMessage,\n\t\t\t\t\t\tdirection: \"inbound\",\n\t\t\t\t\t});\n\t\t\t\t\tminInterval = wakeupCaps.minWakeUpInterval;\n\t\t\t\t\tmaxInterval = wakeupCaps.maxWakeUpInterval;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// SDS14223 prescribes a IntervalSet followed by a check\n\t\t\t// We have no intention of changing the interval (maybe some time in the future)\n\t\t\t// So for now get the current interval and just set the controller ID\n\n\t\t\tctx.logNode(node.id, {\n\t\t\t\tendpoint: this.endpointIndex,\n\t\t\t\tmessage: \"retrieving wakeup interval from the device...\",\n\t\t\t\tdirection: \"outbound\",\n\t\t\t});\n\t\t\tconst wakeupResp = await api.getInterval();\n\n\t\t\tif (wakeupResp) {\n\t\t\t\tconst logMessage = `received wakeup configuration:\nwakeup interval: ${wakeupResp.wakeUpInterval} seconds\ncontroller node: ${wakeupResp.controllerNodeId}`;\n\t\t\t\tctx.logNode(node.id, {\n\t\t\t\t\tendpoint: this.endpointIndex,\n\t\t\t\t\tmessage: logMessage,\n\t\t\t\t\tdirection: \"inbound\",\n\t\t\t\t});\n\n\t\t\t\tdesiredInterval = wakeupResp.wakeUpInterval;\n\t\t\t\tcurrentControllerNodeId = wakeupResp.controllerNodeId;\n\t\t\t} else {\n\t\t\t\t// Just guess, I guess\n\t\t\t\tdesiredInterval = 3600 * 6; // 6 hours\n\t\t\t\tcurrentControllerNodeId = 0; // assume not set\n\t\t\t}\n\n\t\t\tconst ownNodeId = ctx.ownNodeId;\n\t\t\t// Only change the destination if necessary\n\t\t\tif (currentControllerNodeId !== ownNodeId) {\n\t\t\t\t// Spec compliance: Limit the interval to the allowed range, but...\n\t\t\t\t// ...try and preserve a \"never wake up\" configuration (#6367)\n\t\t\t\tif (\n\t\t\t\t\tdesiredInterval !== 0\n\t\t\t\t\t&& minInterval != undefined\n\t\t\t\t\t&& maxInterval != undefined\n\t\t\t\t) {\n\t\t\t\t\tdesiredInterval = clamp(\n\t\t\t\t\t\tdesiredInterval,\n\t\t\t\t\t\tminInterval,\n\t\t\t\t\t\tmaxInterval,\n\t\t\t\t\t);\n\t\t\t\t}\n\n\t\t\t\tctx.logNode(node.id, {\n\t\t\t\t\tendpoint: this.endpointIndex,\n\t\t\t\t\tmessage: \"configuring wakeup destination node\",\n\t\t\t\t\tdirection: \"outbound\",\n\t\t\t\t});\n\t\t\t\tawait api.setInterval(desiredInterval, ownNodeId);\n\t\t\t\tthis.setValue(\n\t\t\t\t\tctx,\n\t\t\t\t\tWakeUpCCValues.controllerNodeId,\n\t\t\t\t\townNodeId,\n\t\t\t\t);\n\t\t\t\tctx.logNode(\n\t\t\t\t\tnode.id,\n\t\t\t\t\t\"wakeup destination node changed!\",\n\t\t\t\t);\n\t\t\t}\n\t\t}\n\n\t\t// Remember that the interview is complete\n\t\tthis.setInterviewComplete(ctx, true);\n\t}\n}\n\n// @publicAPI\nexport interface WakeUpCCIntervalSetOptions {\n\twakeUpInterval: number;\n\tcontrollerNodeId: number;\n}\n\n@CCCommand(WakeUpCommand.IntervalSet)\n@useSupervision()\nexport class WakeUpCCIntervalSet extends WakeUpCC {\n\tpublic constructor(\n\t\toptions: WithAddress<WakeUpCCIntervalSetOptions>,\n\t) {\n\t\tsuper(options);\n\t\tthis.wakeUpInterval = options.wakeUpInterval;\n\t\tthis.controllerNodeId = options.controllerNodeId;\n\t}\n\n\tpublic static from(raw: CCRaw, ctx: CCParsingContext): WakeUpCCIntervalSet {\n\t\tvalidatePayload(raw.payload.length >= 4);\n\t\tconst wakeUpInterval = raw.payload.readUIntBE(0, 3);\n\t\tconst controllerNodeId = raw.payload[3];\n\n\t\treturn new this({\n\t\t\tnodeId: ctx.sourceNodeId,\n\t\t\twakeUpInterval,\n\t\t\tcontrollerNodeId,\n\t\t});\n\t}\n\n\tpublic wakeUpInterval: number;\n\tpublic controllerNodeId: number;\n\n\tpublic serialize(ctx: CCEncodingContext): Promise<Bytes> {\n\t\tthis.payload = Bytes.from([\n\t\t\t0,\n\t\t\t0,\n\t\t\t0, // placeholder\n\t\t\tthis.controllerNodeId,\n\t\t]);\n\t\tthis.payload.writeUIntBE(this.wakeUpInterval, 0, 3);\n\t\treturn super.serialize(ctx);\n\t}\n\n\tpublic toLogEntry(ctx?: GetValueDB): MessageOrCCLogEntry {\n\t\treturn {\n\t\t\t...super.toLogEntry(ctx),\n\t\t\tmessage: {\n\t\t\t\t\"wake-up interval\": `${this.wakeUpInterval} seconds`,\n\t\t\t\t\"controller node id\": this.controllerNodeId,\n\t\t\t},\n\t\t};\n\t}\n}\n\n// @publicAPI\nexport interface WakeUpCCIntervalReportOptions {\n\twakeUpInterval: number;\n\tcontrollerNodeId: number;\n}\n\n@CCCommand(WakeUpCommand.IntervalReport)\n@ccValueProperty(\"wakeUpInterval\", WakeUpCCValues.wakeUpInterval)\n@ccValueProperty(\"controllerNodeId\", WakeUpCCValues.controllerNodeId)\nexport class WakeUpCCIntervalReport extends WakeUpCC {\n\tpublic constructor(\n\t\toptions: WithAddress<WakeUpCCIntervalReportOptions>,\n\t) {\n\t\tsuper(options);\n\n\t\t// TODO: Check implementation:\n\t\tthis.wakeUpInterval = options.wakeUpInterval;\n\t\tthis.controllerNodeId = options.controllerNodeId;\n\t}\n\n\tpublic static from(\n\t\traw: CCRaw,\n\t\tctx: CCParsingContext,\n\t): WakeUpCCIntervalReport {\n\t\tvalidatePayload(raw.payload.length >= 4);\n\t\tconst wakeUpInterval = raw.payload.readUIntBE(0, 3);\n\t\tconst controllerNodeId = raw.payload[3];\n\n\t\treturn new this({\n\t\t\tnodeId: ctx.sourceNodeId,\n\t\t\twakeUpInterval,\n\t\t\tcontrollerNodeId,\n\t\t});\n\t}\n\n\tpublic readonly wakeUpInterval: number;\n\n\tpublic readonly controllerNodeId: number;\n\n\tpublic toLogEntry(ctx?: GetValueDB): MessageOrCCLogEntry {\n\t\treturn {\n\t\t\t...super.toLogEntry(ctx),\n\t\t\tmessage: {\n\t\t\t\t\"wake-up interval\": `${this.wakeUpInterval} seconds`,\n\t\t\t\t\"controller node id\": this.controllerNodeId,\n\t\t\t},\n\t\t};\n\t}\n}\n\n@CCCommand(WakeUpCommand.IntervalGet)\n@expectedCCResponse(WakeUpCCIntervalReport)\nexport class WakeUpCCIntervalGet extends WakeUpCC {}\n\n@CCCommand(WakeUpCommand.WakeUpNotification)\nexport class WakeUpCCWakeUpNotification extends WakeUpCC {}\n\n@CCCommand(WakeUpCommand.NoMoreInformation)\nexport class WakeUpCCNoMoreInformation extends WakeUpCC {}\n\n// @publicAPI\nexport interface WakeUpCCIntervalCapabilitiesReportOptions {\n\tminWakeUpInterval: number;\n\tmaxWakeUpInterval: number;\n\tdefaultWakeUpInterval: number;\n\twakeUpIntervalSteps: number;\n\twakeUpOnDemandSupported: boolean;\n}\n\n@CCCommand(WakeUpCommand.IntervalCapabilitiesReport)\n@ccValueProperty(\n\t\"wakeUpOnDemandSupported\",\n\tWakeUpCCValues.wakeUpOnDemandSupported,\n)\nexport class WakeUpCCIntervalCapabilitiesReport extends WakeUpCC {\n\tpublic constructor(\n\t\toptions: WithAddress<WakeUpCCIntervalCapabilitiesReportOptions>,\n\t) {\n\t\tsuper(options);\n\n\t\t// TODO: Check implementation:\n\t\tthis.minWakeUpInterval = options.minWakeUpInterval;\n\t\tthis.maxWakeUpInterval = options.maxWakeUpInterval;\n\t\tthis.defaultWakeUpInterval = options.defaultWakeUpInterval;\n\t\tthis.wakeUpIntervalSteps = options.wakeUpIntervalSteps;\n\t\tthis.wakeUpOnDemandSupported = options.wakeUpOnDemandSupported;\n\t}\n\n\tpublic static from(\n\t\traw: CCRaw,\n\t\tctx: CCParsingContext,\n\t): WakeUpCCIntervalCapabilitiesReport {\n\t\tvalidatePayload(raw.payload.length >= 12);\n\t\tconst minWakeUpInterval = raw.payload.readUIntBE(0, 3);\n\t\tconst maxWakeUpInterval = raw.payload.readUIntBE(3, 3);\n\t\tconst defaultWakeUpInterval = raw.payload.readUIntBE(6, 3);\n\t\tconst wakeUpIntervalSteps = raw.payload.readUIntBE(9, 3);\n\t\tlet wakeUpOnDemandSupported = false;\n\t\tif (raw.payload.length >= 13) {\n\t\t\t// V3+\n\t\t\twakeUpOnDemandSupported = !!(raw.payload[12] & 0b1);\n\t\t}\n\n\t\treturn new this({\n\t\t\tnodeId: ctx.sourceNodeId,\n\t\t\tminWakeUpInterval,\n\t\t\tmaxWakeUpInterval,\n\t\t\tdefaultWakeUpInterval,\n\t\t\twakeUpIntervalSteps,\n\t\t\twakeUpOnDemandSupported,\n\t\t});\n\t}\n\n\tpublic persistValues(ctx: PersistValuesContext): boolean {\n\t\tif (!super.persistValues(ctx)) return false;\n\t\tconst valueDB = this.getValueDB(ctx);\n\n\t\t// Store the received information as metadata for the wake up interval\n\t\tvalueDB.setMetadata(\n\t\t\t{\n\t\t\t\tcommandClass: this.ccId,\n\t\t\t\tendpoint: this.endpointIndex,\n\t\t\t\tproperty: \"wakeUpInterval\",\n\t\t\t},\n\t\t\t{\n\t\t\t\t...ValueMetadata.WriteOnlyUInt24,\n\t\t\t\tmin: this.minWakeUpInterval,\n\t\t\t\tmax: this.maxWakeUpInterval,\n\t\t\t\tsteps: this.wakeUpIntervalSteps,\n\t\t\t\tdefault: this.defaultWakeUpInterval,\n\t\t\t},\n\t\t);\n\n\t\t// Store wakeUpOnDemandSupported in valueDB\n\n\t\treturn true;\n\t}\n\n\tpublic readonly minWakeUpInterval: number;\n\tpublic readonly maxWakeUpInterval: number;\n\tpublic readonly defaultWakeUpInterval: number;\n\tpublic readonly wakeUpIntervalSteps: number;\n\n\tpublic readonly wakeUpOnDemandSupported: boolean;\n\n\tpublic toLogEntry(ctx?: GetValueDB): MessageOrCCLogEntry {\n\t\treturn {\n\t\t\t...super.toLogEntry(ctx),\n\t\t\tmessage: {\n\t\t\t\t\"default interval\": `${this.defaultWakeUpInterval} seconds`,\n\t\t\t\t\"minimum interval\": `${this.minWakeUpInterval} seconds`,\n\t\t\t\t\"maximum interval\": `${this.maxWakeUpInterval} seconds`,\n\t\t\t\t\"interval steps\": `${this.wakeUpIntervalSteps} seconds`,\n\t\t\t\t\"wake up on demand supported\":\n\t\t\t\t\t`${this.wakeUpOnDemandSupported}`,\n\t\t\t},\n\t\t};\n\t}\n}\n\n@CCCommand(WakeUpCommand.IntervalCapabilitiesGet)\n@expectedCCResponse(WakeUpCCIntervalCapabilitiesReport)\nexport class WakeUpCCIntervalCapabilitiesGet extends WakeUpCC {}\n"],
|
|
5
|
+
"mappings": ";;;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+BACC,GAAG,KAAK,uBAAuB;;;IAGnC;;;;IAKY,mCAA+B,MAAA;8BAF3C,yCAAU,2BAAc,uBAAuB,OAC/C,kDAAmB,kCAAkC,CAAC;;;;oBACF;uDAAA,YAAQ;WAAA;;;;;;;;AAA7D,mBAAA,MAAA,mBAAA,EAAA,OAAA,WAAA,GAAA,kBAAA,EAAA,MAAA,SAAA,MAAA,WAAA,MAAA,UAAA,UAAA,GAAA,MAAA,uBAAA;;;AAAa,wBAAA,YAAA,uBAAA;;;;;",
|
|
6
|
+
"names": []
|
|
7
7
|
}
|
|
@@ -1,7 +1,6 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { CommandClasses, Duration, type GetValueDB, type MessageOrCCLogEntry, type SupervisionResult, type WithAddress } from "@zwave-js/core";
|
|
3
|
-
import {
|
|
4
|
-
import { Bytes } from "@zwave-js/shared/safe";
|
|
1
|
+
import type { CCEncodingContext, CCParsingContext } from "@zwave-js/cc";
|
|
2
|
+
import { CommandClasses, Duration, type GetValueDB, type MaybeNotKnown, type MessageOrCCLogEntry, type SupervisionResult, type WithAddress } from "@zwave-js/core";
|
|
3
|
+
import { Bytes } from "@zwave-js/shared";
|
|
5
4
|
import { CCAPI, POLL_VALUE, type PollValueImplementation, SET_VALUE, SET_VALUE_HOOKS, type SetValueImplementation, type SetValueImplementationHooksFactory } from "../lib/API.js";
|
|
6
5
|
import { type CCRaw, CommandClass, type InterviewContext } from "../lib/CommandClass.js";
|
|
7
6
|
import { type LevelChangeDirection, WindowCoveringCommand, WindowCoveringParameter } from "../lib/_Types.js";
|
|
@@ -43,8 +43,7 @@ __export(WindowCoveringCC_exports, {
|
|
|
43
43
|
module.exports = __toCommonJS(WindowCoveringCC_exports);
|
|
44
44
|
var __validateArgs = __toESM(require("./WindowCoveringCC._validateArgs.js"), 1);
|
|
45
45
|
var import_core = require("@zwave-js/core");
|
|
46
|
-
var
|
|
47
|
-
var import_safe2 = require("@zwave-js/shared/safe");
|
|
46
|
+
var import_shared = require("@zwave-js/shared");
|
|
48
47
|
var import_API = require("../lib/API.js");
|
|
49
48
|
var import_CCValueUtils = require("../lib/CCValueUtils.js");
|
|
50
49
|
var import_CommandClass = require("../lib/CommandClass.js");
|
|
@@ -262,7 +261,7 @@ let WindowCoveringCCAPI = (() => {
|
|
|
262
261
|
});
|
|
263
262
|
const response = await this.host.sendCommand(cc, this.commandOptions);
|
|
264
263
|
if (response) {
|
|
265
|
-
return (0,
|
|
264
|
+
return (0, import_shared.pick)(response, ["currentValue", "targetValue", "duration"]);
|
|
266
265
|
}
|
|
267
266
|
}
|
|
268
267
|
async set(targetValues, duration) {
|
|
@@ -337,7 +336,7 @@ let WindowCoveringCC = (() => {
|
|
|
337
336
|
const supported = await api.getSupported();
|
|
338
337
|
if (supported?.length) {
|
|
339
338
|
const logMessage = `supported window covering parameters:
|
|
340
|
-
${supported.map((p) => `\xB7 ${(0,
|
|
339
|
+
${supported.map((p) => `\xB7 ${(0, import_shared.getEnumMemberName)(import_Types.WindowCoveringParameter, p)}`).join("\n")}`;
|
|
341
340
|
ctx.logNode(node.id, {
|
|
342
341
|
endpoint: this.endpointIndex,
|
|
343
342
|
message: logMessage,
|
|
@@ -352,7 +351,7 @@ ${supported.map((p) => `\xB7 ${(0, import_safe2.getEnumMemberName)(import_Types.
|
|
|
352
351
|
if (param % 2 === 1) {
|
|
353
352
|
ctx.logNode(node.id, {
|
|
354
353
|
endpoint: this.endpointIndex,
|
|
355
|
-
message: `querying position for parameter ${(0,
|
|
354
|
+
message: `querying position for parameter ${(0, import_shared.getEnumMemberName)(import_Types.WindowCoveringParameter, param)}...`,
|
|
356
355
|
direction: "outbound"
|
|
357
356
|
});
|
|
358
357
|
await api.get(param);
|
|
@@ -363,7 +362,7 @@ ${supported.map((p) => `\xB7 ${(0, import_safe2.getEnumMemberName)(import_Types.
|
|
|
363
362
|
}
|
|
364
363
|
translatePropertyKey(ctx, property, propertyKey) {
|
|
365
364
|
if (typeof propertyKey === "number") {
|
|
366
|
-
return (0,
|
|
365
|
+
return (0, import_shared.getEnumMemberName)(import_Types.WindowCoveringParameter, propertyKey);
|
|
367
366
|
}
|
|
368
367
|
return super.translatePropertyKey(ctx, property, propertyKey);
|
|
369
368
|
}
|
|
@@ -409,8 +408,8 @@ let WindowCoveringCCSupportedReport = (() => {
|
|
|
409
408
|
serialize(ctx) {
|
|
410
409
|
const bitmask = (0, import_core.encodeBitMask)(this.supportedParameters, void 0, import_Types.WindowCoveringParameter["Outbound Left (no position)"]).subarray(0, 15);
|
|
411
410
|
const numBitmaskBytes = bitmask.length & 15;
|
|
412
|
-
this.payload =
|
|
413
|
-
|
|
411
|
+
this.payload = import_shared.Bytes.concat([
|
|
412
|
+
import_shared.Bytes.from([numBitmaskBytes]),
|
|
414
413
|
bitmask.subarray(0, numBitmaskBytes)
|
|
415
414
|
]);
|
|
416
415
|
return super.serialize(ctx);
|
|
@@ -420,7 +419,7 @@ let WindowCoveringCCSupportedReport = (() => {
|
|
|
420
419
|
...super.toLogEntry(ctx),
|
|
421
420
|
message: {
|
|
422
421
|
"supported parameters": this.supportedParameters.map((p) => `
|
|
423
|
-
\xB7 ${(0,
|
|
422
|
+
\xB7 ${(0, import_shared.getEnumMemberName)(import_Types.WindowCoveringParameter, p)}`).join("")
|
|
424
423
|
}
|
|
425
424
|
};
|
|
426
425
|
}
|
|
@@ -499,7 +498,7 @@ let WindowCoveringCCReport = (() => {
|
|
|
499
498
|
return {
|
|
500
499
|
...super.toLogEntry(ctx),
|
|
501
500
|
message: {
|
|
502
|
-
parameter: (0,
|
|
501
|
+
parameter: (0, import_shared.getEnumMemberName)(import_Types.WindowCoveringParameter, this.parameter),
|
|
503
502
|
"current value": this.currentValue,
|
|
504
503
|
"target value": this.targetValue,
|
|
505
504
|
duration: this.duration.toString()
|
|
@@ -547,14 +546,14 @@ let WindowCoveringCCGet = (() => {
|
|
|
547
546
|
}
|
|
548
547
|
parameter;
|
|
549
548
|
serialize(ctx) {
|
|
550
|
-
this.payload =
|
|
549
|
+
this.payload = import_shared.Bytes.from([this.parameter]);
|
|
551
550
|
return super.serialize(ctx);
|
|
552
551
|
}
|
|
553
552
|
toLogEntry(ctx) {
|
|
554
553
|
return {
|
|
555
554
|
...super.toLogEntry(ctx),
|
|
556
555
|
message: {
|
|
557
|
-
parameter: (0,
|
|
556
|
+
parameter: (0, import_shared.getEnumMemberName)(import_Types.WindowCoveringParameter, this.parameter)
|
|
558
557
|
}
|
|
559
558
|
};
|
|
560
559
|
}
|
|
@@ -612,7 +611,7 @@ let WindowCoveringCCSet = (() => {
|
|
|
612
611
|
duration;
|
|
613
612
|
serialize(ctx) {
|
|
614
613
|
const numEntries = this.targetValues.length & 31;
|
|
615
|
-
this.payload = new
|
|
614
|
+
this.payload = new import_shared.Bytes(2 + numEntries * 2);
|
|
616
615
|
this.payload[0] = numEntries;
|
|
617
616
|
for (let i = 0; i < numEntries; i++) {
|
|
618
617
|
const offset = 1 + i * 2;
|
|
@@ -625,7 +624,7 @@ let WindowCoveringCCSet = (() => {
|
|
|
625
624
|
toLogEntry(ctx) {
|
|
626
625
|
const message = {};
|
|
627
626
|
for (const { parameter, value } of this.targetValues) {
|
|
628
|
-
message[(0,
|
|
627
|
+
message[(0, import_shared.getEnumMemberName)(import_Types.WindowCoveringParameter, parameter)] = value;
|
|
629
628
|
}
|
|
630
629
|
if (this.duration) {
|
|
631
630
|
message.duration = this.duration.toString();
|
|
@@ -683,7 +682,7 @@ let WindowCoveringCCStartLevelChange = (() => {
|
|
|
683
682
|
direction;
|
|
684
683
|
duration;
|
|
685
684
|
serialize(ctx) {
|
|
686
|
-
this.payload =
|
|
685
|
+
this.payload = import_shared.Bytes.from([
|
|
687
686
|
this.direction === "down" ? 64 : 0,
|
|
688
687
|
this.parameter,
|
|
689
688
|
(this.duration ?? import_core.Duration.default()).serializeSet()
|
|
@@ -692,7 +691,7 @@ let WindowCoveringCCStartLevelChange = (() => {
|
|
|
692
691
|
}
|
|
693
692
|
toLogEntry(ctx) {
|
|
694
693
|
const message = {
|
|
695
|
-
parameter: (0,
|
|
694
|
+
parameter: (0, import_shared.getEnumMemberName)(import_Types.WindowCoveringParameter, this.parameter),
|
|
696
695
|
direction: this.direction
|
|
697
696
|
};
|
|
698
697
|
if (this.duration) {
|
|
@@ -740,14 +739,14 @@ let WindowCoveringCCStopLevelChange = (() => {
|
|
|
740
739
|
}
|
|
741
740
|
parameter;
|
|
742
741
|
serialize(ctx) {
|
|
743
|
-
this.payload =
|
|
742
|
+
this.payload = import_shared.Bytes.from([this.parameter]);
|
|
744
743
|
return super.serialize(ctx);
|
|
745
744
|
}
|
|
746
745
|
toLogEntry(ctx) {
|
|
747
746
|
return {
|
|
748
747
|
...super.toLogEntry(ctx),
|
|
749
748
|
message: {
|
|
750
|
-
parameter: (0,
|
|
749
|
+
parameter: (0, import_shared.getEnumMemberName)(import_Types.WindowCoveringParameter, this.parameter)
|
|
751
750
|
}
|
|
752
751
|
};
|
|
753
752
|
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../src/cc/WindowCoveringCC.ts"],
|
|
4
|
-
"sourcesContent": ["import { type CCEncodingContext, type CCParsingContext } from \"@zwave-js/cc\";\nimport {\n\tCommandClasses,\n\tDuration,\n\ttype GetValueDB,\n\ttype MessageOrCCLogEntry,\n\tMessagePriority,\n\ttype MessageRecord,\n\ttype SupervisionResult,\n\tValueMetadata,\n\ttype WithAddress,\n\tencodeBitMask,\n\tparseBitMask,\n\tvalidatePayload,\n} from \"@zwave-js/core\";\nimport { type MaybeNotKnown } from \"@zwave-js/core/safe\";\nimport { Bytes } from \"@zwave-js/shared/safe\";\nimport { getEnumMemberName, pick } from \"@zwave-js/shared/safe\";\nimport { validateArgs } from \"@zwave-js/transformers\";\nimport {\n\tCCAPI,\n\tPOLL_VALUE,\n\ttype PollValueImplementation,\n\tSET_VALUE,\n\tSET_VALUE_HOOKS,\n\ttype SetValueImplementation,\n\ttype SetValueImplementationHooksFactory,\n\tthrowMissingPropertyKey,\n\tthrowUnsupportedProperty,\n\tthrowUnsupportedPropertyKey,\n\tthrowWrongValueType,\n} from \"../lib/API.js\";\nimport {\n\twindowCoveringParameterToLevelChangeLabel,\n\twindowCoveringParameterToMetadataStates,\n} from \"../lib/CCValueUtils.js\";\nimport {\n\ttype CCRaw,\n\tCommandClass,\n\ttype InterviewContext,\n} from \"../lib/CommandClass.js\";\nimport {\n\tAPI,\n\tCCCommand,\n\tccValueProperty,\n\tccValues,\n\tcommandClass,\n\texpectedCCResponse,\n\timplementedVersion,\n\tuseSupervision,\n} from \"../lib/CommandClassDecorators.js\";\nimport { V } from \"../lib/Values.js\";\nimport {\n\ttype LevelChangeDirection,\n\tWindowCoveringCommand,\n\tWindowCoveringParameter,\n} from \"../lib/_Types.js\";\n\nexport const WindowCoveringCCValues = V.defineCCValues(\n\tCommandClasses[\"Window Covering\"],\n\t{\n\t\t...V.staticProperty(\n\t\t\t\"supportedParameters\",\n\t\t\tundefined, // meta\n\t\t\t{ internal: true }, // value options\n\t\t),\n\t\t...V.dynamicPropertyAndKeyWithName(\n\t\t\t\"currentValue\",\n\t\t\t\"currentValue\",\n\t\t\t(parameter: WindowCoveringParameter) => parameter,\n\t\t\t({ property, propertyKey }) =>\n\t\t\t\tproperty === \"currentValue\" && typeof propertyKey === \"number\",\n\t\t\t(parameter: WindowCoveringParameter) => {\n\t\t\t\treturn {\n\t\t\t\t\t...ValueMetadata.ReadOnlyLevel,\n\t\t\t\t\tlabel: `Current value - ${\n\t\t\t\t\t\tgetEnumMemberName(\n\t\t\t\t\t\t\tWindowCoveringParameter,\n\t\t\t\t\t\t\tparameter,\n\t\t\t\t\t\t)\n\t\t\t\t\t}`,\n\t\t\t\t\tstates: windowCoveringParameterToMetadataStates(parameter),\n\t\t\t\t\tccSpecific: { parameter },\n\t\t\t\t} as const;\n\t\t\t},\n\t\t),\n\t\t...V.dynamicPropertyAndKeyWithName(\n\t\t\t\"targetValue\",\n\t\t\t\"targetValue\",\n\t\t\t(parameter: WindowCoveringParameter) => parameter,\n\t\t\t({ property, propertyKey }) =>\n\t\t\t\tproperty === \"targetValue\" && typeof propertyKey === \"number\",\n\t\t\t(parameter: WindowCoveringParameter) => {\n\t\t\t\t// Only odd-numbered parameters have position support and are writable\n\t\t\t\tconst writeable = parameter % 2 === 1;\n\t\t\t\treturn {\n\t\t\t\t\t...ValueMetadata.Level,\n\t\t\t\t\tlabel: `Target value - ${\n\t\t\t\t\t\tgetEnumMemberName(\n\t\t\t\t\t\t\tWindowCoveringParameter,\n\t\t\t\t\t\t\tparameter,\n\t\t\t\t\t\t)\n\t\t\t\t\t}`,\n\t\t\t\t\t// Only odd-numbered parameters have position support and are writable\n\t\t\t\t\twriteable: parameter % 2 === 1,\n\t\t\t\t\tstates: windowCoveringParameterToMetadataStates(parameter),\n\t\t\t\t\tallowManualEntry: writeable,\n\t\t\t\t\tccSpecific: { parameter },\n\t\t\t\t\tvalueChangeOptions: [\"transitionDuration\"],\n\t\t\t\t} as const;\n\t\t\t},\n\t\t),\n\t\t...V.dynamicPropertyAndKeyWithName(\n\t\t\t\"duration\",\n\t\t\t\"duration\",\n\t\t\t(parameter: WindowCoveringParameter) => parameter,\n\t\t\t({ property, propertyKey }) =>\n\t\t\t\tproperty === \"duration\" && typeof propertyKey === \"number\",\n\t\t\t(parameter: WindowCoveringParameter) => ({\n\t\t\t\t...ValueMetadata.ReadOnlyDuration,\n\t\t\t\tlabel: `Remaining duration - ${\n\t\t\t\t\tgetEnumMemberName(\n\t\t\t\t\t\tWindowCoveringParameter,\n\t\t\t\t\t\tparameter,\n\t\t\t\t\t)\n\t\t\t\t}`,\n\t\t\t\tccSpecific: {\n\t\t\t\t\tparameter,\n\t\t\t\t},\n\t\t\t} as const),\n\t\t),\n\t\t...V.dynamicPropertyAndKeyWithName(\n\t\t\t\"levelChangeUp\",\n\t\t\t// The direction refers to the change in level, not the physical location\n\t\t\t\"levelChangeUp\",\n\t\t\t(parameter: WindowCoveringParameter) => parameter,\n\t\t\t({ property, propertyKey }) =>\n\t\t\t\tproperty === \"levelChangeUp\" && typeof propertyKey === \"number\",\n\t\t\t(parameter: WindowCoveringParameter) => {\n\t\t\t\treturn {\n\t\t\t\t\t...ValueMetadata.WriteOnlyBoolean,\n\t\t\t\t\tlabel: `${\n\t\t\t\t\t\twindowCoveringParameterToLevelChangeLabel(\n\t\t\t\t\t\t\tparameter,\n\t\t\t\t\t\t\t\"up\",\n\t\t\t\t\t\t)\n\t\t\t\t\t} - ${\n\t\t\t\t\t\tgetEnumMemberName(\n\t\t\t\t\t\t\tWindowCoveringParameter,\n\t\t\t\t\t\t\tparameter,\n\t\t\t\t\t\t)\n\t\t\t\t\t}`,\n\t\t\t\t\tvalueChangeOptions: [\"transitionDuration\"],\n\t\t\t\t\tstates: {\n\t\t\t\t\t\ttrue: \"Start\",\n\t\t\t\t\t\tfalse: \"Stop\",\n\t\t\t\t\t},\n\t\t\t\t\tccSpecific: { parameter },\n\t\t\t\t} as const;\n\t\t\t},\n\t\t),\n\t\t...V.dynamicPropertyAndKeyWithName(\n\t\t\t\"levelChangeDown\",\n\t\t\t// The direction refers to the change in level, not the physical location\n\t\t\t\"levelChangeDown\",\n\t\t\t(parameter: WindowCoveringParameter) => parameter,\n\t\t\t({ property, propertyKey }) =>\n\t\t\t\tproperty === \"levelChangeDown\"\n\t\t\t\t&& typeof propertyKey === \"number\",\n\t\t\t(parameter: WindowCoveringParameter) => {\n\t\t\t\treturn {\n\t\t\t\t\t...ValueMetadata.WriteOnlyBoolean,\n\t\t\t\t\tlabel: `${\n\t\t\t\t\t\twindowCoveringParameterToLevelChangeLabel(\n\t\t\t\t\t\t\tparameter,\n\t\t\t\t\t\t\t\"down\",\n\t\t\t\t\t\t)\n\t\t\t\t\t} - ${\n\t\t\t\t\t\tgetEnumMemberName(\n\t\t\t\t\t\t\tWindowCoveringParameter,\n\t\t\t\t\t\t\tparameter,\n\t\t\t\t\t\t)\n\t\t\t\t\t}`,\n\t\t\t\t\tvalueChangeOptions: [\"transitionDuration\"],\n\t\t\t\t\tstates: {\n\t\t\t\t\t\ttrue: \"Start\",\n\t\t\t\t\t\tfalse: \"Stop\",\n\t\t\t\t\t},\n\t\t\t\t\tccSpecific: { parameter },\n\t\t\t\t} as const;\n\t\t\t},\n\t\t),\n\t},\n);\n\n@API(CommandClasses[\"Window Covering\"])\nexport class WindowCoveringCCAPI extends CCAPI {\n\tpublic supportsCommand(cmd: WindowCoveringCommand): MaybeNotKnown<boolean> {\n\t\tswitch (cmd) {\n\t\t\tcase WindowCoveringCommand.Get:\n\t\t\tcase WindowCoveringCommand.Set:\n\t\t\tcase WindowCoveringCommand.SupportedGet:\n\t\t\tcase WindowCoveringCommand.StartLevelChange:\n\t\t\tcase WindowCoveringCommand.StopLevelChange:\n\t\t\t\treturn true; // This is mandatory\n\t\t}\n\t\treturn super.supportsCommand(cmd);\n\t}\n\n\tprotected override get [SET_VALUE](): SetValueImplementation {\n\t\treturn async function(\n\t\t\tthis: WindowCoveringCCAPI,\n\t\t\t{ property, propertyKey },\n\t\t\tvalue,\n\t\t\toptions,\n\t\t) {\n\t\t\tconst valueId = {\n\t\t\t\tcommandClass: this.ccId,\n\t\t\t\tproperty,\n\t\t\t\tpropertyKey,\n\t\t\t};\n\n\t\t\tif (WindowCoveringCCValues.targetValue.is(valueId)) {\n\t\t\t\tif (\n\t\t\t\t\ttypeof propertyKey !== \"number\"\n\t\t\t\t\t// Only odd-numbered parameters have position support and are writable\n\t\t\t\t\t|| propertyKey % 2 === 0\n\t\t\t\t) {\n\t\t\t\t\tthrowUnsupportedPropertyKey(\n\t\t\t\t\t\tthis.ccId,\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}\n\n\t\t\t\tif (typeof value !== \"number\") {\n\t\t\t\t\tthrowWrongValueType(\n\t\t\t\t\t\tthis.ccId,\n\t\t\t\t\t\tproperty,\n\t\t\t\t\t\t\"number\",\n\t\t\t\t\t\ttypeof value,\n\t\t\t\t\t);\n\t\t\t\t}\n\n\t\t\t\tconst parameter = propertyKey;\n\t\t\t\tconst duration = Duration.from(options?.transitionDuration);\n\n\t\t\t\treturn this.set([{ parameter, value }], duration);\n\t\t\t} else if (\n\t\t\t\tWindowCoveringCCValues.levelChangeUp.is(valueId)\n\t\t\t\t|| WindowCoveringCCValues.levelChangeDown.is(valueId)\n\t\t\t) {\n\t\t\t\tif (typeof value !== \"boolean\") {\n\t\t\t\t\tthrowWrongValueType(\n\t\t\t\t\t\tthis.ccId,\n\t\t\t\t\t\tproperty,\n\t\t\t\t\t\t\"boolean\",\n\t\t\t\t\t\ttypeof value,\n\t\t\t\t\t);\n\t\t\t\t}\n\n\t\t\t\tconst parameter = propertyKey as number;\n\t\t\t\tconst direction = WindowCoveringCCValues.levelChangeUp.is(\n\t\t\t\t\t\tvalueId,\n\t\t\t\t\t)\n\t\t\t\t\t? \"up\"\n\t\t\t\t\t: \"down\";\n\n\t\t\t\tif (value) {\n\t\t\t\t\t// Perform the level change\n\t\t\t\t\tconst duration = Duration.from(options?.transitionDuration);\n\t\t\t\t\treturn this.startLevelChange(\n\t\t\t\t\t\tparameter,\n\t\t\t\t\t\tdirection,\n\t\t\t\t\t\tduration,\n\t\t\t\t\t);\n\t\t\t\t} else {\n\t\t\t\t\treturn this.stopLevelChange(parameter);\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tthrowUnsupportedProperty(this.ccId, property);\n\t\t\t}\n\t\t};\n\t}\n\n\tprotected [SET_VALUE_HOOKS]: SetValueImplementationHooksFactory = (\n\t\t{ property, propertyKey },\n\t\tvalue,\n\t\toptions,\n\t) => {\n\t\tconst valueId = {\n\t\t\tcommandClass: this.ccId,\n\t\t\tproperty,\n\t\t\tpropertyKey,\n\t\t};\n\n\t\tif (WindowCoveringCCValues.targetValue.is(valueId)) {\n\t\t\tif (typeof propertyKey !== \"number\") return;\n\t\t\tconst parameter = propertyKey;\n\n\t\t\tconst duration = Duration.from(options?.transitionDuration);\n\n\t\t\tconst currentValueValueId = WindowCoveringCCValues.currentValue(\n\t\t\t\tparameter,\n\t\t\t).endpoint(this.endpoint.index);\n\n\t\t\treturn {\n\t\t\t\t// Window Covering commands may take some time to be executed.\n\t\t\t\t// Therefore we try to supervise the command execution and delay the\n\t\t\t\t// optimistic update until the final result is received.\n\t\t\t\tsupervisionDelayedUpdates: true,\n\t\t\t\tsupervisionOnSuccess: async () => {\n\t\t\t\t\t// Only update currentValue for valid target values\n\t\t\t\t\tif (\n\t\t\t\t\t\ttypeof value === \"number\"\n\t\t\t\t\t\t&& value >= 0\n\t\t\t\t\t\t&& value <= 99\n\t\t\t\t\t) {\n\t\t\t\t\t\tthis.tryGetValueDB()?.setValue(\n\t\t\t\t\t\t\tcurrentValueValueId,\n\t\t\t\t\t\t\tvalue,\n\t\t\t\t\t\t);\n\t\t\t\t\t} else if (value === 255) {\n\t\t\t\t\t\t// We don't know the status now, so refresh the current value\n\t\t\t\t\t\ttry {\n\t\t\t\t\t\t\tawait this.get(parameter);\n\t\t\t\t\t\t} catch {\n\t\t\t\t\t\t\t// ignore\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t},\n\t\t\t\tsupervisionOnFailure: async () => {\n\t\t\t\t\t// The transition failed, so now we don't know the status - refresh the current value\n\t\t\t\t\ttry {\n\t\t\t\t\t\tawait this.get(parameter);\n\t\t\t\t\t} catch {\n\t\t\t\t\t\t// ignore\n\t\t\t\t\t}\n\t\t\t\t},\n\n\t\t\t\toptimisticallyUpdateRelatedValues: (\n\t\t\t\t\t_supervisedAndSuccessful,\n\t\t\t\t) => {\n\t\t\t\t\t// Only update currentValue for valid target values\n\t\t\t\t\tif (\n\t\t\t\t\t\ttypeof value === \"number\"\n\t\t\t\t\t\t&& value >= 0\n\t\t\t\t\t\t&& value <= 99\n\t\t\t\t\t) {\n\t\t\t\t\t\tif (this.isSinglecast()) {\n\t\t\t\t\t\t\tthis.tryGetValueDB()?.setValue(\n\t\t\t\t\t\t\t\tcurrentValueValueId,\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 if (this.isMulticast()) {\n\t\t\t\t\t\t\t// Figure out which nodes were affected by this command\n\t\t\t\t\t\t\tconst affectedNodes = this.endpoint.node\n\t\t\t\t\t\t\t\t.physicalNodes.filter(\n\t\t\t\t\t\t\t\t\t(node) =>\n\t\t\t\t\t\t\t\t\t\tnode\n\t\t\t\t\t\t\t\t\t\t\t.getEndpoint(this.endpoint.index)\n\t\t\t\t\t\t\t\t\t\t\t?.supportsCC(this.ccId),\n\t\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\t// and optimistically update the currentValue\n\t\t\t\t\t\t\tfor (const node of affectedNodes) {\n\t\t\t\t\t\t\t\tthis.host\n\t\t\t\t\t\t\t\t\t.tryGetValueDB(node.id)\n\t\t\t\t\t\t\t\t\t?.setValue(currentValueValueId, value);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t},\n\n\t\t\t\tverifyChanges: () => {\n\t\t\t\t\tif (this.isSinglecast()) {\n\t\t\t\t\t\t// We query currentValue instead of targetValue to make sure that unsolicited updates cancel the scheduled poll\n\t\t\t\t\t\tthis.schedulePoll(currentValueValueId, value, {\n\t\t\t\t\t\t\tduration,\n\t\t\t\t\t\t});\n\t\t\t\t\t} else {\n\t\t\t\t\t\t// For multicasts, do not schedule a refresh - this could cause a LOT of traffic\n\t\t\t\t\t}\n\t\t\t\t},\n\t\t\t};\n\t\t}\n\t};\n\n\tprotected get [POLL_VALUE](): PollValueImplementation {\n\t\treturn async function(\n\t\t\tthis: WindowCoveringCCAPI,\n\t\t\t{ property, propertyKey },\n\t\t) {\n\t\t\tswitch (property) {\n\t\t\t\tcase \"currentValue\":\n\t\t\t\tcase \"targetValue\":\n\t\t\t\tcase \"duration\":\n\t\t\t\t\tif (propertyKey == undefined) {\n\t\t\t\t\t\tthrowMissingPropertyKey(this.ccId, property);\n\t\t\t\t\t} else if (typeof propertyKey !== \"number\") {\n\t\t\t\t\t\tthrowUnsupportedPropertyKey(\n\t\t\t\t\t\t\tthis.ccId,\n\t\t\t\t\t\t\tproperty,\n\t\t\t\t\t\t\tpropertyKey,\n\t\t\t\t\t\t);\n\t\t\t\t\t}\n\t\t\t\t\treturn (await this.get(propertyKey))?.[property];\n\t\t\t\tdefault:\n\t\t\t\t\tthrowUnsupportedProperty(this.ccId, property);\n\t\t\t}\n\t\t};\n\t}\n\n\tpublic async getSupported(): Promise<\n\t\tMaybeNotKnown<readonly WindowCoveringParameter[]>\n\t> {\n\t\tthis.assertSupportsCommand(\n\t\t\tWindowCoveringCommand,\n\t\t\tWindowCoveringCommand.SupportedGet,\n\t\t);\n\n\t\tconst cc = new WindowCoveringCCSupportedGet({\n\t\t\tnodeId: this.endpoint.nodeId,\n\t\t\tendpointIndex: this.endpoint.index,\n\t\t});\n\t\tconst response = await this.host.sendCommand<\n\t\t\tWindowCoveringCCSupportedReport\n\t\t>(\n\t\t\tcc,\n\t\t\tthis.commandOptions,\n\t\t);\n\t\treturn response?.supportedParameters;\n\t}\n\n\t@validateArgs({ strictEnums: true })\n\t// eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types\n\tpublic async get(parameter: WindowCoveringParameter) {\n\t\tthis.assertSupportsCommand(\n\t\t\tWindowCoveringCommand,\n\t\t\tWindowCoveringCommand.Get,\n\t\t);\n\n\t\tconst cc = new WindowCoveringCCGet({\n\t\t\tnodeId: this.endpoint.nodeId,\n\t\t\tendpointIndex: this.endpoint.index,\n\t\t\tparameter,\n\t\t});\n\t\tconst response = await this.host.sendCommand<\n\t\t\tWindowCoveringCCReport\n\t\t>(\n\t\t\tcc,\n\t\t\tthis.commandOptions,\n\t\t);\n\t\tif (response) {\n\t\t\treturn pick(response, [\"currentValue\", \"targetValue\", \"duration\"]);\n\t\t}\n\t}\n\n\t@validateArgs()\n\tpublic async set(\n\t\ttargetValues: {\n\t\t\tparameter: WindowCoveringParameter;\n\t\t\tvalue: number;\n\t\t}[],\n\t\tduration?: Duration | string,\n\t): Promise<SupervisionResult | undefined> {\n\t\tthis.assertSupportsCommand(\n\t\t\tWindowCoveringCommand,\n\t\t\tWindowCoveringCommand.StartLevelChange,\n\t\t);\n\n\t\tconst cc = new WindowCoveringCCSet({\n\t\t\tnodeId: this.endpoint.nodeId,\n\t\t\tendpointIndex: this.endpoint.index,\n\t\t\ttargetValues,\n\t\t\tduration,\n\t\t});\n\n\t\treturn this.host.sendCommand(cc, this.commandOptions);\n\t}\n\n\t@validateArgs({ strictEnums: true })\n\tpublic async startLevelChange(\n\t\tparameter: WindowCoveringParameter,\n\t\tdirection: keyof typeof LevelChangeDirection,\n\t\tduration?: Duration | string,\n\t): Promise<SupervisionResult | undefined> {\n\t\tthis.assertSupportsCommand(\n\t\t\tWindowCoveringCommand,\n\t\t\tWindowCoveringCommand.StartLevelChange,\n\t\t);\n\n\t\tconst cc = new WindowCoveringCCStartLevelChange({\n\t\t\tnodeId: this.endpoint.nodeId,\n\t\t\tendpointIndex: this.endpoint.index,\n\t\t\tparameter,\n\t\t\tdirection,\n\t\t\tduration,\n\t\t});\n\n\t\treturn this.host.sendCommand(cc, this.commandOptions);\n\t}\n\n\t@validateArgs({ strictEnums: true })\n\tpublic async stopLevelChange(\n\t\tparameter: WindowCoveringParameter,\n\t): Promise<SupervisionResult | undefined> {\n\t\tthis.assertSupportsCommand(\n\t\t\tWindowCoveringCommand,\n\t\t\tWindowCoveringCommand.StopLevelChange,\n\t\t);\n\n\t\tconst cc = new WindowCoveringCCStopLevelChange({\n\t\t\tnodeId: this.endpoint.nodeId,\n\t\t\tendpointIndex: this.endpoint.index,\n\t\t\tparameter,\n\t\t});\n\n\t\treturn this.host.sendCommand(cc, this.commandOptions);\n\t}\n}\n\n@commandClass(CommandClasses[\"Window Covering\"])\n@implementedVersion(1)\n@ccValues(WindowCoveringCCValues)\nexport class WindowCoveringCC extends CommandClass {\n\tdeclare ccCommand: WindowCoveringCommand;\n\n\tpublic async interview(\n\t\tctx: InterviewContext,\n\t): Promise<void> {\n\t\tconst node = this.getNode(ctx)!;\n\t\tconst endpoint = this.getEndpoint(ctx)!;\n\t\tconst api = CCAPI.create(\n\t\t\tCommandClasses[\"Window Covering\"],\n\t\t\tctx,\n\t\t\tendpoint,\n\t\t).withOptions({\n\t\t\tpriority: MessagePriority.NodeQuery,\n\t\t});\n\n\t\tctx.logNode(node.id, {\n\t\t\tendpoint: this.endpointIndex,\n\t\t\tmessage: `Interviewing ${this.ccName}...`,\n\t\t\tdirection: \"none\",\n\t\t});\n\n\t\tctx.logNode(node.id, {\n\t\t\tendpoint: this.endpointIndex,\n\t\t\tmessage: \"querying supported window covering parameters...\",\n\t\t\tdirection: \"outbound\",\n\t\t});\n\t\tconst supported = await api.getSupported();\n\t\tif (supported?.length) {\n\t\t\tconst logMessage = `supported window covering parameters:\n${\n\t\t\t\tsupported\n\t\t\t\t\t.map((p) =>\n\t\t\t\t\t\t`\u00B7 ${getEnumMemberName(WindowCoveringParameter, p)}`\n\t\t\t\t\t)\n\t\t\t\t\t.join(\"\\n\")\n\t\t\t}`;\n\t\t\tctx.logNode(node.id, {\n\t\t\t\tendpoint: this.endpointIndex,\n\t\t\t\tmessage: logMessage,\n\t\t\t\tdirection: \"inbound\",\n\t\t\t});\n\n\t\t\t// Create metadata for all supported parameters\n\t\t\tfor (const param of supported) {\n\t\t\t\t// Default values\n\t\t\t\tthis.setMetadata(\n\t\t\t\t\tctx,\n\t\t\t\t\tWindowCoveringCCValues.currentValue(param),\n\t\t\t\t);\n\t\t\t\tthis.setMetadata(\n\t\t\t\t\tctx,\n\t\t\t\t\tWindowCoveringCCValues.targetValue(param),\n\t\t\t\t);\n\t\t\t\tthis.setMetadata(\n\t\t\t\t\tctx,\n\t\t\t\t\tWindowCoveringCCValues.duration(param),\n\t\t\t\t);\n\n\t\t\t\t// Level change values\n\t\t\t\tthis.setMetadata(\n\t\t\t\t\tctx,\n\t\t\t\t\tWindowCoveringCCValues.levelChangeUp(param),\n\t\t\t\t);\n\t\t\t\tthis.setMetadata(\n\t\t\t\t\tctx,\n\t\t\t\t\tWindowCoveringCCValues.levelChangeDown(param),\n\t\t\t\t);\n\n\t\t\t\t// And for the odd parameters (with position support), query the position\n\t\t\t\tif (param % 2 === 1) {\n\t\t\t\t\tctx.logNode(node.id, {\n\t\t\t\t\t\tendpoint: this.endpointIndex,\n\t\t\t\t\t\tmessage: `querying position for parameter ${\n\t\t\t\t\t\t\tgetEnumMemberName(\n\t\t\t\t\t\t\t\tWindowCoveringParameter,\n\t\t\t\t\t\t\t\tparam,\n\t\t\t\t\t\t\t)\n\t\t\t\t\t\t}...`,\n\t\t\t\t\t\tdirection: \"outbound\",\n\t\t\t\t\t});\n\t\t\t\t\tawait api.get(param);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t// Remember that the interview is complete\n\t\tthis.setInterviewComplete(ctx, true);\n\t}\n\n\tpublic translatePropertyKey(\n\t\tctx: GetValueDB,\n\t\tproperty: string | number,\n\t\tpropertyKey: string | number,\n\t): string | undefined {\n\t\tif (typeof propertyKey === \"number\") {\n\t\t\treturn getEnumMemberName(WindowCoveringParameter, propertyKey);\n\t\t}\n\t\treturn super.translatePropertyKey(ctx, property, propertyKey);\n\t}\n}\n\n// @publicAPI\nexport interface WindowCoveringCCSupportedReportOptions {\n\tsupportedParameters: readonly WindowCoveringParameter[];\n}\n\n@CCCommand(WindowCoveringCommand.SupportedReport)\n@ccValueProperty(\n\t\"supportedParameters\",\n\tWindowCoveringCCValues.supportedParameters,\n)\nexport class WindowCoveringCCSupportedReport extends WindowCoveringCC {\n\tpublic constructor(\n\t\toptions: WithAddress<WindowCoveringCCSupportedReportOptions>,\n\t) {\n\t\tsuper(options);\n\t\tthis.supportedParameters = options.supportedParameters;\n\t}\n\n\tpublic static from(\n\t\traw: CCRaw,\n\t\tctx: CCParsingContext,\n\t): WindowCoveringCCSupportedReport {\n\t\tvalidatePayload(raw.payload.length >= 1);\n\n\t\tconst numBitmaskBytes = raw.payload[0] & 0b1111;\n\t\tvalidatePayload(raw.payload.length >= 1 + numBitmaskBytes);\n\t\tconst bitmask = raw.payload.subarray(1, 1 + numBitmaskBytes);\n\t\tconst supportedParameters: WindowCoveringParameter[] = parseBitMask(\n\t\t\tbitmask,\n\t\t\tWindowCoveringParameter[\"Outbound Left (no position)\"],\n\t\t);\n\n\t\treturn new this({\n\t\t\tnodeId: ctx.sourceNodeId,\n\t\t\tsupportedParameters,\n\t\t});\n\t}\n\n\tpublic readonly supportedParameters: readonly WindowCoveringParameter[];\n\n\tpublic serialize(ctx: CCEncodingContext): Promise<Bytes> {\n\t\tconst bitmask = encodeBitMask(\n\t\t\tthis.supportedParameters,\n\t\t\tundefined,\n\t\t\tWindowCoveringParameter[\"Outbound Left (no position)\"],\n\t\t).subarray(0, 15);\n\t\tconst numBitmaskBytes = bitmask.length & 0b1111;\n\n\t\tthis.payload = Bytes.concat([\n\t\t\tBytes.from([numBitmaskBytes]),\n\t\t\tbitmask.subarray(0, numBitmaskBytes),\n\t\t]);\n\n\t\treturn super.serialize(ctx);\n\t}\n\n\tpublic toLogEntry(ctx?: GetValueDB): MessageOrCCLogEntry {\n\t\treturn {\n\t\t\t...super.toLogEntry(ctx),\n\t\t\tmessage: {\n\t\t\t\t\"supported parameters\": this.supportedParameters\n\t\t\t\t\t.map(\n\t\t\t\t\t\t(p) =>\n\t\t\t\t\t\t\t`\\n\u00B7 ${\n\t\t\t\t\t\t\t\tgetEnumMemberName(\n\t\t\t\t\t\t\t\t\tWindowCoveringParameter,\n\t\t\t\t\t\t\t\t\tp,\n\t\t\t\t\t\t\t\t)\n\t\t\t\t\t\t\t}`,\n\t\t\t\t\t)\n\t\t\t\t\t.join(\"\"),\n\t\t\t},\n\t\t};\n\t}\n}\n\n@CCCommand(WindowCoveringCommand.SupportedGet)\n@expectedCCResponse(WindowCoveringCCSupportedReport)\nexport class WindowCoveringCCSupportedGet extends WindowCoveringCC {}\n\n// @publicAPI\nexport interface WindowCoveringCCReportOptions {\n\tparameter: WindowCoveringParameter;\n\tcurrentValue: number;\n\ttargetValue: number;\n\tduration: Duration;\n}\n\n@CCCommand(WindowCoveringCommand.Report)\n@ccValueProperty(\n\t\"currentValue\",\n\tWindowCoveringCCValues.currentValue,\n\t(self) => [self.parameter],\n)\n@ccValueProperty(\n\t\"targetValue\",\n\tWindowCoveringCCValues.targetValue,\n\t(self) => [self.parameter],\n)\n@ccValueProperty(\n\t\"duration\",\n\tWindowCoveringCCValues.duration,\n\t(self) => [self.parameter],\n)\nexport class WindowCoveringCCReport extends WindowCoveringCC {\n\tpublic constructor(\n\t\toptions: WithAddress<WindowCoveringCCReportOptions>,\n\t) {\n\t\tsuper(options);\n\n\t\t// TODO: Check implementation:\n\t\tthis.parameter = options.parameter;\n\t\tthis.currentValue = options.currentValue;\n\t\tthis.targetValue = options.targetValue;\n\t\tthis.duration = options.duration;\n\t}\n\n\tpublic static from(\n\t\traw: CCRaw,\n\t\tctx: CCParsingContext,\n\t): WindowCoveringCCReport {\n\t\tvalidatePayload(raw.payload.length >= 4);\n\t\tconst parameter: WindowCoveringParameter = raw.payload[0];\n\t\tconst currentValue = raw.payload[1];\n\t\tconst targetValue = raw.payload[2];\n\t\tconst duration = Duration.parseReport(raw.payload[3])\n\t\t\t?? Duration.unknown();\n\n\t\treturn new this({\n\t\t\tnodeId: ctx.sourceNodeId,\n\t\t\tparameter,\n\t\t\tcurrentValue,\n\t\t\ttargetValue,\n\t\t\tduration,\n\t\t});\n\t}\n\n\tpublic readonly parameter: WindowCoveringParameter;\n\n\tpublic readonly currentValue: number;\n\n\tpublic readonly targetValue: number;\n\n\tpublic readonly duration: Duration;\n\n\tpublic toLogEntry(ctx?: GetValueDB): MessageOrCCLogEntry {\n\t\treturn {\n\t\t\t...super.toLogEntry(ctx),\n\t\t\tmessage: {\n\t\t\t\tparameter: getEnumMemberName(\n\t\t\t\t\tWindowCoveringParameter,\n\t\t\t\t\tthis.parameter,\n\t\t\t\t),\n\t\t\t\t\"current value\": this.currentValue,\n\t\t\t\t\"target value\": this.targetValue,\n\t\t\t\tduration: this.duration.toString(),\n\t\t\t},\n\t\t};\n\t}\n}\n\n// @publicAPI\nexport interface WindowCoveringCCGetOptions {\n\tparameter: WindowCoveringParameter;\n}\n\nfunction testResponseForWindowCoveringGet(\n\tsent: WindowCoveringCCGet,\n\treceived: WindowCoveringCCReport,\n) {\n\treturn received.parameter === sent.parameter;\n}\n\n@CCCommand(WindowCoveringCommand.Get)\n@expectedCCResponse(WindowCoveringCCReport, testResponseForWindowCoveringGet)\nexport class WindowCoveringCCGet extends WindowCoveringCC {\n\tpublic constructor(\n\t\toptions: WithAddress<WindowCoveringCCGetOptions>,\n\t) {\n\t\tsuper(options);\n\t\tthis.parameter = options.parameter;\n\t}\n\n\tpublic static from(raw: CCRaw, ctx: CCParsingContext): WindowCoveringCCGet {\n\t\tvalidatePayload(raw.payload.length >= 1);\n\t\tconst parameter: WindowCoveringParameter = raw.payload[0];\n\n\t\treturn new this({\n\t\t\tnodeId: ctx.sourceNodeId,\n\t\t\tparameter,\n\t\t});\n\t}\n\n\tpublic parameter: WindowCoveringParameter;\n\n\tpublic serialize(ctx: CCEncodingContext): Promise<Bytes> {\n\t\tthis.payload = Bytes.from([this.parameter]);\n\t\treturn super.serialize(ctx);\n\t}\n\n\tpublic toLogEntry(ctx?: GetValueDB): MessageOrCCLogEntry {\n\t\treturn {\n\t\t\t...super.toLogEntry(ctx),\n\t\t\tmessage: {\n\t\t\t\tparameter: getEnumMemberName(\n\t\t\t\t\tWindowCoveringParameter,\n\t\t\t\t\tthis.parameter,\n\t\t\t\t),\n\t\t\t},\n\t\t};\n\t}\n}\n\n// @publicAPI\nexport interface WindowCoveringCCSetOptions {\n\ttargetValues: {\n\t\tparameter: WindowCoveringParameter;\n\t\tvalue: number;\n\t}[];\n\tduration?: Duration | string;\n}\n\n@CCCommand(WindowCoveringCommand.Set)\n@useSupervision()\nexport class WindowCoveringCCSet extends WindowCoveringCC {\n\tpublic constructor(\n\t\toptions: WithAddress<WindowCoveringCCSetOptions>,\n\t) {\n\t\tsuper(options);\n\t\tthis.targetValues = options.targetValues;\n\t\tthis.duration = Duration.from(options.duration);\n\t}\n\n\tpublic static from(raw: CCRaw, ctx: CCParsingContext): WindowCoveringCCSet {\n\t\tvalidatePayload(raw.payload.length >= 1);\n\t\tconst numEntries = raw.payload[0] & 0b11111;\n\n\t\tvalidatePayload(raw.payload.length >= 1 + numEntries * 2);\n\t\tconst targetValues: WindowCoveringCCSetOptions[\"targetValues\"] = [];\n\n\t\tfor (let i = 0; i < numEntries; i++) {\n\t\t\tconst offset = 1 + i * 2;\n\t\t\ttargetValues.push({\n\t\t\t\tparameter: raw.payload[offset],\n\t\t\t\tvalue: raw.payload[offset + 1],\n\t\t\t});\n\t\t}\n\n\t\tlet duration: Duration | undefined;\n\n\t\tif (raw.payload.length >= 2 + numEntries * 2) {\n\t\t\tduration = Duration.parseSet(\n\t\t\t\traw.payload[1 + numEntries * 2],\n\t\t\t);\n\t\t}\n\n\t\treturn new this({\n\t\t\tnodeId: ctx.sourceNodeId,\n\t\t\ttargetValues,\n\t\t\tduration,\n\t\t});\n\t}\n\n\tpublic targetValues: {\n\t\tparameter: WindowCoveringParameter;\n\t\tvalue: number;\n\t}[];\n\tpublic duration: Duration | undefined;\n\n\tpublic serialize(ctx: CCEncodingContext): Promise<Bytes> {\n\t\tconst numEntries = this.targetValues.length & 0b11111;\n\t\tthis.payload = new Bytes(2 + numEntries * 2);\n\n\t\tthis.payload[0] = numEntries;\n\t\tfor (let i = 0; i < numEntries; i++) {\n\t\t\tconst offset = 1 + i * 2;\n\t\t\tthis.payload[offset] = this.targetValues[i].parameter;\n\t\t\tthis.payload[offset + 1] = this.targetValues[i].value;\n\t\t}\n\n\t\tthis.payload[this.payload.length - 1] = (\n\t\t\tthis.duration ?? Duration.default()\n\t\t).serializeSet();\n\n\t\treturn super.serialize(ctx);\n\t}\n\n\tpublic toLogEntry(ctx?: GetValueDB): MessageOrCCLogEntry {\n\t\tconst message: MessageRecord = {};\n\t\tfor (const { parameter, value } of this.targetValues) {\n\t\t\tmessage[getEnumMemberName(WindowCoveringParameter, parameter)] =\n\t\t\t\tvalue;\n\t\t}\n\t\tif (this.duration) {\n\t\t\tmessage.duration = this.duration.toString();\n\t\t}\n\t\treturn {\n\t\t\t...super.toLogEntry(ctx),\n\t\t\tmessage,\n\t\t};\n\t}\n}\n\n// @publicAPI\nexport interface WindowCoveringCCStartLevelChangeOptions {\n\tparameter: WindowCoveringParameter;\n\tdirection: keyof typeof LevelChangeDirection;\n\tduration?: Duration | string;\n}\n\n@CCCommand(WindowCoveringCommand.StartLevelChange)\n@useSupervision()\nexport class WindowCoveringCCStartLevelChange extends WindowCoveringCC {\n\tpublic constructor(\n\t\toptions: WithAddress<WindowCoveringCCStartLevelChangeOptions>,\n\t) {\n\t\tsuper(options);\n\t\tthis.parameter = options.parameter;\n\t\tthis.direction = options.direction;\n\t\tthis.duration = Duration.from(options.duration);\n\t}\n\n\tpublic static from(\n\t\traw: CCRaw,\n\t\tctx: CCParsingContext,\n\t): WindowCoveringCCStartLevelChange {\n\t\tvalidatePayload(raw.payload.length >= 2);\n\t\tconst direction = !!(raw.payload[0] & 0b0100_0000)\n\t\t\t? \"down\"\n\t\t\t: \"up\";\n\t\tconst parameter: WindowCoveringParameter = raw.payload[1];\n\t\tlet duration: Duration | undefined;\n\n\t\tif (raw.payload.length >= 3) {\n\t\t\tduration = Duration.parseSet(raw.payload[2]);\n\t\t}\n\n\t\treturn new this({\n\t\t\tnodeId: ctx.sourceNodeId,\n\t\t\tdirection,\n\t\t\tparameter,\n\t\t\tduration,\n\t\t});\n\t}\n\n\tpublic parameter: WindowCoveringParameter;\n\tpublic direction: keyof typeof LevelChangeDirection;\n\tpublic duration: Duration | undefined;\n\n\tpublic serialize(ctx: CCEncodingContext): Promise<Bytes> {\n\t\tthis.payload = Bytes.from([\n\t\t\tthis.direction === \"down\" ? 0b0100_0000 : 0b0000_0000,\n\t\t\tthis.parameter,\n\t\t\t(this.duration ?? Duration.default()).serializeSet(),\n\t\t]);\n\t\treturn super.serialize(ctx);\n\t}\n\n\tpublic toLogEntry(ctx?: GetValueDB): MessageOrCCLogEntry {\n\t\tconst message: MessageRecord = {\n\t\t\tparameter: getEnumMemberName(\n\t\t\t\tWindowCoveringParameter,\n\t\t\t\tthis.parameter,\n\t\t\t),\n\t\t\tdirection: this.direction,\n\t\t};\n\t\tif (this.duration) {\n\t\t\tmessage.duration = this.duration.toString();\n\t\t}\n\t\treturn {\n\t\t\t...super.toLogEntry(ctx),\n\t\t\tmessage,\n\t\t};\n\t}\n}\n\n// @publicAPI\nexport interface WindowCoveringCCStopLevelChangeOptions {\n\tparameter: WindowCoveringParameter;\n}\n\n@CCCommand(WindowCoveringCommand.StopLevelChange)\n@useSupervision()\nexport class WindowCoveringCCStopLevelChange extends WindowCoveringCC {\n\tpublic constructor(\n\t\toptions: WithAddress<WindowCoveringCCStopLevelChangeOptions>,\n\t) {\n\t\tsuper(options);\n\t\tthis.parameter = options.parameter;\n\t}\n\n\tpublic static from(\n\t\traw: CCRaw,\n\t\tctx: CCParsingContext,\n\t): WindowCoveringCCStopLevelChange {\n\t\tvalidatePayload(raw.payload.length >= 1);\n\t\tconst parameter: WindowCoveringParameter = raw.payload[0];\n\n\t\treturn new this({\n\t\t\tnodeId: ctx.sourceNodeId,\n\t\t\tparameter,\n\t\t});\n\t}\n\n\tpublic parameter: WindowCoveringParameter;\n\n\tpublic serialize(ctx: CCEncodingContext): Promise<Bytes> {\n\t\tthis.payload = Bytes.from([this.parameter]);\n\t\treturn super.serialize(ctx);\n\t}\n\n\tpublic toLogEntry(ctx?: GetValueDB): MessageOrCCLogEntry {\n\t\treturn {\n\t\t\t...super.toLogEntry(ctx),\n\t\t\tmessage: {\n\t\t\t\tparameter: getEnumMemberName(\n\t\t\t\t\tWindowCoveringParameter,\n\t\t\t\t\t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A,mBAAA,EAAA,OAAA,WAAA,GAAA,kBAAA,EAAA,MAAA,SAAA,MAAA,WAAA,MAAA,UAAA,UAAA,GAAA,MAAA,uBAAA;;;AAAa,wBAAA,YAAA,uBAAA;;IACZ,YACC,SAA4D;AAE5D,YAAM,OAAO;AACb,WAAK,YAAY,QAAQ;IAC1B;IAEO,OAAO,KACb,KACA,KAAqB;AAErB,uCAAgB,IAAI,QAAQ,UAAU,CAAC;AACvC,YAAM,YAAqC,IAAI,QAAQ,CAAC;AAExD,aAAO,IAAI,KAAK;QACf,QAAQ,IAAI;QACZ;OACA;IACF;IAEO;IAEA,UAAU,KAAsB;AACtC,WAAK,UAAU,kBAAM,KAAK,CAAC,KAAK,SAAS,CAAC;AAC1C,aAAO,MAAM,UAAU,GAAG;IAC3B;IAEO,WAAW,KAAgB;AACjC,aAAO;QACN,GAAG,MAAM,WAAW,GAAG;QACvB,SAAS;UACR,eAAW,gCACV,sCACA,KAAK,SAAS;;;IAIlB;;;;",
|
|
6
|
-
"names": [
|
|
4
|
+
"sourcesContent": ["import type { CCEncodingContext, CCParsingContext } from \"@zwave-js/cc\";\nimport {\n\tCommandClasses,\n\tDuration,\n\ttype GetValueDB,\n\ttype MaybeNotKnown,\n\ttype MessageOrCCLogEntry,\n\tMessagePriority,\n\ttype MessageRecord,\n\ttype SupervisionResult,\n\tValueMetadata,\n\ttype WithAddress,\n\tencodeBitMask,\n\tparseBitMask,\n\tvalidatePayload,\n} from \"@zwave-js/core\";\nimport { Bytes, getEnumMemberName, pick } from \"@zwave-js/shared\";\nimport { validateArgs } from \"@zwave-js/transformers\";\nimport {\n\tCCAPI,\n\tPOLL_VALUE,\n\ttype PollValueImplementation,\n\tSET_VALUE,\n\tSET_VALUE_HOOKS,\n\ttype SetValueImplementation,\n\ttype SetValueImplementationHooksFactory,\n\tthrowMissingPropertyKey,\n\tthrowUnsupportedProperty,\n\tthrowUnsupportedPropertyKey,\n\tthrowWrongValueType,\n} from \"../lib/API.js\";\nimport {\n\twindowCoveringParameterToLevelChangeLabel,\n\twindowCoveringParameterToMetadataStates,\n} from \"../lib/CCValueUtils.js\";\nimport {\n\ttype CCRaw,\n\tCommandClass,\n\ttype InterviewContext,\n} from \"../lib/CommandClass.js\";\nimport {\n\tAPI,\n\tCCCommand,\n\tccValueProperty,\n\tccValues,\n\tcommandClass,\n\texpectedCCResponse,\n\timplementedVersion,\n\tuseSupervision,\n} from \"../lib/CommandClassDecorators.js\";\nimport { V } from \"../lib/Values.js\";\nimport {\n\ttype LevelChangeDirection,\n\tWindowCoveringCommand,\n\tWindowCoveringParameter,\n} from \"../lib/_Types.js\";\n\nexport const WindowCoveringCCValues = V.defineCCValues(\n\tCommandClasses[\"Window Covering\"],\n\t{\n\t\t...V.staticProperty(\n\t\t\t\"supportedParameters\",\n\t\t\tundefined, // meta\n\t\t\t{ internal: true }, // value options\n\t\t),\n\t\t...V.dynamicPropertyAndKeyWithName(\n\t\t\t\"currentValue\",\n\t\t\t\"currentValue\",\n\t\t\t(parameter: WindowCoveringParameter) => parameter,\n\t\t\t({ property, propertyKey }) =>\n\t\t\t\tproperty === \"currentValue\" && typeof propertyKey === \"number\",\n\t\t\t(parameter: WindowCoveringParameter) => {\n\t\t\t\treturn {\n\t\t\t\t\t...ValueMetadata.ReadOnlyLevel,\n\t\t\t\t\tlabel: `Current value - ${\n\t\t\t\t\t\tgetEnumMemberName(\n\t\t\t\t\t\t\tWindowCoveringParameter,\n\t\t\t\t\t\t\tparameter,\n\t\t\t\t\t\t)\n\t\t\t\t\t}`,\n\t\t\t\t\tstates: windowCoveringParameterToMetadataStates(parameter),\n\t\t\t\t\tccSpecific: { parameter },\n\t\t\t\t} as const;\n\t\t\t},\n\t\t),\n\t\t...V.dynamicPropertyAndKeyWithName(\n\t\t\t\"targetValue\",\n\t\t\t\"targetValue\",\n\t\t\t(parameter: WindowCoveringParameter) => parameter,\n\t\t\t({ property, propertyKey }) =>\n\t\t\t\tproperty === \"targetValue\" && typeof propertyKey === \"number\",\n\t\t\t(parameter: WindowCoveringParameter) => {\n\t\t\t\t// Only odd-numbered parameters have position support and are writable\n\t\t\t\tconst writeable = parameter % 2 === 1;\n\t\t\t\treturn {\n\t\t\t\t\t...ValueMetadata.Level,\n\t\t\t\t\tlabel: `Target value - ${\n\t\t\t\t\t\tgetEnumMemberName(\n\t\t\t\t\t\t\tWindowCoveringParameter,\n\t\t\t\t\t\t\tparameter,\n\t\t\t\t\t\t)\n\t\t\t\t\t}`,\n\t\t\t\t\t// Only odd-numbered parameters have position support and are writable\n\t\t\t\t\twriteable: parameter % 2 === 1,\n\t\t\t\t\tstates: windowCoveringParameterToMetadataStates(parameter),\n\t\t\t\t\tallowManualEntry: writeable,\n\t\t\t\t\tccSpecific: { parameter },\n\t\t\t\t\tvalueChangeOptions: [\"transitionDuration\"],\n\t\t\t\t} as const;\n\t\t\t},\n\t\t),\n\t\t...V.dynamicPropertyAndKeyWithName(\n\t\t\t\"duration\",\n\t\t\t\"duration\",\n\t\t\t(parameter: WindowCoveringParameter) => parameter,\n\t\t\t({ property, propertyKey }) =>\n\t\t\t\tproperty === \"duration\" && typeof propertyKey === \"number\",\n\t\t\t(parameter: WindowCoveringParameter) => ({\n\t\t\t\t...ValueMetadata.ReadOnlyDuration,\n\t\t\t\tlabel: `Remaining duration - ${\n\t\t\t\t\tgetEnumMemberName(\n\t\t\t\t\t\tWindowCoveringParameter,\n\t\t\t\t\t\tparameter,\n\t\t\t\t\t)\n\t\t\t\t}`,\n\t\t\t\tccSpecific: {\n\t\t\t\t\tparameter,\n\t\t\t\t},\n\t\t\t} as const),\n\t\t),\n\t\t...V.dynamicPropertyAndKeyWithName(\n\t\t\t\"levelChangeUp\",\n\t\t\t// The direction refers to the change in level, not the physical location\n\t\t\t\"levelChangeUp\",\n\t\t\t(parameter: WindowCoveringParameter) => parameter,\n\t\t\t({ property, propertyKey }) =>\n\t\t\t\tproperty === \"levelChangeUp\" && typeof propertyKey === \"number\",\n\t\t\t(parameter: WindowCoveringParameter) => {\n\t\t\t\treturn {\n\t\t\t\t\t...ValueMetadata.WriteOnlyBoolean,\n\t\t\t\t\tlabel: `${\n\t\t\t\t\t\twindowCoveringParameterToLevelChangeLabel(\n\t\t\t\t\t\t\tparameter,\n\t\t\t\t\t\t\t\"up\",\n\t\t\t\t\t\t)\n\t\t\t\t\t} - ${\n\t\t\t\t\t\tgetEnumMemberName(\n\t\t\t\t\t\t\tWindowCoveringParameter,\n\t\t\t\t\t\t\tparameter,\n\t\t\t\t\t\t)\n\t\t\t\t\t}`,\n\t\t\t\t\tvalueChangeOptions: [\"transitionDuration\"],\n\t\t\t\t\tstates: {\n\t\t\t\t\t\ttrue: \"Start\",\n\t\t\t\t\t\tfalse: \"Stop\",\n\t\t\t\t\t},\n\t\t\t\t\tccSpecific: { parameter },\n\t\t\t\t} as const;\n\t\t\t},\n\t\t),\n\t\t...V.dynamicPropertyAndKeyWithName(\n\t\t\t\"levelChangeDown\",\n\t\t\t// The direction refers to the change in level, not the physical location\n\t\t\t\"levelChangeDown\",\n\t\t\t(parameter: WindowCoveringParameter) => parameter,\n\t\t\t({ property, propertyKey }) =>\n\t\t\t\tproperty === \"levelChangeDown\"\n\t\t\t\t&& typeof propertyKey === \"number\",\n\t\t\t(parameter: WindowCoveringParameter) => {\n\t\t\t\treturn {\n\t\t\t\t\t...ValueMetadata.WriteOnlyBoolean,\n\t\t\t\t\tlabel: `${\n\t\t\t\t\t\twindowCoveringParameterToLevelChangeLabel(\n\t\t\t\t\t\t\tparameter,\n\t\t\t\t\t\t\t\"down\",\n\t\t\t\t\t\t)\n\t\t\t\t\t} - ${\n\t\t\t\t\t\tgetEnumMemberName(\n\t\t\t\t\t\t\tWindowCoveringParameter,\n\t\t\t\t\t\t\tparameter,\n\t\t\t\t\t\t)\n\t\t\t\t\t}`,\n\t\t\t\t\tvalueChangeOptions: [\"transitionDuration\"],\n\t\t\t\t\tstates: {\n\t\t\t\t\t\ttrue: \"Start\",\n\t\t\t\t\t\tfalse: \"Stop\",\n\t\t\t\t\t},\n\t\t\t\t\tccSpecific: { parameter },\n\t\t\t\t} as const;\n\t\t\t},\n\t\t),\n\t},\n);\n\n@API(CommandClasses[\"Window Covering\"])\nexport class WindowCoveringCCAPI extends CCAPI {\n\tpublic supportsCommand(cmd: WindowCoveringCommand): MaybeNotKnown<boolean> {\n\t\tswitch (cmd) {\n\t\t\tcase WindowCoveringCommand.Get:\n\t\t\tcase WindowCoveringCommand.Set:\n\t\t\tcase WindowCoveringCommand.SupportedGet:\n\t\t\tcase WindowCoveringCommand.StartLevelChange:\n\t\t\tcase WindowCoveringCommand.StopLevelChange:\n\t\t\t\treturn true; // This is mandatory\n\t\t}\n\t\treturn super.supportsCommand(cmd);\n\t}\n\n\tprotected override get [SET_VALUE](): SetValueImplementation {\n\t\treturn async function(\n\t\t\tthis: WindowCoveringCCAPI,\n\t\t\t{ property, propertyKey },\n\t\t\tvalue,\n\t\t\toptions,\n\t\t) {\n\t\t\tconst valueId = {\n\t\t\t\tcommandClass: this.ccId,\n\t\t\t\tproperty,\n\t\t\t\tpropertyKey,\n\t\t\t};\n\n\t\t\tif (WindowCoveringCCValues.targetValue.is(valueId)) {\n\t\t\t\tif (\n\t\t\t\t\ttypeof propertyKey !== \"number\"\n\t\t\t\t\t// Only odd-numbered parameters have position support and are writable\n\t\t\t\t\t|| propertyKey % 2 === 0\n\t\t\t\t) {\n\t\t\t\t\tthrowUnsupportedPropertyKey(\n\t\t\t\t\t\tthis.ccId,\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}\n\n\t\t\t\tif (typeof value !== \"number\") {\n\t\t\t\t\tthrowWrongValueType(\n\t\t\t\t\t\tthis.ccId,\n\t\t\t\t\t\tproperty,\n\t\t\t\t\t\t\"number\",\n\t\t\t\t\t\ttypeof value,\n\t\t\t\t\t);\n\t\t\t\t}\n\n\t\t\t\tconst parameter = propertyKey;\n\t\t\t\tconst duration = Duration.from(options?.transitionDuration);\n\n\t\t\t\treturn this.set([{ parameter, value }], duration);\n\t\t\t} else if (\n\t\t\t\tWindowCoveringCCValues.levelChangeUp.is(valueId)\n\t\t\t\t|| WindowCoveringCCValues.levelChangeDown.is(valueId)\n\t\t\t) {\n\t\t\t\tif (typeof value !== \"boolean\") {\n\t\t\t\t\tthrowWrongValueType(\n\t\t\t\t\t\tthis.ccId,\n\t\t\t\t\t\tproperty,\n\t\t\t\t\t\t\"boolean\",\n\t\t\t\t\t\ttypeof value,\n\t\t\t\t\t);\n\t\t\t\t}\n\n\t\t\t\tconst parameter = propertyKey as number;\n\t\t\t\tconst direction = WindowCoveringCCValues.levelChangeUp.is(\n\t\t\t\t\t\tvalueId,\n\t\t\t\t\t)\n\t\t\t\t\t? \"up\"\n\t\t\t\t\t: \"down\";\n\n\t\t\t\tif (value) {\n\t\t\t\t\t// Perform the level change\n\t\t\t\t\tconst duration = Duration.from(options?.transitionDuration);\n\t\t\t\t\treturn this.startLevelChange(\n\t\t\t\t\t\tparameter,\n\t\t\t\t\t\tdirection,\n\t\t\t\t\t\tduration,\n\t\t\t\t\t);\n\t\t\t\t} else {\n\t\t\t\t\treturn this.stopLevelChange(parameter);\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tthrowUnsupportedProperty(this.ccId, property);\n\t\t\t}\n\t\t};\n\t}\n\n\tprotected [SET_VALUE_HOOKS]: SetValueImplementationHooksFactory = (\n\t\t{ property, propertyKey },\n\t\tvalue,\n\t\toptions,\n\t) => {\n\t\tconst valueId = {\n\t\t\tcommandClass: this.ccId,\n\t\t\tproperty,\n\t\t\tpropertyKey,\n\t\t};\n\n\t\tif (WindowCoveringCCValues.targetValue.is(valueId)) {\n\t\t\tif (typeof propertyKey !== \"number\") return;\n\t\t\tconst parameter = propertyKey;\n\n\t\t\tconst duration = Duration.from(options?.transitionDuration);\n\n\t\t\tconst currentValueValueId = WindowCoveringCCValues.currentValue(\n\t\t\t\tparameter,\n\t\t\t).endpoint(this.endpoint.index);\n\n\t\t\treturn {\n\t\t\t\t// Window Covering commands may take some time to be executed.\n\t\t\t\t// Therefore we try to supervise the command execution and delay the\n\t\t\t\t// optimistic update until the final result is received.\n\t\t\t\tsupervisionDelayedUpdates: true,\n\t\t\t\tsupervisionOnSuccess: async () => {\n\t\t\t\t\t// Only update currentValue for valid target values\n\t\t\t\t\tif (\n\t\t\t\t\t\ttypeof value === \"number\"\n\t\t\t\t\t\t&& value >= 0\n\t\t\t\t\t\t&& value <= 99\n\t\t\t\t\t) {\n\t\t\t\t\t\tthis.tryGetValueDB()?.setValue(\n\t\t\t\t\t\t\tcurrentValueValueId,\n\t\t\t\t\t\t\tvalue,\n\t\t\t\t\t\t);\n\t\t\t\t\t} else if (value === 255) {\n\t\t\t\t\t\t// We don't know the status now, so refresh the current value\n\t\t\t\t\t\ttry {\n\t\t\t\t\t\t\tawait this.get(parameter);\n\t\t\t\t\t\t} catch {\n\t\t\t\t\t\t\t// ignore\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t},\n\t\t\t\tsupervisionOnFailure: async () => {\n\t\t\t\t\t// The transition failed, so now we don't know the status - refresh the current value\n\t\t\t\t\ttry {\n\t\t\t\t\t\tawait this.get(parameter);\n\t\t\t\t\t} catch {\n\t\t\t\t\t\t// ignore\n\t\t\t\t\t}\n\t\t\t\t},\n\n\t\t\t\toptimisticallyUpdateRelatedValues: (\n\t\t\t\t\t_supervisedAndSuccessful,\n\t\t\t\t) => {\n\t\t\t\t\t// Only update currentValue for valid target values\n\t\t\t\t\tif (\n\t\t\t\t\t\ttypeof value === \"number\"\n\t\t\t\t\t\t&& value >= 0\n\t\t\t\t\t\t&& value <= 99\n\t\t\t\t\t) {\n\t\t\t\t\t\tif (this.isSinglecast()) {\n\t\t\t\t\t\t\tthis.tryGetValueDB()?.setValue(\n\t\t\t\t\t\t\t\tcurrentValueValueId,\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 if (this.isMulticast()) {\n\t\t\t\t\t\t\t// Figure out which nodes were affected by this command\n\t\t\t\t\t\t\tconst affectedNodes = this.endpoint.node\n\t\t\t\t\t\t\t\t.physicalNodes.filter(\n\t\t\t\t\t\t\t\t\t(node) =>\n\t\t\t\t\t\t\t\t\t\tnode\n\t\t\t\t\t\t\t\t\t\t\t.getEndpoint(this.endpoint.index)\n\t\t\t\t\t\t\t\t\t\t\t?.supportsCC(this.ccId),\n\t\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\t// and optimistically update the currentValue\n\t\t\t\t\t\t\tfor (const node of affectedNodes) {\n\t\t\t\t\t\t\t\tthis.host\n\t\t\t\t\t\t\t\t\t.tryGetValueDB(node.id)\n\t\t\t\t\t\t\t\t\t?.setValue(currentValueValueId, value);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t},\n\n\t\t\t\tverifyChanges: () => {\n\t\t\t\t\tif (this.isSinglecast()) {\n\t\t\t\t\t\t// We query currentValue instead of targetValue to make sure that unsolicited updates cancel the scheduled poll\n\t\t\t\t\t\tthis.schedulePoll(currentValueValueId, value, {\n\t\t\t\t\t\t\tduration,\n\t\t\t\t\t\t});\n\t\t\t\t\t} else {\n\t\t\t\t\t\t// For multicasts, do not schedule a refresh - this could cause a LOT of traffic\n\t\t\t\t\t}\n\t\t\t\t},\n\t\t\t};\n\t\t}\n\t};\n\n\tprotected get [POLL_VALUE](): PollValueImplementation {\n\t\treturn async function(\n\t\t\tthis: WindowCoveringCCAPI,\n\t\t\t{ property, propertyKey },\n\t\t) {\n\t\t\tswitch (property) {\n\t\t\t\tcase \"currentValue\":\n\t\t\t\tcase \"targetValue\":\n\t\t\t\tcase \"duration\":\n\t\t\t\t\tif (propertyKey == undefined) {\n\t\t\t\t\t\tthrowMissingPropertyKey(this.ccId, property);\n\t\t\t\t\t} else if (typeof propertyKey !== \"number\") {\n\t\t\t\t\t\tthrowUnsupportedPropertyKey(\n\t\t\t\t\t\t\tthis.ccId,\n\t\t\t\t\t\t\tproperty,\n\t\t\t\t\t\t\tpropertyKey,\n\t\t\t\t\t\t);\n\t\t\t\t\t}\n\t\t\t\t\treturn (await this.get(propertyKey))?.[property];\n\t\t\t\tdefault:\n\t\t\t\t\tthrowUnsupportedProperty(this.ccId, property);\n\t\t\t}\n\t\t};\n\t}\n\n\tpublic async getSupported(): Promise<\n\t\tMaybeNotKnown<readonly WindowCoveringParameter[]>\n\t> {\n\t\tthis.assertSupportsCommand(\n\t\t\tWindowCoveringCommand,\n\t\t\tWindowCoveringCommand.SupportedGet,\n\t\t);\n\n\t\tconst cc = new WindowCoveringCCSupportedGet({\n\t\t\tnodeId: this.endpoint.nodeId,\n\t\t\tendpointIndex: this.endpoint.index,\n\t\t});\n\t\tconst response = await this.host.sendCommand<\n\t\t\tWindowCoveringCCSupportedReport\n\t\t>(\n\t\t\tcc,\n\t\t\tthis.commandOptions,\n\t\t);\n\t\treturn response?.supportedParameters;\n\t}\n\n\t@validateArgs({ strictEnums: true })\n\t// eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types\n\tpublic async get(parameter: WindowCoveringParameter) {\n\t\tthis.assertSupportsCommand(\n\t\t\tWindowCoveringCommand,\n\t\t\tWindowCoveringCommand.Get,\n\t\t);\n\n\t\tconst cc = new WindowCoveringCCGet({\n\t\t\tnodeId: this.endpoint.nodeId,\n\t\t\tendpointIndex: this.endpoint.index,\n\t\t\tparameter,\n\t\t});\n\t\tconst response = await this.host.sendCommand<\n\t\t\tWindowCoveringCCReport\n\t\t>(\n\t\t\tcc,\n\t\t\tthis.commandOptions,\n\t\t);\n\t\tif (response) {\n\t\t\treturn pick(response, [\"currentValue\", \"targetValue\", \"duration\"]);\n\t\t}\n\t}\n\n\t@validateArgs()\n\tpublic async set(\n\t\ttargetValues: {\n\t\t\tparameter: WindowCoveringParameter;\n\t\t\tvalue: number;\n\t\t}[],\n\t\tduration?: Duration | string,\n\t): Promise<SupervisionResult | undefined> {\n\t\tthis.assertSupportsCommand(\n\t\t\tWindowCoveringCommand,\n\t\t\tWindowCoveringCommand.StartLevelChange,\n\t\t);\n\n\t\tconst cc = new WindowCoveringCCSet({\n\t\t\tnodeId: this.endpoint.nodeId,\n\t\t\tendpointIndex: this.endpoint.index,\n\t\t\ttargetValues,\n\t\t\tduration,\n\t\t});\n\n\t\treturn this.host.sendCommand(cc, this.commandOptions);\n\t}\n\n\t@validateArgs({ strictEnums: true })\n\tpublic async startLevelChange(\n\t\tparameter: WindowCoveringParameter,\n\t\tdirection: keyof typeof LevelChangeDirection,\n\t\tduration?: Duration | string,\n\t): Promise<SupervisionResult | undefined> {\n\t\tthis.assertSupportsCommand(\n\t\t\tWindowCoveringCommand,\n\t\t\tWindowCoveringCommand.StartLevelChange,\n\t\t);\n\n\t\tconst cc = new WindowCoveringCCStartLevelChange({\n\t\t\tnodeId: this.endpoint.nodeId,\n\t\t\tendpointIndex: this.endpoint.index,\n\t\t\tparameter,\n\t\t\tdirection,\n\t\t\tduration,\n\t\t});\n\n\t\treturn this.host.sendCommand(cc, this.commandOptions);\n\t}\n\n\t@validateArgs({ strictEnums: true })\n\tpublic async stopLevelChange(\n\t\tparameter: WindowCoveringParameter,\n\t): Promise<SupervisionResult | undefined> {\n\t\tthis.assertSupportsCommand(\n\t\t\tWindowCoveringCommand,\n\t\t\tWindowCoveringCommand.StopLevelChange,\n\t\t);\n\n\t\tconst cc = new WindowCoveringCCStopLevelChange({\n\t\t\tnodeId: this.endpoint.nodeId,\n\t\t\tendpointIndex: this.endpoint.index,\n\t\t\tparameter,\n\t\t});\n\n\t\treturn this.host.sendCommand(cc, this.commandOptions);\n\t}\n}\n\n@commandClass(CommandClasses[\"Window Covering\"])\n@implementedVersion(1)\n@ccValues(WindowCoveringCCValues)\nexport class WindowCoveringCC extends CommandClass {\n\tdeclare ccCommand: WindowCoveringCommand;\n\n\tpublic async interview(\n\t\tctx: InterviewContext,\n\t): Promise<void> {\n\t\tconst node = this.getNode(ctx)!;\n\t\tconst endpoint = this.getEndpoint(ctx)!;\n\t\tconst api = CCAPI.create(\n\t\t\tCommandClasses[\"Window Covering\"],\n\t\t\tctx,\n\t\t\tendpoint,\n\t\t).withOptions({\n\t\t\tpriority: MessagePriority.NodeQuery,\n\t\t});\n\n\t\tctx.logNode(node.id, {\n\t\t\tendpoint: this.endpointIndex,\n\t\t\tmessage: `Interviewing ${this.ccName}...`,\n\t\t\tdirection: \"none\",\n\t\t});\n\n\t\tctx.logNode(node.id, {\n\t\t\tendpoint: this.endpointIndex,\n\t\t\tmessage: \"querying supported window covering parameters...\",\n\t\t\tdirection: \"outbound\",\n\t\t});\n\t\tconst supported = await api.getSupported();\n\t\tif (supported?.length) {\n\t\t\tconst logMessage = `supported window covering parameters:\n${\n\t\t\t\tsupported\n\t\t\t\t\t.map((p) =>\n\t\t\t\t\t\t`\u00B7 ${getEnumMemberName(WindowCoveringParameter, p)}`\n\t\t\t\t\t)\n\t\t\t\t\t.join(\"\\n\")\n\t\t\t}`;\n\t\t\tctx.logNode(node.id, {\n\t\t\t\tendpoint: this.endpointIndex,\n\t\t\t\tmessage: logMessage,\n\t\t\t\tdirection: \"inbound\",\n\t\t\t});\n\n\t\t\t// Create metadata for all supported parameters\n\t\t\tfor (const param of supported) {\n\t\t\t\t// Default values\n\t\t\t\tthis.setMetadata(\n\t\t\t\t\tctx,\n\t\t\t\t\tWindowCoveringCCValues.currentValue(param),\n\t\t\t\t);\n\t\t\t\tthis.setMetadata(\n\t\t\t\t\tctx,\n\t\t\t\t\tWindowCoveringCCValues.targetValue(param),\n\t\t\t\t);\n\t\t\t\tthis.setMetadata(\n\t\t\t\t\tctx,\n\t\t\t\t\tWindowCoveringCCValues.duration(param),\n\t\t\t\t);\n\n\t\t\t\t// Level change values\n\t\t\t\tthis.setMetadata(\n\t\t\t\t\tctx,\n\t\t\t\t\tWindowCoveringCCValues.levelChangeUp(param),\n\t\t\t\t);\n\t\t\t\tthis.setMetadata(\n\t\t\t\t\tctx,\n\t\t\t\t\tWindowCoveringCCValues.levelChangeDown(param),\n\t\t\t\t);\n\n\t\t\t\t// And for the odd parameters (with position support), query the position\n\t\t\t\tif (param % 2 === 1) {\n\t\t\t\t\tctx.logNode(node.id, {\n\t\t\t\t\t\tendpoint: this.endpointIndex,\n\t\t\t\t\t\tmessage: `querying position for parameter ${\n\t\t\t\t\t\t\tgetEnumMemberName(\n\t\t\t\t\t\t\t\tWindowCoveringParameter,\n\t\t\t\t\t\t\t\tparam,\n\t\t\t\t\t\t\t)\n\t\t\t\t\t\t}...`,\n\t\t\t\t\t\tdirection: \"outbound\",\n\t\t\t\t\t});\n\t\t\t\t\tawait api.get(param);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t// Remember that the interview is complete\n\t\tthis.setInterviewComplete(ctx, true);\n\t}\n\n\tpublic translatePropertyKey(\n\t\tctx: GetValueDB,\n\t\tproperty: string | number,\n\t\tpropertyKey: string | number,\n\t): string | undefined {\n\t\tif (typeof propertyKey === \"number\") {\n\t\t\treturn getEnumMemberName(WindowCoveringParameter, propertyKey);\n\t\t}\n\t\treturn super.translatePropertyKey(ctx, property, propertyKey);\n\t}\n}\n\n// @publicAPI\nexport interface WindowCoveringCCSupportedReportOptions {\n\tsupportedParameters: readonly WindowCoveringParameter[];\n}\n\n@CCCommand(WindowCoveringCommand.SupportedReport)\n@ccValueProperty(\n\t\"supportedParameters\",\n\tWindowCoveringCCValues.supportedParameters,\n)\nexport class WindowCoveringCCSupportedReport extends WindowCoveringCC {\n\tpublic constructor(\n\t\toptions: WithAddress<WindowCoveringCCSupportedReportOptions>,\n\t) {\n\t\tsuper(options);\n\t\tthis.supportedParameters = options.supportedParameters;\n\t}\n\n\tpublic static from(\n\t\traw: CCRaw,\n\t\tctx: CCParsingContext,\n\t): WindowCoveringCCSupportedReport {\n\t\tvalidatePayload(raw.payload.length >= 1);\n\n\t\tconst numBitmaskBytes = raw.payload[0] & 0b1111;\n\t\tvalidatePayload(raw.payload.length >= 1 + numBitmaskBytes);\n\t\tconst bitmask = raw.payload.subarray(1, 1 + numBitmaskBytes);\n\t\tconst supportedParameters: WindowCoveringParameter[] = parseBitMask(\n\t\t\tbitmask,\n\t\t\tWindowCoveringParameter[\"Outbound Left (no position)\"],\n\t\t);\n\n\t\treturn new this({\n\t\t\tnodeId: ctx.sourceNodeId,\n\t\t\tsupportedParameters,\n\t\t});\n\t}\n\n\tpublic readonly supportedParameters: readonly WindowCoveringParameter[];\n\n\tpublic serialize(ctx: CCEncodingContext): Promise<Bytes> {\n\t\tconst bitmask = encodeBitMask(\n\t\t\tthis.supportedParameters,\n\t\t\tundefined,\n\t\t\tWindowCoveringParameter[\"Outbound Left (no position)\"],\n\t\t).subarray(0, 15);\n\t\tconst numBitmaskBytes = bitmask.length & 0b1111;\n\n\t\tthis.payload = Bytes.concat([\n\t\t\tBytes.from([numBitmaskBytes]),\n\t\t\tbitmask.subarray(0, numBitmaskBytes),\n\t\t]);\n\n\t\treturn super.serialize(ctx);\n\t}\n\n\tpublic toLogEntry(ctx?: GetValueDB): MessageOrCCLogEntry {\n\t\treturn {\n\t\t\t...super.toLogEntry(ctx),\n\t\t\tmessage: {\n\t\t\t\t\"supported parameters\": this.supportedParameters\n\t\t\t\t\t.map(\n\t\t\t\t\t\t(p) =>\n\t\t\t\t\t\t\t`\\n\u00B7 ${\n\t\t\t\t\t\t\t\tgetEnumMemberName(\n\t\t\t\t\t\t\t\t\tWindowCoveringParameter,\n\t\t\t\t\t\t\t\t\tp,\n\t\t\t\t\t\t\t\t)\n\t\t\t\t\t\t\t}`,\n\t\t\t\t\t)\n\t\t\t\t\t.join(\"\"),\n\t\t\t},\n\t\t};\n\t}\n}\n\n@CCCommand(WindowCoveringCommand.SupportedGet)\n@expectedCCResponse(WindowCoveringCCSupportedReport)\nexport class WindowCoveringCCSupportedGet extends WindowCoveringCC {}\n\n// @publicAPI\nexport interface WindowCoveringCCReportOptions {\n\tparameter: WindowCoveringParameter;\n\tcurrentValue: number;\n\ttargetValue: number;\n\tduration: Duration;\n}\n\n@CCCommand(WindowCoveringCommand.Report)\n@ccValueProperty(\n\t\"currentValue\",\n\tWindowCoveringCCValues.currentValue,\n\t(self) => [self.parameter],\n)\n@ccValueProperty(\n\t\"targetValue\",\n\tWindowCoveringCCValues.targetValue,\n\t(self) => [self.parameter],\n)\n@ccValueProperty(\n\t\"duration\",\n\tWindowCoveringCCValues.duration,\n\t(self) => [self.parameter],\n)\nexport class WindowCoveringCCReport extends WindowCoveringCC {\n\tpublic constructor(\n\t\toptions: WithAddress<WindowCoveringCCReportOptions>,\n\t) {\n\t\tsuper(options);\n\n\t\t// TODO: Check implementation:\n\t\tthis.parameter = options.parameter;\n\t\tthis.currentValue = options.currentValue;\n\t\tthis.targetValue = options.targetValue;\n\t\tthis.duration = options.duration;\n\t}\n\n\tpublic static from(\n\t\traw: CCRaw,\n\t\tctx: CCParsingContext,\n\t): WindowCoveringCCReport {\n\t\tvalidatePayload(raw.payload.length >= 4);\n\t\tconst parameter: WindowCoveringParameter = raw.payload[0];\n\t\tconst currentValue = raw.payload[1];\n\t\tconst targetValue = raw.payload[2];\n\t\tconst duration = Duration.parseReport(raw.payload[3])\n\t\t\t?? Duration.unknown();\n\n\t\treturn new this({\n\t\t\tnodeId: ctx.sourceNodeId,\n\t\t\tparameter,\n\t\t\tcurrentValue,\n\t\t\ttargetValue,\n\t\t\tduration,\n\t\t});\n\t}\n\n\tpublic readonly parameter: WindowCoveringParameter;\n\n\tpublic readonly currentValue: number;\n\n\tpublic readonly targetValue: number;\n\n\tpublic readonly duration: Duration;\n\n\tpublic toLogEntry(ctx?: GetValueDB): MessageOrCCLogEntry {\n\t\treturn {\n\t\t\t...super.toLogEntry(ctx),\n\t\t\tmessage: {\n\t\t\t\tparameter: getEnumMemberName(\n\t\t\t\t\tWindowCoveringParameter,\n\t\t\t\t\tthis.parameter,\n\t\t\t\t),\n\t\t\t\t\"current value\": this.currentValue,\n\t\t\t\t\"target value\": this.targetValue,\n\t\t\t\tduration: this.duration.toString(),\n\t\t\t},\n\t\t};\n\t}\n}\n\n// @publicAPI\nexport interface WindowCoveringCCGetOptions {\n\tparameter: WindowCoveringParameter;\n}\n\nfunction testResponseForWindowCoveringGet(\n\tsent: WindowCoveringCCGet,\n\treceived: WindowCoveringCCReport,\n) {\n\treturn received.parameter === sent.parameter;\n}\n\n@CCCommand(WindowCoveringCommand.Get)\n@expectedCCResponse(WindowCoveringCCReport, testResponseForWindowCoveringGet)\nexport class WindowCoveringCCGet extends WindowCoveringCC {\n\tpublic constructor(\n\t\toptions: WithAddress<WindowCoveringCCGetOptions>,\n\t) {\n\t\tsuper(options);\n\t\tthis.parameter = options.parameter;\n\t}\n\n\tpublic static from(raw: CCRaw, ctx: CCParsingContext): WindowCoveringCCGet {\n\t\tvalidatePayload(raw.payload.length >= 1);\n\t\tconst parameter: WindowCoveringParameter = raw.payload[0];\n\n\t\treturn new this({\n\t\t\tnodeId: ctx.sourceNodeId,\n\t\t\tparameter,\n\t\t});\n\t}\n\n\tpublic parameter: WindowCoveringParameter;\n\n\tpublic serialize(ctx: CCEncodingContext): Promise<Bytes> {\n\t\tthis.payload = Bytes.from([this.parameter]);\n\t\treturn super.serialize(ctx);\n\t}\n\n\tpublic toLogEntry(ctx?: GetValueDB): MessageOrCCLogEntry {\n\t\treturn {\n\t\t\t...super.toLogEntry(ctx),\n\t\t\tmessage: {\n\t\t\t\tparameter: getEnumMemberName(\n\t\t\t\t\tWindowCoveringParameter,\n\t\t\t\t\tthis.parameter,\n\t\t\t\t),\n\t\t\t},\n\t\t};\n\t}\n}\n\n// @publicAPI\nexport interface WindowCoveringCCSetOptions {\n\ttargetValues: {\n\t\tparameter: WindowCoveringParameter;\n\t\tvalue: number;\n\t}[];\n\tduration?: Duration | string;\n}\n\n@CCCommand(WindowCoveringCommand.Set)\n@useSupervision()\nexport class WindowCoveringCCSet extends WindowCoveringCC {\n\tpublic constructor(\n\t\toptions: WithAddress<WindowCoveringCCSetOptions>,\n\t) {\n\t\tsuper(options);\n\t\tthis.targetValues = options.targetValues;\n\t\tthis.duration = Duration.from(options.duration);\n\t}\n\n\tpublic static from(raw: CCRaw, ctx: CCParsingContext): WindowCoveringCCSet {\n\t\tvalidatePayload(raw.payload.length >= 1);\n\t\tconst numEntries = raw.payload[0] & 0b11111;\n\n\t\tvalidatePayload(raw.payload.length >= 1 + numEntries * 2);\n\t\tconst targetValues: WindowCoveringCCSetOptions[\"targetValues\"] = [];\n\n\t\tfor (let i = 0; i < numEntries; i++) {\n\t\t\tconst offset = 1 + i * 2;\n\t\t\ttargetValues.push({\n\t\t\t\tparameter: raw.payload[offset],\n\t\t\t\tvalue: raw.payload[offset + 1],\n\t\t\t});\n\t\t}\n\n\t\tlet duration: Duration | undefined;\n\n\t\tif (raw.payload.length >= 2 + numEntries * 2) {\n\t\t\tduration = Duration.parseSet(\n\t\t\t\traw.payload[1 + numEntries * 2],\n\t\t\t);\n\t\t}\n\n\t\treturn new this({\n\t\t\tnodeId: ctx.sourceNodeId,\n\t\t\ttargetValues,\n\t\t\tduration,\n\t\t});\n\t}\n\n\tpublic targetValues: {\n\t\tparameter: WindowCoveringParameter;\n\t\tvalue: number;\n\t}[];\n\tpublic duration: Duration | undefined;\n\n\tpublic serialize(ctx: CCEncodingContext): Promise<Bytes> {\n\t\tconst numEntries = this.targetValues.length & 0b11111;\n\t\tthis.payload = new Bytes(2 + numEntries * 2);\n\n\t\tthis.payload[0] = numEntries;\n\t\tfor (let i = 0; i < numEntries; i++) {\n\t\t\tconst offset = 1 + i * 2;\n\t\t\tthis.payload[offset] = this.targetValues[i].parameter;\n\t\t\tthis.payload[offset + 1] = this.targetValues[i].value;\n\t\t}\n\n\t\tthis.payload[this.payload.length - 1] = (\n\t\t\tthis.duration ?? Duration.default()\n\t\t).serializeSet();\n\n\t\treturn super.serialize(ctx);\n\t}\n\n\tpublic toLogEntry(ctx?: GetValueDB): MessageOrCCLogEntry {\n\t\tconst message: MessageRecord = {};\n\t\tfor (const { parameter, value } of this.targetValues) {\n\t\t\tmessage[getEnumMemberName(WindowCoveringParameter, parameter)] =\n\t\t\t\tvalue;\n\t\t}\n\t\tif (this.duration) {\n\t\t\tmessage.duration = this.duration.toString();\n\t\t}\n\t\treturn {\n\t\t\t...super.toLogEntry(ctx),\n\t\t\tmessage,\n\t\t};\n\t}\n}\n\n// @publicAPI\nexport interface WindowCoveringCCStartLevelChangeOptions {\n\tparameter: WindowCoveringParameter;\n\tdirection: keyof typeof LevelChangeDirection;\n\tduration?: Duration | string;\n}\n\n@CCCommand(WindowCoveringCommand.StartLevelChange)\n@useSupervision()\nexport class WindowCoveringCCStartLevelChange extends WindowCoveringCC {\n\tpublic constructor(\n\t\toptions: WithAddress<WindowCoveringCCStartLevelChangeOptions>,\n\t) {\n\t\tsuper(options);\n\t\tthis.parameter = options.parameter;\n\t\tthis.direction = options.direction;\n\t\tthis.duration = Duration.from(options.duration);\n\t}\n\n\tpublic static from(\n\t\traw: CCRaw,\n\t\tctx: CCParsingContext,\n\t): WindowCoveringCCStartLevelChange {\n\t\tvalidatePayload(raw.payload.length >= 2);\n\t\tconst direction = !!(raw.payload[0] & 0b0100_0000)\n\t\t\t? \"down\"\n\t\t\t: \"up\";\n\t\tconst parameter: WindowCoveringParameter = raw.payload[1];\n\t\tlet duration: Duration | undefined;\n\n\t\tif (raw.payload.length >= 3) {\n\t\t\tduration = Duration.parseSet(raw.payload[2]);\n\t\t}\n\n\t\treturn new this({\n\t\t\tnodeId: ctx.sourceNodeId,\n\t\t\tdirection,\n\t\t\tparameter,\n\t\t\tduration,\n\t\t});\n\t}\n\n\tpublic parameter: WindowCoveringParameter;\n\tpublic direction: keyof typeof LevelChangeDirection;\n\tpublic duration: Duration | undefined;\n\n\tpublic serialize(ctx: CCEncodingContext): Promise<Bytes> {\n\t\tthis.payload = Bytes.from([\n\t\t\tthis.direction === \"down\" ? 0b0100_0000 : 0b0000_0000,\n\t\t\tthis.parameter,\n\t\t\t(this.duration ?? Duration.default()).serializeSet(),\n\t\t]);\n\t\treturn super.serialize(ctx);\n\t}\n\n\tpublic toLogEntry(ctx?: GetValueDB): MessageOrCCLogEntry {\n\t\tconst message: MessageRecord = {\n\t\t\tparameter: getEnumMemberName(\n\t\t\t\tWindowCoveringParameter,\n\t\t\t\tthis.parameter,\n\t\t\t),\n\t\t\tdirection: this.direction,\n\t\t};\n\t\tif (this.duration) {\n\t\t\tmessage.duration = this.duration.toString();\n\t\t}\n\t\treturn {\n\t\t\t...super.toLogEntry(ctx),\n\t\t\tmessage,\n\t\t};\n\t}\n}\n\n// @publicAPI\nexport interface WindowCoveringCCStopLevelChangeOptions {\n\tparameter: WindowCoveringParameter;\n}\n\n@CCCommand(WindowCoveringCommand.StopLevelChange)\n@useSupervision()\nexport class WindowCoveringCCStopLevelChange extends WindowCoveringCC {\n\tpublic constructor(\n\t\toptions: WithAddress<WindowCoveringCCStopLevelChangeOptions>,\n\t) {\n\t\tsuper(options);\n\t\tthis.parameter = options.parameter;\n\t}\n\n\tpublic static from(\n\t\traw: CCRaw,\n\t\tctx: CCParsingContext,\n\t): WindowCoveringCCStopLevelChange {\n\t\tvalidatePayload(raw.payload.length >= 1);\n\t\tconst parameter: WindowCoveringParameter = raw.payload[0];\n\n\t\treturn new this({\n\t\t\tnodeId: ctx.sourceNodeId,\n\t\t\tparameter,\n\t\t});\n\t}\n\n\tpublic parameter: WindowCoveringParameter;\n\n\tpublic serialize(ctx: CCEncodingContext): Promise<Bytes> {\n\t\tthis.payload = Bytes.from([this.parameter]);\n\t\treturn super.serialize(ctx);\n\t}\n\n\tpublic toLogEntry(ctx?: GetValueDB): MessageOrCCLogEntry {\n\t\treturn {\n\t\t\t...super.toLogEntry(ctx),\n\t\t\tmessage: {\n\t\t\t\tparameter: getEnumMemberName(\n\t\t\t\t\tWindowCoveringParameter,\n\t\t\t\t\tthis.parameter,\n\t\t\t\t),\n\t\t\t},\n\t\t};\n\t}\n}\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;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