@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 SupervisionCC_1, SupervisionCCReport_1, SupervisionCCGet_1;
|
|
8
35
|
import { CommandClasses, Duration, EncapsulationFlags, MessagePriority, SupervisionStatus, TransmitOptions, ZWaveError, ZWaveErrorCodes, isTransmissionError, validatePayload, } from "@zwave-js/core/safe";
|
|
9
36
|
import { Bytes } from "@zwave-js/shared/safe";
|
|
10
37
|
import { getEnumMemberName } from "@zwave-js/shared/safe";
|
|
@@ -25,295 +52,345 @@ export const SupervisionCCValues = Object.freeze({
|
|
|
25
52
|
// Encapsulation CCs are used internally and too frequently that we
|
|
26
53
|
// want to pay the cost of validating each call
|
|
27
54
|
/* eslint-disable @zwave-js/ccapi-validate-args */
|
|
28
|
-
let SupervisionCCAPI =
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
55
|
+
let SupervisionCCAPI = (() => {
|
|
56
|
+
let _classDecorators = [API(CommandClasses.Supervision)];
|
|
57
|
+
let _classDescriptor;
|
|
58
|
+
let _classExtraInitializers = [];
|
|
59
|
+
let _classThis;
|
|
60
|
+
let _classSuper = PhysicalCCAPI;
|
|
61
|
+
var SupervisionCCAPI = class extends _classSuper {
|
|
62
|
+
static { _classThis = this; }
|
|
63
|
+
static {
|
|
64
|
+
const _metadata = typeof Symbol === "function" && Symbol.metadata ? Object.create(_classSuper[Symbol.metadata] ?? null) : void 0;
|
|
65
|
+
__esDecorate(null, _classDescriptor = { value: _classThis }, _classDecorators, { kind: "class", name: _classThis.name, metadata: _metadata }, null, _classExtraInitializers);
|
|
66
|
+
SupervisionCCAPI = _classThis = _classDescriptor.value;
|
|
67
|
+
if (_metadata) Object.defineProperty(_classThis, Symbol.metadata, { enumerable: true, configurable: true, writable: true, value: _metadata });
|
|
68
|
+
__runInitializers(_classThis, _classExtraInitializers);
|
|
34
69
|
}
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
nodeId: this.endpoint.nodeId,
|
|
43
|
-
endpointIndex: this.endpoint.index,
|
|
44
|
-
...cmdOptions,
|
|
45
|
-
});
|
|
46
|
-
// The report must be sent back with the same encapsulation order
|
|
47
|
-
cc.encapsulationFlags = encapsulationFlags;
|
|
48
|
-
try {
|
|
49
|
-
await this.host.sendCommand(cc, {
|
|
50
|
-
...this.commandOptions,
|
|
51
|
-
// Supervision Reports must be prioritized over normal messages
|
|
52
|
-
priority: lowPriority
|
|
53
|
-
? MessagePriority.ImmediateLow
|
|
54
|
-
: MessagePriority.Immediate,
|
|
55
|
-
// But we don't want to wait for an ACK because this can lock up the network for seconds
|
|
56
|
-
// if the target node is asleep or unreachable
|
|
57
|
-
transmitOptions: TransmitOptions.DEFAULT_NOACK,
|
|
58
|
-
// Only try sending the report once. If it fails, the node will ask again
|
|
59
|
-
maxSendAttempts: 1,
|
|
60
|
-
});
|
|
70
|
+
supportsCommand(cmd) {
|
|
71
|
+
switch (cmd) {
|
|
72
|
+
case SupervisionCommand.Get:
|
|
73
|
+
case SupervisionCommand.Report:
|
|
74
|
+
return true; // This is mandatory
|
|
75
|
+
}
|
|
76
|
+
return super.supportsCommand(cmd);
|
|
61
77
|
}
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
78
|
+
async sendReport(options) {
|
|
79
|
+
// Here we don't assert support - some devices only half-support Supervision, so we treat them
|
|
80
|
+
// as if they don't support it. We still need to be able to respond to the Get command though.
|
|
81
|
+
const { encapsulationFlags = EncapsulationFlags.None, lowPriority = false, ...cmdOptions } = options;
|
|
82
|
+
const cc = new SupervisionCCReport({
|
|
83
|
+
nodeId: this.endpoint.nodeId,
|
|
84
|
+
endpointIndex: this.endpoint.index,
|
|
85
|
+
...cmdOptions,
|
|
86
|
+
});
|
|
87
|
+
// The report must be sent back with the same encapsulation order
|
|
88
|
+
cc.encapsulationFlags = encapsulationFlags;
|
|
89
|
+
try {
|
|
90
|
+
await this.host.sendCommand(cc, {
|
|
91
|
+
...this.commandOptions,
|
|
92
|
+
// Supervision Reports must be prioritized over normal messages
|
|
93
|
+
priority: lowPriority
|
|
94
|
+
? MessagePriority.ImmediateLow
|
|
95
|
+
: MessagePriority.Immediate,
|
|
96
|
+
// But we don't want to wait for an ACK because this can lock up the network for seconds
|
|
97
|
+
// if the target node is asleep or unreachable
|
|
98
|
+
transmitOptions: TransmitOptions.DEFAULT_NOACK,
|
|
99
|
+
// Only try sending the report once. If it fails, the node will ask again
|
|
100
|
+
maxSendAttempts: 1,
|
|
101
|
+
});
|
|
66
102
|
}
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
103
|
+
catch (e) {
|
|
104
|
+
if (isTransmissionError(e)) {
|
|
105
|
+
// Swallow errors related to transmission failures
|
|
106
|
+
return;
|
|
107
|
+
}
|
|
108
|
+
else {
|
|
109
|
+
// Pass other errors through
|
|
110
|
+
throw e;
|
|
111
|
+
}
|
|
70
112
|
}
|
|
71
113
|
}
|
|
72
|
-
}
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
API(CommandClasses.Supervision)
|
|
76
|
-
], SupervisionCCAPI);
|
|
114
|
+
};
|
|
115
|
+
return SupervisionCCAPI = _classThis;
|
|
116
|
+
})();
|
|
77
117
|
export { SupervisionCCAPI };
|
|
78
|
-
let SupervisionCC =
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
118
|
+
let SupervisionCC = (() => {
|
|
119
|
+
let _classDecorators = [commandClass(CommandClasses.Supervision), implementedVersion(2)];
|
|
120
|
+
let _classDescriptor;
|
|
121
|
+
let _classExtraInitializers = [];
|
|
122
|
+
let _classThis;
|
|
123
|
+
let _classSuper = CommandClass;
|
|
124
|
+
var SupervisionCC = class extends _classSuper {
|
|
125
|
+
static { _classThis = this; }
|
|
126
|
+
static {
|
|
127
|
+
const _metadata = typeof Symbol === "function" && Symbol.metadata ? Object.create(_classSuper[Symbol.metadata] ?? null) : void 0;
|
|
128
|
+
__esDecorate(null, _classDescriptor = { value: _classThis }, _classDecorators, { kind: "class", name: _classThis.name, metadata: _metadata }, null, _classExtraInitializers);
|
|
129
|
+
SupervisionCC = _classThis = _classDescriptor.value;
|
|
130
|
+
if (_metadata) Object.defineProperty(_classThis, Symbol.metadata, { enumerable: true, configurable: true, writable: true, value: _metadata });
|
|
131
|
+
__runInitializers(_classThis, _classExtraInitializers);
|
|
89
132
|
}
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
ret.encapsulationFlags = cc.encapsulationFlags
|
|
101
|
-
& ~EncapsulationFlags.Supervision;
|
|
102
|
-
return ret;
|
|
103
|
-
}
|
|
104
|
-
/**
|
|
105
|
-
* Given a CC instance, this returns the Supervision session ID which is used for this command.
|
|
106
|
-
* Returns `undefined` when there is no session ID or the command was sent as multicast.
|
|
107
|
-
*/
|
|
108
|
-
static getSessionId(command) {
|
|
109
|
-
if (command.isEncapsulatedWith(CommandClasses.Supervision, SupervisionCommand.Get)) {
|
|
110
|
-
const supervisionEncapsulation = command.getEncapsulatingCC(CommandClasses.Supervision, SupervisionCommand.Get);
|
|
111
|
-
if (supervisionEncapsulation.frameType !== "broadcast"
|
|
112
|
-
&& supervisionEncapsulation.frameType !== "multicast") {
|
|
113
|
-
return supervisionEncapsulation.sessionId;
|
|
133
|
+
/** Tests if a command should be supervised and thus requires encapsulation */
|
|
134
|
+
static requiresEncapsulation(cc) {
|
|
135
|
+
return (!!(cc.encapsulationFlags & EncapsulationFlags.Supervision)
|
|
136
|
+
&& !(cc instanceof SupervisionCCGet)
|
|
137
|
+
&& !(cc instanceof SupervisionCCReport));
|
|
138
|
+
}
|
|
139
|
+
/** Encapsulates a command that targets a specific endpoint */
|
|
140
|
+
static encapsulate(cc, sessionId, requestStatusUpdates = true) {
|
|
141
|
+
if (!cc.isSinglecast()) {
|
|
142
|
+
throw new ZWaveError(`Supervision is only possible for singlecast commands!`, ZWaveErrorCodes.Argument_Invalid);
|
|
114
143
|
}
|
|
144
|
+
const ret = new SupervisionCCGet({
|
|
145
|
+
nodeId: cc.nodeId,
|
|
146
|
+
// Supervision CC is wrapped inside MultiChannel CCs, so the endpoint must be copied
|
|
147
|
+
endpointIndex: cc.endpointIndex,
|
|
148
|
+
encapsulated: cc,
|
|
149
|
+
sessionId,
|
|
150
|
+
requestStatusUpdates,
|
|
151
|
+
});
|
|
152
|
+
// Copy the encapsulation flags from the encapsulated command
|
|
153
|
+
// but omit Supervision, since we're doing that right now
|
|
154
|
+
ret.encapsulationFlags = cc.encapsulationFlags
|
|
155
|
+
& ~EncapsulationFlags.Supervision;
|
|
156
|
+
return ret;
|
|
115
157
|
}
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
*/
|
|
129
|
-
static setCCSupportedWithSupervision(ctx, endpoint, ccId, supported) {
|
|
130
|
-
ctx
|
|
131
|
-
.getValueDB(endpoint.nodeId)
|
|
132
|
-
.setValue(SupervisionCCValues.ccSupported(ccId).endpoint(endpoint.index), supported);
|
|
133
|
-
}
|
|
134
|
-
/** Returns whether this is a valid command to send supervised */
|
|
135
|
-
static mayUseSupervision(ctx, command) {
|
|
136
|
-
// Supervision may only be used for singlecast CCs that expect no response
|
|
137
|
-
// The specs mention that Supervision CAN be used for S2 multicast, but conveniently fail to explain how to respond to that.
|
|
138
|
-
if (!command.isSinglecast())
|
|
139
|
-
return false;
|
|
140
|
-
if (command.expectsCCResponse())
|
|
141
|
-
return false;
|
|
142
|
-
// with a valid node and endpoint
|
|
143
|
-
const node = command.getNode(ctx);
|
|
144
|
-
if (!node)
|
|
145
|
-
return false;
|
|
146
|
-
const endpoint = command.getEndpoint(ctx);
|
|
147
|
-
if (!endpoint)
|
|
148
|
-
return false;
|
|
149
|
-
// and only if ...
|
|
150
|
-
return (
|
|
151
|
-
// ... the node supports it
|
|
152
|
-
node.supportsCC(CommandClasses.Supervision)
|
|
153
|
-
// ... the command is marked as "should use supervision"
|
|
154
|
-
&& shouldUseSupervision(command)
|
|
155
|
-
// ... and we haven't previously determined that the node doesn't properly support it
|
|
156
|
-
&& SupervisionCC_1.getCCSupportedWithSupervision(ctx, endpoint, command.ccId));
|
|
157
|
-
}
|
|
158
|
-
};
|
|
159
|
-
SupervisionCC = SupervisionCC_1 = __decorate([
|
|
160
|
-
commandClass(CommandClasses.Supervision),
|
|
161
|
-
implementedVersion(2)
|
|
162
|
-
], SupervisionCC);
|
|
163
|
-
export { SupervisionCC };
|
|
164
|
-
let SupervisionCCReport = SupervisionCCReport_1 = class SupervisionCCReport extends SupervisionCC {
|
|
165
|
-
constructor(options) {
|
|
166
|
-
super(options);
|
|
167
|
-
this.moreUpdatesFollow = options.moreUpdatesFollow;
|
|
168
|
-
this.requestWakeUpOnDemand = !!options.requestWakeUpOnDemand;
|
|
169
|
-
this.sessionId = options.sessionId;
|
|
170
|
-
this.status = options.status;
|
|
171
|
-
if (options.status === SupervisionStatus.Working) {
|
|
172
|
-
this.duration = options.duration;
|
|
158
|
+
/**
|
|
159
|
+
* Given a CC instance, this returns the Supervision session ID which is used for this command.
|
|
160
|
+
* Returns `undefined` when there is no session ID or the command was sent as multicast.
|
|
161
|
+
*/
|
|
162
|
+
static getSessionId(command) {
|
|
163
|
+
if (command.isEncapsulatedWith(CommandClasses.Supervision, SupervisionCommand.Get)) {
|
|
164
|
+
const supervisionEncapsulation = command.getEncapsulatingCC(CommandClasses.Supervision, SupervisionCommand.Get);
|
|
165
|
+
if (supervisionEncapsulation.frameType !== "broadcast"
|
|
166
|
+
&& supervisionEncapsulation.frameType !== "multicast") {
|
|
167
|
+
return supervisionEncapsulation.sessionId;
|
|
168
|
+
}
|
|
169
|
+
}
|
|
173
170
|
}
|
|
174
|
-
|
|
175
|
-
|
|
171
|
+
/**
|
|
172
|
+
* Returns whether a node supports the given CC with Supervision encapsulation.
|
|
173
|
+
*/
|
|
174
|
+
static getCCSupportedWithSupervision(ctx, endpoint, ccId) {
|
|
175
|
+
// By default assume supervision is supported for all CCs, unless we've remembered one not to be
|
|
176
|
+
return (ctx
|
|
177
|
+
.getValueDB(endpoint.nodeId)
|
|
178
|
+
.getValue(SupervisionCCValues.ccSupported(ccId).endpoint(endpoint.index)) ?? true);
|
|
176
179
|
}
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
if (status === SupervisionStatus.Working) {
|
|
185
|
-
const duration = Duration.parseReport(raw.payload[2])
|
|
186
|
-
?? new Duration(0, "seconds");
|
|
187
|
-
return new SupervisionCCReport_1({
|
|
188
|
-
nodeId: ctx.sourceNodeId,
|
|
189
|
-
moreUpdatesFollow,
|
|
190
|
-
requestWakeUpOnDemand,
|
|
191
|
-
sessionId,
|
|
192
|
-
status,
|
|
193
|
-
duration,
|
|
194
|
-
});
|
|
180
|
+
/**
|
|
181
|
+
* Remembers whether a node supports the given CC with Supervision encapsulation.
|
|
182
|
+
*/
|
|
183
|
+
static setCCSupportedWithSupervision(ctx, endpoint, ccId, supported) {
|
|
184
|
+
ctx
|
|
185
|
+
.getValueDB(endpoint.nodeId)
|
|
186
|
+
.setValue(SupervisionCCValues.ccSupported(ccId).endpoint(endpoint.index), supported);
|
|
195
187
|
}
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
188
|
+
/** Returns whether this is a valid command to send supervised */
|
|
189
|
+
static mayUseSupervision(ctx, command) {
|
|
190
|
+
// Supervision may only be used for singlecast CCs that expect no response
|
|
191
|
+
// The specs mention that Supervision CAN be used for S2 multicast, but conveniently fail to explain how to respond to that.
|
|
192
|
+
if (!command.isSinglecast())
|
|
193
|
+
return false;
|
|
194
|
+
if (command.expectsCCResponse())
|
|
195
|
+
return false;
|
|
196
|
+
// with a valid node and endpoint
|
|
197
|
+
const node = command.getNode(ctx);
|
|
198
|
+
if (!node)
|
|
199
|
+
return false;
|
|
200
|
+
const endpoint = command.getEndpoint(ctx);
|
|
201
|
+
if (!endpoint)
|
|
202
|
+
return false;
|
|
203
|
+
// and only if ...
|
|
204
|
+
return (
|
|
205
|
+
// ... the node supports it
|
|
206
|
+
node.supportsCC(CommandClasses.Supervision)
|
|
207
|
+
// ... the command is marked as "should use supervision"
|
|
208
|
+
&& shouldUseSupervision(command)
|
|
209
|
+
// ... and we haven't previously determined that the node doesn't properly support it
|
|
210
|
+
&& SupervisionCC.getCCSupportedWithSupervision(ctx, endpoint, command.ccId));
|
|
204
211
|
}
|
|
205
|
-
}
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
])
|
|
219
|
-
|
|
220
|
-
|
|
212
|
+
};
|
|
213
|
+
return SupervisionCC = _classThis;
|
|
214
|
+
})();
|
|
215
|
+
export { SupervisionCC };
|
|
216
|
+
let SupervisionCCReport = (() => {
|
|
217
|
+
let _classDecorators = [CCCommand(SupervisionCommand.Report)];
|
|
218
|
+
let _classDescriptor;
|
|
219
|
+
let _classExtraInitializers = [];
|
|
220
|
+
let _classThis;
|
|
221
|
+
let _classSuper = SupervisionCC;
|
|
222
|
+
var SupervisionCCReport = class extends _classSuper {
|
|
223
|
+
static { _classThis = this; }
|
|
224
|
+
static {
|
|
225
|
+
const _metadata = typeof Symbol === "function" && Symbol.metadata ? Object.create(_classSuper[Symbol.metadata] ?? null) : void 0;
|
|
226
|
+
__esDecorate(null, _classDescriptor = { value: _classThis }, _classDecorators, { kind: "class", name: _classThis.name, metadata: _metadata }, null, _classExtraInitializers);
|
|
227
|
+
SupervisionCCReport = _classThis = _classDescriptor.value;
|
|
228
|
+
if (_metadata) Object.defineProperty(_classThis, Symbol.metadata, { enumerable: true, configurable: true, writable: true, value: _metadata });
|
|
229
|
+
__runInitializers(_classThis, _classExtraInitializers);
|
|
230
|
+
}
|
|
231
|
+
constructor(options) {
|
|
232
|
+
super(options);
|
|
233
|
+
this.moreUpdatesFollow = options.moreUpdatesFollow;
|
|
234
|
+
this.requestWakeUpOnDemand = !!options.requestWakeUpOnDemand;
|
|
235
|
+
this.sessionId = options.sessionId;
|
|
236
|
+
this.status = options.status;
|
|
237
|
+
if (options.status === SupervisionStatus.Working) {
|
|
238
|
+
this.duration = options.duration;
|
|
239
|
+
}
|
|
240
|
+
else {
|
|
241
|
+
this.duration = new Duration(0, "seconds");
|
|
242
|
+
}
|
|
243
|
+
}
|
|
244
|
+
static from(raw, ctx) {
|
|
245
|
+
validatePayload(raw.payload.length >= 3);
|
|
246
|
+
const moreUpdatesFollow = !!(raw.payload[0] & 0b1_0_000000);
|
|
247
|
+
const requestWakeUpOnDemand = !!(raw.payload[0] & 0b0_1_000000);
|
|
248
|
+
const sessionId = raw.payload[0] & 0b111111;
|
|
249
|
+
const status = raw.payload[1];
|
|
250
|
+
if (status === SupervisionStatus.Working) {
|
|
251
|
+
const duration = Duration.parseReport(raw.payload[2])
|
|
252
|
+
?? new Duration(0, "seconds");
|
|
253
|
+
return new this({
|
|
254
|
+
nodeId: ctx.sourceNodeId,
|
|
255
|
+
moreUpdatesFollow,
|
|
256
|
+
requestWakeUpOnDemand,
|
|
257
|
+
sessionId,
|
|
258
|
+
status,
|
|
259
|
+
duration,
|
|
260
|
+
});
|
|
261
|
+
}
|
|
262
|
+
else {
|
|
263
|
+
return new this({
|
|
264
|
+
nodeId: ctx.sourceNodeId,
|
|
265
|
+
moreUpdatesFollow,
|
|
266
|
+
requestWakeUpOnDemand,
|
|
267
|
+
sessionId,
|
|
268
|
+
status,
|
|
269
|
+
});
|
|
270
|
+
}
|
|
271
|
+
}
|
|
272
|
+
moreUpdatesFollow;
|
|
273
|
+
requestWakeUpOnDemand;
|
|
274
|
+
sessionId;
|
|
275
|
+
status;
|
|
276
|
+
duration;
|
|
277
|
+
serialize(ctx) {
|
|
221
278
|
this.payload = Bytes.concat([
|
|
222
|
-
|
|
223
|
-
|
|
279
|
+
Bytes.from([
|
|
280
|
+
(this.moreUpdatesFollow ? 0b1_0_000000 : 0)
|
|
281
|
+
| (this.requestWakeUpOnDemand ? 0b0_1_000000 : 0)
|
|
282
|
+
| (this.sessionId & 0b111111),
|
|
283
|
+
this.status,
|
|
284
|
+
]),
|
|
224
285
|
]);
|
|
286
|
+
if (this.duration) {
|
|
287
|
+
this.payload = Bytes.concat([
|
|
288
|
+
this.payload,
|
|
289
|
+
Bytes.from([this.duration.serializeReport()]),
|
|
290
|
+
]);
|
|
291
|
+
}
|
|
292
|
+
return super.serialize(ctx);
|
|
225
293
|
}
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
"more updates follow": this.moreUpdatesFollow,
|
|
232
|
-
status: getEnumMemberName(SupervisionStatus, this.status),
|
|
233
|
-
};
|
|
234
|
-
if (this.duration) {
|
|
235
|
-
message.duration = this.duration.toString();
|
|
236
|
-
}
|
|
237
|
-
return {
|
|
238
|
-
...super.toLogEntry(ctx),
|
|
239
|
-
message,
|
|
240
|
-
};
|
|
241
|
-
}
|
|
242
|
-
toSupervisionResult() {
|
|
243
|
-
if (this.status === SupervisionStatus.Working) {
|
|
244
|
-
return {
|
|
245
|
-
status: this.status,
|
|
246
|
-
remainingDuration: this.duration,
|
|
294
|
+
toLogEntry(ctx) {
|
|
295
|
+
const message = {
|
|
296
|
+
"session id": this.sessionId,
|
|
297
|
+
"more updates follow": this.moreUpdatesFollow,
|
|
298
|
+
status: getEnumMemberName(SupervisionStatus, this.status),
|
|
247
299
|
};
|
|
248
|
-
|
|
249
|
-
|
|
300
|
+
if (this.duration) {
|
|
301
|
+
message.duration = this.duration.toString();
|
|
302
|
+
}
|
|
250
303
|
return {
|
|
251
|
-
|
|
304
|
+
...super.toLogEntry(ctx),
|
|
305
|
+
message,
|
|
252
306
|
};
|
|
253
307
|
}
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
308
|
+
toSupervisionResult() {
|
|
309
|
+
if (this.status === SupervisionStatus.Working) {
|
|
310
|
+
return {
|
|
311
|
+
status: this.status,
|
|
312
|
+
remainingDuration: this.duration,
|
|
313
|
+
};
|
|
314
|
+
}
|
|
315
|
+
else {
|
|
316
|
+
return {
|
|
317
|
+
status: this.status,
|
|
318
|
+
};
|
|
319
|
+
}
|
|
320
|
+
}
|
|
321
|
+
};
|
|
322
|
+
return SupervisionCCReport = _classThis;
|
|
323
|
+
})();
|
|
259
324
|
export { SupervisionCCReport };
|
|
260
325
|
function testResponseForSupervisionCCGet(sent, received) {
|
|
261
326
|
return received.sessionId === sent.sessionId;
|
|
262
327
|
}
|
|
263
|
-
let SupervisionCCGet =
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
encapsulated
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
}
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
328
|
+
let SupervisionCCGet = (() => {
|
|
329
|
+
let _classDecorators = [CCCommand(SupervisionCommand.Get), expectedCCResponse(SupervisionCCReport, testResponseForSupervisionCCGet)];
|
|
330
|
+
let _classDescriptor;
|
|
331
|
+
let _classExtraInitializers = [];
|
|
332
|
+
let _classThis;
|
|
333
|
+
let _classSuper = SupervisionCC;
|
|
334
|
+
var SupervisionCCGet = class extends _classSuper {
|
|
335
|
+
static { _classThis = this; }
|
|
336
|
+
static {
|
|
337
|
+
const _metadata = typeof Symbol === "function" && Symbol.metadata ? Object.create(_classSuper[Symbol.metadata] ?? null) : void 0;
|
|
338
|
+
__esDecorate(null, _classDescriptor = { value: _classThis }, _classDecorators, { kind: "class", name: _classThis.name, metadata: _metadata }, null, _classExtraInitializers);
|
|
339
|
+
SupervisionCCGet = _classThis = _classDescriptor.value;
|
|
340
|
+
if (_metadata) Object.defineProperty(_classThis, Symbol.metadata, { enumerable: true, configurable: true, writable: true, value: _metadata });
|
|
341
|
+
__runInitializers(_classThis, _classExtraInitializers);
|
|
342
|
+
}
|
|
343
|
+
constructor(options) {
|
|
344
|
+
super(options);
|
|
345
|
+
this.sessionId = options.sessionId;
|
|
346
|
+
this.requestStatusUpdates = options.requestStatusUpdates;
|
|
347
|
+
this.encapsulated = options.encapsulated;
|
|
348
|
+
// Supervision is inside MultiChannel CCs, so the endpoint must be copied
|
|
349
|
+
this.encapsulated.endpointIndex = this.endpointIndex;
|
|
350
|
+
this.encapsulated.encapsulatingCC = this;
|
|
351
|
+
}
|
|
352
|
+
static from(raw, ctx) {
|
|
353
|
+
validatePayload(raw.payload.length >= 3);
|
|
354
|
+
const requestStatusUpdates = !!(raw.payload[0] & 0b1_0_000000);
|
|
355
|
+
const sessionId = raw.payload[0] & 0b111111;
|
|
356
|
+
const encapsulated = CommandClass.parse(raw.payload.subarray(2), ctx);
|
|
357
|
+
return new this({
|
|
358
|
+
nodeId: ctx.sourceNodeId,
|
|
359
|
+
requestStatusUpdates,
|
|
360
|
+
sessionId,
|
|
361
|
+
encapsulated,
|
|
362
|
+
});
|
|
363
|
+
}
|
|
364
|
+
requestStatusUpdates;
|
|
365
|
+
sessionId;
|
|
366
|
+
encapsulated;
|
|
367
|
+
serialize(ctx) {
|
|
368
|
+
const encapCC = this.encapsulated.serialize(ctx);
|
|
369
|
+
this.payload = Bytes.concat([
|
|
370
|
+
Bytes.from([
|
|
371
|
+
(this.requestStatusUpdates ? 0b10_000000 : 0)
|
|
372
|
+
| (this.sessionId & 0b111111),
|
|
373
|
+
encapCC.length,
|
|
374
|
+
]),
|
|
375
|
+
encapCC,
|
|
376
|
+
]);
|
|
377
|
+
return super.serialize(ctx);
|
|
378
|
+
}
|
|
379
|
+
computeEncapsulationOverhead() {
|
|
380
|
+
// Supervision CC adds two bytes (control byte + cc length)
|
|
381
|
+
return super.computeEncapsulationOverhead() + 2;
|
|
382
|
+
}
|
|
383
|
+
toLogEntry(ctx) {
|
|
384
|
+
return {
|
|
385
|
+
...super.toLogEntry(ctx),
|
|
386
|
+
message: {
|
|
387
|
+
"session id": this.sessionId,
|
|
388
|
+
"request updates": this.requestStatusUpdates,
|
|
389
|
+
},
|
|
390
|
+
};
|
|
391
|
+
}
|
|
392
|
+
};
|
|
393
|
+
return SupervisionCCGet = _classThis;
|
|
394
|
+
})();
|
|
318
395
|
export { SupervisionCCGet };
|
|
319
396
|
//# sourceMappingURL=SupervisionCC.js.map
|