@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 ProtectionCCReport_1, ProtectionCCSupportedReport_1, ProtectionCCExclusiveControlReport_1, ProtectionCCTimeoutReport_1;
|
|
8
35
|
function __assertType(argName, typeName, boundHasError) {
|
|
9
36
|
const { ZWaveError, ZWaveErrorCodes } = require("@zwave-js/core");
|
|
10
37
|
if (boundHasError()) {
|
|
@@ -49,7 +76,7 @@ import { getEnumMemberName, pick } from "@zwave-js/shared/safe";
|
|
|
49
76
|
import { padStart } from "alcalzone-shared/strings/index.js";
|
|
50
77
|
import { CCAPI, POLL_VALUE, SET_VALUE, throwUnsupportedProperty, throwWrongValueType, } from "../lib/API.js";
|
|
51
78
|
import { CommandClass, getEffectiveCCVersion, } from "../lib/CommandClass.js";
|
|
52
|
-
import { API, CCCommand,
|
|
79
|
+
import { API, CCCommand, ccValueProperty, ccValues, commandClass, expectedCCResponse, implementedVersion, useSupervision, } from "../lib/CommandClassDecorators.js";
|
|
53
80
|
import { V } from "../lib/Values.js";
|
|
54
81
|
import { LocalProtectionState, ProtectionCommand, RFProtectionState, } from "../lib/_Types.js";
|
|
55
82
|
export const ProtectionCCValues = Object.freeze({
|
|
@@ -88,582 +115,716 @@ export const ProtectionCCValues = Object.freeze({
|
|
|
88
115
|
}),
|
|
89
116
|
}),
|
|
90
117
|
});
|
|
91
|
-
let ProtectionCCAPI =
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
case ProtectionCommand.ExclusiveControlGet:
|
|
106
|
-
case ProtectionCommand.ExclusiveControlSet: {
|
|
107
|
-
return (this.isSinglecast()
|
|
108
|
-
&& this.tryGetValueDB()?.getValue(ProtectionCCValues.supportsExclusiveControl.endpoint(this.endpoint.index)));
|
|
109
|
-
}
|
|
118
|
+
let ProtectionCCAPI = (() => {
|
|
119
|
+
let _classDecorators = [API(CommandClasses.Protection)];
|
|
120
|
+
let _classDescriptor;
|
|
121
|
+
let _classExtraInitializers = [];
|
|
122
|
+
let _classThis;
|
|
123
|
+
let _classSuper = CCAPI;
|
|
124
|
+
var ProtectionCCAPI = 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
|
+
ProtectionCCAPI = _classThis = _classDescriptor.value;
|
|
130
|
+
if (_metadata) Object.defineProperty(_classThis, Symbol.metadata, { enumerable: true, configurable: true, writable: true, value: _metadata });
|
|
131
|
+
__runInitializers(_classThis, _classExtraInitializers);
|
|
110
132
|
}
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
133
|
+
supportsCommand(cmd) {
|
|
134
|
+
switch (cmd) {
|
|
135
|
+
case ProtectionCommand.Get:
|
|
136
|
+
return this.isSinglecast();
|
|
137
|
+
case ProtectionCommand.Set:
|
|
138
|
+
return true; // This is mandatory
|
|
139
|
+
case ProtectionCommand.SupportedGet:
|
|
140
|
+
return this.version >= 2 && this.isSinglecast();
|
|
141
|
+
case ProtectionCommand.TimeoutGet:
|
|
142
|
+
case ProtectionCommand.TimeoutSet: {
|
|
143
|
+
return (this.isSinglecast()
|
|
144
|
+
&& this.tryGetValueDB()?.getValue(ProtectionCCValues.supportsTimeout.endpoint(this.endpoint.index)));
|
|
119
145
|
}
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
else if (property === "rf") {
|
|
125
|
-
if (typeof value !== "number") {
|
|
126
|
-
throwWrongValueType(this.ccId, property, "number", typeof value);
|
|
146
|
+
case ProtectionCommand.ExclusiveControlGet:
|
|
147
|
+
case ProtectionCommand.ExclusiveControlSet: {
|
|
148
|
+
return (this.isSinglecast()
|
|
149
|
+
&& this.tryGetValueDB()?.getValue(ProtectionCCValues.supportsExclusiveControl.endpoint(this.endpoint.index)));
|
|
127
150
|
}
|
|
128
|
-
// We need to set both values together, so retrieve the other one from the value DB
|
|
129
|
-
const local = valueDB?.getValue(ProtectionCCValues.localProtectionState.endpoint(this.endpoint.index));
|
|
130
|
-
return this.set(local ?? LocalProtectionState.Unprotected, value);
|
|
131
151
|
}
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
152
|
+
return super.supportsCommand(cmd);
|
|
153
|
+
}
|
|
154
|
+
get [SET_VALUE]() {
|
|
155
|
+
return async function ({ property }, value) {
|
|
156
|
+
const valueDB = this.tryGetValueDB();
|
|
157
|
+
if (property === "local") {
|
|
158
|
+
if (typeof value !== "number") {
|
|
159
|
+
throwWrongValueType(this.ccId, property, "number", typeof value);
|
|
160
|
+
}
|
|
161
|
+
// We need to set both values together, so retrieve the other one from the value DB
|
|
162
|
+
const rf = valueDB?.getValue(ProtectionCCValues.rfProtectionState.endpoint(this.endpoint.index));
|
|
163
|
+
return this.set(value, rf);
|
|
135
164
|
}
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
return
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
default:
|
|
165
|
+
else if (property === "rf") {
|
|
166
|
+
if (typeof value !== "number") {
|
|
167
|
+
throwWrongValueType(this.ccId, property, "number", typeof value);
|
|
168
|
+
}
|
|
169
|
+
// We need to set both values together, so retrieve the other one from the value DB
|
|
170
|
+
const local = valueDB?.getValue(ProtectionCCValues.localProtectionState.endpoint(this.endpoint.index));
|
|
171
|
+
return this.set(local ?? LocalProtectionState.Unprotected, value);
|
|
172
|
+
}
|
|
173
|
+
else if (property === "exclusiveControlNodeId") {
|
|
174
|
+
if (typeof value !== "number") {
|
|
175
|
+
throwWrongValueType(this.ccId, property, "number", typeof value);
|
|
176
|
+
}
|
|
177
|
+
return this.setExclusiveControl(value);
|
|
178
|
+
}
|
|
179
|
+
else {
|
|
152
180
|
throwUnsupportedProperty(this.ccId, property);
|
|
181
|
+
}
|
|
182
|
+
};
|
|
183
|
+
}
|
|
184
|
+
get [POLL_VALUE]() {
|
|
185
|
+
return async function ({ property }) {
|
|
186
|
+
switch (property) {
|
|
187
|
+
case "local":
|
|
188
|
+
case "rf":
|
|
189
|
+
return (await this.get())?.[property];
|
|
190
|
+
case "exclusiveControlNodeId":
|
|
191
|
+
return this.getExclusiveControl();
|
|
192
|
+
default:
|
|
193
|
+
throwUnsupportedProperty(this.ccId, property);
|
|
194
|
+
}
|
|
195
|
+
};
|
|
196
|
+
}
|
|
197
|
+
// eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types
|
|
198
|
+
async get() {
|
|
199
|
+
this.assertSupportsCommand(ProtectionCommand, ProtectionCommand.Get);
|
|
200
|
+
const cc = new ProtectionCCGet({
|
|
201
|
+
nodeId: this.endpoint.nodeId,
|
|
202
|
+
endpointIndex: this.endpoint.index,
|
|
203
|
+
});
|
|
204
|
+
const response = await this.host.sendCommand(cc, this.commandOptions);
|
|
205
|
+
if (response) {
|
|
206
|
+
return pick(response, ["local", "rf"]);
|
|
153
207
|
}
|
|
154
|
-
};
|
|
155
|
-
}
|
|
156
|
-
// eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types
|
|
157
|
-
async get() {
|
|
158
|
-
this.assertSupportsCommand(ProtectionCommand, ProtectionCommand.Get);
|
|
159
|
-
const cc = new ProtectionCCGet({
|
|
160
|
-
nodeId: this.endpoint.nodeId,
|
|
161
|
-
endpointIndex: this.endpoint.index,
|
|
162
|
-
});
|
|
163
|
-
const response = await this.host.sendCommand(cc, this.commandOptions);
|
|
164
|
-
if (response) {
|
|
165
|
-
return pick(response, ["local", "rf"]);
|
|
166
208
|
}
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
return this.host.sendCommand(cc, this.commandOptions);
|
|
179
|
-
}
|
|
180
|
-
// eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types
|
|
181
|
-
async getSupported() {
|
|
182
|
-
this.assertSupportsCommand(ProtectionCommand, ProtectionCommand.SupportedGet);
|
|
183
|
-
const cc = new ProtectionCCSupportedGet({
|
|
184
|
-
nodeId: this.endpoint.nodeId,
|
|
185
|
-
endpointIndex: this.endpoint.index,
|
|
186
|
-
});
|
|
187
|
-
const response = await this.host.sendCommand(cc, this.commandOptions);
|
|
188
|
-
if (response) {
|
|
189
|
-
return pick(response, [
|
|
190
|
-
"supportsExclusiveControl",
|
|
191
|
-
"supportsTimeout",
|
|
192
|
-
"supportedLocalStates",
|
|
193
|
-
"supportedRFStates",
|
|
194
|
-
]);
|
|
209
|
+
async set(local, rf) {
|
|
210
|
+
__assertType("local", "LocalProtectionState", __assertType__LocalProtectionState.bind(void 0, local));
|
|
211
|
+
__assertType("rf", "(optional) RFProtectionState", __assertType__optional_RFProtectionState.bind(void 0, rf));
|
|
212
|
+
this.assertSupportsCommand(ProtectionCommand, ProtectionCommand.Set);
|
|
213
|
+
const cc = new ProtectionCCSet({
|
|
214
|
+
nodeId: this.endpoint.nodeId,
|
|
215
|
+
endpointIndex: this.endpoint.index,
|
|
216
|
+
local,
|
|
217
|
+
rf,
|
|
218
|
+
});
|
|
219
|
+
return this.host.sendCommand(cc, this.commandOptions);
|
|
195
220
|
}
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
}
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
221
|
+
// eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types
|
|
222
|
+
async getSupported() {
|
|
223
|
+
this.assertSupportsCommand(ProtectionCommand, ProtectionCommand.SupportedGet);
|
|
224
|
+
const cc = new ProtectionCCSupportedGet({
|
|
225
|
+
nodeId: this.endpoint.nodeId,
|
|
226
|
+
endpointIndex: this.endpoint.index,
|
|
227
|
+
});
|
|
228
|
+
const response = await this.host.sendCommand(cc, this.commandOptions);
|
|
229
|
+
if (response) {
|
|
230
|
+
return pick(response, [
|
|
231
|
+
"supportsExclusiveControl",
|
|
232
|
+
"supportsTimeout",
|
|
233
|
+
"supportedLocalStates",
|
|
234
|
+
"supportedRFStates",
|
|
235
|
+
]);
|
|
236
|
+
}
|
|
237
|
+
}
|
|
238
|
+
async getExclusiveControl() {
|
|
239
|
+
this.assertSupportsCommand(ProtectionCommand, ProtectionCommand.ExclusiveControlGet);
|
|
240
|
+
const cc = new ProtectionCCExclusiveControlGet({
|
|
241
|
+
nodeId: this.endpoint.nodeId,
|
|
242
|
+
endpointIndex: this.endpoint.index,
|
|
243
|
+
});
|
|
244
|
+
const response = await this.host.sendCommand(cc, this.commandOptions);
|
|
245
|
+
return response?.exclusiveControlNodeId;
|
|
246
|
+
}
|
|
247
|
+
async setExclusiveControl(nodeId) {
|
|
248
|
+
__assertType("nodeId", "number", __assertType__number.bind(void 0, nodeId));
|
|
249
|
+
this.assertSupportsCommand(ProtectionCommand, ProtectionCommand.ExclusiveControlSet);
|
|
250
|
+
const cc = new ProtectionCCExclusiveControlSet({
|
|
251
|
+
nodeId: this.endpoint.nodeId,
|
|
252
|
+
endpointIndex: this.endpoint.index,
|
|
253
|
+
exclusiveControlNodeId: nodeId,
|
|
254
|
+
});
|
|
255
|
+
return this.host.sendCommand(cc, this.commandOptions);
|
|
256
|
+
}
|
|
257
|
+
async getTimeout() {
|
|
258
|
+
this.assertSupportsCommand(ProtectionCommand, ProtectionCommand.TimeoutGet);
|
|
259
|
+
const cc = new ProtectionCCTimeoutGet({
|
|
260
|
+
nodeId: this.endpoint.nodeId,
|
|
261
|
+
endpointIndex: this.endpoint.index,
|
|
262
|
+
});
|
|
263
|
+
const response = await this.host.sendCommand(cc, this.commandOptions);
|
|
264
|
+
return response?.timeout;
|
|
265
|
+
}
|
|
266
|
+
async setTimeout(timeout) {
|
|
267
|
+
__assertType("timeout", "Timeout", __assertType__Timeout.bind(void 0, timeout));
|
|
268
|
+
this.assertSupportsCommand(ProtectionCommand, ProtectionCommand.TimeoutSet);
|
|
269
|
+
const cc = new ProtectionCCTimeoutSet({
|
|
270
|
+
nodeId: this.endpoint.nodeId,
|
|
271
|
+
endpointIndex: this.endpoint.index,
|
|
272
|
+
timeout,
|
|
273
|
+
});
|
|
274
|
+
return this.host.sendCommand(cc, this.commandOptions);
|
|
275
|
+
}
|
|
276
|
+
};
|
|
277
|
+
return ProtectionCCAPI = _classThis;
|
|
278
|
+
})();
|
|
239
279
|
export { ProtectionCCAPI };
|
|
240
|
-
let ProtectionCC =
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
280
|
+
let ProtectionCC = (() => {
|
|
281
|
+
let _classDecorators = [commandClass(CommandClasses.Protection), implementedVersion(2), ccValues(ProtectionCCValues)];
|
|
282
|
+
let _classDescriptor;
|
|
283
|
+
let _classExtraInitializers = [];
|
|
284
|
+
let _classThis;
|
|
285
|
+
let _classSuper = CommandClass;
|
|
286
|
+
var ProtectionCC = class extends _classSuper {
|
|
287
|
+
static { _classThis = this; }
|
|
288
|
+
static {
|
|
289
|
+
const _metadata = typeof Symbol === "function" && Symbol.metadata ? Object.create(_classSuper[Symbol.metadata] ?? null) : void 0;
|
|
290
|
+
__esDecorate(null, _classDescriptor = { value: _classThis }, _classDecorators, { kind: "class", name: _classThis.name, metadata: _metadata }, null, _classExtraInitializers);
|
|
291
|
+
ProtectionCC = _classThis = _classDescriptor.value;
|
|
292
|
+
if (_metadata) Object.defineProperty(_classThis, Symbol.metadata, { enumerable: true, configurable: true, writable: true, value: _metadata });
|
|
293
|
+
__runInitializers(_classThis, _classExtraInitializers);
|
|
294
|
+
}
|
|
295
|
+
async interview(ctx) {
|
|
296
|
+
const node = this.getNode(ctx);
|
|
297
|
+
const endpoint = this.getEndpoint(ctx);
|
|
298
|
+
const api = CCAPI.create(CommandClasses.Protection, ctx, endpoint).withOptions({
|
|
299
|
+
priority: MessagePriority.NodeQuery,
|
|
300
|
+
});
|
|
257
301
|
ctx.logNode(node.id, {
|
|
258
|
-
|
|
259
|
-
|
|
302
|
+
endpoint: this.endpointIndex,
|
|
303
|
+
message: `Interviewing ${this.ccName}...`,
|
|
304
|
+
direction: "none",
|
|
260
305
|
});
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
306
|
+
// We need to do some queries after a potential timeout
|
|
307
|
+
// In this case, do now mark this CC as interviewed completely
|
|
308
|
+
let hadCriticalTimeout = false;
|
|
309
|
+
// First find out what the device supports
|
|
310
|
+
if (api.version >= 2) {
|
|
311
|
+
ctx.logNode(node.id, {
|
|
312
|
+
message: "querying protection capabilities...",
|
|
313
|
+
direction: "outbound",
|
|
314
|
+
});
|
|
315
|
+
const resp = await api.getSupported();
|
|
316
|
+
if (resp) {
|
|
317
|
+
const logMessage = `received protection capabilities:
|
|
264
318
|
exclusive control: ${resp.supportsExclusiveControl}
|
|
265
319
|
timeout: ${resp.supportsTimeout}
|
|
266
320
|
local protection states: ${resp.supportedLocalStates
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
321
|
+
.map((local) => getEnumMemberName(LocalProtectionState, local))
|
|
322
|
+
.map((str) => `\n· ${str}`)
|
|
323
|
+
.join("")}
|
|
270
324
|
RF protection states: ${resp.supportedRFStates
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
325
|
+
.map((local) => getEnumMemberName(RFProtectionState, local))
|
|
326
|
+
.map((str) => `\n· ${str}`)
|
|
327
|
+
.join("")}`;
|
|
328
|
+
ctx.logNode(node.id, {
|
|
329
|
+
message: logMessage,
|
|
330
|
+
direction: "inbound",
|
|
331
|
+
});
|
|
332
|
+
}
|
|
333
|
+
else {
|
|
334
|
+
hadCriticalTimeout = true;
|
|
335
|
+
}
|
|
281
336
|
}
|
|
337
|
+
await this.refreshValues(ctx);
|
|
338
|
+
// Remember that the interview is complete
|
|
339
|
+
if (!hadCriticalTimeout)
|
|
340
|
+
this.setInterviewComplete(ctx, true);
|
|
282
341
|
}
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
async refreshValues(ctx) {
|
|
289
|
-
const node = this.getNode(ctx);
|
|
290
|
-
const endpoint = this.getEndpoint(ctx);
|
|
291
|
-
const api = CCAPI.create(CommandClasses.Protection, ctx, endpoint).withOptions({
|
|
292
|
-
priority: MessagePriority.NodeQuery,
|
|
293
|
-
});
|
|
294
|
-
const supportsExclusiveControl = !!this.getValue(ctx, ProtectionCCValues.supportsExclusiveControl);
|
|
295
|
-
const supportsTimeout = !!this.getValue(ctx, ProtectionCCValues.supportsTimeout);
|
|
296
|
-
// Query the current state
|
|
297
|
-
ctx.logNode(node.id, {
|
|
298
|
-
message: "querying protection status...",
|
|
299
|
-
direction: "outbound",
|
|
300
|
-
});
|
|
301
|
-
const protectionResp = await api.get();
|
|
302
|
-
if (protectionResp) {
|
|
303
|
-
let logMessage = `received protection status:
|
|
304
|
-
local: ${getEnumMemberName(LocalProtectionState, protectionResp.local)}`;
|
|
305
|
-
if (protectionResp.rf != undefined) {
|
|
306
|
-
logMessage += `
|
|
307
|
-
rf ${getEnumMemberName(RFProtectionState, protectionResp.rf)}`;
|
|
308
|
-
}
|
|
309
|
-
ctx.logNode(node.id, {
|
|
310
|
-
message: logMessage,
|
|
311
|
-
direction: "inbound",
|
|
342
|
+
async refreshValues(ctx) {
|
|
343
|
+
const node = this.getNode(ctx);
|
|
344
|
+
const endpoint = this.getEndpoint(ctx);
|
|
345
|
+
const api = CCAPI.create(CommandClasses.Protection, ctx, endpoint).withOptions({
|
|
346
|
+
priority: MessagePriority.NodeQuery,
|
|
312
347
|
});
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
// Query the current
|
|
348
|
+
const supportsExclusiveControl = !!this.getValue(ctx, ProtectionCCValues.supportsExclusiveControl);
|
|
349
|
+
const supportsTimeout = !!this.getValue(ctx, ProtectionCCValues.supportsTimeout);
|
|
350
|
+
// Query the current state
|
|
316
351
|
ctx.logNode(node.id, {
|
|
317
|
-
message: "querying protection
|
|
352
|
+
message: "querying protection status...",
|
|
318
353
|
direction: "outbound",
|
|
319
354
|
});
|
|
320
|
-
const
|
|
321
|
-
if (
|
|
355
|
+
const protectionResp = await api.get();
|
|
356
|
+
if (protectionResp) {
|
|
357
|
+
let logMessage = `received protection status:
|
|
358
|
+
local: ${getEnumMemberName(LocalProtectionState, protectionResp.local)}`;
|
|
359
|
+
if (protectionResp.rf != undefined) {
|
|
360
|
+
logMessage += `
|
|
361
|
+
rf ${getEnumMemberName(RFProtectionState, protectionResp.rf)}`;
|
|
362
|
+
}
|
|
322
363
|
ctx.logNode(node.id, {
|
|
323
|
-
message:
|
|
364
|
+
message: logMessage,
|
|
324
365
|
direction: "inbound",
|
|
325
366
|
});
|
|
326
367
|
}
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
// Query the current timeout
|
|
330
|
-
ctx.logNode(node.id, {
|
|
331
|
-
message: "querying exclusive control node...",
|
|
332
|
-
direction: "outbound",
|
|
333
|
-
});
|
|
334
|
-
const nodeId = await api.getExclusiveControl();
|
|
335
|
-
if (nodeId != undefined) {
|
|
368
|
+
if (supportsTimeout) {
|
|
369
|
+
// Query the current timeout
|
|
336
370
|
ctx.logNode(node.id, {
|
|
337
|
-
message:
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
371
|
+
message: "querying protection timeout...",
|
|
372
|
+
direction: "outbound",
|
|
373
|
+
});
|
|
374
|
+
const timeout = await api.getTimeout();
|
|
375
|
+
if (timeout) {
|
|
376
|
+
ctx.logNode(node.id, {
|
|
377
|
+
message: `received timeout: ${timeout.toString()}`,
|
|
378
|
+
direction: "inbound",
|
|
379
|
+
});
|
|
380
|
+
}
|
|
381
|
+
}
|
|
382
|
+
if (supportsExclusiveControl) {
|
|
383
|
+
// Query the current timeout
|
|
384
|
+
ctx.logNode(node.id, {
|
|
385
|
+
message: "querying exclusive control node...",
|
|
386
|
+
direction: "outbound",
|
|
341
387
|
});
|
|
388
|
+
const nodeId = await api.getExclusiveControl();
|
|
389
|
+
if (nodeId != undefined) {
|
|
390
|
+
ctx.logNode(node.id, {
|
|
391
|
+
message: (nodeId !== 0
|
|
392
|
+
? `Node ${padStart(nodeId.toString(), 3, "0")}`
|
|
393
|
+
: `no node`) + ` has exclusive control`,
|
|
394
|
+
direction: "inbound",
|
|
395
|
+
});
|
|
396
|
+
}
|
|
342
397
|
}
|
|
343
398
|
}
|
|
344
|
-
}
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
commandClass(CommandClasses.Protection),
|
|
348
|
-
implementedVersion(2),
|
|
349
|
-
ccValues(ProtectionCCValues)
|
|
350
|
-
], ProtectionCC);
|
|
399
|
+
};
|
|
400
|
+
return ProtectionCC = _classThis;
|
|
401
|
+
})();
|
|
351
402
|
export { ProtectionCC };
|
|
352
|
-
let ProtectionCCSet =
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
this.local
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
|
|
383
|
-
|
|
384
|
-
|
|
385
|
-
|
|
386
|
-
|
|
387
|
-
|
|
388
|
-
|
|
389
|
-
|
|
390
|
-
|
|
391
|
-
|
|
392
|
-
|
|
393
|
-
|
|
394
|
-
|
|
395
|
-
|
|
403
|
+
let ProtectionCCSet = (() => {
|
|
404
|
+
let _classDecorators = [CCCommand(ProtectionCommand.Set), useSupervision()];
|
|
405
|
+
let _classDescriptor;
|
|
406
|
+
let _classExtraInitializers = [];
|
|
407
|
+
let _classThis;
|
|
408
|
+
let _classSuper = ProtectionCC;
|
|
409
|
+
var ProtectionCCSet = class extends _classSuper {
|
|
410
|
+
static { _classThis = this; }
|
|
411
|
+
static {
|
|
412
|
+
const _metadata = typeof Symbol === "function" && Symbol.metadata ? Object.create(_classSuper[Symbol.metadata] ?? null) : void 0;
|
|
413
|
+
__esDecorate(null, _classDescriptor = { value: _classThis }, _classDecorators, { kind: "class", name: _classThis.name, metadata: _metadata }, null, _classExtraInitializers);
|
|
414
|
+
ProtectionCCSet = _classThis = _classDescriptor.value;
|
|
415
|
+
if (_metadata) Object.defineProperty(_classThis, Symbol.metadata, { enumerable: true, configurable: true, writable: true, value: _metadata });
|
|
416
|
+
__runInitializers(_classThis, _classExtraInitializers);
|
|
417
|
+
}
|
|
418
|
+
constructor(options) {
|
|
419
|
+
super(options);
|
|
420
|
+
this.local = options.local;
|
|
421
|
+
this.rf = options.rf;
|
|
422
|
+
}
|
|
423
|
+
static from(_raw, _ctx) {
|
|
424
|
+
// TODO: Deserialize payload
|
|
425
|
+
throw new ZWaveError(`${this.name}: deserialization not implemented`, ZWaveErrorCodes.Deserialization_NotImplemented);
|
|
426
|
+
// return new ProtectionCCSet({
|
|
427
|
+
// nodeId: ctx.sourceNodeId,
|
|
428
|
+
// });
|
|
429
|
+
}
|
|
430
|
+
local;
|
|
431
|
+
rf;
|
|
432
|
+
serialize(ctx) {
|
|
433
|
+
this.payload = Bytes.from([
|
|
434
|
+
this.local & 0b1111,
|
|
435
|
+
(this.rf ?? RFProtectionState.Unprotected) & 0b1111,
|
|
436
|
+
]);
|
|
437
|
+
const ccVersion = getEffectiveCCVersion(ctx, this);
|
|
438
|
+
if (ccVersion < 2 && ctx.getDeviceConfig?.(this.nodeId)?.compat?.encodeCCsUsingTargetVersion) {
|
|
439
|
+
// When forcing CC version 1, only include the local state
|
|
440
|
+
this.payload = this.payload.subarray(0, 1);
|
|
441
|
+
}
|
|
442
|
+
return super.serialize(ctx);
|
|
443
|
+
}
|
|
444
|
+
toLogEntry(ctx) {
|
|
445
|
+
const message = {
|
|
446
|
+
local: getEnumMemberName(LocalProtectionState, this.local),
|
|
447
|
+
};
|
|
448
|
+
if (this.rf != undefined) {
|
|
449
|
+
message.rf = getEnumMemberName(RFProtectionState, this.rf);
|
|
450
|
+
}
|
|
451
|
+
return {
|
|
452
|
+
...super.toLogEntry(ctx),
|
|
453
|
+
message,
|
|
454
|
+
};
|
|
455
|
+
}
|
|
456
|
+
};
|
|
457
|
+
return ProtectionCCSet = _classThis;
|
|
458
|
+
})();
|
|
396
459
|
export { ProtectionCCSet };
|
|
397
|
-
let ProtectionCCReport =
|
|
398
|
-
|
|
399
|
-
|
|
400
|
-
|
|
401
|
-
|
|
402
|
-
|
|
403
|
-
|
|
404
|
-
|
|
405
|
-
|
|
406
|
-
|
|
407
|
-
|
|
408
|
-
|
|
409
|
-
|
|
410
|
-
|
|
411
|
-
|
|
412
|
-
|
|
413
|
-
|
|
414
|
-
|
|
415
|
-
|
|
416
|
-
|
|
417
|
-
|
|
418
|
-
|
|
419
|
-
|
|
420
|
-
|
|
421
|
-
|
|
422
|
-
|
|
423
|
-
|
|
424
|
-
|
|
425
|
-
|
|
426
|
-
|
|
427
|
-
|
|
428
|
-
|
|
429
|
-
|
|
430
|
-
|
|
431
|
-
|
|
432
|
-
|
|
433
|
-
|
|
434
|
-
|
|
435
|
-
|
|
436
|
-
|
|
437
|
-
|
|
438
|
-
|
|
439
|
-
|
|
440
|
-
|
|
460
|
+
let ProtectionCCReport = (() => {
|
|
461
|
+
let _classDecorators = [CCCommand(ProtectionCommand.Report), ccValueProperty("local", ProtectionCCValues.localProtectionState), ccValueProperty("rf", ProtectionCCValues.rfProtectionState)];
|
|
462
|
+
let _classDescriptor;
|
|
463
|
+
let _classExtraInitializers = [];
|
|
464
|
+
let _classThis;
|
|
465
|
+
let _classSuper = ProtectionCC;
|
|
466
|
+
var ProtectionCCReport = class extends _classSuper {
|
|
467
|
+
static { _classThis = this; }
|
|
468
|
+
static {
|
|
469
|
+
const _metadata = typeof Symbol === "function" && Symbol.metadata ? Object.create(_classSuper[Symbol.metadata] ?? null) : void 0;
|
|
470
|
+
__esDecorate(null, _classDescriptor = { value: _classThis }, _classDecorators, { kind: "class", name: _classThis.name, metadata: _metadata }, null, _classExtraInitializers);
|
|
471
|
+
ProtectionCCReport = _classThis = _classDescriptor.value;
|
|
472
|
+
if (_metadata) Object.defineProperty(_classThis, Symbol.metadata, { enumerable: true, configurable: true, writable: true, value: _metadata });
|
|
473
|
+
__runInitializers(_classThis, _classExtraInitializers);
|
|
474
|
+
}
|
|
475
|
+
constructor(options) {
|
|
476
|
+
super(options);
|
|
477
|
+
// TODO: Check implementation:
|
|
478
|
+
this.local = options.local;
|
|
479
|
+
this.rf = options.rf;
|
|
480
|
+
}
|
|
481
|
+
static from(raw, ctx) {
|
|
482
|
+
validatePayload(raw.payload.length >= 1);
|
|
483
|
+
const local = raw.payload[0] & 0b1111;
|
|
484
|
+
let rf;
|
|
485
|
+
if (raw.payload.length >= 2) {
|
|
486
|
+
rf = raw.payload[1] & 0b1111;
|
|
487
|
+
}
|
|
488
|
+
return new this({
|
|
489
|
+
nodeId: ctx.sourceNodeId,
|
|
490
|
+
local,
|
|
491
|
+
rf,
|
|
492
|
+
});
|
|
493
|
+
}
|
|
494
|
+
local;
|
|
495
|
+
rf;
|
|
496
|
+
toLogEntry(ctx) {
|
|
497
|
+
const message = {
|
|
498
|
+
local: getEnumMemberName(LocalProtectionState, this.local),
|
|
499
|
+
};
|
|
500
|
+
if (this.rf != undefined) {
|
|
501
|
+
message.rf = getEnumMemberName(RFProtectionState, this.rf);
|
|
502
|
+
}
|
|
503
|
+
return {
|
|
504
|
+
...super.toLogEntry(ctx),
|
|
505
|
+
message,
|
|
506
|
+
};
|
|
507
|
+
}
|
|
508
|
+
};
|
|
509
|
+
return ProtectionCCReport = _classThis;
|
|
510
|
+
})();
|
|
441
511
|
export { ProtectionCCReport };
|
|
442
|
-
let ProtectionCCGet =
|
|
443
|
-
|
|
444
|
-
|
|
445
|
-
|
|
446
|
-
|
|
447
|
-
|
|
512
|
+
let ProtectionCCGet = (() => {
|
|
513
|
+
let _classDecorators = [CCCommand(ProtectionCommand.Get), expectedCCResponse(ProtectionCCReport)];
|
|
514
|
+
let _classDescriptor;
|
|
515
|
+
let _classExtraInitializers = [];
|
|
516
|
+
let _classThis;
|
|
517
|
+
let _classSuper = ProtectionCC;
|
|
518
|
+
var ProtectionCCGet = class extends _classSuper {
|
|
519
|
+
static { _classThis = this; }
|
|
520
|
+
static {
|
|
521
|
+
const _metadata = typeof Symbol === "function" && Symbol.metadata ? Object.create(_classSuper[Symbol.metadata] ?? null) : void 0;
|
|
522
|
+
__esDecorate(null, _classDescriptor = { value: _classThis }, _classDecorators, { kind: "class", name: _classThis.name, metadata: _metadata }, null, _classExtraInitializers);
|
|
523
|
+
ProtectionCCGet = _classThis = _classDescriptor.value;
|
|
524
|
+
if (_metadata) Object.defineProperty(_classThis, Symbol.metadata, { enumerable: true, configurable: true, writable: true, value: _metadata });
|
|
525
|
+
__runInitializers(_classThis, _classExtraInitializers);
|
|
526
|
+
}
|
|
527
|
+
};
|
|
528
|
+
return ProtectionCCGet = _classThis;
|
|
529
|
+
})();
|
|
448
530
|
export { ProtectionCCGet };
|
|
449
|
-
let ProtectionCCSupportedReport =
|
|
450
|
-
|
|
451
|
-
|
|
452
|
-
|
|
453
|
-
|
|
454
|
-
|
|
455
|
-
|
|
456
|
-
|
|
457
|
-
|
|
458
|
-
|
|
459
|
-
|
|
460
|
-
|
|
461
|
-
|
|
462
|
-
|
|
463
|
-
|
|
464
|
-
|
|
465
|
-
|
|
466
|
-
|
|
467
|
-
|
|
468
|
-
|
|
469
|
-
|
|
470
|
-
|
|
471
|
-
|
|
472
|
-
|
|
473
|
-
|
|
474
|
-
|
|
475
|
-
|
|
476
|
-
|
|
477
|
-
|
|
478
|
-
|
|
479
|
-
|
|
480
|
-
|
|
481
|
-
|
|
482
|
-
|
|
483
|
-
|
|
484
|
-
|
|
485
|
-
}
|
|
486
|
-
|
|
487
|
-
|
|
488
|
-
|
|
489
|
-
|
|
490
|
-
|
|
491
|
-
|
|
492
|
-
|
|
493
|
-
|
|
494
|
-
|
|
495
|
-
|
|
496
|
-
|
|
497
|
-
|
|
498
|
-
|
|
499
|
-
|
|
500
|
-
|
|
501
|
-
|
|
502
|
-
|
|
503
|
-
|
|
504
|
-
|
|
505
|
-
|
|
506
|
-
|
|
507
|
-
|
|
508
|
-
|
|
509
|
-
|
|
510
|
-
|
|
511
|
-
|
|
512
|
-
|
|
513
|
-
|
|
514
|
-
|
|
515
|
-
|
|
516
|
-
|
|
517
|
-
|
|
518
|
-
|
|
519
|
-
|
|
520
|
-
|
|
521
|
-
|
|
522
|
-
|
|
523
|
-
|
|
524
|
-
|
|
531
|
+
let ProtectionCCSupportedReport = (() => {
|
|
532
|
+
let _classDecorators = [CCCommand(ProtectionCommand.SupportedReport), ccValueProperty("supportsExclusiveControl", ProtectionCCValues.supportsExclusiveControl), ccValueProperty("supportsTimeout", ProtectionCCValues.supportsTimeout), ccValueProperty("supportedLocalStates", ProtectionCCValues.supportedLocalStates), ccValueProperty("supportedRFStates", ProtectionCCValues.supportedRFStates)];
|
|
533
|
+
let _classDescriptor;
|
|
534
|
+
let _classExtraInitializers = [];
|
|
535
|
+
let _classThis;
|
|
536
|
+
let _classSuper = ProtectionCC;
|
|
537
|
+
var ProtectionCCSupportedReport = class extends _classSuper {
|
|
538
|
+
static { _classThis = this; }
|
|
539
|
+
static {
|
|
540
|
+
const _metadata = typeof Symbol === "function" && Symbol.metadata ? Object.create(_classSuper[Symbol.metadata] ?? null) : void 0;
|
|
541
|
+
__esDecorate(null, _classDescriptor = { value: _classThis }, _classDecorators, { kind: "class", name: _classThis.name, metadata: _metadata }, null, _classExtraInitializers);
|
|
542
|
+
ProtectionCCSupportedReport = _classThis = _classDescriptor.value;
|
|
543
|
+
if (_metadata) Object.defineProperty(_classThis, Symbol.metadata, { enumerable: true, configurable: true, writable: true, value: _metadata });
|
|
544
|
+
__runInitializers(_classThis, _classExtraInitializers);
|
|
545
|
+
}
|
|
546
|
+
constructor(options) {
|
|
547
|
+
super(options);
|
|
548
|
+
// TODO: Check implementation:
|
|
549
|
+
this.supportsTimeout = options.supportsTimeout;
|
|
550
|
+
this.supportsExclusiveControl = options.supportsExclusiveControl;
|
|
551
|
+
this.supportedLocalStates = options.supportedLocalStates;
|
|
552
|
+
this.supportedRFStates = options.supportedRFStates;
|
|
553
|
+
}
|
|
554
|
+
static from(raw, ctx) {
|
|
555
|
+
validatePayload(raw.payload.length >= 5);
|
|
556
|
+
const supportsTimeout = !!(raw.payload[0] & 0b1);
|
|
557
|
+
const supportsExclusiveControl = !!(raw.payload[0] & 0b10);
|
|
558
|
+
const supportedLocalStates = parseBitMask(raw.payload.subarray(1, 3), LocalProtectionState.Unprotected);
|
|
559
|
+
const supportedRFStates = parseBitMask(raw.payload.subarray(3, 5), RFProtectionState.Unprotected);
|
|
560
|
+
return new this({
|
|
561
|
+
nodeId: ctx.sourceNodeId,
|
|
562
|
+
supportsTimeout,
|
|
563
|
+
supportsExclusiveControl,
|
|
564
|
+
supportedLocalStates,
|
|
565
|
+
supportedRFStates,
|
|
566
|
+
});
|
|
567
|
+
}
|
|
568
|
+
persistValues(ctx) {
|
|
569
|
+
if (!super.persistValues(ctx))
|
|
570
|
+
return false;
|
|
571
|
+
// update metadata (partially) for the local and rf values
|
|
572
|
+
const localStateValue = ProtectionCCValues.localProtectionState;
|
|
573
|
+
this.setMetadata(ctx, localStateValue, {
|
|
574
|
+
...localStateValue.meta,
|
|
575
|
+
states: enumValuesToMetadataStates(LocalProtectionState, this.supportedLocalStates),
|
|
576
|
+
});
|
|
577
|
+
const rfStateValue = ProtectionCCValues.rfProtectionState;
|
|
578
|
+
this.setMetadata(ctx, rfStateValue, {
|
|
579
|
+
...rfStateValue.meta,
|
|
580
|
+
states: enumValuesToMetadataStates(RFProtectionState, this.supportedRFStates),
|
|
581
|
+
});
|
|
582
|
+
return true;
|
|
583
|
+
}
|
|
584
|
+
supportsExclusiveControl;
|
|
585
|
+
supportsTimeout;
|
|
586
|
+
supportedLocalStates;
|
|
587
|
+
supportedRFStates;
|
|
588
|
+
toLogEntry(ctx) {
|
|
589
|
+
return {
|
|
590
|
+
...super.toLogEntry(ctx),
|
|
591
|
+
message: {
|
|
592
|
+
"supports exclusive control": this.supportsExclusiveControl,
|
|
593
|
+
"supports timeout": this.supportsTimeout,
|
|
594
|
+
"local protection states": this.supportedLocalStates
|
|
595
|
+
.map((local) => getEnumMemberName(LocalProtectionState, local))
|
|
596
|
+
.map((str) => `\n· ${str}`)
|
|
597
|
+
.join(""),
|
|
598
|
+
"RF protection states": this.supportedRFStates
|
|
599
|
+
.map((rf) => getEnumMemberName(RFProtectionState, rf))
|
|
600
|
+
.map((str) => `\n· ${str}`)
|
|
601
|
+
.join(""),
|
|
602
|
+
},
|
|
603
|
+
};
|
|
604
|
+
}
|
|
605
|
+
};
|
|
606
|
+
return ProtectionCCSupportedReport = _classThis;
|
|
607
|
+
})();
|
|
525
608
|
export { ProtectionCCSupportedReport };
|
|
526
|
-
let ProtectionCCSupportedGet =
|
|
527
|
-
|
|
528
|
-
|
|
529
|
-
|
|
530
|
-
|
|
531
|
-
|
|
609
|
+
let ProtectionCCSupportedGet = (() => {
|
|
610
|
+
let _classDecorators = [CCCommand(ProtectionCommand.SupportedGet), expectedCCResponse(ProtectionCCSupportedReport)];
|
|
611
|
+
let _classDescriptor;
|
|
612
|
+
let _classExtraInitializers = [];
|
|
613
|
+
let _classThis;
|
|
614
|
+
let _classSuper = ProtectionCC;
|
|
615
|
+
var ProtectionCCSupportedGet = class extends _classSuper {
|
|
616
|
+
static { _classThis = this; }
|
|
617
|
+
static {
|
|
618
|
+
const _metadata = typeof Symbol === "function" && Symbol.metadata ? Object.create(_classSuper[Symbol.metadata] ?? null) : void 0;
|
|
619
|
+
__esDecorate(null, _classDescriptor = { value: _classThis }, _classDecorators, { kind: "class", name: _classThis.name, metadata: _metadata }, null, _classExtraInitializers);
|
|
620
|
+
ProtectionCCSupportedGet = _classThis = _classDescriptor.value;
|
|
621
|
+
if (_metadata) Object.defineProperty(_classThis, Symbol.metadata, { enumerable: true, configurable: true, writable: true, value: _metadata });
|
|
622
|
+
__runInitializers(_classThis, _classExtraInitializers);
|
|
623
|
+
}
|
|
624
|
+
};
|
|
625
|
+
return ProtectionCCSupportedGet = _classThis;
|
|
626
|
+
})();
|
|
532
627
|
export { ProtectionCCSupportedGet };
|
|
533
|
-
let ProtectionCCExclusiveControlReport =
|
|
534
|
-
|
|
535
|
-
|
|
536
|
-
|
|
537
|
-
|
|
538
|
-
|
|
539
|
-
|
|
540
|
-
|
|
541
|
-
|
|
542
|
-
|
|
543
|
-
|
|
544
|
-
|
|
545
|
-
|
|
546
|
-
|
|
547
|
-
|
|
548
|
-
|
|
549
|
-
|
|
550
|
-
|
|
551
|
-
|
|
552
|
-
|
|
553
|
-
|
|
554
|
-
|
|
555
|
-
|
|
556
|
-
|
|
557
|
-
|
|
558
|
-
|
|
559
|
-
|
|
560
|
-
|
|
561
|
-
|
|
562
|
-
|
|
628
|
+
let ProtectionCCExclusiveControlReport = (() => {
|
|
629
|
+
let _classDecorators = [CCCommand(ProtectionCommand.ExclusiveControlReport), ccValueProperty("exclusiveControlNodeId", ProtectionCCValues.exclusiveControlNodeId)];
|
|
630
|
+
let _classDescriptor;
|
|
631
|
+
let _classExtraInitializers = [];
|
|
632
|
+
let _classThis;
|
|
633
|
+
let _classSuper = ProtectionCC;
|
|
634
|
+
var ProtectionCCExclusiveControlReport = class extends _classSuper {
|
|
635
|
+
static { _classThis = this; }
|
|
636
|
+
static {
|
|
637
|
+
const _metadata = typeof Symbol === "function" && Symbol.metadata ? Object.create(_classSuper[Symbol.metadata] ?? null) : void 0;
|
|
638
|
+
__esDecorate(null, _classDescriptor = { value: _classThis }, _classDecorators, { kind: "class", name: _classThis.name, metadata: _metadata }, null, _classExtraInitializers);
|
|
639
|
+
ProtectionCCExclusiveControlReport = _classThis = _classDescriptor.value;
|
|
640
|
+
if (_metadata) Object.defineProperty(_classThis, Symbol.metadata, { enumerable: true, configurable: true, writable: true, value: _metadata });
|
|
641
|
+
__runInitializers(_classThis, _classExtraInitializers);
|
|
642
|
+
}
|
|
643
|
+
constructor(options) {
|
|
644
|
+
super(options);
|
|
645
|
+
// TODO: Check implementation:
|
|
646
|
+
this.exclusiveControlNodeId = options.exclusiveControlNodeId;
|
|
647
|
+
}
|
|
648
|
+
static from(raw, ctx) {
|
|
649
|
+
validatePayload(raw.payload.length >= 1);
|
|
650
|
+
const exclusiveControlNodeId = raw.payload[0];
|
|
651
|
+
return new this({
|
|
652
|
+
nodeId: ctx.sourceNodeId,
|
|
653
|
+
exclusiveControlNodeId,
|
|
654
|
+
});
|
|
655
|
+
}
|
|
656
|
+
exclusiveControlNodeId;
|
|
657
|
+
toLogEntry(ctx) {
|
|
658
|
+
return {
|
|
659
|
+
...super.toLogEntry(ctx),
|
|
660
|
+
message: {
|
|
661
|
+
"exclusive control node id": this.exclusiveControlNodeId,
|
|
662
|
+
},
|
|
663
|
+
};
|
|
664
|
+
}
|
|
665
|
+
};
|
|
666
|
+
return ProtectionCCExclusiveControlReport = _classThis;
|
|
667
|
+
})();
|
|
563
668
|
export { ProtectionCCExclusiveControlReport };
|
|
564
|
-
let ProtectionCCExclusiveControlGet =
|
|
565
|
-
|
|
566
|
-
|
|
567
|
-
|
|
568
|
-
|
|
569
|
-
|
|
669
|
+
let ProtectionCCExclusiveControlGet = (() => {
|
|
670
|
+
let _classDecorators = [CCCommand(ProtectionCommand.ExclusiveControlGet), expectedCCResponse(ProtectionCCExclusiveControlReport)];
|
|
671
|
+
let _classDescriptor;
|
|
672
|
+
let _classExtraInitializers = [];
|
|
673
|
+
let _classThis;
|
|
674
|
+
let _classSuper = ProtectionCC;
|
|
675
|
+
var ProtectionCCExclusiveControlGet = class extends _classSuper {
|
|
676
|
+
static { _classThis = this; }
|
|
677
|
+
static {
|
|
678
|
+
const _metadata = typeof Symbol === "function" && Symbol.metadata ? Object.create(_classSuper[Symbol.metadata] ?? null) : void 0;
|
|
679
|
+
__esDecorate(null, _classDescriptor = { value: _classThis }, _classDecorators, { kind: "class", name: _classThis.name, metadata: _metadata }, null, _classExtraInitializers);
|
|
680
|
+
ProtectionCCExclusiveControlGet = _classThis = _classDescriptor.value;
|
|
681
|
+
if (_metadata) Object.defineProperty(_classThis, Symbol.metadata, { enumerable: true, configurable: true, writable: true, value: _metadata });
|
|
682
|
+
__runInitializers(_classThis, _classExtraInitializers);
|
|
683
|
+
}
|
|
684
|
+
};
|
|
685
|
+
return ProtectionCCExclusiveControlGet = _classThis;
|
|
686
|
+
})();
|
|
570
687
|
export { ProtectionCCExclusiveControlGet };
|
|
571
|
-
let ProtectionCCExclusiveControlSet =
|
|
572
|
-
|
|
573
|
-
|
|
574
|
-
|
|
575
|
-
|
|
576
|
-
|
|
577
|
-
|
|
578
|
-
|
|
579
|
-
|
|
580
|
-
|
|
581
|
-
|
|
582
|
-
|
|
583
|
-
|
|
584
|
-
|
|
585
|
-
|
|
586
|
-
|
|
587
|
-
|
|
588
|
-
|
|
589
|
-
|
|
590
|
-
|
|
591
|
-
|
|
592
|
-
|
|
593
|
-
|
|
594
|
-
|
|
595
|
-
|
|
596
|
-
}
|
|
597
|
-
|
|
598
|
-
|
|
599
|
-
|
|
600
|
-
|
|
601
|
-
|
|
688
|
+
let ProtectionCCExclusiveControlSet = (() => {
|
|
689
|
+
let _classDecorators = [CCCommand(ProtectionCommand.ExclusiveControlSet), expectedCCResponse(ProtectionCCReport), useSupervision()];
|
|
690
|
+
let _classDescriptor;
|
|
691
|
+
let _classExtraInitializers = [];
|
|
692
|
+
let _classThis;
|
|
693
|
+
let _classSuper = ProtectionCC;
|
|
694
|
+
var ProtectionCCExclusiveControlSet = class extends _classSuper {
|
|
695
|
+
static { _classThis = this; }
|
|
696
|
+
static {
|
|
697
|
+
const _metadata = typeof Symbol === "function" && Symbol.metadata ? Object.create(_classSuper[Symbol.metadata] ?? null) : void 0;
|
|
698
|
+
__esDecorate(null, _classDescriptor = { value: _classThis }, _classDecorators, { kind: "class", name: _classThis.name, metadata: _metadata }, null, _classExtraInitializers);
|
|
699
|
+
ProtectionCCExclusiveControlSet = _classThis = _classDescriptor.value;
|
|
700
|
+
if (_metadata) Object.defineProperty(_classThis, Symbol.metadata, { enumerable: true, configurable: true, writable: true, value: _metadata });
|
|
701
|
+
__runInitializers(_classThis, _classExtraInitializers);
|
|
702
|
+
}
|
|
703
|
+
constructor(options) {
|
|
704
|
+
super(options);
|
|
705
|
+
this.exclusiveControlNodeId = options.exclusiveControlNodeId;
|
|
706
|
+
}
|
|
707
|
+
static from(_raw, _ctx) {
|
|
708
|
+
// TODO: Deserialize payload
|
|
709
|
+
throw new ZWaveError(`${this.name}: deserialization not implemented`, ZWaveErrorCodes.Deserialization_NotImplemented);
|
|
710
|
+
// return new ProtectionCCExclusiveControlSet({
|
|
711
|
+
// nodeId: ctx.sourceNodeId,
|
|
712
|
+
// });
|
|
713
|
+
}
|
|
714
|
+
exclusiveControlNodeId;
|
|
715
|
+
serialize(ctx) {
|
|
716
|
+
this.payload = Bytes.from([this.exclusiveControlNodeId]);
|
|
717
|
+
return super.serialize(ctx);
|
|
718
|
+
}
|
|
719
|
+
toLogEntry(ctx) {
|
|
720
|
+
return {
|
|
721
|
+
...super.toLogEntry(ctx),
|
|
722
|
+
message: {
|
|
723
|
+
"exclusive control node id": this.exclusiveControlNodeId,
|
|
724
|
+
},
|
|
725
|
+
};
|
|
726
|
+
}
|
|
727
|
+
};
|
|
728
|
+
return ProtectionCCExclusiveControlSet = _classThis;
|
|
729
|
+
})();
|
|
602
730
|
export { ProtectionCCExclusiveControlSet };
|
|
603
|
-
let ProtectionCCTimeoutReport =
|
|
604
|
-
|
|
605
|
-
|
|
606
|
-
|
|
607
|
-
|
|
608
|
-
|
|
609
|
-
|
|
610
|
-
|
|
611
|
-
|
|
612
|
-
|
|
613
|
-
|
|
614
|
-
|
|
615
|
-
|
|
616
|
-
|
|
617
|
-
|
|
618
|
-
|
|
619
|
-
|
|
620
|
-
|
|
621
|
-
|
|
622
|
-
}
|
|
623
|
-
|
|
624
|
-
|
|
625
|
-
|
|
626
|
-
|
|
627
|
-
|
|
628
|
-
|
|
629
|
-
|
|
630
|
-
|
|
731
|
+
let ProtectionCCTimeoutReport = (() => {
|
|
732
|
+
let _classDecorators = [CCCommand(ProtectionCommand.TimeoutReport), ccValueProperty("timeout", ProtectionCCValues.timeout)];
|
|
733
|
+
let _classDescriptor;
|
|
734
|
+
let _classExtraInitializers = [];
|
|
735
|
+
let _classThis;
|
|
736
|
+
let _classSuper = ProtectionCC;
|
|
737
|
+
var ProtectionCCTimeoutReport = class extends _classSuper {
|
|
738
|
+
static { _classThis = this; }
|
|
739
|
+
static {
|
|
740
|
+
const _metadata = typeof Symbol === "function" && Symbol.metadata ? Object.create(_classSuper[Symbol.metadata] ?? null) : void 0;
|
|
741
|
+
__esDecorate(null, _classDescriptor = { value: _classThis }, _classDecorators, { kind: "class", name: _classThis.name, metadata: _metadata }, null, _classExtraInitializers);
|
|
742
|
+
ProtectionCCTimeoutReport = _classThis = _classDescriptor.value;
|
|
743
|
+
if (_metadata) Object.defineProperty(_classThis, Symbol.metadata, { enumerable: true, configurable: true, writable: true, value: _metadata });
|
|
744
|
+
__runInitializers(_classThis, _classExtraInitializers);
|
|
745
|
+
}
|
|
746
|
+
constructor(options) {
|
|
747
|
+
super(options);
|
|
748
|
+
// TODO: Check implementation:
|
|
749
|
+
this.timeout = options.timeout;
|
|
750
|
+
}
|
|
751
|
+
static from(raw, ctx) {
|
|
752
|
+
validatePayload(raw.payload.length >= 1);
|
|
753
|
+
const timeout = Timeout.parse(raw.payload[0]);
|
|
754
|
+
return new this({
|
|
755
|
+
nodeId: ctx.sourceNodeId,
|
|
756
|
+
timeout,
|
|
757
|
+
});
|
|
758
|
+
}
|
|
759
|
+
timeout;
|
|
760
|
+
toLogEntry(ctx) {
|
|
761
|
+
return {
|
|
762
|
+
...super.toLogEntry(ctx),
|
|
763
|
+
message: { timeout: this.timeout.toString() },
|
|
764
|
+
};
|
|
765
|
+
}
|
|
766
|
+
};
|
|
767
|
+
return ProtectionCCTimeoutReport = _classThis;
|
|
768
|
+
})();
|
|
631
769
|
export { ProtectionCCTimeoutReport };
|
|
632
|
-
let ProtectionCCTimeoutGet =
|
|
633
|
-
|
|
634
|
-
|
|
635
|
-
|
|
636
|
-
|
|
637
|
-
|
|
770
|
+
let ProtectionCCTimeoutGet = (() => {
|
|
771
|
+
let _classDecorators = [CCCommand(ProtectionCommand.TimeoutGet), expectedCCResponse(ProtectionCCTimeoutReport)];
|
|
772
|
+
let _classDescriptor;
|
|
773
|
+
let _classExtraInitializers = [];
|
|
774
|
+
let _classThis;
|
|
775
|
+
let _classSuper = ProtectionCC;
|
|
776
|
+
var ProtectionCCTimeoutGet = class extends _classSuper {
|
|
777
|
+
static { _classThis = this; }
|
|
778
|
+
static {
|
|
779
|
+
const _metadata = typeof Symbol === "function" && Symbol.metadata ? Object.create(_classSuper[Symbol.metadata] ?? null) : void 0;
|
|
780
|
+
__esDecorate(null, _classDescriptor = { value: _classThis }, _classDecorators, { kind: "class", name: _classThis.name, metadata: _metadata }, null, _classExtraInitializers);
|
|
781
|
+
ProtectionCCTimeoutGet = _classThis = _classDescriptor.value;
|
|
782
|
+
if (_metadata) Object.defineProperty(_classThis, Symbol.metadata, { enumerable: true, configurable: true, writable: true, value: _metadata });
|
|
783
|
+
__runInitializers(_classThis, _classExtraInitializers);
|
|
784
|
+
}
|
|
785
|
+
};
|
|
786
|
+
return ProtectionCCTimeoutGet = _classThis;
|
|
787
|
+
})();
|
|
638
788
|
export { ProtectionCCTimeoutGet };
|
|
639
|
-
let ProtectionCCTimeoutSet =
|
|
640
|
-
|
|
641
|
-
|
|
642
|
-
|
|
643
|
-
|
|
644
|
-
|
|
645
|
-
|
|
646
|
-
|
|
647
|
-
|
|
648
|
-
|
|
649
|
-
|
|
650
|
-
|
|
651
|
-
|
|
652
|
-
|
|
653
|
-
|
|
654
|
-
|
|
655
|
-
|
|
656
|
-
|
|
657
|
-
|
|
658
|
-
|
|
659
|
-
|
|
660
|
-
|
|
661
|
-
|
|
662
|
-
|
|
663
|
-
|
|
664
|
-
|
|
665
|
-
|
|
666
|
-
|
|
667
|
-
|
|
789
|
+
let ProtectionCCTimeoutSet = (() => {
|
|
790
|
+
let _classDecorators = [CCCommand(ProtectionCommand.TimeoutSet), expectedCCResponse(ProtectionCCReport), useSupervision()];
|
|
791
|
+
let _classDescriptor;
|
|
792
|
+
let _classExtraInitializers = [];
|
|
793
|
+
let _classThis;
|
|
794
|
+
let _classSuper = ProtectionCC;
|
|
795
|
+
var ProtectionCCTimeoutSet = class extends _classSuper {
|
|
796
|
+
static { _classThis = this; }
|
|
797
|
+
static {
|
|
798
|
+
const _metadata = typeof Symbol === "function" && Symbol.metadata ? Object.create(_classSuper[Symbol.metadata] ?? null) : void 0;
|
|
799
|
+
__esDecorate(null, _classDescriptor = { value: _classThis }, _classDecorators, { kind: "class", name: _classThis.name, metadata: _metadata }, null, _classExtraInitializers);
|
|
800
|
+
ProtectionCCTimeoutSet = _classThis = _classDescriptor.value;
|
|
801
|
+
if (_metadata) Object.defineProperty(_classThis, Symbol.metadata, { enumerable: true, configurable: true, writable: true, value: _metadata });
|
|
802
|
+
__runInitializers(_classThis, _classExtraInitializers);
|
|
803
|
+
}
|
|
804
|
+
constructor(options) {
|
|
805
|
+
super(options);
|
|
806
|
+
this.timeout = options.timeout;
|
|
807
|
+
}
|
|
808
|
+
static from(_raw, _ctx) {
|
|
809
|
+
// TODO: Deserialize payload
|
|
810
|
+
throw new ZWaveError(`${this.name}: deserialization not implemented`, ZWaveErrorCodes.Deserialization_NotImplemented);
|
|
811
|
+
// return new ProtectionCCTimeoutSet({
|
|
812
|
+
// nodeId: ctx.sourceNodeId,
|
|
813
|
+
// });
|
|
814
|
+
}
|
|
815
|
+
timeout;
|
|
816
|
+
serialize(ctx) {
|
|
817
|
+
this.payload = Bytes.from([this.timeout.serialize()]);
|
|
818
|
+
return super.serialize(ctx);
|
|
819
|
+
}
|
|
820
|
+
toLogEntry(ctx) {
|
|
821
|
+
return {
|
|
822
|
+
...super.toLogEntry(ctx),
|
|
823
|
+
message: { timeout: this.timeout.toString() },
|
|
824
|
+
};
|
|
825
|
+
}
|
|
826
|
+
};
|
|
827
|
+
return ProtectionCCTimeoutSet = _classThis;
|
|
828
|
+
})();
|
|
668
829
|
export { ProtectionCCTimeoutSet };
|
|
669
830
|
//# sourceMappingURL=ProtectionCC.js.map
|