@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 MultilevelSwitchCCSet_1, MultilevelSwitchCCReport_1, MultilevelSwitchCCStartLevelChange_1, MultilevelSwitchCCSupportedReport_1;
|
|
8
35
|
function __assertType(argName, typeName, boundHasError) {
|
|
9
36
|
const { ZWaveError, ZWaveErrorCodes } = require("@zwave-js/core");
|
|
10
37
|
if (boundHasError()) {
|
|
@@ -175,7 +202,7 @@ import { Bytes } from "@zwave-js/shared/safe";
|
|
|
175
202
|
import { getEnumMemberName, pick } from "@zwave-js/shared/safe";
|
|
176
203
|
import { CCAPI, POLL_VALUE, SET_VALUE, SET_VALUE_HOOKS, throwUnsupportedProperty, throwWrongValueType, } from "../lib/API.js";
|
|
177
204
|
import { CommandClass, getEffectiveCCVersion, } from "../lib/CommandClass.js";
|
|
178
|
-
import { API, CCCommand,
|
|
205
|
+
import { API, CCCommand, ccValueProperty, ccValues, commandClass, expectedCCResponse, implementedVersion, useSupervision, } from "../lib/CommandClassDecorators.js";
|
|
179
206
|
import { V } from "../lib/Values.js";
|
|
180
207
|
import { LevelChangeDirection, MultilevelSwitchCommand, SwitchType, } from "../lib/_Types.js";
|
|
181
208
|
/**
|
|
@@ -277,534 +304,632 @@ export const MultilevelSwitchCCValues = Object.freeze({
|
|
|
277
304
|
}),
|
|
278
305
|
}),
|
|
279
306
|
});
|
|
280
|
-
let MultilevelSwitchCCAPI =
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
// eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types
|
|
295
|
-
async get() {
|
|
296
|
-
this.assertSupportsCommand(MultilevelSwitchCommand, MultilevelSwitchCommand.Get);
|
|
297
|
-
const cc = new MultilevelSwitchCCGet({
|
|
298
|
-
nodeId: this.endpoint.nodeId,
|
|
299
|
-
endpointIndex: this.endpoint.index,
|
|
300
|
-
});
|
|
301
|
-
const response = await this.host.sendCommand(cc, this.commandOptions);
|
|
302
|
-
if (response) {
|
|
303
|
-
return pick(response, ["currentValue", "targetValue", "duration"]);
|
|
307
|
+
let MultilevelSwitchCCAPI = (() => {
|
|
308
|
+
let _classDecorators = [API(CommandClasses["Multilevel Switch"])];
|
|
309
|
+
let _classDescriptor;
|
|
310
|
+
let _classExtraInitializers = [];
|
|
311
|
+
let _classThis;
|
|
312
|
+
let _classSuper = CCAPI;
|
|
313
|
+
var MultilevelSwitchCCAPI = class extends _classSuper {
|
|
314
|
+
static { _classThis = this; }
|
|
315
|
+
static {
|
|
316
|
+
const _metadata = typeof Symbol === "function" && Symbol.metadata ? Object.create(_classSuper[Symbol.metadata] ?? null) : void 0;
|
|
317
|
+
__esDecorate(null, _classDescriptor = { value: _classThis }, _classDecorators, { kind: "class", name: _classThis.name, metadata: _metadata }, null, _classExtraInitializers);
|
|
318
|
+
MultilevelSwitchCCAPI = _classThis = _classDescriptor.value;
|
|
319
|
+
if (_metadata) Object.defineProperty(_classThis, Symbol.metadata, { enumerable: true, configurable: true, writable: true, value: _metadata });
|
|
320
|
+
__runInitializers(_classThis, _classExtraInitializers);
|
|
304
321
|
}
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
this.assertSupportsCommand(MultilevelSwitchCommand, MultilevelSwitchCommand.Set);
|
|
316
|
-
const cc = new MultilevelSwitchCCSet({
|
|
317
|
-
nodeId: this.endpoint.nodeId,
|
|
318
|
-
endpointIndex: this.endpoint.index,
|
|
319
|
-
targetValue,
|
|
320
|
-
duration,
|
|
321
|
-
});
|
|
322
|
-
return this.host.sendCommand(cc, this.commandOptions);
|
|
323
|
-
}
|
|
324
|
-
async startLevelChange(options) {
|
|
325
|
-
__assertType("options", "MultilevelSwitchCCStartLevelChangeOptions", __assertType__MultilevelSwitchCCStartLevelChangeOptions.bind(void 0, options));
|
|
326
|
-
this.assertSupportsCommand(MultilevelSwitchCommand, MultilevelSwitchCommand.StartLevelChange);
|
|
327
|
-
const cc = new MultilevelSwitchCCStartLevelChange({
|
|
328
|
-
nodeId: this.endpoint.nodeId,
|
|
329
|
-
endpointIndex: this.endpoint.index,
|
|
330
|
-
...options,
|
|
331
|
-
});
|
|
332
|
-
return this.host.sendCommand(cc, this.commandOptions);
|
|
333
|
-
}
|
|
334
|
-
async stopLevelChange() {
|
|
335
|
-
this.assertSupportsCommand(MultilevelSwitchCommand, MultilevelSwitchCommand.StopLevelChange);
|
|
336
|
-
const cc = new MultilevelSwitchCCStopLevelChange({
|
|
337
|
-
nodeId: this.endpoint.nodeId,
|
|
338
|
-
endpointIndex: this.endpoint.index,
|
|
339
|
-
});
|
|
340
|
-
return this.host.sendCommand(cc, this.commandOptions);
|
|
341
|
-
}
|
|
342
|
-
async getSupported() {
|
|
343
|
-
this.assertSupportsCommand(MultilevelSwitchCommand, MultilevelSwitchCommand.SupportedGet);
|
|
344
|
-
const cc = new MultilevelSwitchCCSupportedGet({
|
|
345
|
-
nodeId: this.endpoint.nodeId,
|
|
346
|
-
endpointIndex: this.endpoint.index,
|
|
347
|
-
});
|
|
348
|
-
const response = await this.host.sendCommand(cc, this.commandOptions);
|
|
349
|
-
return response?.switchType;
|
|
350
|
-
}
|
|
351
|
-
get [SET_VALUE]() {
|
|
352
|
-
return async function ({ property }, value, options) {
|
|
353
|
-
// Enable restoring the previous non-zero value
|
|
354
|
-
if (property === "restorePrevious") {
|
|
355
|
-
property = "targetValue";
|
|
356
|
-
value = 255;
|
|
322
|
+
supportsCommand(cmd) {
|
|
323
|
+
switch (cmd) {
|
|
324
|
+
case MultilevelSwitchCommand.Get:
|
|
325
|
+
return this.isSinglecast();
|
|
326
|
+
case MultilevelSwitchCommand.Set:
|
|
327
|
+
case MultilevelSwitchCommand.StartLevelChange:
|
|
328
|
+
case MultilevelSwitchCommand.StopLevelChange:
|
|
329
|
+
return true; // This is mandatory
|
|
330
|
+
case MultilevelSwitchCommand.SupportedGet:
|
|
331
|
+
return this.version >= 3 && this.isSinglecast();
|
|
357
332
|
}
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
|
|
333
|
+
return super.supportsCommand(cmd);
|
|
334
|
+
}
|
|
335
|
+
// eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types
|
|
336
|
+
async get() {
|
|
337
|
+
this.assertSupportsCommand(MultilevelSwitchCommand, MultilevelSwitchCommand.Get);
|
|
338
|
+
const cc = new MultilevelSwitchCCGet({
|
|
339
|
+
nodeId: this.endpoint.nodeId,
|
|
340
|
+
endpointIndex: this.endpoint.index,
|
|
341
|
+
});
|
|
342
|
+
const response = await this.host.sendCommand(cc, this.commandOptions);
|
|
343
|
+
if (response) {
|
|
344
|
+
return pick(response, ["currentValue", "targetValue", "duration"]);
|
|
364
345
|
}
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
|
|
346
|
+
}
|
|
347
|
+
/**
|
|
348
|
+
* Sets the switch to a new value
|
|
349
|
+
* @param targetValue The new target value for the switch
|
|
350
|
+
* @param duration The duration after which the target value should be reached. Can be a Duration instance or a user-friendly duration string like `"1m17s"`. Only supported in V2 and above.
|
|
351
|
+
* @returns A promise indicating whether the command was completed
|
|
352
|
+
*/
|
|
353
|
+
async set(targetValue, duration) {
|
|
354
|
+
__assertType("targetValue", "number", __assertType__number.bind(void 0, targetValue));
|
|
355
|
+
__assertType("duration", undefined, __assertType__optional_su__string__2_eu.bind(void 0, duration));
|
|
356
|
+
this.assertSupportsCommand(MultilevelSwitchCommand, MultilevelSwitchCommand.Set);
|
|
357
|
+
const cc = new MultilevelSwitchCCSet({
|
|
358
|
+
nodeId: this.endpoint.nodeId,
|
|
359
|
+
endpointIndex: this.endpoint.index,
|
|
360
|
+
targetValue,
|
|
361
|
+
duration,
|
|
362
|
+
});
|
|
363
|
+
return this.host.sendCommand(cc, this.commandOptions);
|
|
364
|
+
}
|
|
365
|
+
async startLevelChange(options) {
|
|
366
|
+
__assertType("options", "MultilevelSwitchCCStartLevelChangeOptions", __assertType__MultilevelSwitchCCStartLevelChangeOptions.bind(void 0, options));
|
|
367
|
+
this.assertSupportsCommand(MultilevelSwitchCommand, MultilevelSwitchCommand.StartLevelChange);
|
|
368
|
+
const cc = new MultilevelSwitchCCStartLevelChange({
|
|
369
|
+
nodeId: this.endpoint.nodeId,
|
|
370
|
+
endpointIndex: this.endpoint.index,
|
|
371
|
+
...options,
|
|
372
|
+
});
|
|
373
|
+
return this.host.sendCommand(cc, this.commandOptions);
|
|
374
|
+
}
|
|
375
|
+
async stopLevelChange() {
|
|
376
|
+
this.assertSupportsCommand(MultilevelSwitchCommand, MultilevelSwitchCommand.StopLevelChange);
|
|
377
|
+
const cc = new MultilevelSwitchCCStopLevelChange({
|
|
378
|
+
nodeId: this.endpoint.nodeId,
|
|
379
|
+
endpointIndex: this.endpoint.index,
|
|
380
|
+
});
|
|
381
|
+
return this.host.sendCommand(cc, this.commandOptions);
|
|
382
|
+
}
|
|
383
|
+
async getSupported() {
|
|
384
|
+
this.assertSupportsCommand(MultilevelSwitchCommand, MultilevelSwitchCommand.SupportedGet);
|
|
385
|
+
const cc = new MultilevelSwitchCCSupportedGet({
|
|
386
|
+
nodeId: this.endpoint.nodeId,
|
|
387
|
+
endpointIndex: this.endpoint.index,
|
|
388
|
+
});
|
|
389
|
+
const response = await this.host.sendCommand(cc, this.commandOptions);
|
|
390
|
+
return response?.switchType;
|
|
391
|
+
}
|
|
392
|
+
get [SET_VALUE]() {
|
|
393
|
+
return async function ({ property }, value, options) {
|
|
394
|
+
// Enable restoring the previous non-zero value
|
|
395
|
+
if (property === "restorePrevious") {
|
|
396
|
+
property = "targetValue";
|
|
397
|
+
value = 255;
|
|
371
398
|
}
|
|
372
|
-
if (
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
=== 0
|
|
377
|
-
? "down"
|
|
378
|
-
: "up";
|
|
379
|
-
// Singlecast only: Try to retrieve the current value to use as the start level,
|
|
380
|
-
// even if the target node is going to ignore it. There might
|
|
381
|
-
// be some bugged devices that ignore the ignore start level flag.
|
|
382
|
-
const startLevel = this.tryGetValueDB()?.getValue(MultilevelSwitchCCValues.currentValue.endpoint(this.endpoint.index));
|
|
383
|
-
// And perform the level change
|
|
399
|
+
if (property === "targetValue") {
|
|
400
|
+
if (typeof value !== "number") {
|
|
401
|
+
throwWrongValueType(this.ccId, property, "number", typeof value);
|
|
402
|
+
}
|
|
384
403
|
const duration = Duration.from(options?.transitionDuration);
|
|
385
|
-
return this.
|
|
386
|
-
|
|
387
|
-
|
|
388
|
-
|
|
389
|
-
|
|
390
|
-
|
|
391
|
-
|
|
392
|
-
|
|
404
|
+
return this.set(value, duration);
|
|
405
|
+
}
|
|
406
|
+
else if (switchTypeProperties.includes(property)) {
|
|
407
|
+
// Since the switch only supports one of the switch types, we would
|
|
408
|
+
// need to check if the correct one is used. But since the names are
|
|
409
|
+
// purely cosmetic, we just accept all of them
|
|
410
|
+
if (typeof value !== "boolean") {
|
|
411
|
+
throwWrongValueType(this.ccId, property, "number", typeof value);
|
|
412
|
+
}
|
|
413
|
+
if (value) {
|
|
414
|
+
// The property names are organized so that positive motions are
|
|
415
|
+
// at odd indices and negative motions at even indices
|
|
416
|
+
const direction = switchTypeProperties.indexOf(property) % 2
|
|
417
|
+
=== 0
|
|
418
|
+
? "down"
|
|
419
|
+
: "up";
|
|
420
|
+
// Singlecast only: Try to retrieve the current value to use as the start level,
|
|
421
|
+
// even if the target node is going to ignore it. There might
|
|
422
|
+
// be some bugged devices that ignore the ignore start level flag.
|
|
423
|
+
const startLevel = this.tryGetValueDB()?.getValue(MultilevelSwitchCCValues.currentValue.endpoint(this.endpoint.index));
|
|
424
|
+
// And perform the level change
|
|
425
|
+
const duration = Duration.from(options?.transitionDuration);
|
|
426
|
+
return this.startLevelChange({
|
|
427
|
+
direction,
|
|
428
|
+
ignoreStartLevel: true,
|
|
429
|
+
startLevel: typeof startLevel === "number"
|
|
430
|
+
? startLevel
|
|
431
|
+
: undefined,
|
|
432
|
+
duration,
|
|
433
|
+
});
|
|
434
|
+
}
|
|
435
|
+
else {
|
|
436
|
+
return this.stopLevelChange();
|
|
437
|
+
}
|
|
393
438
|
}
|
|
394
439
|
else {
|
|
395
|
-
|
|
440
|
+
throwUnsupportedProperty(this.ccId, property);
|
|
396
441
|
}
|
|
442
|
+
};
|
|
443
|
+
}
|
|
444
|
+
[SET_VALUE_HOOKS] = ({ property }, value, options) => {
|
|
445
|
+
// Enable restoring the previous non-zero value
|
|
446
|
+
if (property === "restorePrevious") {
|
|
447
|
+
property = "targetValue";
|
|
448
|
+
value = 255;
|
|
397
449
|
}
|
|
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
|
-
// We don't know the status now, so refresh the current value
|
|
450
|
+
if (property === "targetValue") {
|
|
451
|
+
const duration = Duration.from(options?.transitionDuration);
|
|
452
|
+
const currentValueValueId = MultilevelSwitchCCValues.currentValue
|
|
453
|
+
.endpoint(this.endpoint.index);
|
|
454
|
+
return {
|
|
455
|
+
// Multilevel Switch commands may take some time to be executed.
|
|
456
|
+
// Therefore we try to supervise the command execution and delay the
|
|
457
|
+
// optimistic update until the final result is received.
|
|
458
|
+
supervisionDelayedUpdates: true,
|
|
459
|
+
supervisionOnSuccess: async () => {
|
|
460
|
+
// Only update currentValue for valid target values
|
|
461
|
+
if (typeof value === "number"
|
|
462
|
+
&& value >= 0
|
|
463
|
+
&& value <= 99) {
|
|
464
|
+
this.tryGetValueDB()?.setValue(currentValueValueId, value);
|
|
465
|
+
}
|
|
466
|
+
else if (value === 255) {
|
|
467
|
+
// We don't know the status now, so refresh the current value
|
|
468
|
+
try {
|
|
469
|
+
await this.get();
|
|
470
|
+
}
|
|
471
|
+
catch {
|
|
472
|
+
// ignore
|
|
473
|
+
}
|
|
474
|
+
}
|
|
475
|
+
},
|
|
476
|
+
supervisionOnFailure: async () => {
|
|
477
|
+
// The transition failed, so now we don't know the status - refresh the current value
|
|
427
478
|
try {
|
|
428
479
|
await this.get();
|
|
429
480
|
}
|
|
430
481
|
catch {
|
|
431
482
|
// ignore
|
|
432
483
|
}
|
|
433
|
-
}
|
|
434
|
-
|
|
435
|
-
|
|
436
|
-
|
|
437
|
-
|
|
438
|
-
|
|
439
|
-
|
|
440
|
-
|
|
441
|
-
|
|
442
|
-
|
|
443
|
-
|
|
444
|
-
|
|
445
|
-
|
|
446
|
-
|
|
447
|
-
|
|
448
|
-
|
|
449
|
-
|
|
450
|
-
|
|
451
|
-
|
|
452
|
-
|
|
453
|
-
|
|
454
|
-
const affectedNodes = this.endpoint.node
|
|
455
|
-
.physicalNodes.filter((node) => node
|
|
456
|
-
.getEndpoint(this.endpoint.index)
|
|
457
|
-
?.supportsCC(this.ccId));
|
|
458
|
-
// and optimistically update the currentValue
|
|
459
|
-
for (const node of affectedNodes) {
|
|
460
|
-
this.host
|
|
461
|
-
.tryGetValueDB(node.id)
|
|
462
|
-
?.setValue(currentValueValueId, value);
|
|
484
|
+
},
|
|
485
|
+
optimisticallyUpdateRelatedValues: (_supervisedAndSuccessful) => {
|
|
486
|
+
// Only update currentValue for valid target values
|
|
487
|
+
if (typeof value === "number"
|
|
488
|
+
&& value >= 0
|
|
489
|
+
&& value <= 99) {
|
|
490
|
+
if (this.isSinglecast()) {
|
|
491
|
+
this.tryGetValueDB()?.setValue(currentValueValueId, value);
|
|
492
|
+
}
|
|
493
|
+
else if (this.isMulticast()) {
|
|
494
|
+
// Figure out which nodes were affected by this command
|
|
495
|
+
const affectedNodes = this.endpoint.node
|
|
496
|
+
.physicalNodes.filter((node) => node
|
|
497
|
+
.getEndpoint(this.endpoint.index)
|
|
498
|
+
?.supportsCC(this.ccId));
|
|
499
|
+
// and optimistically update the currentValue
|
|
500
|
+
for (const node of affectedNodes) {
|
|
501
|
+
this.host
|
|
502
|
+
.tryGetValueDB(node.id)
|
|
503
|
+
?.setValue(currentValueValueId, value);
|
|
504
|
+
}
|
|
463
505
|
}
|
|
464
506
|
}
|
|
465
|
-
}
|
|
466
|
-
|
|
467
|
-
|
|
468
|
-
|
|
469
|
-
|
|
470
|
-
|
|
471
|
-
|
|
472
|
-
|
|
473
|
-
|
|
474
|
-
|
|
475
|
-
|
|
476
|
-
|
|
477
|
-
|
|
478
|
-
}
|
|
479
|
-
}
|
|
507
|
+
},
|
|
508
|
+
forceVerifyChanges: () => {
|
|
509
|
+
// If we don't know the actual value, we need to verify the change, regardless of the supervision result
|
|
510
|
+
return value === 255;
|
|
511
|
+
},
|
|
512
|
+
verifyChanges: () => {
|
|
513
|
+
if (this.isSinglecast()
|
|
514
|
+
// We generally don't want to poll for multicasts because of how much traffic it can cause
|
|
515
|
+
// However, when setting the value 255 (ON), we don't know the actual state
|
|
516
|
+
|| (this.isMulticast() && value === 255)) {
|
|
517
|
+
// We query currentValue instead of targetValue to make sure that unsolicited updates cancel the scheduled poll
|
|
518
|
+
this.schedulePoll(currentValueValueId, value === 255 ? undefined : value, { duration });
|
|
519
|
+
}
|
|
520
|
+
},
|
|
521
|
+
};
|
|
522
|
+
}
|
|
523
|
+
};
|
|
524
|
+
get [POLL_VALUE]() {
|
|
525
|
+
return async function ({ property }) {
|
|
526
|
+
switch (property) {
|
|
527
|
+
case "currentValue":
|
|
528
|
+
case "targetValue":
|
|
529
|
+
case "duration":
|
|
530
|
+
return (await this.get())?.[property];
|
|
531
|
+
default:
|
|
532
|
+
throwUnsupportedProperty(this.ccId, property);
|
|
533
|
+
}
|
|
480
534
|
};
|
|
481
535
|
}
|
|
482
536
|
};
|
|
483
|
-
|
|
484
|
-
|
|
485
|
-
switch (property) {
|
|
486
|
-
case "currentValue":
|
|
487
|
-
case "targetValue":
|
|
488
|
-
case "duration":
|
|
489
|
-
return (await this.get())?.[property];
|
|
490
|
-
default:
|
|
491
|
-
throwUnsupportedProperty(this.ccId, property);
|
|
492
|
-
}
|
|
493
|
-
};
|
|
494
|
-
}
|
|
495
|
-
};
|
|
496
|
-
MultilevelSwitchCCAPI = __decorate([
|
|
497
|
-
API(CommandClasses["Multilevel Switch"])
|
|
498
|
-
], MultilevelSwitchCCAPI);
|
|
537
|
+
return MultilevelSwitchCCAPI = _classThis;
|
|
538
|
+
})();
|
|
499
539
|
export { MultilevelSwitchCCAPI };
|
|
500
|
-
let MultilevelSwitchCC =
|
|
501
|
-
|
|
502
|
-
|
|
503
|
-
|
|
504
|
-
|
|
505
|
-
|
|
506
|
-
|
|
507
|
-
|
|
508
|
-
|
|
509
|
-
|
|
510
|
-
|
|
511
|
-
|
|
512
|
-
|
|
513
|
-
|
|
540
|
+
let MultilevelSwitchCC = (() => {
|
|
541
|
+
let _classDecorators = [commandClass(CommandClasses["Multilevel Switch"]), implementedVersion(4), ccValues(MultilevelSwitchCCValues)];
|
|
542
|
+
let _classDescriptor;
|
|
543
|
+
let _classExtraInitializers = [];
|
|
544
|
+
let _classThis;
|
|
545
|
+
let _classSuper = CommandClass;
|
|
546
|
+
var MultilevelSwitchCC = class extends _classSuper {
|
|
547
|
+
static { _classThis = this; }
|
|
548
|
+
static {
|
|
549
|
+
const _metadata = typeof Symbol === "function" && Symbol.metadata ? Object.create(_classSuper[Symbol.metadata] ?? null) : void 0;
|
|
550
|
+
__esDecorate(null, _classDescriptor = { value: _classThis }, _classDecorators, { kind: "class", name: _classThis.name, metadata: _metadata }, null, _classExtraInitializers);
|
|
551
|
+
MultilevelSwitchCC = _classThis = _classDescriptor.value;
|
|
552
|
+
if (_metadata) Object.defineProperty(_classThis, Symbol.metadata, { enumerable: true, configurable: true, writable: true, value: _metadata });
|
|
553
|
+
__runInitializers(_classThis, _classExtraInitializers);
|
|
554
|
+
}
|
|
555
|
+
async interview(ctx) {
|
|
556
|
+
const node = this.getNode(ctx);
|
|
557
|
+
const endpoint = this.getEndpoint(ctx);
|
|
558
|
+
const api = CCAPI.create(CommandClasses["Multilevel Switch"], ctx, endpoint).withOptions({
|
|
559
|
+
priority: MessagePriority.NodeQuery,
|
|
560
|
+
});
|
|
514
561
|
ctx.logNode(node.id, {
|
|
515
562
|
endpoint: this.endpointIndex,
|
|
516
|
-
message:
|
|
517
|
-
direction: "
|
|
563
|
+
message: `Interviewing ${this.ccName}...`,
|
|
564
|
+
direction: "none",
|
|
518
565
|
});
|
|
519
|
-
|
|
520
|
-
|
|
566
|
+
if (api.version >= 3) {
|
|
567
|
+
// Find out which kind of switch this is
|
|
521
568
|
ctx.logNode(node.id, {
|
|
522
569
|
endpoint: this.endpointIndex,
|
|
523
|
-
message:
|
|
524
|
-
direction: "
|
|
570
|
+
message: "requesting switch type...",
|
|
571
|
+
direction: "outbound",
|
|
525
572
|
});
|
|
573
|
+
const switchType = await api.getSupported();
|
|
574
|
+
if (switchType != undefined) {
|
|
575
|
+
ctx.logNode(node.id, {
|
|
576
|
+
endpoint: this.endpointIndex,
|
|
577
|
+
message: `has switch type ${getEnumMemberName(SwitchType, switchType)}`,
|
|
578
|
+
direction: "inbound",
|
|
579
|
+
});
|
|
580
|
+
}
|
|
581
|
+
}
|
|
582
|
+
else {
|
|
583
|
+
// requesting the switch type automatically creates the up/down actions
|
|
584
|
+
// We need to do this manually for V1 and V2
|
|
585
|
+
this.createMetadataForLevelChangeActions(ctx);
|
|
526
586
|
}
|
|
587
|
+
await this.refreshValues(ctx);
|
|
588
|
+
// Remember that the interview is complete
|
|
589
|
+
this.setInterviewComplete(ctx, true);
|
|
527
590
|
}
|
|
528
|
-
|
|
529
|
-
|
|
530
|
-
|
|
531
|
-
|
|
591
|
+
async refreshValues(ctx) {
|
|
592
|
+
const node = this.getNode(ctx);
|
|
593
|
+
const endpoint = this.getEndpoint(ctx);
|
|
594
|
+
const api = CCAPI.create(CommandClasses["Multilevel Switch"], ctx, endpoint).withOptions({
|
|
595
|
+
priority: MessagePriority.NodeQuery,
|
|
596
|
+
});
|
|
597
|
+
ctx.logNode(node.id, {
|
|
598
|
+
endpoint: this.endpointIndex,
|
|
599
|
+
message: "requesting current switch state...",
|
|
600
|
+
direction: "outbound",
|
|
601
|
+
});
|
|
602
|
+
await api.get();
|
|
532
603
|
}
|
|
533
|
-
|
|
534
|
-
|
|
535
|
-
|
|
536
|
-
|
|
537
|
-
|
|
538
|
-
|
|
539
|
-
|
|
540
|
-
|
|
541
|
-
|
|
542
|
-
}
|
|
543
|
-
|
|
544
|
-
|
|
545
|
-
|
|
546
|
-
direction: "outbound",
|
|
547
|
-
});
|
|
548
|
-
await api.get();
|
|
549
|
-
}
|
|
550
|
-
setMappedBasicValue(ctx, value) {
|
|
551
|
-
this.setValue(ctx, MultilevelSwitchCCValues.currentValue, value);
|
|
552
|
-
return true;
|
|
553
|
-
}
|
|
554
|
-
createMetadataForLevelChangeActions(ctx,
|
|
555
|
-
// SDS13781: The Primary Switch Type SHOULD be 0x02 (Up/Down)
|
|
556
|
-
switchType = SwitchType["Down/Up"]) {
|
|
557
|
-
this.ensureMetadata(ctx, MultilevelSwitchCCValues.levelChangeUp(switchType));
|
|
558
|
-
this.ensureMetadata(ctx, MultilevelSwitchCCValues.levelChangeDown(switchType));
|
|
559
|
-
}
|
|
560
|
-
};
|
|
561
|
-
MultilevelSwitchCC = __decorate([
|
|
562
|
-
commandClass(CommandClasses["Multilevel Switch"]),
|
|
563
|
-
implementedVersion(4),
|
|
564
|
-
ccValues(MultilevelSwitchCCValues)
|
|
565
|
-
], MultilevelSwitchCC);
|
|
604
|
+
setMappedBasicValue(ctx, value) {
|
|
605
|
+
this.setValue(ctx, MultilevelSwitchCCValues.currentValue, value);
|
|
606
|
+
return true;
|
|
607
|
+
}
|
|
608
|
+
createMetadataForLevelChangeActions(ctx,
|
|
609
|
+
// SDS13781: The Primary Switch Type SHOULD be 0x02 (Up/Down)
|
|
610
|
+
switchType = SwitchType["Down/Up"]) {
|
|
611
|
+
this.ensureMetadata(ctx, MultilevelSwitchCCValues.levelChangeUp(switchType));
|
|
612
|
+
this.ensureMetadata(ctx, MultilevelSwitchCCValues.levelChangeDown(switchType));
|
|
613
|
+
}
|
|
614
|
+
};
|
|
615
|
+
return MultilevelSwitchCC = _classThis;
|
|
616
|
+
})();
|
|
566
617
|
export { MultilevelSwitchCC };
|
|
567
|
-
let MultilevelSwitchCCSet =
|
|
568
|
-
|
|
569
|
-
|
|
570
|
-
|
|
571
|
-
|
|
572
|
-
|
|
573
|
-
|
|
574
|
-
|
|
575
|
-
|
|
576
|
-
|
|
577
|
-
|
|
578
|
-
|
|
579
|
-
|
|
580
|
-
|
|
581
|
-
nodeId: ctx.sourceNodeId,
|
|
582
|
-
targetValue,
|
|
583
|
-
duration,
|
|
584
|
-
});
|
|
585
|
-
}
|
|
586
|
-
targetValue;
|
|
587
|
-
duration;
|
|
588
|
-
serialize(ctx) {
|
|
589
|
-
this.payload = Bytes.from([
|
|
590
|
-
this.targetValue,
|
|
591
|
-
(this.duration ?? Duration.default()).serializeSet(),
|
|
592
|
-
]);
|
|
593
|
-
const ccVersion = getEffectiveCCVersion(ctx, this);
|
|
594
|
-
if (ccVersion < 2 && ctx.getDeviceConfig?.(this.nodeId)?.compat?.encodeCCsUsingTargetVersion) {
|
|
595
|
-
// When forcing CC version 1, only include the target value
|
|
596
|
-
this.payload = this.payload.subarray(0, 1);
|
|
597
|
-
}
|
|
598
|
-
return super.serialize(ctx);
|
|
599
|
-
}
|
|
600
|
-
toLogEntry(ctx) {
|
|
601
|
-
const message = {
|
|
602
|
-
"target value": this.targetValue,
|
|
603
|
-
};
|
|
604
|
-
if (this.duration) {
|
|
605
|
-
message.duration = this.duration.toString();
|
|
618
|
+
let MultilevelSwitchCCSet = (() => {
|
|
619
|
+
let _classDecorators = [CCCommand(MultilevelSwitchCommand.Set), useSupervision()];
|
|
620
|
+
let _classDescriptor;
|
|
621
|
+
let _classExtraInitializers = [];
|
|
622
|
+
let _classThis;
|
|
623
|
+
let _classSuper = MultilevelSwitchCC;
|
|
624
|
+
var MultilevelSwitchCCSet = class extends _classSuper {
|
|
625
|
+
static { _classThis = this; }
|
|
626
|
+
static {
|
|
627
|
+
const _metadata = typeof Symbol === "function" && Symbol.metadata ? Object.create(_classSuper[Symbol.metadata] ?? null) : void 0;
|
|
628
|
+
__esDecorate(null, _classDescriptor = { value: _classThis }, _classDecorators, { kind: "class", name: _classThis.name, metadata: _metadata }, null, _classExtraInitializers);
|
|
629
|
+
MultilevelSwitchCCSet = _classThis = _classDescriptor.value;
|
|
630
|
+
if (_metadata) Object.defineProperty(_classThis, Symbol.metadata, { enumerable: true, configurable: true, writable: true, value: _metadata });
|
|
631
|
+
__runInitializers(_classThis, _classExtraInitializers);
|
|
606
632
|
}
|
|
607
|
-
|
|
608
|
-
|
|
609
|
-
|
|
610
|
-
|
|
611
|
-
|
|
612
|
-
|
|
613
|
-
|
|
614
|
-
|
|
615
|
-
|
|
616
|
-
|
|
633
|
+
constructor(options) {
|
|
634
|
+
super(options);
|
|
635
|
+
this.targetValue = options.targetValue;
|
|
636
|
+
this.duration = Duration.from(options.duration);
|
|
637
|
+
}
|
|
638
|
+
static from(raw, ctx) {
|
|
639
|
+
validatePayload(raw.payload.length >= 1);
|
|
640
|
+
const targetValue = raw.payload[0];
|
|
641
|
+
let duration;
|
|
642
|
+
if (raw.payload.length >= 2) {
|
|
643
|
+
duration = Duration.parseReport(raw.payload[1]);
|
|
644
|
+
}
|
|
645
|
+
return new this({
|
|
646
|
+
nodeId: ctx.sourceNodeId,
|
|
647
|
+
targetValue,
|
|
648
|
+
duration,
|
|
649
|
+
});
|
|
650
|
+
}
|
|
651
|
+
targetValue;
|
|
652
|
+
duration;
|
|
653
|
+
serialize(ctx) {
|
|
654
|
+
this.payload = Bytes.from([
|
|
655
|
+
this.targetValue,
|
|
656
|
+
(this.duration ?? Duration.default()).serializeSet(),
|
|
657
|
+
]);
|
|
658
|
+
const ccVersion = getEffectiveCCVersion(ctx, this);
|
|
659
|
+
if (ccVersion < 2 && ctx.getDeviceConfig?.(this.nodeId)?.compat?.encodeCCsUsingTargetVersion) {
|
|
660
|
+
// When forcing CC version 1, only include the target value
|
|
661
|
+
this.payload = this.payload.subarray(0, 1);
|
|
662
|
+
}
|
|
663
|
+
return super.serialize(ctx);
|
|
664
|
+
}
|
|
665
|
+
toLogEntry(ctx) {
|
|
666
|
+
const message = {
|
|
667
|
+
"target value": this.targetValue,
|
|
668
|
+
};
|
|
669
|
+
if (this.duration) {
|
|
670
|
+
message.duration = this.duration.toString();
|
|
671
|
+
}
|
|
672
|
+
return {
|
|
673
|
+
...super.toLogEntry(ctx),
|
|
674
|
+
message,
|
|
675
|
+
};
|
|
676
|
+
}
|
|
677
|
+
};
|
|
678
|
+
return MultilevelSwitchCCSet = _classThis;
|
|
679
|
+
})();
|
|
617
680
|
export { MultilevelSwitchCCSet };
|
|
618
|
-
let MultilevelSwitchCCReport =
|
|
619
|
-
|
|
620
|
-
|
|
621
|
-
|
|
622
|
-
|
|
623
|
-
|
|
624
|
-
|
|
625
|
-
|
|
626
|
-
|
|
627
|
-
|
|
628
|
-
|
|
629
|
-
|
|
630
|
-
|
|
631
|
-
|
|
632
|
-
let targetValue;
|
|
633
|
-
let duration;
|
|
634
|
-
if (raw.payload.length >= 3) {
|
|
635
|
-
targetValue = parseMaybeNumber(raw.payload[1]);
|
|
636
|
-
duration = Duration.parseReport(raw.payload[2]);
|
|
637
|
-
}
|
|
638
|
-
return new MultilevelSwitchCCReport_1({
|
|
639
|
-
nodeId: ctx.sourceNodeId,
|
|
640
|
-
currentValue,
|
|
641
|
-
targetValue,
|
|
642
|
-
duration,
|
|
643
|
-
});
|
|
644
|
-
}
|
|
645
|
-
targetValue;
|
|
646
|
-
duration;
|
|
647
|
-
currentValue;
|
|
648
|
-
serialize(ctx) {
|
|
649
|
-
this.payload = Bytes.from([
|
|
650
|
-
this.currentValue ?? 0xfe,
|
|
651
|
-
this.targetValue ?? 0xfe,
|
|
652
|
-
(this.duration ?? Duration.default()).serializeReport(),
|
|
653
|
-
]);
|
|
654
|
-
return super.serialize(ctx);
|
|
655
|
-
}
|
|
656
|
-
toLogEntry(ctx) {
|
|
657
|
-
const message = {
|
|
658
|
-
"current value": maybeUnknownToString(this.currentValue),
|
|
659
|
-
};
|
|
660
|
-
if (this.targetValue !== NOT_KNOWN && this.duration) {
|
|
661
|
-
message["target value"] = maybeUnknownToString(this.targetValue);
|
|
662
|
-
message.duration = this.duration.toString();
|
|
681
|
+
let MultilevelSwitchCCReport = (() => {
|
|
682
|
+
let _classDecorators = [CCCommand(MultilevelSwitchCommand.Report), ccValueProperty("targetValue", MultilevelSwitchCCValues.targetValue), ccValueProperty("duration", MultilevelSwitchCCValues.duration), ccValueProperty("currentValue", MultilevelSwitchCCValues.currentValue)];
|
|
683
|
+
let _classDescriptor;
|
|
684
|
+
let _classExtraInitializers = [];
|
|
685
|
+
let _classThis;
|
|
686
|
+
let _classSuper = MultilevelSwitchCC;
|
|
687
|
+
var MultilevelSwitchCCReport = class extends _classSuper {
|
|
688
|
+
static { _classThis = this; }
|
|
689
|
+
static {
|
|
690
|
+
const _metadata = typeof Symbol === "function" && Symbol.metadata ? Object.create(_classSuper[Symbol.metadata] ?? null) : void 0;
|
|
691
|
+
__esDecorate(null, _classDescriptor = { value: _classThis }, _classDecorators, { kind: "class", name: _classThis.name, metadata: _metadata }, null, _classExtraInitializers);
|
|
692
|
+
MultilevelSwitchCCReport = _classThis = _classDescriptor.value;
|
|
693
|
+
if (_metadata) Object.defineProperty(_classThis, Symbol.metadata, { enumerable: true, configurable: true, writable: true, value: _metadata });
|
|
694
|
+
__runInitializers(_classThis, _classExtraInitializers);
|
|
663
695
|
}
|
|
664
|
-
|
|
665
|
-
|
|
666
|
-
|
|
667
|
-
|
|
668
|
-
|
|
669
|
-
}
|
|
670
|
-
|
|
671
|
-
|
|
672
|
-
|
|
673
|
-
|
|
674
|
-
|
|
675
|
-
|
|
676
|
-
|
|
677
|
-
|
|
678
|
-
|
|
679
|
-
|
|
680
|
-
|
|
681
|
-
]
|
|
696
|
+
constructor(options) {
|
|
697
|
+
super(options);
|
|
698
|
+
this.currentValue = options.currentValue;
|
|
699
|
+
this.targetValue = options.targetValue;
|
|
700
|
+
this.duration = Duration.from(options.duration);
|
|
701
|
+
}
|
|
702
|
+
static from(raw, ctx) {
|
|
703
|
+
validatePayload(raw.payload.length >= 1);
|
|
704
|
+
const currentValue =
|
|
705
|
+
// 0xff is a legacy value for 100% (99)
|
|
706
|
+
raw.payload[0] === 0xff
|
|
707
|
+
? 99
|
|
708
|
+
: parseMaybeNumber(raw.payload[0]);
|
|
709
|
+
let targetValue;
|
|
710
|
+
let duration;
|
|
711
|
+
if (raw.payload.length >= 3) {
|
|
712
|
+
targetValue = parseMaybeNumber(raw.payload[1]);
|
|
713
|
+
duration = Duration.parseReport(raw.payload[2]);
|
|
714
|
+
}
|
|
715
|
+
return new this({
|
|
716
|
+
nodeId: ctx.sourceNodeId,
|
|
717
|
+
currentValue,
|
|
718
|
+
targetValue,
|
|
719
|
+
duration,
|
|
720
|
+
});
|
|
721
|
+
}
|
|
722
|
+
targetValue;
|
|
723
|
+
duration;
|
|
724
|
+
currentValue;
|
|
725
|
+
serialize(ctx) {
|
|
726
|
+
this.payload = Bytes.from([
|
|
727
|
+
this.currentValue ?? 0xfe,
|
|
728
|
+
this.targetValue ?? 0xfe,
|
|
729
|
+
(this.duration ?? Duration.default()).serializeReport(),
|
|
730
|
+
]);
|
|
731
|
+
return super.serialize(ctx);
|
|
732
|
+
}
|
|
733
|
+
toLogEntry(ctx) {
|
|
734
|
+
const message = {
|
|
735
|
+
"current value": maybeUnknownToString(this.currentValue),
|
|
736
|
+
};
|
|
737
|
+
if (this.targetValue !== NOT_KNOWN && this.duration) {
|
|
738
|
+
message["target value"] = maybeUnknownToString(this.targetValue);
|
|
739
|
+
message.duration = this.duration.toString();
|
|
740
|
+
}
|
|
741
|
+
return {
|
|
742
|
+
...super.toLogEntry(ctx),
|
|
743
|
+
message,
|
|
744
|
+
};
|
|
745
|
+
}
|
|
746
|
+
};
|
|
747
|
+
return MultilevelSwitchCCReport = _classThis;
|
|
748
|
+
})();
|
|
682
749
|
export { MultilevelSwitchCCReport };
|
|
683
|
-
let MultilevelSwitchCCGet =
|
|
684
|
-
|
|
685
|
-
|
|
686
|
-
|
|
687
|
-
|
|
688
|
-
|
|
750
|
+
let MultilevelSwitchCCGet = (() => {
|
|
751
|
+
let _classDecorators = [CCCommand(MultilevelSwitchCommand.Get), expectedCCResponse(MultilevelSwitchCCReport)];
|
|
752
|
+
let _classDescriptor;
|
|
753
|
+
let _classExtraInitializers = [];
|
|
754
|
+
let _classThis;
|
|
755
|
+
let _classSuper = MultilevelSwitchCC;
|
|
756
|
+
var MultilevelSwitchCCGet = class extends _classSuper {
|
|
757
|
+
static { _classThis = this; }
|
|
758
|
+
static {
|
|
759
|
+
const _metadata = typeof Symbol === "function" && Symbol.metadata ? Object.create(_classSuper[Symbol.metadata] ?? null) : void 0;
|
|
760
|
+
__esDecorate(null, _classDescriptor = { value: _classThis }, _classDecorators, { kind: "class", name: _classThis.name, metadata: _metadata }, null, _classExtraInitializers);
|
|
761
|
+
MultilevelSwitchCCGet = _classThis = _classDescriptor.value;
|
|
762
|
+
if (_metadata) Object.defineProperty(_classThis, Symbol.metadata, { enumerable: true, configurable: true, writable: true, value: _metadata });
|
|
763
|
+
__runInitializers(_classThis, _classExtraInitializers);
|
|
764
|
+
}
|
|
765
|
+
};
|
|
766
|
+
return MultilevelSwitchCCGet = _classThis;
|
|
767
|
+
})();
|
|
689
768
|
export { MultilevelSwitchCCGet };
|
|
690
|
-
let MultilevelSwitchCCStartLevelChange =
|
|
691
|
-
|
|
692
|
-
|
|
693
|
-
|
|
694
|
-
|
|
695
|
-
|
|
696
|
-
|
|
697
|
-
|
|
698
|
-
|
|
699
|
-
|
|
700
|
-
|
|
701
|
-
|
|
702
|
-
|
|
703
|
-
|
|
704
|
-
const startLevel = raw.payload[1];
|
|
705
|
-
let duration;
|
|
706
|
-
if (raw.payload.length >= 3) {
|
|
707
|
-
duration = Duration.parseSet(raw.payload[2]);
|
|
708
|
-
}
|
|
709
|
-
return new MultilevelSwitchCCStartLevelChange_1({
|
|
710
|
-
nodeId: ctx.sourceNodeId,
|
|
711
|
-
ignoreStartLevel,
|
|
712
|
-
direction,
|
|
713
|
-
startLevel,
|
|
714
|
-
duration,
|
|
715
|
-
});
|
|
716
|
-
}
|
|
717
|
-
duration;
|
|
718
|
-
startLevel;
|
|
719
|
-
ignoreStartLevel;
|
|
720
|
-
direction;
|
|
721
|
-
serialize(ctx) {
|
|
722
|
-
const controlByte = (LevelChangeDirection[this.direction] << 6)
|
|
723
|
-
| (this.ignoreStartLevel ? 0b0010_0000 : 0);
|
|
724
|
-
this.payload = Bytes.from([
|
|
725
|
-
controlByte,
|
|
726
|
-
this.startLevel,
|
|
727
|
-
(this.duration ?? Duration.default()).serializeSet(),
|
|
728
|
-
]);
|
|
729
|
-
const ccVersion = getEffectiveCCVersion(ctx, this);
|
|
730
|
-
if (ccVersion < 2 && ctx.getDeviceConfig?.(this.nodeId)?.compat?.encodeCCsUsingTargetVersion) {
|
|
731
|
-
// When forcing CC version 1, omit the duration byte
|
|
732
|
-
this.payload = this.payload.subarray(0, -1);
|
|
733
|
-
}
|
|
734
|
-
return super.serialize(ctx);
|
|
735
|
-
}
|
|
736
|
-
toLogEntry(ctx) {
|
|
737
|
-
const message = {
|
|
738
|
-
startLevel: `${this.startLevel}${this.ignoreStartLevel ? " (ignored)" : ""}`,
|
|
739
|
-
direction: this.direction,
|
|
740
|
-
};
|
|
741
|
-
if (this.duration) {
|
|
742
|
-
message.duration = this.duration.toString();
|
|
769
|
+
let MultilevelSwitchCCStartLevelChange = (() => {
|
|
770
|
+
let _classDecorators = [CCCommand(MultilevelSwitchCommand.StartLevelChange), useSupervision()];
|
|
771
|
+
let _classDescriptor;
|
|
772
|
+
let _classExtraInitializers = [];
|
|
773
|
+
let _classThis;
|
|
774
|
+
let _classSuper = MultilevelSwitchCC;
|
|
775
|
+
var MultilevelSwitchCCStartLevelChange = class extends _classSuper {
|
|
776
|
+
static { _classThis = this; }
|
|
777
|
+
static {
|
|
778
|
+
const _metadata = typeof Symbol === "function" && Symbol.metadata ? Object.create(_classSuper[Symbol.metadata] ?? null) : void 0;
|
|
779
|
+
__esDecorate(null, _classDescriptor = { value: _classThis }, _classDecorators, { kind: "class", name: _classThis.name, metadata: _metadata }, null, _classExtraInitializers);
|
|
780
|
+
MultilevelSwitchCCStartLevelChange = _classThis = _classDescriptor.value;
|
|
781
|
+
if (_metadata) Object.defineProperty(_classThis, Symbol.metadata, { enumerable: true, configurable: true, writable: true, value: _metadata });
|
|
782
|
+
__runInitializers(_classThis, _classExtraInitializers);
|
|
743
783
|
}
|
|
744
|
-
|
|
745
|
-
|
|
746
|
-
|
|
747
|
-
|
|
748
|
-
|
|
749
|
-
|
|
750
|
-
|
|
751
|
-
|
|
752
|
-
|
|
753
|
-
]
|
|
784
|
+
constructor(options) {
|
|
785
|
+
super(options);
|
|
786
|
+
this.duration = Duration.from(options.duration);
|
|
787
|
+
this.ignoreStartLevel = options.ignoreStartLevel;
|
|
788
|
+
this.startLevel = options.startLevel ?? 0;
|
|
789
|
+
this.direction = options.direction;
|
|
790
|
+
}
|
|
791
|
+
static from(raw, ctx) {
|
|
792
|
+
validatePayload(raw.payload.length >= 2);
|
|
793
|
+
const ignoreStartLevel = !!((raw.payload[0] & 0b0_0_1_00000) >>> 5);
|
|
794
|
+
const direction = ((raw.payload[0] & 0b0_1_0_00000) >>> 6)
|
|
795
|
+
? "down"
|
|
796
|
+
: "up";
|
|
797
|
+
const startLevel = raw.payload[1];
|
|
798
|
+
let duration;
|
|
799
|
+
if (raw.payload.length >= 3) {
|
|
800
|
+
duration = Duration.parseSet(raw.payload[2]);
|
|
801
|
+
}
|
|
802
|
+
return new this({
|
|
803
|
+
nodeId: ctx.sourceNodeId,
|
|
804
|
+
ignoreStartLevel,
|
|
805
|
+
direction,
|
|
806
|
+
startLevel,
|
|
807
|
+
duration,
|
|
808
|
+
});
|
|
809
|
+
}
|
|
810
|
+
duration;
|
|
811
|
+
startLevel;
|
|
812
|
+
ignoreStartLevel;
|
|
813
|
+
direction;
|
|
814
|
+
serialize(ctx) {
|
|
815
|
+
const controlByte = (LevelChangeDirection[this.direction] << 6)
|
|
816
|
+
| (this.ignoreStartLevel ? 0b0010_0000 : 0);
|
|
817
|
+
this.payload = Bytes.from([
|
|
818
|
+
controlByte,
|
|
819
|
+
this.startLevel,
|
|
820
|
+
(this.duration ?? Duration.default()).serializeSet(),
|
|
821
|
+
]);
|
|
822
|
+
const ccVersion = getEffectiveCCVersion(ctx, this);
|
|
823
|
+
if (ccVersion < 2 && ctx.getDeviceConfig?.(this.nodeId)?.compat?.encodeCCsUsingTargetVersion) {
|
|
824
|
+
// When forcing CC version 1, omit the duration byte
|
|
825
|
+
this.payload = this.payload.subarray(0, -1);
|
|
826
|
+
}
|
|
827
|
+
return super.serialize(ctx);
|
|
828
|
+
}
|
|
829
|
+
toLogEntry(ctx) {
|
|
830
|
+
const message = {
|
|
831
|
+
startLevel: `${this.startLevel}${this.ignoreStartLevel ? " (ignored)" : ""}`,
|
|
832
|
+
direction: this.direction,
|
|
833
|
+
};
|
|
834
|
+
if (this.duration) {
|
|
835
|
+
message.duration = this.duration.toString();
|
|
836
|
+
}
|
|
837
|
+
return {
|
|
838
|
+
...super.toLogEntry(ctx),
|
|
839
|
+
message,
|
|
840
|
+
};
|
|
841
|
+
}
|
|
842
|
+
};
|
|
843
|
+
return MultilevelSwitchCCStartLevelChange = _classThis;
|
|
844
|
+
})();
|
|
754
845
|
export { MultilevelSwitchCCStartLevelChange };
|
|
755
|
-
let MultilevelSwitchCCStopLevelChange =
|
|
756
|
-
|
|
757
|
-
|
|
758
|
-
|
|
759
|
-
|
|
760
|
-
|
|
846
|
+
let MultilevelSwitchCCStopLevelChange = (() => {
|
|
847
|
+
let _classDecorators = [CCCommand(MultilevelSwitchCommand.StopLevelChange), useSupervision()];
|
|
848
|
+
let _classDescriptor;
|
|
849
|
+
let _classExtraInitializers = [];
|
|
850
|
+
let _classThis;
|
|
851
|
+
let _classSuper = MultilevelSwitchCC;
|
|
852
|
+
var MultilevelSwitchCCStopLevelChange = class extends _classSuper {
|
|
853
|
+
static { _classThis = this; }
|
|
854
|
+
static {
|
|
855
|
+
const _metadata = typeof Symbol === "function" && Symbol.metadata ? Object.create(_classSuper[Symbol.metadata] ?? null) : void 0;
|
|
856
|
+
__esDecorate(null, _classDescriptor = { value: _classThis }, _classDecorators, { kind: "class", name: _classThis.name, metadata: _metadata }, null, _classExtraInitializers);
|
|
857
|
+
MultilevelSwitchCCStopLevelChange = _classThis = _classDescriptor.value;
|
|
858
|
+
if (_metadata) Object.defineProperty(_classThis, Symbol.metadata, { enumerable: true, configurable: true, writable: true, value: _metadata });
|
|
859
|
+
__runInitializers(_classThis, _classExtraInitializers);
|
|
860
|
+
}
|
|
861
|
+
};
|
|
862
|
+
return MultilevelSwitchCCStopLevelChange = _classThis;
|
|
863
|
+
})();
|
|
761
864
|
export { MultilevelSwitchCCStopLevelChange };
|
|
762
|
-
let MultilevelSwitchCCSupportedReport =
|
|
763
|
-
|
|
764
|
-
|
|
765
|
-
|
|
766
|
-
|
|
767
|
-
|
|
768
|
-
|
|
769
|
-
|
|
770
|
-
|
|
771
|
-
|
|
772
|
-
|
|
773
|
-
|
|
774
|
-
|
|
775
|
-
|
|
776
|
-
|
|
777
|
-
|
|
778
|
-
|
|
779
|
-
|
|
780
|
-
|
|
781
|
-
|
|
782
|
-
|
|
783
|
-
|
|
784
|
-
|
|
785
|
-
|
|
786
|
-
|
|
787
|
-
|
|
788
|
-
|
|
789
|
-
|
|
790
|
-
|
|
791
|
-
|
|
792
|
-
|
|
793
|
-
|
|
794
|
-
|
|
795
|
-
|
|
796
|
-
|
|
797
|
-
|
|
798
|
-
|
|
799
|
-
|
|
800
|
-
|
|
801
|
-
|
|
865
|
+
let MultilevelSwitchCCSupportedReport = (() => {
|
|
866
|
+
let _classDecorators = [CCCommand(MultilevelSwitchCommand.SupportedReport), ccValueProperty("switchType", MultilevelSwitchCCValues.switchType)];
|
|
867
|
+
let _classDescriptor;
|
|
868
|
+
let _classExtraInitializers = [];
|
|
869
|
+
let _classThis;
|
|
870
|
+
let _classSuper = MultilevelSwitchCC;
|
|
871
|
+
var MultilevelSwitchCCSupportedReport = class extends _classSuper {
|
|
872
|
+
static { _classThis = this; }
|
|
873
|
+
static {
|
|
874
|
+
const _metadata = typeof Symbol === "function" && Symbol.metadata ? Object.create(_classSuper[Symbol.metadata] ?? null) : void 0;
|
|
875
|
+
__esDecorate(null, _classDescriptor = { value: _classThis }, _classDecorators, { kind: "class", name: _classThis.name, metadata: _metadata }, null, _classExtraInitializers);
|
|
876
|
+
MultilevelSwitchCCSupportedReport = _classThis = _classDescriptor.value;
|
|
877
|
+
if (_metadata) Object.defineProperty(_classThis, Symbol.metadata, { enumerable: true, configurable: true, writable: true, value: _metadata });
|
|
878
|
+
__runInitializers(_classThis, _classExtraInitializers);
|
|
879
|
+
}
|
|
880
|
+
constructor(options) {
|
|
881
|
+
super(options);
|
|
882
|
+
this.switchType = options.switchType;
|
|
883
|
+
}
|
|
884
|
+
static from(raw, ctx) {
|
|
885
|
+
validatePayload(raw.payload.length >= 1);
|
|
886
|
+
const switchType = raw.payload[0] & 0b11111;
|
|
887
|
+
return new this({
|
|
888
|
+
nodeId: ctx.sourceNodeId,
|
|
889
|
+
switchType,
|
|
890
|
+
});
|
|
891
|
+
}
|
|
892
|
+
// This is the primary switch type. We're not supporting secondary switch types
|
|
893
|
+
switchType;
|
|
894
|
+
persistValues(ctx) {
|
|
895
|
+
if (!super.persistValues(ctx))
|
|
896
|
+
return false;
|
|
897
|
+
this.createMetadataForLevelChangeActions(ctx, this.switchType);
|
|
898
|
+
return true;
|
|
899
|
+
}
|
|
900
|
+
serialize(ctx) {
|
|
901
|
+
this.payload = Bytes.from([this.switchType & 0b11111]);
|
|
902
|
+
return super.serialize(ctx);
|
|
903
|
+
}
|
|
904
|
+
toLogEntry(ctx) {
|
|
905
|
+
return {
|
|
906
|
+
...super.toLogEntry(ctx),
|
|
907
|
+
message: {
|
|
908
|
+
"switch type": getEnumMemberName(SwitchType, this.switchType),
|
|
909
|
+
},
|
|
910
|
+
};
|
|
911
|
+
}
|
|
912
|
+
};
|
|
913
|
+
return MultilevelSwitchCCSupportedReport = _classThis;
|
|
914
|
+
})();
|
|
802
915
|
export { MultilevelSwitchCCSupportedReport };
|
|
803
|
-
let MultilevelSwitchCCSupportedGet =
|
|
804
|
-
|
|
805
|
-
|
|
806
|
-
|
|
807
|
-
|
|
808
|
-
|
|
916
|
+
let MultilevelSwitchCCSupportedGet = (() => {
|
|
917
|
+
let _classDecorators = [CCCommand(MultilevelSwitchCommand.SupportedGet), expectedCCResponse(MultilevelSwitchCCSupportedReport)];
|
|
918
|
+
let _classDescriptor;
|
|
919
|
+
let _classExtraInitializers = [];
|
|
920
|
+
let _classThis;
|
|
921
|
+
let _classSuper = MultilevelSwitchCC;
|
|
922
|
+
var MultilevelSwitchCCSupportedGet = class extends _classSuper {
|
|
923
|
+
static { _classThis = this; }
|
|
924
|
+
static {
|
|
925
|
+
const _metadata = typeof Symbol === "function" && Symbol.metadata ? Object.create(_classSuper[Symbol.metadata] ?? null) : void 0;
|
|
926
|
+
__esDecorate(null, _classDescriptor = { value: _classThis }, _classDecorators, { kind: "class", name: _classThis.name, metadata: _metadata }, null, _classExtraInitializers);
|
|
927
|
+
MultilevelSwitchCCSupportedGet = _classThis = _classDescriptor.value;
|
|
928
|
+
if (_metadata) Object.defineProperty(_classThis, Symbol.metadata, { enumerable: true, configurable: true, writable: true, value: _metadata });
|
|
929
|
+
__runInitializers(_classThis, _classExtraInitializers);
|
|
930
|
+
}
|
|
931
|
+
};
|
|
932
|
+
return MultilevelSwitchCCSupportedGet = _classThis;
|
|
933
|
+
})();
|
|
809
934
|
export { MultilevelSwitchCCSupportedGet };
|
|
810
935
|
//# sourceMappingURL=MultilevelSwitchCC.js.map
|