@zwave-js/cc 14.0.0-beta.4 → 14.0.0-beta.5
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 BinarySwitchCCSet_1, BinarySwitchCCReport_1;
|
|
8
35
|
function __assertType(argName, typeName, boundHasError) {
|
|
9
36
|
const { ZWaveError, ZWaveErrorCodes } = require("@zwave-js/core");
|
|
10
37
|
if (boundHasError()) {
|
|
@@ -47,7 +74,7 @@ import { CommandClasses, Duration, MessagePriority, UNKNOWN_STATE, ValueMetadata
|
|
|
47
74
|
import { Bytes } from "@zwave-js/shared/safe";
|
|
48
75
|
import { CCAPI, POLL_VALUE, SET_VALUE, SET_VALUE_HOOKS, throwUnsupportedProperty, throwWrongValueType, } from "../lib/API.js";
|
|
49
76
|
import { CommandClass, getEffectiveCCVersion, } from "../lib/CommandClass.js";
|
|
50
|
-
import { API, CCCommand,
|
|
77
|
+
import { API, CCCommand, ccValueProperty, ccValues, commandClass, expectedCCResponse, implementedVersion, useSupervision, } from "../lib/CommandClassDecorators.js";
|
|
51
78
|
import { V } from "../lib/Values.js";
|
|
52
79
|
import { BinarySwitchCommand } from "../lib/_Types.js";
|
|
53
80
|
export const BinarySwitchCCValues = Object.freeze({
|
|
@@ -67,296 +94,348 @@ export const BinarySwitchCCValues = Object.freeze({
|
|
|
67
94
|
}, { minVersion: 2 }),
|
|
68
95
|
}),
|
|
69
96
|
});
|
|
70
|
-
let BinarySwitchCCAPI =
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
97
|
+
let BinarySwitchCCAPI = (() => {
|
|
98
|
+
let _classDecorators = [API(CommandClasses["Binary Switch"])];
|
|
99
|
+
let _classDescriptor;
|
|
100
|
+
let _classExtraInitializers = [];
|
|
101
|
+
let _classThis;
|
|
102
|
+
let _classSuper = CCAPI;
|
|
103
|
+
var BinarySwitchCCAPI = class extends _classSuper {
|
|
104
|
+
static { _classThis = this; }
|
|
105
|
+
static {
|
|
106
|
+
const _metadata = typeof Symbol === "function" && Symbol.metadata ? Object.create(_classSuper[Symbol.metadata] ?? null) : void 0;
|
|
107
|
+
__esDecorate(null, _classDescriptor = { value: _classThis }, _classDecorators, { kind: "class", name: _classThis.name, metadata: _metadata }, null, _classExtraInitializers);
|
|
108
|
+
BinarySwitchCCAPI = _classThis = _classDescriptor.value;
|
|
109
|
+
if (_metadata) Object.defineProperty(_classThis, Symbol.metadata, { enumerable: true, configurable: true, writable: true, value: _metadata });
|
|
110
|
+
__runInitializers(_classThis, _classExtraInitializers);
|
|
77
111
|
}
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
});
|
|
87
|
-
const response = await this.host.sendCommand(cc, this.commandOptions);
|
|
88
|
-
if (response) {
|
|
89
|
-
return {
|
|
90
|
-
// interpret unknown values as false
|
|
91
|
-
currentValue: response.currentValue || false,
|
|
92
|
-
targetValue: response.targetValue,
|
|
93
|
-
duration: response.duration,
|
|
94
|
-
};
|
|
112
|
+
supportsCommand(cmd) {
|
|
113
|
+
switch (cmd) {
|
|
114
|
+
case BinarySwitchCommand.Get:
|
|
115
|
+
return this.isSinglecast();
|
|
116
|
+
case BinarySwitchCommand.Set:
|
|
117
|
+
return true;
|
|
118
|
+
}
|
|
119
|
+
return super.supportsCommand(cmd);
|
|
95
120
|
}
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
});
|
|
112
|
-
return this.host.sendCommand(cc, this.commandOptions);
|
|
113
|
-
}
|
|
114
|
-
get [SET_VALUE]() {
|
|
115
|
-
return async function ({ property }, value, options) {
|
|
116
|
-
if (property !== "targetValue") {
|
|
117
|
-
throwUnsupportedProperty(this.ccId, property);
|
|
121
|
+
// eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types
|
|
122
|
+
async get() {
|
|
123
|
+
this.assertSupportsCommand(BinarySwitchCommand, BinarySwitchCommand.Get);
|
|
124
|
+
const cc = new BinarySwitchCCGet({
|
|
125
|
+
nodeId: this.endpoint.nodeId,
|
|
126
|
+
endpointIndex: this.endpoint.index,
|
|
127
|
+
});
|
|
128
|
+
const response = await this.host.sendCommand(cc, this.commandOptions);
|
|
129
|
+
if (response) {
|
|
130
|
+
return {
|
|
131
|
+
// interpret unknown values as false
|
|
132
|
+
currentValue: response.currentValue || false,
|
|
133
|
+
targetValue: response.targetValue,
|
|
134
|
+
duration: response.duration,
|
|
135
|
+
};
|
|
118
136
|
}
|
|
119
|
-
|
|
120
|
-
|
|
137
|
+
}
|
|
138
|
+
/**
|
|
139
|
+
* Sets the switch to the given value
|
|
140
|
+
* @param targetValue The target value to set
|
|
141
|
+
* @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.
|
|
142
|
+
*/
|
|
143
|
+
async set(targetValue, duration) {
|
|
144
|
+
__assertType("targetValue", "boolean", __assertType__boolean.bind(void 0, targetValue));
|
|
145
|
+
__assertType("duration", undefined, __assertType__optional_su__string__2_eu.bind(void 0, duration));
|
|
146
|
+
this.assertSupportsCommand(BinarySwitchCommand, BinarySwitchCommand.Set);
|
|
147
|
+
const cc = new BinarySwitchCCSet({
|
|
148
|
+
nodeId: this.endpoint.nodeId,
|
|
149
|
+
endpointIndex: this.endpoint.index,
|
|
150
|
+
targetValue,
|
|
151
|
+
duration,
|
|
152
|
+
});
|
|
153
|
+
return this.host.sendCommand(cc, this.commandOptions);
|
|
154
|
+
}
|
|
155
|
+
get [SET_VALUE]() {
|
|
156
|
+
return async function ({ property }, value, options) {
|
|
157
|
+
if (property !== "targetValue") {
|
|
158
|
+
throwUnsupportedProperty(this.ccId, property);
|
|
159
|
+
}
|
|
160
|
+
if (typeof value !== "boolean") {
|
|
161
|
+
throwWrongValueType(this.ccId, property, "boolean", typeof value);
|
|
162
|
+
}
|
|
163
|
+
const duration = Duration.from(options?.transitionDuration);
|
|
164
|
+
return this.set(value, duration);
|
|
165
|
+
};
|
|
166
|
+
}
|
|
167
|
+
[SET_VALUE_HOOKS] = ({ property }, value, options) => {
|
|
168
|
+
if (property === "targetValue") {
|
|
169
|
+
const currentValueValueId = BinarySwitchCCValues.currentValue
|
|
170
|
+
.endpoint(this.endpoint.index);
|
|
171
|
+
return {
|
|
172
|
+
optimisticallyUpdateRelatedValues: (_supervisedAndSuccessful) => {
|
|
173
|
+
// After setting targetValue, optimistically update currentValue
|
|
174
|
+
if (this.isSinglecast()) {
|
|
175
|
+
this.tryGetValueDB()?.setValue(currentValueValueId, value);
|
|
176
|
+
}
|
|
177
|
+
else if (this.isMulticast()) {
|
|
178
|
+
// Figure out which nodes were affected by this command
|
|
179
|
+
const affectedNodes = this.endpoint.node.physicalNodes
|
|
180
|
+
.filter((node) => node
|
|
181
|
+
.getEndpoint(this.endpoint.index)
|
|
182
|
+
?.supportsCC(this.ccId));
|
|
183
|
+
// and optimistically update the currentValue
|
|
184
|
+
for (const node of affectedNodes) {
|
|
185
|
+
this.host
|
|
186
|
+
.tryGetValueDB(node.id)
|
|
187
|
+
?.setValue(currentValueValueId, value);
|
|
188
|
+
}
|
|
189
|
+
}
|
|
190
|
+
},
|
|
191
|
+
verifyChanges: () => {
|
|
192
|
+
if (this.isSinglecast()) {
|
|
193
|
+
// We query currentValue instead of targetValue to make sure that unsolicited updates cancel the scheduled poll
|
|
194
|
+
this.schedulePoll(currentValueValueId, value, {
|
|
195
|
+
duration: Duration.from(options?.transitionDuration),
|
|
196
|
+
// on/off "transitions" are usually fast
|
|
197
|
+
transition: "fast",
|
|
198
|
+
});
|
|
199
|
+
}
|
|
200
|
+
else {
|
|
201
|
+
// For multicasts, do not schedule a refresh - this could cause a LOT of traffic
|
|
202
|
+
}
|
|
203
|
+
},
|
|
204
|
+
};
|
|
121
205
|
}
|
|
122
|
-
const duration = Duration.from(options?.transitionDuration);
|
|
123
|
-
return this.set(value, duration);
|
|
124
206
|
};
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
}
|
|
136
|
-
else if (this.isMulticast()) {
|
|
137
|
-
// Figure out which nodes were affected by this command
|
|
138
|
-
const affectedNodes = this.endpoint.node.physicalNodes
|
|
139
|
-
.filter((node) => node
|
|
140
|
-
.getEndpoint(this.endpoint.index)
|
|
141
|
-
?.supportsCC(this.ccId));
|
|
142
|
-
// and optimistically update the currentValue
|
|
143
|
-
for (const node of affectedNodes) {
|
|
144
|
-
this.host
|
|
145
|
-
.tryGetValueDB(node.id)
|
|
146
|
-
?.setValue(currentValueValueId, value);
|
|
147
|
-
}
|
|
148
|
-
}
|
|
149
|
-
},
|
|
150
|
-
verifyChanges: () => {
|
|
151
|
-
if (this.isSinglecast()) {
|
|
152
|
-
// We query currentValue instead of targetValue to make sure that unsolicited updates cancel the scheduled poll
|
|
153
|
-
this.schedulePoll(currentValueValueId, value, {
|
|
154
|
-
duration: Duration.from(options?.transitionDuration),
|
|
155
|
-
// on/off "transitions" are usually fast
|
|
156
|
-
transition: "fast",
|
|
157
|
-
});
|
|
158
|
-
}
|
|
159
|
-
else {
|
|
160
|
-
// For multicasts, do not schedule a refresh - this could cause a LOT of traffic
|
|
161
|
-
}
|
|
162
|
-
},
|
|
207
|
+
get [POLL_VALUE]() {
|
|
208
|
+
return async function ({ property }) {
|
|
209
|
+
switch (property) {
|
|
210
|
+
case "currentValue":
|
|
211
|
+
case "targetValue":
|
|
212
|
+
case "duration":
|
|
213
|
+
return (await this.get())?.[property];
|
|
214
|
+
default:
|
|
215
|
+
throwUnsupportedProperty(this.ccId, property);
|
|
216
|
+
}
|
|
163
217
|
};
|
|
164
218
|
}
|
|
165
219
|
};
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
switch (property) {
|
|
169
|
-
case "currentValue":
|
|
170
|
-
case "targetValue":
|
|
171
|
-
case "duration":
|
|
172
|
-
return (await this.get())?.[property];
|
|
173
|
-
default:
|
|
174
|
-
throwUnsupportedProperty(this.ccId, property);
|
|
175
|
-
}
|
|
176
|
-
};
|
|
177
|
-
}
|
|
178
|
-
};
|
|
179
|
-
BinarySwitchCCAPI = __decorate([
|
|
180
|
-
API(CommandClasses["Binary Switch"])
|
|
181
|
-
], BinarySwitchCCAPI);
|
|
220
|
+
return BinarySwitchCCAPI = _classThis;
|
|
221
|
+
})();
|
|
182
222
|
export { BinarySwitchCCAPI };
|
|
183
|
-
let BinarySwitchCC =
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
}
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
223
|
+
let BinarySwitchCC = (() => {
|
|
224
|
+
let _classDecorators = [commandClass(CommandClasses["Binary Switch"]), implementedVersion(2), ccValues(BinarySwitchCCValues)];
|
|
225
|
+
let _classDescriptor;
|
|
226
|
+
let _classExtraInitializers = [];
|
|
227
|
+
let _classThis;
|
|
228
|
+
let _classSuper = CommandClass;
|
|
229
|
+
var BinarySwitchCC = class extends _classSuper {
|
|
230
|
+
static { _classThis = this; }
|
|
231
|
+
static {
|
|
232
|
+
const _metadata = typeof Symbol === "function" && Symbol.metadata ? Object.create(_classSuper[Symbol.metadata] ?? null) : void 0;
|
|
233
|
+
__esDecorate(null, _classDescriptor = { value: _classThis }, _classDecorators, { kind: "class", name: _classThis.name, metadata: _metadata }, null, _classExtraInitializers);
|
|
234
|
+
BinarySwitchCC = _classThis = _classDescriptor.value;
|
|
235
|
+
if (_metadata) Object.defineProperty(_classThis, Symbol.metadata, { enumerable: true, configurable: true, writable: true, value: _metadata });
|
|
236
|
+
__runInitializers(_classThis, _classExtraInitializers);
|
|
237
|
+
}
|
|
238
|
+
async interview(ctx) {
|
|
239
|
+
const node = this.getNode(ctx);
|
|
240
|
+
ctx.logNode(node.id, {
|
|
241
|
+
endpoint: this.endpointIndex,
|
|
242
|
+
message: `Interviewing ${this.ccName}...`,
|
|
243
|
+
direction: "none",
|
|
244
|
+
});
|
|
245
|
+
await this.refreshValues(ctx);
|
|
246
|
+
// Remember that the interview is complete
|
|
247
|
+
this.setInterviewComplete(ctx, true);
|
|
248
|
+
}
|
|
249
|
+
async refreshValues(ctx) {
|
|
250
|
+
const node = this.getNode(ctx);
|
|
251
|
+
const endpoint = this.getEndpoint(ctx);
|
|
252
|
+
const api = CCAPI.create(CommandClasses["Binary Switch"], ctx, endpoint).withOptions({
|
|
253
|
+
priority: MessagePriority.NodeQuery,
|
|
254
|
+
});
|
|
255
|
+
// Query the current state
|
|
256
|
+
ctx.logNode(node.id, {
|
|
257
|
+
endpoint: this.endpointIndex,
|
|
258
|
+
message: "querying Binary Switch state...",
|
|
259
|
+
direction: "outbound",
|
|
260
|
+
});
|
|
261
|
+
const resp = await api.get();
|
|
262
|
+
if (resp) {
|
|
263
|
+
let logMessage = `received Binary Switch state:
|
|
210
264
|
current value: ${resp.currentValue}`;
|
|
211
|
-
|
|
212
|
-
|
|
265
|
+
if (resp.targetValue != undefined) {
|
|
266
|
+
logMessage += `
|
|
213
267
|
target value: ${resp.targetValue}
|
|
214
268
|
remaining duration: ${resp.duration?.toString() ?? "undefined"}`;
|
|
269
|
+
}
|
|
270
|
+
ctx.logNode(node.id, {
|
|
271
|
+
endpoint: this.endpointIndex,
|
|
272
|
+
message: logMessage,
|
|
273
|
+
direction: "inbound",
|
|
274
|
+
});
|
|
215
275
|
}
|
|
216
|
-
ctx.logNode(node.id, {
|
|
217
|
-
endpoint: this.endpointIndex,
|
|
218
|
-
message: logMessage,
|
|
219
|
-
direction: "inbound",
|
|
220
|
-
});
|
|
221
276
|
}
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
}
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
commandClass(CommandClasses["Binary Switch"]),
|
|
230
|
-
implementedVersion(2),
|
|
231
|
-
ccValues(BinarySwitchCCValues)
|
|
232
|
-
], BinarySwitchCC);
|
|
277
|
+
setMappedBasicValue(ctx, value) {
|
|
278
|
+
this.setValue(ctx, BinarySwitchCCValues.currentValue, value > 0);
|
|
279
|
+
return true;
|
|
280
|
+
}
|
|
281
|
+
};
|
|
282
|
+
return BinarySwitchCC = _classThis;
|
|
283
|
+
})();
|
|
233
284
|
export { BinarySwitchCC };
|
|
234
|
-
let BinarySwitchCCSet =
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
285
|
+
let BinarySwitchCCSet = (() => {
|
|
286
|
+
let _classDecorators = [CCCommand(BinarySwitchCommand.Set), useSupervision()];
|
|
287
|
+
let _classDescriptor;
|
|
288
|
+
let _classExtraInitializers = [];
|
|
289
|
+
let _classThis;
|
|
290
|
+
let _classSuper = BinarySwitchCC;
|
|
291
|
+
var BinarySwitchCCSet = class extends _classSuper {
|
|
292
|
+
static { _classThis = this; }
|
|
293
|
+
static {
|
|
294
|
+
const _metadata = typeof Symbol === "function" && Symbol.metadata ? Object.create(_classSuper[Symbol.metadata] ?? null) : void 0;
|
|
295
|
+
__esDecorate(null, _classDescriptor = { value: _classThis }, _classDecorators, { kind: "class", name: _classThis.name, metadata: _metadata }, null, _classExtraInitializers);
|
|
296
|
+
BinarySwitchCCSet = _classThis = _classDescriptor.value;
|
|
297
|
+
if (_metadata) Object.defineProperty(_classThis, Symbol.metadata, { enumerable: true, configurable: true, writable: true, value: _metadata });
|
|
298
|
+
__runInitializers(_classThis, _classExtraInitializers);
|
|
246
299
|
}
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
targetValue
|
|
250
|
-
duration
|
|
251
|
-
});
|
|
252
|
-
}
|
|
253
|
-
targetValue;
|
|
254
|
-
duration;
|
|
255
|
-
serialize(ctx) {
|
|
256
|
-
this.payload = Bytes.from([
|
|
257
|
-
this.targetValue ? 0xff : 0x00,
|
|
258
|
-
(this.duration ?? Duration.default()).serializeSet(),
|
|
259
|
-
]);
|
|
260
|
-
const ccVersion = getEffectiveCCVersion(ctx, this);
|
|
261
|
-
if (ccVersion < 2 && ctx.getDeviceConfig?.(this.nodeId)?.compat?.encodeCCsUsingTargetVersion) {
|
|
262
|
-
// When forcing CC version 1, only send the target value
|
|
263
|
-
this.payload = this.payload.subarray(0, 1);
|
|
300
|
+
constructor(options) {
|
|
301
|
+
super(options);
|
|
302
|
+
this.targetValue = options.targetValue;
|
|
303
|
+
this.duration = Duration.from(options.duration);
|
|
264
304
|
}
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
305
|
+
static from(raw, ctx) {
|
|
306
|
+
validatePayload(raw.payload.length >= 1);
|
|
307
|
+
const targetValue = !!raw.payload[0];
|
|
308
|
+
let duration;
|
|
309
|
+
if (raw.payload.length >= 2) {
|
|
310
|
+
duration = Duration.parseSet(raw.payload[1]);
|
|
311
|
+
}
|
|
312
|
+
return new this({
|
|
313
|
+
nodeId: ctx.sourceNodeId,
|
|
314
|
+
targetValue,
|
|
315
|
+
duration,
|
|
316
|
+
});
|
|
273
317
|
}
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
318
|
+
targetValue;
|
|
319
|
+
duration;
|
|
320
|
+
serialize(ctx) {
|
|
321
|
+
this.payload = Bytes.from([
|
|
322
|
+
this.targetValue ? 0xff : 0x00,
|
|
323
|
+
(this.duration ?? Duration.default()).serializeSet(),
|
|
324
|
+
]);
|
|
325
|
+
const ccVersion = getEffectiveCCVersion(ctx, this);
|
|
326
|
+
if (ccVersion < 2 && ctx.getDeviceConfig?.(this.nodeId)?.compat?.encodeCCsUsingTargetVersion) {
|
|
327
|
+
// When forcing CC version 1, only send the target value
|
|
328
|
+
this.payload = this.payload.subarray(0, 1);
|
|
329
|
+
}
|
|
330
|
+
return super.serialize(ctx);
|
|
331
|
+
}
|
|
332
|
+
toLogEntry(ctx) {
|
|
333
|
+
const message = {
|
|
334
|
+
"target value": this.targetValue,
|
|
335
|
+
};
|
|
336
|
+
if (this.duration != undefined) {
|
|
337
|
+
message.duration = this.duration.toString();
|
|
338
|
+
}
|
|
339
|
+
return {
|
|
340
|
+
...super.toLogEntry(ctx),
|
|
341
|
+
message,
|
|
342
|
+
};
|
|
343
|
+
}
|
|
344
|
+
};
|
|
345
|
+
return BinarySwitchCCSet = _classThis;
|
|
346
|
+
})();
|
|
284
347
|
export { BinarySwitchCCSet };
|
|
285
|
-
let BinarySwitchCCReport =
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
duration = Duration.parseReport(raw.payload[2]);
|
|
348
|
+
let BinarySwitchCCReport = (() => {
|
|
349
|
+
let _classDecorators = [CCCommand(BinarySwitchCommand.Report), ccValueProperty("currentValue", BinarySwitchCCValues.currentValue), ccValueProperty("targetValue", BinarySwitchCCValues.targetValue), ccValueProperty("duration", BinarySwitchCCValues.duration)];
|
|
350
|
+
let _classDescriptor;
|
|
351
|
+
let _classExtraInitializers = [];
|
|
352
|
+
let _classThis;
|
|
353
|
+
let _classSuper = BinarySwitchCC;
|
|
354
|
+
var BinarySwitchCCReport = class extends _classSuper {
|
|
355
|
+
static { _classThis = this; }
|
|
356
|
+
static {
|
|
357
|
+
const _metadata = typeof Symbol === "function" && Symbol.metadata ? Object.create(_classSuper[Symbol.metadata] ?? null) : void 0;
|
|
358
|
+
__esDecorate(null, _classDescriptor = { value: _classThis }, _classDecorators, { kind: "class", name: _classThis.name, metadata: _metadata }, null, _classExtraInitializers);
|
|
359
|
+
BinarySwitchCCReport = _classThis = _classDescriptor.value;
|
|
360
|
+
if (_metadata) Object.defineProperty(_classThis, Symbol.metadata, { enumerable: true, configurable: true, writable: true, value: _metadata });
|
|
361
|
+
__runInitializers(_classThis, _classExtraInitializers);
|
|
300
362
|
}
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
currentValue
|
|
304
|
-
targetValue
|
|
305
|
-
duration
|
|
306
|
-
});
|
|
307
|
-
}
|
|
308
|
-
currentValue;
|
|
309
|
-
targetValue;
|
|
310
|
-
duration;
|
|
311
|
-
serialize(ctx) {
|
|
312
|
-
this.payload = Bytes.from([
|
|
313
|
-
encodeMaybeBoolean(this.currentValue ?? UNKNOWN_STATE),
|
|
314
|
-
]);
|
|
315
|
-
if (this.targetValue !== undefined) {
|
|
316
|
-
this.payload = Bytes.concat([
|
|
317
|
-
this.payload,
|
|
318
|
-
Bytes.from([
|
|
319
|
-
encodeMaybeBoolean(this.targetValue),
|
|
320
|
-
(this.duration ?? Duration.default()).serializeReport(),
|
|
321
|
-
]),
|
|
322
|
-
]);
|
|
363
|
+
constructor(options) {
|
|
364
|
+
super(options);
|
|
365
|
+
this.currentValue = options.currentValue;
|
|
366
|
+
this.targetValue = options.targetValue;
|
|
367
|
+
this.duration = Duration.from(options.duration);
|
|
323
368
|
}
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
369
|
+
static from(raw, ctx) {
|
|
370
|
+
validatePayload(raw.payload.length >= 1);
|
|
371
|
+
const currentValue = parseMaybeBoolean(raw.payload[0]);
|
|
372
|
+
let targetValue;
|
|
373
|
+
let duration;
|
|
374
|
+
if (raw.payload.length >= 3) {
|
|
375
|
+
targetValue = parseMaybeBoolean(raw.payload[1]);
|
|
376
|
+
duration = Duration.parseReport(raw.payload[2]);
|
|
377
|
+
}
|
|
378
|
+
return new this({
|
|
379
|
+
nodeId: ctx.sourceNodeId,
|
|
380
|
+
currentValue,
|
|
381
|
+
targetValue,
|
|
382
|
+
duration,
|
|
383
|
+
});
|
|
332
384
|
}
|
|
333
|
-
|
|
334
|
-
|
|
385
|
+
currentValue;
|
|
386
|
+
targetValue;
|
|
387
|
+
duration;
|
|
388
|
+
serialize(ctx) {
|
|
389
|
+
this.payload = Bytes.from([
|
|
390
|
+
encodeMaybeBoolean(this.currentValue ?? UNKNOWN_STATE),
|
|
391
|
+
]);
|
|
392
|
+
if (this.targetValue !== undefined) {
|
|
393
|
+
this.payload = Bytes.concat([
|
|
394
|
+
this.payload,
|
|
395
|
+
Bytes.from([
|
|
396
|
+
encodeMaybeBoolean(this.targetValue),
|
|
397
|
+
(this.duration ?? Duration.default()).serializeReport(),
|
|
398
|
+
]),
|
|
399
|
+
]);
|
|
400
|
+
}
|
|
401
|
+
return super.serialize(ctx);
|
|
335
402
|
}
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
403
|
+
toLogEntry(ctx) {
|
|
404
|
+
const message = {
|
|
405
|
+
"current value": maybeUnknownToString(this.currentValue),
|
|
406
|
+
};
|
|
407
|
+
if (this.targetValue !== undefined) {
|
|
408
|
+
message["target value"] = maybeUnknownToString(this.targetValue);
|
|
409
|
+
}
|
|
410
|
+
if (this.duration != undefined) {
|
|
411
|
+
message.duration = this.duration.toString();
|
|
412
|
+
}
|
|
413
|
+
return {
|
|
414
|
+
...super.toLogEntry(ctx),
|
|
415
|
+
message,
|
|
416
|
+
};
|
|
417
|
+
}
|
|
418
|
+
};
|
|
419
|
+
return BinarySwitchCCReport = _classThis;
|
|
420
|
+
})();
|
|
354
421
|
export { BinarySwitchCCReport };
|
|
355
|
-
let BinarySwitchCCGet =
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
|
|
422
|
+
let BinarySwitchCCGet = (() => {
|
|
423
|
+
let _classDecorators = [CCCommand(BinarySwitchCommand.Get), expectedCCResponse(BinarySwitchCCReport)];
|
|
424
|
+
let _classDescriptor;
|
|
425
|
+
let _classExtraInitializers = [];
|
|
426
|
+
let _classThis;
|
|
427
|
+
let _classSuper = BinarySwitchCC;
|
|
428
|
+
var BinarySwitchCCGet = class extends _classSuper {
|
|
429
|
+
static { _classThis = this; }
|
|
430
|
+
static {
|
|
431
|
+
const _metadata = typeof Symbol === "function" && Symbol.metadata ? Object.create(_classSuper[Symbol.metadata] ?? null) : void 0;
|
|
432
|
+
__esDecorate(null, _classDescriptor = { value: _classThis }, _classDecorators, { kind: "class", name: _classThis.name, metadata: _metadata }, null, _classExtraInitializers);
|
|
433
|
+
BinarySwitchCCGet = _classThis = _classDescriptor.value;
|
|
434
|
+
if (_metadata) Object.defineProperty(_classThis, Symbol.metadata, { enumerable: true, configurable: true, writable: true, value: _metadata });
|
|
435
|
+
__runInitializers(_classThis, _classExtraInitializers);
|
|
436
|
+
}
|
|
437
|
+
};
|
|
438
|
+
return BinarySwitchCCGet = _classThis;
|
|
439
|
+
})();
|
|
361
440
|
export { BinarySwitchCCGet };
|
|
362
441
|
//# sourceMappingURL=BinarySwitchCC.js.map
|