@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
|
@@ -48,13 +48,45 @@ var import_CommandClass = require("../lib/CommandClass.js");
|
|
|
48
48
|
var import_CommandClassDecorators = require("../lib/CommandClassDecorators.js");
|
|
49
49
|
var import_Values = require("../lib/Values.js");
|
|
50
50
|
var import_Types = require("../lib/_Types.js");
|
|
51
|
-
var
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
51
|
+
var __esDecorate = function(ctor, descriptorIn, decorators, contextIn, initializers, extraInitializers) {
|
|
52
|
+
function accept(f) {
|
|
53
|
+
if (f !== void 0 && typeof f !== "function") throw new TypeError("Function expected");
|
|
54
|
+
return f;
|
|
55
|
+
}
|
|
56
|
+
var kind = contextIn.kind, key = kind === "getter" ? "get" : kind === "setter" ? "set" : "value";
|
|
57
|
+
var target = !descriptorIn && ctor ? contextIn["static"] ? ctor : ctor.prototype : null;
|
|
58
|
+
var descriptor = descriptorIn || (target ? Object.getOwnPropertyDescriptor(target, contextIn.name) : {});
|
|
59
|
+
var _, done = false;
|
|
60
|
+
for (var i = decorators.length - 1; i >= 0; i--) {
|
|
61
|
+
var context = {};
|
|
62
|
+
for (var p in contextIn) context[p] = p === "access" ? {} : contextIn[p];
|
|
63
|
+
for (var p in contextIn.access) context.access[p] = contextIn.access[p];
|
|
64
|
+
context.addInitializer = function(f) {
|
|
65
|
+
if (done) throw new TypeError("Cannot add initializers after decoration has completed");
|
|
66
|
+
extraInitializers.push(accept(f || null));
|
|
67
|
+
};
|
|
68
|
+
var result = (0, decorators[i])(kind === "accessor" ? { get: descriptor.get, set: descriptor.set } : descriptor[key], context);
|
|
69
|
+
if (kind === "accessor") {
|
|
70
|
+
if (result === void 0) continue;
|
|
71
|
+
if (result === null || typeof result !== "object") throw new TypeError("Object expected");
|
|
72
|
+
if (_ = accept(result.get)) descriptor.get = _;
|
|
73
|
+
if (_ = accept(result.set)) descriptor.set = _;
|
|
74
|
+
if (_ = accept(result.init)) initializers.unshift(_);
|
|
75
|
+
} else if (_ = accept(result)) {
|
|
76
|
+
if (kind === "field") initializers.unshift(_);
|
|
77
|
+
else descriptor[key] = _;
|
|
78
|
+
}
|
|
79
|
+
}
|
|
80
|
+
if (target) Object.defineProperty(target, contextIn.name, descriptor);
|
|
81
|
+
done = true;
|
|
82
|
+
};
|
|
83
|
+
var __runInitializers = function(thisArg, initializers, value) {
|
|
84
|
+
var useValue = arguments.length > 2;
|
|
85
|
+
for (var i = 0; i < initializers.length; i++) {
|
|
86
|
+
value = useValue ? initializers[i].call(thisArg, value) : initializers[i].call(thisArg);
|
|
87
|
+
}
|
|
88
|
+
return useValue ? value : void 0;
|
|
56
89
|
};
|
|
57
|
-
var ConfigurationCCReport_1, ConfigurationCCGet_1, ConfigurationCCSet_1, ConfigurationCCBulkReport_1, ConfigurationCCNameReport_1, ConfigurationCCNameGet_1, ConfigurationCCInfoReport_1, ConfigurationCCInfoGet_1, ConfigurationCCPropertiesReport_1, ConfigurationCCPropertiesGet_1;
|
|
58
90
|
function __assertType(argName, typeName, boundHasError) {
|
|
59
91
|
const { ZWaveError: ZWaveError2, ZWaveErrorCodes: ZWaveErrorCodes2 } = require("@zwave-js/core");
|
|
60
92
|
if (boundHasError()) {
|
|
@@ -551,526 +583,557 @@ function getParamInformationFromConfigFile(ctx, nodeId, endpointIndex) {
|
|
|
551
583
|
return deviceConfig?.endpoints?.get(endpointIndex)?.paramInformation;
|
|
552
584
|
}
|
|
553
585
|
}
|
|
554
|
-
let ConfigurationCCAPI =
|
|
555
|
-
|
|
556
|
-
|
|
557
|
-
|
|
558
|
-
|
|
559
|
-
|
|
560
|
-
|
|
561
|
-
|
|
562
|
-
|
|
563
|
-
|
|
564
|
-
|
|
565
|
-
|
|
566
|
-
|
|
567
|
-
|
|
568
|
-
|
|
569
|
-
|
|
570
|
-
}
|
|
571
|
-
|
|
572
|
-
|
|
573
|
-
|
|
574
|
-
|
|
575
|
-
|
|
576
|
-
|
|
577
|
-
|
|
578
|
-
|
|
579
|
-
|
|
580
|
-
|
|
581
|
-
|
|
582
|
-
|
|
586
|
+
let ConfigurationCCAPI = (() => {
|
|
587
|
+
let _classDecorators = [(0, import_CommandClassDecorators.API)(import_safe.CommandClasses.Configuration)];
|
|
588
|
+
let _classDescriptor;
|
|
589
|
+
let _classExtraInitializers = [];
|
|
590
|
+
let _classThis;
|
|
591
|
+
let _classSuper = import_API.CCAPI;
|
|
592
|
+
var ConfigurationCCAPI2 = class extends _classSuper {
|
|
593
|
+
static {
|
|
594
|
+
_classThis = this;
|
|
595
|
+
}
|
|
596
|
+
static {
|
|
597
|
+
const _metadata = typeof Symbol === "function" && Symbol.metadata ? Object.create(_classSuper[Symbol.metadata] ?? null) : void 0;
|
|
598
|
+
__esDecorate(null, _classDescriptor = { value: _classThis }, _classDecorators, { kind: "class", name: _classThis.name, metadata: _metadata }, null, _classExtraInitializers);
|
|
599
|
+
ConfigurationCCAPI2 = _classThis = _classDescriptor.value;
|
|
600
|
+
if (_metadata) Object.defineProperty(_classThis, Symbol.metadata, { enumerable: true, configurable: true, writable: true, value: _metadata });
|
|
601
|
+
__runInitializers(_classThis, _classExtraInitializers);
|
|
602
|
+
}
|
|
603
|
+
supportsCommand(cmd) {
|
|
604
|
+
switch (cmd) {
|
|
605
|
+
case import_Types.ConfigurationCommand.Get:
|
|
606
|
+
case import_Types.ConfigurationCommand.Set:
|
|
607
|
+
return true;
|
|
608
|
+
// This is mandatory
|
|
609
|
+
case import_Types.ConfigurationCommand.BulkGet:
|
|
610
|
+
case import_Types.ConfigurationCommand.BulkSet:
|
|
611
|
+
return this.version >= 2;
|
|
612
|
+
case import_Types.ConfigurationCommand.NameGet:
|
|
613
|
+
case import_Types.ConfigurationCommand.InfoGet:
|
|
614
|
+
case import_Types.ConfigurationCommand.PropertiesGet:
|
|
615
|
+
return this.version >= 3;
|
|
616
|
+
case import_Types.ConfigurationCommand.DefaultReset:
|
|
617
|
+
return this.version >= 4;
|
|
583
618
|
}
|
|
584
|
-
|
|
585
|
-
|
|
586
|
-
|
|
587
|
-
|
|
588
|
-
|
|
589
|
-
|
|
590
|
-
if (!nodes.every((node) => node.getEndpoint(this.endpoint.index)?.supportsCC(import_safe.CommandClasses.Configuration))) {
|
|
591
|
-
throw new import_safe.ZWaveError(`The multicast setValue API for Configuration CC requires all virtual target endpoints to support Configuration CC!`, import_safe.ZWaveErrorCodes.CC_Invalid);
|
|
619
|
+
return super.supportsCommand(cmd);
|
|
620
|
+
}
|
|
621
|
+
get [import_API.SET_VALUE]() {
|
|
622
|
+
return async function({ property, propertyKey }, value) {
|
|
623
|
+
if (typeof property !== "number") {
|
|
624
|
+
(0, import_API.throwUnsupportedProperty)(this.ccId, property);
|
|
592
625
|
}
|
|
593
|
-
|
|
594
|
-
|
|
595
|
-
if (index === 0)
|
|
596
|
-
return true;
|
|
597
|
-
return info.valueSize === paramInfos[0].valueSize && info.format === paramInfos[0].format;
|
|
598
|
-
})) {
|
|
599
|
-
throw new import_safe.ZWaveError(`The multicast setValue API for Configuration CC requires all virtual target nodes to have the same parameter definition!`, import_safe.ZWaveErrorCodes.CC_Invalid);
|
|
626
|
+
if (propertyKey != void 0 && typeof propertyKey !== "number") {
|
|
627
|
+
(0, import_API.throwUnsupportedPropertyKey)(this.ccId, property, propertyKey);
|
|
600
628
|
}
|
|
601
|
-
|
|
602
|
-
|
|
603
|
-
|
|
604
|
-
|
|
605
|
-
|
|
606
|
-
|
|
607
|
-
|
|
608
|
-
if (
|
|
609
|
-
|
|
629
|
+
if (typeof value !== "number") {
|
|
630
|
+
(0, import_API.throwWrongValueType)(this.ccId, property, "number", typeof value);
|
|
631
|
+
}
|
|
632
|
+
let ccInstance;
|
|
633
|
+
const applHost = this.host;
|
|
634
|
+
if (this.isSinglecast()) {
|
|
635
|
+
ccInstance = createConfigurationCCInstance(this.endpoint);
|
|
636
|
+
} else if (this.isMulticast()) {
|
|
637
|
+
const nodes = this.endpoint.node.physicalNodes;
|
|
638
|
+
if (!nodes.every((node) => node.getEndpoint(this.endpoint.index)?.supportsCC(import_safe.CommandClasses.Configuration))) {
|
|
639
|
+
throw new import_safe.ZWaveError(`The multicast setValue API for Configuration CC requires all virtual target endpoints to support Configuration CC!`, import_safe.ZWaveErrorCodes.CC_Invalid);
|
|
640
|
+
}
|
|
641
|
+
const paramInfos = this.endpoint.node.physicalNodes.map((node) => createConfigurationCCInstance(node.getEndpoint(this.endpoint.index)).getParamInformation(this.host, property, propertyKey));
|
|
642
|
+
if (!paramInfos.length || !paramInfos.every((info, index) => {
|
|
643
|
+
if (index === 0)
|
|
644
|
+
return true;
|
|
645
|
+
return info.valueSize === paramInfos[0].valueSize && info.format === paramInfos[0].format;
|
|
646
|
+
})) {
|
|
647
|
+
throw new import_safe.ZWaveError(`The multicast setValue API for Configuration CC requires all virtual target nodes to have the same parameter definition!`, import_safe.ZWaveErrorCodes.CC_Invalid);
|
|
648
|
+
}
|
|
649
|
+
ccInstance = createConfigurationCCInstance(this.endpoint);
|
|
650
|
+
} else {
|
|
651
|
+
throw new import_safe.ZWaveError(`The setValue API for Configuration CC is not supported via broadcast!`, import_safe.ZWaveErrorCodes.CC_NotSupported);
|
|
652
|
+
}
|
|
653
|
+
let { valueSize, format: valueFormat = import_safe.ConfigValueFormat.SignedInteger } = ccInstance.getParamInformation(applHost, property);
|
|
654
|
+
let targetValue;
|
|
655
|
+
if (propertyKey) {
|
|
656
|
+
if (!valueSize) {
|
|
657
|
+
valueSize = ccInstance.getParamInformation(applHost, property, propertyKey).valueSize;
|
|
658
|
+
}
|
|
659
|
+
targetValue = ccInstance.composePartialParamValue(applHost, property, propertyKey, value);
|
|
660
|
+
valueFormat = import_safe.ConfigValueFormat.UnsignedInteger;
|
|
661
|
+
} else {
|
|
662
|
+
targetValue = value;
|
|
610
663
|
}
|
|
611
|
-
targetValue = ccInstance.composePartialParamValue(applHost, property, propertyKey, value);
|
|
612
|
-
valueFormat = import_safe.ConfigValueFormat.UnsignedInteger;
|
|
613
|
-
} else {
|
|
614
|
-
targetValue = value;
|
|
615
|
-
}
|
|
616
|
-
if (!valueSize) {
|
|
617
|
-
valueSize = (0, import_safe.getMinIntegerSize)(targetValue, valueFormat === import_safe.ConfigValueFormat.SignedInteger);
|
|
618
664
|
if (!valueSize) {
|
|
619
|
-
|
|
665
|
+
valueSize = (0, import_safe.getMinIntegerSize)(targetValue, valueFormat === import_safe.ConfigValueFormat.SignedInteger);
|
|
666
|
+
if (!valueSize) {
|
|
667
|
+
throw new import_safe.ZWaveError(`The value ${targetValue} is not valid for configuration parameters!`, import_safe.ZWaveErrorCodes.Argument_Invalid);
|
|
668
|
+
}
|
|
669
|
+
}
|
|
670
|
+
if (!isSafeValue(targetValue, valueSize, valueFormat)) {
|
|
671
|
+
throwInvalidValueError(targetValue, property, valueSize, valueFormat);
|
|
672
|
+
}
|
|
673
|
+
const result = await this.set({
|
|
674
|
+
parameter: property,
|
|
675
|
+
value: targetValue,
|
|
676
|
+
valueSize,
|
|
677
|
+
valueFormat
|
|
678
|
+
});
|
|
679
|
+
if (!(0, import_safe.supervisedCommandSucceeded)(result) && this.isSinglecast()) {
|
|
680
|
+
this.schedulePoll(
|
|
681
|
+
{ property, propertyKey },
|
|
682
|
+
targetValue,
|
|
683
|
+
// Configuration changes are instant
|
|
684
|
+
{ transition: "fast" }
|
|
685
|
+
);
|
|
686
|
+
}
|
|
687
|
+
return result;
|
|
688
|
+
};
|
|
689
|
+
}
|
|
690
|
+
get [import_API.POLL_VALUE]() {
|
|
691
|
+
return async function({ property, propertyKey }) {
|
|
692
|
+
if (typeof property !== "number") {
|
|
693
|
+
(0, import_API.throwUnsupportedProperty)(this.ccId, property);
|
|
694
|
+
}
|
|
695
|
+
if (propertyKey != void 0 && typeof propertyKey !== "number") {
|
|
696
|
+
(0, import_API.throwUnsupportedPropertyKey)(this.ccId, property, propertyKey);
|
|
620
697
|
}
|
|
698
|
+
return this.get(property, { valueBitMask: propertyKey });
|
|
699
|
+
};
|
|
700
|
+
}
|
|
701
|
+
/**
|
|
702
|
+
* Requests the current value of a given config parameter from the device.
|
|
703
|
+
* This may timeout and return `undefined` if the node does not respond.
|
|
704
|
+
* If the node replied with a different parameter number, a `ConfigurationCCError`
|
|
705
|
+
* is thrown with the `argument` property set to the reported parameter number.
|
|
706
|
+
*/
|
|
707
|
+
async get(parameter, options) {
|
|
708
|
+
__assertType("parameter", "number", __assertType__number.bind(void 0, parameter));
|
|
709
|
+
__assertType("options", void 0, __assertType__optional__0.bind(void 0, options));
|
|
710
|
+
this.assertPhysicalEndpoint(this.endpoint);
|
|
711
|
+
if (parameter > 255) {
|
|
712
|
+
const result = await this.getBulk([
|
|
713
|
+
{
|
|
714
|
+
parameter,
|
|
715
|
+
bitMask: options?.valueBitMask
|
|
716
|
+
}
|
|
717
|
+
]);
|
|
718
|
+
return result.find((r) => r.parameter === parameter)?.value;
|
|
621
719
|
}
|
|
622
|
-
|
|
623
|
-
|
|
720
|
+
this.assertSupportsCommand(import_Types.ConfigurationCommand, import_Types.ConfigurationCommand.Get);
|
|
721
|
+
const { valueBitMask, allowUnexpectedResponse } = options ?? {};
|
|
722
|
+
const cc = new ConfigurationCCGet({
|
|
723
|
+
nodeId: this.endpoint.nodeId,
|
|
724
|
+
endpointIndex: this.endpoint.index,
|
|
725
|
+
parameter,
|
|
726
|
+
allowUnexpectedResponse
|
|
727
|
+
});
|
|
728
|
+
const response = await this.host.sendCommand(cc, this.commandOptions);
|
|
729
|
+
if (!response)
|
|
730
|
+
return;
|
|
731
|
+
if (response.parameter === parameter) {
|
|
732
|
+
if (!valueBitMask)
|
|
733
|
+
return response.value;
|
|
734
|
+
const paramInfo = cc.getParamInformation(this.host, response.parameter, valueBitMask);
|
|
735
|
+
return (0, import_safe.parsePartial)(response.value, valueBitMask, isSignedPartial(valueBitMask, paramInfo.format));
|
|
624
736
|
}
|
|
625
|
-
|
|
626
|
-
|
|
627
|
-
|
|
628
|
-
|
|
629
|
-
|
|
737
|
+
this.host.logNode(this.endpoint.nodeId, {
|
|
738
|
+
endpoint: this.endpoint.index,
|
|
739
|
+
message: `Received unexpected ConfigurationReport (param = ${response.parameter}, value = ${response.value.toString()})`,
|
|
740
|
+
direction: "inbound",
|
|
741
|
+
level: "error"
|
|
630
742
|
});
|
|
631
|
-
|
|
632
|
-
|
|
633
|
-
|
|
634
|
-
|
|
635
|
-
|
|
636
|
-
|
|
637
|
-
|
|
743
|
+
throw new ConfigurationCCError(`The first existing parameter on this node is ${response.parameter}`, import_safe.ZWaveErrorCodes.ConfigurationCC_FirstParameterNumber, response.parameter);
|
|
744
|
+
}
|
|
745
|
+
/**
|
|
746
|
+
* Requests the current value of the config parameters from the device.
|
|
747
|
+
* When the node does not respond due to a timeout, the `value` in the returned array will be `undefined`.
|
|
748
|
+
*/
|
|
749
|
+
async getBulk(options) {
|
|
750
|
+
__assertType("options", void 0, __assertType__sa__2_ea_2.bind(void 0, options));
|
|
751
|
+
this.assertPhysicalEndpoint(this.endpoint);
|
|
752
|
+
let values;
|
|
753
|
+
const distinctParameters = (0, import_arrays.distinct)(options.map((o) => o.parameter));
|
|
754
|
+
if (this.supportsCommand(import_Types.ConfigurationCommand.BulkGet) && (0, import_safe.isConsecutiveArray)(distinctParameters)) {
|
|
755
|
+
const cc2 = new ConfigurationCCBulkGet({
|
|
756
|
+
nodeId: this.endpoint.nodeId,
|
|
757
|
+
endpointIndex: this.endpoint.index,
|
|
758
|
+
parameters: distinctParameters
|
|
759
|
+
});
|
|
760
|
+
const response = await this.host.sendCommand(cc2, this.commandOptions);
|
|
761
|
+
if (response)
|
|
762
|
+
values = response.values;
|
|
763
|
+
} else {
|
|
764
|
+
this.assertSupportsCommand(import_Types.ConfigurationCommand, import_Types.ConfigurationCommand.Get);
|
|
765
|
+
const _values = /* @__PURE__ */ new Map();
|
|
766
|
+
for (const parameter of distinctParameters) {
|
|
767
|
+
const cc2 = new ConfigurationCCGet({
|
|
768
|
+
nodeId: this.endpoint.nodeId,
|
|
769
|
+
endpointIndex: this.endpoint.index,
|
|
770
|
+
parameter
|
|
771
|
+
});
|
|
772
|
+
const response = await this.host.sendCommand(cc2, this.commandOptions);
|
|
773
|
+
if (response) {
|
|
774
|
+
_values.set(response.parameter, response.value);
|
|
775
|
+
}
|
|
776
|
+
}
|
|
777
|
+
values = _values;
|
|
638
778
|
}
|
|
639
|
-
|
|
640
|
-
|
|
641
|
-
|
|
642
|
-
|
|
643
|
-
|
|
644
|
-
|
|
645
|
-
|
|
779
|
+
const cc = createConfigurationCCInstance(this.endpoint);
|
|
780
|
+
return options.map((o) => {
|
|
781
|
+
let value = values?.get(o.parameter);
|
|
782
|
+
if (typeof value === "number" && o.bitMask) {
|
|
783
|
+
const paramInfo = cc.getParamInformation(this.host, o.parameter, o.bitMask);
|
|
784
|
+
value = (0, import_safe.parsePartial)(value, o.bitMask, isSignedPartial(o.bitMask, paramInfo.format));
|
|
785
|
+
}
|
|
786
|
+
return { ...o, value };
|
|
787
|
+
});
|
|
788
|
+
}
|
|
789
|
+
/**
|
|
790
|
+
* Sets a new value for a given config parameter of the device.
|
|
791
|
+
*/
|
|
792
|
+
async set(options) {
|
|
793
|
+
__assertType("options", "ConfigurationCCAPISetOptions", __assertType__ConfigurationCCAPISetOptions.bind(void 0, options));
|
|
794
|
+
if (options.parameter > 255) {
|
|
795
|
+
return this.setBulk([options]);
|
|
646
796
|
}
|
|
647
|
-
|
|
648
|
-
|
|
797
|
+
this.assertSupportsCommand(import_Types.ConfigurationCommand, import_Types.ConfigurationCommand.Set);
|
|
798
|
+
const normalized = normalizeConfigurationCCAPISetOptions(this.host, this.endpoint, options);
|
|
799
|
+
let value = normalized.value;
|
|
800
|
+
if (normalized.bitMask) {
|
|
801
|
+
const ccc = createConfigurationCCInstance(this.endpoint);
|
|
802
|
+
value = ccc.composePartialParamValue(this.host, normalized.parameter, normalized.bitMask, normalized.value);
|
|
649
803
|
}
|
|
650
|
-
|
|
651
|
-
};
|
|
652
|
-
}
|
|
653
|
-
/**
|
|
654
|
-
* Requests the current value of a given config parameter from the device.
|
|
655
|
-
* This may timeout and return `undefined` if the node does not respond.
|
|
656
|
-
* If the node replied with a different parameter number, a `ConfigurationCCError`
|
|
657
|
-
* is thrown with the `argument` property set to the reported parameter number.
|
|
658
|
-
*/
|
|
659
|
-
async get(parameter, options) {
|
|
660
|
-
__assertType("parameter", "number", __assertType__number.bind(void 0, parameter));
|
|
661
|
-
__assertType("options", void 0, __assertType__optional__0.bind(void 0, options));
|
|
662
|
-
this.assertPhysicalEndpoint(this.endpoint);
|
|
663
|
-
if (parameter > 255) {
|
|
664
|
-
const result = await this.getBulk([
|
|
665
|
-
{
|
|
666
|
-
parameter,
|
|
667
|
-
bitMask: options?.valueBitMask
|
|
668
|
-
}
|
|
669
|
-
]);
|
|
670
|
-
return result.find((r) => r.parameter === parameter)?.value;
|
|
671
|
-
}
|
|
672
|
-
this.assertSupportsCommand(import_Types.ConfigurationCommand, import_Types.ConfigurationCommand.Get);
|
|
673
|
-
const { valueBitMask, allowUnexpectedResponse } = options ?? {};
|
|
674
|
-
const cc = new ConfigurationCCGet({
|
|
675
|
-
nodeId: this.endpoint.nodeId,
|
|
676
|
-
endpointIndex: this.endpoint.index,
|
|
677
|
-
parameter,
|
|
678
|
-
allowUnexpectedResponse
|
|
679
|
-
});
|
|
680
|
-
const response = await this.host.sendCommand(cc, this.commandOptions);
|
|
681
|
-
if (!response)
|
|
682
|
-
return;
|
|
683
|
-
if (response.parameter === parameter) {
|
|
684
|
-
if (!valueBitMask)
|
|
685
|
-
return response.value;
|
|
686
|
-
const paramInfo = cc.getParamInformation(this.host, response.parameter, valueBitMask);
|
|
687
|
-
return (0, import_safe.parsePartial)(response.value, valueBitMask, isSignedPartial(valueBitMask, paramInfo.format));
|
|
688
|
-
}
|
|
689
|
-
this.host.logNode(this.endpoint.nodeId, {
|
|
690
|
-
endpoint: this.endpoint.index,
|
|
691
|
-
message: `Received unexpected ConfigurationReport (param = ${response.parameter}, value = ${response.value.toString()})`,
|
|
692
|
-
direction: "inbound",
|
|
693
|
-
level: "error"
|
|
694
|
-
});
|
|
695
|
-
throw new ConfigurationCCError(`The first existing parameter on this node is ${response.parameter}`, import_safe.ZWaveErrorCodes.ConfigurationCC_FirstParameterNumber, response.parameter);
|
|
696
|
-
}
|
|
697
|
-
/**
|
|
698
|
-
* Requests the current value of the config parameters from the device.
|
|
699
|
-
* When the node does not respond due to a timeout, the `value` in the returned array will be `undefined`.
|
|
700
|
-
*/
|
|
701
|
-
async getBulk(options) {
|
|
702
|
-
__assertType("options", void 0, __assertType__sa__2_ea_2.bind(void 0, options));
|
|
703
|
-
this.assertPhysicalEndpoint(this.endpoint);
|
|
704
|
-
let values;
|
|
705
|
-
const distinctParameters = (0, import_arrays.distinct)(options.map((o) => o.parameter));
|
|
706
|
-
if (this.supportsCommand(import_Types.ConfigurationCommand.BulkGet) && (0, import_safe.isConsecutiveArray)(distinctParameters)) {
|
|
707
|
-
const cc2 = new ConfigurationCCBulkGet({
|
|
804
|
+
const cc = new ConfigurationCCSet({
|
|
708
805
|
nodeId: this.endpoint.nodeId,
|
|
709
806
|
endpointIndex: this.endpoint.index,
|
|
710
|
-
|
|
807
|
+
resetToDefault: false,
|
|
808
|
+
parameter: normalized.parameter,
|
|
809
|
+
value,
|
|
810
|
+
valueSize: normalized.valueSize,
|
|
811
|
+
valueFormat: normalized.valueFormat
|
|
711
812
|
});
|
|
712
|
-
|
|
713
|
-
|
|
714
|
-
|
|
715
|
-
|
|
716
|
-
|
|
717
|
-
|
|
718
|
-
|
|
719
|
-
|
|
813
|
+
return this.host.sendCommand(cc, this.commandOptions);
|
|
814
|
+
}
|
|
815
|
+
/**
|
|
816
|
+
* Sets new values for multiple config parameters of the device. Uses the `BulkSet` command if supported, otherwise falls back to individual `Set` commands.
|
|
817
|
+
*/
|
|
818
|
+
async setBulk(values) {
|
|
819
|
+
__assertType("values", void 0, __assertType__sa_su_si__4__5_ei_si__4__7_ei_si__4__9_ei_eu_ea_2.bind(void 0, values));
|
|
820
|
+
const normalized = values.map((v) => normalizeConfigurationCCAPISetOptions(this.host, this.endpoint, v));
|
|
821
|
+
const allParams = bulkMergePartialParamValues(this.host, this.endpoint, normalized);
|
|
822
|
+
const canUseBulkSet = this.supportsCommand(import_Types.ConfigurationCommand.BulkSet) && (0, import_safe.isConsecutiveArray)(allParams.map((v) => v.parameter)) && new Set(allParams.map((v) => v.valueFormat)).size === 1 && new Set(allParams.map((v) => v.valueSize)).size === 1;
|
|
823
|
+
if (canUseBulkSet) {
|
|
824
|
+
const cc = new ConfigurationCCBulkSet({
|
|
720
825
|
nodeId: this.endpoint.nodeId,
|
|
721
826
|
endpointIndex: this.endpoint.index,
|
|
722
|
-
parameter
|
|
827
|
+
parameters: allParams.map((v) => v.parameter),
|
|
828
|
+
valueSize: allParams[0].valueSize,
|
|
829
|
+
valueFormat: allParams[0].valueFormat,
|
|
830
|
+
values: allParams.map((v) => v.value),
|
|
831
|
+
handshake: true
|
|
723
832
|
});
|
|
724
|
-
const
|
|
725
|
-
if (
|
|
726
|
-
|
|
833
|
+
const result = await this.host.sendCommand(cc, this.commandOptions);
|
|
834
|
+
if (result) {
|
|
835
|
+
const sentValues = cc.values;
|
|
836
|
+
const receivedValues = [...result.values.values()];
|
|
837
|
+
const success = sentValues.length === receivedValues.length && sentValues.every((v, i) => v === receivedValues[i]);
|
|
838
|
+
return {
|
|
839
|
+
status: success ? import_safe.SupervisionStatus.Success : import_safe.SupervisionStatus.Fail
|
|
840
|
+
};
|
|
841
|
+
} else {
|
|
842
|
+
return void 0;
|
|
843
|
+
}
|
|
844
|
+
} else {
|
|
845
|
+
this.assertSupportsCommand(import_Types.ConfigurationCommand, import_Types.ConfigurationCommand.Set);
|
|
846
|
+
const supervisionResults = [];
|
|
847
|
+
for (const { parameter, value, valueSize, valueFormat } of allParams) {
|
|
848
|
+
const cc = new ConfigurationCCSet({
|
|
849
|
+
nodeId: this.endpoint.nodeId,
|
|
850
|
+
endpointIndex: this.endpoint.index,
|
|
851
|
+
parameter,
|
|
852
|
+
value,
|
|
853
|
+
valueSize,
|
|
854
|
+
valueFormat
|
|
855
|
+
});
|
|
856
|
+
supervisionResults.push(await this.host.sendCommand(cc, this.commandOptions));
|
|
727
857
|
}
|
|
858
|
+
return (0, import_safe.mergeSupervisionResults)(supervisionResults);
|
|
728
859
|
}
|
|
729
|
-
|
|
730
|
-
|
|
731
|
-
|
|
732
|
-
|
|
733
|
-
|
|
734
|
-
|
|
735
|
-
|
|
736
|
-
|
|
860
|
+
}
|
|
861
|
+
/**
|
|
862
|
+
* Resets a configuration parameter to its default value.
|
|
863
|
+
*
|
|
864
|
+
* WARNING: This will throw on legacy devices (ConfigurationCC v3 and below)
|
|
865
|
+
*/
|
|
866
|
+
async reset(parameter) {
|
|
867
|
+
__assertType("parameter", "number", __assertType__number.bind(void 0, parameter));
|
|
868
|
+
if (parameter > 255) {
|
|
869
|
+
return this.resetBulk([parameter]);
|
|
737
870
|
}
|
|
738
|
-
|
|
739
|
-
|
|
740
|
-
|
|
741
|
-
|
|
742
|
-
|
|
743
|
-
*/
|
|
744
|
-
async set(options) {
|
|
745
|
-
__assertType("options", "ConfigurationCCAPISetOptions", __assertType__ConfigurationCCAPISetOptions.bind(void 0, options));
|
|
746
|
-
if (options.parameter > 255) {
|
|
747
|
-
return this.setBulk([options]);
|
|
748
|
-
}
|
|
749
|
-
this.assertSupportsCommand(import_Types.ConfigurationCommand, import_Types.ConfigurationCommand.Set);
|
|
750
|
-
const normalized = normalizeConfigurationCCAPISetOptions(this.host, this.endpoint, options);
|
|
751
|
-
let value = normalized.value;
|
|
752
|
-
if (normalized.bitMask) {
|
|
753
|
-
const ccc = createConfigurationCCInstance(this.endpoint);
|
|
754
|
-
value = ccc.composePartialParamValue(this.host, normalized.parameter, normalized.bitMask, normalized.value);
|
|
755
|
-
}
|
|
756
|
-
const cc = new ConfigurationCCSet({
|
|
757
|
-
nodeId: this.endpoint.nodeId,
|
|
758
|
-
endpointIndex: this.endpoint.index,
|
|
759
|
-
resetToDefault: false,
|
|
760
|
-
parameter: normalized.parameter,
|
|
761
|
-
value,
|
|
762
|
-
valueSize: normalized.valueSize,
|
|
763
|
-
valueFormat: normalized.valueFormat
|
|
764
|
-
});
|
|
765
|
-
return this.host.sendCommand(cc, this.commandOptions);
|
|
766
|
-
}
|
|
767
|
-
/**
|
|
768
|
-
* Sets new values for multiple config parameters of the device. Uses the `BulkSet` command if supported, otherwise falls back to individual `Set` commands.
|
|
769
|
-
*/
|
|
770
|
-
async setBulk(values) {
|
|
771
|
-
__assertType("values", void 0, __assertType__sa_su_si__4__5_ei_si__4__7_ei_si__4__9_ei_eu_ea_2.bind(void 0, values));
|
|
772
|
-
const normalized = values.map((v) => normalizeConfigurationCCAPISetOptions(this.host, this.endpoint, v));
|
|
773
|
-
const allParams = bulkMergePartialParamValues(this.host, this.endpoint, normalized);
|
|
774
|
-
const canUseBulkSet = this.supportsCommand(import_Types.ConfigurationCommand.BulkSet) && (0, import_safe.isConsecutiveArray)(allParams.map((v) => v.parameter)) && new Set(allParams.map((v) => v.valueFormat)).size === 1 && new Set(allParams.map((v) => v.valueSize)).size === 1;
|
|
775
|
-
if (canUseBulkSet) {
|
|
776
|
-
const cc = new ConfigurationCCBulkSet({
|
|
871
|
+
if (this.version <= 3) {
|
|
872
|
+
throw new import_safe.ZWaveError(`Resetting configuration parameters to default MUST not be done on nodes implementing ConfigurationCC V3 or below!`, import_safe.ZWaveErrorCodes.ConfigurationCC_NoResetToDefaultOnLegacyDevices);
|
|
873
|
+
}
|
|
874
|
+
this.assertSupportsCommand(import_Types.ConfigurationCommand, import_Types.ConfigurationCommand.Set);
|
|
875
|
+
const cc = new ConfigurationCCSet({
|
|
777
876
|
nodeId: this.endpoint.nodeId,
|
|
778
877
|
endpointIndex: this.endpoint.index,
|
|
779
|
-
|
|
780
|
-
|
|
781
|
-
valueFormat: allParams[0].valueFormat,
|
|
782
|
-
values: allParams.map((v) => v.value),
|
|
783
|
-
handshake: true
|
|
878
|
+
parameter,
|
|
879
|
+
resetToDefault: true
|
|
784
880
|
});
|
|
785
|
-
|
|
786
|
-
|
|
787
|
-
|
|
788
|
-
|
|
789
|
-
|
|
790
|
-
|
|
791
|
-
|
|
792
|
-
|
|
881
|
+
return this.host.sendCommand(cc, this.commandOptions);
|
|
882
|
+
}
|
|
883
|
+
/**
|
|
884
|
+
* Resets multiple configuration parameters to their default value. Uses BulkSet if supported, otherwise falls back to individual Set commands.
|
|
885
|
+
*
|
|
886
|
+
* WARNING: This will throw on legacy devices (ConfigurationCC v3 and below)
|
|
887
|
+
*/
|
|
888
|
+
async resetBulk(parameters) {
|
|
889
|
+
__assertType("parameters", void 0, __assertType__sa__number_ea_2.bind(void 0, parameters));
|
|
890
|
+
if ((0, import_safe.isConsecutiveArray)(parameters) && this.supportsCommand(import_Types.ConfigurationCommand.BulkSet)) {
|
|
891
|
+
const cc = new ConfigurationCCBulkSet({
|
|
892
|
+
nodeId: this.endpoint.nodeId,
|
|
893
|
+
endpointIndex: this.endpoint.index,
|
|
894
|
+
parameters,
|
|
895
|
+
resetToDefault: true
|
|
896
|
+
});
|
|
897
|
+
return this.host.sendCommand(cc, this.commandOptions);
|
|
793
898
|
} else {
|
|
794
|
-
|
|
795
|
-
|
|
796
|
-
} else {
|
|
797
|
-
this.assertSupportsCommand(import_Types.ConfigurationCommand, import_Types.ConfigurationCommand.Set);
|
|
798
|
-
const supervisionResults = [];
|
|
799
|
-
for (const { parameter, value, valueSize, valueFormat } of allParams) {
|
|
800
|
-
const cc = new ConfigurationCCSet({
|
|
899
|
+
this.assertSupportsCommand(import_Types.ConfigurationCommand, import_Types.ConfigurationCommand.Set);
|
|
900
|
+
const CCs = (0, import_arrays.distinct)(parameters).map((parameter) => new ConfigurationCCSet({
|
|
801
901
|
nodeId: this.endpoint.nodeId,
|
|
802
902
|
endpointIndex: this.endpoint.index,
|
|
803
903
|
parameter,
|
|
804
|
-
|
|
805
|
-
|
|
806
|
-
|
|
807
|
-
|
|
808
|
-
|
|
904
|
+
resetToDefault: true
|
|
905
|
+
}));
|
|
906
|
+
for (const cc of CCs) {
|
|
907
|
+
await this.host.sendCommand(cc, this.commandOptions);
|
|
908
|
+
}
|
|
809
909
|
}
|
|
810
|
-
return (0, import_safe.mergeSupervisionResults)(supervisionResults);
|
|
811
910
|
}
|
|
812
|
-
|
|
813
|
-
|
|
814
|
-
|
|
815
|
-
|
|
816
|
-
|
|
817
|
-
*/
|
|
818
|
-
async reset(parameter) {
|
|
819
|
-
__assertType("parameter", "number", __assertType__number.bind(void 0, parameter));
|
|
820
|
-
if (parameter > 255) {
|
|
821
|
-
return this.resetBulk([parameter]);
|
|
822
|
-
}
|
|
823
|
-
if (this.version <= 3) {
|
|
824
|
-
throw new import_safe.ZWaveError(`Resetting configuration parameters to default MUST not be done on nodes implementing ConfigurationCC V3 or below!`, import_safe.ZWaveErrorCodes.ConfigurationCC_NoResetToDefaultOnLegacyDevices);
|
|
825
|
-
}
|
|
826
|
-
this.assertSupportsCommand(import_Types.ConfigurationCommand, import_Types.ConfigurationCommand.Set);
|
|
827
|
-
const cc = new ConfigurationCCSet({
|
|
828
|
-
nodeId: this.endpoint.nodeId,
|
|
829
|
-
endpointIndex: this.endpoint.index,
|
|
830
|
-
parameter,
|
|
831
|
-
resetToDefault: true
|
|
832
|
-
});
|
|
833
|
-
return this.host.sendCommand(cc, this.commandOptions);
|
|
834
|
-
}
|
|
835
|
-
/**
|
|
836
|
-
* Resets multiple configuration parameters to their default value. Uses BulkSet if supported, otherwise falls back to individual Set commands.
|
|
837
|
-
*
|
|
838
|
-
* WARNING: This will throw on legacy devices (ConfigurationCC v3 and below)
|
|
839
|
-
*/
|
|
840
|
-
async resetBulk(parameters) {
|
|
841
|
-
__assertType("parameters", void 0, __assertType__sa__number_ea_2.bind(void 0, parameters));
|
|
842
|
-
if ((0, import_safe.isConsecutiveArray)(parameters) && this.supportsCommand(import_Types.ConfigurationCommand.BulkSet)) {
|
|
843
|
-
const cc = new ConfigurationCCBulkSet({
|
|
911
|
+
/** Resets all configuration parameters to their default value */
|
|
912
|
+
async resetAll() {
|
|
913
|
+
this.assertPhysicalEndpoint(this.endpoint);
|
|
914
|
+
this.assertSupportsCommand(import_Types.ConfigurationCommand, import_Types.ConfigurationCommand.DefaultReset);
|
|
915
|
+
const cc = new ConfigurationCCDefaultReset({
|
|
844
916
|
nodeId: this.endpoint.nodeId,
|
|
845
|
-
endpointIndex: this.endpoint.index
|
|
846
|
-
parameters,
|
|
847
|
-
resetToDefault: true
|
|
917
|
+
endpointIndex: this.endpoint.index
|
|
848
918
|
});
|
|
849
|
-
|
|
850
|
-
}
|
|
851
|
-
|
|
852
|
-
|
|
919
|
+
await this.host.sendCommand(cc, this.commandOptions);
|
|
920
|
+
}
|
|
921
|
+
async getProperties(parameter) {
|
|
922
|
+
__assertType("parameter", "number", __assertType__number.bind(void 0, parameter));
|
|
923
|
+
this.assertPhysicalEndpoint(this.endpoint);
|
|
924
|
+
const cc = new ConfigurationCCPropertiesGet({
|
|
853
925
|
nodeId: this.endpoint.nodeId,
|
|
854
926
|
endpointIndex: this.endpoint.index,
|
|
855
|
-
parameter
|
|
856
|
-
|
|
857
|
-
|
|
858
|
-
|
|
859
|
-
|
|
927
|
+
parameter
|
|
928
|
+
});
|
|
929
|
+
const response = await this.host.sendCommand(cc, this.commandOptions);
|
|
930
|
+
if (response) {
|
|
931
|
+
return (0, import_safe3.pick)(response, [
|
|
932
|
+
"valueSize",
|
|
933
|
+
"valueFormat",
|
|
934
|
+
"minValue",
|
|
935
|
+
"maxValue",
|
|
936
|
+
"defaultValue",
|
|
937
|
+
"nextParameter",
|
|
938
|
+
"altersCapabilities",
|
|
939
|
+
"isReadonly",
|
|
940
|
+
"isAdvanced",
|
|
941
|
+
"noBulkSupport"
|
|
942
|
+
]);
|
|
860
943
|
}
|
|
861
944
|
}
|
|
862
|
-
|
|
863
|
-
|
|
864
|
-
|
|
865
|
-
|
|
866
|
-
|
|
867
|
-
|
|
868
|
-
|
|
869
|
-
|
|
870
|
-
|
|
871
|
-
|
|
872
|
-
|
|
873
|
-
|
|
874
|
-
|
|
875
|
-
|
|
876
|
-
|
|
877
|
-
|
|
878
|
-
|
|
879
|
-
|
|
880
|
-
|
|
881
|
-
|
|
882
|
-
|
|
883
|
-
|
|
884
|
-
|
|
885
|
-
|
|
886
|
-
|
|
887
|
-
|
|
888
|
-
|
|
889
|
-
|
|
890
|
-
|
|
891
|
-
|
|
892
|
-
|
|
893
|
-
|
|
894
|
-
|
|
895
|
-
|
|
896
|
-
|
|
897
|
-
|
|
898
|
-
|
|
899
|
-
|
|
900
|
-
|
|
901
|
-
|
|
902
|
-
nodeId: this.endpoint.nodeId,
|
|
903
|
-
endpointIndex: this.endpoint.index,
|
|
904
|
-
parameter
|
|
905
|
-
});
|
|
906
|
-
const response = await this.host.sendCommand(cc, this.commandOptions);
|
|
907
|
-
return response?.name;
|
|
908
|
-
}
|
|
909
|
-
/** Requests usage info for a configuration parameter from the node */
|
|
910
|
-
async getInfo(parameter) {
|
|
911
|
-
__assertType("parameter", "number", __assertType__number.bind(void 0, parameter));
|
|
912
|
-
this.assertPhysicalEndpoint(this.endpoint);
|
|
913
|
-
const cc = new ConfigurationCCInfoGet({
|
|
914
|
-
nodeId: this.endpoint.nodeId,
|
|
915
|
-
endpointIndex: this.endpoint.index,
|
|
916
|
-
parameter
|
|
917
|
-
});
|
|
918
|
-
const response = await this.host.sendCommand(cc, this.commandOptions);
|
|
919
|
-
return response?.info;
|
|
920
|
-
}
|
|
921
|
-
/**
|
|
922
|
-
* This scans the node for the existing parameters. Found parameters will be reported
|
|
923
|
-
* through the `value added` and `value updated` events.
|
|
924
|
-
*
|
|
925
|
-
* WARNING: This method throws for newer devices.
|
|
926
|
-
*
|
|
927
|
-
* WARNING: On nodes implementing V1 and V2, this process may take
|
|
928
|
-
* **up to an hour**, depending on the configured timeout.
|
|
929
|
-
*
|
|
930
|
-
* WARNING: On nodes implementing V2, all parameters after 255 will be ignored.
|
|
931
|
-
*/
|
|
932
|
-
async scanParametersLegacy() {
|
|
933
|
-
if (this.version >= 3) {
|
|
934
|
-
throw new import_safe.ZWaveError("Use ConfigurationCC.interview instead of scanning parameters for versions 3 and above.", import_safe.ZWaveErrorCodes.ConfigurationCC_NoLegacyScanOnNewDevices);
|
|
935
|
-
}
|
|
936
|
-
this.assertPhysicalEndpoint(this.endpoint);
|
|
937
|
-
this.host.logNode(this.endpoint.nodeId, {
|
|
938
|
-
endpoint: this.endpoint.index,
|
|
939
|
-
message: `Scanning available parameters...`
|
|
940
|
-
});
|
|
941
|
-
const ccInstance = createConfigurationCCInstance(this.endpoint);
|
|
942
|
-
for (let param = 1; param <= 255; param++) {
|
|
943
|
-
let originalValue;
|
|
945
|
+
/** Requests the name of a configuration parameter from the node */
|
|
946
|
+
async getName(parameter) {
|
|
947
|
+
__assertType("parameter", "number", __assertType__number.bind(void 0, parameter));
|
|
948
|
+
this.assertPhysicalEndpoint(this.endpoint);
|
|
949
|
+
const cc = new ConfigurationCCNameGet({
|
|
950
|
+
nodeId: this.endpoint.nodeId,
|
|
951
|
+
endpointIndex: this.endpoint.index,
|
|
952
|
+
parameter
|
|
953
|
+
});
|
|
954
|
+
const response = await this.host.sendCommand(cc, this.commandOptions);
|
|
955
|
+
return response?.name;
|
|
956
|
+
}
|
|
957
|
+
/** Requests usage info for a configuration parameter from the node */
|
|
958
|
+
async getInfo(parameter) {
|
|
959
|
+
__assertType("parameter", "number", __assertType__number.bind(void 0, parameter));
|
|
960
|
+
this.assertPhysicalEndpoint(this.endpoint);
|
|
961
|
+
const cc = new ConfigurationCCInfoGet({
|
|
962
|
+
nodeId: this.endpoint.nodeId,
|
|
963
|
+
endpointIndex: this.endpoint.index,
|
|
964
|
+
parameter
|
|
965
|
+
});
|
|
966
|
+
const response = await this.host.sendCommand(cc, this.commandOptions);
|
|
967
|
+
return response?.info;
|
|
968
|
+
}
|
|
969
|
+
/**
|
|
970
|
+
* This scans the node for the existing parameters. Found parameters will be reported
|
|
971
|
+
* through the `value added` and `value updated` events.
|
|
972
|
+
*
|
|
973
|
+
* WARNING: This method throws for newer devices.
|
|
974
|
+
*
|
|
975
|
+
* WARNING: On nodes implementing V1 and V2, this process may take
|
|
976
|
+
* **up to an hour**, depending on the configured timeout.
|
|
977
|
+
*
|
|
978
|
+
* WARNING: On nodes implementing V2, all parameters after 255 will be ignored.
|
|
979
|
+
*/
|
|
980
|
+
async scanParametersLegacy() {
|
|
981
|
+
if (this.version >= 3) {
|
|
982
|
+
throw new import_safe.ZWaveError("Use ConfigurationCC.interview instead of scanning parameters for versions 3 and above.", import_safe.ZWaveErrorCodes.ConfigurationCC_NoLegacyScanOnNewDevices);
|
|
983
|
+
}
|
|
984
|
+
this.assertPhysicalEndpoint(this.endpoint);
|
|
944
985
|
this.host.logNode(this.endpoint.nodeId, {
|
|
945
986
|
endpoint: this.endpoint.index,
|
|
946
|
-
message: `
|
|
947
|
-
direction: "outbound"
|
|
987
|
+
message: `Scanning available parameters...`
|
|
948
988
|
});
|
|
949
|
-
|
|
950
|
-
|
|
951
|
-
|
|
952
|
-
|
|
953
|
-
|
|
954
|
-
|
|
989
|
+
const ccInstance = createConfigurationCCInstance(this.endpoint);
|
|
990
|
+
for (let param = 1; param <= 255; param++) {
|
|
991
|
+
let originalValue;
|
|
992
|
+
this.host.logNode(this.endpoint.nodeId, {
|
|
993
|
+
endpoint: this.endpoint.index,
|
|
994
|
+
message: ` trying param ${param}...`,
|
|
995
|
+
direction: "outbound"
|
|
955
996
|
});
|
|
956
|
-
|
|
957
|
-
|
|
997
|
+
try {
|
|
998
|
+
originalValue = await this.get(param, {
|
|
999
|
+
// When requesting a non-existing parameter, a node SHOULD respond with the
|
|
1000
|
+
// first available parameter. We use this for the first param only,
|
|
1001
|
+
// because delayed responses might otherwise confuse the interview process
|
|
1002
|
+
allowUnexpectedResponse: param === 1
|
|
1003
|
+
});
|
|
1004
|
+
if (originalValue != void 0) {
|
|
1005
|
+
const logMessage = ` Param ${param}:
|
|
958
1006
|
readable = true
|
|
959
1007
|
valueSize = ${ccInstance.getParamInformation(this.host, param).valueSize}
|
|
960
1008
|
value = ${originalValue.toString()}`;
|
|
961
|
-
|
|
962
|
-
|
|
963
|
-
|
|
964
|
-
|
|
965
|
-
|
|
966
|
-
|
|
967
|
-
|
|
968
|
-
|
|
969
|
-
|
|
970
|
-
|
|
971
|
-
|
|
1009
|
+
this.host.logNode(this.endpoint.nodeId, {
|
|
1010
|
+
endpoint: this.endpoint.index,
|
|
1011
|
+
message: logMessage,
|
|
1012
|
+
direction: "inbound"
|
|
1013
|
+
});
|
|
1014
|
+
}
|
|
1015
|
+
} catch (e) {
|
|
1016
|
+
if (e instanceof ConfigurationCCError && e.code === import_safe.ZWaveErrorCodes.ConfigurationCC_FirstParameterNumber) {
|
|
1017
|
+
if (e.argument - 1 > param)
|
|
1018
|
+
param = e.argument - 1;
|
|
1019
|
+
continue;
|
|
1020
|
+
}
|
|
1021
|
+
throw e;
|
|
972
1022
|
}
|
|
973
|
-
throw e;
|
|
974
1023
|
}
|
|
975
1024
|
}
|
|
976
|
-
}
|
|
977
|
-
|
|
978
|
-
|
|
979
|
-
|
|
980
|
-
|
|
981
|
-
let
|
|
982
|
-
|
|
983
|
-
|
|
984
|
-
|
|
985
|
-
|
|
986
|
-
|
|
987
|
-
|
|
988
|
-
|
|
989
|
-
|
|
990
|
-
|
|
991
|
-
|
|
992
|
-
|
|
993
|
-
|
|
994
|
-
|
|
995
|
-
|
|
996
|
-
|
|
997
|
-
|
|
998
|
-
|
|
999
|
-
|
|
1025
|
+
};
|
|
1026
|
+
return ConfigurationCCAPI2 = _classThis;
|
|
1027
|
+
})();
|
|
1028
|
+
let ConfigurationCC = (() => {
|
|
1029
|
+
let _classDecorators = [(0, import_CommandClassDecorators.commandClass)(import_safe.CommandClasses.Configuration), (0, import_CommandClassDecorators.implementedVersion)(4), (0, import_CommandClassDecorators.ccValues)(ConfigurationCCValues)];
|
|
1030
|
+
let _classDescriptor;
|
|
1031
|
+
let _classExtraInitializers = [];
|
|
1032
|
+
let _classThis;
|
|
1033
|
+
let _classSuper = import_CommandClass.CommandClass;
|
|
1034
|
+
var ConfigurationCC2 = class extends _classSuper {
|
|
1035
|
+
static {
|
|
1036
|
+
_classThis = this;
|
|
1037
|
+
}
|
|
1038
|
+
static {
|
|
1039
|
+
const _metadata = typeof Symbol === "function" && Symbol.metadata ? Object.create(_classSuper[Symbol.metadata] ?? null) : void 0;
|
|
1040
|
+
__esDecorate(null, _classDescriptor = { value: _classThis }, _classDecorators, { kind: "class", name: _classThis.name, metadata: _metadata }, null, _classExtraInitializers);
|
|
1041
|
+
ConfigurationCC2 = _classThis = _classDescriptor.value;
|
|
1042
|
+
if (_metadata) Object.defineProperty(_classThis, Symbol.metadata, { enumerable: true, configurable: true, writable: true, value: _metadata });
|
|
1043
|
+
__runInitializers(_classThis, _classExtraInitializers);
|
|
1044
|
+
}
|
|
1045
|
+
async interview(ctx) {
|
|
1046
|
+
const node = this.getNode(ctx);
|
|
1047
|
+
const endpoint = this.getEndpoint(ctx);
|
|
1048
|
+
const api = import_API.CCAPI.create(import_safe.CommandClasses.Configuration, ctx, endpoint).withOptions({
|
|
1049
|
+
priority: import_safe.MessagePriority.NodeQuery
|
|
1000
1050
|
});
|
|
1001
|
-
this.deserializeParamInformationFromConfig(ctx, paramInfo);
|
|
1002
|
-
}
|
|
1003
|
-
const documentedParamNumbers = new Set(Array.from(paramInfo?.keys() ?? []).map((k) => k.parameter));
|
|
1004
|
-
if (api.version >= 3) {
|
|
1005
1051
|
ctx.logNode(node.id, {
|
|
1006
1052
|
endpoint: this.endpointIndex,
|
|
1007
|
-
message:
|
|
1008
|
-
direction: "
|
|
1053
|
+
message: `Interviewing ${this.ccName}...`,
|
|
1054
|
+
direction: "none"
|
|
1009
1055
|
});
|
|
1010
|
-
const
|
|
1011
|
-
|
|
1012
|
-
if (
|
|
1013
|
-
param = param0props.nextParameter;
|
|
1014
|
-
if (param === 0) {
|
|
1015
|
-
ctx.logNode(node.id, {
|
|
1016
|
-
endpoint: this.endpointIndex,
|
|
1017
|
-
message: `didn't report any config params, trying #1 just to be sure...`,
|
|
1018
|
-
direction: "inbound"
|
|
1019
|
-
});
|
|
1020
|
-
param = 1;
|
|
1021
|
-
}
|
|
1022
|
-
} else {
|
|
1056
|
+
const deviceConfig = ctx.getDeviceConfig?.(node.id);
|
|
1057
|
+
const paramInfo = getParamInformationFromConfigFile(ctx, node.id, this.endpointIndex);
|
|
1058
|
+
if (paramInfo) {
|
|
1023
1059
|
ctx.logNode(node.id, {
|
|
1024
1060
|
endpoint: this.endpointIndex,
|
|
1025
|
-
message:
|
|
1026
|
-
|
|
1061
|
+
message: `${this.constructor.name}: Loading configuration parameters from device config`,
|
|
1062
|
+
direction: "none"
|
|
1027
1063
|
});
|
|
1028
|
-
|
|
1064
|
+
this.deserializeParamInformationFromConfig(ctx, paramInfo);
|
|
1029
1065
|
}
|
|
1030
|
-
|
|
1066
|
+
const documentedParamNumbers = new Set(Array.from(paramInfo?.keys() ?? []).map((k) => k.parameter));
|
|
1067
|
+
if (api.version >= 3) {
|
|
1031
1068
|
ctx.logNode(node.id, {
|
|
1032
1069
|
endpoint: this.endpointIndex,
|
|
1033
|
-
message:
|
|
1070
|
+
message: "finding first configuration parameter...",
|
|
1034
1071
|
direction: "outbound"
|
|
1035
1072
|
});
|
|
1036
|
-
const
|
|
1037
|
-
|
|
1038
|
-
|
|
1039
|
-
|
|
1040
|
-
|
|
1073
|
+
const param0props = await api.getProperties(0);
|
|
1074
|
+
let param;
|
|
1075
|
+
if (param0props) {
|
|
1076
|
+
param = param0props.nextParameter;
|
|
1077
|
+
if (param === 0) {
|
|
1078
|
+
ctx.logNode(node.id, {
|
|
1079
|
+
endpoint: this.endpointIndex,
|
|
1080
|
+
message: `didn't report any config params, trying #1 just to be sure...`,
|
|
1081
|
+
direction: "inbound"
|
|
1082
|
+
});
|
|
1083
|
+
param = 1;
|
|
1084
|
+
}
|
|
1085
|
+
} else {
|
|
1041
1086
|
ctx.logNode(node.id, {
|
|
1042
1087
|
endpoint: this.endpointIndex,
|
|
1043
|
-
message:
|
|
1088
|
+
message: "Finding first configuration parameter timed out, skipping interview...",
|
|
1044
1089
|
level: "warn"
|
|
1045
1090
|
});
|
|
1046
|
-
|
|
1091
|
+
return;
|
|
1047
1092
|
}
|
|
1048
|
-
|
|
1049
|
-
|
|
1050
|
-
|
|
1051
|
-
|
|
1052
|
-
|
|
1053
|
-
|
|
1054
|
-
|
|
1055
|
-
|
|
1056
|
-
|
|
1057
|
-
|
|
1058
|
-
|
|
1059
|
-
|
|
1093
|
+
while (param > 0) {
|
|
1094
|
+
ctx.logNode(node.id, {
|
|
1095
|
+
endpoint: this.endpointIndex,
|
|
1096
|
+
message: `querying parameter #${param} information...`,
|
|
1097
|
+
direction: "outbound"
|
|
1098
|
+
});
|
|
1099
|
+
const props = await api.getProperties(param).catch(
|
|
1100
|
+
// If querying the properties fails, don't abort the entire interview
|
|
1101
|
+
() => void 0
|
|
1102
|
+
);
|
|
1103
|
+
if (!props) {
|
|
1104
|
+
ctx.logNode(node.id, {
|
|
1105
|
+
endpoint: this.endpointIndex,
|
|
1106
|
+
message: `Querying parameter #${param} information timed out, skipping scan...`,
|
|
1107
|
+
level: "warn"
|
|
1108
|
+
});
|
|
1109
|
+
break;
|
|
1110
|
+
}
|
|
1111
|
+
const { nextParameter, ...properties } = props;
|
|
1112
|
+
let logMessage;
|
|
1113
|
+
if (properties.valueSize === 0) {
|
|
1114
|
+
logMessage = `Parameter #${param} is unsupported. Next parameter: ${nextParameter}`;
|
|
1115
|
+
} else {
|
|
1116
|
+
let name;
|
|
1117
|
+
if (!documentedParamNumbers.has(param)) {
|
|
1118
|
+
if (!deviceConfig?.compat?.skipConfigurationNameQuery) {
|
|
1119
|
+
name = await api.getName(param).catch(
|
|
1120
|
+
// If querying the name fails, don't abort the entire interview
|
|
1121
|
+
() => void 0
|
|
1122
|
+
);
|
|
1123
|
+
}
|
|
1124
|
+
if (!deviceConfig?.compat?.skipConfigurationInfoQuery) {
|
|
1125
|
+
await api.getInfo(param).catch(
|
|
1126
|
+
// If querying the info fails, don't abort the entire interview
|
|
1127
|
+
() => void 0
|
|
1128
|
+
);
|
|
1129
|
+
}
|
|
1060
1130
|
}
|
|
1061
|
-
|
|
1062
|
-
|
|
1063
|
-
|
|
1064
|
-
|
|
1065
|
-
);
|
|
1131
|
+
logMessage = `received information for parameter #${param}:`;
|
|
1132
|
+
if (name) {
|
|
1133
|
+
logMessage += `
|
|
1134
|
+
parameter name: ${name}`;
|
|
1066
1135
|
}
|
|
1067
|
-
}
|
|
1068
|
-
logMessage = `received information for parameter #${param}:`;
|
|
1069
|
-
if (name) {
|
|
1070
1136
|
logMessage += `
|
|
1071
|
-
parameter name: ${name}`;
|
|
1072
|
-
}
|
|
1073
|
-
logMessage += `
|
|
1074
1137
|
value format: ${(0, import_safe3.getEnumMemberName)(import_safe.ConfigValueFormat, properties.valueFormat)}
|
|
1075
1138
|
value size: ${properties.valueSize} bytes
|
|
1076
1139
|
min value: ${properties.minValue?.toString() ?? "undefined"}
|
|
@@ -1080,1082 +1143,1266 @@ is read-only: ${!!properties.isReadonly}
|
|
|
1080
1143
|
is advanced (UI): ${!!properties.isAdvanced}
|
|
1081
1144
|
has bulk support: ${!properties.noBulkSupport}
|
|
1082
1145
|
alters capabilities: ${!!properties.altersCapabilities}`;
|
|
1083
|
-
|
|
1084
|
-
|
|
1085
|
-
|
|
1086
|
-
|
|
1087
|
-
|
|
1088
|
-
|
|
1089
|
-
|
|
1090
|
-
|
|
1091
|
-
|
|
1092
|
-
|
|
1146
|
+
}
|
|
1147
|
+
ctx.logNode(node.id, {
|
|
1148
|
+
endpoint: this.endpointIndex,
|
|
1149
|
+
message: logMessage,
|
|
1150
|
+
direction: "inbound"
|
|
1151
|
+
});
|
|
1152
|
+
if (nextParameter > param) {
|
|
1153
|
+
param = nextParameter;
|
|
1154
|
+
} else {
|
|
1155
|
+
break;
|
|
1156
|
+
}
|
|
1093
1157
|
}
|
|
1094
1158
|
}
|
|
1095
|
-
|
|
1096
|
-
|
|
1097
|
-
|
|
1098
|
-
|
|
1099
|
-
|
|
1100
|
-
|
|
1101
|
-
|
|
1102
|
-
|
|
1103
|
-
|
|
1104
|
-
|
|
1105
|
-
|
|
1106
|
-
|
|
1107
|
-
|
|
1108
|
-
|
|
1109
|
-
|
|
1110
|
-
|
|
1111
|
-
|
|
1112
|
-
|
|
1113
|
-
|
|
1114
|
-
|
|
1159
|
+
await this.refreshValues(ctx);
|
|
1160
|
+
this.setInterviewComplete(ctx, true);
|
|
1161
|
+
}
|
|
1162
|
+
async refreshValues(ctx) {
|
|
1163
|
+
const node = this.getNode(ctx);
|
|
1164
|
+
const endpoint = this.getEndpoint(ctx);
|
|
1165
|
+
const api = import_API.CCAPI.create(import_safe.CommandClasses.Configuration, ctx, endpoint).withOptions({
|
|
1166
|
+
priority: import_safe.MessagePriority.NodeQuery
|
|
1167
|
+
});
|
|
1168
|
+
if (api.version < 3) {
|
|
1169
|
+
const paramInfo = getParamInformationFromConfigFile(ctx, node.id, this.endpointIndex);
|
|
1170
|
+
if (paramInfo?.size) {
|
|
1171
|
+
const alreadyQueried = /* @__PURE__ */ new Set();
|
|
1172
|
+
for (const param of paramInfo.keys()) {
|
|
1173
|
+
if (paramInfo.get(param)?.writeOnly)
|
|
1174
|
+
continue;
|
|
1175
|
+
if (alreadyQueried.has(param.parameter))
|
|
1176
|
+
continue;
|
|
1177
|
+
alreadyQueried.add(param.parameter);
|
|
1178
|
+
ctx.logNode(node.id, {
|
|
1179
|
+
endpoint: this.endpointIndex,
|
|
1180
|
+
message: `querying parameter #${param.parameter} value...`,
|
|
1181
|
+
direction: "outbound"
|
|
1182
|
+
});
|
|
1183
|
+
const paramValue = await api.get(param.parameter);
|
|
1184
|
+
if (typeof paramValue === "number") {
|
|
1185
|
+
ctx.logNode(node.id, {
|
|
1186
|
+
endpoint: this.endpointIndex,
|
|
1187
|
+
message: `parameter #${param.parameter} has value: ${paramValue}`,
|
|
1188
|
+
direction: "inbound"
|
|
1189
|
+
});
|
|
1190
|
+
} else if (!paramValue) {
|
|
1191
|
+
ctx.logNode(node.id, {
|
|
1192
|
+
endpoint: this.endpointIndex,
|
|
1193
|
+
message: `received no value for parameter #${param.parameter}`,
|
|
1194
|
+
direction: "inbound",
|
|
1195
|
+
level: "warn"
|
|
1196
|
+
});
|
|
1197
|
+
}
|
|
1198
|
+
}
|
|
1199
|
+
} else {
|
|
1115
1200
|
ctx.logNode(node.id, {
|
|
1116
1201
|
endpoint: this.endpointIndex,
|
|
1117
|
-
message:
|
|
1118
|
-
direction: "
|
|
1202
|
+
message: `${this.constructor.name}: skipping interview because CC version is < 3 and there is no config file`,
|
|
1203
|
+
direction: "none"
|
|
1119
1204
|
});
|
|
1120
|
-
|
|
1121
|
-
|
|
1205
|
+
}
|
|
1206
|
+
} else {
|
|
1207
|
+
const parameters = (0, import_arrays.distinct)(this.getDefinedValueIDs(ctx).map((v) => v.property).filter((p) => typeof p === "number"));
|
|
1208
|
+
for (const param of parameters) {
|
|
1209
|
+
if (this.getParamInformation(ctx, param).readable !== false) {
|
|
1122
1210
|
ctx.logNode(node.id, {
|
|
1123
1211
|
endpoint: this.endpointIndex,
|
|
1124
|
-
message: `parameter #${param
|
|
1125
|
-
direction: "
|
|
1212
|
+
message: `querying parameter #${param} value...`,
|
|
1213
|
+
direction: "outbound"
|
|
1126
1214
|
});
|
|
1127
|
-
|
|
1215
|
+
await api.get(param);
|
|
1216
|
+
} else {
|
|
1128
1217
|
ctx.logNode(node.id, {
|
|
1129
1218
|
endpoint: this.endpointIndex,
|
|
1130
|
-
message: `
|
|
1131
|
-
direction: "
|
|
1132
|
-
level: "warn"
|
|
1219
|
+
message: `not querying parameter #${param} value, because it is writeonly`,
|
|
1220
|
+
direction: "none"
|
|
1133
1221
|
});
|
|
1134
1222
|
}
|
|
1135
1223
|
}
|
|
1136
|
-
} else {
|
|
1137
|
-
ctx.logNode(node.id, {
|
|
1138
|
-
endpoint: this.endpointIndex,
|
|
1139
|
-
message: `${this.constructor.name}: skipping interview because CC version is < 3 and there is no config file`,
|
|
1140
|
-
direction: "none"
|
|
1141
|
-
});
|
|
1142
1224
|
}
|
|
1143
|
-
}
|
|
1144
|
-
|
|
1145
|
-
|
|
1146
|
-
|
|
1147
|
-
|
|
1148
|
-
|
|
1149
|
-
|
|
1150
|
-
|
|
1151
|
-
|
|
1152
|
-
|
|
1153
|
-
|
|
1154
|
-
|
|
1155
|
-
|
|
1156
|
-
|
|
1157
|
-
|
|
1158
|
-
|
|
1225
|
+
}
|
|
1226
|
+
/**
|
|
1227
|
+
* Whether this node's param information was loaded from a config file.
|
|
1228
|
+
* If this is true, we don't trust what the node reports
|
|
1229
|
+
*/
|
|
1230
|
+
paramExistsInConfigFile(ctx, parameter, valueBitMask) {
|
|
1231
|
+
if (this.getValue(ctx, ConfigurationCCValues.isParamInformationFromConfig) !== true) {
|
|
1232
|
+
return false;
|
|
1233
|
+
}
|
|
1234
|
+
const paramInformation = getParamInformationFromConfigFile(ctx, this.nodeId, this.endpointIndex);
|
|
1235
|
+
if (!paramInformation)
|
|
1236
|
+
return false;
|
|
1237
|
+
if (paramInformation.has({ parameter, valueBitMask })) {
|
|
1238
|
+
return true;
|
|
1239
|
+
} else if (valueBitMask == void 0) {
|
|
1240
|
+
for (const key of paramInformation.keys()) {
|
|
1241
|
+
if (key.parameter === parameter)
|
|
1242
|
+
return true;
|
|
1159
1243
|
}
|
|
1160
1244
|
}
|
|
1161
|
-
}
|
|
1162
|
-
}
|
|
1163
|
-
/**
|
|
1164
|
-
* Whether this node's param information was loaded from a config file.
|
|
1165
|
-
* If this is true, we don't trust what the node reports
|
|
1166
|
-
*/
|
|
1167
|
-
paramExistsInConfigFile(ctx, parameter, valueBitMask) {
|
|
1168
|
-
if (this.getValue(ctx, ConfigurationCCValues.isParamInformationFromConfig) !== true) {
|
|
1169
1245
|
return false;
|
|
1170
1246
|
}
|
|
1171
|
-
|
|
1172
|
-
|
|
1173
|
-
|
|
1174
|
-
|
|
1175
|
-
|
|
1176
|
-
|
|
1177
|
-
|
|
1178
|
-
if (key.parameter === parameter)
|
|
1179
|
-
return true;
|
|
1247
|
+
/**
|
|
1248
|
+
* @internal
|
|
1249
|
+
* Stores config parameter metadata for this CC's node
|
|
1250
|
+
*/
|
|
1251
|
+
extendParamInformation(ctx, parameter, valueBitMask, info) {
|
|
1252
|
+
if (valueBitMask === void 0 && this.paramExistsInConfigFile(ctx, parameter)) {
|
|
1253
|
+
return;
|
|
1180
1254
|
}
|
|
1255
|
+
const metadata = this.getParamInformation(ctx, parameter, valueBitMask);
|
|
1256
|
+
Object.assign(metadata, info);
|
|
1257
|
+
this.setMetadata(ctx, ConfigurationCCValues.paramInformation(parameter, valueBitMask), metadata);
|
|
1258
|
+
}
|
|
1259
|
+
/**
|
|
1260
|
+
* @internal
|
|
1261
|
+
* Returns stored config parameter metadata for this CC's node
|
|
1262
|
+
*/
|
|
1263
|
+
getParamInformation(ctx, parameter, valueBitMask) {
|
|
1264
|
+
return this.getMetadata(ctx, ConfigurationCCValues.paramInformation(parameter, valueBitMask)) ?? {
|
|
1265
|
+
...import_safe.ValueMetadata.Any
|
|
1266
|
+
};
|
|
1181
1267
|
}
|
|
1182
|
-
|
|
1183
|
-
|
|
1184
|
-
|
|
1185
|
-
|
|
1186
|
-
|
|
1187
|
-
|
|
1188
|
-
|
|
1189
|
-
|
|
1190
|
-
|
|
1268
|
+
/**
|
|
1269
|
+
* **INTERNAL:** Returns the param info that was queried for this node. This returns the information that was returned by the node
|
|
1270
|
+
* and does not include partial parameters.
|
|
1271
|
+
*/
|
|
1272
|
+
getQueriedParamInfos(ctx) {
|
|
1273
|
+
const parameters = (0, import_arrays.distinct)(this.getDefinedValueIDs(ctx).map((v) => v.property).filter((p) => typeof p === "number"));
|
|
1274
|
+
return (0, import_objects.composeObject)(parameters.map((p) => [
|
|
1275
|
+
p,
|
|
1276
|
+
this.getParamInformation(ctx, p)
|
|
1277
|
+
]));
|
|
1278
|
+
}
|
|
1279
|
+
/**
|
|
1280
|
+
* Returns stored config parameter metadata for all partial config params addressed with the given parameter number
|
|
1281
|
+
*/
|
|
1282
|
+
getPartialParamInfos(ctx, parameter) {
|
|
1283
|
+
const valueDB = this.getValueDB(ctx);
|
|
1284
|
+
return valueDB.findMetadata((id) => id.commandClass === this.ccId && (id.endpoint ?? 0) === this.endpointIndex && id.property === parameter && id.propertyKey != void 0);
|
|
1285
|
+
}
|
|
1286
|
+
/**
|
|
1287
|
+
* Computes the full value of a parameter after applying a partial param value
|
|
1288
|
+
*/
|
|
1289
|
+
composePartialParamValue(ctx, parameter, bitMask, partialValue) {
|
|
1290
|
+
return this.composePartialParamValues(ctx, parameter, [
|
|
1291
|
+
{ bitMask, partialValue }
|
|
1292
|
+
]);
|
|
1191
1293
|
}
|
|
1192
|
-
|
|
1193
|
-
|
|
1194
|
-
|
|
1195
|
-
|
|
1196
|
-
|
|
1197
|
-
|
|
1198
|
-
|
|
1199
|
-
|
|
1200
|
-
|
|
1201
|
-
return this.getMetadata(ctx, ConfigurationCCValues.paramInformation(parameter, valueBitMask)) ?? {
|
|
1202
|
-
...import_safe.ValueMetadata.Any
|
|
1203
|
-
};
|
|
1204
|
-
}
|
|
1205
|
-
/**
|
|
1206
|
-
* **INTERNAL:** Returns the param info that was queried for this node. This returns the information that was returned by the node
|
|
1207
|
-
* and does not include partial parameters.
|
|
1208
|
-
*/
|
|
1209
|
-
getQueriedParamInfos(ctx) {
|
|
1210
|
-
const parameters = (0, import_arrays.distinct)(this.getDefinedValueIDs(ctx).map((v) => v.property).filter((p) => typeof p === "number"));
|
|
1211
|
-
return (0, import_objects.composeObject)(parameters.map((p) => [
|
|
1212
|
-
p,
|
|
1213
|
-
this.getParamInformation(ctx, p)
|
|
1214
|
-
]));
|
|
1215
|
-
}
|
|
1216
|
-
/**
|
|
1217
|
-
* Returns stored config parameter metadata for all partial config params addressed with the given parameter number
|
|
1218
|
-
*/
|
|
1219
|
-
getPartialParamInfos(ctx, parameter) {
|
|
1220
|
-
const valueDB = this.getValueDB(ctx);
|
|
1221
|
-
return valueDB.findMetadata((id) => id.commandClass === this.ccId && (id.endpoint ?? 0) === this.endpointIndex && id.property === parameter && id.propertyKey != void 0);
|
|
1222
|
-
}
|
|
1223
|
-
/**
|
|
1224
|
-
* Computes the full value of a parameter after applying a partial param value
|
|
1225
|
-
*/
|
|
1226
|
-
composePartialParamValue(ctx, parameter, bitMask, partialValue) {
|
|
1227
|
-
return this.composePartialParamValues(ctx, parameter, [
|
|
1228
|
-
{ bitMask, partialValue }
|
|
1229
|
-
]);
|
|
1230
|
-
}
|
|
1231
|
-
/**
|
|
1232
|
-
* Computes the full value of a parameter after applying multiple partial param values
|
|
1233
|
-
*/
|
|
1234
|
-
composePartialParamValues(ctx, parameter, partials) {
|
|
1235
|
-
const valueDB = this.getValueDB(ctx);
|
|
1236
|
-
const otherValues = valueDB.findValues((id) => id.commandClass === this.ccId && (id.endpoint ?? 0) === this.endpointIndex && id.property === parameter && id.propertyKey != void 0 && !partials.some((p) => id.propertyKey === p.bitMask));
|
|
1237
|
-
let ret = 0;
|
|
1238
|
-
for (const { propertyKey: bitMask, value: partialValue } of otherValues) {
|
|
1239
|
-
ret = (0, import_safe.encodePartial)(ret, partialValue, bitMask);
|
|
1240
|
-
}
|
|
1241
|
-
for (const { bitMask, partialValue } of partials) {
|
|
1242
|
-
ret = (0, import_safe.encodePartial)(ret, partialValue, bitMask);
|
|
1243
|
-
}
|
|
1244
|
-
return ret;
|
|
1245
|
-
}
|
|
1246
|
-
/** Deserializes the config parameter info from a config file */
|
|
1247
|
-
deserializeParamInformationFromConfig(ctx, config) {
|
|
1248
|
-
const valueDB = this.getValueDB(ctx);
|
|
1249
|
-
for (const meta of valueDB.getAllMetadata(this.ccId)) {
|
|
1250
|
-
if (typeof meta.property === "number" && (meta.endpoint ?? 0) === this.endpointIndex) {
|
|
1251
|
-
valueDB.setMetadata(
|
|
1252
|
-
meta,
|
|
1253
|
-
void 0,
|
|
1254
|
-
// Don't emit the added/updated events, as this will spam applications with untranslated events
|
|
1255
|
-
{ noEvent: true }
|
|
1256
|
-
);
|
|
1294
|
+
/**
|
|
1295
|
+
* Computes the full value of a parameter after applying multiple partial param values
|
|
1296
|
+
*/
|
|
1297
|
+
composePartialParamValues(ctx, parameter, partials) {
|
|
1298
|
+
const valueDB = this.getValueDB(ctx);
|
|
1299
|
+
const otherValues = valueDB.findValues((id) => id.commandClass === this.ccId && (id.endpoint ?? 0) === this.endpointIndex && id.property === parameter && id.propertyKey != void 0 && !partials.some((p) => id.propertyKey === p.bitMask));
|
|
1300
|
+
let ret = 0;
|
|
1301
|
+
for (const { propertyKey: bitMask, value: partialValue } of otherValues) {
|
|
1302
|
+
ret = (0, import_safe.encodePartial)(ret, partialValue, bitMask);
|
|
1257
1303
|
}
|
|
1258
|
-
|
|
1259
|
-
|
|
1260
|
-
for (const [param, info] of config.entries()) {
|
|
1261
|
-
const paramInfo = (0, import_safe.stripUndefined)({
|
|
1262
|
-
// TODO: Make this smarter! (0...1 ==> boolean)
|
|
1263
|
-
type: "number",
|
|
1264
|
-
valueSize: info.valueSize,
|
|
1265
|
-
min: info.minValue,
|
|
1266
|
-
max: info.maxValue,
|
|
1267
|
-
default: info.defaultValue,
|
|
1268
|
-
unit: info.unit,
|
|
1269
|
-
format: info.unsigned ? import_safe.ConfigValueFormat.UnsignedInteger : import_safe.ConfigValueFormat.SignedInteger,
|
|
1270
|
-
readable: !info.writeOnly,
|
|
1271
|
-
writeable: !info.readOnly,
|
|
1272
|
-
allowManualEntry: info.allowManualEntry,
|
|
1273
|
-
states: info.options.length > 0 ? (0, import_objects.composeObject)(info.options.map(({ label, value }) => [
|
|
1274
|
-
value.toString(),
|
|
1275
|
-
label
|
|
1276
|
-
])) : void 0,
|
|
1277
|
-
label: info.label,
|
|
1278
|
-
description: info.description,
|
|
1279
|
-
isFromConfig: true
|
|
1280
|
-
});
|
|
1281
|
-
this.extendParamInformation(ctx, param.parameter, param.valueBitMask, paramInfo);
|
|
1282
|
-
}
|
|
1283
|
-
this.setValue(ctx, ConfigurationCCValues.isParamInformationFromConfig, true);
|
|
1284
|
-
}
|
|
1285
|
-
translatePropertyKey(ctx, property, propertyKey) {
|
|
1286
|
-
if (typeof property === "number" && (propertyKey == void 0 || typeof propertyKey === "number")) {
|
|
1287
|
-
return void 0;
|
|
1288
|
-
}
|
|
1289
|
-
return super.translateProperty(ctx, property, propertyKey);
|
|
1290
|
-
}
|
|
1291
|
-
translateProperty(ctx, property, propertyKey) {
|
|
1292
|
-
if (typeof property === "number" && (propertyKey == void 0 || typeof propertyKey === "number")) {
|
|
1293
|
-
const paramInfo = this.getParamInformation(ctx, property, propertyKey);
|
|
1294
|
-
if (paramInfo.label)
|
|
1295
|
-
return paramInfo.label;
|
|
1296
|
-
let ret = `param${(0, import_strings.padStart)(property.toString(), 3, "0")}`;
|
|
1297
|
-
if (propertyKey != void 0) {
|
|
1298
|
-
ret += "_" + propertyKey.toString();
|
|
1304
|
+
for (const { bitMask, partialValue } of partials) {
|
|
1305
|
+
ret = (0, import_safe.encodePartial)(ret, partialValue, bitMask);
|
|
1299
1306
|
}
|
|
1300
1307
|
return ret;
|
|
1301
1308
|
}
|
|
1302
|
-
|
|
1303
|
-
|
|
1304
|
-
|
|
1305
|
-
|
|
1306
|
-
|
|
1307
|
-
|
|
1308
|
-
|
|
1309
|
-
|
|
1310
|
-
|
|
1311
|
-
|
|
1312
|
-
|
|
1313
|
-
|
|
1314
|
-
this.value = options.value;
|
|
1315
|
-
this.valueSize = options.valueSize;
|
|
1316
|
-
this.valueFormat = options.valueFormat;
|
|
1317
|
-
}
|
|
1318
|
-
static from(raw, ctx) {
|
|
1319
|
-
(0, import_safe.validatePayload)(raw.payload.length > 2);
|
|
1320
|
-
const parameter = raw.payload[0];
|
|
1321
|
-
const valueSize = raw.payload[1] & 7;
|
|
1322
|
-
(0, import_safe.validatePayload)(valueSize >= 1, valueSize <= 4, raw.payload.length >= 2 + valueSize);
|
|
1323
|
-
const value = parseValue(raw.payload.subarray(2), valueSize, import_safe.ConfigValueFormat.SignedInteger);
|
|
1324
|
-
return new ConfigurationCCReport_1({
|
|
1325
|
-
nodeId: ctx.sourceNodeId,
|
|
1326
|
-
parameter,
|
|
1327
|
-
valueSize,
|
|
1328
|
-
value
|
|
1329
|
-
});
|
|
1330
|
-
}
|
|
1331
|
-
parameter;
|
|
1332
|
-
value;
|
|
1333
|
-
valueSize;
|
|
1334
|
-
valueFormat;
|
|
1335
|
-
// only used for serialization
|
|
1336
|
-
persistValues(ctx) {
|
|
1337
|
-
if (!super.persistValues(ctx))
|
|
1338
|
-
return false;
|
|
1339
|
-
const ccVersion = (0, import_CommandClass.getEffectiveCCVersion)(ctx, this);
|
|
1340
|
-
const partialParams = this.getPartialParamInfos(ctx, this.parameter);
|
|
1341
|
-
let cachedValueFormat;
|
|
1342
|
-
if (partialParams.length > 0) {
|
|
1343
|
-
cachedValueFormat = partialParams[0].metadata.format;
|
|
1344
|
-
} else {
|
|
1345
|
-
const oldParamInformation = this.getParamInformation(ctx, this.parameter);
|
|
1346
|
-
cachedValueFormat = oldParamInformation.format;
|
|
1347
|
-
this.extendParamInformation(ctx, this.parameter, void 0, {
|
|
1348
|
-
valueSize: this.valueSize
|
|
1349
|
-
});
|
|
1350
|
-
if (ccVersion < 3 && !this.paramExistsInConfigFile(ctx, this.parameter) && oldParamInformation.min == void 0 && oldParamInformation.max == void 0) {
|
|
1351
|
-
const isSigned = oldParamInformation.format == void 0 || oldParamInformation.format === import_safe.ConfigValueFormat.SignedInteger;
|
|
1352
|
-
this.extendParamInformation(ctx, this.parameter, void 0, (0, import_safe.getIntegerLimits)(this.valueSize, isSigned));
|
|
1309
|
+
/** Deserializes the config parameter info from a config file */
|
|
1310
|
+
deserializeParamInformationFromConfig(ctx, config) {
|
|
1311
|
+
const valueDB = this.getValueDB(ctx);
|
|
1312
|
+
for (const meta of valueDB.getAllMetadata(this.ccId)) {
|
|
1313
|
+
if (typeof meta.property === "number" && (meta.endpoint ?? 0) === this.endpointIndex) {
|
|
1314
|
+
valueDB.setMetadata(
|
|
1315
|
+
meta,
|
|
1316
|
+
void 0,
|
|
1317
|
+
// Don't emit the added/updated events, as this will spam applications with untranslated events
|
|
1318
|
+
{ noEvent: true }
|
|
1319
|
+
);
|
|
1320
|
+
}
|
|
1353
1321
|
}
|
|
1322
|
+
this.setValue(ctx, ConfigurationCCValues.isParamInformationFromConfig, false);
|
|
1323
|
+
for (const [param, info] of config.entries()) {
|
|
1324
|
+
const paramInfo = (0, import_safe.stripUndefined)({
|
|
1325
|
+
// TODO: Make this smarter! (0...1 ==> boolean)
|
|
1326
|
+
type: "number",
|
|
1327
|
+
valueSize: info.valueSize,
|
|
1328
|
+
min: info.minValue,
|
|
1329
|
+
max: info.maxValue,
|
|
1330
|
+
default: info.defaultValue,
|
|
1331
|
+
unit: info.unit,
|
|
1332
|
+
format: info.unsigned ? import_safe.ConfigValueFormat.UnsignedInteger : import_safe.ConfigValueFormat.SignedInteger,
|
|
1333
|
+
readable: !info.writeOnly,
|
|
1334
|
+
writeable: !info.readOnly,
|
|
1335
|
+
allowManualEntry: info.allowManualEntry,
|
|
1336
|
+
states: info.options.length > 0 ? (0, import_objects.composeObject)(info.options.map(({ label, value }) => [
|
|
1337
|
+
value.toString(),
|
|
1338
|
+
label
|
|
1339
|
+
])) : void 0,
|
|
1340
|
+
label: info.label,
|
|
1341
|
+
description: info.description,
|
|
1342
|
+
isFromConfig: true
|
|
1343
|
+
});
|
|
1344
|
+
this.extendParamInformation(ctx, param.parameter, param.valueBitMask, paramInfo);
|
|
1345
|
+
}
|
|
1346
|
+
this.setValue(ctx, ConfigurationCCValues.isParamInformationFromConfig, true);
|
|
1354
1347
|
}
|
|
1355
|
-
|
|
1356
|
-
|
|
1357
|
-
|
|
1358
|
-
|
|
1359
|
-
|
|
1360
|
-
|
|
1361
|
-
|
|
1348
|
+
translatePropertyKey(ctx, property, propertyKey) {
|
|
1349
|
+
if (typeof property === "number" && (propertyKey == void 0 || typeof propertyKey === "number")) {
|
|
1350
|
+
return void 0;
|
|
1351
|
+
}
|
|
1352
|
+
return super.translateProperty(ctx, property, propertyKey);
|
|
1353
|
+
}
|
|
1354
|
+
translateProperty(ctx, property, propertyKey) {
|
|
1355
|
+
if (typeof property === "number" && (propertyKey == void 0 || typeof propertyKey === "number")) {
|
|
1356
|
+
const paramInfo = this.getParamInformation(ctx, property, propertyKey);
|
|
1357
|
+
if (paramInfo.label)
|
|
1358
|
+
return paramInfo.label;
|
|
1359
|
+
let ret = `param${(0, import_strings.padStart)(property.toString(), 3, "0")}`;
|
|
1360
|
+
if (propertyKey != void 0) {
|
|
1361
|
+
ret += "_" + propertyKey.toString();
|
|
1362
1362
|
}
|
|
1363
|
+
return ret;
|
|
1363
1364
|
}
|
|
1364
|
-
|
|
1365
|
-
|
|
1366
|
-
|
|
1367
|
-
|
|
1368
|
-
|
|
1369
|
-
|
|
1370
|
-
|
|
1371
|
-
|
|
1372
|
-
|
|
1373
|
-
|
|
1374
|
-
|
|
1375
|
-
|
|
1376
|
-
|
|
1377
|
-
|
|
1378
|
-
|
|
1379
|
-
|
|
1380
|
-
|
|
1381
|
-
|
|
1382
|
-
|
|
1383
|
-
|
|
1365
|
+
return super.translateProperty(ctx, property, propertyKey);
|
|
1366
|
+
}
|
|
1367
|
+
};
|
|
1368
|
+
return ConfigurationCC2 = _classThis;
|
|
1369
|
+
})();
|
|
1370
|
+
let ConfigurationCCReport = (() => {
|
|
1371
|
+
let _classDecorators = [(0, import_CommandClassDecorators.CCCommand)(import_Types.ConfigurationCommand.Report)];
|
|
1372
|
+
let _classDescriptor;
|
|
1373
|
+
let _classExtraInitializers = [];
|
|
1374
|
+
let _classThis;
|
|
1375
|
+
let _classSuper = ConfigurationCC;
|
|
1376
|
+
var ConfigurationCCReport2 = class extends _classSuper {
|
|
1377
|
+
static {
|
|
1378
|
+
_classThis = this;
|
|
1379
|
+
}
|
|
1380
|
+
static {
|
|
1381
|
+
const _metadata = typeof Symbol === "function" && Symbol.metadata ? Object.create(_classSuper[Symbol.metadata] ?? null) : void 0;
|
|
1382
|
+
__esDecorate(null, _classDescriptor = { value: _classThis }, _classDecorators, { kind: "class", name: _classThis.name, metadata: _metadata }, null, _classExtraInitializers);
|
|
1383
|
+
ConfigurationCCReport2 = _classThis = _classDescriptor.value;
|
|
1384
|
+
if (_metadata) Object.defineProperty(_classThis, Symbol.metadata, { enumerable: true, configurable: true, writable: true, value: _metadata });
|
|
1385
|
+
__runInitializers(_classThis, _classExtraInitializers);
|
|
1386
|
+
}
|
|
1387
|
+
constructor(options) {
|
|
1388
|
+
super(options);
|
|
1389
|
+
this.parameter = options.parameter;
|
|
1390
|
+
this.value = options.value;
|
|
1391
|
+
this.valueSize = options.valueSize;
|
|
1392
|
+
this.valueFormat = options.valueFormat;
|
|
1393
|
+
}
|
|
1394
|
+
static from(raw, ctx) {
|
|
1395
|
+
(0, import_safe.validatePayload)(raw.payload.length > 2);
|
|
1396
|
+
const parameter = raw.payload[0];
|
|
1397
|
+
const valueSize = raw.payload[1] & 7;
|
|
1398
|
+
(0, import_safe.validatePayload)(valueSize >= 1, valueSize <= 4, raw.payload.length >= 2 + valueSize);
|
|
1399
|
+
const value = parseValue(raw.payload.subarray(2), valueSize, import_safe.ConfigValueFormat.SignedInteger);
|
|
1400
|
+
return new this({
|
|
1401
|
+
nodeId: ctx.sourceNodeId,
|
|
1402
|
+
parameter,
|
|
1403
|
+
valueSize,
|
|
1404
|
+
value
|
|
1405
|
+
});
|
|
1406
|
+
}
|
|
1407
|
+
parameter;
|
|
1408
|
+
value;
|
|
1409
|
+
valueSize;
|
|
1410
|
+
valueFormat;
|
|
1411
|
+
// only used for serialization
|
|
1412
|
+
persistValues(ctx) {
|
|
1413
|
+
if (!super.persistValues(ctx))
|
|
1414
|
+
return false;
|
|
1415
|
+
const ccVersion = (0, import_CommandClass.getEffectiveCCVersion)(ctx, this);
|
|
1416
|
+
const partialParams = this.getPartialParamInfos(ctx, this.parameter);
|
|
1417
|
+
let cachedValueFormat;
|
|
1418
|
+
if (partialParams.length > 0) {
|
|
1419
|
+
cachedValueFormat = partialParams[0].metadata.format;
|
|
1420
|
+
} else {
|
|
1421
|
+
const oldParamInformation = this.getParamInformation(ctx, this.parameter);
|
|
1422
|
+
cachedValueFormat = oldParamInformation.format;
|
|
1423
|
+
this.extendParamInformation(ctx, this.parameter, void 0, {
|
|
1424
|
+
valueSize: this.valueSize
|
|
1425
|
+
});
|
|
1426
|
+
if (ccVersion < 3 && !this.paramExistsInConfigFile(ctx, this.parameter) && oldParamInformation.min == void 0 && oldParamInformation.max == void 0) {
|
|
1427
|
+
const isSigned = oldParamInformation.format == void 0 || oldParamInformation.format === import_safe.ConfigValueFormat.SignedInteger;
|
|
1428
|
+
this.extendParamInformation(ctx, this.parameter, void 0, (0, import_safe.getIntegerLimits)(this.valueSize, isSigned));
|
|
1429
|
+
}
|
|
1384
1430
|
}
|
|
1385
|
-
|
|
1386
|
-
|
|
1387
|
-
}
|
|
1388
|
-
|
|
1389
|
-
|
|
1390
|
-
|
|
1431
|
+
if (cachedValueFormat != void 0 && cachedValueFormat !== import_safe.ConfigValueFormat.SignedInteger) {
|
|
1432
|
+
this.value = reInterpretSignedValue(this.value, this.valueSize, cachedValueFormat);
|
|
1433
|
+
}
|
|
1434
|
+
if (partialParams.length > 0) {
|
|
1435
|
+
for (const param of partialParams) {
|
|
1436
|
+
if (typeof param.propertyKey === "number") {
|
|
1437
|
+
this.setValue(ctx, ConfigurationCCValues.paramInformation(this.parameter, param.propertyKey), (0, import_safe.parsePartial)(this.value, param.propertyKey, isSignedPartial(param.propertyKey, param.metadata.format)));
|
|
1438
|
+
}
|
|
1439
|
+
}
|
|
1440
|
+
} else {
|
|
1441
|
+
this.setValue(ctx, ConfigurationCCValues.paramInformation(this.parameter), this.value);
|
|
1442
|
+
}
|
|
1443
|
+
return true;
|
|
1444
|
+
}
|
|
1445
|
+
serialize(ctx) {
|
|
1446
|
+
this.payload = import_safe2.Bytes.concat([
|
|
1447
|
+
import_safe2.Bytes.from([this.parameter, this.valueSize & 7]),
|
|
1448
|
+
new import_safe2.Bytes(this.valueSize)
|
|
1449
|
+
]);
|
|
1450
|
+
serializeValue(this.payload, 2, this.valueSize, this.valueFormat ?? import_safe.ConfigValueFormat.SignedInteger, this.value);
|
|
1451
|
+
return super.serialize(ctx);
|
|
1452
|
+
}
|
|
1453
|
+
toLogEntry(ctx) {
|
|
1454
|
+
return {
|
|
1455
|
+
...super.toLogEntry(ctx),
|
|
1456
|
+
message: {
|
|
1457
|
+
"parameter #": this.parameter,
|
|
1458
|
+
"value size": this.valueSize,
|
|
1459
|
+
value: configValueToString(this.value)
|
|
1460
|
+
}
|
|
1461
|
+
};
|
|
1462
|
+
}
|
|
1463
|
+
};
|
|
1464
|
+
return ConfigurationCCReport2 = _classThis;
|
|
1465
|
+
})();
|
|
1391
1466
|
function testResponseForConfigurationGet(sent, received) {
|
|
1392
1467
|
return sent.parameter === received.parameter || sent.allowUnexpectedResponse;
|
|
1393
1468
|
}
|
|
1394
|
-
let ConfigurationCCGet =
|
|
1395
|
-
|
|
1396
|
-
|
|
1397
|
-
|
|
1398
|
-
|
|
1399
|
-
|
|
1400
|
-
|
|
1401
|
-
|
|
1402
|
-
|
|
1403
|
-
|
|
1404
|
-
|
|
1405
|
-
|
|
1406
|
-
|
|
1407
|
-
|
|
1408
|
-
|
|
1409
|
-
|
|
1410
|
-
|
|
1411
|
-
|
|
1412
|
-
|
|
1413
|
-
|
|
1414
|
-
|
|
1415
|
-
|
|
1416
|
-
|
|
1417
|
-
|
|
1418
|
-
|
|
1419
|
-
|
|
1420
|
-
|
|
1421
|
-
|
|
1422
|
-
|
|
1423
|
-
(0, import_CommandClassDecorators.expectedCCResponse)(ConfigurationCCReport, testResponseForConfigurationGet)
|
|
1424
|
-
], ConfigurationCCGet);
|
|
1425
|
-
let ConfigurationCCSet = ConfigurationCCSet_1 = class ConfigurationCCSet2 extends ConfigurationCC {
|
|
1426
|
-
constructor(options) {
|
|
1427
|
-
super(options);
|
|
1428
|
-
this.parameter = options.parameter;
|
|
1429
|
-
this.resetToDefault = !!options.resetToDefault;
|
|
1430
|
-
if (!options.resetToDefault) {
|
|
1431
|
-
this.valueSize = options.valueSize;
|
|
1432
|
-
this.valueFormat = options.valueFormat ?? import_safe.ConfigValueFormat.SignedInteger;
|
|
1433
|
-
this.value = options.value;
|
|
1469
|
+
let ConfigurationCCGet = (() => {
|
|
1470
|
+
let _classDecorators = [(0, import_CommandClassDecorators.CCCommand)(import_Types.ConfigurationCommand.Get), (0, import_CommandClassDecorators.expectedCCResponse)(ConfigurationCCReport, testResponseForConfigurationGet)];
|
|
1471
|
+
let _classDescriptor;
|
|
1472
|
+
let _classExtraInitializers = [];
|
|
1473
|
+
let _classThis;
|
|
1474
|
+
let _classSuper = ConfigurationCC;
|
|
1475
|
+
var ConfigurationCCGet2 = class extends _classSuper {
|
|
1476
|
+
static {
|
|
1477
|
+
_classThis = this;
|
|
1478
|
+
}
|
|
1479
|
+
static {
|
|
1480
|
+
const _metadata = typeof Symbol === "function" && Symbol.metadata ? Object.create(_classSuper[Symbol.metadata] ?? null) : void 0;
|
|
1481
|
+
__esDecorate(null, _classDescriptor = { value: _classThis }, _classDecorators, { kind: "class", name: _classThis.name, metadata: _metadata }, null, _classExtraInitializers);
|
|
1482
|
+
ConfigurationCCGet2 = _classThis = _classDescriptor.value;
|
|
1483
|
+
if (_metadata) Object.defineProperty(_classThis, Symbol.metadata, { enumerable: true, configurable: true, writable: true, value: _metadata });
|
|
1484
|
+
__runInitializers(_classThis, _classExtraInitializers);
|
|
1485
|
+
}
|
|
1486
|
+
constructor(options) {
|
|
1487
|
+
super(options);
|
|
1488
|
+
this.parameter = options.parameter;
|
|
1489
|
+
this.allowUnexpectedResponse = options.allowUnexpectedResponse ?? false;
|
|
1490
|
+
}
|
|
1491
|
+
static from(raw, ctx) {
|
|
1492
|
+
(0, import_safe.validatePayload)(raw.payload.length >= 1);
|
|
1493
|
+
const parameter = raw.payload[0];
|
|
1494
|
+
return new this({
|
|
1495
|
+
nodeId: ctx.sourceNodeId,
|
|
1496
|
+
parameter
|
|
1497
|
+
});
|
|
1434
1498
|
}
|
|
1435
|
-
|
|
1436
|
-
|
|
1437
|
-
(
|
|
1438
|
-
|
|
1439
|
-
|
|
1440
|
-
|
|
1441
|
-
(
|
|
1442
|
-
|
|
1443
|
-
|
|
1444
|
-
|
|
1445
|
-
|
|
1446
|
-
|
|
1447
|
-
|
|
1448
|
-
|
|
1449
|
-
|
|
1450
|
-
|
|
1451
|
-
|
|
1452
|
-
|
|
1453
|
-
|
|
1454
|
-
|
|
1455
|
-
|
|
1456
|
-
|
|
1457
|
-
|
|
1458
|
-
|
|
1459
|
-
|
|
1460
|
-
|
|
1461
|
-
|
|
1462
|
-
|
|
1463
|
-
|
|
1464
|
-
|
|
1465
|
-
|
|
1466
|
-
|
|
1467
|
-
|
|
1468
|
-
|
|
1469
|
-
|
|
1499
|
+
parameter;
|
|
1500
|
+
allowUnexpectedResponse;
|
|
1501
|
+
serialize(ctx) {
|
|
1502
|
+
this.payload = import_safe2.Bytes.from([this.parameter]);
|
|
1503
|
+
return super.serialize(ctx);
|
|
1504
|
+
}
|
|
1505
|
+
toLogEntry(ctx) {
|
|
1506
|
+
return {
|
|
1507
|
+
...super.toLogEntry(ctx),
|
|
1508
|
+
message: { "parameter #": this.parameter }
|
|
1509
|
+
};
|
|
1510
|
+
}
|
|
1511
|
+
};
|
|
1512
|
+
return ConfigurationCCGet2 = _classThis;
|
|
1513
|
+
})();
|
|
1514
|
+
let ConfigurationCCSet = (() => {
|
|
1515
|
+
let _classDecorators = [(0, import_CommandClassDecorators.CCCommand)(import_Types.ConfigurationCommand.Set), (0, import_CommandClassDecorators.useSupervision)()];
|
|
1516
|
+
let _classDescriptor;
|
|
1517
|
+
let _classExtraInitializers = [];
|
|
1518
|
+
let _classThis;
|
|
1519
|
+
let _classSuper = ConfigurationCC;
|
|
1520
|
+
var ConfigurationCCSet2 = class extends _classSuper {
|
|
1521
|
+
static {
|
|
1522
|
+
_classThis = this;
|
|
1523
|
+
}
|
|
1524
|
+
static {
|
|
1525
|
+
const _metadata = typeof Symbol === "function" && Symbol.metadata ? Object.create(_classSuper[Symbol.metadata] ?? null) : void 0;
|
|
1526
|
+
__esDecorate(null, _classDescriptor = { value: _classThis }, _classDecorators, { kind: "class", name: _classThis.name, metadata: _metadata }, null, _classExtraInitializers);
|
|
1527
|
+
ConfigurationCCSet2 = _classThis = _classDescriptor.value;
|
|
1528
|
+
if (_metadata) Object.defineProperty(_classThis, Symbol.metadata, { enumerable: true, configurable: true, writable: true, value: _metadata });
|
|
1529
|
+
__runInitializers(_classThis, _classExtraInitializers);
|
|
1530
|
+
}
|
|
1531
|
+
constructor(options) {
|
|
1532
|
+
super(options);
|
|
1533
|
+
this.parameter = options.parameter;
|
|
1534
|
+
this.resetToDefault = !!options.resetToDefault;
|
|
1535
|
+
if (!options.resetToDefault) {
|
|
1536
|
+
this.valueSize = options.valueSize;
|
|
1537
|
+
this.valueFormat = options.valueFormat ?? import_safe.ConfigValueFormat.SignedInteger;
|
|
1538
|
+
this.value = options.value;
|
|
1470
1539
|
}
|
|
1471
1540
|
}
|
|
1472
|
-
|
|
1473
|
-
|
|
1474
|
-
|
|
1475
|
-
|
|
1476
|
-
|
|
1477
|
-
|
|
1478
|
-
|
|
1479
|
-
|
|
1480
|
-
|
|
1541
|
+
static from(raw, ctx) {
|
|
1542
|
+
(0, import_safe.validatePayload)(raw.payload.length >= 2);
|
|
1543
|
+
const parameter = raw.payload[0];
|
|
1544
|
+
const resetToDefault = !!(raw.payload[1] & 128);
|
|
1545
|
+
const valueSize = raw.payload[1] & 7;
|
|
1546
|
+
(0, import_safe.validatePayload)(valueSize >= 1, valueSize <= 4, raw.payload.length >= 2 + valueSize);
|
|
1547
|
+
const value = parseValue(raw.payload.subarray(2), valueSize, import_safe.ConfigValueFormat.SignedInteger);
|
|
1548
|
+
return new this({
|
|
1549
|
+
nodeId: ctx.sourceNodeId,
|
|
1550
|
+
parameter,
|
|
1551
|
+
resetToDefault,
|
|
1552
|
+
valueSize,
|
|
1553
|
+
value
|
|
1554
|
+
});
|
|
1481
1555
|
}
|
|
1482
|
-
|
|
1483
|
-
|
|
1556
|
+
resetToDefault;
|
|
1557
|
+
parameter;
|
|
1558
|
+
valueSize;
|
|
1559
|
+
valueFormat;
|
|
1560
|
+
value;
|
|
1561
|
+
serialize(ctx) {
|
|
1562
|
+
const valueSize = this.resetToDefault ? 1 : this.valueSize;
|
|
1563
|
+
const payloadLength = 2 + valueSize;
|
|
1564
|
+
this.payload = import_safe2.Bytes.alloc(payloadLength, 0);
|
|
1565
|
+
this.payload[0] = this.parameter;
|
|
1566
|
+
this.payload[1] = (this.resetToDefault ? 128 : 0) | valueSize & 7;
|
|
1567
|
+
if (!this.resetToDefault) {
|
|
1568
|
+
if (typeof this.value === "number" && !isSafeValue(this.value, valueSize, this.valueFormat)) {
|
|
1569
|
+
throwInvalidValueError(this.value, this.parameter, valueSize, this.valueFormat);
|
|
1570
|
+
}
|
|
1571
|
+
try {
|
|
1572
|
+
serializeValue(this.payload, 2, valueSize, this.valueFormat, this.value);
|
|
1573
|
+
} catch (e) {
|
|
1574
|
+
tryCatchOutOfBoundsError(e, this.value, this.parameter, valueSize, this.valueFormat);
|
|
1575
|
+
}
|
|
1576
|
+
}
|
|
1577
|
+
return super.serialize(ctx);
|
|
1484
1578
|
}
|
|
1485
|
-
|
|
1486
|
-
message
|
|
1579
|
+
toLogEntry(ctx) {
|
|
1580
|
+
const message = {
|
|
1581
|
+
"parameter #": this.parameter,
|
|
1582
|
+
"reset to default": this.resetToDefault
|
|
1583
|
+
};
|
|
1584
|
+
if (this.valueSize != void 0) {
|
|
1585
|
+
message["value size"] = this.valueSize;
|
|
1586
|
+
}
|
|
1587
|
+
if (this.valueFormat != void 0) {
|
|
1588
|
+
message["value format"] = (0, import_safe3.getEnumMemberName)(import_safe.ConfigValueFormat, this.valueFormat);
|
|
1589
|
+
}
|
|
1590
|
+
if (this.value != void 0) {
|
|
1591
|
+
message.value = configValueToString(this.value);
|
|
1592
|
+
}
|
|
1593
|
+
return {
|
|
1594
|
+
...super.toLogEntry(ctx),
|
|
1595
|
+
message
|
|
1596
|
+
};
|
|
1487
1597
|
}
|
|
1488
|
-
|
|
1489
|
-
|
|
1490
|
-
|
|
1491
|
-
};
|
|
1492
|
-
}
|
|
1493
|
-
};
|
|
1494
|
-
ConfigurationCCSet = ConfigurationCCSet_1 = __decorate([
|
|
1495
|
-
(0, import_CommandClassDecorators.CCCommand)(import_Types.ConfigurationCommand.Set),
|
|
1496
|
-
(0, import_CommandClassDecorators.useSupervision)()
|
|
1497
|
-
], ConfigurationCCSet);
|
|
1598
|
+
};
|
|
1599
|
+
return ConfigurationCCSet2 = _classThis;
|
|
1600
|
+
})();
|
|
1498
1601
|
function getResponseForBulkSet(cc) {
|
|
1499
1602
|
return cc.handshake ? ConfigurationCCBulkReport : void 0;
|
|
1500
1603
|
}
|
|
1501
|
-
let ConfigurationCCBulkSet =
|
|
1502
|
-
|
|
1503
|
-
|
|
1504
|
-
|
|
1505
|
-
|
|
1506
|
-
|
|
1507
|
-
|
|
1508
|
-
|
|
1509
|
-
|
|
1510
|
-
|
|
1511
|
-
|
|
1512
|
-
|
|
1513
|
-
|
|
1514
|
-
|
|
1515
|
-
|
|
1516
|
-
|
|
1517
|
-
|
|
1518
|
-
|
|
1519
|
-
|
|
1604
|
+
let ConfigurationCCBulkSet = (() => {
|
|
1605
|
+
let _classDecorators = [(0, import_CommandClassDecorators.CCCommand)(import_Types.ConfigurationCommand.BulkSet), (0, import_CommandClassDecorators.expectedCCResponse)(getResponseForBulkSet), (0, import_CommandClassDecorators.useSupervision)()];
|
|
1606
|
+
let _classDescriptor;
|
|
1607
|
+
let _classExtraInitializers = [];
|
|
1608
|
+
let _classThis;
|
|
1609
|
+
let _classSuper = ConfigurationCC;
|
|
1610
|
+
var ConfigurationCCBulkSet2 = class extends _classSuper {
|
|
1611
|
+
static {
|
|
1612
|
+
_classThis = this;
|
|
1613
|
+
}
|
|
1614
|
+
static {
|
|
1615
|
+
const _metadata = typeof Symbol === "function" && Symbol.metadata ? Object.create(_classSuper[Symbol.metadata] ?? null) : void 0;
|
|
1616
|
+
__esDecorate(null, _classDescriptor = { value: _classThis }, _classDecorators, { kind: "class", name: _classThis.name, metadata: _metadata }, null, _classExtraInitializers);
|
|
1617
|
+
ConfigurationCCBulkSet2 = _classThis = _classDescriptor.value;
|
|
1618
|
+
if (_metadata) Object.defineProperty(_classThis, Symbol.metadata, { enumerable: true, configurable: true, writable: true, value: _metadata });
|
|
1619
|
+
__runInitializers(_classThis, _classExtraInitializers);
|
|
1620
|
+
}
|
|
1621
|
+
constructor(options) {
|
|
1622
|
+
super(options);
|
|
1623
|
+
this._parameters = options.parameters;
|
|
1624
|
+
if (this._parameters.length < 1) {
|
|
1625
|
+
throw new import_safe.ZWaveError(`In a ConfigurationCC.BulkSet, parameters must be a non-empty array`, import_safe.ZWaveErrorCodes.CC_Invalid);
|
|
1626
|
+
} else if (!(0, import_safe.isConsecutiveArray)(this._parameters)) {
|
|
1627
|
+
throw new import_safe.ZWaveError(`A ConfigurationCC.BulkSet can only be used for consecutive parameters`, import_safe.ZWaveErrorCodes.CC_Invalid);
|
|
1628
|
+
}
|
|
1629
|
+
this._handshake = !!options.handshake;
|
|
1630
|
+
this._resetToDefault = !!options.resetToDefault;
|
|
1631
|
+
if (!!options.resetToDefault) {
|
|
1632
|
+
this._valueSize = 1;
|
|
1633
|
+
this._valueFormat = import_safe.ConfigValueFormat.SignedInteger;
|
|
1634
|
+
this._values = this._parameters.map(() => 0);
|
|
1635
|
+
} else {
|
|
1636
|
+
this._valueSize = options.valueSize;
|
|
1637
|
+
this._valueFormat = options.valueFormat ?? import_safe.ConfigValueFormat.SignedInteger;
|
|
1638
|
+
this._values = options.values;
|
|
1639
|
+
}
|
|
1520
1640
|
}
|
|
1521
|
-
|
|
1522
|
-
|
|
1523
|
-
|
|
1524
|
-
|
|
1525
|
-
|
|
1526
|
-
|
|
1527
|
-
|
|
1528
|
-
|
|
1529
|
-
|
|
1530
|
-
|
|
1531
|
-
|
|
1532
|
-
|
|
1533
|
-
|
|
1534
|
-
|
|
1535
|
-
|
|
1536
|
-
|
|
1537
|
-
|
|
1538
|
-
|
|
1539
|
-
|
|
1540
|
-
|
|
1541
|
-
|
|
1542
|
-
|
|
1543
|
-
|
|
1544
|
-
|
|
1545
|
-
|
|
1546
|
-
|
|
1547
|
-
|
|
1548
|
-
|
|
1549
|
-
|
|
1550
|
-
|
|
1551
|
-
|
|
1552
|
-
|
|
1553
|
-
|
|
1554
|
-
|
|
1555
|
-
|
|
1556
|
-
|
|
1557
|
-
|
|
1558
|
-
|
|
1559
|
-
|
|
1560
|
-
|
|
1561
|
-
|
|
1562
|
-
|
|
1563
|
-
|
|
1564
|
-
|
|
1565
|
-
|
|
1566
|
-
|
|
1641
|
+
static from(_raw, _ctx) {
|
|
1642
|
+
throw new import_safe.ZWaveError(`${this.name}: deserialization not implemented`, import_safe.ZWaveErrorCodes.Deserialization_NotImplemented);
|
|
1643
|
+
}
|
|
1644
|
+
_parameters;
|
|
1645
|
+
get parameters() {
|
|
1646
|
+
return this._parameters;
|
|
1647
|
+
}
|
|
1648
|
+
_resetToDefault;
|
|
1649
|
+
get resetToDefault() {
|
|
1650
|
+
return this._resetToDefault;
|
|
1651
|
+
}
|
|
1652
|
+
_valueSize;
|
|
1653
|
+
get valueSize() {
|
|
1654
|
+
return this._valueSize;
|
|
1655
|
+
}
|
|
1656
|
+
_valueFormat;
|
|
1657
|
+
get valueFormat() {
|
|
1658
|
+
return this._valueFormat;
|
|
1659
|
+
}
|
|
1660
|
+
_values;
|
|
1661
|
+
get values() {
|
|
1662
|
+
return this._values;
|
|
1663
|
+
}
|
|
1664
|
+
_handshake;
|
|
1665
|
+
get handshake() {
|
|
1666
|
+
return this._handshake;
|
|
1667
|
+
}
|
|
1668
|
+
serialize(ctx) {
|
|
1669
|
+
const valueSize = this._resetToDefault ? 1 : this.valueSize;
|
|
1670
|
+
const payloadLength = 4 + valueSize * this.parameters.length;
|
|
1671
|
+
this.payload = import_safe2.Bytes.alloc(payloadLength, 0);
|
|
1672
|
+
this.payload.writeUInt16BE(this.parameters[0], 0);
|
|
1673
|
+
this.payload[2] = this.parameters.length;
|
|
1674
|
+
this.payload[3] = (this._resetToDefault ? 128 : 0) | (this.handshake ? 64 : 0) | valueSize & 7;
|
|
1675
|
+
if (!this._resetToDefault) {
|
|
1676
|
+
for (let i = 0; i < this.parameters.length; i++) {
|
|
1677
|
+
const value = this._values[i];
|
|
1678
|
+
const param = this._parameters[i];
|
|
1679
|
+
if (!isSafeValue(value, valueSize, this._valueFormat)) {
|
|
1680
|
+
throwInvalidValueError(value, param, valueSize, this._valueFormat);
|
|
1681
|
+
}
|
|
1682
|
+
try {
|
|
1683
|
+
serializeValue(this.payload, 4 + i * valueSize, valueSize, this._valueFormat, value);
|
|
1684
|
+
} catch (e) {
|
|
1685
|
+
tryCatchOutOfBoundsError(e, value, param, valueSize, this._valueFormat);
|
|
1686
|
+
}
|
|
1567
1687
|
}
|
|
1568
1688
|
}
|
|
1689
|
+
return super.serialize(ctx);
|
|
1569
1690
|
}
|
|
1570
|
-
|
|
1571
|
-
|
|
1572
|
-
|
|
1573
|
-
|
|
1574
|
-
|
|
1575
|
-
|
|
1576
|
-
|
|
1577
|
-
|
|
1578
|
-
if (this._values.length > 0) {
|
|
1579
|
-
message.values = this._values.map((value, i) => `
|
|
1691
|
+
toLogEntry(ctx) {
|
|
1692
|
+
const message = {
|
|
1693
|
+
handshake: this.handshake,
|
|
1694
|
+
"reset to default": this.resetToDefault,
|
|
1695
|
+
"value size": this.valueSize
|
|
1696
|
+
};
|
|
1697
|
+
if (this._values.length > 0) {
|
|
1698
|
+
message.values = this._values.map((value, i) => `
|
|
1580
1699
|
\xB7 #${this._parameters[i]}: ${configValueToString(value)}`).join("");
|
|
1700
|
+
}
|
|
1701
|
+
return {
|
|
1702
|
+
...super.toLogEntry(ctx),
|
|
1703
|
+
message
|
|
1704
|
+
};
|
|
1581
1705
|
}
|
|
1582
|
-
|
|
1583
|
-
|
|
1584
|
-
|
|
1585
|
-
|
|
1586
|
-
|
|
1587
|
-
|
|
1588
|
-
|
|
1589
|
-
|
|
1590
|
-
|
|
1591
|
-
|
|
1592
|
-
|
|
1593
|
-
|
|
1594
|
-
|
|
1595
|
-
|
|
1596
|
-
|
|
1597
|
-
|
|
1598
|
-
|
|
1599
|
-
|
|
1600
|
-
|
|
1601
|
-
|
|
1706
|
+
};
|
|
1707
|
+
return ConfigurationCCBulkSet2 = _classThis;
|
|
1708
|
+
})();
|
|
1709
|
+
let ConfigurationCCBulkReport = (() => {
|
|
1710
|
+
let _classDecorators = [(0, import_CommandClassDecorators.CCCommand)(import_Types.ConfigurationCommand.BulkReport)];
|
|
1711
|
+
let _classDescriptor;
|
|
1712
|
+
let _classExtraInitializers = [];
|
|
1713
|
+
let _classThis;
|
|
1714
|
+
let _classSuper = ConfigurationCC;
|
|
1715
|
+
var ConfigurationCCBulkReport2 = class extends _classSuper {
|
|
1716
|
+
static {
|
|
1717
|
+
_classThis = this;
|
|
1718
|
+
}
|
|
1719
|
+
static {
|
|
1720
|
+
const _metadata = typeof Symbol === "function" && Symbol.metadata ? Object.create(_classSuper[Symbol.metadata] ?? null) : void 0;
|
|
1721
|
+
__esDecorate(null, _classDescriptor = { value: _classThis }, _classDecorators, { kind: "class", name: _classThis.name, metadata: _metadata }, null, _classExtraInitializers);
|
|
1722
|
+
ConfigurationCCBulkReport2 = _classThis = _classDescriptor.value;
|
|
1723
|
+
if (_metadata) Object.defineProperty(_classThis, Symbol.metadata, { enumerable: true, configurable: true, writable: true, value: _metadata });
|
|
1724
|
+
__runInitializers(_classThis, _classExtraInitializers);
|
|
1725
|
+
}
|
|
1726
|
+
constructor(options) {
|
|
1727
|
+
super(options);
|
|
1728
|
+
this.reportsToFollow = options.reportsToFollow;
|
|
1729
|
+
this.defaultValues = options.defaultValues;
|
|
1730
|
+
this.isHandshakeResponse = options.isHandshakeResponse;
|
|
1731
|
+
this.valueSize = options.valueSize;
|
|
1732
|
+
for (const [param, value] of Object.entries(options.values)) {
|
|
1733
|
+
this._values.set(parseInt(param), value);
|
|
1734
|
+
}
|
|
1602
1735
|
}
|
|
1603
|
-
|
|
1604
|
-
|
|
1605
|
-
|
|
1606
|
-
|
|
1607
|
-
|
|
1608
|
-
|
|
1609
|
-
|
|
1610
|
-
|
|
1611
|
-
|
|
1612
|
-
|
|
1613
|
-
|
|
1614
|
-
|
|
1615
|
-
|
|
1616
|
-
values[param] = parseValue(raw.payload.subarray(5 + i * valueSize), valueSize, import_safe.ConfigValueFormat.SignedInteger);
|
|
1617
|
-
}
|
|
1618
|
-
return new ConfigurationCCBulkReport_1({
|
|
1619
|
-
nodeId: ctx.sourceNodeId,
|
|
1620
|
-
reportsToFollow,
|
|
1621
|
-
defaultValues,
|
|
1622
|
-
isHandshakeResponse,
|
|
1623
|
-
valueSize,
|
|
1624
|
-
values
|
|
1625
|
-
});
|
|
1626
|
-
}
|
|
1627
|
-
persistValues(ctx) {
|
|
1628
|
-
if (!super.persistValues(ctx))
|
|
1629
|
-
return false;
|
|
1630
|
-
for (let [parameter, value] of this._values.entries()) {
|
|
1631
|
-
const oldParamInformation = this.getParamInformation(ctx, parameter);
|
|
1632
|
-
if (oldParamInformation.format != void 0 && oldParamInformation.format !== import_safe.ConfigValueFormat.SignedInteger) {
|
|
1633
|
-
value = reInterpretSignedValue(value, this.valueSize, oldParamInformation.format);
|
|
1634
|
-
this._values.set(parameter, value);
|
|
1736
|
+
static from(raw, ctx) {
|
|
1737
|
+
(0, import_safe.validatePayload)(raw.payload.length >= 5);
|
|
1738
|
+
const firstParameter = raw.payload.readUInt16BE(0);
|
|
1739
|
+
const numParams = raw.payload[2];
|
|
1740
|
+
const reportsToFollow = raw.payload[3];
|
|
1741
|
+
const defaultValues = !!(raw.payload[4] & 128);
|
|
1742
|
+
const isHandshakeResponse = !!(raw.payload[4] & 64);
|
|
1743
|
+
const valueSize = raw.payload[4] & 7;
|
|
1744
|
+
(0, import_safe.validatePayload)(raw.payload.length >= 5 + numParams * valueSize);
|
|
1745
|
+
const values = {};
|
|
1746
|
+
for (let i = 0; i < numParams; i++) {
|
|
1747
|
+
const param = firstParameter + i;
|
|
1748
|
+
values[param] = parseValue(raw.payload.subarray(5 + i * valueSize), valueSize, import_safe.ConfigValueFormat.SignedInteger);
|
|
1635
1749
|
}
|
|
1636
|
-
this
|
|
1750
|
+
return new this({
|
|
1751
|
+
nodeId: ctx.sourceNodeId,
|
|
1752
|
+
reportsToFollow,
|
|
1753
|
+
defaultValues,
|
|
1754
|
+
isHandshakeResponse,
|
|
1755
|
+
valueSize,
|
|
1756
|
+
values
|
|
1757
|
+
});
|
|
1637
1758
|
}
|
|
1638
|
-
|
|
1639
|
-
|
|
1640
|
-
|
|
1641
|
-
|
|
1642
|
-
|
|
1643
|
-
|
|
1644
|
-
|
|
1645
|
-
|
|
1646
|
-
|
|
1647
|
-
|
|
1648
|
-
|
|
1649
|
-
|
|
1650
|
-
|
|
1651
|
-
|
|
1652
|
-
|
|
1653
|
-
|
|
1654
|
-
|
|
1655
|
-
|
|
1656
|
-
|
|
1657
|
-
|
|
1658
|
-
|
|
1659
|
-
|
|
1660
|
-
|
|
1661
|
-
|
|
1662
|
-
|
|
1759
|
+
persistValues(ctx) {
|
|
1760
|
+
if (!super.persistValues(ctx))
|
|
1761
|
+
return false;
|
|
1762
|
+
for (let [parameter, value] of this._values.entries()) {
|
|
1763
|
+
const oldParamInformation = this.getParamInformation(ctx, parameter);
|
|
1764
|
+
if (oldParamInformation.format != void 0 && oldParamInformation.format !== import_safe.ConfigValueFormat.SignedInteger) {
|
|
1765
|
+
value = reInterpretSignedValue(value, this.valueSize, oldParamInformation.format);
|
|
1766
|
+
this._values.set(parameter, value);
|
|
1767
|
+
}
|
|
1768
|
+
this.setValue(ctx, ConfigurationCCValues.paramInformation(parameter), value);
|
|
1769
|
+
}
|
|
1770
|
+
return true;
|
|
1771
|
+
}
|
|
1772
|
+
reportsToFollow;
|
|
1773
|
+
defaultValues;
|
|
1774
|
+
isHandshakeResponse;
|
|
1775
|
+
valueSize;
|
|
1776
|
+
_values = /* @__PURE__ */ new Map();
|
|
1777
|
+
get values() {
|
|
1778
|
+
return this._values;
|
|
1779
|
+
}
|
|
1780
|
+
getPartialCCSessionId() {
|
|
1781
|
+
return {};
|
|
1782
|
+
}
|
|
1783
|
+
expectMoreMessages() {
|
|
1784
|
+
return this.reportsToFollow > 0;
|
|
1785
|
+
}
|
|
1786
|
+
toLogEntry(ctx) {
|
|
1787
|
+
const message = {
|
|
1788
|
+
"handshake response": this.isHandshakeResponse,
|
|
1789
|
+
"default values": this.defaultValues,
|
|
1790
|
+
"value size": this.valueSize,
|
|
1791
|
+
"reports to follow": this.reportsToFollow
|
|
1792
|
+
};
|
|
1793
|
+
if (this._values.size > 0) {
|
|
1794
|
+
message.values = [...this._values].map(([param, value]) => `
|
|
1663
1795
|
\xB7 #${param}: ${configValueToString(value)}`).join("");
|
|
1796
|
+
}
|
|
1797
|
+
return {
|
|
1798
|
+
...super.toLogEntry(ctx),
|
|
1799
|
+
message
|
|
1800
|
+
};
|
|
1664
1801
|
}
|
|
1665
|
-
|
|
1666
|
-
|
|
1667
|
-
|
|
1668
|
-
|
|
1669
|
-
|
|
1670
|
-
|
|
1671
|
-
|
|
1672
|
-
|
|
1673
|
-
|
|
1674
|
-
|
|
1675
|
-
|
|
1676
|
-
|
|
1677
|
-
|
|
1678
|
-
|
|
1679
|
-
|
|
1802
|
+
};
|
|
1803
|
+
return ConfigurationCCBulkReport2 = _classThis;
|
|
1804
|
+
})();
|
|
1805
|
+
let ConfigurationCCBulkGet = (() => {
|
|
1806
|
+
let _classDecorators = [(0, import_CommandClassDecorators.CCCommand)(import_Types.ConfigurationCommand.BulkGet), (0, import_CommandClassDecorators.expectedCCResponse)(ConfigurationCCBulkReport)];
|
|
1807
|
+
let _classDescriptor;
|
|
1808
|
+
let _classExtraInitializers = [];
|
|
1809
|
+
let _classThis;
|
|
1810
|
+
let _classSuper = ConfigurationCC;
|
|
1811
|
+
var ConfigurationCCBulkGet2 = class extends _classSuper {
|
|
1812
|
+
static {
|
|
1813
|
+
_classThis = this;
|
|
1814
|
+
}
|
|
1815
|
+
static {
|
|
1816
|
+
const _metadata = typeof Symbol === "function" && Symbol.metadata ? Object.create(_classSuper[Symbol.metadata] ?? null) : void 0;
|
|
1817
|
+
__esDecorate(null, _classDescriptor = { value: _classThis }, _classDecorators, { kind: "class", name: _classThis.name, metadata: _metadata }, null, _classExtraInitializers);
|
|
1818
|
+
ConfigurationCCBulkGet2 = _classThis = _classDescriptor.value;
|
|
1819
|
+
if (_metadata) Object.defineProperty(_classThis, Symbol.metadata, { enumerable: true, configurable: true, writable: true, value: _metadata });
|
|
1820
|
+
__runInitializers(_classThis, _classExtraInitializers);
|
|
1821
|
+
}
|
|
1822
|
+
constructor(options) {
|
|
1823
|
+
super(options);
|
|
1824
|
+
this._parameters = options.parameters.sort();
|
|
1825
|
+
if (!(0, import_safe.isConsecutiveArray)(this.parameters)) {
|
|
1826
|
+
throw new import_safe.ZWaveError(`A ConfigurationCC.BulkGet can only be used for consecutive parameters`, import_safe.ZWaveErrorCodes.CC_Invalid);
|
|
1827
|
+
}
|
|
1680
1828
|
}
|
|
1681
|
-
|
|
1682
|
-
|
|
1683
|
-
|
|
1684
|
-
|
|
1685
|
-
|
|
1686
|
-
|
|
1687
|
-
|
|
1688
|
-
|
|
1689
|
-
|
|
1690
|
-
|
|
1691
|
-
|
|
1692
|
-
|
|
1693
|
-
|
|
1694
|
-
|
|
1695
|
-
|
|
1696
|
-
|
|
1697
|
-
|
|
1698
|
-
|
|
1699
|
-
}
|
|
1700
|
-
}
|
|
1701
|
-
|
|
1702
|
-
|
|
1703
|
-
|
|
1704
|
-
(0, import_CommandClassDecorators.
|
|
1705
|
-
|
|
1706
|
-
let
|
|
1707
|
-
|
|
1708
|
-
|
|
1709
|
-
|
|
1710
|
-
|
|
1711
|
-
|
|
1712
|
-
|
|
1713
|
-
|
|
1714
|
-
|
|
1715
|
-
|
|
1716
|
-
|
|
1717
|
-
|
|
1718
|
-
(
|
|
1719
|
-
}
|
|
1720
|
-
|
|
1721
|
-
|
|
1722
|
-
|
|
1723
|
-
|
|
1724
|
-
reportsToFollow
|
|
1725
|
-
|
|
1726
|
-
|
|
1727
|
-
|
|
1728
|
-
|
|
1729
|
-
|
|
1730
|
-
|
|
1731
|
-
|
|
1732
|
-
|
|
1733
|
-
|
|
1734
|
-
|
|
1735
|
-
|
|
1736
|
-
|
|
1737
|
-
|
|
1829
|
+
static from(_raw, _ctx) {
|
|
1830
|
+
throw new import_safe.ZWaveError(`${this.name}: deserialization not implemented`, import_safe.ZWaveErrorCodes.Deserialization_NotImplemented);
|
|
1831
|
+
}
|
|
1832
|
+
_parameters;
|
|
1833
|
+
get parameters() {
|
|
1834
|
+
return this._parameters;
|
|
1835
|
+
}
|
|
1836
|
+
serialize(ctx) {
|
|
1837
|
+
this.payload = new import_safe2.Bytes(3);
|
|
1838
|
+
this.payload.writeUInt16BE(this.parameters[0], 0);
|
|
1839
|
+
this.payload[2] = this.parameters.length;
|
|
1840
|
+
return super.serialize(ctx);
|
|
1841
|
+
}
|
|
1842
|
+
toLogEntry(ctx) {
|
|
1843
|
+
return {
|
|
1844
|
+
...super.toLogEntry(ctx),
|
|
1845
|
+
message: { parameters: this.parameters.join(", ") }
|
|
1846
|
+
};
|
|
1847
|
+
}
|
|
1848
|
+
};
|
|
1849
|
+
return ConfigurationCCBulkGet2 = _classThis;
|
|
1850
|
+
})();
|
|
1851
|
+
let ConfigurationCCNameReport = (() => {
|
|
1852
|
+
let _classDecorators = [(0, import_CommandClassDecorators.CCCommand)(import_Types.ConfigurationCommand.NameReport)];
|
|
1853
|
+
let _classDescriptor;
|
|
1854
|
+
let _classExtraInitializers = [];
|
|
1855
|
+
let _classThis;
|
|
1856
|
+
let _classSuper = ConfigurationCC;
|
|
1857
|
+
var ConfigurationCCNameReport2 = class extends _classSuper {
|
|
1858
|
+
static {
|
|
1859
|
+
_classThis = this;
|
|
1860
|
+
}
|
|
1861
|
+
static {
|
|
1862
|
+
const _metadata = typeof Symbol === "function" && Symbol.metadata ? Object.create(_classSuper[Symbol.metadata] ?? null) : void 0;
|
|
1863
|
+
__esDecorate(null, _classDescriptor = { value: _classThis }, _classDecorators, { kind: "class", name: _classThis.name, metadata: _metadata }, null, _classExtraInitializers);
|
|
1864
|
+
ConfigurationCCNameReport2 = _classThis = _classDescriptor.value;
|
|
1865
|
+
if (_metadata) Object.defineProperty(_classThis, Symbol.metadata, { enumerable: true, configurable: true, writable: true, value: _metadata });
|
|
1866
|
+
__runInitializers(_classThis, _classExtraInitializers);
|
|
1867
|
+
}
|
|
1868
|
+
constructor(options) {
|
|
1869
|
+
super(options);
|
|
1870
|
+
this.parameter = options.parameter;
|
|
1871
|
+
this.name = options.name;
|
|
1872
|
+
this.reportsToFollow = options.reportsToFollow;
|
|
1873
|
+
}
|
|
1874
|
+
static from(raw, ctx) {
|
|
1875
|
+
(0, import_safe.validatePayload)(raw.payload.length >= 3);
|
|
1876
|
+
const parameter = raw.payload.readUInt16BE(0);
|
|
1877
|
+
const reportsToFollow = raw.payload[2];
|
|
1878
|
+
if (reportsToFollow > 0) {
|
|
1879
|
+
(0, import_safe.validatePayload)(raw.payload.length >= 4);
|
|
1880
|
+
}
|
|
1881
|
+
const name = raw.payload.subarray(3).toString("utf8");
|
|
1882
|
+
return new this({
|
|
1883
|
+
nodeId: ctx.sourceNodeId,
|
|
1884
|
+
parameter,
|
|
1885
|
+
reportsToFollow,
|
|
1886
|
+
name
|
|
1738
1887
|
});
|
|
1739
|
-
}
|
|
1740
|
-
|
|
1741
|
-
|
|
1742
|
-
|
|
1743
|
-
|
|
1744
|
-
|
|
1745
|
-
|
|
1746
|
-
|
|
1747
|
-
|
|
1748
|
-
this.extendParamInformation(ctx,
|
|
1749
|
-
label
|
|
1888
|
+
}
|
|
1889
|
+
parameter;
|
|
1890
|
+
name;
|
|
1891
|
+
reportsToFollow;
|
|
1892
|
+
persistValues(ctx) {
|
|
1893
|
+
if (!super.persistValues(ctx))
|
|
1894
|
+
return false;
|
|
1895
|
+
const partialParams = this.getPartialParamInfos(ctx, this.parameter);
|
|
1896
|
+
if (partialParams.length === 0) {
|
|
1897
|
+
this.extendParamInformation(ctx, this.parameter, void 0, {
|
|
1898
|
+
label: this.name
|
|
1750
1899
|
});
|
|
1900
|
+
} else {
|
|
1901
|
+
for (const param of partialParams) {
|
|
1902
|
+
const paramNumber = param.property;
|
|
1903
|
+
const bitMask = param.propertyKey;
|
|
1904
|
+
const bitNumber = Math.log2(bitMask) % 1 === 0 ? Math.log2(bitMask) : void 0;
|
|
1905
|
+
let label = `${this.name} - ${bitMask}`;
|
|
1906
|
+
if (bitNumber != void 0) {
|
|
1907
|
+
label += ` (bit ${bitNumber})`;
|
|
1908
|
+
}
|
|
1909
|
+
this.extendParamInformation(ctx, paramNumber, bitMask, {
|
|
1910
|
+
label
|
|
1911
|
+
});
|
|
1912
|
+
}
|
|
1751
1913
|
}
|
|
1914
|
+
return true;
|
|
1752
1915
|
}
|
|
1753
|
-
|
|
1754
|
-
|
|
1755
|
-
|
|
1756
|
-
|
|
1757
|
-
|
|
1758
|
-
|
|
1759
|
-
|
|
1760
|
-
|
|
1761
|
-
|
|
1762
|
-
|
|
1763
|
-
|
|
1764
|
-
|
|
1765
|
-
|
|
1766
|
-
|
|
1767
|
-
|
|
1768
|
-
|
|
1769
|
-
|
|
1770
|
-
|
|
1771
|
-
|
|
1772
|
-
|
|
1773
|
-
|
|
1774
|
-
|
|
1775
|
-
|
|
1776
|
-
|
|
1777
|
-
|
|
1778
|
-
|
|
1916
|
+
serialize(ctx) {
|
|
1917
|
+
const nameBuffer = import_safe2.Bytes.from(this.name, "utf8");
|
|
1918
|
+
this.payload = new import_safe2.Bytes(3 + nameBuffer.length);
|
|
1919
|
+
this.payload.writeUInt16BE(this.parameter, 0);
|
|
1920
|
+
this.payload[2] = this.reportsToFollow;
|
|
1921
|
+
this.payload.set(nameBuffer, 3);
|
|
1922
|
+
return super.serialize(ctx);
|
|
1923
|
+
}
|
|
1924
|
+
getPartialCCSessionId() {
|
|
1925
|
+
return { parameter: this.parameter };
|
|
1926
|
+
}
|
|
1927
|
+
expectMoreMessages() {
|
|
1928
|
+
return this.reportsToFollow > 0;
|
|
1929
|
+
}
|
|
1930
|
+
mergePartialCCs(partials, _ctx) {
|
|
1931
|
+
this.name = [...partials, this].map((report) => report.name).reduce((prev, cur) => prev + cur, "");
|
|
1932
|
+
}
|
|
1933
|
+
toLogEntry(ctx) {
|
|
1934
|
+
return {
|
|
1935
|
+
...super.toLogEntry(ctx),
|
|
1936
|
+
message: {
|
|
1937
|
+
"parameter #": this.parameter,
|
|
1938
|
+
name: this.name,
|
|
1939
|
+
"reports to follow": this.reportsToFollow
|
|
1940
|
+
}
|
|
1941
|
+
};
|
|
1942
|
+
}
|
|
1943
|
+
};
|
|
1944
|
+
return ConfigurationCCNameReport2 = _classThis;
|
|
1945
|
+
})();
|
|
1946
|
+
let ConfigurationCCNameGet = (() => {
|
|
1947
|
+
let _classDecorators = [(0, import_CommandClassDecorators.CCCommand)(import_Types.ConfigurationCommand.NameGet), (0, import_CommandClassDecorators.expectedCCResponse)(ConfigurationCCNameReport)];
|
|
1948
|
+
let _classDescriptor;
|
|
1949
|
+
let _classExtraInitializers = [];
|
|
1950
|
+
let _classThis;
|
|
1951
|
+
let _classSuper = ConfigurationCC;
|
|
1952
|
+
var ConfigurationCCNameGet2 = class extends _classSuper {
|
|
1953
|
+
static {
|
|
1954
|
+
_classThis = this;
|
|
1955
|
+
}
|
|
1956
|
+
static {
|
|
1957
|
+
const _metadata = typeof Symbol === "function" && Symbol.metadata ? Object.create(_classSuper[Symbol.metadata] ?? null) : void 0;
|
|
1958
|
+
__esDecorate(null, _classDescriptor = { value: _classThis }, _classDecorators, { kind: "class", name: _classThis.name, metadata: _metadata }, null, _classExtraInitializers);
|
|
1959
|
+
ConfigurationCCNameGet2 = _classThis = _classDescriptor.value;
|
|
1960
|
+
if (_metadata) Object.defineProperty(_classThis, Symbol.metadata, { enumerable: true, configurable: true, writable: true, value: _metadata });
|
|
1961
|
+
__runInitializers(_classThis, _classExtraInitializers);
|
|
1962
|
+
}
|
|
1963
|
+
constructor(options) {
|
|
1964
|
+
super(options);
|
|
1965
|
+
this.parameter = options.parameter;
|
|
1966
|
+
}
|
|
1967
|
+
static from(raw, ctx) {
|
|
1968
|
+
(0, import_safe.validatePayload)(raw.payload.length >= 2);
|
|
1969
|
+
const parameter = raw.payload.readUInt16BE(0);
|
|
1970
|
+
return new this({
|
|
1971
|
+
nodeId: ctx.sourceNodeId,
|
|
1972
|
+
parameter
|
|
1973
|
+
});
|
|
1974
|
+
}
|
|
1975
|
+
parameter;
|
|
1976
|
+
serialize(ctx) {
|
|
1977
|
+
this.payload = new import_safe2.Bytes(2);
|
|
1978
|
+
this.payload.writeUInt16BE(this.parameter, 0);
|
|
1979
|
+
return super.serialize(ctx);
|
|
1980
|
+
}
|
|
1981
|
+
toLogEntry(ctx) {
|
|
1982
|
+
return {
|
|
1983
|
+
...super.toLogEntry(ctx),
|
|
1984
|
+
message: { "parameter #": this.parameter }
|
|
1985
|
+
};
|
|
1986
|
+
}
|
|
1987
|
+
};
|
|
1988
|
+
return ConfigurationCCNameGet2 = _classThis;
|
|
1989
|
+
})();
|
|
1990
|
+
let ConfigurationCCInfoReport = (() => {
|
|
1991
|
+
let _classDecorators = [(0, import_CommandClassDecorators.CCCommand)(import_Types.ConfigurationCommand.InfoReport)];
|
|
1992
|
+
let _classDescriptor;
|
|
1993
|
+
let _classExtraInitializers = [];
|
|
1994
|
+
let _classThis;
|
|
1995
|
+
let _classSuper = ConfigurationCC;
|
|
1996
|
+
var ConfigurationCCInfoReport2 = class extends _classSuper {
|
|
1997
|
+
static {
|
|
1998
|
+
_classThis = this;
|
|
1999
|
+
}
|
|
2000
|
+
static {
|
|
2001
|
+
const _metadata = typeof Symbol === "function" && Symbol.metadata ? Object.create(_classSuper[Symbol.metadata] ?? null) : void 0;
|
|
2002
|
+
__esDecorate(null, _classDescriptor = { value: _classThis }, _classDecorators, { kind: "class", name: _classThis.name, metadata: _metadata }, null, _classExtraInitializers);
|
|
2003
|
+
ConfigurationCCInfoReport2 = _classThis = _classDescriptor.value;
|
|
2004
|
+
if (_metadata) Object.defineProperty(_classThis, Symbol.metadata, { enumerable: true, configurable: true, writable: true, value: _metadata });
|
|
2005
|
+
__runInitializers(_classThis, _classExtraInitializers);
|
|
2006
|
+
}
|
|
2007
|
+
constructor(options) {
|
|
2008
|
+
super(options);
|
|
2009
|
+
this.parameter = options.parameter;
|
|
2010
|
+
this.info = options.info;
|
|
2011
|
+
this.reportsToFollow = options.reportsToFollow;
|
|
2012
|
+
}
|
|
2013
|
+
static from(raw, ctx) {
|
|
2014
|
+
(0, import_safe.validatePayload)(raw.payload.length >= 3);
|
|
2015
|
+
const parameter = raw.payload.readUInt16BE(0);
|
|
2016
|
+
const reportsToFollow = raw.payload[2];
|
|
2017
|
+
if (reportsToFollow > 0) {
|
|
2018
|
+
(0, import_safe.validatePayload)(raw.payload.length >= 4);
|
|
1779
2019
|
}
|
|
1780
|
-
|
|
1781
|
-
|
|
1782
|
-
|
|
1783
|
-
|
|
1784
|
-
|
|
1785
|
-
|
|
1786
|
-
let ConfigurationCCNameGet = ConfigurationCCNameGet_1 = class ConfigurationCCNameGet2 extends ConfigurationCC {
|
|
1787
|
-
constructor(options) {
|
|
1788
|
-
super(options);
|
|
1789
|
-
this.parameter = options.parameter;
|
|
1790
|
-
}
|
|
1791
|
-
static from(raw, ctx) {
|
|
1792
|
-
(0, import_safe.validatePayload)(raw.payload.length >= 2);
|
|
1793
|
-
const parameter = raw.payload.readUInt16BE(0);
|
|
1794
|
-
return new ConfigurationCCNameGet_1({
|
|
1795
|
-
nodeId: ctx.sourceNodeId,
|
|
1796
|
-
parameter
|
|
1797
|
-
});
|
|
1798
|
-
}
|
|
1799
|
-
parameter;
|
|
1800
|
-
serialize(ctx) {
|
|
1801
|
-
this.payload = new import_safe2.Bytes(2);
|
|
1802
|
-
this.payload.writeUInt16BE(this.parameter, 0);
|
|
1803
|
-
return super.serialize(ctx);
|
|
1804
|
-
}
|
|
1805
|
-
toLogEntry(ctx) {
|
|
1806
|
-
return {
|
|
1807
|
-
...super.toLogEntry(ctx),
|
|
1808
|
-
message: { "parameter #": this.parameter }
|
|
1809
|
-
};
|
|
1810
|
-
}
|
|
1811
|
-
};
|
|
1812
|
-
ConfigurationCCNameGet = ConfigurationCCNameGet_1 = __decorate([
|
|
1813
|
-
(0, import_CommandClassDecorators.CCCommand)(import_Types.ConfigurationCommand.NameGet),
|
|
1814
|
-
(0, import_CommandClassDecorators.expectedCCResponse)(ConfigurationCCNameReport)
|
|
1815
|
-
], ConfigurationCCNameGet);
|
|
1816
|
-
let ConfigurationCCInfoReport = ConfigurationCCInfoReport_1 = class ConfigurationCCInfoReport2 extends ConfigurationCC {
|
|
1817
|
-
constructor(options) {
|
|
1818
|
-
super(options);
|
|
1819
|
-
this.parameter = options.parameter;
|
|
1820
|
-
this.info = options.info;
|
|
1821
|
-
this.reportsToFollow = options.reportsToFollow;
|
|
1822
|
-
}
|
|
1823
|
-
static from(raw, ctx) {
|
|
1824
|
-
(0, import_safe.validatePayload)(raw.payload.length >= 3);
|
|
1825
|
-
const parameter = raw.payload.readUInt16BE(0);
|
|
1826
|
-
const reportsToFollow = raw.payload[2];
|
|
1827
|
-
if (reportsToFollow > 0) {
|
|
1828
|
-
(0, import_safe.validatePayload)(raw.payload.length >= 4);
|
|
1829
|
-
}
|
|
1830
|
-
const info = raw.payload.subarray(3).toString("utf8");
|
|
1831
|
-
return new ConfigurationCCInfoReport_1({
|
|
1832
|
-
nodeId: ctx.sourceNodeId,
|
|
1833
|
-
parameter,
|
|
1834
|
-
reportsToFollow,
|
|
1835
|
-
info
|
|
1836
|
-
});
|
|
1837
|
-
}
|
|
1838
|
-
parameter;
|
|
1839
|
-
info;
|
|
1840
|
-
reportsToFollow;
|
|
1841
|
-
persistValues(ctx) {
|
|
1842
|
-
if (!super.persistValues(ctx))
|
|
1843
|
-
return false;
|
|
1844
|
-
const partialParams = this.getPartialParamInfos(ctx, this.parameter).sort((a, b) => (a.propertyKey ?? 0) - (b.propertyKey ?? 0));
|
|
1845
|
-
if (partialParams.length === 0) {
|
|
1846
|
-
this.extendParamInformation(ctx, this.parameter, void 0, {
|
|
1847
|
-
description: this.info
|
|
2020
|
+
const info = raw.payload.subarray(3).toString("utf8");
|
|
2021
|
+
return new this({
|
|
2022
|
+
nodeId: ctx.sourceNodeId,
|
|
2023
|
+
parameter,
|
|
2024
|
+
reportsToFollow,
|
|
2025
|
+
info
|
|
1848
2026
|
});
|
|
1849
|
-
}
|
|
1850
|
-
|
|
1851
|
-
|
|
1852
|
-
|
|
1853
|
-
|
|
1854
|
-
|
|
1855
|
-
|
|
1856
|
-
|
|
2027
|
+
}
|
|
2028
|
+
parameter;
|
|
2029
|
+
info;
|
|
2030
|
+
reportsToFollow;
|
|
2031
|
+
persistValues(ctx) {
|
|
2032
|
+
if (!super.persistValues(ctx))
|
|
2033
|
+
return false;
|
|
2034
|
+
const partialParams = this.getPartialParamInfos(ctx, this.parameter).sort((a, b) => (a.propertyKey ?? 0) - (b.propertyKey ?? 0));
|
|
2035
|
+
if (partialParams.length === 0) {
|
|
2036
|
+
this.extendParamInformation(ctx, this.parameter, void 0, {
|
|
2037
|
+
description: this.info
|
|
1857
2038
|
});
|
|
1858
|
-
|
|
1859
|
-
|
|
2039
|
+
} else {
|
|
2040
|
+
let firstParamLabel;
|
|
2041
|
+
for (const param of partialParams) {
|
|
2042
|
+
const paramNumber = param.property;
|
|
2043
|
+
const bitMask = param.propertyKey;
|
|
2044
|
+
const description = firstParamLabel ? `Refer to ${firstParamLabel}` : this.info;
|
|
2045
|
+
this.extendParamInformation(ctx, paramNumber, bitMask, {
|
|
2046
|
+
description
|
|
2047
|
+
});
|
|
2048
|
+
if (firstParamLabel == void 0) {
|
|
2049
|
+
firstParamLabel = this.getParamInformation(ctx, paramNumber, bitMask).label ?? `parameter ${paramNumber} - ${bitMask}`;
|
|
2050
|
+
}
|
|
1860
2051
|
}
|
|
1861
2052
|
}
|
|
2053
|
+
return true;
|
|
1862
2054
|
}
|
|
1863
|
-
|
|
1864
|
-
|
|
1865
|
-
|
|
1866
|
-
|
|
1867
|
-
|
|
1868
|
-
|
|
1869
|
-
|
|
1870
|
-
|
|
1871
|
-
|
|
1872
|
-
|
|
1873
|
-
|
|
1874
|
-
|
|
1875
|
-
|
|
1876
|
-
|
|
1877
|
-
|
|
1878
|
-
|
|
1879
|
-
|
|
1880
|
-
|
|
1881
|
-
|
|
1882
|
-
|
|
1883
|
-
|
|
1884
|
-
|
|
1885
|
-
|
|
1886
|
-
|
|
1887
|
-
|
|
1888
|
-
|
|
2055
|
+
serialize(ctx) {
|
|
2056
|
+
const infoBuffer = import_safe2.Bytes.from(this.info, "utf8");
|
|
2057
|
+
this.payload = new import_safe2.Bytes(3 + infoBuffer.length);
|
|
2058
|
+
this.payload.writeUInt16BE(this.parameter, 0);
|
|
2059
|
+
this.payload[2] = this.reportsToFollow;
|
|
2060
|
+
this.payload.set(infoBuffer, 3);
|
|
2061
|
+
return super.serialize(ctx);
|
|
2062
|
+
}
|
|
2063
|
+
getPartialCCSessionId() {
|
|
2064
|
+
return { parameter: this.parameter };
|
|
2065
|
+
}
|
|
2066
|
+
expectMoreMessages() {
|
|
2067
|
+
return this.reportsToFollow > 0;
|
|
2068
|
+
}
|
|
2069
|
+
mergePartialCCs(partials, _ctx) {
|
|
2070
|
+
this.info = [...partials, this].map((report) => report.info).reduce((prev, cur) => prev + cur, "");
|
|
2071
|
+
}
|
|
2072
|
+
toLogEntry(ctx) {
|
|
2073
|
+
return {
|
|
2074
|
+
...super.toLogEntry(ctx),
|
|
2075
|
+
message: {
|
|
2076
|
+
"parameter #": this.parameter,
|
|
2077
|
+
info: this.info,
|
|
2078
|
+
"reports to follow": this.reportsToFollow
|
|
2079
|
+
}
|
|
2080
|
+
};
|
|
2081
|
+
}
|
|
2082
|
+
};
|
|
2083
|
+
return ConfigurationCCInfoReport2 = _classThis;
|
|
2084
|
+
})();
|
|
2085
|
+
let ConfigurationCCInfoGet = (() => {
|
|
2086
|
+
let _classDecorators = [(0, import_CommandClassDecorators.CCCommand)(import_Types.ConfigurationCommand.InfoGet), (0, import_CommandClassDecorators.expectedCCResponse)(ConfigurationCCInfoReport)];
|
|
2087
|
+
let _classDescriptor;
|
|
2088
|
+
let _classExtraInitializers = [];
|
|
2089
|
+
let _classThis;
|
|
2090
|
+
let _classSuper = ConfigurationCC;
|
|
2091
|
+
var ConfigurationCCInfoGet2 = class extends _classSuper {
|
|
2092
|
+
static {
|
|
2093
|
+
_classThis = this;
|
|
2094
|
+
}
|
|
2095
|
+
static {
|
|
2096
|
+
const _metadata = typeof Symbol === "function" && Symbol.metadata ? Object.create(_classSuper[Symbol.metadata] ?? null) : void 0;
|
|
2097
|
+
__esDecorate(null, _classDescriptor = { value: _classThis }, _classDecorators, { kind: "class", name: _classThis.name, metadata: _metadata }, null, _classExtraInitializers);
|
|
2098
|
+
ConfigurationCCInfoGet2 = _classThis = _classDescriptor.value;
|
|
2099
|
+
if (_metadata) Object.defineProperty(_classThis, Symbol.metadata, { enumerable: true, configurable: true, writable: true, value: _metadata });
|
|
2100
|
+
__runInitializers(_classThis, _classExtraInitializers);
|
|
2101
|
+
}
|
|
2102
|
+
constructor(options) {
|
|
2103
|
+
super(options);
|
|
2104
|
+
this.parameter = options.parameter;
|
|
2105
|
+
}
|
|
2106
|
+
static from(raw, ctx) {
|
|
2107
|
+
(0, import_safe.validatePayload)(raw.payload.length >= 2);
|
|
2108
|
+
const parameter = raw.payload.readUInt16BE(0);
|
|
2109
|
+
return new this({
|
|
2110
|
+
nodeId: ctx.sourceNodeId,
|
|
2111
|
+
parameter
|
|
2112
|
+
});
|
|
2113
|
+
}
|
|
2114
|
+
parameter;
|
|
2115
|
+
serialize(ctx) {
|
|
2116
|
+
this.payload = new import_safe2.Bytes(2);
|
|
2117
|
+
this.payload.writeUInt16BE(this.parameter, 0);
|
|
2118
|
+
return super.serialize(ctx);
|
|
2119
|
+
}
|
|
2120
|
+
toLogEntry(ctx) {
|
|
2121
|
+
return {
|
|
2122
|
+
...super.toLogEntry(ctx),
|
|
2123
|
+
message: { "parameter #": this.parameter }
|
|
2124
|
+
};
|
|
2125
|
+
}
|
|
2126
|
+
};
|
|
2127
|
+
return ConfigurationCCInfoGet2 = _classThis;
|
|
2128
|
+
})();
|
|
2129
|
+
let ConfigurationCCPropertiesReport = (() => {
|
|
2130
|
+
let _classDecorators = [(0, import_CommandClassDecorators.CCCommand)(import_Types.ConfigurationCommand.PropertiesReport)];
|
|
2131
|
+
let _classDescriptor;
|
|
2132
|
+
let _classExtraInitializers = [];
|
|
2133
|
+
let _classThis;
|
|
2134
|
+
let _classSuper = ConfigurationCC;
|
|
2135
|
+
var ConfigurationCCPropertiesReport2 = class extends _classSuper {
|
|
2136
|
+
static {
|
|
2137
|
+
_classThis = this;
|
|
2138
|
+
}
|
|
2139
|
+
static {
|
|
2140
|
+
const _metadata = typeof Symbol === "function" && Symbol.metadata ? Object.create(_classSuper[Symbol.metadata] ?? null) : void 0;
|
|
2141
|
+
__esDecorate(null, _classDescriptor = { value: _classThis }, _classDecorators, { kind: "class", name: _classThis.name, metadata: _metadata }, null, _classExtraInitializers);
|
|
2142
|
+
ConfigurationCCPropertiesReport2 = _classThis = _classDescriptor.value;
|
|
2143
|
+
if (_metadata) Object.defineProperty(_classThis, Symbol.metadata, { enumerable: true, configurable: true, writable: true, value: _metadata });
|
|
2144
|
+
__runInitializers(_classThis, _classExtraInitializers);
|
|
2145
|
+
}
|
|
2146
|
+
constructor(options) {
|
|
2147
|
+
super(options);
|
|
2148
|
+
this.parameter = options.parameter;
|
|
2149
|
+
this.valueSize = options.valueSize;
|
|
2150
|
+
this.valueFormat = options.valueFormat;
|
|
2151
|
+
if (this.valueSize > 0) {
|
|
2152
|
+
if (options.minValue == void 0) {
|
|
2153
|
+
throw new import_safe.ZWaveError("The minimum value must be set when the value size is non-zero", import_safe.ZWaveErrorCodes.Argument_Invalid);
|
|
2154
|
+
} else if (options.maxValue == void 0) {
|
|
2155
|
+
throw new import_safe.ZWaveError("The maximum value must be set when the value size is non-zero", import_safe.ZWaveErrorCodes.Argument_Invalid);
|
|
2156
|
+
} else if (options.defaultValue == void 0) {
|
|
2157
|
+
throw new import_safe.ZWaveError("The default value must be set when the value size is non-zero", import_safe.ZWaveErrorCodes.Argument_Invalid);
|
|
2158
|
+
}
|
|
2159
|
+
this.minValue = options.minValue;
|
|
2160
|
+
this.maxValue = options.maxValue;
|
|
2161
|
+
this.defaultValue = options.defaultValue;
|
|
1889
2162
|
}
|
|
1890
|
-
|
|
1891
|
-
|
|
1892
|
-
|
|
1893
|
-
|
|
1894
|
-
|
|
1895
|
-
|
|
1896
|
-
|
|
1897
|
-
|
|
1898
|
-
|
|
1899
|
-
|
|
1900
|
-
|
|
1901
|
-
|
|
1902
|
-
|
|
1903
|
-
|
|
1904
|
-
|
|
1905
|
-
|
|
1906
|
-
|
|
1907
|
-
|
|
1908
|
-
|
|
1909
|
-
|
|
1910
|
-
|
|
1911
|
-
this.payload = new import_safe2.Bytes(2);
|
|
1912
|
-
this.payload.writeUInt16BE(this.parameter, 0);
|
|
1913
|
-
return super.serialize(ctx);
|
|
1914
|
-
}
|
|
1915
|
-
toLogEntry(ctx) {
|
|
1916
|
-
return {
|
|
1917
|
-
...super.toLogEntry(ctx),
|
|
1918
|
-
message: { "parameter #": this.parameter }
|
|
1919
|
-
};
|
|
1920
|
-
}
|
|
1921
|
-
};
|
|
1922
|
-
ConfigurationCCInfoGet = ConfigurationCCInfoGet_1 = __decorate([
|
|
1923
|
-
(0, import_CommandClassDecorators.CCCommand)(import_Types.ConfigurationCommand.InfoGet),
|
|
1924
|
-
(0, import_CommandClassDecorators.expectedCCResponse)(ConfigurationCCInfoReport)
|
|
1925
|
-
], ConfigurationCCInfoGet);
|
|
1926
|
-
let ConfigurationCCPropertiesReport = ConfigurationCCPropertiesReport_1 = class ConfigurationCCPropertiesReport2 extends ConfigurationCC {
|
|
1927
|
-
constructor(options) {
|
|
1928
|
-
super(options);
|
|
1929
|
-
this.parameter = options.parameter;
|
|
1930
|
-
this.valueSize = options.valueSize;
|
|
1931
|
-
this.valueFormat = options.valueFormat;
|
|
1932
|
-
if (this.valueSize > 0) {
|
|
1933
|
-
if (options.minValue == void 0) {
|
|
1934
|
-
throw new import_safe.ZWaveError("The minimum value must be set when the value size is non-zero", import_safe.ZWaveErrorCodes.Argument_Invalid);
|
|
1935
|
-
} else if (options.maxValue == void 0) {
|
|
1936
|
-
throw new import_safe.ZWaveError("The maximum value must be set when the value size is non-zero", import_safe.ZWaveErrorCodes.Argument_Invalid);
|
|
1937
|
-
} else if (options.defaultValue == void 0) {
|
|
1938
|
-
throw new import_safe.ZWaveError("The default value must be set when the value size is non-zero", import_safe.ZWaveErrorCodes.Argument_Invalid);
|
|
2163
|
+
this.nextParameter = options.nextParameter;
|
|
2164
|
+
this.altersCapabilities = options.altersCapabilities;
|
|
2165
|
+
this.isReadonly = options.isReadonly;
|
|
2166
|
+
this.isAdvanced = options.isAdvanced;
|
|
2167
|
+
this.noBulkSupport = options.noBulkSupport;
|
|
2168
|
+
}
|
|
2169
|
+
static from(raw, ctx) {
|
|
2170
|
+
(0, import_safe.validatePayload)(raw.payload.length >= 3);
|
|
2171
|
+
const parameter = raw.payload.readUInt16BE(0);
|
|
2172
|
+
const valueFormat = (raw.payload[2] & 56) >>> 3;
|
|
2173
|
+
const valueSize = raw.payload[2] & 7;
|
|
2174
|
+
let nextParameter;
|
|
2175
|
+
if (valueSize === 0 && raw.payload.length < 5) {
|
|
2176
|
+
nextParameter = 0;
|
|
2177
|
+
return new this({
|
|
2178
|
+
nodeId: ctx.sourceNodeId,
|
|
2179
|
+
parameter,
|
|
2180
|
+
valueFormat,
|
|
2181
|
+
valueSize,
|
|
2182
|
+
nextParameter
|
|
2183
|
+
});
|
|
1939
2184
|
}
|
|
1940
|
-
|
|
1941
|
-
|
|
1942
|
-
|
|
1943
|
-
|
|
1944
|
-
|
|
1945
|
-
|
|
1946
|
-
|
|
1947
|
-
|
|
1948
|
-
|
|
1949
|
-
|
|
1950
|
-
|
|
1951
|
-
|
|
1952
|
-
|
|
1953
|
-
|
|
1954
|
-
|
|
1955
|
-
|
|
1956
|
-
|
|
1957
|
-
|
|
1958
|
-
|
|
2185
|
+
const nextParameterOffset = 3 + 3 * valueSize;
|
|
2186
|
+
(0, import_safe.validatePayload)(raw.payload.length >= nextParameterOffset + 2);
|
|
2187
|
+
let minValue;
|
|
2188
|
+
let maxValue;
|
|
2189
|
+
let defaultValue;
|
|
2190
|
+
if (valueSize > 0) {
|
|
2191
|
+
if (valueFormat === import_safe.ConfigValueFormat.BitField) {
|
|
2192
|
+
minValue = 0;
|
|
2193
|
+
} else {
|
|
2194
|
+
minValue = parseValue(raw.payload.subarray(3), valueSize, valueFormat);
|
|
2195
|
+
}
|
|
2196
|
+
maxValue = parseValue(raw.payload.subarray(3 + valueSize), valueSize, valueFormat);
|
|
2197
|
+
defaultValue = parseValue(raw.payload.subarray(3 + 2 * valueSize), valueSize, valueFormat);
|
|
2198
|
+
}
|
|
2199
|
+
nextParameter = raw.payload.readUInt16BE(nextParameterOffset);
|
|
2200
|
+
let altersCapabilities;
|
|
2201
|
+
let isReadonly;
|
|
2202
|
+
let isAdvanced;
|
|
2203
|
+
let noBulkSupport;
|
|
2204
|
+
if (raw.payload.length >= nextParameterOffset + 3) {
|
|
2205
|
+
const options1 = raw.payload[2];
|
|
2206
|
+
const options2 = raw.payload[3 + 3 * valueSize + 2];
|
|
2207
|
+
altersCapabilities = !!(options1 & 128);
|
|
2208
|
+
isReadonly = !!(options1 & 64);
|
|
2209
|
+
isAdvanced = !!(options2 & 1);
|
|
2210
|
+
noBulkSupport = !!(options2 & 2);
|
|
2211
|
+
}
|
|
2212
|
+
return new this({
|
|
1959
2213
|
nodeId: ctx.sourceNodeId,
|
|
1960
2214
|
parameter,
|
|
1961
2215
|
valueFormat,
|
|
1962
2216
|
valueSize,
|
|
1963
|
-
nextParameter
|
|
2217
|
+
nextParameter,
|
|
2218
|
+
minValue,
|
|
2219
|
+
maxValue,
|
|
2220
|
+
defaultValue,
|
|
2221
|
+
altersCapabilities,
|
|
2222
|
+
isReadonly,
|
|
2223
|
+
isAdvanced,
|
|
2224
|
+
noBulkSupport
|
|
1964
2225
|
});
|
|
1965
2226
|
}
|
|
1966
|
-
|
|
1967
|
-
|
|
1968
|
-
|
|
1969
|
-
|
|
1970
|
-
|
|
1971
|
-
|
|
1972
|
-
|
|
1973
|
-
|
|
1974
|
-
|
|
1975
|
-
|
|
1976
|
-
|
|
1977
|
-
|
|
1978
|
-
|
|
1979
|
-
|
|
1980
|
-
|
|
1981
|
-
|
|
1982
|
-
|
|
1983
|
-
|
|
1984
|
-
let noBulkSupport;
|
|
1985
|
-
if (raw.payload.length >= nextParameterOffset + 3) {
|
|
1986
|
-
const options1 = raw.payload[2];
|
|
1987
|
-
const options2 = raw.payload[3 + 3 * valueSize + 2];
|
|
1988
|
-
altersCapabilities = !!(options1 & 128);
|
|
1989
|
-
isReadonly = !!(options1 & 64);
|
|
1990
|
-
isAdvanced = !!(options2 & 1);
|
|
1991
|
-
noBulkSupport = !!(options2 & 2);
|
|
1992
|
-
}
|
|
1993
|
-
return new ConfigurationCCPropertiesReport_1({
|
|
1994
|
-
nodeId: ctx.sourceNodeId,
|
|
1995
|
-
parameter,
|
|
1996
|
-
valueFormat,
|
|
1997
|
-
valueSize,
|
|
1998
|
-
nextParameter,
|
|
1999
|
-
minValue,
|
|
2000
|
-
maxValue,
|
|
2001
|
-
defaultValue,
|
|
2002
|
-
altersCapabilities,
|
|
2003
|
-
isReadonly,
|
|
2004
|
-
isAdvanced,
|
|
2005
|
-
noBulkSupport
|
|
2006
|
-
});
|
|
2007
|
-
}
|
|
2008
|
-
persistValues(ctx) {
|
|
2009
|
-
if (!super.persistValues(ctx))
|
|
2010
|
-
return false;
|
|
2011
|
-
if (this.valueSize > 0) {
|
|
2012
|
-
const baseInfo = {
|
|
2013
|
-
type: "number",
|
|
2014
|
-
format: this.valueFormat,
|
|
2015
|
-
valueSize: this.valueSize,
|
|
2016
|
-
requiresReInclusion: this.altersCapabilities,
|
|
2017
|
-
readable: true,
|
|
2018
|
-
writeable: !this.isReadonly,
|
|
2019
|
-
allowManualEntry: true,
|
|
2020
|
-
isAdvanced: this.isAdvanced,
|
|
2021
|
-
noBulkSupport: this.noBulkSupport,
|
|
2022
|
-
isFromConfig: false
|
|
2023
|
-
};
|
|
2024
|
-
if (this.valueFormat !== import_safe.ConfigValueFormat.BitField) {
|
|
2025
|
-
if (!this.paramExistsInConfigFile(ctx, this.parameter)) {
|
|
2026
|
-
const paramInfo = (0, import_safe.stripUndefined)({
|
|
2027
|
-
...baseInfo,
|
|
2028
|
-
min: this.minValue,
|
|
2029
|
-
max: this.maxValue,
|
|
2030
|
-
default: this.defaultValue
|
|
2031
|
-
});
|
|
2032
|
-
this.extendParamInformation(ctx, this.parameter, void 0, paramInfo);
|
|
2033
|
-
}
|
|
2034
|
-
} else {
|
|
2035
|
-
const bits = this.maxValue;
|
|
2036
|
-
let mask = 1;
|
|
2037
|
-
while (mask <= bits) {
|
|
2038
|
-
if (
|
|
2039
|
-
// Only create partials that exist
|
|
2040
|
-
!!(mask & bits) && !this.paramExistsInConfigFile(ctx, this.parameter, mask)
|
|
2041
|
-
) {
|
|
2227
|
+
persistValues(ctx) {
|
|
2228
|
+
if (!super.persistValues(ctx))
|
|
2229
|
+
return false;
|
|
2230
|
+
if (this.valueSize > 0) {
|
|
2231
|
+
const baseInfo = {
|
|
2232
|
+
type: "number",
|
|
2233
|
+
format: this.valueFormat,
|
|
2234
|
+
valueSize: this.valueSize,
|
|
2235
|
+
requiresReInclusion: this.altersCapabilities,
|
|
2236
|
+
readable: true,
|
|
2237
|
+
writeable: !this.isReadonly,
|
|
2238
|
+
allowManualEntry: true,
|
|
2239
|
+
isAdvanced: this.isAdvanced,
|
|
2240
|
+
noBulkSupport: this.noBulkSupport,
|
|
2241
|
+
isFromConfig: false
|
|
2242
|
+
};
|
|
2243
|
+
if (this.valueFormat !== import_safe.ConfigValueFormat.BitField) {
|
|
2244
|
+
if (!this.paramExistsInConfigFile(ctx, this.parameter)) {
|
|
2042
2245
|
const paramInfo = (0, import_safe.stripUndefined)({
|
|
2043
2246
|
...baseInfo,
|
|
2044
|
-
min:
|
|
2045
|
-
max:
|
|
2046
|
-
default: this.defaultValue
|
|
2247
|
+
min: this.minValue,
|
|
2248
|
+
max: this.maxValue,
|
|
2249
|
+
default: this.defaultValue
|
|
2047
2250
|
});
|
|
2048
|
-
this.extendParamInformation(ctx, this.parameter,
|
|
2251
|
+
this.extendParamInformation(ctx, this.parameter, void 0, paramInfo);
|
|
2252
|
+
}
|
|
2253
|
+
} else {
|
|
2254
|
+
const bits = this.maxValue;
|
|
2255
|
+
let mask = 1;
|
|
2256
|
+
while (mask <= bits) {
|
|
2257
|
+
if (
|
|
2258
|
+
// Only create partials that exist
|
|
2259
|
+
!!(mask & bits) && !this.paramExistsInConfigFile(ctx, this.parameter, mask)
|
|
2260
|
+
) {
|
|
2261
|
+
const paramInfo = (0, import_safe.stripUndefined)({
|
|
2262
|
+
...baseInfo,
|
|
2263
|
+
min: 0,
|
|
2264
|
+
max: 1,
|
|
2265
|
+
default: this.defaultValue & mask ? 1 : 0
|
|
2266
|
+
});
|
|
2267
|
+
this.extendParamInformation(ctx, this.parameter, mask, paramInfo);
|
|
2268
|
+
}
|
|
2269
|
+
mask *= 2;
|
|
2049
2270
|
}
|
|
2050
|
-
mask *= 2;
|
|
2051
2271
|
}
|
|
2052
2272
|
}
|
|
2273
|
+
return true;
|
|
2053
2274
|
}
|
|
2054
|
-
|
|
2055
|
-
|
|
2056
|
-
|
|
2057
|
-
|
|
2058
|
-
|
|
2059
|
-
|
|
2060
|
-
|
|
2061
|
-
|
|
2062
|
-
|
|
2063
|
-
|
|
2064
|
-
|
|
2065
|
-
|
|
2066
|
-
|
|
2067
|
-
|
|
2068
|
-
|
|
2069
|
-
|
|
2070
|
-
|
|
2071
|
-
|
|
2072
|
-
|
|
2073
|
-
|
|
2074
|
-
|
|
2075
|
-
|
|
2076
|
-
|
|
2077
|
-
|
|
2078
|
-
|
|
2079
|
-
|
|
2080
|
-
|
|
2081
|
-
|
|
2082
|
-
|
|
2083
|
-
|
|
2084
|
-
|
|
2085
|
-
|
|
2086
|
-
|
|
2087
|
-
|
|
2088
|
-
|
|
2089
|
-
|
|
2090
|
-
|
|
2091
|
-
|
|
2092
|
-
|
|
2093
|
-
|
|
2094
|
-
|
|
2095
|
-
|
|
2096
|
-
|
|
2097
|
-
|
|
2098
|
-
|
|
2099
|
-
|
|
2100
|
-
|
|
2101
|
-
|
|
2102
|
-
|
|
2103
|
-
|
|
2104
|
-
|
|
2275
|
+
parameter;
|
|
2276
|
+
valueSize;
|
|
2277
|
+
valueFormat;
|
|
2278
|
+
minValue;
|
|
2279
|
+
maxValue;
|
|
2280
|
+
defaultValue;
|
|
2281
|
+
nextParameter;
|
|
2282
|
+
altersCapabilities;
|
|
2283
|
+
isReadonly;
|
|
2284
|
+
isAdvanced;
|
|
2285
|
+
noBulkSupport;
|
|
2286
|
+
serialize(ctx) {
|
|
2287
|
+
this.payload = new import_safe2.Bytes(3 + 3 * this.valueSize + 2 + 1);
|
|
2288
|
+
this.payload.writeUInt16BE(this.parameter, 0);
|
|
2289
|
+
const options1 = (this.altersCapabilities ? 128 : 0) | (this.isReadonly ? 64 : 0) | (this.valueFormat & 7) << 3 | this.valueSize & 7;
|
|
2290
|
+
this.payload[2] = options1;
|
|
2291
|
+
let offset = 3;
|
|
2292
|
+
if (this.valueSize > 0) {
|
|
2293
|
+
serializeValue(this.payload, offset, this.valueSize, this.valueFormat, this.minValue);
|
|
2294
|
+
offset += this.valueSize;
|
|
2295
|
+
serializeValue(this.payload, offset, this.valueSize, this.valueFormat, this.maxValue);
|
|
2296
|
+
offset += this.valueSize;
|
|
2297
|
+
serializeValue(this.payload, offset, this.valueSize, this.valueFormat, this.defaultValue);
|
|
2298
|
+
offset += this.valueSize;
|
|
2299
|
+
}
|
|
2300
|
+
this.payload.writeUInt16BE(this.nextParameter, offset);
|
|
2301
|
+
offset += 2;
|
|
2302
|
+
const options2 = (this.isAdvanced ? 1 : 0) | (this.noBulkSupport ? 2 : 0);
|
|
2303
|
+
this.payload[offset] = options2;
|
|
2304
|
+
return super.serialize(ctx);
|
|
2305
|
+
}
|
|
2306
|
+
toLogEntry(ctx) {
|
|
2307
|
+
const message = {
|
|
2308
|
+
"parameter #": this.parameter,
|
|
2309
|
+
"next param #": this.nextParameter,
|
|
2310
|
+
"value size": this.valueSize,
|
|
2311
|
+
"value format": (0, import_safe3.getEnumMemberName)(import_safe.ConfigValueFormat, this.valueFormat)
|
|
2312
|
+
};
|
|
2313
|
+
if (this.minValue != void 0) {
|
|
2314
|
+
message["min value"] = configValueToString(this.minValue);
|
|
2315
|
+
}
|
|
2316
|
+
if (this.maxValue != void 0) {
|
|
2317
|
+
message["max value"] = configValueToString(this.maxValue);
|
|
2318
|
+
}
|
|
2319
|
+
if (this.defaultValue != void 0) {
|
|
2320
|
+
message["default value"] = configValueToString(this.defaultValue);
|
|
2321
|
+
}
|
|
2322
|
+
if (this.altersCapabilities != void 0) {
|
|
2323
|
+
message["alters capabilities"] = this.altersCapabilities;
|
|
2324
|
+
}
|
|
2325
|
+
if (this.isReadonly != void 0) {
|
|
2326
|
+
message.readonly = this.isReadonly;
|
|
2327
|
+
}
|
|
2328
|
+
if (this.isAdvanced != void 0) {
|
|
2329
|
+
message.advanced = this.isAdvanced;
|
|
2330
|
+
}
|
|
2331
|
+
if (this.noBulkSupport != void 0) {
|
|
2332
|
+
message["bulk support"] = !this.noBulkSupport;
|
|
2333
|
+
}
|
|
2334
|
+
return {
|
|
2335
|
+
...super.toLogEntry(ctx),
|
|
2336
|
+
message
|
|
2337
|
+
};
|
|
2105
2338
|
}
|
|
2106
|
-
|
|
2107
|
-
|
|
2339
|
+
};
|
|
2340
|
+
return ConfigurationCCPropertiesReport2 = _classThis;
|
|
2341
|
+
})();
|
|
2342
|
+
let ConfigurationCCPropertiesGet = (() => {
|
|
2343
|
+
let _classDecorators = [(0, import_CommandClassDecorators.CCCommand)(import_Types.ConfigurationCommand.PropertiesGet), (0, import_CommandClassDecorators.expectedCCResponse)(ConfigurationCCPropertiesReport)];
|
|
2344
|
+
let _classDescriptor;
|
|
2345
|
+
let _classExtraInitializers = [];
|
|
2346
|
+
let _classThis;
|
|
2347
|
+
let _classSuper = ConfigurationCC;
|
|
2348
|
+
var ConfigurationCCPropertiesGet2 = class extends _classSuper {
|
|
2349
|
+
static {
|
|
2350
|
+
_classThis = this;
|
|
2351
|
+
}
|
|
2352
|
+
static {
|
|
2353
|
+
const _metadata = typeof Symbol === "function" && Symbol.metadata ? Object.create(_classSuper[Symbol.metadata] ?? null) : void 0;
|
|
2354
|
+
__esDecorate(null, _classDescriptor = { value: _classThis }, _classDecorators, { kind: "class", name: _classThis.name, metadata: _metadata }, null, _classExtraInitializers);
|
|
2355
|
+
ConfigurationCCPropertiesGet2 = _classThis = _classDescriptor.value;
|
|
2356
|
+
if (_metadata) Object.defineProperty(_classThis, Symbol.metadata, { enumerable: true, configurable: true, writable: true, value: _metadata });
|
|
2357
|
+
__runInitializers(_classThis, _classExtraInitializers);
|
|
2358
|
+
}
|
|
2359
|
+
constructor(options) {
|
|
2360
|
+
super(options);
|
|
2361
|
+
this.parameter = options.parameter;
|
|
2362
|
+
}
|
|
2363
|
+
static from(raw, ctx) {
|
|
2364
|
+
(0, import_safe.validatePayload)(raw.payload.length >= 2);
|
|
2365
|
+
const parameter = raw.payload.readUInt16BE(0);
|
|
2366
|
+
return new this({
|
|
2367
|
+
nodeId: ctx.sourceNodeId,
|
|
2368
|
+
parameter
|
|
2369
|
+
});
|
|
2108
2370
|
}
|
|
2109
|
-
|
|
2110
|
-
|
|
2371
|
+
parameter;
|
|
2372
|
+
serialize(ctx) {
|
|
2373
|
+
this.payload = new import_safe2.Bytes(2);
|
|
2374
|
+
this.payload.writeUInt16BE(this.parameter, 0);
|
|
2375
|
+
return super.serialize(ctx);
|
|
2111
2376
|
}
|
|
2112
|
-
|
|
2113
|
-
|
|
2377
|
+
toLogEntry(ctx) {
|
|
2378
|
+
return {
|
|
2379
|
+
...super.toLogEntry(ctx),
|
|
2380
|
+
message: { "parameter #": this.parameter }
|
|
2381
|
+
};
|
|
2114
2382
|
}
|
|
2115
|
-
|
|
2116
|
-
|
|
2117
|
-
|
|
2118
|
-
|
|
2119
|
-
|
|
2120
|
-
|
|
2121
|
-
|
|
2122
|
-
|
|
2123
|
-
|
|
2124
|
-
|
|
2125
|
-
|
|
2126
|
-
|
|
2127
|
-
|
|
2128
|
-
|
|
2129
|
-
|
|
2130
|
-
|
|
2131
|
-
|
|
2132
|
-
|
|
2133
|
-
|
|
2134
|
-
|
|
2135
|
-
|
|
2136
|
-
|
|
2137
|
-
|
|
2138
|
-
serialize(ctx) {
|
|
2139
|
-
this.payload = new import_safe2.Bytes(2);
|
|
2140
|
-
this.payload.writeUInt16BE(this.parameter, 0);
|
|
2141
|
-
return super.serialize(ctx);
|
|
2142
|
-
}
|
|
2143
|
-
toLogEntry(ctx) {
|
|
2144
|
-
return {
|
|
2145
|
-
...super.toLogEntry(ctx),
|
|
2146
|
-
message: { "parameter #": this.parameter }
|
|
2147
|
-
};
|
|
2148
|
-
}
|
|
2149
|
-
};
|
|
2150
|
-
ConfigurationCCPropertiesGet = ConfigurationCCPropertiesGet_1 = __decorate([
|
|
2151
|
-
(0, import_CommandClassDecorators.CCCommand)(import_Types.ConfigurationCommand.PropertiesGet),
|
|
2152
|
-
(0, import_CommandClassDecorators.expectedCCResponse)(ConfigurationCCPropertiesReport)
|
|
2153
|
-
], ConfigurationCCPropertiesGet);
|
|
2154
|
-
let ConfigurationCCDefaultReset = class ConfigurationCCDefaultReset2 extends ConfigurationCC {
|
|
2155
|
-
};
|
|
2156
|
-
ConfigurationCCDefaultReset = __decorate([
|
|
2157
|
-
(0, import_CommandClassDecorators.CCCommand)(import_Types.ConfigurationCommand.DefaultReset)
|
|
2158
|
-
], ConfigurationCCDefaultReset);
|
|
2383
|
+
};
|
|
2384
|
+
return ConfigurationCCPropertiesGet2 = _classThis;
|
|
2385
|
+
})();
|
|
2386
|
+
let ConfigurationCCDefaultReset = (() => {
|
|
2387
|
+
let _classDecorators = [(0, import_CommandClassDecorators.CCCommand)(import_Types.ConfigurationCommand.DefaultReset)];
|
|
2388
|
+
let _classDescriptor;
|
|
2389
|
+
let _classExtraInitializers = [];
|
|
2390
|
+
let _classThis;
|
|
2391
|
+
let _classSuper = ConfigurationCC;
|
|
2392
|
+
var ConfigurationCCDefaultReset2 = class extends _classSuper {
|
|
2393
|
+
static {
|
|
2394
|
+
_classThis = this;
|
|
2395
|
+
}
|
|
2396
|
+
static {
|
|
2397
|
+
const _metadata = typeof Symbol === "function" && Symbol.metadata ? Object.create(_classSuper[Symbol.metadata] ?? null) : void 0;
|
|
2398
|
+
__esDecorate(null, _classDescriptor = { value: _classThis }, _classDecorators, { kind: "class", name: _classThis.name, metadata: _metadata }, null, _classExtraInitializers);
|
|
2399
|
+
ConfigurationCCDefaultReset2 = _classThis = _classDescriptor.value;
|
|
2400
|
+
if (_metadata) Object.defineProperty(_classThis, Symbol.metadata, { enumerable: true, configurable: true, writable: true, value: _metadata });
|
|
2401
|
+
__runInitializers(_classThis, _classExtraInitializers);
|
|
2402
|
+
}
|
|
2403
|
+
};
|
|
2404
|
+
return ConfigurationCCDefaultReset2 = _classThis;
|
|
2405
|
+
})();
|
|
2159
2406
|
function isSafeValue(value, size, format) {
|
|
2160
2407
|
let minValue;
|
|
2161
2408
|
let maxValue;
|