@zwave-js/cc 14.0.0-beta.4 → 14.0.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.js +381 -266
- package/build/cjs/cc/AlarmSensorCC.js.map +3 -3
- package/build/cjs/cc/AssociationCC.js +669 -503
- package/build/cjs/cc/AssociationCC.js.map +3 -3
- package/build/cjs/cc/AssociationGroupInfoCC.js +633 -492
- package/build/cjs/cc/AssociationGroupInfoCC.js.map +3 -3
- package/build/cjs/cc/BarrierOperatorCC.js +595 -429
- package/build/cjs/cc/BarrierOperatorCC.js.map +3 -3
- package/build/cjs/cc/BasicCC.js +354 -260
- package/build/cjs/cc/BasicCC.js.map +3 -3
- package/build/cjs/cc/BatteryCC.js +427 -345
- package/build/cjs/cc/BatteryCC.js.map +3 -3
- package/build/cjs/cc/BinarySensorCC.js +391 -276
- package/build/cjs/cc/BinarySensorCC.js.map +3 -3
- package/build/cjs/cc/BinarySwitchCC.js +347 -253
- package/build/cjs/cc/BinarySwitchCC.js.map +3 -3
- package/build/cjs/cc/CRC16CC.js +160 -85
- package/build/cjs/cc/CRC16CC.js.map +3 -3
- package/build/cjs/cc/CentralSceneCC.js +459 -324
- package/build/cjs/cc/CentralSceneCC.js.map +3 -3
- package/build/cjs/cc/ClimateControlScheduleCC.js +459 -293
- package/build/cjs/cc/ClimateControlScheduleCC.js.map +3 -3
- package/build/cjs/cc/ClockCC.js +254 -150
- package/build/cjs/cc/ClockCC.js.map +3 -3
- package/build/cjs/cc/ColorSwitchCC.js +758 -610
- package/build/cjs/cc/ColorSwitchCC.js.map +3 -3
- package/build/cjs/cc/ConfigurationCC.js +1700 -1453
- package/build/cjs/cc/ConfigurationCC.js.map +3 -3
- package/build/cjs/cc/DeviceResetLocallyCC.js +125 -49
- package/build/cjs/cc/DeviceResetLocallyCC.js.map +3 -3
- package/build/cjs/cc/DoorLockCC.js +904 -777
- package/build/cjs/cc/DoorLockCC.js.map +3 -3
- package/build/cjs/cc/DoorLockLoggingCC.js +321 -206
- package/build/cjs/cc/DoorLockLoggingCC.js.map +3 -3
- package/build/cjs/cc/EnergyProductionCC.js +249 -160
- package/build/cjs/cc/EnergyProductionCC.js.map +3 -3
- package/build/cjs/cc/EntryControlCC.js +619 -458
- package/build/cjs/cc/EntryControlCC.js.map +3 -3
- package/build/cjs/cc/FirmwareUpdateMetaDataCC.js +898 -698
- package/build/cjs/cc/FirmwareUpdateMetaDataCC.js.map +3 -3
- package/build/cjs/cc/HailCC.js +57 -11
- package/build/cjs/cc/HailCC.js.map +2 -2
- package/build/cjs/cc/HumidityControlModeCC.js +359 -233
- package/build/cjs/cc/HumidityControlModeCC.js.map +3 -3
- package/build/cjs/cc/HumidityControlOperatingStateCC.js +189 -103
- package/build/cjs/cc/HumidityControlOperatingStateCC.js.map +3 -3
- package/build/cjs/cc/HumidityControlSetpointCC.js +682 -495
- package/build/cjs/cc/HumidityControlSetpointCC.js.map +3 -3
- package/build/cjs/cc/InclusionControllerCC.js +205 -114
- package/build/cjs/cc/InclusionControllerCC.js.map +3 -3
- package/build/cjs/cc/IndicatorCC.js +897 -736
- package/build/cjs/cc/IndicatorCC.js.map +3 -3
- package/build/cjs/cc/IrrigationCC.js +1651 -1405
- package/build/cjs/cc/IrrigationCC.js.map +3 -3
- package/build/cjs/cc/LanguageCC.js +268 -171
- package/build/cjs/cc/LanguageCC.js.map +3 -3
- package/build/cjs/cc/LockCC.js +254 -154
- package/build/cjs/cc/LockCC.js.map +3 -3
- package/build/cjs/cc/ManufacturerProprietaryCC.js +189 -129
- package/build/cjs/cc/ManufacturerProprietaryCC.js.map +2 -2
- package/build/cjs/cc/ManufacturerSpecificCC.js +319 -213
- package/build/cjs/cc/ManufacturerSpecificCC.js.map +3 -3
- package/build/cjs/cc/MeterCC.js +827 -707
- package/build/cjs/cc/MeterCC.js.map +3 -3
- package/build/cjs/cc/MultiChannelAssociationCC.js +612 -478
- package/build/cjs/cc/MultiChannelAssociationCC.js.map +3 -3
- package/build/cjs/cc/MultiChannelCC.js +1037 -819
- package/build/cjs/cc/MultiChannelCC.js.map +3 -3
- package/build/cjs/cc/MultiCommandCC.js +172 -97
- package/build/cjs/cc/MultiCommandCC.js.map +3 -3
- package/build/cjs/cc/MultilevelSensorCC.js +589 -449
- package/build/cjs/cc/MultilevelSensorCC.js.map +3 -3
- package/build/cjs/cc/MultilevelSwitchCC.js +587 -439
- package/build/cjs/cc/MultilevelSwitchCC.js.map +3 -3
- package/build/cjs/cc/NoOperationCC.js +89 -27
- package/build/cjs/cc/NoOperationCC.js.map +2 -2
- package/build/cjs/cc/NodeNamingCC.js +417 -277
- package/build/cjs/cc/NodeNamingCC.js.map +3 -3
- package/build/cjs/cc/NotificationCC.js +972 -818
- package/build/cjs/cc/NotificationCC.js.map +3 -3
- package/build/cjs/cc/PowerlevelCC.js +450 -303
- package/build/cjs/cc/PowerlevelCC.js.map +3 -3
- package/build/cjs/cc/ProtectionCC.js +686 -494
- package/build/cjs/cc/ProtectionCC.js.map +3 -3
- package/build/cjs/cc/SceneActivationCC.js +165 -97
- package/build/cjs/cc/SceneActivationCC.js.map +3 -3
- package/build/cjs/cc/SceneActuatorConfigurationCC.js +346 -243
- package/build/cjs/cc/SceneActuatorConfigurationCC.js.map +3 -3
- package/build/cjs/cc/SceneControllerConfigurationCC.js +401 -298
- package/build/cjs/cc/SceneControllerConfigurationCC.js.map +3 -3
- package/build/cjs/cc/ScheduleEntryLockCC.js +1552 -1272
- package/build/cjs/cc/ScheduleEntryLockCC.js.map +3 -3
- package/build/cjs/cc/Security2CC.js +1483 -1219
- package/build/cjs/cc/Security2CC.js.map +3 -3
- package/build/cjs/cc/SecurityCC.js +839 -619
- package/build/cjs/cc/SecurityCC.js.map +3 -3
- package/build/cjs/cc/SoundSwitchCC.js +707 -515
- package/build/cjs/cc/SoundSwitchCC.js.map +3 -3
- package/build/cjs/cc/SupervisionCC.js +327 -237
- package/build/cjs/cc/SupervisionCC.js.map +3 -3
- package/build/cjs/cc/ThermostatFanModeCC.js +386 -263
- package/build/cjs/cc/ThermostatFanModeCC.js.map +3 -3
- package/build/cjs/cc/ThermostatFanStateCC.js +192 -106
- package/build/cjs/cc/ThermostatFanStateCC.js.map +3 -3
- package/build/cjs/cc/ThermostatModeCC.js +425 -302
- package/build/cjs/cc/ThermostatModeCC.js.map +3 -3
- package/build/cjs/cc/ThermostatOperatingStateCC.js +188 -102
- package/build/cjs/cc/ThermostatOperatingStateCC.js.map +3 -3
- package/build/cjs/cc/ThermostatSetbackCC.js +277 -173
- package/build/cjs/cc/ThermostatSetbackCC.js.map +3 -3
- package/build/cjs/cc/ThermostatSetpointCC.js +645 -491
- package/build/cjs/cc/ThermostatSetpointCC.js.map +3 -3
- package/build/cjs/cc/TimeCC.js +515 -353
- package/build/cjs/cc/TimeCC.js.map +3 -3
- package/build/cjs/cc/TimeParametersCC.js +302 -202
- package/build/cjs/cc/TimeParametersCC.js.map +3 -3
- package/build/cjs/cc/TransportServiceCC.js +433 -315
- package/build/cjs/cc/TransportServiceCC.js.map +3 -3
- package/build/cjs/cc/UserCodeCC.js +1385 -1102
- package/build/cjs/cc/UserCodeCC.js.map +3 -3
- package/build/cjs/cc/VersionCC.js +696 -562
- package/build/cjs/cc/VersionCC.js.map +3 -3
- package/build/cjs/cc/WakeUpCC.js +499 -346
- package/build/cjs/cc/WakeUpCC.js.map +3 -3
- package/build/cjs/cc/WindowCoveringCC.js +626 -478
- package/build/cjs/cc/WindowCoveringCC.js.map +3 -3
- package/build/cjs/cc/ZWaveLongRangeCC.js +57 -10
- package/build/cjs/cc/ZWaveLongRangeCC.js.map +2 -2
- package/build/cjs/cc/ZWavePlusCC.js +233 -159
- package/build/cjs/cc/ZWavePlusCC.js.map +3 -3
- package/build/cjs/cc/ZWaveProtocolCC.js +1515 -948
- package/build/cjs/cc/ZWaveProtocolCC.js.map +3 -3
- package/build/cjs/cc/manufacturerProprietary/Decorators.d.ts +4 -4
- package/build/cjs/cc/manufacturerProprietary/Decorators.js.map +1 -1
- package/build/cjs/cc/manufacturerProprietary/FibaroCC.js +395 -274
- package/build/cjs/cc/manufacturerProprietary/FibaroCC.js.map +3 -3
- package/build/cjs/lib/CommandClassDecorators.d.ts +11 -15
- package/build/cjs/lib/CommandClassDecorators.js +19 -20
- package/build/cjs/lib/CommandClassDecorators.js.map +2 -2
- package/build/cjs/lib/Security2/Extension.d.ts +1 -1
- package/build/cjs/lib/Security2/Extension.js +217 -126
- package/build/cjs/lib/Security2/Extension.js.map +3 -3
- package/build/esm/cc/AlarmSensorCC.d.ts.map +1 -1
- package/build/esm/cc/AlarmSensorCC.js +389 -291
- package/build/esm/cc/AlarmSensorCC.js.map +1 -1
- package/build/esm/cc/AssociationCC.d.ts.map +1 -1
- package/build/esm/cc/AssociationCC.js +678 -537
- package/build/esm/cc/AssociationCC.js.map +1 -1
- package/build/esm/cc/AssociationGroupInfoCC.d.ts.map +1 -1
- package/build/esm/cc/AssociationGroupInfoCC.js +659 -539
- package/build/esm/cc/AssociationGroupInfoCC.js.map +1 -1
- package/build/esm/cc/BarrierOperatorCC.d.ts.map +1 -1
- package/build/esm/cc/BarrierOperatorCC.js +634 -493
- package/build/esm/cc/BarrierOperatorCC.js.map +1 -1
- package/build/esm/cc/BasicCC.d.ts.map +1 -1
- package/build/esm/cc/BasicCC.js +380 -302
- package/build/esm/cc/BasicCC.js.map +1 -1
- package/build/esm/cc/BatteryCC.d.ts.map +1 -1
- package/build/esm/cc/BatteryCC.js +449 -384
- package/build/esm/cc/BatteryCC.js.map +1 -1
- package/build/esm/cc/BinarySensorCC.d.ts.map +1 -1
- package/build/esm/cc/BinarySensorCC.js +395 -297
- package/build/esm/cc/BinarySensorCC.js.map +1 -1
- package/build/esm/cc/BinarySwitchCC.d.ts.map +1 -1
- package/build/esm/cc/BinarySwitchCC.js +353 -274
- package/build/esm/cc/BinarySwitchCC.js.map +1 -1
- package/build/esm/cc/CRC16CC.js +162 -98
- package/build/esm/cc/CRC16CC.js.map +1 -1
- package/build/esm/cc/CentralSceneCC.d.ts.map +1 -1
- package/build/esm/cc/CentralSceneCC.js +465 -351
- package/build/esm/cc/CentralSceneCC.js.map +1 -1
- package/build/esm/cc/ClimateControlScheduleCC.d.ts.map +1 -1
- package/build/esm/cc/ClimateControlScheduleCC.js +454 -313
- package/build/esm/cc/ClimateControlScheduleCC.js.map +1 -1
- package/build/esm/cc/ClockCC.js +248 -159
- package/build/esm/cc/ClockCC.js.map +1 -1
- package/build/esm/cc/ColorSwitchCC.d.ts.map +1 -1
- package/build/esm/cc/ColorSwitchCC.js +802 -677
- package/build/esm/cc/ColorSwitchCC.js.map +1 -1
- package/build/esm/cc/ConfigurationCC.js +1899 -1687
- package/build/esm/cc/ConfigurationCC.js.map +1 -1
- package/build/esm/cc/DeviceResetLocallyCC.js +124 -59
- package/build/esm/cc/DeviceResetLocallyCC.js.map +1 -1
- package/build/esm/cc/DoorLockCC.d.ts.map +1 -1
- package/build/esm/cc/DoorLockCC.js +951 -849
- package/build/esm/cc/DoorLockCC.js.map +1 -1
- package/build/esm/cc/DoorLockLoggingCC.d.ts.map +1 -1
- package/build/esm/cc/DoorLockLoggingCC.js +316 -218
- package/build/esm/cc/DoorLockLoggingCC.js.map +1 -1
- package/build/esm/cc/EnergyProductionCC.js +240 -164
- package/build/esm/cc/EnergyProductionCC.js.map +1 -1
- package/build/esm/cc/EntryControlCC.d.ts.map +1 -1
- package/build/esm/cc/EntryControlCC.js +629 -493
- package/build/esm/cc/EntryControlCC.js.map +1 -1
- package/build/esm/cc/FirmwareUpdateMetaDataCC.d.ts.map +1 -1
- package/build/esm/cc/FirmwareUpdateMetaDataCC.js +938 -769
- package/build/esm/cc/FirmwareUpdateMetaDataCC.js.map +1 -1
- package/build/esm/cc/HailCC.js +51 -12
- package/build/esm/cc/HailCC.js.map +1 -1
- package/build/esm/cc/HumidityControlModeCC.d.ts.map +1 -1
- package/build/esm/cc/HumidityControlModeCC.js +357 -250
- package/build/esm/cc/HumidityControlModeCC.js.map +1 -1
- package/build/esm/cc/HumidityControlOperatingStateCC.d.ts.map +1 -1
- package/build/esm/cc/HumidityControlOperatingStateCC.js +182 -109
- package/build/esm/cc/HumidityControlOperatingStateCC.js.map +1 -1
- package/build/esm/cc/HumidityControlSetpointCC.d.ts.map +1 -1
- package/build/esm/cc/HumidityControlSetpointCC.js +706 -546
- package/build/esm/cc/HumidityControlSetpointCC.js.map +1 -1
- package/build/esm/cc/InclusionControllerCC.js +197 -119
- package/build/esm/cc/InclusionControllerCC.js.map +1 -1
- package/build/esm/cc/IndicatorCC.js +973 -835
- package/build/esm/cc/IndicatorCC.js.map +1 -1
- package/build/esm/cc/IrrigationCC.d.ts.map +1 -1
- package/build/esm/cc/IrrigationCC.js +1697 -1496
- package/build/esm/cc/IrrigationCC.js.map +1 -1
- package/build/esm/cc/LanguageCC.d.ts.map +1 -1
- package/build/esm/cc/LanguageCC.js +266 -184
- package/build/esm/cc/LanguageCC.js.map +1 -1
- package/build/esm/cc/LockCC.d.ts.map +1 -1
- package/build/esm/cc/LockCC.js +247 -162
- package/build/esm/cc/LockCC.js.map +1 -1
- package/build/esm/cc/ManufacturerProprietaryCC.js +192 -141
- package/build/esm/cc/ManufacturerProprietaryCC.js.map +1 -1
- package/build/esm/cc/ManufacturerSpecificCC.d.ts.map +1 -1
- package/build/esm/cc/ManufacturerSpecificCC.js +312 -223
- package/build/esm/cc/ManufacturerSpecificCC.js.map +1 -1
- package/build/esm/cc/MeterCC.d.ts.map +1 -1
- package/build/esm/cc/MeterCC.js +896 -795
- package/build/esm/cc/MeterCC.js.map +1 -1
- package/build/esm/cc/MultiChannelAssociationCC.d.ts.map +1 -1
- package/build/esm/cc/MultiChannelAssociationCC.js +631 -518
- package/build/esm/cc/MultiChannelAssociationCC.js.map +1 -1
- package/build/esm/cc/MultiChannelCC.d.ts.map +1 -1
- package/build/esm/cc/MultiChannelCC.js +1106 -921
- package/build/esm/cc/MultiChannelCC.js.map +1 -1
- package/build/esm/cc/MultiCommandCC.js +166 -102
- package/build/esm/cc/MultiCommandCC.js.map +1 -1
- package/build/esm/cc/MultilevelSensorCC.d.ts.map +1 -1
- package/build/esm/cc/MultilevelSensorCC.js +616 -497
- package/build/esm/cc/MultilevelSensorCC.js.map +1 -1
- package/build/esm/cc/MultilevelSwitchCC.d.ts.map +1 -1
- package/build/esm/cc/MultilevelSwitchCC.js +621 -496
- package/build/esm/cc/MultilevelSwitchCC.js.map +1 -1
- package/build/esm/cc/NoOperationCC.js +82 -29
- package/build/esm/cc/NoOperationCC.js.map +1 -1
- package/build/esm/cc/NodeNamingCC.d.ts.map +1 -1
- package/build/esm/cc/NodeNamingCC.js +413 -294
- package/build/esm/cc/NodeNamingCC.js.map +1 -1
- package/build/esm/cc/NotificationCC.d.ts.map +1 -1
- package/build/esm/cc/NotificationCC.js +1097 -966
- package/build/esm/cc/NotificationCC.js.map +1 -1
- package/build/esm/cc/PowerlevelCC.js +437 -311
- package/build/esm/cc/PowerlevelCC.js.map +1 -1
- package/build/esm/cc/ProtectionCC.d.ts.map +1 -1
- package/build/esm/cc/ProtectionCC.js +704 -543
- package/build/esm/cc/ProtectionCC.js.map +1 -1
- package/build/esm/cc/SceneActivationCC.d.ts.map +1 -1
- package/build/esm/cc/SceneActivationCC.js +157 -100
- package/build/esm/cc/SceneActivationCC.js.map +1 -1
- package/build/esm/cc/SceneActuatorConfigurationCC.js +357 -269
- package/build/esm/cc/SceneActuatorConfigurationCC.js.map +1 -1
- package/build/esm/cc/SceneControllerConfigurationCC.js +434 -346
- package/build/esm/cc/SceneControllerConfigurationCC.js.map +1 -1
- package/build/esm/cc/ScheduleEntryLockCC.d.ts.map +1 -1
- package/build/esm/cc/ScheduleEntryLockCC.js +1596 -1357
- package/build/esm/cc/ScheduleEntryLockCC.js.map +1 -1
- package/build/esm/cc/Security2CC.js +1633 -1406
- package/build/esm/cc/Security2CC.js.map +1 -1
- package/build/esm/cc/SecurityCC.js +876 -687
- package/build/esm/cc/SecurityCC.js.map +1 -1
- package/build/esm/cc/SoundSwitchCC.d.ts.map +1 -1
- package/build/esm/cc/SoundSwitchCC.js +689 -526
- package/build/esm/cc/SoundSwitchCC.js.map +1 -1
- package/build/esm/cc/SupervisionCC.js +349 -272
- package/build/esm/cc/SupervisionCC.js.map +1 -1
- package/build/esm/cc/ThermostatFanModeCC.d.ts.map +1 -1
- package/build/esm/cc/ThermostatFanModeCC.js +388 -284
- package/build/esm/cc/ThermostatFanModeCC.js.map +1 -1
- package/build/esm/cc/ThermostatFanStateCC.d.ts.map +1 -1
- package/build/esm/cc/ThermostatFanStateCC.js +184 -111
- package/build/esm/cc/ThermostatFanStateCC.js.map +1 -1
- package/build/esm/cc/ThermostatModeCC.d.ts.map +1 -1
- package/build/esm/cc/ThermostatModeCC.js +435 -331
- package/build/esm/cc/ThermostatModeCC.js.map +1 -1
- package/build/esm/cc/ThermostatOperatingStateCC.d.ts.map +1 -1
- package/build/esm/cc/ThermostatOperatingStateCC.js +180 -107
- package/build/esm/cc/ThermostatOperatingStateCC.js.map +1 -1
- package/build/esm/cc/ThermostatSetbackCC.js +274 -185
- package/build/esm/cc/ThermostatSetbackCC.js.map +1 -1
- package/build/esm/cc/ThermostatSetpointCC.d.ts.map +1 -1
- package/build/esm/cc/ThermostatSetpointCC.js +674 -543
- package/build/esm/cc/ThermostatSetpointCC.js.map +1 -1
- package/build/esm/cc/TimeCC.js +499 -360
- package/build/esm/cc/TimeCC.js.map +1 -1
- package/build/esm/cc/TimeParametersCC.d.ts.map +1 -1
- package/build/esm/cc/TimeParametersCC.js +296 -211
- package/build/esm/cc/TimeParametersCC.js.map +1 -1
- package/build/esm/cc/TransportServiceCC.js +464 -363
- package/build/esm/cc/TransportServiceCC.js.map +1 -1
- package/build/esm/cc/UserCodeCC.d.ts.map +1 -1
- package/build/esm/cc/UserCodeCC.js +1443 -1205
- package/build/esm/cc/UserCodeCC.js.map +1 -1
- package/build/esm/cc/VersionCC.d.ts.map +1 -1
- package/build/esm/cc/VersionCC.js +744 -635
- package/build/esm/cc/VersionCC.js.map +1 -1
- package/build/esm/cc/WakeUpCC.d.ts.map +1 -1
- package/build/esm/cc/WakeUpCC.js +494 -364
- package/build/esm/cc/WakeUpCC.js.map +1 -1
- package/build/esm/cc/WindowCoveringCC.d.ts.map +1 -1
- package/build/esm/cc/WindowCoveringCC.js +655 -530
- package/build/esm/cc/WindowCoveringCC.js.map +1 -1
- package/build/esm/cc/ZWaveLongRangeCC.js +51 -11
- package/build/esm/cc/ZWaveLongRangeCC.js.map +1 -1
- package/build/esm/cc/ZWavePlusCC.d.ts.map +1 -1
- package/build/esm/cc/ZWavePlusCC.js +223 -162
- package/build/esm/cc/ZWavePlusCC.js.map +1 -1
- package/build/esm/cc/ZWaveProtocolCC.js +1443 -953
- package/build/esm/cc/ZWaveProtocolCC.js.map +1 -1
- package/build/esm/cc/manufacturerProprietary/Decorators.d.ts +4 -4
- package/build/esm/cc/manufacturerProprietary/Decorators.d.ts.map +1 -1
- package/build/esm/cc/manufacturerProprietary/FibaroCC.js +390 -286
- package/build/esm/cc/manufacturerProprietary/FibaroCC.js.map +1 -1
- package/build/esm/lib/CommandClassDecorators.d.ts +11 -15
- package/build/esm/lib/CommandClassDecorators.d.ts.map +1 -1
- package/build/esm/lib/CommandClassDecorators.js +24 -24
- package/build/esm/lib/CommandClassDecorators.js.map +1 -1
- package/build/esm/lib/Security2/Extension.d.ts +1 -1
- package/build/esm/lib/Security2/Extension.d.ts.map +1 -1
- package/build/esm/lib/Security2/Extension.js +207 -123
- package/build/esm/lib/Security2/Extension.js.map +1 -1
- package/package.json +6 -6
|
@@ -1,10 +1,37 @@
|
|
|
1
|
-
var
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
1
|
+
var __esDecorate = (this && this.__esDecorate) || function (ctor, descriptorIn, decorators, contextIn, initializers, extraInitializers) {
|
|
2
|
+
function accept(f) { if (f !== void 0 && typeof f !== "function") throw new TypeError("Function expected"); return f; }
|
|
3
|
+
var kind = contextIn.kind, key = kind === "getter" ? "get" : kind === "setter" ? "set" : "value";
|
|
4
|
+
var target = !descriptorIn && ctor ? contextIn["static"] ? ctor : ctor.prototype : null;
|
|
5
|
+
var descriptor = descriptorIn || (target ? Object.getOwnPropertyDescriptor(target, contextIn.name) : {});
|
|
6
|
+
var _, done = false;
|
|
7
|
+
for (var i = decorators.length - 1; i >= 0; i--) {
|
|
8
|
+
var context = {};
|
|
9
|
+
for (var p in contextIn) context[p] = p === "access" ? {} : contextIn[p];
|
|
10
|
+
for (var p in contextIn.access) context.access[p] = contextIn.access[p];
|
|
11
|
+
context.addInitializer = function (f) { if (done) throw new TypeError("Cannot add initializers after decoration has completed"); extraInitializers.push(accept(f || null)); };
|
|
12
|
+
var result = (0, decorators[i])(kind === "accessor" ? { get: descriptor.get, set: descriptor.set } : descriptor[key], context);
|
|
13
|
+
if (kind === "accessor") {
|
|
14
|
+
if (result === void 0) continue;
|
|
15
|
+
if (result === null || typeof result !== "object") throw new TypeError("Object expected");
|
|
16
|
+
if (_ = accept(result.get)) descriptor.get = _;
|
|
17
|
+
if (_ = accept(result.set)) descriptor.set = _;
|
|
18
|
+
if (_ = accept(result.init)) initializers.unshift(_);
|
|
19
|
+
}
|
|
20
|
+
else if (_ = accept(result)) {
|
|
21
|
+
if (kind === "field") initializers.unshift(_);
|
|
22
|
+
else descriptor[key] = _;
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
if (target) Object.defineProperty(target, contextIn.name, descriptor);
|
|
26
|
+
done = true;
|
|
27
|
+
};
|
|
28
|
+
var __runInitializers = (this && this.__runInitializers) || function (thisArg, initializers, value) {
|
|
29
|
+
var useValue = arguments.length > 2;
|
|
30
|
+
for (var i = 0; i < initializers.length; i++) {
|
|
31
|
+
value = useValue ? initializers[i].call(thisArg, value) : initializers[i].call(thisArg);
|
|
32
|
+
}
|
|
33
|
+
return useValue ? value : void 0;
|
|
6
34
|
};
|
|
7
|
-
var WindowCoveringCCSupportedReport_1, WindowCoveringCCReport_1, WindowCoveringCCGet_1, WindowCoveringCCSet_1, WindowCoveringCCStartLevelChange_1, WindowCoveringCCStopLevelChange_1;
|
|
8
35
|
function __assertType(argName, typeName, boundHasError) {
|
|
9
36
|
const { ZWaveError, ZWaveErrorCodes } = require("@zwave-js/core");
|
|
10
37
|
if (boundHasError()) {
|
|
@@ -104,7 +131,7 @@ import { Bytes } from "@zwave-js/shared/safe";
|
|
|
104
131
|
import { getEnumMemberName, pick } from "@zwave-js/shared/safe";
|
|
105
132
|
import { CCAPI, POLL_VALUE, SET_VALUE, SET_VALUE_HOOKS, throwMissingPropertyKey, throwUnsupportedProperty, throwUnsupportedPropertyKey, throwWrongValueType, } from "../lib/API.js";
|
|
106
133
|
import { CommandClass, } from "../lib/CommandClass.js";
|
|
107
|
-
import { API, CCCommand,
|
|
134
|
+
import { API, CCCommand, ccValueProperty, ccValues, commandClass, expectedCCResponse, implementedVersion, useSupervision, } from "../lib/CommandClassDecorators.js";
|
|
108
135
|
import { V } from "../lib/Values.js";
|
|
109
136
|
import { WindowCoveringCommand, WindowCoveringParameter, } from "../lib/_Types.js";
|
|
110
137
|
function parameterToMetadataStates(parameter) {
|
|
@@ -210,571 +237,669 @@ export const WindowCoveringCCValues = Object.freeze({
|
|
|
210
237
|
}),
|
|
211
238
|
}),
|
|
212
239
|
});
|
|
213
|
-
let WindowCoveringCCAPI =
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
240
|
+
let WindowCoveringCCAPI = (() => {
|
|
241
|
+
let _classDecorators = [API(CommandClasses["Window Covering"])];
|
|
242
|
+
let _classDescriptor;
|
|
243
|
+
let _classExtraInitializers = [];
|
|
244
|
+
let _classThis;
|
|
245
|
+
let _classSuper = CCAPI;
|
|
246
|
+
var WindowCoveringCCAPI = class extends _classSuper {
|
|
247
|
+
static { _classThis = this; }
|
|
248
|
+
static {
|
|
249
|
+
const _metadata = typeof Symbol === "function" && Symbol.metadata ? Object.create(_classSuper[Symbol.metadata] ?? null) : void 0;
|
|
250
|
+
__esDecorate(null, _classDescriptor = { value: _classThis }, _classDecorators, { kind: "class", name: _classThis.name, metadata: _metadata }, null, _classExtraInitializers);
|
|
251
|
+
WindowCoveringCCAPI = _classThis = _classDescriptor.value;
|
|
252
|
+
if (_metadata) Object.defineProperty(_classThis, Symbol.metadata, { enumerable: true, configurable: true, writable: true, value: _metadata });
|
|
253
|
+
__runInitializers(_classThis, _classExtraInitializers);
|
|
254
|
+
}
|
|
255
|
+
supportsCommand(cmd) {
|
|
256
|
+
switch (cmd) {
|
|
257
|
+
case WindowCoveringCommand.Get:
|
|
258
|
+
case WindowCoveringCommand.Set:
|
|
259
|
+
case WindowCoveringCommand.SupportedGet:
|
|
260
|
+
case WindowCoveringCommand.StartLevelChange:
|
|
261
|
+
case WindowCoveringCommand.StopLevelChange:
|
|
262
|
+
return true; // This is mandatory
|
|
263
|
+
}
|
|
264
|
+
return super.supportsCommand(cmd);
|
|
265
|
+
}
|
|
266
|
+
get [SET_VALUE]() {
|
|
267
|
+
return async function ({ property, propertyKey }, value, options) {
|
|
268
|
+
const valueId = {
|
|
269
|
+
commandClass: this.ccId,
|
|
270
|
+
property,
|
|
271
|
+
propertyKey,
|
|
272
|
+
};
|
|
273
|
+
if (WindowCoveringCCValues.targetValue.is(valueId)) {
|
|
274
|
+
if (typeof propertyKey !== "number"
|
|
275
|
+
// Only odd-numbered parameters have position support and are writable
|
|
276
|
+
|| propertyKey % 2 === 0) {
|
|
277
|
+
throwUnsupportedPropertyKey(this.ccId, property, propertyKey);
|
|
278
|
+
}
|
|
279
|
+
if (typeof value !== "number") {
|
|
280
|
+
throwWrongValueType(this.ccId, property, "number", typeof value);
|
|
281
|
+
}
|
|
282
|
+
const parameter = propertyKey;
|
|
283
|
+
const duration = Duration.from(options?.transitionDuration);
|
|
284
|
+
return this.set([{ parameter, value }], duration);
|
|
285
|
+
}
|
|
286
|
+
else if (WindowCoveringCCValues.levelChangeUp.is(valueId)
|
|
287
|
+
|| WindowCoveringCCValues.levelChangeDown.is(valueId)) {
|
|
288
|
+
if (typeof value !== "boolean") {
|
|
289
|
+
throwWrongValueType(this.ccId, property, "boolean", typeof value);
|
|
290
|
+
}
|
|
291
|
+
const parameter = propertyKey;
|
|
292
|
+
const direction = WindowCoveringCCValues.levelChangeUp.is(valueId)
|
|
293
|
+
? "up"
|
|
294
|
+
: "down";
|
|
295
|
+
if (value) {
|
|
296
|
+
// Perform the level change
|
|
297
|
+
const duration = Duration.from(options?.transitionDuration);
|
|
298
|
+
return this.startLevelChange(parameter, direction, duration);
|
|
299
|
+
}
|
|
300
|
+
else {
|
|
301
|
+
return this.stopLevelChange(parameter);
|
|
302
|
+
}
|
|
303
|
+
}
|
|
304
|
+
else {
|
|
305
|
+
throwUnsupportedProperty(this.ccId, property);
|
|
306
|
+
}
|
|
307
|
+
};
|
|
308
|
+
}
|
|
309
|
+
[SET_VALUE_HOOKS] = ({ property, propertyKey }, value, options) => {
|
|
227
310
|
const valueId = {
|
|
228
311
|
commandClass: this.ccId,
|
|
229
312
|
property,
|
|
230
313
|
propertyKey,
|
|
231
314
|
};
|
|
232
315
|
if (WindowCoveringCCValues.targetValue.is(valueId)) {
|
|
233
|
-
if (typeof propertyKey !== "number"
|
|
234
|
-
|
|
235
|
-
|| propertyKey % 2 === 0) {
|
|
236
|
-
throwUnsupportedPropertyKey(this.ccId, property, propertyKey);
|
|
237
|
-
}
|
|
238
|
-
if (typeof value !== "number") {
|
|
239
|
-
throwWrongValueType(this.ccId, property, "number", typeof value);
|
|
240
|
-
}
|
|
316
|
+
if (typeof propertyKey !== "number")
|
|
317
|
+
return;
|
|
241
318
|
const parameter = propertyKey;
|
|
242
319
|
const duration = Duration.from(options?.transitionDuration);
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
[SET_VALUE_HOOKS] = ({ property, propertyKey }, value, options) => {
|
|
269
|
-
const valueId = {
|
|
270
|
-
commandClass: this.ccId,
|
|
271
|
-
property,
|
|
272
|
-
propertyKey,
|
|
273
|
-
};
|
|
274
|
-
if (WindowCoveringCCValues.targetValue.is(valueId)) {
|
|
275
|
-
if (typeof propertyKey !== "number")
|
|
276
|
-
return;
|
|
277
|
-
const parameter = propertyKey;
|
|
278
|
-
const duration = Duration.from(options?.transitionDuration);
|
|
279
|
-
const currentValueValueId = WindowCoveringCCValues.currentValue(parameter).endpoint(this.endpoint.index);
|
|
280
|
-
return {
|
|
281
|
-
// Window Covering commands may take some time to be executed.
|
|
282
|
-
// Therefore we try to supervise the command execution and delay the
|
|
283
|
-
// optimistic update until the final result is received.
|
|
284
|
-
supervisionDelayedUpdates: true,
|
|
285
|
-
supervisionOnSuccess: async () => {
|
|
286
|
-
// Only update currentValue for valid target values
|
|
287
|
-
if (typeof value === "number"
|
|
288
|
-
&& value >= 0
|
|
289
|
-
&& value <= 99) {
|
|
290
|
-
this.tryGetValueDB()?.setValue(currentValueValueId, value);
|
|
291
|
-
}
|
|
292
|
-
else if (value === 255) {
|
|
293
|
-
// We don't know the status now, so refresh the current value
|
|
320
|
+
const currentValueValueId = WindowCoveringCCValues.currentValue(parameter).endpoint(this.endpoint.index);
|
|
321
|
+
return {
|
|
322
|
+
// Window Covering commands may take some time to be executed.
|
|
323
|
+
// Therefore we try to supervise the command execution and delay the
|
|
324
|
+
// optimistic update until the final result is received.
|
|
325
|
+
supervisionDelayedUpdates: true,
|
|
326
|
+
supervisionOnSuccess: async () => {
|
|
327
|
+
// Only update currentValue for valid target values
|
|
328
|
+
if (typeof value === "number"
|
|
329
|
+
&& value >= 0
|
|
330
|
+
&& value <= 99) {
|
|
331
|
+
this.tryGetValueDB()?.setValue(currentValueValueId, value);
|
|
332
|
+
}
|
|
333
|
+
else if (value === 255) {
|
|
334
|
+
// We don't know the status now, so refresh the current value
|
|
335
|
+
try {
|
|
336
|
+
await this.get(parameter);
|
|
337
|
+
}
|
|
338
|
+
catch {
|
|
339
|
+
// ignore
|
|
340
|
+
}
|
|
341
|
+
}
|
|
342
|
+
},
|
|
343
|
+
supervisionOnFailure: async () => {
|
|
344
|
+
// The transition failed, so now we don't know the status - refresh the current value
|
|
294
345
|
try {
|
|
295
346
|
await this.get(parameter);
|
|
296
347
|
}
|
|
297
348
|
catch {
|
|
298
349
|
// ignore
|
|
299
350
|
}
|
|
300
|
-
}
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
351
|
+
},
|
|
352
|
+
optimisticallyUpdateRelatedValues: (_supervisedAndSuccessful) => {
|
|
353
|
+
// Only update currentValue for valid target values
|
|
354
|
+
if (typeof value === "number"
|
|
355
|
+
&& value >= 0
|
|
356
|
+
&& value <= 99) {
|
|
357
|
+
if (this.isSinglecast()) {
|
|
358
|
+
this.tryGetValueDB()?.setValue(currentValueValueId, value);
|
|
359
|
+
}
|
|
360
|
+
else if (this.isMulticast()) {
|
|
361
|
+
// Figure out which nodes were affected by this command
|
|
362
|
+
const affectedNodes = this.endpoint.node
|
|
363
|
+
.physicalNodes.filter((node) => node
|
|
364
|
+
.getEndpoint(this.endpoint.index)
|
|
365
|
+
?.supportsCC(this.ccId));
|
|
366
|
+
// and optimistically update the currentValue
|
|
367
|
+
for (const node of affectedNodes) {
|
|
368
|
+
this.host
|
|
369
|
+
.tryGetValueDB(node.id)
|
|
370
|
+
?.setValue(currentValueValueId, value);
|
|
371
|
+
}
|
|
372
|
+
}
|
|
373
|
+
}
|
|
374
|
+
},
|
|
375
|
+
verifyChanges: () => {
|
|
316
376
|
if (this.isSinglecast()) {
|
|
317
|
-
|
|
377
|
+
// We query currentValue instead of targetValue to make sure that unsolicited updates cancel the scheduled poll
|
|
378
|
+
this.schedulePoll(currentValueValueId, value, {
|
|
379
|
+
duration,
|
|
380
|
+
});
|
|
318
381
|
}
|
|
319
|
-
else
|
|
320
|
-
//
|
|
321
|
-
const affectedNodes = this.endpoint.node
|
|
322
|
-
.physicalNodes.filter((node) => node
|
|
323
|
-
.getEndpoint(this.endpoint.index)
|
|
324
|
-
?.supportsCC(this.ccId));
|
|
325
|
-
// and optimistically update the currentValue
|
|
326
|
-
for (const node of affectedNodes) {
|
|
327
|
-
this.host
|
|
328
|
-
.tryGetValueDB(node.id)
|
|
329
|
-
?.setValue(currentValueValueId, value);
|
|
330
|
-
}
|
|
382
|
+
else {
|
|
383
|
+
// For multicasts, do not schedule a refresh - this could cause a LOT of traffic
|
|
331
384
|
}
|
|
332
|
-
}
|
|
333
|
-
}
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
385
|
+
},
|
|
386
|
+
};
|
|
387
|
+
}
|
|
388
|
+
};
|
|
389
|
+
get [POLL_VALUE]() {
|
|
390
|
+
return async function ({ property, propertyKey }) {
|
|
391
|
+
switch (property) {
|
|
392
|
+
case "currentValue":
|
|
393
|
+
case "targetValue":
|
|
394
|
+
case "duration":
|
|
395
|
+
if (propertyKey == undefined) {
|
|
396
|
+
throwMissingPropertyKey(this.ccId, property);
|
|
397
|
+
}
|
|
398
|
+
else if (typeof propertyKey !== "number") {
|
|
399
|
+
throwUnsupportedPropertyKey(this.ccId, property, propertyKey);
|
|
400
|
+
}
|
|
401
|
+
return (await this.get(propertyKey))?.[property];
|
|
402
|
+
default:
|
|
403
|
+
throwUnsupportedProperty(this.ccId, property);
|
|
404
|
+
}
|
|
345
405
|
};
|
|
346
406
|
}
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
|
|
407
|
+
async getSupported() {
|
|
408
|
+
this.assertSupportsCommand(WindowCoveringCommand, WindowCoveringCommand.SupportedGet);
|
|
409
|
+
const cc = new WindowCoveringCCSupportedGet({
|
|
410
|
+
nodeId: this.endpoint.nodeId,
|
|
411
|
+
endpointIndex: this.endpoint.index,
|
|
412
|
+
});
|
|
413
|
+
const response = await this.host.sendCommand(cc, this.commandOptions);
|
|
414
|
+
return response?.supportedParameters;
|
|
415
|
+
}
|
|
416
|
+
async get(parameter) {
|
|
417
|
+
__assertType("parameter", "WindowCoveringParameter", __assertType__WindowCoveringParameter.bind(void 0, parameter));
|
|
418
|
+
this.assertSupportsCommand(WindowCoveringCommand, WindowCoveringCommand.Get);
|
|
419
|
+
const cc = new WindowCoveringCCGet({
|
|
420
|
+
nodeId: this.endpoint.nodeId,
|
|
421
|
+
endpointIndex: this.endpoint.index,
|
|
422
|
+
parameter,
|
|
423
|
+
});
|
|
424
|
+
const response = await this.host.sendCommand(cc, this.commandOptions);
|
|
425
|
+
if (response) {
|
|
426
|
+
return pick(response, ["currentValue", "targetValue", "duration"]);
|
|
363
427
|
}
|
|
364
|
-
};
|
|
365
|
-
}
|
|
366
|
-
async getSupported() {
|
|
367
|
-
this.assertSupportsCommand(WindowCoveringCommand, WindowCoveringCommand.SupportedGet);
|
|
368
|
-
const cc = new WindowCoveringCCSupportedGet({
|
|
369
|
-
nodeId: this.endpoint.nodeId,
|
|
370
|
-
endpointIndex: this.endpoint.index,
|
|
371
|
-
});
|
|
372
|
-
const response = await this.host.sendCommand(cc, this.commandOptions);
|
|
373
|
-
return response?.supportedParameters;
|
|
374
|
-
}
|
|
375
|
-
async get(parameter) {
|
|
376
|
-
__assertType("parameter", "WindowCoveringParameter", __assertType__WindowCoveringParameter.bind(void 0, parameter));
|
|
377
|
-
this.assertSupportsCommand(WindowCoveringCommand, WindowCoveringCommand.Get);
|
|
378
|
-
const cc = new WindowCoveringCCGet({
|
|
379
|
-
nodeId: this.endpoint.nodeId,
|
|
380
|
-
endpointIndex: this.endpoint.index,
|
|
381
|
-
parameter,
|
|
382
|
-
});
|
|
383
|
-
const response = await this.host.sendCommand(cc, this.commandOptions);
|
|
384
|
-
if (response) {
|
|
385
|
-
return pick(response, ["currentValue", "targetValue", "duration"]);
|
|
386
428
|
}
|
|
387
|
-
|
|
388
|
-
|
|
389
|
-
|
|
390
|
-
|
|
391
|
-
|
|
392
|
-
|
|
393
|
-
|
|
394
|
-
|
|
395
|
-
|
|
396
|
-
|
|
397
|
-
|
|
398
|
-
|
|
399
|
-
|
|
400
|
-
|
|
401
|
-
|
|
402
|
-
|
|
403
|
-
|
|
404
|
-
|
|
405
|
-
|
|
406
|
-
|
|
407
|
-
|
|
408
|
-
|
|
409
|
-
|
|
410
|
-
|
|
411
|
-
|
|
412
|
-
|
|
413
|
-
|
|
414
|
-
|
|
415
|
-
|
|
416
|
-
|
|
417
|
-
|
|
418
|
-
|
|
419
|
-
|
|
420
|
-
|
|
421
|
-
|
|
422
|
-
|
|
423
|
-
}
|
|
424
|
-
|
|
425
|
-
|
|
426
|
-
API(CommandClasses["Window Covering"])
|
|
427
|
-
], WindowCoveringCCAPI);
|
|
429
|
+
async set(targetValues, duration) {
|
|
430
|
+
__assertType("targetValues", undefined, __assertType__sa__2_ea_2.bind(void 0, targetValues));
|
|
431
|
+
__assertType("duration", undefined, __assertType__optional_su__string__2_eu.bind(void 0, duration));
|
|
432
|
+
this.assertSupportsCommand(WindowCoveringCommand, WindowCoveringCommand.StartLevelChange);
|
|
433
|
+
const cc = new WindowCoveringCCSet({
|
|
434
|
+
nodeId: this.endpoint.nodeId,
|
|
435
|
+
endpointIndex: this.endpoint.index,
|
|
436
|
+
targetValues,
|
|
437
|
+
duration,
|
|
438
|
+
});
|
|
439
|
+
return this.host.sendCommand(cc, this.commandOptions);
|
|
440
|
+
}
|
|
441
|
+
async startLevelChange(parameter, direction, duration) {
|
|
442
|
+
__assertType("parameter", "WindowCoveringParameter", __assertType__WindowCoveringParameter.bind(void 0, parameter));
|
|
443
|
+
__assertType("direction", undefined, __assertType__su__1__2_eu.bind(void 0, direction));
|
|
444
|
+
__assertType("duration", undefined, __assertType__optional_su__string__2_eu.bind(void 0, duration));
|
|
445
|
+
this.assertSupportsCommand(WindowCoveringCommand, WindowCoveringCommand.StartLevelChange);
|
|
446
|
+
const cc = new WindowCoveringCCStartLevelChange({
|
|
447
|
+
nodeId: this.endpoint.nodeId,
|
|
448
|
+
endpointIndex: this.endpoint.index,
|
|
449
|
+
parameter,
|
|
450
|
+
direction,
|
|
451
|
+
duration,
|
|
452
|
+
});
|
|
453
|
+
return this.host.sendCommand(cc, this.commandOptions);
|
|
454
|
+
}
|
|
455
|
+
async stopLevelChange(parameter) {
|
|
456
|
+
__assertType("parameter", "WindowCoveringParameter", __assertType__WindowCoveringParameter.bind(void 0, parameter));
|
|
457
|
+
this.assertSupportsCommand(WindowCoveringCommand, WindowCoveringCommand.StopLevelChange);
|
|
458
|
+
const cc = new WindowCoveringCCStopLevelChange({
|
|
459
|
+
nodeId: this.endpoint.nodeId,
|
|
460
|
+
endpointIndex: this.endpoint.index,
|
|
461
|
+
parameter,
|
|
462
|
+
});
|
|
463
|
+
return this.host.sendCommand(cc, this.commandOptions);
|
|
464
|
+
}
|
|
465
|
+
};
|
|
466
|
+
return WindowCoveringCCAPI = _classThis;
|
|
467
|
+
})();
|
|
428
468
|
export { WindowCoveringCCAPI };
|
|
429
|
-
let WindowCoveringCC =
|
|
430
|
-
|
|
431
|
-
|
|
432
|
-
|
|
433
|
-
|
|
434
|
-
|
|
435
|
-
|
|
436
|
-
|
|
437
|
-
|
|
438
|
-
|
|
439
|
-
|
|
440
|
-
|
|
441
|
-
|
|
442
|
-
|
|
443
|
-
|
|
444
|
-
|
|
445
|
-
|
|
446
|
-
|
|
447
|
-
|
|
448
|
-
|
|
449
|
-
|
|
450
|
-
.map((p) => `· ${getEnumMemberName(WindowCoveringParameter, p)}`)
|
|
451
|
-
.join("\n")}`;
|
|
469
|
+
let WindowCoveringCC = (() => {
|
|
470
|
+
let _classDecorators = [commandClass(CommandClasses["Window Covering"]), implementedVersion(1), ccValues(WindowCoveringCCValues)];
|
|
471
|
+
let _classDescriptor;
|
|
472
|
+
let _classExtraInitializers = [];
|
|
473
|
+
let _classThis;
|
|
474
|
+
let _classSuper = CommandClass;
|
|
475
|
+
var WindowCoveringCC = class extends _classSuper {
|
|
476
|
+
static { _classThis = this; }
|
|
477
|
+
static {
|
|
478
|
+
const _metadata = typeof Symbol === "function" && Symbol.metadata ? Object.create(_classSuper[Symbol.metadata] ?? null) : void 0;
|
|
479
|
+
__esDecorate(null, _classDescriptor = { value: _classThis }, _classDecorators, { kind: "class", name: _classThis.name, metadata: _metadata }, null, _classExtraInitializers);
|
|
480
|
+
WindowCoveringCC = _classThis = _classDescriptor.value;
|
|
481
|
+
if (_metadata) Object.defineProperty(_classThis, Symbol.metadata, { enumerable: true, configurable: true, writable: true, value: _metadata });
|
|
482
|
+
__runInitializers(_classThis, _classExtraInitializers);
|
|
483
|
+
}
|
|
484
|
+
async interview(ctx) {
|
|
485
|
+
const node = this.getNode(ctx);
|
|
486
|
+
const endpoint = this.getEndpoint(ctx);
|
|
487
|
+
const api = CCAPI.create(CommandClasses["Window Covering"], ctx, endpoint).withOptions({
|
|
488
|
+
priority: MessagePriority.NodeQuery,
|
|
489
|
+
});
|
|
452
490
|
ctx.logNode(node.id, {
|
|
453
491
|
endpoint: this.endpointIndex,
|
|
454
|
-
message:
|
|
455
|
-
direction: "
|
|
492
|
+
message: `Interviewing ${this.ccName}...`,
|
|
493
|
+
direction: "none",
|
|
456
494
|
});
|
|
457
|
-
|
|
458
|
-
|
|
459
|
-
|
|
460
|
-
|
|
461
|
-
|
|
462
|
-
|
|
463
|
-
|
|
464
|
-
|
|
465
|
-
|
|
466
|
-
|
|
467
|
-
|
|
468
|
-
|
|
469
|
-
|
|
470
|
-
|
|
471
|
-
|
|
472
|
-
|
|
473
|
-
|
|
495
|
+
ctx.logNode(node.id, {
|
|
496
|
+
endpoint: this.endpointIndex,
|
|
497
|
+
message: "querying supported window covering parameters...",
|
|
498
|
+
direction: "outbound",
|
|
499
|
+
});
|
|
500
|
+
const supported = await api.getSupported();
|
|
501
|
+
if (supported?.length) {
|
|
502
|
+
const logMessage = `supported window covering parameters:
|
|
503
|
+
${supported
|
|
504
|
+
.map((p) => `· ${getEnumMemberName(WindowCoveringParameter, p)}`)
|
|
505
|
+
.join("\n")}`;
|
|
506
|
+
ctx.logNode(node.id, {
|
|
507
|
+
endpoint: this.endpointIndex,
|
|
508
|
+
message: logMessage,
|
|
509
|
+
direction: "inbound",
|
|
510
|
+
});
|
|
511
|
+
// Create metadata for all supported parameters
|
|
512
|
+
for (const param of supported) {
|
|
513
|
+
// Default values
|
|
514
|
+
this.setMetadata(ctx, WindowCoveringCCValues.currentValue(param));
|
|
515
|
+
this.setMetadata(ctx, WindowCoveringCCValues.targetValue(param));
|
|
516
|
+
this.setMetadata(ctx, WindowCoveringCCValues.duration(param));
|
|
517
|
+
// Level change values
|
|
518
|
+
this.setMetadata(ctx, WindowCoveringCCValues.levelChangeUp(param));
|
|
519
|
+
this.setMetadata(ctx, WindowCoveringCCValues.levelChangeDown(param));
|
|
520
|
+
// And for the odd parameters (with position support), query the position
|
|
521
|
+
if (param % 2 === 1) {
|
|
522
|
+
ctx.logNode(node.id, {
|
|
523
|
+
endpoint: this.endpointIndex,
|
|
524
|
+
message: `querying position for parameter ${getEnumMemberName(WindowCoveringParameter, param)}...`,
|
|
525
|
+
direction: "outbound",
|
|
526
|
+
});
|
|
527
|
+
await api.get(param);
|
|
528
|
+
}
|
|
474
529
|
}
|
|
475
530
|
}
|
|
531
|
+
// Remember that the interview is complete
|
|
532
|
+
this.setInterviewComplete(ctx, true);
|
|
476
533
|
}
|
|
477
|
-
|
|
478
|
-
|
|
479
|
-
|
|
480
|
-
|
|
481
|
-
|
|
482
|
-
return getEnumMemberName(WindowCoveringParameter, propertyKey);
|
|
534
|
+
translatePropertyKey(ctx, property, propertyKey) {
|
|
535
|
+
if (typeof propertyKey === "number") {
|
|
536
|
+
return getEnumMemberName(WindowCoveringParameter, propertyKey);
|
|
537
|
+
}
|
|
538
|
+
return super.translatePropertyKey(ctx, property, propertyKey);
|
|
483
539
|
}
|
|
484
|
-
|
|
485
|
-
|
|
486
|
-
};
|
|
487
|
-
WindowCoveringCC = __decorate([
|
|
488
|
-
commandClass(CommandClasses["Window Covering"]),
|
|
489
|
-
implementedVersion(1),
|
|
490
|
-
ccValues(WindowCoveringCCValues)
|
|
491
|
-
], WindowCoveringCC);
|
|
540
|
+
};
|
|
541
|
+
return WindowCoveringCC = _classThis;
|
|
542
|
+
})();
|
|
492
543
|
export { WindowCoveringCC };
|
|
493
|
-
let WindowCoveringCCSupportedReport =
|
|
494
|
-
|
|
495
|
-
|
|
496
|
-
|
|
497
|
-
|
|
498
|
-
|
|
499
|
-
|
|
500
|
-
|
|
501
|
-
|
|
502
|
-
|
|
503
|
-
|
|
504
|
-
|
|
505
|
-
|
|
506
|
-
|
|
507
|
-
}
|
|
508
|
-
|
|
509
|
-
|
|
510
|
-
|
|
511
|
-
|
|
512
|
-
|
|
513
|
-
|
|
514
|
-
|
|
515
|
-
|
|
516
|
-
|
|
517
|
-
|
|
518
|
-
|
|
519
|
-
|
|
520
|
-
|
|
521
|
-
|
|
522
|
-
|
|
523
|
-
|
|
524
|
-
|
|
525
|
-
|
|
526
|
-
|
|
527
|
-
|
|
528
|
-
|
|
529
|
-
|
|
530
|
-
|
|
531
|
-
|
|
532
|
-
|
|
533
|
-
|
|
534
|
-
|
|
535
|
-
|
|
544
|
+
let WindowCoveringCCSupportedReport = (() => {
|
|
545
|
+
let _classDecorators = [CCCommand(WindowCoveringCommand.SupportedReport), ccValueProperty("supportedParameters", WindowCoveringCCValues.supportedParameters)];
|
|
546
|
+
let _classDescriptor;
|
|
547
|
+
let _classExtraInitializers = [];
|
|
548
|
+
let _classThis;
|
|
549
|
+
let _classSuper = WindowCoveringCC;
|
|
550
|
+
var WindowCoveringCCSupportedReport = class extends _classSuper {
|
|
551
|
+
static { _classThis = this; }
|
|
552
|
+
static {
|
|
553
|
+
const _metadata = typeof Symbol === "function" && Symbol.metadata ? Object.create(_classSuper[Symbol.metadata] ?? null) : void 0;
|
|
554
|
+
__esDecorate(null, _classDescriptor = { value: _classThis }, _classDecorators, { kind: "class", name: _classThis.name, metadata: _metadata }, null, _classExtraInitializers);
|
|
555
|
+
WindowCoveringCCSupportedReport = _classThis = _classDescriptor.value;
|
|
556
|
+
if (_metadata) Object.defineProperty(_classThis, Symbol.metadata, { enumerable: true, configurable: true, writable: true, value: _metadata });
|
|
557
|
+
__runInitializers(_classThis, _classExtraInitializers);
|
|
558
|
+
}
|
|
559
|
+
constructor(options) {
|
|
560
|
+
super(options);
|
|
561
|
+
this.supportedParameters = options.supportedParameters;
|
|
562
|
+
}
|
|
563
|
+
static from(raw, ctx) {
|
|
564
|
+
validatePayload(raw.payload.length >= 1);
|
|
565
|
+
const numBitmaskBytes = raw.payload[0] & 0b1111;
|
|
566
|
+
validatePayload(raw.payload.length >= 1 + numBitmaskBytes);
|
|
567
|
+
const bitmask = raw.payload.subarray(1, 1 + numBitmaskBytes);
|
|
568
|
+
const supportedParameters = parseBitMask(bitmask, WindowCoveringParameter["Outbound Left (no position)"]);
|
|
569
|
+
return new this({
|
|
570
|
+
nodeId: ctx.sourceNodeId,
|
|
571
|
+
supportedParameters,
|
|
572
|
+
});
|
|
573
|
+
}
|
|
574
|
+
supportedParameters;
|
|
575
|
+
serialize(ctx) {
|
|
576
|
+
const bitmask = encodeBitMask(this.supportedParameters, undefined, WindowCoveringParameter["Outbound Left (no position)"]).subarray(0, 15);
|
|
577
|
+
const numBitmaskBytes = bitmask.length & 0b1111;
|
|
578
|
+
this.payload = Bytes.concat([
|
|
579
|
+
Bytes.from([numBitmaskBytes]),
|
|
580
|
+
bitmask.subarray(0, numBitmaskBytes),
|
|
581
|
+
]);
|
|
582
|
+
return super.serialize(ctx);
|
|
583
|
+
}
|
|
584
|
+
toLogEntry(ctx) {
|
|
585
|
+
return {
|
|
586
|
+
...super.toLogEntry(ctx),
|
|
587
|
+
message: {
|
|
588
|
+
"supported parameters": this.supportedParameters
|
|
589
|
+
.map((p) => `\n· ${getEnumMemberName(WindowCoveringParameter, p)}`)
|
|
590
|
+
.join(""),
|
|
591
|
+
},
|
|
592
|
+
};
|
|
593
|
+
}
|
|
594
|
+
};
|
|
595
|
+
return WindowCoveringCCSupportedReport = _classThis;
|
|
596
|
+
})();
|
|
536
597
|
export { WindowCoveringCCSupportedReport };
|
|
537
|
-
let WindowCoveringCCSupportedGet =
|
|
538
|
-
|
|
539
|
-
|
|
540
|
-
|
|
541
|
-
|
|
542
|
-
|
|
598
|
+
let WindowCoveringCCSupportedGet = (() => {
|
|
599
|
+
let _classDecorators = [CCCommand(WindowCoveringCommand.SupportedGet), expectedCCResponse(WindowCoveringCCSupportedReport)];
|
|
600
|
+
let _classDescriptor;
|
|
601
|
+
let _classExtraInitializers = [];
|
|
602
|
+
let _classThis;
|
|
603
|
+
let _classSuper = WindowCoveringCC;
|
|
604
|
+
var WindowCoveringCCSupportedGet = class extends _classSuper {
|
|
605
|
+
static { _classThis = this; }
|
|
606
|
+
static {
|
|
607
|
+
const _metadata = typeof Symbol === "function" && Symbol.metadata ? Object.create(_classSuper[Symbol.metadata] ?? null) : void 0;
|
|
608
|
+
__esDecorate(null, _classDescriptor = { value: _classThis }, _classDecorators, { kind: "class", name: _classThis.name, metadata: _metadata }, null, _classExtraInitializers);
|
|
609
|
+
WindowCoveringCCSupportedGet = _classThis = _classDescriptor.value;
|
|
610
|
+
if (_metadata) Object.defineProperty(_classThis, Symbol.metadata, { enumerable: true, configurable: true, writable: true, value: _metadata });
|
|
611
|
+
__runInitializers(_classThis, _classExtraInitializers);
|
|
612
|
+
}
|
|
613
|
+
};
|
|
614
|
+
return WindowCoveringCCSupportedGet = _classThis;
|
|
615
|
+
})();
|
|
543
616
|
export { WindowCoveringCCSupportedGet };
|
|
544
|
-
let WindowCoveringCCReport =
|
|
545
|
-
|
|
546
|
-
|
|
547
|
-
|
|
548
|
-
|
|
549
|
-
|
|
550
|
-
|
|
551
|
-
|
|
552
|
-
|
|
553
|
-
|
|
554
|
-
|
|
555
|
-
|
|
556
|
-
|
|
557
|
-
|
|
558
|
-
|
|
559
|
-
|
|
560
|
-
|
|
561
|
-
|
|
562
|
-
parameter
|
|
563
|
-
currentValue
|
|
564
|
-
targetValue
|
|
565
|
-
duration
|
|
566
|
-
}
|
|
567
|
-
|
|
568
|
-
|
|
569
|
-
|
|
570
|
-
|
|
571
|
-
|
|
572
|
-
|
|
573
|
-
|
|
574
|
-
|
|
575
|
-
|
|
576
|
-
parameter
|
|
577
|
-
|
|
578
|
-
|
|
579
|
-
duration
|
|
580
|
-
}
|
|
581
|
-
}
|
|
582
|
-
|
|
583
|
-
|
|
584
|
-
|
|
585
|
-
|
|
586
|
-
|
|
587
|
-
|
|
588
|
-
|
|
589
|
-
|
|
590
|
-
|
|
591
|
-
|
|
592
|
-
|
|
593
|
-
|
|
594
|
-
|
|
595
|
-
|
|
617
|
+
let WindowCoveringCCReport = (() => {
|
|
618
|
+
let _classDecorators = [CCCommand(WindowCoveringCommand.Report), ccValueProperty("currentValue", WindowCoveringCCValues.currentValue, (self) => [self.parameter]), ccValueProperty("targetValue", WindowCoveringCCValues.targetValue, (self) => [self.parameter]), ccValueProperty("duration", WindowCoveringCCValues.duration, (self) => [self.parameter])];
|
|
619
|
+
let _classDescriptor;
|
|
620
|
+
let _classExtraInitializers = [];
|
|
621
|
+
let _classThis;
|
|
622
|
+
let _classSuper = WindowCoveringCC;
|
|
623
|
+
var WindowCoveringCCReport = class extends _classSuper {
|
|
624
|
+
static { _classThis = this; }
|
|
625
|
+
static {
|
|
626
|
+
const _metadata = typeof Symbol === "function" && Symbol.metadata ? Object.create(_classSuper[Symbol.metadata] ?? null) : void 0;
|
|
627
|
+
__esDecorate(null, _classDescriptor = { value: _classThis }, _classDecorators, { kind: "class", name: _classThis.name, metadata: _metadata }, null, _classExtraInitializers);
|
|
628
|
+
WindowCoveringCCReport = _classThis = _classDescriptor.value;
|
|
629
|
+
if (_metadata) Object.defineProperty(_classThis, Symbol.metadata, { enumerable: true, configurable: true, writable: true, value: _metadata });
|
|
630
|
+
__runInitializers(_classThis, _classExtraInitializers);
|
|
631
|
+
}
|
|
632
|
+
constructor(options) {
|
|
633
|
+
super(options);
|
|
634
|
+
// TODO: Check implementation:
|
|
635
|
+
this.parameter = options.parameter;
|
|
636
|
+
this.currentValue = options.currentValue;
|
|
637
|
+
this.targetValue = options.targetValue;
|
|
638
|
+
this.duration = options.duration;
|
|
639
|
+
}
|
|
640
|
+
static from(raw, ctx) {
|
|
641
|
+
validatePayload(raw.payload.length >= 4);
|
|
642
|
+
const parameter = raw.payload[0];
|
|
643
|
+
const currentValue = raw.payload[1];
|
|
644
|
+
const targetValue = raw.payload[2];
|
|
645
|
+
const duration = Duration.parseReport(raw.payload[3])
|
|
646
|
+
?? Duration.unknown();
|
|
647
|
+
return new this({
|
|
648
|
+
nodeId: ctx.sourceNodeId,
|
|
649
|
+
parameter,
|
|
650
|
+
currentValue,
|
|
651
|
+
targetValue,
|
|
652
|
+
duration,
|
|
653
|
+
});
|
|
654
|
+
}
|
|
655
|
+
parameter;
|
|
656
|
+
currentValue;
|
|
657
|
+
targetValue;
|
|
658
|
+
duration;
|
|
659
|
+
toLogEntry(ctx) {
|
|
660
|
+
return {
|
|
661
|
+
...super.toLogEntry(ctx),
|
|
662
|
+
message: {
|
|
663
|
+
parameter: getEnumMemberName(WindowCoveringParameter, this.parameter),
|
|
664
|
+
"current value": this.currentValue,
|
|
665
|
+
"target value": this.targetValue,
|
|
666
|
+
duration: this.duration.toString(),
|
|
667
|
+
},
|
|
668
|
+
};
|
|
669
|
+
}
|
|
670
|
+
};
|
|
671
|
+
return WindowCoveringCCReport = _classThis;
|
|
672
|
+
})();
|
|
596
673
|
export { WindowCoveringCCReport };
|
|
597
674
|
function testResponseForWindowCoveringGet(sent, received) {
|
|
598
675
|
return received.parameter === sent.parameter;
|
|
599
676
|
}
|
|
600
|
-
let WindowCoveringCCGet =
|
|
601
|
-
|
|
602
|
-
|
|
603
|
-
|
|
604
|
-
|
|
605
|
-
|
|
606
|
-
|
|
607
|
-
|
|
608
|
-
|
|
609
|
-
|
|
610
|
-
|
|
611
|
-
|
|
612
|
-
|
|
613
|
-
|
|
614
|
-
|
|
615
|
-
|
|
616
|
-
|
|
617
|
-
|
|
618
|
-
|
|
619
|
-
|
|
620
|
-
|
|
621
|
-
|
|
622
|
-
|
|
623
|
-
|
|
624
|
-
|
|
625
|
-
|
|
626
|
-
}
|
|
627
|
-
|
|
628
|
-
|
|
629
|
-
|
|
630
|
-
|
|
677
|
+
let WindowCoveringCCGet = (() => {
|
|
678
|
+
let _classDecorators = [CCCommand(WindowCoveringCommand.Get), expectedCCResponse(WindowCoveringCCReport, testResponseForWindowCoveringGet)];
|
|
679
|
+
let _classDescriptor;
|
|
680
|
+
let _classExtraInitializers = [];
|
|
681
|
+
let _classThis;
|
|
682
|
+
let _classSuper = WindowCoveringCC;
|
|
683
|
+
var WindowCoveringCCGet = class extends _classSuper {
|
|
684
|
+
static { _classThis = this; }
|
|
685
|
+
static {
|
|
686
|
+
const _metadata = typeof Symbol === "function" && Symbol.metadata ? Object.create(_classSuper[Symbol.metadata] ?? null) : void 0;
|
|
687
|
+
__esDecorate(null, _classDescriptor = { value: _classThis }, _classDecorators, { kind: "class", name: _classThis.name, metadata: _metadata }, null, _classExtraInitializers);
|
|
688
|
+
WindowCoveringCCGet = _classThis = _classDescriptor.value;
|
|
689
|
+
if (_metadata) Object.defineProperty(_classThis, Symbol.metadata, { enumerable: true, configurable: true, writable: true, value: _metadata });
|
|
690
|
+
__runInitializers(_classThis, _classExtraInitializers);
|
|
691
|
+
}
|
|
692
|
+
constructor(options) {
|
|
693
|
+
super(options);
|
|
694
|
+
this.parameter = options.parameter;
|
|
695
|
+
}
|
|
696
|
+
static from(raw, ctx) {
|
|
697
|
+
validatePayload(raw.payload.length >= 1);
|
|
698
|
+
const parameter = raw.payload[0];
|
|
699
|
+
return new this({
|
|
700
|
+
nodeId: ctx.sourceNodeId,
|
|
701
|
+
parameter,
|
|
702
|
+
});
|
|
703
|
+
}
|
|
704
|
+
parameter;
|
|
705
|
+
serialize(ctx) {
|
|
706
|
+
this.payload = Bytes.from([this.parameter]);
|
|
707
|
+
return super.serialize(ctx);
|
|
708
|
+
}
|
|
709
|
+
toLogEntry(ctx) {
|
|
710
|
+
return {
|
|
711
|
+
...super.toLogEntry(ctx),
|
|
712
|
+
message: {
|
|
713
|
+
parameter: getEnumMemberName(WindowCoveringParameter, this.parameter),
|
|
714
|
+
},
|
|
715
|
+
};
|
|
716
|
+
}
|
|
717
|
+
};
|
|
718
|
+
return WindowCoveringCCGet = _classThis;
|
|
719
|
+
})();
|
|
631
720
|
export { WindowCoveringCCGet };
|
|
632
|
-
let WindowCoveringCCSet =
|
|
633
|
-
|
|
634
|
-
|
|
635
|
-
|
|
636
|
-
|
|
637
|
-
|
|
638
|
-
|
|
639
|
-
|
|
640
|
-
|
|
641
|
-
|
|
642
|
-
|
|
643
|
-
|
|
644
|
-
|
|
645
|
-
|
|
646
|
-
|
|
647
|
-
|
|
721
|
+
let WindowCoveringCCSet = (() => {
|
|
722
|
+
let _classDecorators = [CCCommand(WindowCoveringCommand.Set), useSupervision()];
|
|
723
|
+
let _classDescriptor;
|
|
724
|
+
let _classExtraInitializers = [];
|
|
725
|
+
let _classThis;
|
|
726
|
+
let _classSuper = WindowCoveringCC;
|
|
727
|
+
var WindowCoveringCCSet = class extends _classSuper {
|
|
728
|
+
static { _classThis = this; }
|
|
729
|
+
static {
|
|
730
|
+
const _metadata = typeof Symbol === "function" && Symbol.metadata ? Object.create(_classSuper[Symbol.metadata] ?? null) : void 0;
|
|
731
|
+
__esDecorate(null, _classDescriptor = { value: _classThis }, _classDecorators, { kind: "class", name: _classThis.name, metadata: _metadata }, null, _classExtraInitializers);
|
|
732
|
+
WindowCoveringCCSet = _classThis = _classDescriptor.value;
|
|
733
|
+
if (_metadata) Object.defineProperty(_classThis, Symbol.metadata, { enumerable: true, configurable: true, writable: true, value: _metadata });
|
|
734
|
+
__runInitializers(_classThis, _classExtraInitializers);
|
|
735
|
+
}
|
|
736
|
+
constructor(options) {
|
|
737
|
+
super(options);
|
|
738
|
+
this.targetValues = options.targetValues;
|
|
739
|
+
this.duration = Duration.from(options.duration);
|
|
740
|
+
}
|
|
741
|
+
static from(raw, ctx) {
|
|
742
|
+
validatePayload(raw.payload.length >= 1);
|
|
743
|
+
const numEntries = raw.payload[0] & 0b11111;
|
|
744
|
+
validatePayload(raw.payload.length >= 1 + numEntries * 2);
|
|
745
|
+
const targetValues = [];
|
|
746
|
+
for (let i = 0; i < numEntries; i++) {
|
|
747
|
+
const offset = 1 + i * 2;
|
|
748
|
+
targetValues.push({
|
|
749
|
+
parameter: raw.payload[offset],
|
|
750
|
+
value: raw.payload[offset + 1],
|
|
751
|
+
});
|
|
752
|
+
}
|
|
753
|
+
let duration;
|
|
754
|
+
if (raw.payload.length >= 2 + numEntries * 2) {
|
|
755
|
+
duration = Duration.parseSet(raw.payload[1 + numEntries * 2]);
|
|
756
|
+
}
|
|
757
|
+
return new this({
|
|
758
|
+
nodeId: ctx.sourceNodeId,
|
|
759
|
+
targetValues,
|
|
760
|
+
duration,
|
|
648
761
|
});
|
|
649
762
|
}
|
|
650
|
-
|
|
651
|
-
|
|
652
|
-
|
|
763
|
+
targetValues;
|
|
764
|
+
duration;
|
|
765
|
+
serialize(ctx) {
|
|
766
|
+
const numEntries = this.targetValues.length & 0b11111;
|
|
767
|
+
this.payload = new Bytes(2 + numEntries * 2);
|
|
768
|
+
this.payload[0] = numEntries;
|
|
769
|
+
for (let i = 0; i < numEntries; i++) {
|
|
770
|
+
const offset = 1 + i * 2;
|
|
771
|
+
this.payload[offset] = this.targetValues[i].parameter;
|
|
772
|
+
this.payload[offset + 1] = this.targetValues[i].value;
|
|
773
|
+
}
|
|
774
|
+
this.payload[this.payload.length - 1] = (this.duration ?? Duration.default()).serializeSet();
|
|
775
|
+
return super.serialize(ctx);
|
|
653
776
|
}
|
|
654
|
-
|
|
655
|
-
|
|
656
|
-
targetValues
|
|
657
|
-
|
|
658
|
-
|
|
659
|
-
|
|
660
|
-
|
|
661
|
-
|
|
662
|
-
|
|
663
|
-
|
|
664
|
-
|
|
665
|
-
|
|
666
|
-
|
|
667
|
-
|
|
668
|
-
|
|
669
|
-
|
|
670
|
-
|
|
671
|
-
this.payload[this.payload.length - 1] = (this.duration ?? Duration.default()).serializeSet();
|
|
672
|
-
return super.serialize(ctx);
|
|
673
|
-
}
|
|
674
|
-
toLogEntry(ctx) {
|
|
675
|
-
const message = {};
|
|
676
|
-
for (const { parameter, value } of this.targetValues) {
|
|
677
|
-
message[getEnumMemberName(WindowCoveringParameter, parameter)] =
|
|
678
|
-
value;
|
|
679
|
-
}
|
|
680
|
-
if (this.duration) {
|
|
681
|
-
message.duration = this.duration.toString();
|
|
682
|
-
}
|
|
683
|
-
return {
|
|
684
|
-
...super.toLogEntry(ctx),
|
|
685
|
-
message,
|
|
686
|
-
};
|
|
687
|
-
}
|
|
688
|
-
};
|
|
689
|
-
WindowCoveringCCSet = WindowCoveringCCSet_1 = __decorate([
|
|
690
|
-
CCCommand(WindowCoveringCommand.Set),
|
|
691
|
-
useSupervision()
|
|
692
|
-
], WindowCoveringCCSet);
|
|
777
|
+
toLogEntry(ctx) {
|
|
778
|
+
const message = {};
|
|
779
|
+
for (const { parameter, value } of this.targetValues) {
|
|
780
|
+
message[getEnumMemberName(WindowCoveringParameter, parameter)] =
|
|
781
|
+
value;
|
|
782
|
+
}
|
|
783
|
+
if (this.duration) {
|
|
784
|
+
message.duration = this.duration.toString();
|
|
785
|
+
}
|
|
786
|
+
return {
|
|
787
|
+
...super.toLogEntry(ctx),
|
|
788
|
+
message,
|
|
789
|
+
};
|
|
790
|
+
}
|
|
791
|
+
};
|
|
792
|
+
return WindowCoveringCCSet = _classThis;
|
|
793
|
+
})();
|
|
693
794
|
export { WindowCoveringCCSet };
|
|
694
|
-
let WindowCoveringCCStartLevelChange =
|
|
695
|
-
|
|
696
|
-
|
|
697
|
-
|
|
698
|
-
|
|
699
|
-
|
|
700
|
-
|
|
701
|
-
|
|
702
|
-
|
|
703
|
-
|
|
704
|
-
|
|
705
|
-
|
|
706
|
-
|
|
707
|
-
|
|
708
|
-
if (raw.payload.length >= 3) {
|
|
709
|
-
duration = Duration.parseSet(raw.payload[2]);
|
|
710
|
-
}
|
|
711
|
-
return new WindowCoveringCCStartLevelChange_1({
|
|
712
|
-
nodeId: ctx.sourceNodeId,
|
|
713
|
-
direction,
|
|
714
|
-
parameter,
|
|
715
|
-
duration,
|
|
716
|
-
});
|
|
717
|
-
}
|
|
718
|
-
parameter;
|
|
719
|
-
direction;
|
|
720
|
-
duration;
|
|
721
|
-
serialize(ctx) {
|
|
722
|
-
this.payload = Bytes.from([
|
|
723
|
-
this.direction === "down" ? 0b0100_0000 : 0b0000_0000,
|
|
724
|
-
this.parameter,
|
|
725
|
-
(this.duration ?? Duration.default()).serializeSet(),
|
|
726
|
-
]);
|
|
727
|
-
return super.serialize(ctx);
|
|
728
|
-
}
|
|
729
|
-
toLogEntry(ctx) {
|
|
730
|
-
const message = {
|
|
731
|
-
parameter: getEnumMemberName(WindowCoveringParameter, this.parameter),
|
|
732
|
-
direction: this.direction,
|
|
733
|
-
};
|
|
734
|
-
if (this.duration) {
|
|
735
|
-
message.duration = this.duration.toString();
|
|
795
|
+
let WindowCoveringCCStartLevelChange = (() => {
|
|
796
|
+
let _classDecorators = [CCCommand(WindowCoveringCommand.StartLevelChange), useSupervision()];
|
|
797
|
+
let _classDescriptor;
|
|
798
|
+
let _classExtraInitializers = [];
|
|
799
|
+
let _classThis;
|
|
800
|
+
let _classSuper = WindowCoveringCC;
|
|
801
|
+
var WindowCoveringCCStartLevelChange = class extends _classSuper {
|
|
802
|
+
static { _classThis = this; }
|
|
803
|
+
static {
|
|
804
|
+
const _metadata = typeof Symbol === "function" && Symbol.metadata ? Object.create(_classSuper[Symbol.metadata] ?? null) : void 0;
|
|
805
|
+
__esDecorate(null, _classDescriptor = { value: _classThis }, _classDecorators, { kind: "class", name: _classThis.name, metadata: _metadata }, null, _classExtraInitializers);
|
|
806
|
+
WindowCoveringCCStartLevelChange = _classThis = _classDescriptor.value;
|
|
807
|
+
if (_metadata) Object.defineProperty(_classThis, Symbol.metadata, { enumerable: true, configurable: true, writable: true, value: _metadata });
|
|
808
|
+
__runInitializers(_classThis, _classExtraInitializers);
|
|
736
809
|
}
|
|
737
|
-
|
|
738
|
-
|
|
739
|
-
|
|
740
|
-
|
|
741
|
-
|
|
742
|
-
}
|
|
743
|
-
|
|
744
|
-
|
|
745
|
-
|
|
746
|
-
|
|
747
|
-
|
|
748
|
-
|
|
749
|
-
|
|
750
|
-
|
|
751
|
-
|
|
752
|
-
|
|
753
|
-
|
|
754
|
-
|
|
755
|
-
|
|
756
|
-
|
|
757
|
-
|
|
758
|
-
|
|
759
|
-
}
|
|
760
|
-
|
|
761
|
-
|
|
762
|
-
|
|
763
|
-
|
|
764
|
-
|
|
765
|
-
|
|
766
|
-
|
|
767
|
-
|
|
768
|
-
|
|
769
|
-
|
|
810
|
+
constructor(options) {
|
|
811
|
+
super(options);
|
|
812
|
+
this.parameter = options.parameter;
|
|
813
|
+
this.direction = options.direction;
|
|
814
|
+
this.duration = Duration.from(options.duration);
|
|
815
|
+
}
|
|
816
|
+
static from(raw, ctx) {
|
|
817
|
+
validatePayload(raw.payload.length >= 2);
|
|
818
|
+
const direction = !!(raw.payload[0] & 0b0100_0000)
|
|
819
|
+
? "down"
|
|
820
|
+
: "up";
|
|
821
|
+
const parameter = raw.payload[1];
|
|
822
|
+
let duration;
|
|
823
|
+
if (raw.payload.length >= 3) {
|
|
824
|
+
duration = Duration.parseSet(raw.payload[2]);
|
|
825
|
+
}
|
|
826
|
+
return new this({
|
|
827
|
+
nodeId: ctx.sourceNodeId,
|
|
828
|
+
direction,
|
|
829
|
+
parameter,
|
|
830
|
+
duration,
|
|
831
|
+
});
|
|
832
|
+
}
|
|
833
|
+
parameter;
|
|
834
|
+
direction;
|
|
835
|
+
duration;
|
|
836
|
+
serialize(ctx) {
|
|
837
|
+
this.payload = Bytes.from([
|
|
838
|
+
this.direction === "down" ? 0b0100_0000 : 0b0000_0000,
|
|
839
|
+
this.parameter,
|
|
840
|
+
(this.duration ?? Duration.default()).serializeSet(),
|
|
841
|
+
]);
|
|
842
|
+
return super.serialize(ctx);
|
|
843
|
+
}
|
|
844
|
+
toLogEntry(ctx) {
|
|
845
|
+
const message = {
|
|
770
846
|
parameter: getEnumMemberName(WindowCoveringParameter, this.parameter),
|
|
771
|
-
|
|
772
|
-
|
|
773
|
-
|
|
774
|
-
|
|
775
|
-
|
|
776
|
-
|
|
777
|
-
|
|
778
|
-
|
|
847
|
+
direction: this.direction,
|
|
848
|
+
};
|
|
849
|
+
if (this.duration) {
|
|
850
|
+
message.duration = this.duration.toString();
|
|
851
|
+
}
|
|
852
|
+
return {
|
|
853
|
+
...super.toLogEntry(ctx),
|
|
854
|
+
message,
|
|
855
|
+
};
|
|
856
|
+
}
|
|
857
|
+
};
|
|
858
|
+
return WindowCoveringCCStartLevelChange = _classThis;
|
|
859
|
+
})();
|
|
860
|
+
export { WindowCoveringCCStartLevelChange };
|
|
861
|
+
let WindowCoveringCCStopLevelChange = (() => {
|
|
862
|
+
let _classDecorators = [CCCommand(WindowCoveringCommand.StopLevelChange), useSupervision()];
|
|
863
|
+
let _classDescriptor;
|
|
864
|
+
let _classExtraInitializers = [];
|
|
865
|
+
let _classThis;
|
|
866
|
+
let _classSuper = WindowCoveringCC;
|
|
867
|
+
var WindowCoveringCCStopLevelChange = class extends _classSuper {
|
|
868
|
+
static { _classThis = this; }
|
|
869
|
+
static {
|
|
870
|
+
const _metadata = typeof Symbol === "function" && Symbol.metadata ? Object.create(_classSuper[Symbol.metadata] ?? null) : void 0;
|
|
871
|
+
__esDecorate(null, _classDescriptor = { value: _classThis }, _classDecorators, { kind: "class", name: _classThis.name, metadata: _metadata }, null, _classExtraInitializers);
|
|
872
|
+
WindowCoveringCCStopLevelChange = _classThis = _classDescriptor.value;
|
|
873
|
+
if (_metadata) Object.defineProperty(_classThis, Symbol.metadata, { enumerable: true, configurable: true, writable: true, value: _metadata });
|
|
874
|
+
__runInitializers(_classThis, _classExtraInitializers);
|
|
875
|
+
}
|
|
876
|
+
constructor(options) {
|
|
877
|
+
super(options);
|
|
878
|
+
this.parameter = options.parameter;
|
|
879
|
+
}
|
|
880
|
+
static from(raw, ctx) {
|
|
881
|
+
validatePayload(raw.payload.length >= 1);
|
|
882
|
+
const parameter = raw.payload[0];
|
|
883
|
+
return new this({
|
|
884
|
+
nodeId: ctx.sourceNodeId,
|
|
885
|
+
parameter,
|
|
886
|
+
});
|
|
887
|
+
}
|
|
888
|
+
parameter;
|
|
889
|
+
serialize(ctx) {
|
|
890
|
+
this.payload = Bytes.from([this.parameter]);
|
|
891
|
+
return super.serialize(ctx);
|
|
892
|
+
}
|
|
893
|
+
toLogEntry(ctx) {
|
|
894
|
+
return {
|
|
895
|
+
...super.toLogEntry(ctx),
|
|
896
|
+
message: {
|
|
897
|
+
parameter: getEnumMemberName(WindowCoveringParameter, this.parameter),
|
|
898
|
+
},
|
|
899
|
+
};
|
|
900
|
+
}
|
|
901
|
+
};
|
|
902
|
+
return WindowCoveringCCStopLevelChange = _classThis;
|
|
903
|
+
})();
|
|
779
904
|
export { WindowCoveringCCStopLevelChange };
|
|
780
905
|
//# sourceMappingURL=WindowCoveringCC.js.map
|