@zwave-js/cc 14.0.0-beta.4 → 14.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/build/cjs/cc/AlarmSensorCC.js +381 -266
- package/build/cjs/cc/AlarmSensorCC.js.map +3 -3
- package/build/cjs/cc/AssociationCC.js +669 -503
- package/build/cjs/cc/AssociationCC.js.map +3 -3
- package/build/cjs/cc/AssociationGroupInfoCC.js +633 -492
- package/build/cjs/cc/AssociationGroupInfoCC.js.map +3 -3
- package/build/cjs/cc/BarrierOperatorCC.js +595 -429
- package/build/cjs/cc/BarrierOperatorCC.js.map +3 -3
- package/build/cjs/cc/BasicCC.js +354 -260
- package/build/cjs/cc/BasicCC.js.map +3 -3
- package/build/cjs/cc/BatteryCC.js +427 -345
- package/build/cjs/cc/BatteryCC.js.map +3 -3
- package/build/cjs/cc/BinarySensorCC.js +391 -276
- package/build/cjs/cc/BinarySensorCC.js.map +3 -3
- package/build/cjs/cc/BinarySwitchCC.js +347 -253
- package/build/cjs/cc/BinarySwitchCC.js.map +3 -3
- package/build/cjs/cc/CRC16CC.js +160 -85
- package/build/cjs/cc/CRC16CC.js.map +3 -3
- package/build/cjs/cc/CentralSceneCC.js +459 -324
- package/build/cjs/cc/CentralSceneCC.js.map +3 -3
- package/build/cjs/cc/ClimateControlScheduleCC.js +459 -293
- package/build/cjs/cc/ClimateControlScheduleCC.js.map +3 -3
- package/build/cjs/cc/ClockCC.js +254 -150
- package/build/cjs/cc/ClockCC.js.map +3 -3
- package/build/cjs/cc/ColorSwitchCC.js +758 -610
- package/build/cjs/cc/ColorSwitchCC.js.map +3 -3
- package/build/cjs/cc/ConfigurationCC.js +1700 -1453
- package/build/cjs/cc/ConfigurationCC.js.map +3 -3
- package/build/cjs/cc/DeviceResetLocallyCC.js +125 -49
- package/build/cjs/cc/DeviceResetLocallyCC.js.map +3 -3
- package/build/cjs/cc/DoorLockCC.js +904 -777
- package/build/cjs/cc/DoorLockCC.js.map +3 -3
- package/build/cjs/cc/DoorLockLoggingCC.js +321 -206
- package/build/cjs/cc/DoorLockLoggingCC.js.map +3 -3
- package/build/cjs/cc/EnergyProductionCC.js +249 -160
- package/build/cjs/cc/EnergyProductionCC.js.map +3 -3
- package/build/cjs/cc/EntryControlCC.js +619 -458
- package/build/cjs/cc/EntryControlCC.js.map +3 -3
- package/build/cjs/cc/FirmwareUpdateMetaDataCC.js +898 -698
- package/build/cjs/cc/FirmwareUpdateMetaDataCC.js.map +3 -3
- package/build/cjs/cc/HailCC.js +57 -11
- package/build/cjs/cc/HailCC.js.map +2 -2
- package/build/cjs/cc/HumidityControlModeCC.js +359 -233
- package/build/cjs/cc/HumidityControlModeCC.js.map +3 -3
- package/build/cjs/cc/HumidityControlOperatingStateCC.js +189 -103
- package/build/cjs/cc/HumidityControlOperatingStateCC.js.map +3 -3
- package/build/cjs/cc/HumidityControlSetpointCC.js +682 -495
- package/build/cjs/cc/HumidityControlSetpointCC.js.map +3 -3
- package/build/cjs/cc/InclusionControllerCC.js +205 -114
- package/build/cjs/cc/InclusionControllerCC.js.map +3 -3
- package/build/cjs/cc/IndicatorCC.js +897 -736
- package/build/cjs/cc/IndicatorCC.js.map +3 -3
- package/build/cjs/cc/IrrigationCC.js +1651 -1405
- package/build/cjs/cc/IrrigationCC.js.map +3 -3
- package/build/cjs/cc/LanguageCC.js +268 -171
- package/build/cjs/cc/LanguageCC.js.map +3 -3
- package/build/cjs/cc/LockCC.js +254 -154
- package/build/cjs/cc/LockCC.js.map +3 -3
- package/build/cjs/cc/ManufacturerProprietaryCC.js +189 -129
- package/build/cjs/cc/ManufacturerProprietaryCC.js.map +2 -2
- package/build/cjs/cc/ManufacturerSpecificCC.js +319 -213
- package/build/cjs/cc/ManufacturerSpecificCC.js.map +3 -3
- package/build/cjs/cc/MeterCC.js +827 -707
- package/build/cjs/cc/MeterCC.js.map +3 -3
- package/build/cjs/cc/MultiChannelAssociationCC.js +612 -478
- package/build/cjs/cc/MultiChannelAssociationCC.js.map +3 -3
- package/build/cjs/cc/MultiChannelCC.js +1037 -819
- package/build/cjs/cc/MultiChannelCC.js.map +3 -3
- package/build/cjs/cc/MultiCommandCC.js +172 -97
- package/build/cjs/cc/MultiCommandCC.js.map +3 -3
- package/build/cjs/cc/MultilevelSensorCC.js +589 -449
- package/build/cjs/cc/MultilevelSensorCC.js.map +3 -3
- package/build/cjs/cc/MultilevelSwitchCC.js +587 -439
- package/build/cjs/cc/MultilevelSwitchCC.js.map +3 -3
- package/build/cjs/cc/NoOperationCC.js +89 -27
- package/build/cjs/cc/NoOperationCC.js.map +2 -2
- package/build/cjs/cc/NodeNamingCC.js +417 -277
- package/build/cjs/cc/NodeNamingCC.js.map +3 -3
- package/build/cjs/cc/NotificationCC.js +972 -818
- package/build/cjs/cc/NotificationCC.js.map +3 -3
- package/build/cjs/cc/PowerlevelCC.js +450 -303
- package/build/cjs/cc/PowerlevelCC.js.map +3 -3
- package/build/cjs/cc/ProtectionCC.js +686 -494
- package/build/cjs/cc/ProtectionCC.js.map +3 -3
- package/build/cjs/cc/SceneActivationCC.js +165 -97
- package/build/cjs/cc/SceneActivationCC.js.map +3 -3
- package/build/cjs/cc/SceneActuatorConfigurationCC.js +346 -243
- package/build/cjs/cc/SceneActuatorConfigurationCC.js.map +3 -3
- package/build/cjs/cc/SceneControllerConfigurationCC.js +401 -298
- package/build/cjs/cc/SceneControllerConfigurationCC.js.map +3 -3
- package/build/cjs/cc/ScheduleEntryLockCC.js +1552 -1272
- package/build/cjs/cc/ScheduleEntryLockCC.js.map +3 -3
- package/build/cjs/cc/Security2CC.js +1483 -1219
- package/build/cjs/cc/Security2CC.js.map +3 -3
- package/build/cjs/cc/SecurityCC.js +839 -619
- package/build/cjs/cc/SecurityCC.js.map +3 -3
- package/build/cjs/cc/SoundSwitchCC.js +707 -515
- package/build/cjs/cc/SoundSwitchCC.js.map +3 -3
- package/build/cjs/cc/SupervisionCC.js +327 -237
- package/build/cjs/cc/SupervisionCC.js.map +3 -3
- package/build/cjs/cc/ThermostatFanModeCC.js +386 -263
- package/build/cjs/cc/ThermostatFanModeCC.js.map +3 -3
- package/build/cjs/cc/ThermostatFanStateCC.js +192 -106
- package/build/cjs/cc/ThermostatFanStateCC.js.map +3 -3
- package/build/cjs/cc/ThermostatModeCC.js +425 -302
- package/build/cjs/cc/ThermostatModeCC.js.map +3 -3
- package/build/cjs/cc/ThermostatOperatingStateCC.js +188 -102
- package/build/cjs/cc/ThermostatOperatingStateCC.js.map +3 -3
- package/build/cjs/cc/ThermostatSetbackCC.js +277 -173
- package/build/cjs/cc/ThermostatSetbackCC.js.map +3 -3
- package/build/cjs/cc/ThermostatSetpointCC.js +645 -491
- package/build/cjs/cc/ThermostatSetpointCC.js.map +3 -3
- package/build/cjs/cc/TimeCC.js +515 -353
- package/build/cjs/cc/TimeCC.js.map +3 -3
- package/build/cjs/cc/TimeParametersCC.js +302 -202
- package/build/cjs/cc/TimeParametersCC.js.map +3 -3
- package/build/cjs/cc/TransportServiceCC.js +433 -315
- package/build/cjs/cc/TransportServiceCC.js.map +3 -3
- package/build/cjs/cc/UserCodeCC.js +1385 -1102
- package/build/cjs/cc/UserCodeCC.js.map +3 -3
- package/build/cjs/cc/VersionCC.js +696 -562
- package/build/cjs/cc/VersionCC.js.map +3 -3
- package/build/cjs/cc/WakeUpCC.js +499 -346
- package/build/cjs/cc/WakeUpCC.js.map +3 -3
- package/build/cjs/cc/WindowCoveringCC.js +626 -478
- package/build/cjs/cc/WindowCoveringCC.js.map +3 -3
- package/build/cjs/cc/ZWaveLongRangeCC.js +57 -10
- package/build/cjs/cc/ZWaveLongRangeCC.js.map +2 -2
- package/build/cjs/cc/ZWavePlusCC.js +233 -159
- package/build/cjs/cc/ZWavePlusCC.js.map +3 -3
- package/build/cjs/cc/ZWaveProtocolCC.js +1515 -948
- package/build/cjs/cc/ZWaveProtocolCC.js.map +3 -3
- package/build/cjs/cc/manufacturerProprietary/Decorators.d.ts +4 -4
- package/build/cjs/cc/manufacturerProprietary/Decorators.js.map +1 -1
- package/build/cjs/cc/manufacturerProprietary/FibaroCC.js +395 -274
- package/build/cjs/cc/manufacturerProprietary/FibaroCC.js.map +3 -3
- package/build/cjs/lib/CommandClassDecorators.d.ts +11 -15
- package/build/cjs/lib/CommandClassDecorators.js +19 -20
- package/build/cjs/lib/CommandClassDecorators.js.map +2 -2
- package/build/cjs/lib/Security2/Extension.d.ts +1 -1
- package/build/cjs/lib/Security2/Extension.js +217 -126
- package/build/cjs/lib/Security2/Extension.js.map +3 -3
- package/build/esm/cc/AlarmSensorCC.d.ts.map +1 -1
- package/build/esm/cc/AlarmSensorCC.js +389 -291
- package/build/esm/cc/AlarmSensorCC.js.map +1 -1
- package/build/esm/cc/AssociationCC.d.ts.map +1 -1
- package/build/esm/cc/AssociationCC.js +678 -537
- package/build/esm/cc/AssociationCC.js.map +1 -1
- package/build/esm/cc/AssociationGroupInfoCC.d.ts.map +1 -1
- package/build/esm/cc/AssociationGroupInfoCC.js +659 -539
- package/build/esm/cc/AssociationGroupInfoCC.js.map +1 -1
- package/build/esm/cc/BarrierOperatorCC.d.ts.map +1 -1
- package/build/esm/cc/BarrierOperatorCC.js +634 -493
- package/build/esm/cc/BarrierOperatorCC.js.map +1 -1
- package/build/esm/cc/BasicCC.d.ts.map +1 -1
- package/build/esm/cc/BasicCC.js +380 -302
- package/build/esm/cc/BasicCC.js.map +1 -1
- package/build/esm/cc/BatteryCC.d.ts.map +1 -1
- package/build/esm/cc/BatteryCC.js +449 -384
- package/build/esm/cc/BatteryCC.js.map +1 -1
- package/build/esm/cc/BinarySensorCC.d.ts.map +1 -1
- package/build/esm/cc/BinarySensorCC.js +395 -297
- package/build/esm/cc/BinarySensorCC.js.map +1 -1
- package/build/esm/cc/BinarySwitchCC.d.ts.map +1 -1
- package/build/esm/cc/BinarySwitchCC.js +353 -274
- package/build/esm/cc/BinarySwitchCC.js.map +1 -1
- package/build/esm/cc/CRC16CC.js +162 -98
- package/build/esm/cc/CRC16CC.js.map +1 -1
- package/build/esm/cc/CentralSceneCC.d.ts.map +1 -1
- package/build/esm/cc/CentralSceneCC.js +465 -351
- package/build/esm/cc/CentralSceneCC.js.map +1 -1
- package/build/esm/cc/ClimateControlScheduleCC.d.ts.map +1 -1
- package/build/esm/cc/ClimateControlScheduleCC.js +454 -313
- package/build/esm/cc/ClimateControlScheduleCC.js.map +1 -1
- package/build/esm/cc/ClockCC.js +248 -159
- package/build/esm/cc/ClockCC.js.map +1 -1
- package/build/esm/cc/ColorSwitchCC.d.ts.map +1 -1
- package/build/esm/cc/ColorSwitchCC.js +802 -677
- package/build/esm/cc/ColorSwitchCC.js.map +1 -1
- package/build/esm/cc/ConfigurationCC.js +1899 -1687
- package/build/esm/cc/ConfigurationCC.js.map +1 -1
- package/build/esm/cc/DeviceResetLocallyCC.js +124 -59
- package/build/esm/cc/DeviceResetLocallyCC.js.map +1 -1
- package/build/esm/cc/DoorLockCC.d.ts.map +1 -1
- package/build/esm/cc/DoorLockCC.js +951 -849
- package/build/esm/cc/DoorLockCC.js.map +1 -1
- package/build/esm/cc/DoorLockLoggingCC.d.ts.map +1 -1
- package/build/esm/cc/DoorLockLoggingCC.js +316 -218
- package/build/esm/cc/DoorLockLoggingCC.js.map +1 -1
- package/build/esm/cc/EnergyProductionCC.js +240 -164
- package/build/esm/cc/EnergyProductionCC.js.map +1 -1
- package/build/esm/cc/EntryControlCC.d.ts.map +1 -1
- package/build/esm/cc/EntryControlCC.js +629 -493
- package/build/esm/cc/EntryControlCC.js.map +1 -1
- package/build/esm/cc/FirmwareUpdateMetaDataCC.d.ts.map +1 -1
- package/build/esm/cc/FirmwareUpdateMetaDataCC.js +938 -769
- package/build/esm/cc/FirmwareUpdateMetaDataCC.js.map +1 -1
- package/build/esm/cc/HailCC.js +51 -12
- package/build/esm/cc/HailCC.js.map +1 -1
- package/build/esm/cc/HumidityControlModeCC.d.ts.map +1 -1
- package/build/esm/cc/HumidityControlModeCC.js +357 -250
- package/build/esm/cc/HumidityControlModeCC.js.map +1 -1
- package/build/esm/cc/HumidityControlOperatingStateCC.d.ts.map +1 -1
- package/build/esm/cc/HumidityControlOperatingStateCC.js +182 -109
- package/build/esm/cc/HumidityControlOperatingStateCC.js.map +1 -1
- package/build/esm/cc/HumidityControlSetpointCC.d.ts.map +1 -1
- package/build/esm/cc/HumidityControlSetpointCC.js +706 -546
- package/build/esm/cc/HumidityControlSetpointCC.js.map +1 -1
- package/build/esm/cc/InclusionControllerCC.js +197 -119
- package/build/esm/cc/InclusionControllerCC.js.map +1 -1
- package/build/esm/cc/IndicatorCC.js +973 -835
- package/build/esm/cc/IndicatorCC.js.map +1 -1
- package/build/esm/cc/IrrigationCC.d.ts.map +1 -1
- package/build/esm/cc/IrrigationCC.js +1697 -1496
- package/build/esm/cc/IrrigationCC.js.map +1 -1
- package/build/esm/cc/LanguageCC.d.ts.map +1 -1
- package/build/esm/cc/LanguageCC.js +266 -184
- package/build/esm/cc/LanguageCC.js.map +1 -1
- package/build/esm/cc/LockCC.d.ts.map +1 -1
- package/build/esm/cc/LockCC.js +247 -162
- package/build/esm/cc/LockCC.js.map +1 -1
- package/build/esm/cc/ManufacturerProprietaryCC.js +192 -141
- package/build/esm/cc/ManufacturerProprietaryCC.js.map +1 -1
- package/build/esm/cc/ManufacturerSpecificCC.d.ts.map +1 -1
- package/build/esm/cc/ManufacturerSpecificCC.js +312 -223
- package/build/esm/cc/ManufacturerSpecificCC.js.map +1 -1
- package/build/esm/cc/MeterCC.d.ts.map +1 -1
- package/build/esm/cc/MeterCC.js +896 -795
- package/build/esm/cc/MeterCC.js.map +1 -1
- package/build/esm/cc/MultiChannelAssociationCC.d.ts.map +1 -1
- package/build/esm/cc/MultiChannelAssociationCC.js +631 -518
- package/build/esm/cc/MultiChannelAssociationCC.js.map +1 -1
- package/build/esm/cc/MultiChannelCC.d.ts.map +1 -1
- package/build/esm/cc/MultiChannelCC.js +1106 -921
- package/build/esm/cc/MultiChannelCC.js.map +1 -1
- package/build/esm/cc/MultiCommandCC.js +166 -102
- package/build/esm/cc/MultiCommandCC.js.map +1 -1
- package/build/esm/cc/MultilevelSensorCC.d.ts.map +1 -1
- package/build/esm/cc/MultilevelSensorCC.js +616 -497
- package/build/esm/cc/MultilevelSensorCC.js.map +1 -1
- package/build/esm/cc/MultilevelSwitchCC.d.ts.map +1 -1
- package/build/esm/cc/MultilevelSwitchCC.js +621 -496
- package/build/esm/cc/MultilevelSwitchCC.js.map +1 -1
- package/build/esm/cc/NoOperationCC.js +82 -29
- package/build/esm/cc/NoOperationCC.js.map +1 -1
- package/build/esm/cc/NodeNamingCC.d.ts.map +1 -1
- package/build/esm/cc/NodeNamingCC.js +413 -294
- package/build/esm/cc/NodeNamingCC.js.map +1 -1
- package/build/esm/cc/NotificationCC.d.ts.map +1 -1
- package/build/esm/cc/NotificationCC.js +1097 -966
- package/build/esm/cc/NotificationCC.js.map +1 -1
- package/build/esm/cc/PowerlevelCC.js +437 -311
- package/build/esm/cc/PowerlevelCC.js.map +1 -1
- package/build/esm/cc/ProtectionCC.d.ts.map +1 -1
- package/build/esm/cc/ProtectionCC.js +704 -543
- package/build/esm/cc/ProtectionCC.js.map +1 -1
- package/build/esm/cc/SceneActivationCC.d.ts.map +1 -1
- package/build/esm/cc/SceneActivationCC.js +157 -100
- package/build/esm/cc/SceneActivationCC.js.map +1 -1
- package/build/esm/cc/SceneActuatorConfigurationCC.js +357 -269
- package/build/esm/cc/SceneActuatorConfigurationCC.js.map +1 -1
- package/build/esm/cc/SceneControllerConfigurationCC.js +434 -346
- package/build/esm/cc/SceneControllerConfigurationCC.js.map +1 -1
- package/build/esm/cc/ScheduleEntryLockCC.d.ts.map +1 -1
- package/build/esm/cc/ScheduleEntryLockCC.js +1596 -1357
- package/build/esm/cc/ScheduleEntryLockCC.js.map +1 -1
- package/build/esm/cc/Security2CC.js +1633 -1406
- package/build/esm/cc/Security2CC.js.map +1 -1
- package/build/esm/cc/SecurityCC.js +876 -687
- package/build/esm/cc/SecurityCC.js.map +1 -1
- package/build/esm/cc/SoundSwitchCC.d.ts.map +1 -1
- package/build/esm/cc/SoundSwitchCC.js +689 -526
- package/build/esm/cc/SoundSwitchCC.js.map +1 -1
- package/build/esm/cc/SupervisionCC.js +349 -272
- package/build/esm/cc/SupervisionCC.js.map +1 -1
- package/build/esm/cc/ThermostatFanModeCC.d.ts.map +1 -1
- package/build/esm/cc/ThermostatFanModeCC.js +388 -284
- package/build/esm/cc/ThermostatFanModeCC.js.map +1 -1
- package/build/esm/cc/ThermostatFanStateCC.d.ts.map +1 -1
- package/build/esm/cc/ThermostatFanStateCC.js +184 -111
- package/build/esm/cc/ThermostatFanStateCC.js.map +1 -1
- package/build/esm/cc/ThermostatModeCC.d.ts.map +1 -1
- package/build/esm/cc/ThermostatModeCC.js +435 -331
- package/build/esm/cc/ThermostatModeCC.js.map +1 -1
- package/build/esm/cc/ThermostatOperatingStateCC.d.ts.map +1 -1
- package/build/esm/cc/ThermostatOperatingStateCC.js +180 -107
- package/build/esm/cc/ThermostatOperatingStateCC.js.map +1 -1
- package/build/esm/cc/ThermostatSetbackCC.js +274 -185
- package/build/esm/cc/ThermostatSetbackCC.js.map +1 -1
- package/build/esm/cc/ThermostatSetpointCC.d.ts.map +1 -1
- package/build/esm/cc/ThermostatSetpointCC.js +674 -543
- package/build/esm/cc/ThermostatSetpointCC.js.map +1 -1
- package/build/esm/cc/TimeCC.js +499 -360
- package/build/esm/cc/TimeCC.js.map +1 -1
- package/build/esm/cc/TimeParametersCC.d.ts.map +1 -1
- package/build/esm/cc/TimeParametersCC.js +296 -211
- package/build/esm/cc/TimeParametersCC.js.map +1 -1
- package/build/esm/cc/TransportServiceCC.js +464 -363
- package/build/esm/cc/TransportServiceCC.js.map +1 -1
- package/build/esm/cc/UserCodeCC.d.ts.map +1 -1
- package/build/esm/cc/UserCodeCC.js +1443 -1205
- package/build/esm/cc/UserCodeCC.js.map +1 -1
- package/build/esm/cc/VersionCC.d.ts.map +1 -1
- package/build/esm/cc/VersionCC.js +744 -635
- package/build/esm/cc/VersionCC.js.map +1 -1
- package/build/esm/cc/WakeUpCC.d.ts.map +1 -1
- package/build/esm/cc/WakeUpCC.js +494 -364
- package/build/esm/cc/WakeUpCC.js.map +1 -1
- package/build/esm/cc/WindowCoveringCC.d.ts.map +1 -1
- package/build/esm/cc/WindowCoveringCC.js +655 -530
- package/build/esm/cc/WindowCoveringCC.js.map +1 -1
- package/build/esm/cc/ZWaveLongRangeCC.js +51 -11
- package/build/esm/cc/ZWaveLongRangeCC.js.map +1 -1
- package/build/esm/cc/ZWavePlusCC.d.ts.map +1 -1
- package/build/esm/cc/ZWavePlusCC.js +223 -162
- package/build/esm/cc/ZWavePlusCC.js.map +1 -1
- package/build/esm/cc/ZWaveProtocolCC.js +1443 -953
- package/build/esm/cc/ZWaveProtocolCC.js.map +1 -1
- package/build/esm/cc/manufacturerProprietary/Decorators.d.ts +4 -4
- package/build/esm/cc/manufacturerProprietary/Decorators.d.ts.map +1 -1
- package/build/esm/cc/manufacturerProprietary/FibaroCC.js +390 -286
- package/build/esm/cc/manufacturerProprietary/FibaroCC.js.map +1 -1
- package/build/esm/lib/CommandClassDecorators.d.ts +11 -15
- package/build/esm/lib/CommandClassDecorators.d.ts.map +1 -1
- package/build/esm/lib/CommandClassDecorators.js +24 -24
- package/build/esm/lib/CommandClassDecorators.js.map +1 -1
- package/build/esm/lib/Security2/Extension.d.ts +1 -1
- package/build/esm/lib/Security2/Extension.d.ts.map +1 -1
- package/build/esm/lib/Security2/Extension.js +207 -123
- package/build/esm/lib/Security2/Extension.js.map +1 -1
- package/package.json +6 -6
|
@@ -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 AssociationCC_1, AssociationCCSet_1, AssociationCCRemove_1, AssociationCCReport_1, AssociationCCGet_1, AssociationCCSupportedGroupingsReport_1, AssociationCCSpecificGroupReport_1;
|
|
8
35
|
function __assertType(argName, typeName, boundHasError) {
|
|
9
36
|
const { ZWaveError, ZWaveErrorCodes } = require("@zwave-js/core");
|
|
10
37
|
if (boundHasError()) {
|
|
@@ -118,7 +145,7 @@ import { Bytes } from "@zwave-js/shared/safe";
|
|
|
118
145
|
import { distinct } from "alcalzone-shared/arrays/index.js";
|
|
119
146
|
import { CCAPI, PhysicalCCAPI } from "../lib/API.js";
|
|
120
147
|
import { CommandClass, } from "../lib/CommandClass.js";
|
|
121
|
-
import { API, CCCommand,
|
|
148
|
+
import { API, CCCommand, ccValueProperty, ccValues, commandClass, expectedCCResponse, implementedVersion, useSupervision, } from "../lib/CommandClassDecorators.js";
|
|
122
149
|
import { V } from "../lib/Values.js";
|
|
123
150
|
import { AssociationCommand } from "../lib/_Types.js";
|
|
124
151
|
import * as ccUtils from "../lib/utils.js";
|
|
@@ -137,570 +164,684 @@ export const AssociationCCValues = Object.freeze({
|
|
|
137
164
|
}),
|
|
138
165
|
});
|
|
139
166
|
// @noSetValueAPI
|
|
140
|
-
let AssociationCCAPI =
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
return super.supportsCommand(cmd);
|
|
155
|
-
}
|
|
156
|
-
/**
|
|
157
|
-
* Returns the number of association groups a node supports.
|
|
158
|
-
* Association groups are consecutive, starting at 1.
|
|
159
|
-
*/
|
|
160
|
-
async getGroupCount() {
|
|
161
|
-
this.assertSupportsCommand(AssociationCommand, AssociationCommand.SupportedGroupingsGet);
|
|
162
|
-
const cc = new AssociationCCSupportedGroupingsGet({
|
|
163
|
-
nodeId: this.endpoint.nodeId,
|
|
164
|
-
endpointIndex: this.endpoint.index,
|
|
165
|
-
});
|
|
166
|
-
const response = await this.host.sendCommand(cc, this.commandOptions);
|
|
167
|
-
if (response)
|
|
168
|
-
return response.groupCount;
|
|
169
|
-
}
|
|
170
|
-
async reportGroupCount(groupCount) {
|
|
171
|
-
__assertType("groupCount", "number", __assertType__number.bind(void 0, groupCount));
|
|
172
|
-
this.assertSupportsCommand(AssociationCommand, AssociationCommand.SupportedGroupingsReport);
|
|
173
|
-
const cc = new AssociationCCSupportedGroupingsReport({
|
|
174
|
-
nodeId: this.endpoint.nodeId,
|
|
175
|
-
endpointIndex: this.endpoint.index,
|
|
176
|
-
groupCount,
|
|
177
|
-
});
|
|
178
|
-
await this.host.sendCommand(cc, this.commandOptions);
|
|
179
|
-
}
|
|
180
|
-
/**
|
|
181
|
-
* Returns information about an association group.
|
|
182
|
-
*/
|
|
183
|
-
async getGroup(groupId) {
|
|
184
|
-
__assertType("groupId", "number", __assertType__number.bind(void 0, groupId));
|
|
185
|
-
this.assertSupportsCommand(AssociationCommand, AssociationCommand.Get);
|
|
186
|
-
const cc = new AssociationCCGet({
|
|
187
|
-
nodeId: this.endpoint.nodeId,
|
|
188
|
-
endpointIndex: this.endpoint.index,
|
|
189
|
-
groupId,
|
|
190
|
-
});
|
|
191
|
-
const response = await this.host.sendCommand(cc, this.commandOptions);
|
|
192
|
-
if (response) {
|
|
193
|
-
return {
|
|
194
|
-
maxNodes: response.maxNodes,
|
|
195
|
-
nodeIds: response.nodeIds,
|
|
196
|
-
};
|
|
167
|
+
let AssociationCCAPI = (() => {
|
|
168
|
+
let _classDecorators = [API(CommandClasses.Association)];
|
|
169
|
+
let _classDescriptor;
|
|
170
|
+
let _classExtraInitializers = [];
|
|
171
|
+
let _classThis;
|
|
172
|
+
let _classSuper = PhysicalCCAPI;
|
|
173
|
+
var AssociationCCAPI = class extends _classSuper {
|
|
174
|
+
static { _classThis = this; }
|
|
175
|
+
static {
|
|
176
|
+
const _metadata = typeof Symbol === "function" && Symbol.metadata ? Object.create(_classSuper[Symbol.metadata] ?? null) : void 0;
|
|
177
|
+
__esDecorate(null, _classDescriptor = { value: _classThis }, _classDecorators, { kind: "class", name: _classThis.name, metadata: _metadata }, null, _classExtraInitializers);
|
|
178
|
+
AssociationCCAPI = _classThis = _classDescriptor.value;
|
|
179
|
+
if (_metadata) Object.defineProperty(_classThis, Symbol.metadata, { enumerable: true, configurable: true, writable: true, value: _metadata });
|
|
180
|
+
__runInitializers(_classThis, _classExtraInitializers);
|
|
197
181
|
}
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
* Adds new nodes to an association group
|
|
211
|
-
*/
|
|
212
|
-
async addNodeIds(groupId, ...nodeIds) {
|
|
213
|
-
__assertType("groupId", "number", __assertType__number.bind(void 0, groupId));
|
|
214
|
-
__assertType("nodeIds", undefined, __assertType__sa__number_ea_2.bind(void 0, nodeIds));
|
|
215
|
-
this.assertSupportsCommand(AssociationCommand, AssociationCommand.Set);
|
|
216
|
-
const cc = new AssociationCCSet({
|
|
217
|
-
nodeId: this.endpoint.nodeId,
|
|
218
|
-
endpointIndex: this.endpoint.index,
|
|
219
|
-
groupId,
|
|
220
|
-
nodeIds,
|
|
221
|
-
});
|
|
222
|
-
return this.host.sendCommand(cc, this.commandOptions);
|
|
223
|
-
}
|
|
224
|
-
/**
|
|
225
|
-
* Removes nodes from an association group
|
|
226
|
-
*/
|
|
227
|
-
async removeNodeIds(options) {
|
|
228
|
-
__assertType("options", "AssociationCCRemoveOptions", __assertType__AssociationCCRemoveOptions.bind(void 0, options));
|
|
229
|
-
this.assertSupportsCommand(AssociationCommand, AssociationCommand.Remove);
|
|
230
|
-
// Validate options
|
|
231
|
-
if (!options.groupId) {
|
|
232
|
-
if (this.version === 1) {
|
|
233
|
-
throw new ZWaveError(`Node ${this.endpoint.nodeId} only supports AssociationCC V1 which requires the group Id to be set`, ZWaveErrorCodes.Argument_Invalid);
|
|
182
|
+
supportsCommand(cmd) {
|
|
183
|
+
switch (cmd) {
|
|
184
|
+
case AssociationCommand.Get:
|
|
185
|
+
case AssociationCommand.Set:
|
|
186
|
+
case AssociationCommand.Report:
|
|
187
|
+
case AssociationCommand.Remove:
|
|
188
|
+
case AssociationCommand.SupportedGroupingsGet:
|
|
189
|
+
case AssociationCommand.SupportedGroupingsReport:
|
|
190
|
+
return true;
|
|
191
|
+
case AssociationCommand.SpecificGroupGet:
|
|
192
|
+
case AssociationCommand.SpecificGroupReport:
|
|
193
|
+
return this.version >= 2;
|
|
234
194
|
}
|
|
195
|
+
return super.supportsCommand(cmd);
|
|
235
196
|
}
|
|
236
|
-
|
|
237
|
-
|
|
197
|
+
/**
|
|
198
|
+
* Returns the number of association groups a node supports.
|
|
199
|
+
* Association groups are consecutive, starting at 1.
|
|
200
|
+
*/
|
|
201
|
+
async getGroupCount() {
|
|
202
|
+
this.assertSupportsCommand(AssociationCommand, AssociationCommand.SupportedGroupingsGet);
|
|
203
|
+
const cc = new AssociationCCSupportedGroupingsGet({
|
|
204
|
+
nodeId: this.endpoint.nodeId,
|
|
205
|
+
endpointIndex: this.endpoint.index,
|
|
206
|
+
});
|
|
207
|
+
const response = await this.host.sendCommand(cc, this.commandOptions);
|
|
208
|
+
if (response)
|
|
209
|
+
return response.groupCount;
|
|
238
210
|
}
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
211
|
+
async reportGroupCount(groupCount) {
|
|
212
|
+
__assertType("groupCount", "number", __assertType__number.bind(void 0, groupCount));
|
|
213
|
+
this.assertSupportsCommand(AssociationCommand, AssociationCommand.SupportedGroupingsReport);
|
|
214
|
+
const cc = new AssociationCCSupportedGroupingsReport({
|
|
215
|
+
nodeId: this.endpoint.nodeId,
|
|
216
|
+
endpointIndex: this.endpoint.index,
|
|
217
|
+
groupCount,
|
|
218
|
+
});
|
|
219
|
+
await this.host.sendCommand(cc, this.commandOptions);
|
|
220
|
+
}
|
|
221
|
+
/**
|
|
222
|
+
* Returns information about an association group.
|
|
223
|
+
*/
|
|
224
|
+
async getGroup(groupId) {
|
|
225
|
+
__assertType("groupId", "number", __assertType__number.bind(void 0, groupId));
|
|
226
|
+
this.assertSupportsCommand(AssociationCommand, AssociationCommand.Get);
|
|
227
|
+
const cc = new AssociationCCGet({
|
|
228
|
+
nodeId: this.endpoint.nodeId,
|
|
229
|
+
endpointIndex: this.endpoint.index,
|
|
230
|
+
groupId,
|
|
231
|
+
});
|
|
232
|
+
const response = await this.host.sendCommand(cc, this.commandOptions);
|
|
233
|
+
if (response) {
|
|
234
|
+
return {
|
|
235
|
+
maxNodes: response.maxNodes,
|
|
236
|
+
nodeIds: response.nodeIds,
|
|
237
|
+
};
|
|
262
238
|
}
|
|
263
239
|
}
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
nodeId: this.endpoint.nodeId,
|
|
272
|
-
endpointIndex: this.endpoint.index,
|
|
273
|
-
});
|
|
274
|
-
const response = await this.host.sendCommand(cc, this.commandOptions);
|
|
275
|
-
return response?.group;
|
|
276
|
-
}
|
|
277
|
-
/**
|
|
278
|
-
* Report the association group that represents the most recently detected button press
|
|
279
|
-
*/
|
|
280
|
-
async reportSpecificGroup(group) {
|
|
281
|
-
__assertType("group", "number", __assertType__number.bind(void 0, group));
|
|
282
|
-
this.assertSupportsCommand(AssociationCommand, AssociationCommand.SpecificGroupReport);
|
|
283
|
-
const cc = new AssociationCCSpecificGroupReport({
|
|
284
|
-
nodeId: this.endpoint.nodeId,
|
|
285
|
-
endpointIndex: this.endpoint.index,
|
|
286
|
-
group,
|
|
287
|
-
});
|
|
288
|
-
await this.host.sendCommand(cc, this.commandOptions);
|
|
289
|
-
}
|
|
290
|
-
};
|
|
291
|
-
AssociationCCAPI = __decorate([
|
|
292
|
-
API(CommandClasses.Association)
|
|
293
|
-
], AssociationCCAPI);
|
|
294
|
-
export { AssociationCCAPI };
|
|
295
|
-
let AssociationCC = AssociationCC_1 = class AssociationCC extends CommandClass {
|
|
296
|
-
determineRequiredCCInterviews() {
|
|
297
|
-
// AssociationCC must be interviewed after Z-Wave+ if that is supported
|
|
298
|
-
return [
|
|
299
|
-
...super.determineRequiredCCInterviews(),
|
|
300
|
-
CommandClasses["Z-Wave Plus Info"],
|
|
301
|
-
// We need information about endpoints to correctly configure the lifeline associations
|
|
302
|
-
CommandClasses["Multi Channel"],
|
|
303
|
-
];
|
|
304
|
-
}
|
|
305
|
-
/**
|
|
306
|
-
* Returns the number of association groups reported by the node/endpoint.
|
|
307
|
-
* This only works AFTER the interview process
|
|
308
|
-
*/
|
|
309
|
-
static getGroupCountCached(ctx, endpoint) {
|
|
310
|
-
return ctx
|
|
311
|
-
.getValueDB(endpoint.nodeId)
|
|
312
|
-
.getValue(AssociationCCValues.groupCount.endpoint(endpoint.index)) || 0;
|
|
313
|
-
}
|
|
314
|
-
/**
|
|
315
|
-
* Returns the number of nodes an association group supports.
|
|
316
|
-
* This only works AFTER the interview process
|
|
317
|
-
*/
|
|
318
|
-
static getMaxNodesCached(ctx, endpoint, groupId) {
|
|
319
|
-
return (ctx
|
|
320
|
-
.getValueDB(endpoint.nodeId)
|
|
321
|
-
.getValue(AssociationCCValues.maxNodes(groupId).endpoint(endpoint.index))
|
|
322
|
-
// If the information is not available, fall back to the configuration file if possible
|
|
323
|
-
// This can happen on some legacy devices which have "hidden" association groups
|
|
324
|
-
?? ctx
|
|
325
|
-
.getDeviceConfig?.(endpoint.nodeId)
|
|
326
|
-
?.getAssociationConfigForEndpoint(endpoint.index, groupId)
|
|
327
|
-
?.maxNodes
|
|
328
|
-
?? 0);
|
|
329
|
-
}
|
|
330
|
-
/**
|
|
331
|
-
* Returns all the destinations of all association groups reported by the node/endpoint.
|
|
332
|
-
* This only works AFTER the interview process
|
|
333
|
-
*/
|
|
334
|
-
static getAllDestinationsCached(ctx, endpoint) {
|
|
335
|
-
const ret = new Map();
|
|
336
|
-
const groupCount = this.getGroupCountCached(ctx, endpoint);
|
|
337
|
-
const valueDB = ctx.getValueDB(endpoint.nodeId);
|
|
338
|
-
for (let i = 1; i <= groupCount; i++) {
|
|
339
|
-
// Add all root destinations
|
|
340
|
-
const nodes = valueDB.getValue(AssociationCCValues.nodeIds(i).endpoint(endpoint.index)) ?? [];
|
|
341
|
-
ret.set(i,
|
|
342
|
-
// Filter out duplicates
|
|
343
|
-
distinct(nodes).map((nodeId) => ({ nodeId })));
|
|
344
|
-
}
|
|
345
|
-
return ret;
|
|
346
|
-
}
|
|
347
|
-
async interview(ctx) {
|
|
348
|
-
const node = this.getNode(ctx);
|
|
349
|
-
const endpoint = this.getEndpoint(ctx);
|
|
350
|
-
const api = CCAPI.create(CommandClasses.Association, ctx, endpoint).withOptions({
|
|
351
|
-
priority: MessagePriority.NodeQuery,
|
|
352
|
-
});
|
|
353
|
-
ctx.logNode(node.id, {
|
|
354
|
-
endpoint: this.endpointIndex,
|
|
355
|
-
message: `Interviewing ${this.ccName}...`,
|
|
356
|
-
direction: "none",
|
|
357
|
-
});
|
|
358
|
-
// Even if Multi Channel Association is supported, we still need to query the number of
|
|
359
|
-
// normal association groups since some devices report more association groups than
|
|
360
|
-
// multi channel association groups
|
|
361
|
-
// Find out how many groups are supported
|
|
362
|
-
ctx.logNode(node.id, {
|
|
363
|
-
endpoint: this.endpointIndex,
|
|
364
|
-
message: "querying number of association groups...",
|
|
365
|
-
direction: "outbound",
|
|
366
|
-
});
|
|
367
|
-
const groupCount = await api.getGroupCount();
|
|
368
|
-
if (groupCount != undefined) {
|
|
369
|
-
ctx.logNode(node.id, {
|
|
370
|
-
endpoint: this.endpointIndex,
|
|
371
|
-
message: `supports ${groupCount} association groups`,
|
|
372
|
-
direction: "inbound",
|
|
240
|
+
async sendReport(options) {
|
|
241
|
+
__assertType("options", "AssociationCCReportOptions", __assertType__AssociationCCReportOptions.bind(void 0, options));
|
|
242
|
+
this.assertSupportsCommand(AssociationCommand, AssociationCommand.Report);
|
|
243
|
+
const cc = new AssociationCCReport({
|
|
244
|
+
nodeId: this.endpoint.nodeId,
|
|
245
|
+
endpointIndex: this.endpoint.index,
|
|
246
|
+
...options,
|
|
373
247
|
});
|
|
248
|
+
await this.host.sendCommand(cc, this.commandOptions);
|
|
374
249
|
}
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
|
|
250
|
+
/**
|
|
251
|
+
* Adds new nodes to an association group
|
|
252
|
+
*/
|
|
253
|
+
async addNodeIds(groupId, ...nodeIds) {
|
|
254
|
+
__assertType("groupId", "number", __assertType__number.bind(void 0, groupId));
|
|
255
|
+
__assertType("nodeIds", undefined, __assertType__sa__number_ea_2.bind(void 0, nodeIds));
|
|
256
|
+
this.assertSupportsCommand(AssociationCommand, AssociationCommand.Set);
|
|
257
|
+
const cc = new AssociationCCSet({
|
|
258
|
+
nodeId: this.endpoint.nodeId,
|
|
259
|
+
endpointIndex: this.endpoint.index,
|
|
260
|
+
groupId,
|
|
261
|
+
nodeIds,
|
|
262
|
+
});
|
|
263
|
+
return this.host.sendCommand(cc, this.commandOptions);
|
|
264
|
+
}
|
|
265
|
+
/**
|
|
266
|
+
* Removes nodes from an association group
|
|
267
|
+
*/
|
|
268
|
+
async removeNodeIds(options) {
|
|
269
|
+
__assertType("options", "AssociationCCRemoveOptions", __assertType__AssociationCCRemoveOptions.bind(void 0, options));
|
|
270
|
+
this.assertSupportsCommand(AssociationCommand, AssociationCommand.Remove);
|
|
271
|
+
// Validate options
|
|
272
|
+
if (!options.groupId) {
|
|
273
|
+
if (this.version === 1) {
|
|
274
|
+
throw new ZWaveError(`Node ${this.endpoint.nodeId} only supports AssociationCC V1 which requires the group Id to be set`, ZWaveErrorCodes.Argument_Invalid);
|
|
275
|
+
}
|
|
276
|
+
}
|
|
277
|
+
else if (options.groupId < 0) {
|
|
278
|
+
throw new ZWaveError("The group id must be positive!", ZWaveErrorCodes.Argument_Invalid);
|
|
279
|
+
}
|
|
280
|
+
const cc = new AssociationCCRemove({
|
|
281
|
+
nodeId: this.endpoint.nodeId,
|
|
282
|
+
endpointIndex: this.endpoint.index,
|
|
283
|
+
...options,
|
|
284
|
+
});
|
|
285
|
+
return this.host.sendCommand(cc, this.commandOptions);
|
|
286
|
+
}
|
|
287
|
+
/**
|
|
288
|
+
* Removes nodes from all association groups
|
|
289
|
+
*/
|
|
290
|
+
async removeNodeIdsFromAllGroups(nodeIds) {
|
|
291
|
+
__assertType("nodeIds", undefined, __assertType__sa__number_ea_2.bind(void 0, nodeIds));
|
|
292
|
+
this.assertSupportsCommand(AssociationCommand, AssociationCommand.Remove);
|
|
293
|
+
if (this.version >= 2) {
|
|
294
|
+
// The node supports bulk removal
|
|
295
|
+
return this.removeNodeIds({ nodeIds, groupId: 0 });
|
|
296
|
+
}
|
|
297
|
+
else {
|
|
298
|
+
// We have to remove the node manually from all groups
|
|
299
|
+
const groupCount = this.tryGetValueDB()?.getValue(AssociationCCValues.groupCount.endpoint(this.endpoint.index)) ?? 0;
|
|
300
|
+
for (let groupId = 1; groupId <= groupCount; groupId++) {
|
|
301
|
+
// TODO: evaluate intermediate supervision results
|
|
302
|
+
await this.removeNodeIds({ nodeIds, groupId });
|
|
303
|
+
}
|
|
304
|
+
}
|
|
305
|
+
}
|
|
306
|
+
/**
|
|
307
|
+
* Request the association group that represents the most recently detected button press
|
|
308
|
+
*/
|
|
309
|
+
async getSpecificGroup() {
|
|
310
|
+
this.assertSupportsCommand(AssociationCommand, AssociationCommand.SpecificGroupGet);
|
|
311
|
+
const cc = new AssociationCCSpecificGroupGet({
|
|
312
|
+
nodeId: this.endpoint.nodeId,
|
|
313
|
+
endpointIndex: this.endpoint.index,
|
|
314
|
+
});
|
|
315
|
+
const response = await this.host.sendCommand(cc, this.commandOptions);
|
|
316
|
+
return response?.group;
|
|
317
|
+
}
|
|
318
|
+
/**
|
|
319
|
+
* Report the association group that represents the most recently detected button press
|
|
320
|
+
*/
|
|
321
|
+
async reportSpecificGroup(group) {
|
|
322
|
+
__assertType("group", "number", __assertType__number.bind(void 0, group));
|
|
323
|
+
this.assertSupportsCommand(AssociationCommand, AssociationCommand.SpecificGroupReport);
|
|
324
|
+
const cc = new AssociationCCSpecificGroupReport({
|
|
325
|
+
nodeId: this.endpoint.nodeId,
|
|
326
|
+
endpointIndex: this.endpoint.index,
|
|
327
|
+
group,
|
|
380
328
|
});
|
|
381
|
-
|
|
329
|
+
await this.host.sendCommand(cc, this.commandOptions);
|
|
330
|
+
}
|
|
331
|
+
};
|
|
332
|
+
return AssociationCCAPI = _classThis;
|
|
333
|
+
})();
|
|
334
|
+
export { AssociationCCAPI };
|
|
335
|
+
let AssociationCC = (() => {
|
|
336
|
+
let _classDecorators = [commandClass(CommandClasses.Association), implementedVersion(4), ccValues(AssociationCCValues)];
|
|
337
|
+
let _classDescriptor;
|
|
338
|
+
let _classExtraInitializers = [];
|
|
339
|
+
let _classThis;
|
|
340
|
+
let _classSuper = CommandClass;
|
|
341
|
+
var AssociationCC = class extends _classSuper {
|
|
342
|
+
static { _classThis = this; }
|
|
343
|
+
static {
|
|
344
|
+
const _metadata = typeof Symbol === "function" && Symbol.metadata ? Object.create(_classSuper[Symbol.metadata] ?? null) : void 0;
|
|
345
|
+
__esDecorate(null, _classDescriptor = { value: _classThis }, _classDecorators, { kind: "class", name: _classThis.name, metadata: _metadata }, null, _classExtraInitializers);
|
|
346
|
+
AssociationCC = _classThis = _classDescriptor.value;
|
|
347
|
+
if (_metadata) Object.defineProperty(_classThis, Symbol.metadata, { enumerable: true, configurable: true, writable: true, value: _metadata });
|
|
348
|
+
__runInitializers(_classThis, _classExtraInitializers);
|
|
349
|
+
}
|
|
350
|
+
determineRequiredCCInterviews() {
|
|
351
|
+
// AssociationCC must be interviewed after Z-Wave+ if that is supported
|
|
352
|
+
return [
|
|
353
|
+
...super.determineRequiredCCInterviews(),
|
|
354
|
+
CommandClasses["Z-Wave Plus Info"],
|
|
355
|
+
// We need information about endpoints to correctly configure the lifeline associations
|
|
356
|
+
CommandClasses["Multi Channel"],
|
|
357
|
+
];
|
|
358
|
+
}
|
|
359
|
+
/**
|
|
360
|
+
* Returns the number of association groups reported by the node/endpoint.
|
|
361
|
+
* This only works AFTER the interview process
|
|
362
|
+
*/
|
|
363
|
+
static getGroupCountCached(ctx, endpoint) {
|
|
364
|
+
return ctx
|
|
365
|
+
.getValueDB(endpoint.nodeId)
|
|
366
|
+
.getValue(AssociationCCValues.groupCount.endpoint(endpoint.index)) || 0;
|
|
367
|
+
}
|
|
368
|
+
/**
|
|
369
|
+
* Returns the number of nodes an association group supports.
|
|
370
|
+
* This only works AFTER the interview process
|
|
371
|
+
*/
|
|
372
|
+
static getMaxNodesCached(ctx, endpoint, groupId) {
|
|
373
|
+
return (ctx
|
|
374
|
+
.getValueDB(endpoint.nodeId)
|
|
375
|
+
.getValue(AssociationCCValues.maxNodes(groupId).endpoint(endpoint.index))
|
|
376
|
+
// If the information is not available, fall back to the configuration file if possible
|
|
377
|
+
// This can happen on some legacy devices which have "hidden" association groups
|
|
378
|
+
?? ctx
|
|
379
|
+
.getDeviceConfig?.(endpoint.nodeId)
|
|
380
|
+
?.getAssociationConfigForEndpoint(endpoint.index, groupId)
|
|
381
|
+
?.maxNodes
|
|
382
|
+
?? 0);
|
|
382
383
|
}
|
|
383
|
-
|
|
384
|
-
|
|
385
|
-
|
|
386
|
-
|
|
384
|
+
/**
|
|
385
|
+
* Returns all the destinations of all association groups reported by the node/endpoint.
|
|
386
|
+
* This only works AFTER the interview process
|
|
387
|
+
*/
|
|
388
|
+
static getAllDestinationsCached(ctx, endpoint) {
|
|
389
|
+
const ret = new Map();
|
|
390
|
+
const groupCount = this.getGroupCountCached(ctx, endpoint);
|
|
391
|
+
const valueDB = ctx.getValueDB(endpoint.nodeId);
|
|
392
|
+
for (let i = 1; i <= groupCount; i++) {
|
|
393
|
+
// Add all root destinations
|
|
394
|
+
const nodes = valueDB.getValue(AssociationCCValues.nodeIds(i).endpoint(endpoint.index)) ?? [];
|
|
395
|
+
ret.set(i,
|
|
396
|
+
// Filter out duplicates
|
|
397
|
+
distinct(nodes).map((nodeId) => ({ nodeId })));
|
|
398
|
+
}
|
|
399
|
+
return ret;
|
|
400
|
+
}
|
|
401
|
+
async interview(ctx) {
|
|
402
|
+
const node = this.getNode(ctx);
|
|
403
|
+
const endpoint = this.getEndpoint(ctx);
|
|
404
|
+
const api = CCAPI.create(CommandClasses.Association, ctx, endpoint).withOptions({
|
|
405
|
+
priority: MessagePriority.NodeQuery,
|
|
406
|
+
});
|
|
387
407
|
ctx.logNode(node.id, {
|
|
388
408
|
endpoint: this.endpointIndex,
|
|
389
|
-
message:
|
|
409
|
+
message: `Interviewing ${this.ccName}...`,
|
|
390
410
|
direction: "none",
|
|
391
411
|
});
|
|
392
|
-
|
|
393
|
-
|
|
394
|
-
|
|
395
|
-
|
|
396
|
-
await ccUtils.configureLifelineAssociations(ctx, endpoint);
|
|
397
|
-
// Remember that the interview is complete
|
|
398
|
-
this.setInterviewComplete(ctx, true);
|
|
399
|
-
}
|
|
400
|
-
async refreshValues(ctx) {
|
|
401
|
-
const node = this.getNode(ctx);
|
|
402
|
-
const endpoint = this.getEndpoint(ctx);
|
|
403
|
-
const api = CCAPI.create(CommandClasses.Association, ctx, endpoint).withOptions({
|
|
404
|
-
priority: MessagePriority.NodeQuery,
|
|
405
|
-
});
|
|
406
|
-
const groupCount = AssociationCC_1.getGroupCountCached(ctx, endpoint);
|
|
407
|
-
// Query each association group
|
|
408
|
-
for (let groupId = 1; groupId <= groupCount; groupId++) {
|
|
412
|
+
// Even if Multi Channel Association is supported, we still need to query the number of
|
|
413
|
+
// normal association groups since some devices report more association groups than
|
|
414
|
+
// multi channel association groups
|
|
415
|
+
// Find out how many groups are supported
|
|
409
416
|
ctx.logNode(node.id, {
|
|
410
417
|
endpoint: this.endpointIndex,
|
|
411
|
-
message:
|
|
418
|
+
message: "querying number of association groups...",
|
|
412
419
|
direction: "outbound",
|
|
413
420
|
});
|
|
414
|
-
const
|
|
415
|
-
if (
|
|
416
|
-
const logMessage = `received information for association group #${groupId}:
|
|
417
|
-
maximum # of nodes: ${group.maxNodes}
|
|
418
|
-
currently assigned nodes: ${group.nodeIds.map(String).join(", ")}`;
|
|
421
|
+
const groupCount = await api.getGroupCount();
|
|
422
|
+
if (groupCount != undefined) {
|
|
419
423
|
ctx.logNode(node.id, {
|
|
420
424
|
endpoint: this.endpointIndex,
|
|
421
|
-
message:
|
|
425
|
+
message: `supports ${groupCount} association groups`,
|
|
422
426
|
direction: "inbound",
|
|
423
427
|
});
|
|
424
428
|
}
|
|
429
|
+
else {
|
|
430
|
+
ctx.logNode(node.id, {
|
|
431
|
+
endpoint: this.endpointIndex,
|
|
432
|
+
message: "Querying association groups timed out, skipping interview...",
|
|
433
|
+
level: "warn",
|
|
434
|
+
});
|
|
435
|
+
return;
|
|
436
|
+
}
|
|
437
|
+
// Query each association group for its members
|
|
438
|
+
await this.refreshValues(ctx);
|
|
439
|
+
// Skip the remaining Association CC interview in favor of Multi Channel Association if possible
|
|
440
|
+
if (endpoint.supportsCC(CommandClasses["Multi Channel Association"])) {
|
|
441
|
+
ctx.logNode(node.id, {
|
|
442
|
+
endpoint: this.endpointIndex,
|
|
443
|
+
message: `${this.constructor.name}: delaying configuration of lifeline associations until after Multi Channel Association interview...`,
|
|
444
|
+
direction: "none",
|
|
445
|
+
});
|
|
446
|
+
this.setInterviewComplete(ctx, true);
|
|
447
|
+
return;
|
|
448
|
+
}
|
|
449
|
+
// And set up lifeline associations
|
|
450
|
+
await ccUtils.configureLifelineAssociations(ctx, endpoint);
|
|
451
|
+
// Remember that the interview is complete
|
|
452
|
+
this.setInterviewComplete(ctx, true);
|
|
425
453
|
}
|
|
426
|
-
|
|
427
|
-
|
|
428
|
-
|
|
429
|
-
|
|
430
|
-
|
|
431
|
-
|
|
432
|
-
|
|
454
|
+
async refreshValues(ctx) {
|
|
455
|
+
const node = this.getNode(ctx);
|
|
456
|
+
const endpoint = this.getEndpoint(ctx);
|
|
457
|
+
const api = CCAPI.create(CommandClasses.Association, ctx, endpoint).withOptions({
|
|
458
|
+
priority: MessagePriority.NodeQuery,
|
|
459
|
+
});
|
|
460
|
+
const groupCount = AssociationCC.getGroupCountCached(ctx, endpoint);
|
|
461
|
+
// Query each association group
|
|
462
|
+
for (let groupId = 1; groupId <= groupCount; groupId++) {
|
|
463
|
+
ctx.logNode(node.id, {
|
|
464
|
+
endpoint: this.endpointIndex,
|
|
465
|
+
message: `querying association group #${groupId}...`,
|
|
466
|
+
direction: "outbound",
|
|
467
|
+
});
|
|
468
|
+
const group = await api.getGroup(groupId);
|
|
469
|
+
if (group != undefined) {
|
|
470
|
+
const logMessage = `received information for association group #${groupId}:
|
|
471
|
+
maximum # of nodes: ${group.maxNodes}
|
|
472
|
+
currently assigned nodes: ${group.nodeIds.map(String).join(", ")}`;
|
|
473
|
+
ctx.logNode(node.id, {
|
|
474
|
+
endpoint: this.endpointIndex,
|
|
475
|
+
message: logMessage,
|
|
476
|
+
direction: "inbound",
|
|
477
|
+
});
|
|
478
|
+
}
|
|
479
|
+
}
|
|
480
|
+
}
|
|
481
|
+
};
|
|
482
|
+
return AssociationCC = _classThis;
|
|
483
|
+
})();
|
|
433
484
|
export { AssociationCC };
|
|
434
|
-
let AssociationCCSet =
|
|
435
|
-
|
|
436
|
-
|
|
437
|
-
|
|
438
|
-
|
|
485
|
+
let AssociationCCSet = (() => {
|
|
486
|
+
let _classDecorators = [CCCommand(AssociationCommand.Set), useSupervision()];
|
|
487
|
+
let _classDescriptor;
|
|
488
|
+
let _classExtraInitializers = [];
|
|
489
|
+
let _classThis;
|
|
490
|
+
let _classSuper = AssociationCC;
|
|
491
|
+
var AssociationCCSet = class extends _classSuper {
|
|
492
|
+
static { _classThis = this; }
|
|
493
|
+
static {
|
|
494
|
+
const _metadata = typeof Symbol === "function" && Symbol.metadata ? Object.create(_classSuper[Symbol.metadata] ?? null) : void 0;
|
|
495
|
+
__esDecorate(null, _classDescriptor = { value: _classThis }, _classDecorators, { kind: "class", name: _classThis.name, metadata: _metadata }, null, _classExtraInitializers);
|
|
496
|
+
AssociationCCSet = _classThis = _classDescriptor.value;
|
|
497
|
+
if (_metadata) Object.defineProperty(_classThis, Symbol.metadata, { enumerable: true, configurable: true, writable: true, value: _metadata });
|
|
498
|
+
__runInitializers(_classThis, _classExtraInitializers);
|
|
439
499
|
}
|
|
440
|
-
|
|
441
|
-
|
|
500
|
+
constructor(options) {
|
|
501
|
+
super(options);
|
|
502
|
+
if (options.groupId < 1) {
|
|
503
|
+
throw new ZWaveError("The group id must be positive!", ZWaveErrorCodes.Argument_Invalid);
|
|
504
|
+
}
|
|
505
|
+
if (options.nodeIds.some((n) => n < 1 || n > MAX_NODES)) {
|
|
506
|
+
throw new ZWaveError(`All node IDs must be between 1 and ${MAX_NODES}!`, ZWaveErrorCodes.Argument_Invalid);
|
|
507
|
+
}
|
|
508
|
+
this.groupId = options.groupId;
|
|
509
|
+
this.nodeIds = options.nodeIds;
|
|
442
510
|
}
|
|
443
|
-
|
|
444
|
-
|
|
445
|
-
|
|
446
|
-
|
|
447
|
-
|
|
448
|
-
|
|
449
|
-
|
|
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
|
-
AssociationCCSet = AssociationCCSet_1 = __decorate([
|
|
476
|
-
CCCommand(AssociationCommand.Set),
|
|
477
|
-
useSupervision()
|
|
478
|
-
], AssociationCCSet);
|
|
511
|
+
static from(raw, ctx) {
|
|
512
|
+
validatePayload(raw.payload.length >= 2);
|
|
513
|
+
const groupId = raw.payload[0];
|
|
514
|
+
const nodeIds = [...raw.payload.subarray(1)];
|
|
515
|
+
return new this({
|
|
516
|
+
nodeId: ctx.sourceNodeId,
|
|
517
|
+
groupId,
|
|
518
|
+
nodeIds,
|
|
519
|
+
});
|
|
520
|
+
}
|
|
521
|
+
groupId;
|
|
522
|
+
nodeIds;
|
|
523
|
+
serialize(ctx) {
|
|
524
|
+
this.payload = Bytes.from([this.groupId, ...this.nodeIds]);
|
|
525
|
+
return super.serialize(ctx);
|
|
526
|
+
}
|
|
527
|
+
toLogEntry(ctx) {
|
|
528
|
+
const message = {
|
|
529
|
+
"group id": this.groupId || "all groups",
|
|
530
|
+
"node ids": this.nodeIds.length
|
|
531
|
+
? this.nodeIds.join(", ")
|
|
532
|
+
: "all nodes",
|
|
533
|
+
};
|
|
534
|
+
return {
|
|
535
|
+
...super.toLogEntry(ctx),
|
|
536
|
+
message,
|
|
537
|
+
};
|
|
538
|
+
}
|
|
539
|
+
};
|
|
540
|
+
return AssociationCCSet = _classThis;
|
|
541
|
+
})();
|
|
479
542
|
export { AssociationCCSet };
|
|
480
|
-
let AssociationCCRemove =
|
|
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
|
-
|
|
525
|
-
|
|
526
|
-
|
|
543
|
+
let AssociationCCRemove = (() => {
|
|
544
|
+
let _classDecorators = [CCCommand(AssociationCommand.Remove), useSupervision()];
|
|
545
|
+
let _classDescriptor;
|
|
546
|
+
let _classExtraInitializers = [];
|
|
547
|
+
let _classThis;
|
|
548
|
+
let _classSuper = AssociationCC;
|
|
549
|
+
var AssociationCCRemove = class extends _classSuper {
|
|
550
|
+
static { _classThis = this; }
|
|
551
|
+
static {
|
|
552
|
+
const _metadata = typeof Symbol === "function" && Symbol.metadata ? Object.create(_classSuper[Symbol.metadata] ?? null) : void 0;
|
|
553
|
+
__esDecorate(null, _classDescriptor = { value: _classThis }, _classDecorators, { kind: "class", name: _classThis.name, metadata: _metadata }, null, _classExtraInitializers);
|
|
554
|
+
AssociationCCRemove = _classThis = _classDescriptor.value;
|
|
555
|
+
if (_metadata) Object.defineProperty(_classThis, Symbol.metadata, { enumerable: true, configurable: true, writable: true, value: _metadata });
|
|
556
|
+
__runInitializers(_classThis, _classExtraInitializers);
|
|
557
|
+
}
|
|
558
|
+
constructor(options) {
|
|
559
|
+
super(options);
|
|
560
|
+
// When removing associations, we allow invalid node IDs.
|
|
561
|
+
// See GH#3606 - it is possible that those exist.
|
|
562
|
+
this.groupId = options.groupId;
|
|
563
|
+
this.nodeIds = options.nodeIds;
|
|
564
|
+
}
|
|
565
|
+
static from(raw, ctx) {
|
|
566
|
+
validatePayload(raw.payload.length >= 1);
|
|
567
|
+
let groupId;
|
|
568
|
+
if (raw.payload[0] !== 0) {
|
|
569
|
+
groupId = raw.payload[0];
|
|
570
|
+
}
|
|
571
|
+
const nodeIds = [...raw.payload.subarray(1)];
|
|
572
|
+
return new this({
|
|
573
|
+
nodeId: ctx.sourceNodeId,
|
|
574
|
+
groupId,
|
|
575
|
+
nodeIds,
|
|
576
|
+
});
|
|
577
|
+
}
|
|
578
|
+
groupId;
|
|
579
|
+
nodeIds;
|
|
580
|
+
serialize(ctx) {
|
|
581
|
+
this.payload = Bytes.from([
|
|
582
|
+
this.groupId || 0,
|
|
583
|
+
...(this.nodeIds || []),
|
|
584
|
+
]);
|
|
585
|
+
return super.serialize(ctx);
|
|
586
|
+
}
|
|
587
|
+
toLogEntry(ctx) {
|
|
588
|
+
const message = {
|
|
589
|
+
"group id": this.groupId || "all groups",
|
|
590
|
+
"node ids": this.nodeIds && this.nodeIds.length
|
|
591
|
+
? this.nodeIds.join(", ")
|
|
592
|
+
: "all nodes",
|
|
593
|
+
};
|
|
594
|
+
return {
|
|
595
|
+
...super.toLogEntry(ctx),
|
|
596
|
+
message,
|
|
597
|
+
};
|
|
598
|
+
}
|
|
599
|
+
};
|
|
600
|
+
return AssociationCCRemove = _classThis;
|
|
601
|
+
})();
|
|
527
602
|
export { AssociationCCRemove };
|
|
528
|
-
let AssociationCCReport =
|
|
529
|
-
|
|
530
|
-
|
|
531
|
-
|
|
532
|
-
|
|
533
|
-
|
|
534
|
-
|
|
535
|
-
|
|
536
|
-
|
|
537
|
-
|
|
538
|
-
|
|
539
|
-
|
|
540
|
-
|
|
541
|
-
|
|
542
|
-
|
|
543
|
-
|
|
544
|
-
|
|
545
|
-
|
|
546
|
-
|
|
547
|
-
nodeIds
|
|
548
|
-
|
|
549
|
-
|
|
550
|
-
|
|
551
|
-
|
|
552
|
-
|
|
553
|
-
|
|
554
|
-
|
|
555
|
-
|
|
556
|
-
|
|
557
|
-
|
|
558
|
-
|
|
559
|
-
|
|
560
|
-
|
|
561
|
-
|
|
562
|
-
|
|
563
|
-
|
|
564
|
-
|
|
565
|
-
|
|
566
|
-
|
|
567
|
-
|
|
568
|
-
|
|
569
|
-
|
|
570
|
-
this.
|
|
571
|
-
|
|
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
|
-
|
|
603
|
+
let AssociationCCReport = (() => {
|
|
604
|
+
let _classDecorators = [CCCommand(AssociationCommand.Report), ccValueProperty("maxNodes", AssociationCCValues.maxNodes, (self) => [self.groupId]), ccValueProperty("nodeIds", AssociationCCValues.nodeIds, (self) => [self.groupId])];
|
|
605
|
+
let _classDescriptor;
|
|
606
|
+
let _classExtraInitializers = [];
|
|
607
|
+
let _classThis;
|
|
608
|
+
let _classSuper = AssociationCC;
|
|
609
|
+
var AssociationCCReport = class extends _classSuper {
|
|
610
|
+
static { _classThis = this; }
|
|
611
|
+
static {
|
|
612
|
+
const _metadata = typeof Symbol === "function" && Symbol.metadata ? Object.create(_classSuper[Symbol.metadata] ?? null) : void 0;
|
|
613
|
+
__esDecorate(null, _classDescriptor = { value: _classThis }, _classDecorators, { kind: "class", name: _classThis.name, metadata: _metadata }, null, _classExtraInitializers);
|
|
614
|
+
AssociationCCReport = _classThis = _classDescriptor.value;
|
|
615
|
+
if (_metadata) Object.defineProperty(_classThis, Symbol.metadata, { enumerable: true, configurable: true, writable: true, value: _metadata });
|
|
616
|
+
__runInitializers(_classThis, _classExtraInitializers);
|
|
617
|
+
}
|
|
618
|
+
constructor(options) {
|
|
619
|
+
super(options);
|
|
620
|
+
this.groupId = options.groupId;
|
|
621
|
+
this.maxNodes = options.maxNodes;
|
|
622
|
+
this.nodeIds = options.nodeIds;
|
|
623
|
+
this.reportsToFollow = options.reportsToFollow;
|
|
624
|
+
}
|
|
625
|
+
static from(raw, ctx) {
|
|
626
|
+
validatePayload(raw.payload.length >= 3);
|
|
627
|
+
const groupId = raw.payload[0];
|
|
628
|
+
const maxNodes = raw.payload[1];
|
|
629
|
+
const reportsToFollow = raw.payload[2];
|
|
630
|
+
const nodeIds = [...raw.payload.subarray(3)];
|
|
631
|
+
return new this({
|
|
632
|
+
nodeId: ctx.sourceNodeId,
|
|
633
|
+
groupId,
|
|
634
|
+
maxNodes,
|
|
635
|
+
reportsToFollow,
|
|
636
|
+
nodeIds,
|
|
637
|
+
});
|
|
638
|
+
}
|
|
639
|
+
groupId;
|
|
640
|
+
maxNodes;
|
|
641
|
+
nodeIds;
|
|
642
|
+
reportsToFollow;
|
|
643
|
+
getPartialCCSessionId() {
|
|
644
|
+
// Distinguish sessions by the association group ID
|
|
645
|
+
return { groupId: this.groupId };
|
|
646
|
+
}
|
|
647
|
+
expectMoreMessages() {
|
|
648
|
+
return this.reportsToFollow > 0;
|
|
649
|
+
}
|
|
650
|
+
mergePartialCCs(partials, _ctx) {
|
|
651
|
+
// Concat the list of nodes
|
|
652
|
+
this.nodeIds = [...partials, this]
|
|
653
|
+
.map((report) => report.nodeIds)
|
|
654
|
+
.reduce((prev, cur) => prev.concat(...cur), []);
|
|
655
|
+
}
|
|
656
|
+
serialize(ctx) {
|
|
657
|
+
this.payload = Bytes.from([
|
|
658
|
+
this.groupId,
|
|
659
|
+
this.maxNodes,
|
|
660
|
+
this.reportsToFollow,
|
|
661
|
+
...this.nodeIds,
|
|
662
|
+
]);
|
|
663
|
+
return super.serialize(ctx);
|
|
664
|
+
}
|
|
665
|
+
toLogEntry(ctx) {
|
|
666
|
+
return {
|
|
667
|
+
...super.toLogEntry(ctx),
|
|
668
|
+
message: {
|
|
669
|
+
"group id": this.groupId,
|
|
670
|
+
"max # of nodes": this.maxNodes,
|
|
671
|
+
"node IDs": this.nodeIds.join(", "),
|
|
672
|
+
"reports to follow": this.reportsToFollow,
|
|
673
|
+
},
|
|
674
|
+
};
|
|
675
|
+
}
|
|
676
|
+
};
|
|
677
|
+
return AssociationCCReport = _classThis;
|
|
678
|
+
})();
|
|
597
679
|
export { AssociationCCReport };
|
|
598
|
-
let AssociationCCGet =
|
|
599
|
-
|
|
600
|
-
|
|
601
|
-
|
|
602
|
-
|
|
680
|
+
let AssociationCCGet = (() => {
|
|
681
|
+
let _classDecorators = [CCCommand(AssociationCommand.Get), expectedCCResponse(AssociationCCReport)];
|
|
682
|
+
let _classDescriptor;
|
|
683
|
+
let _classExtraInitializers = [];
|
|
684
|
+
let _classThis;
|
|
685
|
+
let _classSuper = AssociationCC;
|
|
686
|
+
var AssociationCCGet = class extends _classSuper {
|
|
687
|
+
static { _classThis = this; }
|
|
688
|
+
static {
|
|
689
|
+
const _metadata = typeof Symbol === "function" && Symbol.metadata ? Object.create(_classSuper[Symbol.metadata] ?? null) : void 0;
|
|
690
|
+
__esDecorate(null, _classDescriptor = { value: _classThis }, _classDecorators, { kind: "class", name: _classThis.name, metadata: _metadata }, null, _classExtraInitializers);
|
|
691
|
+
AssociationCCGet = _classThis = _classDescriptor.value;
|
|
692
|
+
if (_metadata) Object.defineProperty(_classThis, Symbol.metadata, { enumerable: true, configurable: true, writable: true, value: _metadata });
|
|
693
|
+
__runInitializers(_classThis, _classExtraInitializers);
|
|
603
694
|
}
|
|
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
|
-
|
|
695
|
+
constructor(options) {
|
|
696
|
+
super(options);
|
|
697
|
+
if (options.groupId < 1) {
|
|
698
|
+
throw new ZWaveError("The group id must be positive!", ZWaveErrorCodes.Argument_Invalid);
|
|
699
|
+
}
|
|
700
|
+
this.groupId = options.groupId;
|
|
701
|
+
}
|
|
702
|
+
static from(raw, ctx) {
|
|
703
|
+
validatePayload(raw.payload.length >= 1);
|
|
704
|
+
const groupId = raw.payload[0];
|
|
705
|
+
return new this({
|
|
706
|
+
nodeId: ctx.sourceNodeId,
|
|
707
|
+
groupId,
|
|
708
|
+
});
|
|
709
|
+
}
|
|
710
|
+
groupId;
|
|
711
|
+
serialize(ctx) {
|
|
712
|
+
this.payload = Bytes.from([this.groupId]);
|
|
713
|
+
return super.serialize(ctx);
|
|
714
|
+
}
|
|
715
|
+
toLogEntry(ctx) {
|
|
716
|
+
return {
|
|
717
|
+
...super.toLogEntry(ctx),
|
|
718
|
+
message: { "group id": this.groupId },
|
|
719
|
+
};
|
|
720
|
+
}
|
|
721
|
+
};
|
|
722
|
+
return AssociationCCGet = _classThis;
|
|
723
|
+
})();
|
|
630
724
|
export { AssociationCCGet };
|
|
631
|
-
let AssociationCCSupportedGroupingsReport =
|
|
632
|
-
|
|
633
|
-
|
|
634
|
-
|
|
635
|
-
|
|
636
|
-
|
|
637
|
-
|
|
638
|
-
|
|
639
|
-
|
|
640
|
-
|
|
641
|
-
|
|
642
|
-
|
|
643
|
-
|
|
644
|
-
|
|
645
|
-
|
|
646
|
-
|
|
647
|
-
|
|
648
|
-
|
|
649
|
-
|
|
650
|
-
|
|
651
|
-
|
|
652
|
-
|
|
653
|
-
|
|
654
|
-
|
|
655
|
-
|
|
656
|
-
|
|
657
|
-
|
|
658
|
-
|
|
659
|
-
|
|
660
|
-
|
|
661
|
-
|
|
725
|
+
let AssociationCCSupportedGroupingsReport = (() => {
|
|
726
|
+
let _classDecorators = [CCCommand(AssociationCommand.SupportedGroupingsReport), ccValueProperty("groupCount", AssociationCCValues.groupCount)];
|
|
727
|
+
let _classDescriptor;
|
|
728
|
+
let _classExtraInitializers = [];
|
|
729
|
+
let _classThis;
|
|
730
|
+
let _classSuper = AssociationCC;
|
|
731
|
+
var AssociationCCSupportedGroupingsReport = class extends _classSuper {
|
|
732
|
+
static { _classThis = this; }
|
|
733
|
+
static {
|
|
734
|
+
const _metadata = typeof Symbol === "function" && Symbol.metadata ? Object.create(_classSuper[Symbol.metadata] ?? null) : void 0;
|
|
735
|
+
__esDecorate(null, _classDescriptor = { value: _classThis }, _classDecorators, { kind: "class", name: _classThis.name, metadata: _metadata }, null, _classExtraInitializers);
|
|
736
|
+
AssociationCCSupportedGroupingsReport = _classThis = _classDescriptor.value;
|
|
737
|
+
if (_metadata) Object.defineProperty(_classThis, Symbol.metadata, { enumerable: true, configurable: true, writable: true, value: _metadata });
|
|
738
|
+
__runInitializers(_classThis, _classExtraInitializers);
|
|
739
|
+
}
|
|
740
|
+
constructor(options) {
|
|
741
|
+
super(options);
|
|
742
|
+
this.groupCount = options.groupCount;
|
|
743
|
+
}
|
|
744
|
+
static from(raw, ctx) {
|
|
745
|
+
validatePayload(raw.payload.length >= 1);
|
|
746
|
+
const groupCount = raw.payload[0];
|
|
747
|
+
return new this({
|
|
748
|
+
nodeId: ctx.sourceNodeId,
|
|
749
|
+
groupCount,
|
|
750
|
+
});
|
|
751
|
+
}
|
|
752
|
+
groupCount;
|
|
753
|
+
serialize(ctx) {
|
|
754
|
+
this.payload = Bytes.from([this.groupCount]);
|
|
755
|
+
return super.serialize(ctx);
|
|
756
|
+
}
|
|
757
|
+
toLogEntry(ctx) {
|
|
758
|
+
return {
|
|
759
|
+
...super.toLogEntry(ctx),
|
|
760
|
+
message: { "group count": this.groupCount },
|
|
761
|
+
};
|
|
762
|
+
}
|
|
763
|
+
};
|
|
764
|
+
return AssociationCCSupportedGroupingsReport = _classThis;
|
|
765
|
+
})();
|
|
662
766
|
export { AssociationCCSupportedGroupingsReport };
|
|
663
|
-
let AssociationCCSupportedGroupingsGet =
|
|
664
|
-
|
|
665
|
-
|
|
666
|
-
|
|
667
|
-
|
|
668
|
-
|
|
767
|
+
let AssociationCCSupportedGroupingsGet = (() => {
|
|
768
|
+
let _classDecorators = [CCCommand(AssociationCommand.SupportedGroupingsGet), expectedCCResponse(AssociationCCSupportedGroupingsReport)];
|
|
769
|
+
let _classDescriptor;
|
|
770
|
+
let _classExtraInitializers = [];
|
|
771
|
+
let _classThis;
|
|
772
|
+
let _classSuper = AssociationCC;
|
|
773
|
+
var AssociationCCSupportedGroupingsGet = class extends _classSuper {
|
|
774
|
+
static { _classThis = this; }
|
|
775
|
+
static {
|
|
776
|
+
const _metadata = typeof Symbol === "function" && Symbol.metadata ? Object.create(_classSuper[Symbol.metadata] ?? null) : void 0;
|
|
777
|
+
__esDecorate(null, _classDescriptor = { value: _classThis }, _classDecorators, { kind: "class", name: _classThis.name, metadata: _metadata }, null, _classExtraInitializers);
|
|
778
|
+
AssociationCCSupportedGroupingsGet = _classThis = _classDescriptor.value;
|
|
779
|
+
if (_metadata) Object.defineProperty(_classThis, Symbol.metadata, { enumerable: true, configurable: true, writable: true, value: _metadata });
|
|
780
|
+
__runInitializers(_classThis, _classExtraInitializers);
|
|
781
|
+
}
|
|
782
|
+
};
|
|
783
|
+
return AssociationCCSupportedGroupingsGet = _classThis;
|
|
784
|
+
})();
|
|
669
785
|
export { AssociationCCSupportedGroupingsGet };
|
|
670
|
-
let AssociationCCSpecificGroupReport =
|
|
671
|
-
|
|
672
|
-
|
|
673
|
-
|
|
674
|
-
|
|
675
|
-
|
|
676
|
-
|
|
677
|
-
|
|
678
|
-
|
|
679
|
-
|
|
680
|
-
|
|
681
|
-
|
|
682
|
-
|
|
683
|
-
|
|
684
|
-
|
|
685
|
-
|
|
686
|
-
|
|
687
|
-
|
|
688
|
-
|
|
689
|
-
|
|
690
|
-
|
|
691
|
-
|
|
692
|
-
|
|
693
|
-
|
|
694
|
-
|
|
695
|
-
|
|
696
|
-
|
|
697
|
-
|
|
786
|
+
let AssociationCCSpecificGroupReport = (() => {
|
|
787
|
+
let _classDecorators = [CCCommand(AssociationCommand.SpecificGroupReport)];
|
|
788
|
+
let _classDescriptor;
|
|
789
|
+
let _classExtraInitializers = [];
|
|
790
|
+
let _classThis;
|
|
791
|
+
let _classSuper = AssociationCC;
|
|
792
|
+
var AssociationCCSpecificGroupReport = class extends _classSuper {
|
|
793
|
+
static { _classThis = this; }
|
|
794
|
+
static {
|
|
795
|
+
const _metadata = typeof Symbol === "function" && Symbol.metadata ? Object.create(_classSuper[Symbol.metadata] ?? null) : void 0;
|
|
796
|
+
__esDecorate(null, _classDescriptor = { value: _classThis }, _classDecorators, { kind: "class", name: _classThis.name, metadata: _metadata }, null, _classExtraInitializers);
|
|
797
|
+
AssociationCCSpecificGroupReport = _classThis = _classDescriptor.value;
|
|
798
|
+
if (_metadata) Object.defineProperty(_classThis, Symbol.metadata, { enumerable: true, configurable: true, writable: true, value: _metadata });
|
|
799
|
+
__runInitializers(_classThis, _classExtraInitializers);
|
|
800
|
+
}
|
|
801
|
+
constructor(options) {
|
|
802
|
+
super(options);
|
|
803
|
+
this.group = options.group;
|
|
804
|
+
}
|
|
805
|
+
static from(raw, ctx) {
|
|
806
|
+
validatePayload(raw.payload.length >= 1);
|
|
807
|
+
const group = raw.payload[0];
|
|
808
|
+
return new this({
|
|
809
|
+
nodeId: ctx.sourceNodeId,
|
|
810
|
+
group,
|
|
811
|
+
});
|
|
812
|
+
}
|
|
813
|
+
group;
|
|
814
|
+
serialize(ctx) {
|
|
815
|
+
this.payload = Bytes.from([this.group]);
|
|
816
|
+
return super.serialize(ctx);
|
|
817
|
+
}
|
|
818
|
+
toLogEntry(ctx) {
|
|
819
|
+
return {
|
|
820
|
+
...super.toLogEntry(ctx),
|
|
821
|
+
message: { group: this.group },
|
|
822
|
+
};
|
|
823
|
+
}
|
|
824
|
+
};
|
|
825
|
+
return AssociationCCSpecificGroupReport = _classThis;
|
|
826
|
+
})();
|
|
698
827
|
export { AssociationCCSpecificGroupReport };
|
|
699
|
-
let AssociationCCSpecificGroupGet =
|
|
700
|
-
|
|
701
|
-
|
|
702
|
-
|
|
703
|
-
|
|
704
|
-
|
|
828
|
+
let AssociationCCSpecificGroupGet = (() => {
|
|
829
|
+
let _classDecorators = [CCCommand(AssociationCommand.SpecificGroupGet), expectedCCResponse(AssociationCCSpecificGroupReport)];
|
|
830
|
+
let _classDescriptor;
|
|
831
|
+
let _classExtraInitializers = [];
|
|
832
|
+
let _classThis;
|
|
833
|
+
let _classSuper = AssociationCC;
|
|
834
|
+
var AssociationCCSpecificGroupGet = class extends _classSuper {
|
|
835
|
+
static { _classThis = this; }
|
|
836
|
+
static {
|
|
837
|
+
const _metadata = typeof Symbol === "function" && Symbol.metadata ? Object.create(_classSuper[Symbol.metadata] ?? null) : void 0;
|
|
838
|
+
__esDecorate(null, _classDescriptor = { value: _classThis }, _classDecorators, { kind: "class", name: _classThis.name, metadata: _metadata }, null, _classExtraInitializers);
|
|
839
|
+
AssociationCCSpecificGroupGet = _classThis = _classDescriptor.value;
|
|
840
|
+
if (_metadata) Object.defineProperty(_classThis, Symbol.metadata, { enumerable: true, configurable: true, writable: true, value: _metadata });
|
|
841
|
+
__runInitializers(_classThis, _classExtraInitializers);
|
|
842
|
+
}
|
|
843
|
+
};
|
|
844
|
+
return AssociationCCSpecificGroupGet = _classThis;
|
|
845
|
+
})();
|
|
705
846
|
export { AssociationCCSpecificGroupGet };
|
|
706
847
|
//# sourceMappingURL=AssociationCC.js.map
|