@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
|
@@ -38,13 +38,45 @@ var import_CommandClass = require("../lib/CommandClass.js");
|
|
|
38
38
|
var import_CommandClassDecorators = require("../lib/CommandClassDecorators.js");
|
|
39
39
|
var import_Values = require("../lib/Values.js");
|
|
40
40
|
var import_Types = require("../lib/_Types.js");
|
|
41
|
-
var
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
41
|
+
var __esDecorate = function(ctor, descriptorIn, decorators, contextIn, initializers, extraInitializers) {
|
|
42
|
+
function accept(f) {
|
|
43
|
+
if (f !== void 0 && typeof f !== "function") throw new TypeError("Function expected");
|
|
44
|
+
return f;
|
|
45
|
+
}
|
|
46
|
+
var kind = contextIn.kind, key = kind === "getter" ? "get" : kind === "setter" ? "set" : "value";
|
|
47
|
+
var target = !descriptorIn && ctor ? contextIn["static"] ? ctor : ctor.prototype : null;
|
|
48
|
+
var descriptor = descriptorIn || (target ? Object.getOwnPropertyDescriptor(target, contextIn.name) : {});
|
|
49
|
+
var _, done = false;
|
|
50
|
+
for (var i = decorators.length - 1; i >= 0; i--) {
|
|
51
|
+
var context = {};
|
|
52
|
+
for (var p in contextIn) context[p] = p === "access" ? {} : contextIn[p];
|
|
53
|
+
for (var p in contextIn.access) context.access[p] = contextIn.access[p];
|
|
54
|
+
context.addInitializer = function(f) {
|
|
55
|
+
if (done) throw new TypeError("Cannot add initializers after decoration has completed");
|
|
56
|
+
extraInitializers.push(accept(f || null));
|
|
57
|
+
};
|
|
58
|
+
var result = (0, decorators[i])(kind === "accessor" ? { get: descriptor.get, set: descriptor.set } : descriptor[key], context);
|
|
59
|
+
if (kind === "accessor") {
|
|
60
|
+
if (result === void 0) continue;
|
|
61
|
+
if (result === null || typeof result !== "object") throw new TypeError("Object expected");
|
|
62
|
+
if (_ = accept(result.get)) descriptor.get = _;
|
|
63
|
+
if (_ = accept(result.set)) descriptor.set = _;
|
|
64
|
+
if (_ = accept(result.init)) initializers.unshift(_);
|
|
65
|
+
} else if (_ = accept(result)) {
|
|
66
|
+
if (kind === "field") initializers.unshift(_);
|
|
67
|
+
else descriptor[key] = _;
|
|
68
|
+
}
|
|
69
|
+
}
|
|
70
|
+
if (target) Object.defineProperty(target, contextIn.name, descriptor);
|
|
71
|
+
done = true;
|
|
72
|
+
};
|
|
73
|
+
var __runInitializers = function(thisArg, initializers, value) {
|
|
74
|
+
var useValue = arguments.length > 2;
|
|
75
|
+
for (var i = 0; i < initializers.length; i++) {
|
|
76
|
+
value = useValue ? initializers[i].call(thisArg, value) : initializers[i].call(thisArg);
|
|
77
|
+
}
|
|
78
|
+
return useValue ? value : void 0;
|
|
46
79
|
};
|
|
47
|
-
var MultilevelSwitchCCSet_1, MultilevelSwitchCCReport_1, MultilevelSwitchCCStartLevelChange_1, MultilevelSwitchCCSupportedReport_1;
|
|
48
80
|
function __assertType(argName, typeName, boundHasError) {
|
|
49
81
|
const { ZWaveError, ZWaveErrorCodes } = require("@zwave-js/core");
|
|
50
82
|
if (boundHasError()) {
|
|
@@ -301,469 +333,585 @@ const MultilevelSwitchCCValues = Object.freeze({
|
|
|
301
333
|
)
|
|
302
334
|
})
|
|
303
335
|
});
|
|
304
|
-
let MultilevelSwitchCCAPI =
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
// This is mandatory
|
|
314
|
-
case import_Types.MultilevelSwitchCommand.SupportedGet:
|
|
315
|
-
return this.version >= 3 && this.isSinglecast();
|
|
316
|
-
}
|
|
317
|
-
return super.supportsCommand(cmd);
|
|
318
|
-
}
|
|
319
|
-
// eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types
|
|
320
|
-
async get() {
|
|
321
|
-
this.assertSupportsCommand(import_Types.MultilevelSwitchCommand, import_Types.MultilevelSwitchCommand.Get);
|
|
322
|
-
const cc = new MultilevelSwitchCCGet({
|
|
323
|
-
nodeId: this.endpoint.nodeId,
|
|
324
|
-
endpointIndex: this.endpoint.index
|
|
325
|
-
});
|
|
326
|
-
const response = await this.host.sendCommand(cc, this.commandOptions);
|
|
327
|
-
if (response) {
|
|
328
|
-
return (0, import_safe3.pick)(response, ["currentValue", "targetValue", "duration"]);
|
|
336
|
+
let MultilevelSwitchCCAPI = (() => {
|
|
337
|
+
let _classDecorators = [(0, import_CommandClassDecorators.API)(import_safe.CommandClasses["Multilevel Switch"])];
|
|
338
|
+
let _classDescriptor;
|
|
339
|
+
let _classExtraInitializers = [];
|
|
340
|
+
let _classThis;
|
|
341
|
+
let _classSuper = import_API.CCAPI;
|
|
342
|
+
var MultilevelSwitchCCAPI2 = class extends _classSuper {
|
|
343
|
+
static {
|
|
344
|
+
_classThis = this;
|
|
329
345
|
}
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
}
|
|
349
|
-
async startLevelChange(options) {
|
|
350
|
-
__assertType("options", "MultilevelSwitchCCStartLevelChangeOptions", __assertType__MultilevelSwitchCCStartLevelChangeOptions.bind(void 0, options));
|
|
351
|
-
this.assertSupportsCommand(import_Types.MultilevelSwitchCommand, import_Types.MultilevelSwitchCommand.StartLevelChange);
|
|
352
|
-
const cc = new MultilevelSwitchCCStartLevelChange({
|
|
353
|
-
nodeId: this.endpoint.nodeId,
|
|
354
|
-
endpointIndex: this.endpoint.index,
|
|
355
|
-
...options
|
|
356
|
-
});
|
|
357
|
-
return this.host.sendCommand(cc, this.commandOptions);
|
|
358
|
-
}
|
|
359
|
-
async stopLevelChange() {
|
|
360
|
-
this.assertSupportsCommand(import_Types.MultilevelSwitchCommand, import_Types.MultilevelSwitchCommand.StopLevelChange);
|
|
361
|
-
const cc = new MultilevelSwitchCCStopLevelChange({
|
|
362
|
-
nodeId: this.endpoint.nodeId,
|
|
363
|
-
endpointIndex: this.endpoint.index
|
|
364
|
-
});
|
|
365
|
-
return this.host.sendCommand(cc, this.commandOptions);
|
|
366
|
-
}
|
|
367
|
-
async getSupported() {
|
|
368
|
-
this.assertSupportsCommand(import_Types.MultilevelSwitchCommand, import_Types.MultilevelSwitchCommand.SupportedGet);
|
|
369
|
-
const cc = new MultilevelSwitchCCSupportedGet({
|
|
370
|
-
nodeId: this.endpoint.nodeId,
|
|
371
|
-
endpointIndex: this.endpoint.index
|
|
372
|
-
});
|
|
373
|
-
const response = await this.host.sendCommand(cc, this.commandOptions);
|
|
374
|
-
return response?.switchType;
|
|
375
|
-
}
|
|
376
|
-
get [import_API.SET_VALUE]() {
|
|
377
|
-
return async function({ property }, value, options) {
|
|
378
|
-
if (property === "restorePrevious") {
|
|
379
|
-
property = "targetValue";
|
|
380
|
-
value = 255;
|
|
346
|
+
static {
|
|
347
|
+
const _metadata = typeof Symbol === "function" && Symbol.metadata ? Object.create(_classSuper[Symbol.metadata] ?? null) : void 0;
|
|
348
|
+
__esDecorate(null, _classDescriptor = { value: _classThis }, _classDecorators, { kind: "class", name: _classThis.name, metadata: _metadata }, null, _classExtraInitializers);
|
|
349
|
+
MultilevelSwitchCCAPI2 = _classThis = _classDescriptor.value;
|
|
350
|
+
if (_metadata) Object.defineProperty(_classThis, Symbol.metadata, { enumerable: true, configurable: true, writable: true, value: _metadata });
|
|
351
|
+
__runInitializers(_classThis, _classExtraInitializers);
|
|
352
|
+
}
|
|
353
|
+
supportsCommand(cmd) {
|
|
354
|
+
switch (cmd) {
|
|
355
|
+
case import_Types.MultilevelSwitchCommand.Get:
|
|
356
|
+
return this.isSinglecast();
|
|
357
|
+
case import_Types.MultilevelSwitchCommand.Set:
|
|
358
|
+
case import_Types.MultilevelSwitchCommand.StartLevelChange:
|
|
359
|
+
case import_Types.MultilevelSwitchCommand.StopLevelChange:
|
|
360
|
+
return true;
|
|
361
|
+
// This is mandatory
|
|
362
|
+
case import_Types.MultilevelSwitchCommand.SupportedGet:
|
|
363
|
+
return this.version >= 3 && this.isSinglecast();
|
|
381
364
|
}
|
|
382
|
-
|
|
383
|
-
|
|
384
|
-
|
|
385
|
-
|
|
386
|
-
|
|
387
|
-
|
|
388
|
-
|
|
389
|
-
|
|
390
|
-
|
|
365
|
+
return super.supportsCommand(cmd);
|
|
366
|
+
}
|
|
367
|
+
// eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types
|
|
368
|
+
async get() {
|
|
369
|
+
this.assertSupportsCommand(import_Types.MultilevelSwitchCommand, import_Types.MultilevelSwitchCommand.Get);
|
|
370
|
+
const cc = new MultilevelSwitchCCGet({
|
|
371
|
+
nodeId: this.endpoint.nodeId,
|
|
372
|
+
endpointIndex: this.endpoint.index
|
|
373
|
+
});
|
|
374
|
+
const response = await this.host.sendCommand(cc, this.commandOptions);
|
|
375
|
+
if (response) {
|
|
376
|
+
return (0, import_safe3.pick)(response, ["currentValue", "targetValue", "duration"]);
|
|
377
|
+
}
|
|
378
|
+
}
|
|
379
|
+
/**
|
|
380
|
+
* Sets the switch to a new value
|
|
381
|
+
* @param targetValue The new target value for the switch
|
|
382
|
+
* @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.
|
|
383
|
+
* @returns A promise indicating whether the command was completed
|
|
384
|
+
*/
|
|
385
|
+
async set(targetValue, duration) {
|
|
386
|
+
__assertType("targetValue", "number", __assertType__number.bind(void 0, targetValue));
|
|
387
|
+
__assertType("duration", void 0, __assertType__optional_su__string__2_eu.bind(void 0, duration));
|
|
388
|
+
this.assertSupportsCommand(import_Types.MultilevelSwitchCommand, import_Types.MultilevelSwitchCommand.Set);
|
|
389
|
+
const cc = new MultilevelSwitchCCSet({
|
|
390
|
+
nodeId: this.endpoint.nodeId,
|
|
391
|
+
endpointIndex: this.endpoint.index,
|
|
392
|
+
targetValue,
|
|
393
|
+
duration
|
|
394
|
+
});
|
|
395
|
+
return this.host.sendCommand(cc, this.commandOptions);
|
|
396
|
+
}
|
|
397
|
+
async startLevelChange(options) {
|
|
398
|
+
__assertType("options", "MultilevelSwitchCCStartLevelChangeOptions", __assertType__MultilevelSwitchCCStartLevelChangeOptions.bind(void 0, options));
|
|
399
|
+
this.assertSupportsCommand(import_Types.MultilevelSwitchCommand, import_Types.MultilevelSwitchCommand.StartLevelChange);
|
|
400
|
+
const cc = new MultilevelSwitchCCStartLevelChange({
|
|
401
|
+
nodeId: this.endpoint.nodeId,
|
|
402
|
+
endpointIndex: this.endpoint.index,
|
|
403
|
+
...options
|
|
404
|
+
});
|
|
405
|
+
return this.host.sendCommand(cc, this.commandOptions);
|
|
406
|
+
}
|
|
407
|
+
async stopLevelChange() {
|
|
408
|
+
this.assertSupportsCommand(import_Types.MultilevelSwitchCommand, import_Types.MultilevelSwitchCommand.StopLevelChange);
|
|
409
|
+
const cc = new MultilevelSwitchCCStopLevelChange({
|
|
410
|
+
nodeId: this.endpoint.nodeId,
|
|
411
|
+
endpointIndex: this.endpoint.index
|
|
412
|
+
});
|
|
413
|
+
return this.host.sendCommand(cc, this.commandOptions);
|
|
414
|
+
}
|
|
415
|
+
async getSupported() {
|
|
416
|
+
this.assertSupportsCommand(import_Types.MultilevelSwitchCommand, import_Types.MultilevelSwitchCommand.SupportedGet);
|
|
417
|
+
const cc = new MultilevelSwitchCCSupportedGet({
|
|
418
|
+
nodeId: this.endpoint.nodeId,
|
|
419
|
+
endpointIndex: this.endpoint.index
|
|
420
|
+
});
|
|
421
|
+
const response = await this.host.sendCommand(cc, this.commandOptions);
|
|
422
|
+
return response?.switchType;
|
|
423
|
+
}
|
|
424
|
+
get [import_API.SET_VALUE]() {
|
|
425
|
+
return async function({ property }, value, options) {
|
|
426
|
+
if (property === "restorePrevious") {
|
|
427
|
+
property = "targetValue";
|
|
428
|
+
value = 255;
|
|
391
429
|
}
|
|
392
|
-
if (
|
|
393
|
-
|
|
394
|
-
|
|
430
|
+
if (property === "targetValue") {
|
|
431
|
+
if (typeof value !== "number") {
|
|
432
|
+
(0, import_API.throwWrongValueType)(this.ccId, property, "number", typeof value);
|
|
433
|
+
}
|
|
395
434
|
const duration = import_safe.Duration.from(options?.transitionDuration);
|
|
396
|
-
return this.
|
|
397
|
-
|
|
398
|
-
|
|
399
|
-
|
|
400
|
-
|
|
401
|
-
|
|
435
|
+
return this.set(value, duration);
|
|
436
|
+
} else if (switchTypeProperties.includes(property)) {
|
|
437
|
+
if (typeof value !== "boolean") {
|
|
438
|
+
(0, import_API.throwWrongValueType)(this.ccId, property, "number", typeof value);
|
|
439
|
+
}
|
|
440
|
+
if (value) {
|
|
441
|
+
const direction = switchTypeProperties.indexOf(property) % 2 === 0 ? "down" : "up";
|
|
442
|
+
const startLevel = this.tryGetValueDB()?.getValue(MultilevelSwitchCCValues.currentValue.endpoint(this.endpoint.index));
|
|
443
|
+
const duration = import_safe.Duration.from(options?.transitionDuration);
|
|
444
|
+
return this.startLevelChange({
|
|
445
|
+
direction,
|
|
446
|
+
ignoreStartLevel: true,
|
|
447
|
+
startLevel: typeof startLevel === "number" ? startLevel : void 0,
|
|
448
|
+
duration
|
|
449
|
+
});
|
|
450
|
+
} else {
|
|
451
|
+
return this.stopLevelChange();
|
|
452
|
+
}
|
|
402
453
|
} else {
|
|
403
|
-
|
|
454
|
+
(0, import_API.throwUnsupportedProperty)(this.ccId, property);
|
|
404
455
|
}
|
|
405
|
-
}
|
|
406
|
-
|
|
456
|
+
};
|
|
457
|
+
}
|
|
458
|
+
[import_API.SET_VALUE_HOOKS] = ({ property }, value, options) => {
|
|
459
|
+
if (property === "restorePrevious") {
|
|
460
|
+
property = "targetValue";
|
|
461
|
+
value = 255;
|
|
407
462
|
}
|
|
408
|
-
|
|
409
|
-
|
|
410
|
-
|
|
411
|
-
|
|
412
|
-
|
|
413
|
-
|
|
414
|
-
|
|
415
|
-
|
|
416
|
-
|
|
417
|
-
|
|
418
|
-
|
|
419
|
-
|
|
420
|
-
|
|
421
|
-
|
|
422
|
-
|
|
423
|
-
|
|
424
|
-
|
|
425
|
-
|
|
426
|
-
|
|
463
|
+
if (property === "targetValue") {
|
|
464
|
+
const duration = import_safe.Duration.from(options?.transitionDuration);
|
|
465
|
+
const currentValueValueId = MultilevelSwitchCCValues.currentValue.endpoint(this.endpoint.index);
|
|
466
|
+
return {
|
|
467
|
+
// Multilevel Switch commands may take some time to be executed.
|
|
468
|
+
// Therefore we try to supervise the command execution and delay the
|
|
469
|
+
// optimistic update until the final result is received.
|
|
470
|
+
supervisionDelayedUpdates: true,
|
|
471
|
+
supervisionOnSuccess: async () => {
|
|
472
|
+
if (typeof value === "number" && value >= 0 && value <= 99) {
|
|
473
|
+
this.tryGetValueDB()?.setValue(currentValueValueId, value);
|
|
474
|
+
} else if (value === 255) {
|
|
475
|
+
try {
|
|
476
|
+
await this.get();
|
|
477
|
+
} catch {
|
|
478
|
+
}
|
|
479
|
+
}
|
|
480
|
+
},
|
|
481
|
+
supervisionOnFailure: async () => {
|
|
427
482
|
try {
|
|
428
483
|
await this.get();
|
|
429
484
|
} catch {
|
|
430
485
|
}
|
|
431
|
-
}
|
|
432
|
-
|
|
433
|
-
|
|
434
|
-
|
|
435
|
-
|
|
436
|
-
|
|
437
|
-
|
|
438
|
-
|
|
439
|
-
|
|
440
|
-
|
|
441
|
-
if (this.isSinglecast()) {
|
|
442
|
-
this.tryGetValueDB()?.setValue(currentValueValueId, value);
|
|
443
|
-
} else if (this.isMulticast()) {
|
|
444
|
-
const affectedNodes = this.endpoint.node.physicalNodes.filter((node) => node.getEndpoint(this.endpoint.index)?.supportsCC(this.ccId));
|
|
445
|
-
for (const node of affectedNodes) {
|
|
446
|
-
this.host.tryGetValueDB(node.id)?.setValue(currentValueValueId, value);
|
|
486
|
+
},
|
|
487
|
+
optimisticallyUpdateRelatedValues: (_supervisedAndSuccessful) => {
|
|
488
|
+
if (typeof value === "number" && value >= 0 && value <= 99) {
|
|
489
|
+
if (this.isSinglecast()) {
|
|
490
|
+
this.tryGetValueDB()?.setValue(currentValueValueId, value);
|
|
491
|
+
} else if (this.isMulticast()) {
|
|
492
|
+
const affectedNodes = this.endpoint.node.physicalNodes.filter((node) => node.getEndpoint(this.endpoint.index)?.supportsCC(this.ccId));
|
|
493
|
+
for (const node of affectedNodes) {
|
|
494
|
+
this.host.tryGetValueDB(node.id)?.setValue(currentValueValueId, value);
|
|
495
|
+
}
|
|
447
496
|
}
|
|
448
497
|
}
|
|
498
|
+
},
|
|
499
|
+
forceVerifyChanges: () => {
|
|
500
|
+
return value === 255;
|
|
501
|
+
},
|
|
502
|
+
verifyChanges: () => {
|
|
503
|
+
if (this.isSinglecast() || this.isMulticast() && value === 255) {
|
|
504
|
+
this.schedulePoll(currentValueValueId, value === 255 ? void 0 : value, { duration });
|
|
505
|
+
}
|
|
449
506
|
}
|
|
450
|
-
}
|
|
451
|
-
|
|
452
|
-
|
|
453
|
-
|
|
454
|
-
|
|
455
|
-
|
|
456
|
-
|
|
457
|
-
|
|
507
|
+
};
|
|
508
|
+
}
|
|
509
|
+
};
|
|
510
|
+
get [import_API.POLL_VALUE]() {
|
|
511
|
+
return async function({ property }) {
|
|
512
|
+
switch (property) {
|
|
513
|
+
case "currentValue":
|
|
514
|
+
case "targetValue":
|
|
515
|
+
case "duration":
|
|
516
|
+
return (await this.get())?.[property];
|
|
517
|
+
default:
|
|
518
|
+
(0, import_API.throwUnsupportedProperty)(this.ccId, property);
|
|
458
519
|
}
|
|
459
520
|
};
|
|
460
521
|
}
|
|
461
522
|
};
|
|
462
|
-
|
|
463
|
-
|
|
464
|
-
|
|
465
|
-
|
|
466
|
-
|
|
467
|
-
|
|
468
|
-
|
|
469
|
-
|
|
470
|
-
|
|
471
|
-
|
|
472
|
-
|
|
473
|
-
|
|
474
|
-
|
|
475
|
-
|
|
476
|
-
|
|
477
|
-
|
|
478
|
-
|
|
479
|
-
|
|
480
|
-
|
|
481
|
-
|
|
482
|
-
|
|
483
|
-
|
|
484
|
-
|
|
485
|
-
|
|
486
|
-
|
|
487
|
-
message: `Interviewing ${this.ccName}...`,
|
|
488
|
-
direction: "none"
|
|
489
|
-
});
|
|
490
|
-
if (api.version >= 3) {
|
|
523
|
+
return MultilevelSwitchCCAPI2 = _classThis;
|
|
524
|
+
})();
|
|
525
|
+
let MultilevelSwitchCC = (() => {
|
|
526
|
+
let _classDecorators = [(0, import_CommandClassDecorators.commandClass)(import_safe.CommandClasses["Multilevel Switch"]), (0, import_CommandClassDecorators.implementedVersion)(4), (0, import_CommandClassDecorators.ccValues)(MultilevelSwitchCCValues)];
|
|
527
|
+
let _classDescriptor;
|
|
528
|
+
let _classExtraInitializers = [];
|
|
529
|
+
let _classThis;
|
|
530
|
+
let _classSuper = import_CommandClass.CommandClass;
|
|
531
|
+
var MultilevelSwitchCC2 = class extends _classSuper {
|
|
532
|
+
static {
|
|
533
|
+
_classThis = this;
|
|
534
|
+
}
|
|
535
|
+
static {
|
|
536
|
+
const _metadata = typeof Symbol === "function" && Symbol.metadata ? Object.create(_classSuper[Symbol.metadata] ?? null) : void 0;
|
|
537
|
+
__esDecorate(null, _classDescriptor = { value: _classThis }, _classDecorators, { kind: "class", name: _classThis.name, metadata: _metadata }, null, _classExtraInitializers);
|
|
538
|
+
MultilevelSwitchCC2 = _classThis = _classDescriptor.value;
|
|
539
|
+
if (_metadata) Object.defineProperty(_classThis, Symbol.metadata, { enumerable: true, configurable: true, writable: true, value: _metadata });
|
|
540
|
+
__runInitializers(_classThis, _classExtraInitializers);
|
|
541
|
+
}
|
|
542
|
+
async interview(ctx) {
|
|
543
|
+
const node = this.getNode(ctx);
|
|
544
|
+
const endpoint = this.getEndpoint(ctx);
|
|
545
|
+
const api = import_API.CCAPI.create(import_safe.CommandClasses["Multilevel Switch"], ctx, endpoint).withOptions({
|
|
546
|
+
priority: import_safe.MessagePriority.NodeQuery
|
|
547
|
+
});
|
|
491
548
|
ctx.logNode(node.id, {
|
|
492
549
|
endpoint: this.endpointIndex,
|
|
493
|
-
message:
|
|
494
|
-
direction: "
|
|
550
|
+
message: `Interviewing ${this.ccName}...`,
|
|
551
|
+
direction: "none"
|
|
495
552
|
});
|
|
496
|
-
|
|
497
|
-
if (switchType != void 0) {
|
|
553
|
+
if (api.version >= 3) {
|
|
498
554
|
ctx.logNode(node.id, {
|
|
499
555
|
endpoint: this.endpointIndex,
|
|
500
|
-
message:
|
|
501
|
-
direction: "
|
|
556
|
+
message: "requesting switch type...",
|
|
557
|
+
direction: "outbound"
|
|
502
558
|
});
|
|
559
|
+
const switchType = await api.getSupported();
|
|
560
|
+
if (switchType != void 0) {
|
|
561
|
+
ctx.logNode(node.id, {
|
|
562
|
+
endpoint: this.endpointIndex,
|
|
563
|
+
message: `has switch type ${(0, import_safe3.getEnumMemberName)(import_Types.SwitchType, switchType)}`,
|
|
564
|
+
direction: "inbound"
|
|
565
|
+
});
|
|
566
|
+
}
|
|
567
|
+
} else {
|
|
568
|
+
this.createMetadataForLevelChangeActions(ctx);
|
|
503
569
|
}
|
|
504
|
-
|
|
505
|
-
this.
|
|
570
|
+
await this.refreshValues(ctx);
|
|
571
|
+
this.setInterviewComplete(ctx, true);
|
|
506
572
|
}
|
|
507
|
-
|
|
508
|
-
|
|
509
|
-
|
|
510
|
-
|
|
511
|
-
|
|
512
|
-
|
|
513
|
-
|
|
514
|
-
|
|
515
|
-
|
|
516
|
-
|
|
517
|
-
|
|
518
|
-
|
|
519
|
-
direction: "outbound"
|
|
520
|
-
});
|
|
521
|
-
await api.get();
|
|
522
|
-
}
|
|
523
|
-
setMappedBasicValue(ctx, value) {
|
|
524
|
-
this.setValue(ctx, MultilevelSwitchCCValues.currentValue, value);
|
|
525
|
-
return true;
|
|
526
|
-
}
|
|
527
|
-
createMetadataForLevelChangeActions(ctx, switchType = import_Types.SwitchType["Down/Up"]) {
|
|
528
|
-
this.ensureMetadata(ctx, MultilevelSwitchCCValues.levelChangeUp(switchType));
|
|
529
|
-
this.ensureMetadata(ctx, MultilevelSwitchCCValues.levelChangeDown(switchType));
|
|
530
|
-
}
|
|
531
|
-
};
|
|
532
|
-
MultilevelSwitchCC = __decorate([
|
|
533
|
-
(0, import_CommandClassDecorators.commandClass)(import_safe.CommandClasses["Multilevel Switch"]),
|
|
534
|
-
(0, import_CommandClassDecorators.implementedVersion)(4),
|
|
535
|
-
(0, import_CommandClassDecorators.ccValues)(MultilevelSwitchCCValues)
|
|
536
|
-
], MultilevelSwitchCC);
|
|
537
|
-
let MultilevelSwitchCCSet = MultilevelSwitchCCSet_1 = class MultilevelSwitchCCSet2 extends MultilevelSwitchCC {
|
|
538
|
-
constructor(options) {
|
|
539
|
-
super(options);
|
|
540
|
-
this.targetValue = options.targetValue;
|
|
541
|
-
this.duration = import_safe.Duration.from(options.duration);
|
|
542
|
-
}
|
|
543
|
-
static from(raw, ctx) {
|
|
544
|
-
(0, import_safe.validatePayload)(raw.payload.length >= 1);
|
|
545
|
-
const targetValue = raw.payload[0];
|
|
546
|
-
let duration;
|
|
547
|
-
if (raw.payload.length >= 2) {
|
|
548
|
-
duration = import_safe.Duration.parseReport(raw.payload[1]);
|
|
549
|
-
}
|
|
550
|
-
return new MultilevelSwitchCCSet_1({
|
|
551
|
-
nodeId: ctx.sourceNodeId,
|
|
552
|
-
targetValue,
|
|
553
|
-
duration
|
|
554
|
-
});
|
|
555
|
-
}
|
|
556
|
-
targetValue;
|
|
557
|
-
duration;
|
|
558
|
-
serialize(ctx) {
|
|
559
|
-
this.payload = import_safe2.Bytes.from([
|
|
560
|
-
this.targetValue,
|
|
561
|
-
(this.duration ?? import_safe.Duration.default()).serializeSet()
|
|
562
|
-
]);
|
|
563
|
-
const ccVersion = (0, import_CommandClass.getEffectiveCCVersion)(ctx, this);
|
|
564
|
-
if (ccVersion < 2 && ctx.getDeviceConfig?.(this.nodeId)?.compat?.encodeCCsUsingTargetVersion) {
|
|
565
|
-
this.payload = this.payload.subarray(0, 1);
|
|
566
|
-
}
|
|
567
|
-
return super.serialize(ctx);
|
|
568
|
-
}
|
|
569
|
-
toLogEntry(ctx) {
|
|
570
|
-
const message = {
|
|
571
|
-
"target value": this.targetValue
|
|
572
|
-
};
|
|
573
|
-
if (this.duration) {
|
|
574
|
-
message.duration = this.duration.toString();
|
|
573
|
+
async refreshValues(ctx) {
|
|
574
|
+
const node = this.getNode(ctx);
|
|
575
|
+
const endpoint = this.getEndpoint(ctx);
|
|
576
|
+
const api = import_API.CCAPI.create(import_safe.CommandClasses["Multilevel Switch"], ctx, endpoint).withOptions({
|
|
577
|
+
priority: import_safe.MessagePriority.NodeQuery
|
|
578
|
+
});
|
|
579
|
+
ctx.logNode(node.id, {
|
|
580
|
+
endpoint: this.endpointIndex,
|
|
581
|
+
message: "requesting current switch state...",
|
|
582
|
+
direction: "outbound"
|
|
583
|
+
});
|
|
584
|
+
await api.get();
|
|
575
585
|
}
|
|
576
|
-
|
|
577
|
-
|
|
578
|
-
|
|
579
|
-
};
|
|
580
|
-
}
|
|
581
|
-
};
|
|
582
|
-
MultilevelSwitchCCSet = MultilevelSwitchCCSet_1 = __decorate([
|
|
583
|
-
(0, import_CommandClassDecorators.CCCommand)(import_Types.MultilevelSwitchCommand.Set),
|
|
584
|
-
(0, import_CommandClassDecorators.useSupervision)()
|
|
585
|
-
], MultilevelSwitchCCSet);
|
|
586
|
-
let MultilevelSwitchCCReport = MultilevelSwitchCCReport_1 = class MultilevelSwitchCCReport2 extends MultilevelSwitchCC {
|
|
587
|
-
constructor(options) {
|
|
588
|
-
super(options);
|
|
589
|
-
this.currentValue = options.currentValue;
|
|
590
|
-
this.targetValue = options.targetValue;
|
|
591
|
-
this.duration = import_safe.Duration.from(options.duration);
|
|
592
|
-
}
|
|
593
|
-
static from(raw, ctx) {
|
|
594
|
-
(0, import_safe.validatePayload)(raw.payload.length >= 1);
|
|
595
|
-
const currentValue = (
|
|
596
|
-
// 0xff is a legacy value for 100% (99)
|
|
597
|
-
raw.payload[0] === 255 ? 99 : (0, import_safe.parseMaybeNumber)(raw.payload[0])
|
|
598
|
-
);
|
|
599
|
-
let targetValue;
|
|
600
|
-
let duration;
|
|
601
|
-
if (raw.payload.length >= 3) {
|
|
602
|
-
targetValue = (0, import_safe.parseMaybeNumber)(raw.payload[1]);
|
|
603
|
-
duration = import_safe.Duration.parseReport(raw.payload[2]);
|
|
604
|
-
}
|
|
605
|
-
return new MultilevelSwitchCCReport_1({
|
|
606
|
-
nodeId: ctx.sourceNodeId,
|
|
607
|
-
currentValue,
|
|
608
|
-
targetValue,
|
|
609
|
-
duration
|
|
610
|
-
});
|
|
611
|
-
}
|
|
612
|
-
targetValue;
|
|
613
|
-
duration;
|
|
614
|
-
currentValue;
|
|
615
|
-
serialize(ctx) {
|
|
616
|
-
this.payload = import_safe2.Bytes.from([
|
|
617
|
-
this.currentValue ?? 254,
|
|
618
|
-
this.targetValue ?? 254,
|
|
619
|
-
(this.duration ?? import_safe.Duration.default()).serializeReport()
|
|
620
|
-
]);
|
|
621
|
-
return super.serialize(ctx);
|
|
622
|
-
}
|
|
623
|
-
toLogEntry(ctx) {
|
|
624
|
-
const message = {
|
|
625
|
-
"current value": (0, import_safe.maybeUnknownToString)(this.currentValue)
|
|
626
|
-
};
|
|
627
|
-
if (this.targetValue !== import_safe.NOT_KNOWN && this.duration) {
|
|
628
|
-
message["target value"] = (0, import_safe.maybeUnknownToString)(this.targetValue);
|
|
629
|
-
message.duration = this.duration.toString();
|
|
586
|
+
setMappedBasicValue(ctx, value) {
|
|
587
|
+
this.setValue(ctx, MultilevelSwitchCCValues.currentValue, value);
|
|
588
|
+
return true;
|
|
630
589
|
}
|
|
631
|
-
|
|
632
|
-
|
|
633
|
-
|
|
634
|
-
};
|
|
635
|
-
}
|
|
636
|
-
};
|
|
637
|
-
__decorate([
|
|
638
|
-
(0, import_CommandClassDecorators.ccValue)(MultilevelSwitchCCValues.targetValue)
|
|
639
|
-
], MultilevelSwitchCCReport.prototype, "targetValue", void 0);
|
|
640
|
-
__decorate([
|
|
641
|
-
(0, import_CommandClassDecorators.ccValue)(MultilevelSwitchCCValues.duration)
|
|
642
|
-
], MultilevelSwitchCCReport.prototype, "duration", void 0);
|
|
643
|
-
__decorate([
|
|
644
|
-
(0, import_CommandClassDecorators.ccValue)(MultilevelSwitchCCValues.currentValue)
|
|
645
|
-
], MultilevelSwitchCCReport.prototype, "currentValue", void 0);
|
|
646
|
-
MultilevelSwitchCCReport = MultilevelSwitchCCReport_1 = __decorate([
|
|
647
|
-
(0, import_CommandClassDecorators.CCCommand)(import_Types.MultilevelSwitchCommand.Report)
|
|
648
|
-
], MultilevelSwitchCCReport);
|
|
649
|
-
let MultilevelSwitchCCGet = class MultilevelSwitchCCGet2 extends MultilevelSwitchCC {
|
|
650
|
-
};
|
|
651
|
-
MultilevelSwitchCCGet = __decorate([
|
|
652
|
-
(0, import_CommandClassDecorators.CCCommand)(import_Types.MultilevelSwitchCommand.Get),
|
|
653
|
-
(0, import_CommandClassDecorators.expectedCCResponse)(MultilevelSwitchCCReport)
|
|
654
|
-
], MultilevelSwitchCCGet);
|
|
655
|
-
let MultilevelSwitchCCStartLevelChange = MultilevelSwitchCCStartLevelChange_1 = class MultilevelSwitchCCStartLevelChange2 extends MultilevelSwitchCC {
|
|
656
|
-
constructor(options) {
|
|
657
|
-
super(options);
|
|
658
|
-
this.duration = import_safe.Duration.from(options.duration);
|
|
659
|
-
this.ignoreStartLevel = options.ignoreStartLevel;
|
|
660
|
-
this.startLevel = options.startLevel ?? 0;
|
|
661
|
-
this.direction = options.direction;
|
|
662
|
-
}
|
|
663
|
-
static from(raw, ctx) {
|
|
664
|
-
(0, import_safe.validatePayload)(raw.payload.length >= 2);
|
|
665
|
-
const ignoreStartLevel = !!((raw.payload[0] & 32) >>> 5);
|
|
666
|
-
const direction = (raw.payload[0] & 64) >>> 6 ? "down" : "up";
|
|
667
|
-
const startLevel = raw.payload[1];
|
|
668
|
-
let duration;
|
|
669
|
-
if (raw.payload.length >= 3) {
|
|
670
|
-
duration = import_safe.Duration.parseSet(raw.payload[2]);
|
|
671
|
-
}
|
|
672
|
-
return new MultilevelSwitchCCStartLevelChange_1({
|
|
673
|
-
nodeId: ctx.sourceNodeId,
|
|
674
|
-
ignoreStartLevel,
|
|
675
|
-
direction,
|
|
676
|
-
startLevel,
|
|
677
|
-
duration
|
|
678
|
-
});
|
|
679
|
-
}
|
|
680
|
-
duration;
|
|
681
|
-
startLevel;
|
|
682
|
-
ignoreStartLevel;
|
|
683
|
-
direction;
|
|
684
|
-
serialize(ctx) {
|
|
685
|
-
const controlByte = import_Types.LevelChangeDirection[this.direction] << 6 | (this.ignoreStartLevel ? 32 : 0);
|
|
686
|
-
this.payload = import_safe2.Bytes.from([
|
|
687
|
-
controlByte,
|
|
688
|
-
this.startLevel,
|
|
689
|
-
(this.duration ?? import_safe.Duration.default()).serializeSet()
|
|
690
|
-
]);
|
|
691
|
-
const ccVersion = (0, import_CommandClass.getEffectiveCCVersion)(ctx, this);
|
|
692
|
-
if (ccVersion < 2 && ctx.getDeviceConfig?.(this.nodeId)?.compat?.encodeCCsUsingTargetVersion) {
|
|
693
|
-
this.payload = this.payload.subarray(0, -1);
|
|
694
|
-
}
|
|
695
|
-
return super.serialize(ctx);
|
|
696
|
-
}
|
|
697
|
-
toLogEntry(ctx) {
|
|
698
|
-
const message = {
|
|
699
|
-
startLevel: `${this.startLevel}${this.ignoreStartLevel ? " (ignored)" : ""}`,
|
|
700
|
-
direction: this.direction
|
|
701
|
-
};
|
|
702
|
-
if (this.duration) {
|
|
703
|
-
message.duration = this.duration.toString();
|
|
590
|
+
createMetadataForLevelChangeActions(ctx, switchType = import_Types.SwitchType["Down/Up"]) {
|
|
591
|
+
this.ensureMetadata(ctx, MultilevelSwitchCCValues.levelChangeUp(switchType));
|
|
592
|
+
this.ensureMetadata(ctx, MultilevelSwitchCCValues.levelChangeDown(switchType));
|
|
704
593
|
}
|
|
705
|
-
|
|
706
|
-
|
|
707
|
-
|
|
708
|
-
|
|
709
|
-
|
|
710
|
-
|
|
711
|
-
|
|
712
|
-
|
|
713
|
-
|
|
714
|
-
|
|
715
|
-
|
|
716
|
-
|
|
717
|
-
|
|
718
|
-
|
|
719
|
-
|
|
720
|
-
|
|
721
|
-
|
|
722
|
-
|
|
723
|
-
|
|
724
|
-
|
|
725
|
-
|
|
726
|
-
|
|
727
|
-
|
|
728
|
-
|
|
729
|
-
|
|
730
|
-
|
|
731
|
-
|
|
732
|
-
|
|
733
|
-
|
|
734
|
-
|
|
735
|
-
|
|
736
|
-
persistValues(ctx) {
|
|
737
|
-
if (!super.persistValues(ctx))
|
|
738
|
-
return false;
|
|
739
|
-
this.createMetadataForLevelChangeActions(ctx, this.switchType);
|
|
740
|
-
return true;
|
|
741
|
-
}
|
|
742
|
-
serialize(ctx) {
|
|
743
|
-
this.payload = import_safe2.Bytes.from([this.switchType & 31]);
|
|
744
|
-
return super.serialize(ctx);
|
|
745
|
-
}
|
|
746
|
-
toLogEntry(ctx) {
|
|
747
|
-
return {
|
|
748
|
-
...super.toLogEntry(ctx),
|
|
749
|
-
message: {
|
|
750
|
-
"switch type": (0, import_safe3.getEnumMemberName)(import_Types.SwitchType, this.switchType)
|
|
594
|
+
};
|
|
595
|
+
return MultilevelSwitchCC2 = _classThis;
|
|
596
|
+
})();
|
|
597
|
+
let MultilevelSwitchCCSet = (() => {
|
|
598
|
+
let _classDecorators = [(0, import_CommandClassDecorators.CCCommand)(import_Types.MultilevelSwitchCommand.Set), (0, import_CommandClassDecorators.useSupervision)()];
|
|
599
|
+
let _classDescriptor;
|
|
600
|
+
let _classExtraInitializers = [];
|
|
601
|
+
let _classThis;
|
|
602
|
+
let _classSuper = MultilevelSwitchCC;
|
|
603
|
+
var MultilevelSwitchCCSet2 = class extends _classSuper {
|
|
604
|
+
static {
|
|
605
|
+
_classThis = this;
|
|
606
|
+
}
|
|
607
|
+
static {
|
|
608
|
+
const _metadata = typeof Symbol === "function" && Symbol.metadata ? Object.create(_classSuper[Symbol.metadata] ?? null) : void 0;
|
|
609
|
+
__esDecorate(null, _classDescriptor = { value: _classThis }, _classDecorators, { kind: "class", name: _classThis.name, metadata: _metadata }, null, _classExtraInitializers);
|
|
610
|
+
MultilevelSwitchCCSet2 = _classThis = _classDescriptor.value;
|
|
611
|
+
if (_metadata) Object.defineProperty(_classThis, Symbol.metadata, { enumerable: true, configurable: true, writable: true, value: _metadata });
|
|
612
|
+
__runInitializers(_classThis, _classExtraInitializers);
|
|
613
|
+
}
|
|
614
|
+
constructor(options) {
|
|
615
|
+
super(options);
|
|
616
|
+
this.targetValue = options.targetValue;
|
|
617
|
+
this.duration = import_safe.Duration.from(options.duration);
|
|
618
|
+
}
|
|
619
|
+
static from(raw, ctx) {
|
|
620
|
+
(0, import_safe.validatePayload)(raw.payload.length >= 1);
|
|
621
|
+
const targetValue = raw.payload[0];
|
|
622
|
+
let duration;
|
|
623
|
+
if (raw.payload.length >= 2) {
|
|
624
|
+
duration = import_safe.Duration.parseReport(raw.payload[1]);
|
|
751
625
|
}
|
|
752
|
-
|
|
753
|
-
|
|
754
|
-
|
|
755
|
-
|
|
756
|
-
|
|
757
|
-
|
|
758
|
-
|
|
759
|
-
|
|
760
|
-
|
|
761
|
-
|
|
762
|
-
|
|
763
|
-
|
|
764
|
-
|
|
765
|
-
|
|
766
|
-
|
|
626
|
+
return new this({
|
|
627
|
+
nodeId: ctx.sourceNodeId,
|
|
628
|
+
targetValue,
|
|
629
|
+
duration
|
|
630
|
+
});
|
|
631
|
+
}
|
|
632
|
+
targetValue;
|
|
633
|
+
duration;
|
|
634
|
+
serialize(ctx) {
|
|
635
|
+
this.payload = import_safe2.Bytes.from([
|
|
636
|
+
this.targetValue,
|
|
637
|
+
(this.duration ?? import_safe.Duration.default()).serializeSet()
|
|
638
|
+
]);
|
|
639
|
+
const ccVersion = (0, import_CommandClass.getEffectiveCCVersion)(ctx, this);
|
|
640
|
+
if (ccVersion < 2 && ctx.getDeviceConfig?.(this.nodeId)?.compat?.encodeCCsUsingTargetVersion) {
|
|
641
|
+
this.payload = this.payload.subarray(0, 1);
|
|
642
|
+
}
|
|
643
|
+
return super.serialize(ctx);
|
|
644
|
+
}
|
|
645
|
+
toLogEntry(ctx) {
|
|
646
|
+
const message = {
|
|
647
|
+
"target value": this.targetValue
|
|
648
|
+
};
|
|
649
|
+
if (this.duration) {
|
|
650
|
+
message.duration = this.duration.toString();
|
|
651
|
+
}
|
|
652
|
+
return {
|
|
653
|
+
...super.toLogEntry(ctx),
|
|
654
|
+
message
|
|
655
|
+
};
|
|
656
|
+
}
|
|
657
|
+
};
|
|
658
|
+
return MultilevelSwitchCCSet2 = _classThis;
|
|
659
|
+
})();
|
|
660
|
+
let MultilevelSwitchCCReport = (() => {
|
|
661
|
+
let _classDecorators = [(0, import_CommandClassDecorators.CCCommand)(import_Types.MultilevelSwitchCommand.Report), (0, import_CommandClassDecorators.ccValueProperty)("targetValue", MultilevelSwitchCCValues.targetValue), (0, import_CommandClassDecorators.ccValueProperty)("duration", MultilevelSwitchCCValues.duration), (0, import_CommandClassDecorators.ccValueProperty)("currentValue", MultilevelSwitchCCValues.currentValue)];
|
|
662
|
+
let _classDescriptor;
|
|
663
|
+
let _classExtraInitializers = [];
|
|
664
|
+
let _classThis;
|
|
665
|
+
let _classSuper = MultilevelSwitchCC;
|
|
666
|
+
var MultilevelSwitchCCReport2 = class extends _classSuper {
|
|
667
|
+
static {
|
|
668
|
+
_classThis = this;
|
|
669
|
+
}
|
|
670
|
+
static {
|
|
671
|
+
const _metadata = typeof Symbol === "function" && Symbol.metadata ? Object.create(_classSuper[Symbol.metadata] ?? null) : void 0;
|
|
672
|
+
__esDecorate(null, _classDescriptor = { value: _classThis }, _classDecorators, { kind: "class", name: _classThis.name, metadata: _metadata }, null, _classExtraInitializers);
|
|
673
|
+
MultilevelSwitchCCReport2 = _classThis = _classDescriptor.value;
|
|
674
|
+
if (_metadata) Object.defineProperty(_classThis, Symbol.metadata, { enumerable: true, configurable: true, writable: true, value: _metadata });
|
|
675
|
+
__runInitializers(_classThis, _classExtraInitializers);
|
|
676
|
+
}
|
|
677
|
+
constructor(options) {
|
|
678
|
+
super(options);
|
|
679
|
+
this.currentValue = options.currentValue;
|
|
680
|
+
this.targetValue = options.targetValue;
|
|
681
|
+
this.duration = import_safe.Duration.from(options.duration);
|
|
682
|
+
}
|
|
683
|
+
static from(raw, ctx) {
|
|
684
|
+
(0, import_safe.validatePayload)(raw.payload.length >= 1);
|
|
685
|
+
const currentValue = (
|
|
686
|
+
// 0xff is a legacy value for 100% (99)
|
|
687
|
+
raw.payload[0] === 255 ? 99 : (0, import_safe.parseMaybeNumber)(raw.payload[0])
|
|
688
|
+
);
|
|
689
|
+
let targetValue;
|
|
690
|
+
let duration;
|
|
691
|
+
if (raw.payload.length >= 3) {
|
|
692
|
+
targetValue = (0, import_safe.parseMaybeNumber)(raw.payload[1]);
|
|
693
|
+
duration = import_safe.Duration.parseReport(raw.payload[2]);
|
|
694
|
+
}
|
|
695
|
+
return new this({
|
|
696
|
+
nodeId: ctx.sourceNodeId,
|
|
697
|
+
currentValue,
|
|
698
|
+
targetValue,
|
|
699
|
+
duration
|
|
700
|
+
});
|
|
701
|
+
}
|
|
702
|
+
targetValue;
|
|
703
|
+
duration;
|
|
704
|
+
currentValue;
|
|
705
|
+
serialize(ctx) {
|
|
706
|
+
this.payload = import_safe2.Bytes.from([
|
|
707
|
+
this.currentValue ?? 254,
|
|
708
|
+
this.targetValue ?? 254,
|
|
709
|
+
(this.duration ?? import_safe.Duration.default()).serializeReport()
|
|
710
|
+
]);
|
|
711
|
+
return super.serialize(ctx);
|
|
712
|
+
}
|
|
713
|
+
toLogEntry(ctx) {
|
|
714
|
+
const message = {
|
|
715
|
+
"current value": (0, import_safe.maybeUnknownToString)(this.currentValue)
|
|
716
|
+
};
|
|
717
|
+
if (this.targetValue !== import_safe.NOT_KNOWN && this.duration) {
|
|
718
|
+
message["target value"] = (0, import_safe.maybeUnknownToString)(this.targetValue);
|
|
719
|
+
message.duration = this.duration.toString();
|
|
720
|
+
}
|
|
721
|
+
return {
|
|
722
|
+
...super.toLogEntry(ctx),
|
|
723
|
+
message
|
|
724
|
+
};
|
|
725
|
+
}
|
|
726
|
+
};
|
|
727
|
+
return MultilevelSwitchCCReport2 = _classThis;
|
|
728
|
+
})();
|
|
729
|
+
let MultilevelSwitchCCGet = (() => {
|
|
730
|
+
let _classDecorators = [(0, import_CommandClassDecorators.CCCommand)(import_Types.MultilevelSwitchCommand.Get), (0, import_CommandClassDecorators.expectedCCResponse)(MultilevelSwitchCCReport)];
|
|
731
|
+
let _classDescriptor;
|
|
732
|
+
let _classExtraInitializers = [];
|
|
733
|
+
let _classThis;
|
|
734
|
+
let _classSuper = MultilevelSwitchCC;
|
|
735
|
+
var MultilevelSwitchCCGet2 = class extends _classSuper {
|
|
736
|
+
static {
|
|
737
|
+
_classThis = this;
|
|
738
|
+
}
|
|
739
|
+
static {
|
|
740
|
+
const _metadata = typeof Symbol === "function" && Symbol.metadata ? Object.create(_classSuper[Symbol.metadata] ?? null) : void 0;
|
|
741
|
+
__esDecorate(null, _classDescriptor = { value: _classThis }, _classDecorators, { kind: "class", name: _classThis.name, metadata: _metadata }, null, _classExtraInitializers);
|
|
742
|
+
MultilevelSwitchCCGet2 = _classThis = _classDescriptor.value;
|
|
743
|
+
if (_metadata) Object.defineProperty(_classThis, Symbol.metadata, { enumerable: true, configurable: true, writable: true, value: _metadata });
|
|
744
|
+
__runInitializers(_classThis, _classExtraInitializers);
|
|
745
|
+
}
|
|
746
|
+
};
|
|
747
|
+
return MultilevelSwitchCCGet2 = _classThis;
|
|
748
|
+
})();
|
|
749
|
+
let MultilevelSwitchCCStartLevelChange = (() => {
|
|
750
|
+
let _classDecorators = [(0, import_CommandClassDecorators.CCCommand)(import_Types.MultilevelSwitchCommand.StartLevelChange), (0, import_CommandClassDecorators.useSupervision)()];
|
|
751
|
+
let _classDescriptor;
|
|
752
|
+
let _classExtraInitializers = [];
|
|
753
|
+
let _classThis;
|
|
754
|
+
let _classSuper = MultilevelSwitchCC;
|
|
755
|
+
var MultilevelSwitchCCStartLevelChange2 = class extends _classSuper {
|
|
756
|
+
static {
|
|
757
|
+
_classThis = this;
|
|
758
|
+
}
|
|
759
|
+
static {
|
|
760
|
+
const _metadata = typeof Symbol === "function" && Symbol.metadata ? Object.create(_classSuper[Symbol.metadata] ?? null) : void 0;
|
|
761
|
+
__esDecorate(null, _classDescriptor = { value: _classThis }, _classDecorators, { kind: "class", name: _classThis.name, metadata: _metadata }, null, _classExtraInitializers);
|
|
762
|
+
MultilevelSwitchCCStartLevelChange2 = _classThis = _classDescriptor.value;
|
|
763
|
+
if (_metadata) Object.defineProperty(_classThis, Symbol.metadata, { enumerable: true, configurable: true, writable: true, value: _metadata });
|
|
764
|
+
__runInitializers(_classThis, _classExtraInitializers);
|
|
765
|
+
}
|
|
766
|
+
constructor(options) {
|
|
767
|
+
super(options);
|
|
768
|
+
this.duration = import_safe.Duration.from(options.duration);
|
|
769
|
+
this.ignoreStartLevel = options.ignoreStartLevel;
|
|
770
|
+
this.startLevel = options.startLevel ?? 0;
|
|
771
|
+
this.direction = options.direction;
|
|
772
|
+
}
|
|
773
|
+
static from(raw, ctx) {
|
|
774
|
+
(0, import_safe.validatePayload)(raw.payload.length >= 2);
|
|
775
|
+
const ignoreStartLevel = !!((raw.payload[0] & 32) >>> 5);
|
|
776
|
+
const direction = (raw.payload[0] & 64) >>> 6 ? "down" : "up";
|
|
777
|
+
const startLevel = raw.payload[1];
|
|
778
|
+
let duration;
|
|
779
|
+
if (raw.payload.length >= 3) {
|
|
780
|
+
duration = import_safe.Duration.parseSet(raw.payload[2]);
|
|
781
|
+
}
|
|
782
|
+
return new this({
|
|
783
|
+
nodeId: ctx.sourceNodeId,
|
|
784
|
+
ignoreStartLevel,
|
|
785
|
+
direction,
|
|
786
|
+
startLevel,
|
|
787
|
+
duration
|
|
788
|
+
});
|
|
789
|
+
}
|
|
790
|
+
duration;
|
|
791
|
+
startLevel;
|
|
792
|
+
ignoreStartLevel;
|
|
793
|
+
direction;
|
|
794
|
+
serialize(ctx) {
|
|
795
|
+
const controlByte = import_Types.LevelChangeDirection[this.direction] << 6 | (this.ignoreStartLevel ? 32 : 0);
|
|
796
|
+
this.payload = import_safe2.Bytes.from([
|
|
797
|
+
controlByte,
|
|
798
|
+
this.startLevel,
|
|
799
|
+
(this.duration ?? import_safe.Duration.default()).serializeSet()
|
|
800
|
+
]);
|
|
801
|
+
const ccVersion = (0, import_CommandClass.getEffectiveCCVersion)(ctx, this);
|
|
802
|
+
if (ccVersion < 2 && ctx.getDeviceConfig?.(this.nodeId)?.compat?.encodeCCsUsingTargetVersion) {
|
|
803
|
+
this.payload = this.payload.subarray(0, -1);
|
|
804
|
+
}
|
|
805
|
+
return super.serialize(ctx);
|
|
806
|
+
}
|
|
807
|
+
toLogEntry(ctx) {
|
|
808
|
+
const message = {
|
|
809
|
+
startLevel: `${this.startLevel}${this.ignoreStartLevel ? " (ignored)" : ""}`,
|
|
810
|
+
direction: this.direction
|
|
811
|
+
};
|
|
812
|
+
if (this.duration) {
|
|
813
|
+
message.duration = this.duration.toString();
|
|
814
|
+
}
|
|
815
|
+
return {
|
|
816
|
+
...super.toLogEntry(ctx),
|
|
817
|
+
message
|
|
818
|
+
};
|
|
819
|
+
}
|
|
820
|
+
};
|
|
821
|
+
return MultilevelSwitchCCStartLevelChange2 = _classThis;
|
|
822
|
+
})();
|
|
823
|
+
let MultilevelSwitchCCStopLevelChange = (() => {
|
|
824
|
+
let _classDecorators = [(0, import_CommandClassDecorators.CCCommand)(import_Types.MultilevelSwitchCommand.StopLevelChange), (0, import_CommandClassDecorators.useSupervision)()];
|
|
825
|
+
let _classDescriptor;
|
|
826
|
+
let _classExtraInitializers = [];
|
|
827
|
+
let _classThis;
|
|
828
|
+
let _classSuper = MultilevelSwitchCC;
|
|
829
|
+
var MultilevelSwitchCCStopLevelChange2 = class extends _classSuper {
|
|
830
|
+
static {
|
|
831
|
+
_classThis = this;
|
|
832
|
+
}
|
|
833
|
+
static {
|
|
834
|
+
const _metadata = typeof Symbol === "function" && Symbol.metadata ? Object.create(_classSuper[Symbol.metadata] ?? null) : void 0;
|
|
835
|
+
__esDecorate(null, _classDescriptor = { value: _classThis }, _classDecorators, { kind: "class", name: _classThis.name, metadata: _metadata }, null, _classExtraInitializers);
|
|
836
|
+
MultilevelSwitchCCStopLevelChange2 = _classThis = _classDescriptor.value;
|
|
837
|
+
if (_metadata) Object.defineProperty(_classThis, Symbol.metadata, { enumerable: true, configurable: true, writable: true, value: _metadata });
|
|
838
|
+
__runInitializers(_classThis, _classExtraInitializers);
|
|
839
|
+
}
|
|
840
|
+
};
|
|
841
|
+
return MultilevelSwitchCCStopLevelChange2 = _classThis;
|
|
842
|
+
})();
|
|
843
|
+
let MultilevelSwitchCCSupportedReport = (() => {
|
|
844
|
+
let _classDecorators = [(0, import_CommandClassDecorators.CCCommand)(import_Types.MultilevelSwitchCommand.SupportedReport), (0, import_CommandClassDecorators.ccValueProperty)("switchType", MultilevelSwitchCCValues.switchType)];
|
|
845
|
+
let _classDescriptor;
|
|
846
|
+
let _classExtraInitializers = [];
|
|
847
|
+
let _classThis;
|
|
848
|
+
let _classSuper = MultilevelSwitchCC;
|
|
849
|
+
var MultilevelSwitchCCSupportedReport2 = class extends _classSuper {
|
|
850
|
+
static {
|
|
851
|
+
_classThis = this;
|
|
852
|
+
}
|
|
853
|
+
static {
|
|
854
|
+
const _metadata = typeof Symbol === "function" && Symbol.metadata ? Object.create(_classSuper[Symbol.metadata] ?? null) : void 0;
|
|
855
|
+
__esDecorate(null, _classDescriptor = { value: _classThis }, _classDecorators, { kind: "class", name: _classThis.name, metadata: _metadata }, null, _classExtraInitializers);
|
|
856
|
+
MultilevelSwitchCCSupportedReport2 = _classThis = _classDescriptor.value;
|
|
857
|
+
if (_metadata) Object.defineProperty(_classThis, Symbol.metadata, { enumerable: true, configurable: true, writable: true, value: _metadata });
|
|
858
|
+
__runInitializers(_classThis, _classExtraInitializers);
|
|
859
|
+
}
|
|
860
|
+
constructor(options) {
|
|
861
|
+
super(options);
|
|
862
|
+
this.switchType = options.switchType;
|
|
863
|
+
}
|
|
864
|
+
static from(raw, ctx) {
|
|
865
|
+
(0, import_safe.validatePayload)(raw.payload.length >= 1);
|
|
866
|
+
const switchType = raw.payload[0] & 31;
|
|
867
|
+
return new this({
|
|
868
|
+
nodeId: ctx.sourceNodeId,
|
|
869
|
+
switchType
|
|
870
|
+
});
|
|
871
|
+
}
|
|
872
|
+
// This is the primary switch type. We're not supporting secondary switch types
|
|
873
|
+
switchType;
|
|
874
|
+
persistValues(ctx) {
|
|
875
|
+
if (!super.persistValues(ctx))
|
|
876
|
+
return false;
|
|
877
|
+
this.createMetadataForLevelChangeActions(ctx, this.switchType);
|
|
878
|
+
return true;
|
|
879
|
+
}
|
|
880
|
+
serialize(ctx) {
|
|
881
|
+
this.payload = import_safe2.Bytes.from([this.switchType & 31]);
|
|
882
|
+
return super.serialize(ctx);
|
|
883
|
+
}
|
|
884
|
+
toLogEntry(ctx) {
|
|
885
|
+
return {
|
|
886
|
+
...super.toLogEntry(ctx),
|
|
887
|
+
message: {
|
|
888
|
+
"switch type": (0, import_safe3.getEnumMemberName)(import_Types.SwitchType, this.switchType)
|
|
889
|
+
}
|
|
890
|
+
};
|
|
891
|
+
}
|
|
892
|
+
};
|
|
893
|
+
return MultilevelSwitchCCSupportedReport2 = _classThis;
|
|
894
|
+
})();
|
|
895
|
+
let MultilevelSwitchCCSupportedGet = (() => {
|
|
896
|
+
let _classDecorators = [(0, import_CommandClassDecorators.CCCommand)(import_Types.MultilevelSwitchCommand.SupportedGet), (0, import_CommandClassDecorators.expectedCCResponse)(MultilevelSwitchCCSupportedReport)];
|
|
897
|
+
let _classDescriptor;
|
|
898
|
+
let _classExtraInitializers = [];
|
|
899
|
+
let _classThis;
|
|
900
|
+
let _classSuper = MultilevelSwitchCC;
|
|
901
|
+
var MultilevelSwitchCCSupportedGet2 = class extends _classSuper {
|
|
902
|
+
static {
|
|
903
|
+
_classThis = this;
|
|
904
|
+
}
|
|
905
|
+
static {
|
|
906
|
+
const _metadata = typeof Symbol === "function" && Symbol.metadata ? Object.create(_classSuper[Symbol.metadata] ?? null) : void 0;
|
|
907
|
+
__esDecorate(null, _classDescriptor = { value: _classThis }, _classDecorators, { kind: "class", name: _classThis.name, metadata: _metadata }, null, _classExtraInitializers);
|
|
908
|
+
MultilevelSwitchCCSupportedGet2 = _classThis = _classDescriptor.value;
|
|
909
|
+
if (_metadata) Object.defineProperty(_classThis, Symbol.metadata, { enumerable: true, configurable: true, writable: true, value: _metadata });
|
|
910
|
+
__runInitializers(_classThis, _classExtraInitializers);
|
|
911
|
+
}
|
|
912
|
+
};
|
|
913
|
+
return MultilevelSwitchCCSupportedGet2 = _classThis;
|
|
914
|
+
})();
|
|
767
915
|
// Annotate the CommonJS export names for ESM import in node:
|
|
768
916
|
0 && (module.exports = {
|
|
769
917
|
MultilevelSwitchCC,
|