@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
package/build/esm/cc/BasicCC.js
CHANGED
|
@@ -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 BasicCCSet_1, BasicCCReport_1;
|
|
8
35
|
function __assertType(argName, typeName, boundHasError) {
|
|
9
36
|
const { ZWaveError, ZWaveErrorCodes } = require("@zwave-js/core");
|
|
10
37
|
if (boundHasError()) {
|
|
@@ -22,7 +49,7 @@ import { Bytes } from "@zwave-js/shared/safe";
|
|
|
22
49
|
import { pick } from "@zwave-js/shared/safe";
|
|
23
50
|
import { CCAPI, POLL_VALUE, SET_VALUE, SET_VALUE_HOOKS, throwUnsupportedProperty, throwWrongValueType, } from "../lib/API.js";
|
|
24
51
|
import { CommandClass, getEffectiveCCVersion, } from "../lib/CommandClass.js";
|
|
25
|
-
import { API, CCCommand,
|
|
52
|
+
import { API, CCCommand, ccValueProperty, ccValues, commandClass, expectedCCResponse, implementedVersion, useSupervision, } from "../lib/CommandClassDecorators.js";
|
|
26
53
|
import { V } from "../lib/Values.js";
|
|
27
54
|
import { BasicCommand } from "../lib/_Types.js";
|
|
28
55
|
export const BasicCCValues = Object.freeze({
|
|
@@ -57,334 +84,385 @@ export const BasicCCValues = Object.freeze({
|
|
|
57
84
|
}),
|
|
58
85
|
}),
|
|
59
86
|
});
|
|
60
|
-
let BasicCCAPI =
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
87
|
+
let BasicCCAPI = (() => {
|
|
88
|
+
let _classDecorators = [API(CommandClasses.Basic)];
|
|
89
|
+
let _classDescriptor;
|
|
90
|
+
let _classExtraInitializers = [];
|
|
91
|
+
let _classThis;
|
|
92
|
+
let _classSuper = CCAPI;
|
|
93
|
+
var BasicCCAPI = class extends _classSuper {
|
|
94
|
+
static { _classThis = this; }
|
|
95
|
+
static {
|
|
96
|
+
const _metadata = typeof Symbol === "function" && Symbol.metadata ? Object.create(_classSuper[Symbol.metadata] ?? null) : void 0;
|
|
97
|
+
__esDecorate(null, _classDescriptor = { value: _classThis }, _classDecorators, { kind: "class", name: _classThis.name, metadata: _metadata }, null, _classExtraInitializers);
|
|
98
|
+
BasicCCAPI = _classThis = _classDescriptor.value;
|
|
99
|
+
if (_metadata) Object.defineProperty(_classThis, Symbol.metadata, { enumerable: true, configurable: true, writable: true, value: _metadata });
|
|
100
|
+
__runInitializers(_classThis, _classExtraInitializers);
|
|
67
101
|
}
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
102
|
+
supportsCommand(cmd) {
|
|
103
|
+
switch (cmd) {
|
|
104
|
+
case BasicCommand.Get:
|
|
105
|
+
return this.isSinglecast();
|
|
106
|
+
case BasicCommand.Set:
|
|
107
|
+
return true;
|
|
108
|
+
}
|
|
109
|
+
return super.supportsCommand(cmd);
|
|
110
|
+
}
|
|
111
|
+
get [SET_VALUE]() {
|
|
112
|
+
return async function ({ property }, value) {
|
|
113
|
+
// Enable restoring the previous non-zero value
|
|
114
|
+
if (property === "restorePrevious") {
|
|
115
|
+
property = "targetValue";
|
|
116
|
+
value = 255;
|
|
117
|
+
}
|
|
118
|
+
if (property !== "targetValue") {
|
|
119
|
+
throwUnsupportedProperty(this.ccId, property);
|
|
120
|
+
}
|
|
121
|
+
if (typeof value !== "number") {
|
|
122
|
+
throwWrongValueType(this.ccId, property, "number", typeof value);
|
|
123
|
+
}
|
|
124
|
+
return this.set(value);
|
|
125
|
+
};
|
|
126
|
+
}
|
|
127
|
+
[SET_VALUE_HOOKS] = ({ property }, value, _options) => {
|
|
72
128
|
// Enable restoring the previous non-zero value
|
|
73
129
|
if (property === "restorePrevious") {
|
|
74
130
|
property = "targetValue";
|
|
75
131
|
value = 255;
|
|
76
132
|
}
|
|
77
|
-
if (property
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
if (this.isSinglecast()) {
|
|
101
|
-
this.tryGetValueDB()?.setValue(currentValueValueId, value);
|
|
102
|
-
}
|
|
103
|
-
else if (this.isMulticast()) {
|
|
104
|
-
// Figure out which nodes were affected by this command
|
|
105
|
-
const affectedNodes = this.endpoint.node
|
|
106
|
-
.physicalNodes.filter((node) => node
|
|
107
|
-
.getEndpoint(this.endpoint.index)
|
|
108
|
-
?.supportsCC(this.ccId));
|
|
109
|
-
// and optimistically update the currentValue
|
|
110
|
-
for (const node of affectedNodes) {
|
|
111
|
-
this.host
|
|
112
|
-
.tryGetValueDB(node.id)
|
|
113
|
-
?.setValue(currentValueValueId, value);
|
|
133
|
+
if (property === "targetValue") {
|
|
134
|
+
const currentValueValueId = BasicCCValues.currentValue.endpoint(this.endpoint.index);
|
|
135
|
+
return {
|
|
136
|
+
optimisticallyUpdateRelatedValues: (_supervisedAndSuccessful) => {
|
|
137
|
+
// Only update currentValue for valid target values
|
|
138
|
+
if (typeof value === "number"
|
|
139
|
+
&& value >= 0
|
|
140
|
+
&& value <= 99) {
|
|
141
|
+
if (this.isSinglecast()) {
|
|
142
|
+
this.tryGetValueDB()?.setValue(currentValueValueId, value);
|
|
143
|
+
}
|
|
144
|
+
else if (this.isMulticast()) {
|
|
145
|
+
// Figure out which nodes were affected by this command
|
|
146
|
+
const affectedNodes = this.endpoint.node
|
|
147
|
+
.physicalNodes.filter((node) => node
|
|
148
|
+
.getEndpoint(this.endpoint.index)
|
|
149
|
+
?.supportsCC(this.ccId));
|
|
150
|
+
// and optimistically update the currentValue
|
|
151
|
+
for (const node of affectedNodes) {
|
|
152
|
+
this.host
|
|
153
|
+
.tryGetValueDB(node.id)
|
|
154
|
+
?.setValue(currentValueValueId, value);
|
|
155
|
+
}
|
|
114
156
|
}
|
|
115
157
|
}
|
|
116
|
-
}
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
}
|
|
130
|
-
}
|
|
158
|
+
},
|
|
159
|
+
forceVerifyChanges: () => {
|
|
160
|
+
// If we don't know the actual value, we need to verify the change, regardless of the supervision result
|
|
161
|
+
return value === 255;
|
|
162
|
+
},
|
|
163
|
+
verifyChanges: () => {
|
|
164
|
+
if (this.isSinglecast()
|
|
165
|
+
// We generally don't want to poll for multicasts because of how much traffic it can cause
|
|
166
|
+
// However, when setting the value 255 (ON), we don't know the actual state
|
|
167
|
+
|| (this.isMulticast() && value === 255)) {
|
|
168
|
+
// We query currentValue instead of targetValue to make sure that unsolicited updates cancel the scheduled poll
|
|
169
|
+
this.schedulePoll(currentValueValueId, value === 255 ? undefined : value);
|
|
170
|
+
}
|
|
171
|
+
},
|
|
172
|
+
};
|
|
173
|
+
}
|
|
174
|
+
};
|
|
175
|
+
get [POLL_VALUE]() {
|
|
176
|
+
return async function ({ property }) {
|
|
177
|
+
switch (property) {
|
|
178
|
+
case "currentValue":
|
|
179
|
+
case "targetValue":
|
|
180
|
+
case "duration":
|
|
181
|
+
return (await this.get())?.[property];
|
|
182
|
+
default:
|
|
183
|
+
throwUnsupportedProperty(this.ccId, property);
|
|
184
|
+
}
|
|
131
185
|
};
|
|
132
186
|
}
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
187
|
+
// eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types
|
|
188
|
+
async get() {
|
|
189
|
+
this.assertSupportsCommand(BasicCommand, BasicCommand.Get);
|
|
190
|
+
const cc = new BasicCCGet({
|
|
191
|
+
nodeId: this.endpoint.nodeId,
|
|
192
|
+
endpointIndex: this.endpoint.index,
|
|
193
|
+
});
|
|
194
|
+
const response = await this.host.sendCommand(cc, this.commandOptions);
|
|
195
|
+
if (response) {
|
|
196
|
+
this.tryGetValueDB()?.setValue(BasicCCValues.currentValue.endpoint(this.endpoint.index), response.currentValue);
|
|
197
|
+
return pick(response, ["currentValue", "targetValue", "duration"]);
|
|
143
198
|
}
|
|
144
|
-
};
|
|
145
|
-
}
|
|
146
|
-
// eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types
|
|
147
|
-
async get() {
|
|
148
|
-
this.assertSupportsCommand(BasicCommand, BasicCommand.Get);
|
|
149
|
-
const cc = new BasicCCGet({
|
|
150
|
-
nodeId: this.endpoint.nodeId,
|
|
151
|
-
endpointIndex: this.endpoint.index,
|
|
152
|
-
});
|
|
153
|
-
const response = await this.host.sendCommand(cc, this.commandOptions);
|
|
154
|
-
if (response) {
|
|
155
|
-
this.tryGetValueDB()?.setValue(BasicCCValues.currentValue.endpoint(this.endpoint.index), response.currentValue);
|
|
156
|
-
return pick(response, ["currentValue", "targetValue", "duration"]);
|
|
157
199
|
}
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
}
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
API(CommandClasses.Basic)
|
|
172
|
-
], BasicCCAPI);
|
|
200
|
+
async set(targetValue) {
|
|
201
|
+
__assertType("targetValue", "number", __assertType__number.bind(void 0, targetValue));
|
|
202
|
+
this.assertSupportsCommand(BasicCommand, BasicCommand.Set);
|
|
203
|
+
const cc = new BasicCCSet({
|
|
204
|
+
nodeId: this.endpoint.nodeId,
|
|
205
|
+
endpointIndex: this.endpoint.index,
|
|
206
|
+
targetValue,
|
|
207
|
+
});
|
|
208
|
+
return this.host.sendCommand(cc, this.commandOptions);
|
|
209
|
+
}
|
|
210
|
+
};
|
|
211
|
+
return BasicCCAPI = _classThis;
|
|
212
|
+
})();
|
|
173
213
|
export { BasicCCAPI };
|
|
174
|
-
let BasicCC =
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
214
|
+
let BasicCC = (() => {
|
|
215
|
+
let _classDecorators = [commandClass(CommandClasses.Basic), implementedVersion(2), ccValues(BasicCCValues)];
|
|
216
|
+
let _classDescriptor;
|
|
217
|
+
let _classExtraInitializers = [];
|
|
218
|
+
let _classThis;
|
|
219
|
+
let _classSuper = CommandClass;
|
|
220
|
+
var BasicCC = class extends _classSuper {
|
|
221
|
+
static { _classThis = this; }
|
|
222
|
+
static {
|
|
223
|
+
const _metadata = typeof Symbol === "function" && Symbol.metadata ? Object.create(_classSuper[Symbol.metadata] ?? null) : void 0;
|
|
224
|
+
__esDecorate(null, _classDescriptor = { value: _classThis }, _classDecorators, { kind: "class", name: _classThis.name, metadata: _metadata }, null, _classExtraInitializers);
|
|
225
|
+
BasicCC = _classThis = _classDescriptor.value;
|
|
226
|
+
if (_metadata) Object.defineProperty(_classThis, Symbol.metadata, { enumerable: true, configurable: true, writable: true, value: _metadata });
|
|
227
|
+
__runInitializers(_classThis, _classExtraInitializers);
|
|
228
|
+
}
|
|
229
|
+
async interview(ctx) {
|
|
230
|
+
const node = this.getNode(ctx);
|
|
231
|
+
const endpoint = this.getEndpoint(ctx);
|
|
189
232
|
ctx.logNode(node.id, {
|
|
190
233
|
endpoint: this.endpointIndex,
|
|
191
|
-
message:
|
|
234
|
+
message: `Interviewing ${this.ccName}...`,
|
|
235
|
+
direction: "none",
|
|
192
236
|
});
|
|
193
|
-
//
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
237
|
+
// Assume that the endpoint supports Basic CC, so the values get persisted correctly.
|
|
238
|
+
endpoint.addCC(CommandClasses.Basic, { isSupported: true });
|
|
239
|
+
// try to query the current state
|
|
240
|
+
await this.refreshValues(ctx);
|
|
241
|
+
// Remove Basic CC support again when there was no response
|
|
242
|
+
if (this.getValue(ctx, BasicCCValues.currentValue) == undefined) {
|
|
243
|
+
ctx.logNode(node.id, {
|
|
244
|
+
endpoint: this.endpointIndex,
|
|
245
|
+
message: "No response to Basic Get command, assuming Basic CC is unsupported...",
|
|
246
|
+
});
|
|
247
|
+
// SDS14223: A controlling node MUST conclude that the Basic Command Class is not supported by a node (or
|
|
248
|
+
// endpoint) if no Basic Report is returned.
|
|
249
|
+
endpoint.addCC(CommandClasses.Basic, { isSupported: false });
|
|
250
|
+
if (!endpoint.controlsCC(CommandClasses.Basic)) {
|
|
251
|
+
endpoint.removeCC(CommandClasses.Basic);
|
|
252
|
+
}
|
|
198
253
|
}
|
|
254
|
+
// Remember that the interview is complete
|
|
255
|
+
this.setInterviewComplete(ctx, true);
|
|
199
256
|
}
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
const basicResponse = await api.get();
|
|
216
|
-
if (basicResponse) {
|
|
217
|
-
let logMessage = `received Basic CC state:
|
|
257
|
+
async refreshValues(ctx) {
|
|
258
|
+
const node = this.getNode(ctx);
|
|
259
|
+
const endpoint = this.getEndpoint(ctx);
|
|
260
|
+
const api = CCAPI.create(CommandClasses.Basic, ctx, endpoint).withOptions({
|
|
261
|
+
priority: MessagePriority.NodeQuery,
|
|
262
|
+
});
|
|
263
|
+
// try to query the current state
|
|
264
|
+
ctx.logNode(node.id, {
|
|
265
|
+
endpoint: this.endpointIndex,
|
|
266
|
+
message: "querying Basic CC state...",
|
|
267
|
+
direction: "outbound",
|
|
268
|
+
});
|
|
269
|
+
const basicResponse = await api.get();
|
|
270
|
+
if (basicResponse) {
|
|
271
|
+
let logMessage = `received Basic CC state:
|
|
218
272
|
current value: ${basicResponse.currentValue}`;
|
|
219
|
-
|
|
220
|
-
|
|
273
|
+
if (basicResponse.targetValue != undefined) {
|
|
274
|
+
logMessage += `
|
|
221
275
|
target value: ${basicResponse.targetValue}
|
|
222
276
|
remaining duration: ${basicResponse.duration?.toString() ?? "undefined"}`;
|
|
277
|
+
}
|
|
278
|
+
ctx.logNode(node.id, {
|
|
279
|
+
endpoint: this.endpointIndex,
|
|
280
|
+
message: logMessage,
|
|
281
|
+
direction: "inbound",
|
|
282
|
+
});
|
|
223
283
|
}
|
|
224
|
-
ctx.logNode(node.id, {
|
|
225
|
-
endpoint: this.endpointIndex,
|
|
226
|
-
message: logMessage,
|
|
227
|
-
direction: "inbound",
|
|
228
|
-
});
|
|
229
284
|
}
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
285
|
+
getDefinedValueIDs(ctx) {
|
|
286
|
+
const ret = [];
|
|
287
|
+
const endpoint = this.getEndpoint(ctx);
|
|
288
|
+
const compat = ctx.getDeviceConfig?.(endpoint.nodeId)?.compat;
|
|
289
|
+
if (compat?.mapBasicSet === "event") {
|
|
290
|
+
// Add the compat event value if it should be exposed
|
|
291
|
+
ret.push(BasicCCValues.compatEvent.endpoint(endpoint.index));
|
|
292
|
+
}
|
|
293
|
+
if (endpoint.supportsCC(this.ccId)) {
|
|
294
|
+
// Defer to the base implementation if Basic CC is supported.
|
|
295
|
+
// This implies that no other actuator CC is supported.
|
|
296
|
+
ret.push(...super.getDefinedValueIDs(ctx));
|
|
297
|
+
}
|
|
298
|
+
else if (endpoint.controlsCC(CommandClasses.Basic)) {
|
|
299
|
+
// During the interview, we mark Basic CC as controlled only if we want to expose currentValue
|
|
300
|
+
ret.push(BasicCCValues.currentValue.endpoint(endpoint.index));
|
|
301
|
+
}
|
|
302
|
+
return ret;
|
|
238
303
|
}
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
304
|
+
};
|
|
305
|
+
return BasicCC = _classThis;
|
|
306
|
+
})();
|
|
307
|
+
export { BasicCC };
|
|
308
|
+
let BasicCCSet = (() => {
|
|
309
|
+
let _classDecorators = [CCCommand(BasicCommand.Set), useSupervision()];
|
|
310
|
+
let _classDescriptor;
|
|
311
|
+
let _classExtraInitializers = [];
|
|
312
|
+
let _classThis;
|
|
313
|
+
let _classSuper = BasicCC;
|
|
314
|
+
var BasicCCSet = class extends _classSuper {
|
|
315
|
+
static { _classThis = this; }
|
|
316
|
+
static {
|
|
317
|
+
const _metadata = typeof Symbol === "function" && Symbol.metadata ? Object.create(_classSuper[Symbol.metadata] ?? null) : void 0;
|
|
318
|
+
__esDecorate(null, _classDescriptor = { value: _classThis }, _classDecorators, { kind: "class", name: _classThis.name, metadata: _metadata }, null, _classExtraInitializers);
|
|
319
|
+
BasicCCSet = _classThis = _classDescriptor.value;
|
|
320
|
+
if (_metadata) Object.defineProperty(_classThis, Symbol.metadata, { enumerable: true, configurable: true, writable: true, value: _metadata });
|
|
321
|
+
__runInitializers(_classThis, _classExtraInitializers);
|
|
243
322
|
}
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
323
|
+
constructor(options) {
|
|
324
|
+
super(options);
|
|
325
|
+
this.targetValue = options.targetValue;
|
|
247
326
|
}
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
ccValues(BasicCCValues)
|
|
256
|
-
], BasicCC);
|
|
257
|
-
export { BasicCC };
|
|
258
|
-
let BasicCCSet = BasicCCSet_1 = class BasicCCSet extends BasicCC {
|
|
259
|
-
constructor(options) {
|
|
260
|
-
super(options);
|
|
261
|
-
this.targetValue = options.targetValue;
|
|
262
|
-
}
|
|
263
|
-
static from(raw, ctx) {
|
|
264
|
-
validatePayload(raw.payload.length >= 1);
|
|
265
|
-
const targetValue = raw.payload[0];
|
|
266
|
-
return new BasicCCSet_1({
|
|
267
|
-
nodeId: ctx.sourceNodeId,
|
|
268
|
-
targetValue,
|
|
269
|
-
});
|
|
270
|
-
}
|
|
271
|
-
targetValue;
|
|
272
|
-
serialize(ctx) {
|
|
273
|
-
this.payload = Bytes.from([this.targetValue]);
|
|
274
|
-
return super.serialize(ctx);
|
|
275
|
-
}
|
|
276
|
-
toLogEntry(ctx) {
|
|
277
|
-
return {
|
|
278
|
-
...super.toLogEntry(ctx),
|
|
279
|
-
message: { "target value": this.targetValue },
|
|
280
|
-
};
|
|
281
|
-
}
|
|
282
|
-
};
|
|
283
|
-
BasicCCSet = BasicCCSet_1 = __decorate([
|
|
284
|
-
CCCommand(BasicCommand.Set),
|
|
285
|
-
useSupervision()
|
|
286
|
-
], BasicCCSet);
|
|
287
|
-
export { BasicCCSet };
|
|
288
|
-
let BasicCCReport = BasicCCReport_1 = class BasicCCReport extends BasicCC {
|
|
289
|
-
// @noCCValues See comment in the constructor
|
|
290
|
-
constructor(options) {
|
|
291
|
-
super(options);
|
|
292
|
-
this.currentValue = options.currentValue;
|
|
293
|
-
this.targetValue = options.targetValue;
|
|
294
|
-
this.duration = options.duration;
|
|
295
|
-
}
|
|
296
|
-
static from(raw, ctx) {
|
|
297
|
-
validatePayload(raw.payload.length >= 1);
|
|
298
|
-
const currentValue =
|
|
299
|
-
// 0xff is a legacy value for 100% (99)
|
|
300
|
-
raw.payload[0] === 0xff
|
|
301
|
-
? 99
|
|
302
|
-
: parseMaybeNumber(raw.payload[0]);
|
|
303
|
-
validatePayload(currentValue !== undefined);
|
|
304
|
-
let targetValue;
|
|
305
|
-
let duration;
|
|
306
|
-
if (raw.payload.length >= 3) {
|
|
307
|
-
targetValue = parseMaybeNumber(raw.payload[1]);
|
|
308
|
-
duration = Duration.parseReport(raw.payload[2]);
|
|
327
|
+
static from(raw, ctx) {
|
|
328
|
+
validatePayload(raw.payload.length >= 1);
|
|
329
|
+
const targetValue = raw.payload[0];
|
|
330
|
+
return new this({
|
|
331
|
+
nodeId: ctx.sourceNodeId,
|
|
332
|
+
targetValue,
|
|
333
|
+
});
|
|
309
334
|
}
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
duration,
|
|
315
|
-
});
|
|
316
|
-
}
|
|
317
|
-
currentValue;
|
|
318
|
-
targetValue;
|
|
319
|
-
duration;
|
|
320
|
-
persistValues(ctx) {
|
|
321
|
-
// Basic CC Report persists its values itself, since there are some
|
|
322
|
-
// specific rules when which value may be persisted.
|
|
323
|
-
// These rules are essentially encoded in the getDefinedValueIDs overload,
|
|
324
|
-
// so we simply reuse that here.
|
|
325
|
-
// Figure out which values may be persisted.
|
|
326
|
-
const definedValueIDs = this.getDefinedValueIDs(ctx);
|
|
327
|
-
const shouldPersistCurrentValue = definedValueIDs.some((vid) => BasicCCValues.currentValue.is(vid));
|
|
328
|
-
const shouldPersistTargetValue = definedValueIDs.some((vid) => BasicCCValues.targetValue.is(vid));
|
|
329
|
-
const shouldPersistDuration = definedValueIDs.some((vid) => BasicCCValues.duration.is(vid));
|
|
330
|
-
if (this.currentValue !== undefined && shouldPersistCurrentValue) {
|
|
331
|
-
this.setValue(ctx, BasicCCValues.currentValue, this.currentValue);
|
|
335
|
+
targetValue;
|
|
336
|
+
serialize(ctx) {
|
|
337
|
+
this.payload = Bytes.from([this.targetValue]);
|
|
338
|
+
return super.serialize(ctx);
|
|
332
339
|
}
|
|
333
|
-
|
|
334
|
-
|
|
340
|
+
toLogEntry(ctx) {
|
|
341
|
+
return {
|
|
342
|
+
...super.toLogEntry(ctx),
|
|
343
|
+
message: { "target value": this.targetValue },
|
|
344
|
+
};
|
|
335
345
|
}
|
|
336
|
-
|
|
337
|
-
|
|
346
|
+
};
|
|
347
|
+
return BasicCCSet = _classThis;
|
|
348
|
+
})();
|
|
349
|
+
export { BasicCCSet };
|
|
350
|
+
let BasicCCReport = (() => {
|
|
351
|
+
let _classDecorators = [CCCommand(BasicCommand.Report), ccValueProperty("currentValue", BasicCCValues.currentValue), ccValueProperty("targetValue", BasicCCValues.targetValue), ccValueProperty("duration", BasicCCValues.duration)];
|
|
352
|
+
let _classDescriptor;
|
|
353
|
+
let _classExtraInitializers = [];
|
|
354
|
+
let _classThis;
|
|
355
|
+
let _classSuper = BasicCC;
|
|
356
|
+
var BasicCCReport = class extends _classSuper {
|
|
357
|
+
static { _classThis = this; }
|
|
358
|
+
static {
|
|
359
|
+
const _metadata = typeof Symbol === "function" && Symbol.metadata ? Object.create(_classSuper[Symbol.metadata] ?? null) : void 0;
|
|
360
|
+
__esDecorate(null, _classDescriptor = { value: _classThis }, _classDecorators, { kind: "class", name: _classThis.name, metadata: _metadata }, null, _classExtraInitializers);
|
|
361
|
+
BasicCCReport = _classThis = _classDescriptor.value;
|
|
362
|
+
if (_metadata) Object.defineProperty(_classThis, Symbol.metadata, { enumerable: true, configurable: true, writable: true, value: _metadata });
|
|
363
|
+
__runInitializers(_classThis, _classExtraInitializers);
|
|
338
364
|
}
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
this.
|
|
344
|
-
this.
|
|
345
|
-
(this.duration ?? Duration.unknown()).serializeReport(),
|
|
346
|
-
]);
|
|
347
|
-
const ccVersion = getEffectiveCCVersion(ctx, this);
|
|
348
|
-
if (ccVersion < 2 && ctx.getDeviceConfig?.(this.nodeId)?.compat?.encodeCCsUsingTargetVersion) {
|
|
349
|
-
// When forcing CC version 1, only send the current value
|
|
350
|
-
this.payload = this.payload.subarray(0, 1);
|
|
365
|
+
// @noCCValues See comment in the constructor
|
|
366
|
+
constructor(options) {
|
|
367
|
+
super(options);
|
|
368
|
+
this.currentValue = options.currentValue;
|
|
369
|
+
this.targetValue = options.targetValue;
|
|
370
|
+
this.duration = options.duration;
|
|
351
371
|
}
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
|
|
372
|
+
static from(raw, ctx) {
|
|
373
|
+
validatePayload(raw.payload.length >= 1);
|
|
374
|
+
const currentValue =
|
|
375
|
+
// 0xff is a legacy value for 100% (99)
|
|
376
|
+
raw.payload[0] === 0xff
|
|
377
|
+
? 99
|
|
378
|
+
: parseMaybeNumber(raw.payload[0]);
|
|
379
|
+
validatePayload(currentValue !== undefined);
|
|
380
|
+
let targetValue;
|
|
381
|
+
let duration;
|
|
382
|
+
if (raw.payload.length >= 3) {
|
|
383
|
+
targetValue = parseMaybeNumber(raw.payload[1]);
|
|
384
|
+
duration = Duration.parseReport(raw.payload[2]);
|
|
385
|
+
}
|
|
386
|
+
return new this({
|
|
387
|
+
nodeId: ctx.sourceNodeId,
|
|
388
|
+
currentValue,
|
|
389
|
+
targetValue,
|
|
390
|
+
duration,
|
|
391
|
+
});
|
|
360
392
|
}
|
|
361
|
-
|
|
362
|
-
|
|
393
|
+
currentValue;
|
|
394
|
+
targetValue;
|
|
395
|
+
duration;
|
|
396
|
+
persistValues(ctx) {
|
|
397
|
+
// Basic CC Report persists its values itself, since there are some
|
|
398
|
+
// specific rules when which value may be persisted.
|
|
399
|
+
// These rules are essentially encoded in the getDefinedValueIDs overload,
|
|
400
|
+
// so we simply reuse that here.
|
|
401
|
+
// Figure out which values may be persisted.
|
|
402
|
+
const definedValueIDs = this.getDefinedValueIDs(ctx);
|
|
403
|
+
const shouldPersistCurrentValue = definedValueIDs.some((vid) => BasicCCValues.currentValue.is(vid));
|
|
404
|
+
const shouldPersistTargetValue = definedValueIDs.some((vid) => BasicCCValues.targetValue.is(vid));
|
|
405
|
+
const shouldPersistDuration = definedValueIDs.some((vid) => BasicCCValues.duration.is(vid));
|
|
406
|
+
if (this.currentValue !== undefined && shouldPersistCurrentValue) {
|
|
407
|
+
this.setValue(ctx, BasicCCValues.currentValue, this.currentValue);
|
|
408
|
+
}
|
|
409
|
+
if (this.targetValue !== undefined && shouldPersistTargetValue) {
|
|
410
|
+
this.setValue(ctx, BasicCCValues.targetValue, this.targetValue);
|
|
411
|
+
}
|
|
412
|
+
if (this.duration !== undefined && shouldPersistDuration) {
|
|
413
|
+
this.setValue(ctx, BasicCCValues.duration, this.duration);
|
|
414
|
+
}
|
|
415
|
+
return true;
|
|
363
416
|
}
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
|
|
417
|
+
serialize(ctx) {
|
|
418
|
+
this.payload = Bytes.from([
|
|
419
|
+
this.currentValue ?? 0xfe,
|
|
420
|
+
this.targetValue ?? 0xfe,
|
|
421
|
+
(this.duration ?? Duration.unknown()).serializeReport(),
|
|
422
|
+
]);
|
|
423
|
+
const ccVersion = getEffectiveCCVersion(ctx, this);
|
|
424
|
+
if (ccVersion < 2 && ctx.getDeviceConfig?.(this.nodeId)?.compat?.encodeCCsUsingTargetVersion) {
|
|
425
|
+
// When forcing CC version 1, only send the current value
|
|
426
|
+
this.payload = this.payload.subarray(0, 1);
|
|
427
|
+
}
|
|
428
|
+
return super.serialize(ctx);
|
|
429
|
+
}
|
|
430
|
+
toLogEntry(ctx) {
|
|
431
|
+
const message = {
|
|
432
|
+
"current value": maybeUnknownToString(this.currentValue),
|
|
433
|
+
};
|
|
434
|
+
if (this.targetValue !== undefined) {
|
|
435
|
+
message["target value"] = maybeUnknownToString(this.targetValue);
|
|
436
|
+
}
|
|
437
|
+
if (this.duration != undefined) {
|
|
438
|
+
message.duration = this.duration.toString();
|
|
439
|
+
}
|
|
440
|
+
return {
|
|
441
|
+
...super.toLogEntry(ctx),
|
|
442
|
+
message,
|
|
443
|
+
};
|
|
444
|
+
}
|
|
445
|
+
};
|
|
446
|
+
return BasicCCReport = _classThis;
|
|
447
|
+
})();
|
|
382
448
|
export { BasicCCReport };
|
|
383
|
-
let BasicCCGet =
|
|
384
|
-
|
|
385
|
-
|
|
386
|
-
|
|
387
|
-
|
|
388
|
-
|
|
449
|
+
let BasicCCGet = (() => {
|
|
450
|
+
let _classDecorators = [CCCommand(BasicCommand.Get), expectedCCResponse(BasicCCReport)];
|
|
451
|
+
let _classDescriptor;
|
|
452
|
+
let _classExtraInitializers = [];
|
|
453
|
+
let _classThis;
|
|
454
|
+
let _classSuper = BasicCC;
|
|
455
|
+
var BasicCCGet = class extends _classSuper {
|
|
456
|
+
static { _classThis = this; }
|
|
457
|
+
static {
|
|
458
|
+
const _metadata = typeof Symbol === "function" && Symbol.metadata ? Object.create(_classSuper[Symbol.metadata] ?? null) : void 0;
|
|
459
|
+
__esDecorate(null, _classDescriptor = { value: _classThis }, _classDecorators, { kind: "class", name: _classThis.name, metadata: _metadata }, null, _classExtraInitializers);
|
|
460
|
+
BasicCCGet = _classThis = _classDescriptor.value;
|
|
461
|
+
if (_metadata) Object.defineProperty(_classThis, Symbol.metadata, { enumerable: true, configurable: true, writable: true, value: _metadata });
|
|
462
|
+
__runInitializers(_classThis, _classExtraInitializers);
|
|
463
|
+
}
|
|
464
|
+
};
|
|
465
|
+
return BasicCCGet = _classThis;
|
|
466
|
+
})();
|
|
389
467
|
export { BasicCCGet };
|
|
390
468
|
//# sourceMappingURL=BasicCC.js.map
|