@zwave-js/cc 14.0.0-beta.4 → 14.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/build/cjs/cc/AlarmSensorCC.js +381 -266
- package/build/cjs/cc/AlarmSensorCC.js.map +3 -3
- package/build/cjs/cc/AssociationCC.js +669 -503
- package/build/cjs/cc/AssociationCC.js.map +3 -3
- package/build/cjs/cc/AssociationGroupInfoCC.js +633 -492
- package/build/cjs/cc/AssociationGroupInfoCC.js.map +3 -3
- package/build/cjs/cc/BarrierOperatorCC.js +595 -429
- package/build/cjs/cc/BarrierOperatorCC.js.map +3 -3
- package/build/cjs/cc/BasicCC.js +354 -260
- package/build/cjs/cc/BasicCC.js.map +3 -3
- package/build/cjs/cc/BatteryCC.js +427 -345
- package/build/cjs/cc/BatteryCC.js.map +3 -3
- package/build/cjs/cc/BinarySensorCC.js +391 -276
- package/build/cjs/cc/BinarySensorCC.js.map +3 -3
- package/build/cjs/cc/BinarySwitchCC.js +347 -253
- package/build/cjs/cc/BinarySwitchCC.js.map +3 -3
- package/build/cjs/cc/CRC16CC.js +160 -85
- package/build/cjs/cc/CRC16CC.js.map +3 -3
- package/build/cjs/cc/CentralSceneCC.js +459 -324
- package/build/cjs/cc/CentralSceneCC.js.map +3 -3
- package/build/cjs/cc/ClimateControlScheduleCC.js +459 -293
- package/build/cjs/cc/ClimateControlScheduleCC.js.map +3 -3
- package/build/cjs/cc/ClockCC.js +254 -150
- package/build/cjs/cc/ClockCC.js.map +3 -3
- package/build/cjs/cc/ColorSwitchCC.js +758 -610
- package/build/cjs/cc/ColorSwitchCC.js.map +3 -3
- package/build/cjs/cc/ConfigurationCC.js +1700 -1453
- package/build/cjs/cc/ConfigurationCC.js.map +3 -3
- package/build/cjs/cc/DeviceResetLocallyCC.js +125 -49
- package/build/cjs/cc/DeviceResetLocallyCC.js.map +3 -3
- package/build/cjs/cc/DoorLockCC.js +904 -777
- package/build/cjs/cc/DoorLockCC.js.map +3 -3
- package/build/cjs/cc/DoorLockLoggingCC.js +321 -206
- package/build/cjs/cc/DoorLockLoggingCC.js.map +3 -3
- package/build/cjs/cc/EnergyProductionCC.js +249 -160
- package/build/cjs/cc/EnergyProductionCC.js.map +3 -3
- package/build/cjs/cc/EntryControlCC.js +619 -458
- package/build/cjs/cc/EntryControlCC.js.map +3 -3
- package/build/cjs/cc/FirmwareUpdateMetaDataCC.js +898 -698
- package/build/cjs/cc/FirmwareUpdateMetaDataCC.js.map +3 -3
- package/build/cjs/cc/HailCC.js +57 -11
- package/build/cjs/cc/HailCC.js.map +2 -2
- package/build/cjs/cc/HumidityControlModeCC.js +359 -233
- package/build/cjs/cc/HumidityControlModeCC.js.map +3 -3
- package/build/cjs/cc/HumidityControlOperatingStateCC.js +189 -103
- package/build/cjs/cc/HumidityControlOperatingStateCC.js.map +3 -3
- package/build/cjs/cc/HumidityControlSetpointCC.js +682 -495
- package/build/cjs/cc/HumidityControlSetpointCC.js.map +3 -3
- package/build/cjs/cc/InclusionControllerCC.js +205 -114
- package/build/cjs/cc/InclusionControllerCC.js.map +3 -3
- package/build/cjs/cc/IndicatorCC.js +897 -736
- package/build/cjs/cc/IndicatorCC.js.map +3 -3
- package/build/cjs/cc/IrrigationCC.js +1651 -1405
- package/build/cjs/cc/IrrigationCC.js.map +3 -3
- package/build/cjs/cc/LanguageCC.js +268 -171
- package/build/cjs/cc/LanguageCC.js.map +3 -3
- package/build/cjs/cc/LockCC.js +254 -154
- package/build/cjs/cc/LockCC.js.map +3 -3
- package/build/cjs/cc/ManufacturerProprietaryCC.js +189 -129
- package/build/cjs/cc/ManufacturerProprietaryCC.js.map +2 -2
- package/build/cjs/cc/ManufacturerSpecificCC.js +319 -213
- package/build/cjs/cc/ManufacturerSpecificCC.js.map +3 -3
- package/build/cjs/cc/MeterCC.js +827 -707
- package/build/cjs/cc/MeterCC.js.map +3 -3
- package/build/cjs/cc/MultiChannelAssociationCC.js +612 -478
- package/build/cjs/cc/MultiChannelAssociationCC.js.map +3 -3
- package/build/cjs/cc/MultiChannelCC.js +1037 -819
- package/build/cjs/cc/MultiChannelCC.js.map +3 -3
- package/build/cjs/cc/MultiCommandCC.js +172 -97
- package/build/cjs/cc/MultiCommandCC.js.map +3 -3
- package/build/cjs/cc/MultilevelSensorCC.js +589 -449
- package/build/cjs/cc/MultilevelSensorCC.js.map +3 -3
- package/build/cjs/cc/MultilevelSwitchCC.js +587 -439
- package/build/cjs/cc/MultilevelSwitchCC.js.map +3 -3
- package/build/cjs/cc/NoOperationCC.js +89 -27
- package/build/cjs/cc/NoOperationCC.js.map +2 -2
- package/build/cjs/cc/NodeNamingCC.js +417 -277
- package/build/cjs/cc/NodeNamingCC.js.map +3 -3
- package/build/cjs/cc/NotificationCC.js +972 -818
- package/build/cjs/cc/NotificationCC.js.map +3 -3
- package/build/cjs/cc/PowerlevelCC.js +450 -303
- package/build/cjs/cc/PowerlevelCC.js.map +3 -3
- package/build/cjs/cc/ProtectionCC.js +686 -494
- package/build/cjs/cc/ProtectionCC.js.map +3 -3
- package/build/cjs/cc/SceneActivationCC.js +165 -97
- package/build/cjs/cc/SceneActivationCC.js.map +3 -3
- package/build/cjs/cc/SceneActuatorConfigurationCC.js +346 -243
- package/build/cjs/cc/SceneActuatorConfigurationCC.js.map +3 -3
- package/build/cjs/cc/SceneControllerConfigurationCC.js +401 -298
- package/build/cjs/cc/SceneControllerConfigurationCC.js.map +3 -3
- package/build/cjs/cc/ScheduleEntryLockCC.js +1552 -1272
- package/build/cjs/cc/ScheduleEntryLockCC.js.map +3 -3
- package/build/cjs/cc/Security2CC.js +1483 -1219
- package/build/cjs/cc/Security2CC.js.map +3 -3
- package/build/cjs/cc/SecurityCC.js +839 -619
- package/build/cjs/cc/SecurityCC.js.map +3 -3
- package/build/cjs/cc/SoundSwitchCC.js +707 -515
- package/build/cjs/cc/SoundSwitchCC.js.map +3 -3
- package/build/cjs/cc/SupervisionCC.js +327 -237
- package/build/cjs/cc/SupervisionCC.js.map +3 -3
- package/build/cjs/cc/ThermostatFanModeCC.js +386 -263
- package/build/cjs/cc/ThermostatFanModeCC.js.map +3 -3
- package/build/cjs/cc/ThermostatFanStateCC.js +192 -106
- package/build/cjs/cc/ThermostatFanStateCC.js.map +3 -3
- package/build/cjs/cc/ThermostatModeCC.js +425 -302
- package/build/cjs/cc/ThermostatModeCC.js.map +3 -3
- package/build/cjs/cc/ThermostatOperatingStateCC.js +188 -102
- package/build/cjs/cc/ThermostatOperatingStateCC.js.map +3 -3
- package/build/cjs/cc/ThermostatSetbackCC.js +277 -173
- package/build/cjs/cc/ThermostatSetbackCC.js.map +3 -3
- package/build/cjs/cc/ThermostatSetpointCC.js +645 -491
- package/build/cjs/cc/ThermostatSetpointCC.js.map +3 -3
- package/build/cjs/cc/TimeCC.js +515 -353
- package/build/cjs/cc/TimeCC.js.map +3 -3
- package/build/cjs/cc/TimeParametersCC.js +302 -202
- package/build/cjs/cc/TimeParametersCC.js.map +3 -3
- package/build/cjs/cc/TransportServiceCC.js +433 -315
- package/build/cjs/cc/TransportServiceCC.js.map +3 -3
- package/build/cjs/cc/UserCodeCC.js +1385 -1102
- package/build/cjs/cc/UserCodeCC.js.map +3 -3
- package/build/cjs/cc/VersionCC.js +696 -562
- package/build/cjs/cc/VersionCC.js.map +3 -3
- package/build/cjs/cc/WakeUpCC.js +499 -346
- package/build/cjs/cc/WakeUpCC.js.map +3 -3
- package/build/cjs/cc/WindowCoveringCC.js +626 -478
- package/build/cjs/cc/WindowCoveringCC.js.map +3 -3
- package/build/cjs/cc/ZWaveLongRangeCC.js +57 -10
- package/build/cjs/cc/ZWaveLongRangeCC.js.map +2 -2
- package/build/cjs/cc/ZWavePlusCC.js +233 -159
- package/build/cjs/cc/ZWavePlusCC.js.map +3 -3
- package/build/cjs/cc/ZWaveProtocolCC.js +1515 -948
- package/build/cjs/cc/ZWaveProtocolCC.js.map +3 -3
- package/build/cjs/cc/manufacturerProprietary/Decorators.d.ts +4 -4
- package/build/cjs/cc/manufacturerProprietary/Decorators.js.map +1 -1
- package/build/cjs/cc/manufacturerProprietary/FibaroCC.js +395 -274
- package/build/cjs/cc/manufacturerProprietary/FibaroCC.js.map +3 -3
- package/build/cjs/lib/CommandClassDecorators.d.ts +11 -15
- package/build/cjs/lib/CommandClassDecorators.js +19 -20
- package/build/cjs/lib/CommandClassDecorators.js.map +2 -2
- package/build/cjs/lib/Security2/Extension.d.ts +1 -1
- package/build/cjs/lib/Security2/Extension.js +217 -126
- package/build/cjs/lib/Security2/Extension.js.map +3 -3
- package/build/esm/cc/AlarmSensorCC.d.ts.map +1 -1
- package/build/esm/cc/AlarmSensorCC.js +389 -291
- package/build/esm/cc/AlarmSensorCC.js.map +1 -1
- package/build/esm/cc/AssociationCC.d.ts.map +1 -1
- package/build/esm/cc/AssociationCC.js +678 -537
- package/build/esm/cc/AssociationCC.js.map +1 -1
- package/build/esm/cc/AssociationGroupInfoCC.d.ts.map +1 -1
- package/build/esm/cc/AssociationGroupInfoCC.js +659 -539
- package/build/esm/cc/AssociationGroupInfoCC.js.map +1 -1
- package/build/esm/cc/BarrierOperatorCC.d.ts.map +1 -1
- package/build/esm/cc/BarrierOperatorCC.js +634 -493
- package/build/esm/cc/BarrierOperatorCC.js.map +1 -1
- package/build/esm/cc/BasicCC.d.ts.map +1 -1
- package/build/esm/cc/BasicCC.js +380 -302
- package/build/esm/cc/BasicCC.js.map +1 -1
- package/build/esm/cc/BatteryCC.d.ts.map +1 -1
- package/build/esm/cc/BatteryCC.js +449 -384
- package/build/esm/cc/BatteryCC.js.map +1 -1
- package/build/esm/cc/BinarySensorCC.d.ts.map +1 -1
- package/build/esm/cc/BinarySensorCC.js +395 -297
- package/build/esm/cc/BinarySensorCC.js.map +1 -1
- package/build/esm/cc/BinarySwitchCC.d.ts.map +1 -1
- package/build/esm/cc/BinarySwitchCC.js +353 -274
- package/build/esm/cc/BinarySwitchCC.js.map +1 -1
- package/build/esm/cc/CRC16CC.js +162 -98
- package/build/esm/cc/CRC16CC.js.map +1 -1
- package/build/esm/cc/CentralSceneCC.d.ts.map +1 -1
- package/build/esm/cc/CentralSceneCC.js +465 -351
- package/build/esm/cc/CentralSceneCC.js.map +1 -1
- package/build/esm/cc/ClimateControlScheduleCC.d.ts.map +1 -1
- package/build/esm/cc/ClimateControlScheduleCC.js +454 -313
- package/build/esm/cc/ClimateControlScheduleCC.js.map +1 -1
- package/build/esm/cc/ClockCC.js +248 -159
- package/build/esm/cc/ClockCC.js.map +1 -1
- package/build/esm/cc/ColorSwitchCC.d.ts.map +1 -1
- package/build/esm/cc/ColorSwitchCC.js +802 -677
- package/build/esm/cc/ColorSwitchCC.js.map +1 -1
- package/build/esm/cc/ConfigurationCC.js +1899 -1687
- package/build/esm/cc/ConfigurationCC.js.map +1 -1
- package/build/esm/cc/DeviceResetLocallyCC.js +124 -59
- package/build/esm/cc/DeviceResetLocallyCC.js.map +1 -1
- package/build/esm/cc/DoorLockCC.d.ts.map +1 -1
- package/build/esm/cc/DoorLockCC.js +951 -849
- package/build/esm/cc/DoorLockCC.js.map +1 -1
- package/build/esm/cc/DoorLockLoggingCC.d.ts.map +1 -1
- package/build/esm/cc/DoorLockLoggingCC.js +316 -218
- package/build/esm/cc/DoorLockLoggingCC.js.map +1 -1
- package/build/esm/cc/EnergyProductionCC.js +240 -164
- package/build/esm/cc/EnergyProductionCC.js.map +1 -1
- package/build/esm/cc/EntryControlCC.d.ts.map +1 -1
- package/build/esm/cc/EntryControlCC.js +629 -493
- package/build/esm/cc/EntryControlCC.js.map +1 -1
- package/build/esm/cc/FirmwareUpdateMetaDataCC.d.ts.map +1 -1
- package/build/esm/cc/FirmwareUpdateMetaDataCC.js +938 -769
- package/build/esm/cc/FirmwareUpdateMetaDataCC.js.map +1 -1
- package/build/esm/cc/HailCC.js +51 -12
- package/build/esm/cc/HailCC.js.map +1 -1
- package/build/esm/cc/HumidityControlModeCC.d.ts.map +1 -1
- package/build/esm/cc/HumidityControlModeCC.js +357 -250
- package/build/esm/cc/HumidityControlModeCC.js.map +1 -1
- package/build/esm/cc/HumidityControlOperatingStateCC.d.ts.map +1 -1
- package/build/esm/cc/HumidityControlOperatingStateCC.js +182 -109
- package/build/esm/cc/HumidityControlOperatingStateCC.js.map +1 -1
- package/build/esm/cc/HumidityControlSetpointCC.d.ts.map +1 -1
- package/build/esm/cc/HumidityControlSetpointCC.js +706 -546
- package/build/esm/cc/HumidityControlSetpointCC.js.map +1 -1
- package/build/esm/cc/InclusionControllerCC.js +197 -119
- package/build/esm/cc/InclusionControllerCC.js.map +1 -1
- package/build/esm/cc/IndicatorCC.js +973 -835
- package/build/esm/cc/IndicatorCC.js.map +1 -1
- package/build/esm/cc/IrrigationCC.d.ts.map +1 -1
- package/build/esm/cc/IrrigationCC.js +1697 -1496
- package/build/esm/cc/IrrigationCC.js.map +1 -1
- package/build/esm/cc/LanguageCC.d.ts.map +1 -1
- package/build/esm/cc/LanguageCC.js +266 -184
- package/build/esm/cc/LanguageCC.js.map +1 -1
- package/build/esm/cc/LockCC.d.ts.map +1 -1
- package/build/esm/cc/LockCC.js +247 -162
- package/build/esm/cc/LockCC.js.map +1 -1
- package/build/esm/cc/ManufacturerProprietaryCC.js +192 -141
- package/build/esm/cc/ManufacturerProprietaryCC.js.map +1 -1
- package/build/esm/cc/ManufacturerSpecificCC.d.ts.map +1 -1
- package/build/esm/cc/ManufacturerSpecificCC.js +312 -223
- package/build/esm/cc/ManufacturerSpecificCC.js.map +1 -1
- package/build/esm/cc/MeterCC.d.ts.map +1 -1
- package/build/esm/cc/MeterCC.js +896 -795
- package/build/esm/cc/MeterCC.js.map +1 -1
- package/build/esm/cc/MultiChannelAssociationCC.d.ts.map +1 -1
- package/build/esm/cc/MultiChannelAssociationCC.js +631 -518
- package/build/esm/cc/MultiChannelAssociationCC.js.map +1 -1
- package/build/esm/cc/MultiChannelCC.d.ts.map +1 -1
- package/build/esm/cc/MultiChannelCC.js +1106 -921
- package/build/esm/cc/MultiChannelCC.js.map +1 -1
- package/build/esm/cc/MultiCommandCC.js +166 -102
- package/build/esm/cc/MultiCommandCC.js.map +1 -1
- package/build/esm/cc/MultilevelSensorCC.d.ts.map +1 -1
- package/build/esm/cc/MultilevelSensorCC.js +616 -497
- package/build/esm/cc/MultilevelSensorCC.js.map +1 -1
- package/build/esm/cc/MultilevelSwitchCC.d.ts.map +1 -1
- package/build/esm/cc/MultilevelSwitchCC.js +621 -496
- package/build/esm/cc/MultilevelSwitchCC.js.map +1 -1
- package/build/esm/cc/NoOperationCC.js +82 -29
- package/build/esm/cc/NoOperationCC.js.map +1 -1
- package/build/esm/cc/NodeNamingCC.d.ts.map +1 -1
- package/build/esm/cc/NodeNamingCC.js +413 -294
- package/build/esm/cc/NodeNamingCC.js.map +1 -1
- package/build/esm/cc/NotificationCC.d.ts.map +1 -1
- package/build/esm/cc/NotificationCC.js +1097 -966
- package/build/esm/cc/NotificationCC.js.map +1 -1
- package/build/esm/cc/PowerlevelCC.js +437 -311
- package/build/esm/cc/PowerlevelCC.js.map +1 -1
- package/build/esm/cc/ProtectionCC.d.ts.map +1 -1
- package/build/esm/cc/ProtectionCC.js +704 -543
- package/build/esm/cc/ProtectionCC.js.map +1 -1
- package/build/esm/cc/SceneActivationCC.d.ts.map +1 -1
- package/build/esm/cc/SceneActivationCC.js +157 -100
- package/build/esm/cc/SceneActivationCC.js.map +1 -1
- package/build/esm/cc/SceneActuatorConfigurationCC.js +357 -269
- package/build/esm/cc/SceneActuatorConfigurationCC.js.map +1 -1
- package/build/esm/cc/SceneControllerConfigurationCC.js +434 -346
- package/build/esm/cc/SceneControllerConfigurationCC.js.map +1 -1
- package/build/esm/cc/ScheduleEntryLockCC.d.ts.map +1 -1
- package/build/esm/cc/ScheduleEntryLockCC.js +1596 -1357
- package/build/esm/cc/ScheduleEntryLockCC.js.map +1 -1
- package/build/esm/cc/Security2CC.js +1633 -1406
- package/build/esm/cc/Security2CC.js.map +1 -1
- package/build/esm/cc/SecurityCC.js +876 -687
- package/build/esm/cc/SecurityCC.js.map +1 -1
- package/build/esm/cc/SoundSwitchCC.d.ts.map +1 -1
- package/build/esm/cc/SoundSwitchCC.js +689 -526
- package/build/esm/cc/SoundSwitchCC.js.map +1 -1
- package/build/esm/cc/SupervisionCC.js +349 -272
- package/build/esm/cc/SupervisionCC.js.map +1 -1
- package/build/esm/cc/ThermostatFanModeCC.d.ts.map +1 -1
- package/build/esm/cc/ThermostatFanModeCC.js +388 -284
- package/build/esm/cc/ThermostatFanModeCC.js.map +1 -1
- package/build/esm/cc/ThermostatFanStateCC.d.ts.map +1 -1
- package/build/esm/cc/ThermostatFanStateCC.js +184 -111
- package/build/esm/cc/ThermostatFanStateCC.js.map +1 -1
- package/build/esm/cc/ThermostatModeCC.d.ts.map +1 -1
- package/build/esm/cc/ThermostatModeCC.js +435 -331
- package/build/esm/cc/ThermostatModeCC.js.map +1 -1
- package/build/esm/cc/ThermostatOperatingStateCC.d.ts.map +1 -1
- package/build/esm/cc/ThermostatOperatingStateCC.js +180 -107
- package/build/esm/cc/ThermostatOperatingStateCC.js.map +1 -1
- package/build/esm/cc/ThermostatSetbackCC.js +274 -185
- package/build/esm/cc/ThermostatSetbackCC.js.map +1 -1
- package/build/esm/cc/ThermostatSetpointCC.d.ts.map +1 -1
- package/build/esm/cc/ThermostatSetpointCC.js +674 -543
- package/build/esm/cc/ThermostatSetpointCC.js.map +1 -1
- package/build/esm/cc/TimeCC.js +499 -360
- package/build/esm/cc/TimeCC.js.map +1 -1
- package/build/esm/cc/TimeParametersCC.d.ts.map +1 -1
- package/build/esm/cc/TimeParametersCC.js +296 -211
- package/build/esm/cc/TimeParametersCC.js.map +1 -1
- package/build/esm/cc/TransportServiceCC.js +464 -363
- package/build/esm/cc/TransportServiceCC.js.map +1 -1
- package/build/esm/cc/UserCodeCC.d.ts.map +1 -1
- package/build/esm/cc/UserCodeCC.js +1443 -1205
- package/build/esm/cc/UserCodeCC.js.map +1 -1
- package/build/esm/cc/VersionCC.d.ts.map +1 -1
- package/build/esm/cc/VersionCC.js +744 -635
- package/build/esm/cc/VersionCC.js.map +1 -1
- package/build/esm/cc/WakeUpCC.d.ts.map +1 -1
- package/build/esm/cc/WakeUpCC.js +494 -364
- package/build/esm/cc/WakeUpCC.js.map +1 -1
- package/build/esm/cc/WindowCoveringCC.d.ts.map +1 -1
- package/build/esm/cc/WindowCoveringCC.js +655 -530
- package/build/esm/cc/WindowCoveringCC.js.map +1 -1
- package/build/esm/cc/ZWaveLongRangeCC.js +51 -11
- package/build/esm/cc/ZWaveLongRangeCC.js.map +1 -1
- package/build/esm/cc/ZWavePlusCC.d.ts.map +1 -1
- package/build/esm/cc/ZWavePlusCC.js +223 -162
- package/build/esm/cc/ZWavePlusCC.js.map +1 -1
- package/build/esm/cc/ZWaveProtocolCC.js +1443 -953
- package/build/esm/cc/ZWaveProtocolCC.js.map +1 -1
- package/build/esm/cc/manufacturerProprietary/Decorators.d.ts +4 -4
- package/build/esm/cc/manufacturerProprietary/Decorators.d.ts.map +1 -1
- package/build/esm/cc/manufacturerProprietary/FibaroCC.js +390 -286
- package/build/esm/cc/manufacturerProprietary/FibaroCC.js.map +1 -1
- package/build/esm/lib/CommandClassDecorators.d.ts +11 -15
- package/build/esm/lib/CommandClassDecorators.d.ts.map +1 -1
- package/build/esm/lib/CommandClassDecorators.js +24 -24
- package/build/esm/lib/CommandClassDecorators.js.map +1 -1
- package/build/esm/lib/Security2/Extension.d.ts +1 -1
- package/build/esm/lib/Security2/Extension.d.ts.map +1 -1
- package/build/esm/lib/Security2/Extension.js +207 -123
- package/build/esm/lib/Security2/Extension.js.map +1 -1
- package/package.json +6 -6
|
@@ -50,13 +50,45 @@ var import_CommandClass = require("../lib/CommandClass.js");
|
|
|
50
50
|
var import_CommandClassDecorators = require("../lib/CommandClassDecorators.js");
|
|
51
51
|
var import_Values = require("../lib/Values.js");
|
|
52
52
|
var import_Types = require("../lib/_Types.js");
|
|
53
|
-
var
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
53
|
+
var __esDecorate = function(ctor, descriptorIn, decorators, contextIn, initializers, extraInitializers) {
|
|
54
|
+
function accept(f) {
|
|
55
|
+
if (f !== void 0 && typeof f !== "function") throw new TypeError("Function expected");
|
|
56
|
+
return f;
|
|
57
|
+
}
|
|
58
|
+
var kind = contextIn.kind, key = kind === "getter" ? "get" : kind === "setter" ? "set" : "value";
|
|
59
|
+
var target = !descriptorIn && ctor ? contextIn["static"] ? ctor : ctor.prototype : null;
|
|
60
|
+
var descriptor = descriptorIn || (target ? Object.getOwnPropertyDescriptor(target, contextIn.name) : {});
|
|
61
|
+
var _, done = false;
|
|
62
|
+
for (var i = decorators.length - 1; i >= 0; i--) {
|
|
63
|
+
var context = {};
|
|
64
|
+
for (var p in contextIn) context[p] = p === "access" ? {} : contextIn[p];
|
|
65
|
+
for (var p in contextIn.access) context.access[p] = contextIn.access[p];
|
|
66
|
+
context.addInitializer = function(f) {
|
|
67
|
+
if (done) throw new TypeError("Cannot add initializers after decoration has completed");
|
|
68
|
+
extraInitializers.push(accept(f || null));
|
|
69
|
+
};
|
|
70
|
+
var result = (0, decorators[i])(kind === "accessor" ? { get: descriptor.get, set: descriptor.set } : descriptor[key], context);
|
|
71
|
+
if (kind === "accessor") {
|
|
72
|
+
if (result === void 0) continue;
|
|
73
|
+
if (result === null || typeof result !== "object") throw new TypeError("Object expected");
|
|
74
|
+
if (_ = accept(result.get)) descriptor.get = _;
|
|
75
|
+
if (_ = accept(result.set)) descriptor.set = _;
|
|
76
|
+
if (_ = accept(result.init)) initializers.unshift(_);
|
|
77
|
+
} else if (_ = accept(result)) {
|
|
78
|
+
if (kind === "field") initializers.unshift(_);
|
|
79
|
+
else descriptor[key] = _;
|
|
80
|
+
}
|
|
81
|
+
}
|
|
82
|
+
if (target) Object.defineProperty(target, contextIn.name, descriptor);
|
|
83
|
+
done = true;
|
|
84
|
+
};
|
|
85
|
+
var __runInitializers = function(thisArg, initializers, value) {
|
|
86
|
+
var useValue = arguments.length > 2;
|
|
87
|
+
for (var i = 0; i < initializers.length; i++) {
|
|
88
|
+
value = useValue ? initializers[i].call(thisArg, value) : initializers[i].call(thisArg);
|
|
89
|
+
}
|
|
90
|
+
return useValue ? value : void 0;
|
|
58
91
|
};
|
|
59
|
-
var UserCodeCC_1, UserCodeCCSet_1, UserCodeCCReport_1, UserCodeCCGet_1, UserCodeCCUsersNumberReport_1, UserCodeCCCapabilitiesReport_1, UserCodeCCKeypadModeSet_1, UserCodeCCKeypadModeReport_1, UserCodeCCAdminCodeSet_1, UserCodeCCAdminCodeReport_1, UserCodeCCUserCodeChecksumReport_1, UserCodeCCExtendedUserCodeReport_1;
|
|
60
92
|
function __assertType(argName, typeName, boundHasError) {
|
|
61
93
|
const { ZWaveError: ZWaveError2, ZWaveErrorCodes: ZWaveErrorCodes2 } = require("@zwave-js/core");
|
|
62
94
|
if (boundHasError()) {
|
|
@@ -424,1174 +456,1425 @@ function userCodeToLogString(userCode) {
|
|
|
424
456
|
return "(empty)";
|
|
425
457
|
return "*".repeat(userCode.length);
|
|
426
458
|
}
|
|
427
|
-
let UserCodeCCAPI =
|
|
428
|
-
|
|
429
|
-
|
|
430
|
-
|
|
431
|
-
|
|
432
|
-
|
|
433
|
-
|
|
434
|
-
|
|
435
|
-
|
|
436
|
-
case import_Types.UserCodeCommand.KeypadModeSet:
|
|
437
|
-
case import_Types.UserCodeCommand.KeypadModeGet:
|
|
438
|
-
case import_Types.UserCodeCommand.ExtendedUserCodeSet:
|
|
439
|
-
case import_Types.UserCodeCommand.ExtendedUserCodeGet:
|
|
440
|
-
return this.version >= 2;
|
|
441
|
-
case import_Types.UserCodeCommand.AdminCodeSet:
|
|
442
|
-
case import_Types.UserCodeCommand.AdminCodeGet: {
|
|
443
|
-
if (this.version < 2)
|
|
444
|
-
return false;
|
|
445
|
-
return this.tryGetValueDB()?.getValue(UserCodeCCValues.supportsAdminCode.endpoint(this.endpoint.index));
|
|
446
|
-
}
|
|
447
|
-
case import_Types.UserCodeCommand.UserCodeChecksumGet: {
|
|
448
|
-
if (this.version < 2)
|
|
449
|
-
return false;
|
|
450
|
-
return this.tryGetValueDB()?.getValue(UserCodeCCValues.supportsUserCodeChecksum.endpoint(this.endpoint.index));
|
|
451
|
-
}
|
|
459
|
+
let UserCodeCCAPI = (() => {
|
|
460
|
+
let _classDecorators = [(0, import_CommandClassDecorators.API)(import_safe.CommandClasses["User Code"])];
|
|
461
|
+
let _classDescriptor;
|
|
462
|
+
let _classExtraInitializers = [];
|
|
463
|
+
let _classThis;
|
|
464
|
+
let _classSuper = import_API.PhysicalCCAPI;
|
|
465
|
+
var UserCodeCCAPI2 = class extends _classSuper {
|
|
466
|
+
static {
|
|
467
|
+
_classThis = this;
|
|
452
468
|
}
|
|
453
|
-
|
|
454
|
-
|
|
455
|
-
|
|
456
|
-
|
|
457
|
-
|
|
458
|
-
|
|
459
|
-
|
|
460
|
-
|
|
461
|
-
|
|
462
|
-
|
|
463
|
-
|
|
464
|
-
|
|
465
|
-
|
|
466
|
-
|
|
467
|
-
|
|
468
|
-
|
|
469
|
-
|
|
470
|
-
|
|
471
|
-
|
|
472
|
-
|
|
469
|
+
static {
|
|
470
|
+
const _metadata = typeof Symbol === "function" && Symbol.metadata ? Object.create(_classSuper[Symbol.metadata] ?? null) : void 0;
|
|
471
|
+
__esDecorate(null, _classDescriptor = { value: _classThis }, _classDecorators, { kind: "class", name: _classThis.name, metadata: _metadata }, null, _classExtraInitializers);
|
|
472
|
+
UserCodeCCAPI2 = _classThis = _classDescriptor.value;
|
|
473
|
+
if (_metadata) Object.defineProperty(_classThis, Symbol.metadata, { enumerable: true, configurable: true, writable: true, value: _metadata });
|
|
474
|
+
__runInitializers(_classThis, _classExtraInitializers);
|
|
475
|
+
}
|
|
476
|
+
supportsCommand(cmd) {
|
|
477
|
+
switch (cmd) {
|
|
478
|
+
case import_Types.UserCodeCommand.Get:
|
|
479
|
+
case import_Types.UserCodeCommand.Set:
|
|
480
|
+
case import_Types.UserCodeCommand.UsersNumberGet:
|
|
481
|
+
return true;
|
|
482
|
+
// This is mandatory
|
|
483
|
+
case import_Types.UserCodeCommand.CapabilitiesGet:
|
|
484
|
+
case import_Types.UserCodeCommand.KeypadModeSet:
|
|
485
|
+
case import_Types.UserCodeCommand.KeypadModeGet:
|
|
486
|
+
case import_Types.UserCodeCommand.ExtendedUserCodeSet:
|
|
487
|
+
case import_Types.UserCodeCommand.ExtendedUserCodeGet:
|
|
488
|
+
return this.version >= 2;
|
|
489
|
+
case import_Types.UserCodeCommand.AdminCodeSet:
|
|
490
|
+
case import_Types.UserCodeCommand.AdminCodeGet: {
|
|
491
|
+
if (this.version < 2)
|
|
492
|
+
return false;
|
|
493
|
+
return this.tryGetValueDB()?.getValue(UserCodeCCValues.supportsAdminCode.endpoint(this.endpoint.index));
|
|
473
494
|
}
|
|
474
|
-
|
|
475
|
-
|
|
495
|
+
case import_Types.UserCodeCommand.UserCodeChecksumGet: {
|
|
496
|
+
if (this.version < 2)
|
|
497
|
+
return false;
|
|
498
|
+
return this.tryGetValueDB()?.getValue(UserCodeCCValues.supportsUserCodeChecksum.endpoint(this.endpoint.index));
|
|
476
499
|
}
|
|
477
|
-
|
|
478
|
-
|
|
500
|
+
}
|
|
501
|
+
return super.supportsCommand(cmd);
|
|
502
|
+
}
|
|
503
|
+
get [import_API.SET_VALUE]() {
|
|
504
|
+
return async function({ property, propertyKey }, value) {
|
|
505
|
+
let result;
|
|
506
|
+
if (property === "keypadMode") {
|
|
507
|
+
if (typeof value !== "number") {
|
|
508
|
+
(0, import_API.throwWrongValueType)(this.ccId, property, "number", typeof value);
|
|
509
|
+
}
|
|
510
|
+
result = await this.setKeypadMode(value);
|
|
511
|
+
} else if (property === "adminCode" || property === "masterCode") {
|
|
512
|
+
if (typeof value !== "string") {
|
|
513
|
+
(0, import_API.throwWrongValueType)(this.ccId, property, "string", typeof value);
|
|
514
|
+
}
|
|
515
|
+
result = await this.setAdminCode(value);
|
|
516
|
+
} else if (property === "userIdStatus") {
|
|
517
|
+
if (propertyKey == void 0) {
|
|
518
|
+
(0, import_API.throwMissingPropertyKey)(this.ccId, property);
|
|
519
|
+
} else if (typeof propertyKey !== "number") {
|
|
520
|
+
(0, import_API.throwUnsupportedPropertyKey)(this.ccId, property, propertyKey);
|
|
521
|
+
}
|
|
522
|
+
if (typeof value !== "number") {
|
|
523
|
+
(0, import_API.throwWrongValueType)(this.ccId, property, "number", typeof value);
|
|
524
|
+
}
|
|
525
|
+
if (value === import_Types.UserIDStatus.Available) {
|
|
526
|
+
result = await this.clear(propertyKey);
|
|
527
|
+
} else {
|
|
528
|
+
const userCode = this.getValueDB().getValue(UserCodeCCValues.userCode(propertyKey).endpoint(this.endpoint.index));
|
|
529
|
+
result = await this.set(propertyKey, value, userCode);
|
|
530
|
+
}
|
|
531
|
+
} else if (property === "userCode") {
|
|
532
|
+
if (propertyKey == void 0) {
|
|
533
|
+
(0, import_API.throwMissingPropertyKey)(this.ccId, property);
|
|
534
|
+
} else if (typeof propertyKey !== "number") {
|
|
535
|
+
(0, import_API.throwUnsupportedPropertyKey)(this.ccId, property, propertyKey);
|
|
536
|
+
}
|
|
537
|
+
if (typeof value !== "string" && !(0, import_safe2.isUint8Array)(value)) {
|
|
538
|
+
(0, import_API.throwWrongValueType)(this.ccId, property, "string or Buffer", typeof value);
|
|
539
|
+
}
|
|
540
|
+
let userIdStatus = this.getValueDB().getValue(UserCodeCCValues.userIdStatus(propertyKey).endpoint(this.endpoint.index));
|
|
541
|
+
if (userIdStatus === import_Types.UserIDStatus.Available || userIdStatus == void 0) {
|
|
542
|
+
userIdStatus = import_Types.UserIDStatus.Enabled;
|
|
543
|
+
}
|
|
544
|
+
result = await this.set(propertyKey, userIdStatus, value);
|
|
479
545
|
} else {
|
|
480
|
-
|
|
481
|
-
result = await this.set(propertyKey, value, userCode);
|
|
546
|
+
(0, import_API.throwUnsupportedProperty)(this.ccId, property);
|
|
482
547
|
}
|
|
483
|
-
|
|
484
|
-
|
|
485
|
-
|
|
486
|
-
|
|
487
|
-
(0, import_API.throwUnsupportedPropertyKey)(this.ccId, property, propertyKey);
|
|
548
|
+
if (this.isSinglecast() && !(0, import_safe.supervisedCommandSucceeded)(result)) {
|
|
549
|
+
this.schedulePoll({ property, propertyKey }, value, {
|
|
550
|
+
transition: "fast"
|
|
551
|
+
});
|
|
488
552
|
}
|
|
489
|
-
|
|
490
|
-
|
|
553
|
+
return result;
|
|
554
|
+
};
|
|
555
|
+
}
|
|
556
|
+
get [import_API.POLL_VALUE]() {
|
|
557
|
+
return async function({ property, propertyKey }) {
|
|
558
|
+
switch (property) {
|
|
559
|
+
case "keypadMode":
|
|
560
|
+
return this.getKeypadMode();
|
|
561
|
+
case "adminCode":
|
|
562
|
+
return this.getAdminCode();
|
|
563
|
+
case "userIdStatus":
|
|
564
|
+
case "userCode": {
|
|
565
|
+
if (propertyKey == void 0) {
|
|
566
|
+
(0, import_API.throwMissingPropertyKey)(this.ccId, property);
|
|
567
|
+
} else if (typeof propertyKey !== "number") {
|
|
568
|
+
(0, import_API.throwUnsupportedPropertyKey)(this.ccId, property, propertyKey);
|
|
569
|
+
}
|
|
570
|
+
return (await this.get(propertyKey))?.[property];
|
|
571
|
+
}
|
|
572
|
+
default:
|
|
573
|
+
(0, import_API.throwUnsupportedProperty)(this.ccId, property);
|
|
491
574
|
}
|
|
492
|
-
|
|
493
|
-
|
|
494
|
-
|
|
575
|
+
};
|
|
576
|
+
}
|
|
577
|
+
async getUsersCount() {
|
|
578
|
+
this.assertSupportsCommand(import_Types.UserCodeCommand, import_Types.UserCodeCommand.UsersNumberGet);
|
|
579
|
+
const cc = new UserCodeCCUsersNumberGet({
|
|
580
|
+
nodeId: this.endpoint.nodeId,
|
|
581
|
+
endpointIndex: this.endpoint.index
|
|
582
|
+
});
|
|
583
|
+
const response = await this.host.sendCommand(cc, this.commandOptions);
|
|
584
|
+
return response?.supportedUsers;
|
|
585
|
+
}
|
|
586
|
+
async get(userId, multiple = false) {
|
|
587
|
+
__assertType("userId", "number", __assertType__number.bind(void 0, userId));
|
|
588
|
+
__assertType("multiple", "(optional) boolean", __assertType__optional_boolean.bind(void 0, multiple));
|
|
589
|
+
if (userId > 255 || multiple) {
|
|
590
|
+
this.assertSupportsCommand(import_Types.UserCodeCommand, import_Types.UserCodeCommand.ExtendedUserCodeGet);
|
|
591
|
+
const cc = new UserCodeCCExtendedUserCodeGet({
|
|
592
|
+
nodeId: this.endpoint.nodeId,
|
|
593
|
+
endpointIndex: this.endpoint.index,
|
|
594
|
+
userId,
|
|
595
|
+
reportMore: multiple
|
|
596
|
+
});
|
|
597
|
+
const response = await this.host.sendCommand(cc, this.commandOptions);
|
|
598
|
+
if (!response) {
|
|
599
|
+
return;
|
|
600
|
+
} else if (multiple) {
|
|
601
|
+
return (0, import_safe3.pick)(response, ["userCodes", "nextUserId"]);
|
|
602
|
+
} else {
|
|
603
|
+
return (0, import_safe3.pick)(response.userCodes[0], [
|
|
604
|
+
"userIdStatus",
|
|
605
|
+
"userCode"
|
|
606
|
+
]);
|
|
495
607
|
}
|
|
496
|
-
result = await this.set(propertyKey, userIdStatus, value);
|
|
497
608
|
} else {
|
|
498
|
-
(
|
|
499
|
-
|
|
500
|
-
|
|
501
|
-
|
|
502
|
-
|
|
609
|
+
this.assertSupportsCommand(import_Types.UserCodeCommand, import_Types.UserCodeCommand.Get);
|
|
610
|
+
const cc = new UserCodeCCGet({
|
|
611
|
+
nodeId: this.endpoint.nodeId,
|
|
612
|
+
endpointIndex: this.endpoint.index,
|
|
613
|
+
userId
|
|
503
614
|
});
|
|
615
|
+
const response = await this.host.sendCommand(cc, this.commandOptions);
|
|
616
|
+
if (response)
|
|
617
|
+
return (0, import_safe3.pick)(response, ["userIdStatus", "userCode"]);
|
|
504
618
|
}
|
|
505
|
-
|
|
506
|
-
|
|
507
|
-
|
|
508
|
-
|
|
509
|
-
|
|
510
|
-
|
|
511
|
-
|
|
512
|
-
|
|
513
|
-
case "adminCode":
|
|
514
|
-
return this.getAdminCode();
|
|
515
|
-
case "userIdStatus":
|
|
516
|
-
case "userCode": {
|
|
517
|
-
if (propertyKey == void 0) {
|
|
518
|
-
(0, import_API.throwMissingPropertyKey)(this.ccId, property);
|
|
519
|
-
} else if (typeof propertyKey !== "number") {
|
|
520
|
-
(0, import_API.throwUnsupportedPropertyKey)(this.ccId, property, propertyKey);
|
|
521
|
-
}
|
|
522
|
-
return (await this.get(propertyKey))?.[property];
|
|
523
|
-
}
|
|
524
|
-
default:
|
|
525
|
-
(0, import_API.throwUnsupportedProperty)(this.ccId, property);
|
|
619
|
+
}
|
|
620
|
+
/** Configures a single user code */
|
|
621
|
+
async set(userId, userIdStatus, userCode) {
|
|
622
|
+
__assertType("userId", "number", __assertType__number.bind(void 0, userId));
|
|
623
|
+
__assertType("userIdStatus", void 0, __assertType__su__1__2__3__4_eu.bind(void 0, userIdStatus));
|
|
624
|
+
__assertType("userCode", void 0, __assertType__su__string__uint8array_eu.bind(void 0, userCode));
|
|
625
|
+
if (userId > 255) {
|
|
626
|
+
return this.setMany([{ userId, userIdStatus, userCode }]);
|
|
526
627
|
}
|
|
527
|
-
|
|
528
|
-
|
|
529
|
-
|
|
530
|
-
|
|
531
|
-
|
|
532
|
-
|
|
533
|
-
endpointIndex: this.endpoint.index
|
|
534
|
-
});
|
|
535
|
-
const response = await this.host.sendCommand(cc, this.commandOptions);
|
|
536
|
-
return response?.supportedUsers;
|
|
537
|
-
}
|
|
538
|
-
async get(userId, multiple = false) {
|
|
539
|
-
__assertType("userId", "number", __assertType__number.bind(void 0, userId));
|
|
540
|
-
__assertType("multiple", "(optional) boolean", __assertType__optional_boolean.bind(void 0, multiple));
|
|
541
|
-
if (userId > 255 || multiple) {
|
|
542
|
-
this.assertSupportsCommand(import_Types.UserCodeCommand, import_Types.UserCodeCommand.ExtendedUserCodeGet);
|
|
543
|
-
const cc = new UserCodeCCExtendedUserCodeGet({
|
|
628
|
+
this.assertSupportsCommand(import_Types.UserCodeCommand, import_Types.UserCodeCommand.Set);
|
|
629
|
+
const numUsers = UserCodeCC.getSupportedUsersCached(this.host, this.endpoint);
|
|
630
|
+
if (numUsers != void 0 && userId > numUsers) {
|
|
631
|
+
throw new import_safe.ZWaveError(`The user ID must be between 0 and the number of supported users ${numUsers}.`, import_safe.ZWaveErrorCodes.Argument_Invalid);
|
|
632
|
+
}
|
|
633
|
+
const cc = new UserCodeCCSet({
|
|
544
634
|
nodeId: this.endpoint.nodeId,
|
|
545
635
|
endpointIndex: this.endpoint.index,
|
|
546
636
|
userId,
|
|
547
|
-
|
|
637
|
+
userIdStatus,
|
|
638
|
+
userCode
|
|
548
639
|
});
|
|
549
|
-
|
|
550
|
-
|
|
551
|
-
|
|
552
|
-
|
|
553
|
-
|
|
640
|
+
return this.host.sendCommand(cc, this.commandOptions);
|
|
641
|
+
}
|
|
642
|
+
/** Configures multiple user codes */
|
|
643
|
+
async setMany(codes) {
|
|
644
|
+
__assertType("codes", void 0, __assertType__sa_su__3__4__5_eu_ea_2.bind(void 0, codes));
|
|
645
|
+
this.assertSupportsCommand(import_Types.UserCodeCommand, import_Types.UserCodeCommand.ExtendedUserCodeSet);
|
|
646
|
+
const numUsers = UserCodeCC.getSupportedUsersCached(this.host, this.endpoint);
|
|
647
|
+
const supportedStatuses = UserCodeCC.getSupportedUserIDStatusesCached(this.host, this.endpoint);
|
|
648
|
+
const supportedASCIIChars = UserCodeCC.getSupportedASCIICharsCached(this.host, this.endpoint);
|
|
649
|
+
const supportsMultipleUserCodeSet = UserCodeCC.supportsMultipleUserCodeSetCached(this.host, this.endpoint) ?? false;
|
|
650
|
+
if (numUsers != void 0) {
|
|
651
|
+
if (codes.some((code) => code.userId < 0 || code.userId > numUsers)) {
|
|
652
|
+
throw new import_safe.ZWaveError(`All User IDs must be between 0 and the number of supported users ${numUsers}.`, import_safe.ZWaveErrorCodes.Argument_Invalid);
|
|
653
|
+
}
|
|
554
654
|
} else {
|
|
555
|
-
|
|
556
|
-
|
|
557
|
-
|
|
558
|
-
]);
|
|
655
|
+
if (codes.some((code) => code.userId < 0)) {
|
|
656
|
+
throw new import_safe.ZWaveError(`All User IDs must be greater than 0.`, import_safe.ZWaveErrorCodes.Argument_Invalid);
|
|
657
|
+
}
|
|
559
658
|
}
|
|
560
|
-
|
|
561
|
-
|
|
562
|
-
|
|
659
|
+
if (codes.some((code) => code.userId === 0) && codes.length > 1) {
|
|
660
|
+
throw new import_safe.ZWaveError(`If user ID 0 is used, only one code may be set`, import_safe.ZWaveErrorCodes.Argument_Invalid);
|
|
661
|
+
} else if (codes.some((code) => code.userId === 0 && code.userIdStatus !== import_Types.UserIDStatus.Available)) {
|
|
662
|
+
throw new import_safe.ZWaveError(`User ID 0 may only be used to clear all user codes`, import_safe.ZWaveErrorCodes.Argument_Invalid);
|
|
663
|
+
} else if (codes.length > 1 && !supportsMultipleUserCodeSet) {
|
|
664
|
+
throw new import_safe.ZWaveError(`The node does not support setting multiple user codes at once`, import_safe.ZWaveErrorCodes.Argument_Invalid);
|
|
665
|
+
}
|
|
666
|
+
for (const code of codes) {
|
|
667
|
+
if (supportedStatuses != void 0 && !supportedStatuses.includes(code.userIdStatus)) {
|
|
668
|
+
throw new import_safe.ZWaveError(`The user ID status ${(0, import_safe3.getEnumMemberName)(import_Types.UserIDStatus, code.userIdStatus)} is not supported by the node`, import_safe.ZWaveErrorCodes.Argument_Invalid);
|
|
669
|
+
} else if (code.userIdStatus === import_Types.UserIDStatus.Available) {
|
|
670
|
+
code.userCode = void 0;
|
|
671
|
+
} else if (supportedASCIIChars) {
|
|
672
|
+
const userCodeString = typeof code.userCode === "string" ? code.userCode : (0, import_safe2.uint8ArrayToString)(code.userCode);
|
|
673
|
+
if (!validateCode(userCodeString, supportedASCIIChars)) {
|
|
674
|
+
throw new import_safe.ZWaveError(`The user code must consist of 4 to 10 of the following characters: ${supportedASCIIChars}`, import_safe.ZWaveErrorCodes.Argument_Invalid);
|
|
675
|
+
}
|
|
676
|
+
}
|
|
677
|
+
}
|
|
678
|
+
const cc = new UserCodeCCExtendedUserCodeSet({
|
|
563
679
|
nodeId: this.endpoint.nodeId,
|
|
564
680
|
endpointIndex: this.endpoint.index,
|
|
565
|
-
|
|
681
|
+
userCodes: codes
|
|
566
682
|
});
|
|
567
|
-
|
|
568
|
-
if (response)
|
|
569
|
-
return (0, import_safe3.pick)(response, ["userIdStatus", "userCode"]);
|
|
683
|
+
return this.host.sendCommand(cc, this.commandOptions);
|
|
570
684
|
}
|
|
571
|
-
|
|
572
|
-
|
|
573
|
-
|
|
574
|
-
|
|
575
|
-
|
|
576
|
-
|
|
577
|
-
|
|
578
|
-
|
|
579
|
-
|
|
580
|
-
|
|
581
|
-
|
|
582
|
-
|
|
583
|
-
|
|
584
|
-
|
|
585
|
-
|
|
586
|
-
|
|
587
|
-
|
|
588
|
-
|
|
589
|
-
|
|
590
|
-
|
|
591
|
-
|
|
592
|
-
|
|
593
|
-
|
|
594
|
-
/** Configures multiple user codes */
|
|
595
|
-
async setMany(codes) {
|
|
596
|
-
__assertType("codes", void 0, __assertType__sa_su__3__4__5_eu_ea_2.bind(void 0, codes));
|
|
597
|
-
this.assertSupportsCommand(import_Types.UserCodeCommand, import_Types.UserCodeCommand.ExtendedUserCodeSet);
|
|
598
|
-
const numUsers = UserCodeCC.getSupportedUsersCached(this.host, this.endpoint);
|
|
599
|
-
const supportedStatuses = UserCodeCC.getSupportedUserIDStatusesCached(this.host, this.endpoint);
|
|
600
|
-
const supportedASCIIChars = UserCodeCC.getSupportedASCIICharsCached(this.host, this.endpoint);
|
|
601
|
-
const supportsMultipleUserCodeSet = UserCodeCC.supportsMultipleUserCodeSetCached(this.host, this.endpoint) ?? false;
|
|
602
|
-
if (numUsers != void 0) {
|
|
603
|
-
if (codes.some((code) => code.userId < 0 || code.userId > numUsers)) {
|
|
604
|
-
throw new import_safe.ZWaveError(`All User IDs must be between 0 and the number of supported users ${numUsers}.`, import_safe.ZWaveErrorCodes.Argument_Invalid);
|
|
685
|
+
/**
|
|
686
|
+
* Clears one or all user code
|
|
687
|
+
* @param userId The user code to clear. If none or 0 is given, all codes are cleared
|
|
688
|
+
*/
|
|
689
|
+
async clear(userId = 0) {
|
|
690
|
+
__assertType("userId", "(optional) number", __assertType__optional_number.bind(void 0, userId));
|
|
691
|
+
if (this.version > 1 || userId > 255) {
|
|
692
|
+
return this.setMany([
|
|
693
|
+
{ userId, userIdStatus: import_Types.UserIDStatus.Available }
|
|
694
|
+
]);
|
|
695
|
+
} else {
|
|
696
|
+
this.assertSupportsCommand(import_Types.UserCodeCommand, import_Types.UserCodeCommand.Set);
|
|
697
|
+
const numUsers = UserCodeCC.getSupportedUsersCached(this.host, this.endpoint);
|
|
698
|
+
if (numUsers != void 0 && userId > numUsers) {
|
|
699
|
+
throw new import_safe.ZWaveError(`The user ID must be between 0 and the number of supported users ${numUsers}.`, import_safe.ZWaveErrorCodes.Argument_Invalid);
|
|
700
|
+
}
|
|
701
|
+
const cc = new UserCodeCCSet({
|
|
702
|
+
nodeId: this.endpoint.nodeId,
|
|
703
|
+
endpointIndex: this.endpoint.index,
|
|
704
|
+
userId,
|
|
705
|
+
userIdStatus: import_Types.UserIDStatus.Available
|
|
706
|
+
});
|
|
707
|
+
return this.host.sendCommand(cc, this.commandOptions);
|
|
605
708
|
}
|
|
606
|
-
}
|
|
607
|
-
|
|
608
|
-
|
|
709
|
+
}
|
|
710
|
+
// eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types
|
|
711
|
+
async getCapabilities() {
|
|
712
|
+
this.assertSupportsCommand(import_Types.UserCodeCommand, import_Types.UserCodeCommand.CapabilitiesGet);
|
|
713
|
+
const cc = new UserCodeCCCapabilitiesGet({
|
|
714
|
+
nodeId: this.endpoint.nodeId,
|
|
715
|
+
endpointIndex: this.endpoint.index
|
|
716
|
+
});
|
|
717
|
+
const response = await this.host.sendCommand(cc, this.commandOptions);
|
|
718
|
+
if (response) {
|
|
719
|
+
return (0, import_safe3.pick)(response, [
|
|
720
|
+
"supportsAdminCode",
|
|
721
|
+
"supportsAdminCodeDeactivation",
|
|
722
|
+
"supportsUserCodeChecksum",
|
|
723
|
+
"supportsMultipleUserCodeReport",
|
|
724
|
+
"supportsMultipleUserCodeSet",
|
|
725
|
+
"supportedUserIDStatuses",
|
|
726
|
+
"supportedKeypadModes",
|
|
727
|
+
"supportedASCIIChars"
|
|
728
|
+
]);
|
|
609
729
|
}
|
|
610
730
|
}
|
|
611
|
-
|
|
612
|
-
|
|
613
|
-
|
|
614
|
-
|
|
615
|
-
|
|
616
|
-
|
|
617
|
-
|
|
618
|
-
|
|
619
|
-
|
|
620
|
-
|
|
621
|
-
|
|
622
|
-
|
|
623
|
-
|
|
624
|
-
|
|
625
|
-
|
|
626
|
-
|
|
627
|
-
}
|
|
731
|
+
async getKeypadMode() {
|
|
732
|
+
this.assertSupportsCommand(import_Types.UserCodeCommand, import_Types.UserCodeCommand.KeypadModeGet);
|
|
733
|
+
const cc = new UserCodeCCKeypadModeGet({
|
|
734
|
+
nodeId: this.endpoint.nodeId,
|
|
735
|
+
endpointIndex: this.endpoint.index
|
|
736
|
+
});
|
|
737
|
+
const response = await this.host.sendCommand(cc, this.commandOptions);
|
|
738
|
+
return response?.keypadMode;
|
|
739
|
+
}
|
|
740
|
+
async setKeypadMode(keypadMode) {
|
|
741
|
+
__assertType("keypadMode", "KeypadMode", __assertType__KeypadMode.bind(void 0, keypadMode));
|
|
742
|
+
this.assertSupportsCommand(import_Types.UserCodeCommand, import_Types.UserCodeCommand.KeypadModeSet);
|
|
743
|
+
const supportedModes = UserCodeCC.getSupportedKeypadModesCached(this.host, this.endpoint);
|
|
744
|
+
if (!supportedModes) {
|
|
745
|
+
throw new import_safe.ZWaveError(`The keypad mode can only be set after the interview is complete!`, import_safe.ZWaveErrorCodes.Argument_Invalid);
|
|
746
|
+
} else if (!supportedModes.includes(keypadMode)) {
|
|
747
|
+
throw new import_safe.ZWaveError(`The keypad mode ${(0, import_safe3.getEnumMemberName)(import_Types.KeypadMode, keypadMode)} is not supported by the node!`, import_safe.ZWaveErrorCodes.Argument_Invalid);
|
|
628
748
|
}
|
|
749
|
+
const cc = new UserCodeCCKeypadModeSet({
|
|
750
|
+
nodeId: this.endpoint.nodeId,
|
|
751
|
+
endpointIndex: this.endpoint.index,
|
|
752
|
+
keypadMode
|
|
753
|
+
});
|
|
754
|
+
return this.host.sendCommand(cc, this.commandOptions);
|
|
629
755
|
}
|
|
630
|
-
|
|
631
|
-
|
|
632
|
-
|
|
633
|
-
|
|
634
|
-
|
|
635
|
-
|
|
636
|
-
|
|
637
|
-
|
|
638
|
-
|
|
639
|
-
|
|
640
|
-
|
|
641
|
-
|
|
642
|
-
|
|
643
|
-
|
|
644
|
-
|
|
645
|
-
{ userId, userIdStatus: import_Types.UserIDStatus.Available }
|
|
646
|
-
]);
|
|
647
|
-
} else {
|
|
648
|
-
this.assertSupportsCommand(import_Types.UserCodeCommand, import_Types.UserCodeCommand.Set);
|
|
649
|
-
const numUsers = UserCodeCC.getSupportedUsersCached(this.host, this.endpoint);
|
|
650
|
-
if (numUsers != void 0 && userId > numUsers) {
|
|
651
|
-
throw new import_safe.ZWaveError(`The user ID must be between 0 and the number of supported users ${numUsers}.`, import_safe.ZWaveErrorCodes.Argument_Invalid);
|
|
756
|
+
async getAdminCode() {
|
|
757
|
+
this.assertSupportsCommand(import_Types.UserCodeCommand, import_Types.UserCodeCommand.AdminCodeGet);
|
|
758
|
+
const cc = new UserCodeCCAdminCodeGet({
|
|
759
|
+
nodeId: this.endpoint.nodeId,
|
|
760
|
+
endpointIndex: this.endpoint.index
|
|
761
|
+
});
|
|
762
|
+
const response = await this.host.sendCommand(cc, this.commandOptions);
|
|
763
|
+
return response?.adminCode;
|
|
764
|
+
}
|
|
765
|
+
async setAdminCode(adminCode) {
|
|
766
|
+
__assertType("adminCode", "string", __assertType__string.bind(void 0, adminCode));
|
|
767
|
+
this.assertSupportsCommand(import_Types.UserCodeCommand, import_Types.UserCodeCommand.AdminCodeSet);
|
|
768
|
+
const supportedASCIIChars = UserCodeCC.getSupportedASCIICharsCached(this.host, this.endpoint);
|
|
769
|
+
if (!supportedASCIIChars) {
|
|
770
|
+
throw new import_safe.ZWaveError(`The admin code can only be set after the interview is complete!`, import_safe.ZWaveErrorCodes.Argument_Invalid);
|
|
652
771
|
}
|
|
653
|
-
|
|
772
|
+
if (!adminCode) {
|
|
773
|
+
const supportsDeactivation = UserCodeCC.supportsAdminCodeDeactivationCached(this.host, this.endpoint);
|
|
774
|
+
if (!supportsDeactivation) {
|
|
775
|
+
throw new import_safe.ZWaveError(`The node does not support deactivating the admin code!`, import_safe.ZWaveErrorCodes.Argument_Invalid);
|
|
776
|
+
}
|
|
777
|
+
} else if (!validateCode(adminCode, supportedASCIIChars)) {
|
|
778
|
+
throw new import_safe.ZWaveError(`The admin code must consist of 4 to 10 of the following characters: ${supportedASCIIChars}`, import_safe.ZWaveErrorCodes.Argument_Invalid);
|
|
779
|
+
}
|
|
780
|
+
const cc = new UserCodeCCAdminCodeSet({
|
|
654
781
|
nodeId: this.endpoint.nodeId,
|
|
655
782
|
endpointIndex: this.endpoint.index,
|
|
656
|
-
|
|
657
|
-
userIdStatus: import_Types.UserIDStatus.Available
|
|
783
|
+
adminCode
|
|
658
784
|
});
|
|
659
785
|
return this.host.sendCommand(cc, this.commandOptions);
|
|
660
786
|
}
|
|
661
|
-
|
|
662
|
-
|
|
663
|
-
|
|
664
|
-
|
|
665
|
-
|
|
666
|
-
|
|
667
|
-
|
|
668
|
-
|
|
669
|
-
const response = await this.host.sendCommand(cc, this.commandOptions);
|
|
670
|
-
if (response) {
|
|
671
|
-
return (0, import_safe3.pick)(response, [
|
|
672
|
-
"supportsAdminCode",
|
|
673
|
-
"supportsAdminCodeDeactivation",
|
|
674
|
-
"supportsUserCodeChecksum",
|
|
675
|
-
"supportsMultipleUserCodeReport",
|
|
676
|
-
"supportsMultipleUserCodeSet",
|
|
677
|
-
"supportedUserIDStatuses",
|
|
678
|
-
"supportedKeypadModes",
|
|
679
|
-
"supportedASCIIChars"
|
|
680
|
-
]);
|
|
787
|
+
async getUserCodeChecksum() {
|
|
788
|
+
this.assertSupportsCommand(import_Types.UserCodeCommand, import_Types.UserCodeCommand.UserCodeChecksumGet);
|
|
789
|
+
const cc = new UserCodeCCUserCodeChecksumGet({
|
|
790
|
+
nodeId: this.endpoint.nodeId,
|
|
791
|
+
endpointIndex: this.endpoint.index
|
|
792
|
+
});
|
|
793
|
+
const response = await this.host.sendCommand(cc, this.commandOptions);
|
|
794
|
+
return response?.userCodeChecksum;
|
|
681
795
|
}
|
|
682
|
-
}
|
|
683
|
-
|
|
684
|
-
|
|
685
|
-
|
|
686
|
-
|
|
687
|
-
|
|
688
|
-
|
|
689
|
-
|
|
690
|
-
|
|
691
|
-
|
|
692
|
-
|
|
693
|
-
|
|
694
|
-
|
|
695
|
-
|
|
696
|
-
|
|
697
|
-
|
|
698
|
-
|
|
699
|
-
|
|
700
|
-
|
|
701
|
-
|
|
702
|
-
|
|
703
|
-
|
|
704
|
-
|
|
705
|
-
|
|
706
|
-
|
|
707
|
-
|
|
708
|
-
|
|
709
|
-
|
|
710
|
-
|
|
711
|
-
|
|
712
|
-
|
|
713
|
-
|
|
714
|
-
|
|
715
|
-
|
|
716
|
-
|
|
717
|
-
|
|
718
|
-
|
|
719
|
-
|
|
720
|
-
|
|
721
|
-
|
|
722
|
-
|
|
723
|
-
|
|
724
|
-
|
|
725
|
-
|
|
726
|
-
|
|
727
|
-
throw new import_safe.ZWaveError(`The node does not support deactivating the admin code!`, import_safe.ZWaveErrorCodes.Argument_Invalid);
|
|
796
|
+
};
|
|
797
|
+
return UserCodeCCAPI2 = _classThis;
|
|
798
|
+
})();
|
|
799
|
+
let UserCodeCC = (() => {
|
|
800
|
+
let _classDecorators = [(0, import_CommandClassDecorators.commandClass)(import_safe.CommandClasses["User Code"]), (0, import_CommandClassDecorators.implementedVersion)(2), (0, import_CommandClassDecorators.ccValues)(UserCodeCCValues)];
|
|
801
|
+
let _classDescriptor;
|
|
802
|
+
let _classExtraInitializers = [];
|
|
803
|
+
let _classThis;
|
|
804
|
+
let _classSuper = import_CommandClass.CommandClass;
|
|
805
|
+
var UserCodeCC2 = class extends _classSuper {
|
|
806
|
+
static {
|
|
807
|
+
_classThis = this;
|
|
808
|
+
}
|
|
809
|
+
static {
|
|
810
|
+
const _metadata = typeof Symbol === "function" && Symbol.metadata ? Object.create(_classSuper[Symbol.metadata] ?? null) : void 0;
|
|
811
|
+
__esDecorate(null, _classDescriptor = { value: _classThis }, _classDecorators, { kind: "class", name: _classThis.name, metadata: _metadata }, null, _classExtraInitializers);
|
|
812
|
+
UserCodeCC2 = _classThis = _classDescriptor.value;
|
|
813
|
+
if (_metadata) Object.defineProperty(_classThis, Symbol.metadata, { enumerable: true, configurable: true, writable: true, value: _metadata });
|
|
814
|
+
__runInitializers(_classThis, _classExtraInitializers);
|
|
815
|
+
}
|
|
816
|
+
async interview(ctx) {
|
|
817
|
+
const node = this.getNode(ctx);
|
|
818
|
+
const endpoint = this.getEndpoint(ctx);
|
|
819
|
+
const api = import_API.CCAPI.create(import_safe.CommandClasses["User Code"], ctx, endpoint).withOptions({
|
|
820
|
+
priority: import_safe.MessagePriority.NodeQuery
|
|
821
|
+
});
|
|
822
|
+
ctx.logNode(node.id, {
|
|
823
|
+
endpoint: this.endpointIndex,
|
|
824
|
+
message: `Interviewing ${this.ccName}...`,
|
|
825
|
+
direction: "none"
|
|
826
|
+
});
|
|
827
|
+
if (api.version >= 2) {
|
|
828
|
+
ctx.logNode(node.id, {
|
|
829
|
+
message: "querying capabilities...",
|
|
830
|
+
direction: "outbound"
|
|
831
|
+
});
|
|
832
|
+
const caps = await api.getCapabilities();
|
|
833
|
+
if (!caps) {
|
|
834
|
+
ctx.logNode(node.id, {
|
|
835
|
+
endpoint: this.endpointIndex,
|
|
836
|
+
message: "User Code capabilities query timed out, skipping interview...",
|
|
837
|
+
level: "warn"
|
|
838
|
+
});
|
|
839
|
+
return;
|
|
840
|
+
}
|
|
728
841
|
}
|
|
729
|
-
} else if (!validateCode(adminCode, supportedASCIIChars)) {
|
|
730
|
-
throw new import_safe.ZWaveError(`The admin code must consist of 4 to 10 of the following characters: ${supportedASCIIChars}`, import_safe.ZWaveErrorCodes.Argument_Invalid);
|
|
731
|
-
}
|
|
732
|
-
const cc = new UserCodeCCAdminCodeSet({
|
|
733
|
-
nodeId: this.endpoint.nodeId,
|
|
734
|
-
endpointIndex: this.endpoint.index,
|
|
735
|
-
adminCode
|
|
736
|
-
});
|
|
737
|
-
return this.host.sendCommand(cc, this.commandOptions);
|
|
738
|
-
}
|
|
739
|
-
async getUserCodeChecksum() {
|
|
740
|
-
this.assertSupportsCommand(import_Types.UserCodeCommand, import_Types.UserCodeCommand.UserCodeChecksumGet);
|
|
741
|
-
const cc = new UserCodeCCUserCodeChecksumGet({
|
|
742
|
-
nodeId: this.endpoint.nodeId,
|
|
743
|
-
endpointIndex: this.endpoint.index
|
|
744
|
-
});
|
|
745
|
-
const response = await this.host.sendCommand(cc, this.commandOptions);
|
|
746
|
-
return response?.userCodeChecksum;
|
|
747
|
-
}
|
|
748
|
-
};
|
|
749
|
-
UserCodeCCAPI = __decorate([
|
|
750
|
-
(0, import_CommandClassDecorators.API)(import_safe.CommandClasses["User Code"])
|
|
751
|
-
], UserCodeCCAPI);
|
|
752
|
-
let UserCodeCC = UserCodeCC_1 = class UserCodeCC2 extends import_CommandClass.CommandClass {
|
|
753
|
-
async interview(ctx) {
|
|
754
|
-
const node = this.getNode(ctx);
|
|
755
|
-
const endpoint = this.getEndpoint(ctx);
|
|
756
|
-
const api = import_API.CCAPI.create(import_safe.CommandClasses["User Code"], ctx, endpoint).withOptions({
|
|
757
|
-
priority: import_safe.MessagePriority.NodeQuery
|
|
758
|
-
});
|
|
759
|
-
ctx.logNode(node.id, {
|
|
760
|
-
endpoint: this.endpointIndex,
|
|
761
|
-
message: `Interviewing ${this.ccName}...`,
|
|
762
|
-
direction: "none"
|
|
763
|
-
});
|
|
764
|
-
if (api.version >= 2) {
|
|
765
842
|
ctx.logNode(node.id, {
|
|
766
|
-
message: "querying
|
|
843
|
+
message: "querying number of user codes...",
|
|
767
844
|
direction: "outbound"
|
|
768
845
|
});
|
|
769
|
-
const
|
|
770
|
-
if (
|
|
846
|
+
const supportedUsers = await api.getUsersCount();
|
|
847
|
+
if (supportedUsers == void 0) {
|
|
771
848
|
ctx.logNode(node.id, {
|
|
772
849
|
endpoint: this.endpointIndex,
|
|
773
|
-
message: "
|
|
850
|
+
message: "Querying number of user codes timed out, skipping interview...",
|
|
774
851
|
level: "warn"
|
|
775
852
|
});
|
|
776
853
|
return;
|
|
777
854
|
}
|
|
855
|
+
for (let userId = 1; userId <= supportedUsers; userId++) {
|
|
856
|
+
setUserCodeMetadata.call(this, ctx, userId);
|
|
857
|
+
}
|
|
858
|
+
if (ctx.getInterviewOptions()?.queryAllUserCodes) {
|
|
859
|
+
await this.refreshValues(ctx);
|
|
860
|
+
}
|
|
861
|
+
this.setInterviewComplete(ctx, true);
|
|
778
862
|
}
|
|
779
|
-
ctx
|
|
780
|
-
|
|
781
|
-
|
|
782
|
-
|
|
783
|
-
|
|
784
|
-
if (supportedUsers == void 0) {
|
|
785
|
-
ctx.logNode(node.id, {
|
|
786
|
-
endpoint: this.endpointIndex,
|
|
787
|
-
message: "Querying number of user codes timed out, skipping interview...",
|
|
788
|
-
level: "warn"
|
|
863
|
+
async refreshValues(ctx) {
|
|
864
|
+
const node = this.getNode(ctx);
|
|
865
|
+
const endpoint = this.getEndpoint(ctx);
|
|
866
|
+
const api = import_API.CCAPI.create(import_safe.CommandClasses["User Code"], ctx, endpoint).withOptions({
|
|
867
|
+
priority: import_safe.MessagePriority.NodeQuery
|
|
789
868
|
});
|
|
790
|
-
|
|
791
|
-
|
|
792
|
-
|
|
793
|
-
|
|
794
|
-
|
|
795
|
-
|
|
796
|
-
|
|
797
|
-
|
|
798
|
-
|
|
799
|
-
|
|
800
|
-
|
|
801
|
-
|
|
802
|
-
|
|
803
|
-
|
|
804
|
-
|
|
805
|
-
|
|
806
|
-
|
|
807
|
-
|
|
808
|
-
|
|
809
|
-
|
|
810
|
-
|
|
811
|
-
|
|
812
|
-
|
|
869
|
+
const supportsAdminCode = UserCodeCC2.supportsAdminCodeCached(ctx, endpoint);
|
|
870
|
+
const supportsUserCodeChecksum = this.getValue(ctx, UserCodeCCValues.supportsUserCodeChecksum) ?? false;
|
|
871
|
+
const supportedKeypadModes = this.getValue(ctx, UserCodeCCValues.supportedKeypadModes) ?? [];
|
|
872
|
+
const supportedUsers = this.getValue(ctx, UserCodeCCValues.supportedUsers) ?? 0;
|
|
873
|
+
const supportsMultipleUserCodeReport = !!this.getValue(ctx, UserCodeCCValues.supportsMultipleUserCodeReport);
|
|
874
|
+
if (api.version >= 2) {
|
|
875
|
+
if (supportsAdminCode) {
|
|
876
|
+
ctx.logNode(node.id, {
|
|
877
|
+
message: "querying admin code...",
|
|
878
|
+
direction: "outbound"
|
|
879
|
+
});
|
|
880
|
+
await api.getAdminCode();
|
|
881
|
+
}
|
|
882
|
+
if (supportedKeypadModes.length > 1) {
|
|
883
|
+
ctx.logNode(node.id, {
|
|
884
|
+
message: "querying active keypad mode...",
|
|
885
|
+
direction: "outbound"
|
|
886
|
+
});
|
|
887
|
+
await api.getKeypadMode();
|
|
888
|
+
}
|
|
889
|
+
const storedUserCodeChecksum = this.getValue(ctx, UserCodeCCValues.userCodeChecksum) ?? 0;
|
|
890
|
+
let currentUserCodeChecksum = 0;
|
|
891
|
+
if (supportsUserCodeChecksum) {
|
|
892
|
+
ctx.logNode(node.id, {
|
|
893
|
+
message: "retrieving current user code checksum...",
|
|
894
|
+
direction: "outbound"
|
|
895
|
+
});
|
|
896
|
+
currentUserCodeChecksum = await api.getUserCodeChecksum();
|
|
897
|
+
}
|
|
898
|
+
if (!supportsUserCodeChecksum || currentUserCodeChecksum !== storedUserCodeChecksum) {
|
|
899
|
+
ctx.logNode(node.id, {
|
|
900
|
+
message: "checksum changed or is not supported, querying all user codes...",
|
|
901
|
+
direction: "outbound"
|
|
902
|
+
});
|
|
903
|
+
if (supportsMultipleUserCodeReport) {
|
|
904
|
+
let nextUserId = 1;
|
|
905
|
+
while (nextUserId > 0 && nextUserId <= supportedUsers) {
|
|
906
|
+
const response = await api.get(nextUserId, true);
|
|
907
|
+
if (response) {
|
|
908
|
+
nextUserId = response.nextUserId;
|
|
909
|
+
} else {
|
|
910
|
+
ctx.logNode(node.id, {
|
|
911
|
+
endpoint: this.endpointIndex,
|
|
912
|
+
message: `Querying user code #${nextUserId} timed out, skipping the remaining interview...`,
|
|
913
|
+
level: "warn"
|
|
914
|
+
});
|
|
915
|
+
break;
|
|
916
|
+
}
|
|
917
|
+
}
|
|
918
|
+
} else {
|
|
919
|
+
for (let userId = 1; userId <= supportedUsers; userId++) {
|
|
920
|
+
await api.get(userId);
|
|
921
|
+
}
|
|
922
|
+
}
|
|
923
|
+
}
|
|
924
|
+
} else {
|
|
813
925
|
ctx.logNode(node.id, {
|
|
814
|
-
message: "querying
|
|
926
|
+
message: "querying all user codes...",
|
|
815
927
|
direction: "outbound"
|
|
816
928
|
});
|
|
817
|
-
|
|
929
|
+
for (let userId = 1; userId <= supportedUsers; userId++) {
|
|
930
|
+
await api.get(userId);
|
|
931
|
+
}
|
|
818
932
|
}
|
|
819
|
-
|
|
820
|
-
|
|
821
|
-
|
|
822
|
-
|
|
823
|
-
|
|
824
|
-
|
|
933
|
+
}
|
|
934
|
+
/**
|
|
935
|
+
* Returns the number of supported users.
|
|
936
|
+
* This only works AFTER the interview process
|
|
937
|
+
*/
|
|
938
|
+
static getSupportedUsersCached(ctx, endpoint) {
|
|
939
|
+
return ctx.getValueDB(endpoint.nodeId).getValue(UserCodeCCValues.supportedUsers.endpoint(endpoint.index));
|
|
940
|
+
}
|
|
941
|
+
/**
|
|
942
|
+
* Returns the supported keypad modes.
|
|
943
|
+
* This only works AFTER the interview process
|
|
944
|
+
*/
|
|
945
|
+
static getSupportedKeypadModesCached(ctx, endpoint) {
|
|
946
|
+
return ctx.getValueDB(endpoint.nodeId).getValue(UserCodeCCValues.supportedKeypadModes.endpoint(endpoint.index));
|
|
947
|
+
}
|
|
948
|
+
/**
|
|
949
|
+
* Returns the supported user ID statuses.
|
|
950
|
+
* This only works AFTER the interview process
|
|
951
|
+
*/
|
|
952
|
+
static getSupportedUserIDStatusesCached(ctx, endpoint) {
|
|
953
|
+
return ctx.getValueDB(endpoint.nodeId).getValue(UserCodeCCValues.supportedUserIDStatuses.endpoint(endpoint.index));
|
|
954
|
+
}
|
|
955
|
+
/**
|
|
956
|
+
* Returns the supported ASCII characters.
|
|
957
|
+
* This only works AFTER the interview process
|
|
958
|
+
*/
|
|
959
|
+
static getSupportedASCIICharsCached(ctx, endpoint) {
|
|
960
|
+
return ctx.getValueDB(endpoint.nodeId).getValue(UserCodeCCValues.supportedASCIIChars.endpoint(endpoint.index));
|
|
961
|
+
}
|
|
962
|
+
/**
|
|
963
|
+
* Returns whether the admin code functionality is supported.
|
|
964
|
+
* This only works AFTER the interview process
|
|
965
|
+
*/
|
|
966
|
+
static supportsAdminCodeCached(ctx, endpoint) {
|
|
967
|
+
const valueDB = ctx.getValueDB(endpoint.nodeId);
|
|
968
|
+
return valueDB.getValue(UserCodeCCValues.supportsAdminCode.endpoint(endpoint.index)) ?? valueDB.getValue(UserCodeCCValues._deprecated_supportsMasterCode.endpoint(endpoint.index)) ?? false;
|
|
969
|
+
}
|
|
970
|
+
/**
|
|
971
|
+
* Returns whether deactivating the admin code is supported.
|
|
972
|
+
* This only works AFTER the interview process
|
|
973
|
+
*/
|
|
974
|
+
static supportsAdminCodeDeactivationCached(ctx, endpoint) {
|
|
975
|
+
const valueDB = ctx.getValueDB(endpoint.nodeId);
|
|
976
|
+
return valueDB.getValue(UserCodeCCValues.supportsAdminCodeDeactivation.endpoint(endpoint.index)) ?? valueDB.getValue(UserCodeCCValues._deprecated_supportsMasterCodeDeactivation.endpoint(endpoint.index)) ?? false;
|
|
977
|
+
}
|
|
978
|
+
/**
|
|
979
|
+
* Returns whether setting multiple user codes at once is supported.
|
|
980
|
+
* This only works AFTER the interview process
|
|
981
|
+
*/
|
|
982
|
+
static supportsMultipleUserCodeSetCached(ctx, endpoint) {
|
|
983
|
+
return !!ctx.getValueDB(endpoint.nodeId).getValue(UserCodeCCValues.supportsMultipleUserCodeSet.endpoint(endpoint.index));
|
|
984
|
+
}
|
|
985
|
+
/**
|
|
986
|
+
* Returns the current status of a user ID.
|
|
987
|
+
* This only works AFTER the user IDs have been queried.
|
|
988
|
+
*/
|
|
989
|
+
static getUserIdStatusCached(ctx, endpoint, userId) {
|
|
990
|
+
return ctx.getValueDB(endpoint.nodeId).getValue(UserCodeCCValues.userIdStatus(userId).endpoint(endpoint.index));
|
|
991
|
+
}
|
|
992
|
+
/**
|
|
993
|
+
* Returns the current code belonging to a user ID.
|
|
994
|
+
* This only works AFTER the user IDs have been queried.
|
|
995
|
+
*/
|
|
996
|
+
static getUserCodeCached(ctx, endpoint, userId) {
|
|
997
|
+
return ctx.getValueDB(endpoint.nodeId).getValue(UserCodeCCValues.userCode(userId).endpoint(endpoint.index));
|
|
998
|
+
}
|
|
999
|
+
};
|
|
1000
|
+
return UserCodeCC2 = _classThis;
|
|
1001
|
+
})();
|
|
1002
|
+
let UserCodeCCSet = (() => {
|
|
1003
|
+
let _classDecorators = [(0, import_CommandClassDecorators.CCCommand)(import_Types.UserCodeCommand.Set), (0, import_CommandClassDecorators.useSupervision)()];
|
|
1004
|
+
let _classDescriptor;
|
|
1005
|
+
let _classExtraInitializers = [];
|
|
1006
|
+
let _classThis;
|
|
1007
|
+
let _classSuper = UserCodeCC;
|
|
1008
|
+
var UserCodeCCSet2 = class extends _classSuper {
|
|
1009
|
+
static {
|
|
1010
|
+
_classThis = this;
|
|
1011
|
+
}
|
|
1012
|
+
static {
|
|
1013
|
+
const _metadata = typeof Symbol === "function" && Symbol.metadata ? Object.create(_classSuper[Symbol.metadata] ?? null) : void 0;
|
|
1014
|
+
__esDecorate(null, _classDescriptor = { value: _classThis }, _classDecorators, { kind: "class", name: _classThis.name, metadata: _metadata }, null, _classExtraInitializers);
|
|
1015
|
+
UserCodeCCSet2 = _classThis = _classDescriptor.value;
|
|
1016
|
+
if (_metadata) Object.defineProperty(_classThis, Symbol.metadata, { enumerable: true, configurable: true, writable: true, value: _metadata });
|
|
1017
|
+
__runInitializers(_classThis, _classExtraInitializers);
|
|
1018
|
+
}
|
|
1019
|
+
constructor(options) {
|
|
1020
|
+
super(options);
|
|
1021
|
+
this.userId = options.userId;
|
|
1022
|
+
this.userIdStatus = options.userIdStatus;
|
|
1023
|
+
if (this.userId < 0) {
|
|
1024
|
+
throw new import_safe.ZWaveError(`${this.constructor.name}: The user ID must be between greater than 0.`, import_safe.ZWaveErrorCodes.Argument_Invalid);
|
|
1025
|
+
} else if (this.userId === 0 && this.userIdStatus !== import_Types.UserIDStatus.Available) {
|
|
1026
|
+
throw new import_safe.ZWaveError(`${this.constructor.name}: User ID 0 may only be used to clear all user codes`, import_safe.ZWaveErrorCodes.Argument_Invalid);
|
|
1027
|
+
} else if (this.userIdStatus === import_Types.UserIDStatus.Available) {
|
|
1028
|
+
this.userCode = "\0".repeat(4);
|
|
1029
|
+
} else {
|
|
1030
|
+
this.userCode = options.userCode;
|
|
1031
|
+
if (this.userCode.length < 4 || this.userCode.length > 10) {
|
|
1032
|
+
throw new import_safe.ZWaveError(`${this.constructor.name}: The user code must have a length of 4 to 10 ${typeof this.userCode === "string" ? "characters" : "bytes"}`, import_safe.ZWaveErrorCodes.Argument_Invalid);
|
|
1033
|
+
}
|
|
825
1034
|
}
|
|
826
|
-
|
|
827
|
-
|
|
828
|
-
|
|
829
|
-
|
|
830
|
-
|
|
831
|
-
|
|
832
|
-
|
|
833
|
-
currentUserCodeChecksum = await api.getUserCodeChecksum();
|
|
1035
|
+
}
|
|
1036
|
+
static from(raw, ctx) {
|
|
1037
|
+
(0, import_safe.validatePayload)(raw.payload.length >= 2);
|
|
1038
|
+
const userId = raw.payload[0];
|
|
1039
|
+
const userIdStatus = raw.payload[1];
|
|
1040
|
+
if (userIdStatus === import_Types.UserIDStatus.StatusNotAvailable) {
|
|
1041
|
+
import_safe.validatePayload.fail("Invalid user ID status");
|
|
834
1042
|
}
|
|
835
|
-
if (
|
|
836
|
-
|
|
837
|
-
|
|
838
|
-
|
|
1043
|
+
if (userIdStatus === import_Types.UserIDStatus.Available) {
|
|
1044
|
+
return new this({
|
|
1045
|
+
nodeId: ctx.sourceNodeId,
|
|
1046
|
+
userId,
|
|
1047
|
+
userIdStatus
|
|
839
1048
|
});
|
|
840
|
-
|
|
841
|
-
|
|
842
|
-
|
|
843
|
-
|
|
844
|
-
|
|
845
|
-
|
|
846
|
-
|
|
847
|
-
|
|
848
|
-
|
|
849
|
-
|
|
850
|
-
|
|
851
|
-
|
|
852
|
-
|
|
853
|
-
|
|
854
|
-
|
|
1049
|
+
}
|
|
1050
|
+
const userCode = raw.payload.subarray(2);
|
|
1051
|
+
return new this({
|
|
1052
|
+
nodeId: ctx.sourceNodeId,
|
|
1053
|
+
userId,
|
|
1054
|
+
userIdStatus,
|
|
1055
|
+
userCode
|
|
1056
|
+
});
|
|
1057
|
+
}
|
|
1058
|
+
userId;
|
|
1059
|
+
userIdStatus;
|
|
1060
|
+
userCode;
|
|
1061
|
+
serialize(ctx) {
|
|
1062
|
+
this.payload = import_safe2.Bytes.concat([
|
|
1063
|
+
import_safe2.Bytes.from([this.userId, this.userIdStatus]),
|
|
1064
|
+
typeof this.userCode === "string" ? import_safe2.Bytes.from(this.userCode, "ascii") : this.userCode
|
|
1065
|
+
]);
|
|
1066
|
+
return super.serialize(ctx);
|
|
1067
|
+
}
|
|
1068
|
+
toLogEntry(ctx) {
|
|
1069
|
+
return {
|
|
1070
|
+
...super.toLogEntry(ctx),
|
|
1071
|
+
message: {
|
|
1072
|
+
"user id": this.userId,
|
|
1073
|
+
"id status": (0, import_safe3.getEnumMemberName)(import_Types.UserIDStatus, this.userIdStatus),
|
|
1074
|
+
"user code": userCodeToLogString(this.userCode)
|
|
1075
|
+
}
|
|
1076
|
+
};
|
|
1077
|
+
}
|
|
1078
|
+
};
|
|
1079
|
+
return UserCodeCCSet2 = _classThis;
|
|
1080
|
+
})();
|
|
1081
|
+
let UserCodeCCReport = (() => {
|
|
1082
|
+
let _classDecorators = [(0, import_CommandClassDecorators.CCCommand)(import_Types.UserCodeCommand.Report)];
|
|
1083
|
+
let _classDescriptor;
|
|
1084
|
+
let _classExtraInitializers = [];
|
|
1085
|
+
let _classThis;
|
|
1086
|
+
let _classSuper = UserCodeCC;
|
|
1087
|
+
var UserCodeCCReport2 = class extends _classSuper {
|
|
1088
|
+
static {
|
|
1089
|
+
_classThis = this;
|
|
1090
|
+
}
|
|
1091
|
+
static {
|
|
1092
|
+
const _metadata = typeof Symbol === "function" && Symbol.metadata ? Object.create(_classSuper[Symbol.metadata] ?? null) : void 0;
|
|
1093
|
+
__esDecorate(null, _classDescriptor = { value: _classThis }, _classDecorators, { kind: "class", name: _classThis.name, metadata: _metadata }, null, _classExtraInitializers);
|
|
1094
|
+
UserCodeCCReport2 = _classThis = _classDescriptor.value;
|
|
1095
|
+
if (_metadata) Object.defineProperty(_classThis, Symbol.metadata, { enumerable: true, configurable: true, writable: true, value: _metadata });
|
|
1096
|
+
__runInitializers(_classThis, _classExtraInitializers);
|
|
1097
|
+
}
|
|
1098
|
+
constructor(options) {
|
|
1099
|
+
super(options);
|
|
1100
|
+
this.userId = options.userId;
|
|
1101
|
+
this.userIdStatus = options.userIdStatus;
|
|
1102
|
+
this.userCode = options.userCode ?? "";
|
|
1103
|
+
}
|
|
1104
|
+
static from(raw, ctx) {
|
|
1105
|
+
(0, import_safe.validatePayload)(raw.payload.length >= 2);
|
|
1106
|
+
const userId = raw.payload[0];
|
|
1107
|
+
const userIdStatus = raw.payload[1];
|
|
1108
|
+
let userCode;
|
|
1109
|
+
if (raw.payload.length === 2 && (userIdStatus === import_Types.UserIDStatus.Available || userIdStatus === import_Types.UserIDStatus.StatusNotAvailable)) {
|
|
1110
|
+
userCode = "";
|
|
1111
|
+
} else {
|
|
1112
|
+
(0, import_safe.validatePayload)(raw.payload.length >= 6);
|
|
1113
|
+
let userCodeBuffer = raw.payload.subarray(2);
|
|
1114
|
+
while (userCodeBuffer.at(-1) === 0) {
|
|
1115
|
+
userCodeBuffer = userCodeBuffer.subarray(0, -1);
|
|
1116
|
+
}
|
|
1117
|
+
const userCodeString = userCodeBuffer.toString("utf8");
|
|
1118
|
+
if ((0, import_safe3.isPrintableASCII)(userCodeString)) {
|
|
1119
|
+
userCode = userCodeString;
|
|
1120
|
+
} else if ((0, import_safe3.isPrintableASCIIWithWhitespace)(userCodeString)) {
|
|
1121
|
+
userCode = userCodeString.trim();
|
|
855
1122
|
} else {
|
|
856
|
-
|
|
857
|
-
await api.get(userId);
|
|
858
|
-
}
|
|
1123
|
+
userCode = userCodeBuffer;
|
|
859
1124
|
}
|
|
860
1125
|
}
|
|
861
|
-
|
|
862
|
-
|
|
863
|
-
|
|
864
|
-
|
|
1126
|
+
return new this({
|
|
1127
|
+
nodeId: ctx.sourceNodeId,
|
|
1128
|
+
userId,
|
|
1129
|
+
userIdStatus,
|
|
1130
|
+
userCode
|
|
865
1131
|
});
|
|
866
|
-
for (let userId = 1; userId <= supportedUsers; userId++) {
|
|
867
|
-
await api.get(userId);
|
|
868
|
-
}
|
|
869
1132
|
}
|
|
870
|
-
|
|
871
|
-
|
|
872
|
-
|
|
873
|
-
|
|
874
|
-
|
|
875
|
-
|
|
876
|
-
|
|
877
|
-
|
|
878
|
-
|
|
879
|
-
|
|
880
|
-
|
|
881
|
-
|
|
882
|
-
|
|
883
|
-
|
|
884
|
-
|
|
885
|
-
/**
|
|
886
|
-
* Returns the supported user ID statuses.
|
|
887
|
-
* This only works AFTER the interview process
|
|
888
|
-
*/
|
|
889
|
-
static getSupportedUserIDStatusesCached(ctx, endpoint) {
|
|
890
|
-
return ctx.getValueDB(endpoint.nodeId).getValue(UserCodeCCValues.supportedUserIDStatuses.endpoint(endpoint.index));
|
|
891
|
-
}
|
|
892
|
-
/**
|
|
893
|
-
* Returns the supported ASCII characters.
|
|
894
|
-
* This only works AFTER the interview process
|
|
895
|
-
*/
|
|
896
|
-
static getSupportedASCIICharsCached(ctx, endpoint) {
|
|
897
|
-
return ctx.getValueDB(endpoint.nodeId).getValue(UserCodeCCValues.supportedASCIIChars.endpoint(endpoint.index));
|
|
898
|
-
}
|
|
899
|
-
/**
|
|
900
|
-
* Returns whether the admin code functionality is supported.
|
|
901
|
-
* This only works AFTER the interview process
|
|
902
|
-
*/
|
|
903
|
-
static supportsAdminCodeCached(ctx, endpoint) {
|
|
904
|
-
const valueDB = ctx.getValueDB(endpoint.nodeId);
|
|
905
|
-
return valueDB.getValue(UserCodeCCValues.supportsAdminCode.endpoint(endpoint.index)) ?? valueDB.getValue(UserCodeCCValues._deprecated_supportsMasterCode.endpoint(endpoint.index)) ?? false;
|
|
906
|
-
}
|
|
907
|
-
/**
|
|
908
|
-
* Returns whether deactivating the admin code is supported.
|
|
909
|
-
* This only works AFTER the interview process
|
|
910
|
-
*/
|
|
911
|
-
static supportsAdminCodeDeactivationCached(ctx, endpoint) {
|
|
912
|
-
const valueDB = ctx.getValueDB(endpoint.nodeId);
|
|
913
|
-
return valueDB.getValue(UserCodeCCValues.supportsAdminCodeDeactivation.endpoint(endpoint.index)) ?? valueDB.getValue(UserCodeCCValues._deprecated_supportsMasterCodeDeactivation.endpoint(endpoint.index)) ?? false;
|
|
914
|
-
}
|
|
915
|
-
/**
|
|
916
|
-
* Returns whether setting multiple user codes at once is supported.
|
|
917
|
-
* This only works AFTER the interview process
|
|
918
|
-
*/
|
|
919
|
-
static supportsMultipleUserCodeSetCached(ctx, endpoint) {
|
|
920
|
-
return !!ctx.getValueDB(endpoint.nodeId).getValue(UserCodeCCValues.supportsMultipleUserCodeSet.endpoint(endpoint.index));
|
|
921
|
-
}
|
|
922
|
-
/**
|
|
923
|
-
* Returns the current status of a user ID.
|
|
924
|
-
* This only works AFTER the user IDs have been queried.
|
|
925
|
-
*/
|
|
926
|
-
static getUserIdStatusCached(ctx, endpoint, userId) {
|
|
927
|
-
return ctx.getValueDB(endpoint.nodeId).getValue(UserCodeCCValues.userIdStatus(userId).endpoint(endpoint.index));
|
|
928
|
-
}
|
|
929
|
-
/**
|
|
930
|
-
* Returns the current code belonging to a user ID.
|
|
931
|
-
* This only works AFTER the user IDs have been queried.
|
|
932
|
-
*/
|
|
933
|
-
static getUserCodeCached(ctx, endpoint, userId) {
|
|
934
|
-
return ctx.getValueDB(endpoint.nodeId).getValue(UserCodeCCValues.userCode(userId).endpoint(endpoint.index));
|
|
935
|
-
}
|
|
936
|
-
};
|
|
937
|
-
UserCodeCC = UserCodeCC_1 = __decorate([
|
|
938
|
-
(0, import_CommandClassDecorators.commandClass)(import_safe.CommandClasses["User Code"]),
|
|
939
|
-
(0, import_CommandClassDecorators.implementedVersion)(2),
|
|
940
|
-
(0, import_CommandClassDecorators.ccValues)(UserCodeCCValues)
|
|
941
|
-
], UserCodeCC);
|
|
942
|
-
let UserCodeCCSet = UserCodeCCSet_1 = class UserCodeCCSet2 extends UserCodeCC {
|
|
943
|
-
constructor(options) {
|
|
944
|
-
super(options);
|
|
945
|
-
this.userId = options.userId;
|
|
946
|
-
this.userIdStatus = options.userIdStatus;
|
|
947
|
-
if (this.userId < 0) {
|
|
948
|
-
throw new import_safe.ZWaveError(`${this.constructor.name}: The user ID must be between greater than 0.`, import_safe.ZWaveErrorCodes.Argument_Invalid);
|
|
949
|
-
} else if (this.userId === 0 && this.userIdStatus !== import_Types.UserIDStatus.Available) {
|
|
950
|
-
throw new import_safe.ZWaveError(`${this.constructor.name}: User ID 0 may only be used to clear all user codes`, import_safe.ZWaveErrorCodes.Argument_Invalid);
|
|
951
|
-
} else if (this.userIdStatus === import_Types.UserIDStatus.Available) {
|
|
952
|
-
this.userCode = "\0".repeat(4);
|
|
953
|
-
} else {
|
|
954
|
-
this.userCode = options.userCode;
|
|
955
|
-
if (this.userCode.length < 4 || this.userCode.length > 10) {
|
|
956
|
-
throw new import_safe.ZWaveError(`${this.constructor.name}: The user code must have a length of 4 to 10 ${typeof this.userCode === "string" ? "characters" : "bytes"}`, import_safe.ZWaveErrorCodes.Argument_Invalid);
|
|
1133
|
+
userId;
|
|
1134
|
+
userIdStatus;
|
|
1135
|
+
userCode;
|
|
1136
|
+
persistValues(ctx) {
|
|
1137
|
+
if (!super.persistValues(ctx))
|
|
1138
|
+
return false;
|
|
1139
|
+
persistUserCode.call(this, ctx, this.userId, this.userIdStatus, this.userCode);
|
|
1140
|
+
return true;
|
|
1141
|
+
}
|
|
1142
|
+
serialize(ctx) {
|
|
1143
|
+
let userCodeBuffer;
|
|
1144
|
+
if (typeof this.userCode === "string") {
|
|
1145
|
+
userCodeBuffer = import_safe2.Bytes.from(this.userCode, "ascii");
|
|
1146
|
+
} else {
|
|
1147
|
+
userCodeBuffer = this.userCode;
|
|
957
1148
|
}
|
|
1149
|
+
this.payload = import_safe2.Bytes.concat([
|
|
1150
|
+
import_safe2.Bytes.from([this.userId, this.userIdStatus]),
|
|
1151
|
+
userCodeBuffer
|
|
1152
|
+
]);
|
|
1153
|
+
return super.serialize(ctx);
|
|
958
1154
|
}
|
|
959
|
-
|
|
960
|
-
|
|
961
|
-
|
|
962
|
-
|
|
963
|
-
|
|
964
|
-
|
|
965
|
-
|
|
966
|
-
|
|
967
|
-
|
|
968
|
-
|
|
1155
|
+
toLogEntry(ctx) {
|
|
1156
|
+
return {
|
|
1157
|
+
...super.toLogEntry(ctx),
|
|
1158
|
+
message: {
|
|
1159
|
+
"user id": this.userId,
|
|
1160
|
+
"id status": (0, import_safe3.getEnumMemberName)(import_Types.UserIDStatus, this.userIdStatus),
|
|
1161
|
+
"user code": userCodeToLogString(this.userCode)
|
|
1162
|
+
}
|
|
1163
|
+
};
|
|
1164
|
+
}
|
|
1165
|
+
// eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types
|
|
1166
|
+
toNotificationEventParameters() {
|
|
1167
|
+
return { userId: this.userId };
|
|
1168
|
+
}
|
|
1169
|
+
};
|
|
1170
|
+
return UserCodeCCReport2 = _classThis;
|
|
1171
|
+
})();
|
|
1172
|
+
let UserCodeCCGet = (() => {
|
|
1173
|
+
let _classDecorators = [(0, import_CommandClassDecorators.CCCommand)(import_Types.UserCodeCommand.Get), (0, import_CommandClassDecorators.expectedCCResponse)(UserCodeCCReport)];
|
|
1174
|
+
let _classDescriptor;
|
|
1175
|
+
let _classExtraInitializers = [];
|
|
1176
|
+
let _classThis;
|
|
1177
|
+
let _classSuper = UserCodeCC;
|
|
1178
|
+
var UserCodeCCGet2 = class extends _classSuper {
|
|
1179
|
+
static {
|
|
1180
|
+
_classThis = this;
|
|
1181
|
+
}
|
|
1182
|
+
static {
|
|
1183
|
+
const _metadata = typeof Symbol === "function" && Symbol.metadata ? Object.create(_classSuper[Symbol.metadata] ?? null) : void 0;
|
|
1184
|
+
__esDecorate(null, _classDescriptor = { value: _classThis }, _classDecorators, { kind: "class", name: _classThis.name, metadata: _metadata }, null, _classExtraInitializers);
|
|
1185
|
+
UserCodeCCGet2 = _classThis = _classDescriptor.value;
|
|
1186
|
+
if (_metadata) Object.defineProperty(_classThis, Symbol.metadata, { enumerable: true, configurable: true, writable: true, value: _metadata });
|
|
1187
|
+
__runInitializers(_classThis, _classExtraInitializers);
|
|
1188
|
+
}
|
|
1189
|
+
constructor(options) {
|
|
1190
|
+
super(options);
|
|
1191
|
+
this.userId = options.userId;
|
|
1192
|
+
}
|
|
1193
|
+
static from(raw, ctx) {
|
|
1194
|
+
(0, import_safe.validatePayload)(raw.payload.length >= 1);
|
|
1195
|
+
const userId = raw.payload[0];
|
|
1196
|
+
return new this({
|
|
969
1197
|
nodeId: ctx.sourceNodeId,
|
|
970
|
-
userId
|
|
971
|
-
userIdStatus
|
|
1198
|
+
userId
|
|
972
1199
|
});
|
|
973
1200
|
}
|
|
974
|
-
|
|
975
|
-
|
|
976
|
-
|
|
977
|
-
|
|
978
|
-
|
|
979
|
-
|
|
980
|
-
|
|
981
|
-
|
|
982
|
-
|
|
983
|
-
|
|
984
|
-
|
|
985
|
-
|
|
986
|
-
|
|
987
|
-
|
|
988
|
-
|
|
989
|
-
|
|
990
|
-
|
|
991
|
-
|
|
992
|
-
|
|
993
|
-
|
|
994
|
-
|
|
995
|
-
|
|
996
|
-
|
|
997
|
-
|
|
998
|
-
|
|
999
|
-
|
|
1000
|
-
|
|
1001
|
-
|
|
1002
|
-
};
|
|
1003
|
-
|
|
1004
|
-
|
|
1005
|
-
|
|
1006
|
-
|
|
1007
|
-
|
|
1008
|
-
|
|
1009
|
-
|
|
1010
|
-
|
|
1011
|
-
|
|
1012
|
-
|
|
1013
|
-
|
|
1014
|
-
static from(raw, ctx) {
|
|
1015
|
-
(0, import_safe.validatePayload)(raw.payload.length >= 2);
|
|
1016
|
-
const userId = raw.payload[0];
|
|
1017
|
-
const userIdStatus = raw.payload[1];
|
|
1018
|
-
let userCode;
|
|
1019
|
-
if (raw.payload.length === 2 && (userIdStatus === import_Types.UserIDStatus.Available || userIdStatus === import_Types.UserIDStatus.StatusNotAvailable)) {
|
|
1020
|
-
userCode = "";
|
|
1021
|
-
} else {
|
|
1022
|
-
(0, import_safe.validatePayload)(raw.payload.length >= 6);
|
|
1023
|
-
let userCodeBuffer = raw.payload.subarray(2);
|
|
1024
|
-
while (userCodeBuffer.at(-1) === 0) {
|
|
1025
|
-
userCodeBuffer = userCodeBuffer.subarray(0, -1);
|
|
1026
|
-
}
|
|
1027
|
-
const userCodeString = userCodeBuffer.toString("utf8");
|
|
1028
|
-
if ((0, import_safe3.isPrintableASCII)(userCodeString)) {
|
|
1029
|
-
userCode = userCodeString;
|
|
1030
|
-
} else if ((0, import_safe3.isPrintableASCIIWithWhitespace)(userCodeString)) {
|
|
1031
|
-
userCode = userCodeString.trim();
|
|
1201
|
+
userId;
|
|
1202
|
+
serialize(ctx) {
|
|
1203
|
+
this.payload = import_safe2.Bytes.from([this.userId]);
|
|
1204
|
+
return super.serialize(ctx);
|
|
1205
|
+
}
|
|
1206
|
+
toLogEntry(ctx) {
|
|
1207
|
+
return {
|
|
1208
|
+
...super.toLogEntry(ctx),
|
|
1209
|
+
message: { "user id": this.userId }
|
|
1210
|
+
};
|
|
1211
|
+
}
|
|
1212
|
+
};
|
|
1213
|
+
return UserCodeCCGet2 = _classThis;
|
|
1214
|
+
})();
|
|
1215
|
+
let UserCodeCCUsersNumberReport = (() => {
|
|
1216
|
+
let _classDecorators = [(0, import_CommandClassDecorators.CCCommand)(import_Types.UserCodeCommand.UsersNumberReport), (0, import_CommandClassDecorators.ccValueProperty)("supportedUsers", UserCodeCCValues.supportedUsers)];
|
|
1217
|
+
let _classDescriptor;
|
|
1218
|
+
let _classExtraInitializers = [];
|
|
1219
|
+
let _classThis;
|
|
1220
|
+
let _classSuper = UserCodeCC;
|
|
1221
|
+
var UserCodeCCUsersNumberReport2 = class extends _classSuper {
|
|
1222
|
+
static {
|
|
1223
|
+
_classThis = this;
|
|
1224
|
+
}
|
|
1225
|
+
static {
|
|
1226
|
+
const _metadata = typeof Symbol === "function" && Symbol.metadata ? Object.create(_classSuper[Symbol.metadata] ?? null) : void 0;
|
|
1227
|
+
__esDecorate(null, _classDescriptor = { value: _classThis }, _classDecorators, { kind: "class", name: _classThis.name, metadata: _metadata }, null, _classExtraInitializers);
|
|
1228
|
+
UserCodeCCUsersNumberReport2 = _classThis = _classDescriptor.value;
|
|
1229
|
+
if (_metadata) Object.defineProperty(_classThis, Symbol.metadata, { enumerable: true, configurable: true, writable: true, value: _metadata });
|
|
1230
|
+
__runInitializers(_classThis, _classExtraInitializers);
|
|
1231
|
+
}
|
|
1232
|
+
constructor(options) {
|
|
1233
|
+
super(options);
|
|
1234
|
+
this.supportedUsers = options.supportedUsers;
|
|
1235
|
+
}
|
|
1236
|
+
static from(raw, ctx) {
|
|
1237
|
+
(0, import_safe.validatePayload)(raw.payload.length >= 1);
|
|
1238
|
+
let supportedUsers;
|
|
1239
|
+
if (raw.payload.length >= 3) {
|
|
1240
|
+
supportedUsers = raw.payload.readUInt16BE(1);
|
|
1032
1241
|
} else {
|
|
1033
|
-
|
|
1242
|
+
supportedUsers = raw.payload[0];
|
|
1034
1243
|
}
|
|
1244
|
+
return new this({
|
|
1245
|
+
nodeId: ctx.sourceNodeId,
|
|
1246
|
+
supportedUsers
|
|
1247
|
+
});
|
|
1035
1248
|
}
|
|
1036
|
-
|
|
1037
|
-
|
|
1038
|
-
|
|
1039
|
-
|
|
1040
|
-
|
|
1041
|
-
|
|
1042
|
-
|
|
1043
|
-
|
|
1044
|
-
|
|
1045
|
-
|
|
1046
|
-
|
|
1047
|
-
|
|
1048
|
-
|
|
1049
|
-
|
|
1050
|
-
|
|
1051
|
-
|
|
1052
|
-
|
|
1053
|
-
|
|
1054
|
-
|
|
1055
|
-
|
|
1056
|
-
|
|
1057
|
-
|
|
1058
|
-
|
|
1059
|
-
|
|
1060
|
-
|
|
1061
|
-
|
|
1062
|
-
|
|
1063
|
-
|
|
1064
|
-
|
|
1065
|
-
|
|
1066
|
-
|
|
1067
|
-
|
|
1068
|
-
|
|
1069
|
-
|
|
1070
|
-
|
|
1071
|
-
|
|
1072
|
-
|
|
1073
|
-
|
|
1074
|
-
|
|
1075
|
-
|
|
1076
|
-
|
|
1077
|
-
|
|
1078
|
-
|
|
1079
|
-
|
|
1080
|
-
|
|
1081
|
-
|
|
1082
|
-
|
|
1083
|
-
|
|
1084
|
-
|
|
1085
|
-
|
|
1086
|
-
|
|
1087
|
-
|
|
1088
|
-
|
|
1089
|
-
(
|
|
1090
|
-
|
|
1091
|
-
|
|
1092
|
-
|
|
1093
|
-
|
|
1094
|
-
|
|
1095
|
-
|
|
1096
|
-
|
|
1097
|
-
|
|
1098
|
-
|
|
1099
|
-
|
|
1100
|
-
|
|
1101
|
-
|
|
1102
|
-
|
|
1103
|
-
|
|
1104
|
-
|
|
1105
|
-
|
|
1106
|
-
|
|
1107
|
-
|
|
1108
|
-
|
|
1109
|
-
|
|
1110
|
-
|
|
1111
|
-
]
|
|
1112
|
-
|
|
1113
|
-
|
|
1114
|
-
|
|
1115
|
-
|
|
1116
|
-
|
|
1117
|
-
|
|
1118
|
-
|
|
1119
|
-
|
|
1120
|
-
|
|
1121
|
-
|
|
1122
|
-
|
|
1123
|
-
|
|
1124
|
-
|
|
1125
|
-
|
|
1126
|
-
|
|
1127
|
-
|
|
1128
|
-
|
|
1129
|
-
|
|
1130
|
-
|
|
1131
|
-
|
|
1132
|
-
|
|
1133
|
-
|
|
1134
|
-
|
|
1135
|
-
|
|
1136
|
-
|
|
1137
|
-
|
|
1138
|
-
|
|
1139
|
-
|
|
1140
|
-
|
|
1141
|
-
|
|
1142
|
-
|
|
1143
|
-
|
|
1144
|
-
|
|
1145
|
-
|
|
1146
|
-
|
|
1147
|
-
|
|
1148
|
-
|
|
1149
|
-
|
|
1150
|
-
|
|
1151
|
-
|
|
1152
|
-
|
|
1153
|
-
|
|
1154
|
-
|
|
1155
|
-
],
|
|
1156
|
-
|
|
1157
|
-
|
|
1158
|
-
|
|
1159
|
-
|
|
1160
|
-
|
|
1161
|
-
|
|
1162
|
-
|
|
1163
|
-
|
|
1164
|
-
|
|
1165
|
-
|
|
1166
|
-
|
|
1167
|
-
|
|
1168
|
-
|
|
1169
|
-
|
|
1170
|
-
(0, import_safe.validatePayload)(raw.payload.length >= offset + 1);
|
|
1171
|
-
const supportsAdminCode = !!(raw.payload[offset] & 128);
|
|
1172
|
-
const supportsAdminCodeDeactivation = !!(raw.payload[offset] & 64);
|
|
1173
|
-
const statusBitMaskLength = raw.payload[offset] & 31;
|
|
1174
|
-
offset += 1;
|
|
1175
|
-
(0, import_safe.validatePayload)(raw.payload.length >= offset + statusBitMaskLength + 1);
|
|
1176
|
-
const supportedUserIDStatuses = (0, import_safe.parseBitMask)(raw.payload.subarray(offset, offset + statusBitMaskLength), import_Types.UserIDStatus.Available);
|
|
1177
|
-
offset += statusBitMaskLength;
|
|
1178
|
-
const supportsUserCodeChecksum = !!(raw.payload[offset] & 128);
|
|
1179
|
-
const supportsMultipleUserCodeReport = !!(raw.payload[offset] & 64);
|
|
1180
|
-
const supportsMultipleUserCodeSet = !!(raw.payload[offset] & 32);
|
|
1181
|
-
const keypadModesBitMaskLength = raw.payload[offset] & 31;
|
|
1182
|
-
offset += 1;
|
|
1183
|
-
(0, import_safe.validatePayload)(raw.payload.length >= offset + keypadModesBitMaskLength + 1);
|
|
1184
|
-
const supportedKeypadModes = (0, import_safe.parseBitMask)(raw.payload.subarray(offset, offset + keypadModesBitMaskLength), import_Types.KeypadMode.Normal);
|
|
1185
|
-
offset += keypadModesBitMaskLength;
|
|
1186
|
-
const keysBitMaskLength = raw.payload[offset] & 31;
|
|
1187
|
-
offset += 1;
|
|
1188
|
-
(0, import_safe.validatePayload)(raw.payload.length >= offset + keysBitMaskLength);
|
|
1189
|
-
const supportedASCIIChars = import_safe2.Bytes.from((0, import_safe.parseBitMask)(raw.payload.subarray(offset, offset + keysBitMaskLength), 0)).toString("ascii");
|
|
1190
|
-
return new UserCodeCCCapabilitiesReport_1({
|
|
1191
|
-
nodeId: ctx.sourceNodeId,
|
|
1192
|
-
supportsAdminCode,
|
|
1193
|
-
supportsAdminCodeDeactivation,
|
|
1194
|
-
supportedUserIDStatuses,
|
|
1195
|
-
supportsUserCodeChecksum,
|
|
1196
|
-
supportsMultipleUserCodeReport,
|
|
1197
|
-
supportsMultipleUserCodeSet,
|
|
1198
|
-
supportedKeypadModes,
|
|
1199
|
-
supportedASCIIChars
|
|
1200
|
-
});
|
|
1201
|
-
}
|
|
1202
|
-
supportsAdminCode;
|
|
1203
|
-
supportsAdminCodeDeactivation;
|
|
1204
|
-
supportsUserCodeChecksum;
|
|
1205
|
-
supportsMultipleUserCodeReport;
|
|
1206
|
-
supportsMultipleUserCodeSet;
|
|
1207
|
-
supportedUserIDStatuses;
|
|
1208
|
-
supportedKeypadModes;
|
|
1209
|
-
supportedASCIIChars;
|
|
1210
|
-
serialize(ctx) {
|
|
1211
|
-
const supportedStatusesBitmask = (0, import_safe.encodeBitMask)(this.supportedUserIDStatuses, void 0, import_Types.UserIDStatus.Available);
|
|
1212
|
-
const controlByte1 = (this.supportsAdminCode ? 128 : 0) | (this.supportsAdminCodeDeactivation ? 64 : 0) | supportedStatusesBitmask.length & 31;
|
|
1213
|
-
const supportedKeypadModesBitmask = (0, import_safe.encodeBitMask)(this.supportedKeypadModes, void 0, import_Types.KeypadMode.Normal);
|
|
1214
|
-
const controlByte2 = (this.supportsUserCodeChecksum ? 128 : 0) | (this.supportsMultipleUserCodeReport ? 64 : 0) | (this.supportsMultipleUserCodeSet ? 32 : 0) | supportedKeypadModesBitmask.length & 31;
|
|
1215
|
-
const keysAsNumbers = [...this.supportedASCIIChars].map((char) => char.charCodeAt(0));
|
|
1216
|
-
const supportedKeysBitmask = (0, import_safe.encodeBitMask)(keysAsNumbers, void 0, 0);
|
|
1217
|
-
const controlByte3 = supportedKeysBitmask.length & 31;
|
|
1218
|
-
this.payload = import_safe2.Bytes.concat([
|
|
1219
|
-
import_safe2.Bytes.from([controlByte1]),
|
|
1220
|
-
supportedStatusesBitmask,
|
|
1221
|
-
import_safe2.Bytes.from([controlByte2]),
|
|
1222
|
-
supportedKeypadModesBitmask,
|
|
1223
|
-
import_safe2.Bytes.from([controlByte3]),
|
|
1224
|
-
supportedKeysBitmask
|
|
1225
|
-
]);
|
|
1226
|
-
return super.serialize(ctx);
|
|
1227
|
-
}
|
|
1228
|
-
toLogEntry(ctx) {
|
|
1229
|
-
return {
|
|
1230
|
-
...super.toLogEntry(ctx),
|
|
1231
|
-
message: {
|
|
1232
|
-
"supports admin code": this.supportsAdminCode,
|
|
1233
|
-
"supports admin code deactivation": this.supportsAdminCodeDeactivation,
|
|
1234
|
-
"supports user code checksum": this.supportsUserCodeChecksum,
|
|
1235
|
-
"supports multiple codes in report": this.supportsMultipleUserCodeReport,
|
|
1236
|
-
"supports multiple codes in set": this.supportsMultipleUserCodeSet,
|
|
1237
|
-
"supported user id statuses": this.supportedUserIDStatuses.map((status) => `
|
|
1249
|
+
supportedUsers;
|
|
1250
|
+
serialize(ctx) {
|
|
1251
|
+
this.payload = new import_safe2.Bytes(3);
|
|
1252
|
+
this.payload[0] = Math.min(255, this.supportedUsers);
|
|
1253
|
+
this.payload.writeUInt16BE(this.supportedUsers, 1);
|
|
1254
|
+
return super.serialize(ctx);
|
|
1255
|
+
}
|
|
1256
|
+
toLogEntry(ctx) {
|
|
1257
|
+
return {
|
|
1258
|
+
...super.toLogEntry(ctx),
|
|
1259
|
+
message: { "supported users": this.supportedUsers }
|
|
1260
|
+
};
|
|
1261
|
+
}
|
|
1262
|
+
};
|
|
1263
|
+
return UserCodeCCUsersNumberReport2 = _classThis;
|
|
1264
|
+
})();
|
|
1265
|
+
let UserCodeCCUsersNumberGet = (() => {
|
|
1266
|
+
let _classDecorators = [(0, import_CommandClassDecorators.CCCommand)(import_Types.UserCodeCommand.UsersNumberGet), (0, import_CommandClassDecorators.expectedCCResponse)(UserCodeCCUsersNumberReport)];
|
|
1267
|
+
let _classDescriptor;
|
|
1268
|
+
let _classExtraInitializers = [];
|
|
1269
|
+
let _classThis;
|
|
1270
|
+
let _classSuper = UserCodeCC;
|
|
1271
|
+
var UserCodeCCUsersNumberGet2 = class extends _classSuper {
|
|
1272
|
+
static {
|
|
1273
|
+
_classThis = this;
|
|
1274
|
+
}
|
|
1275
|
+
static {
|
|
1276
|
+
const _metadata = typeof Symbol === "function" && Symbol.metadata ? Object.create(_classSuper[Symbol.metadata] ?? null) : void 0;
|
|
1277
|
+
__esDecorate(null, _classDescriptor = { value: _classThis }, _classDecorators, { kind: "class", name: _classThis.name, metadata: _metadata }, null, _classExtraInitializers);
|
|
1278
|
+
UserCodeCCUsersNumberGet2 = _classThis = _classDescriptor.value;
|
|
1279
|
+
if (_metadata) Object.defineProperty(_classThis, Symbol.metadata, { enumerable: true, configurable: true, writable: true, value: _metadata });
|
|
1280
|
+
__runInitializers(_classThis, _classExtraInitializers);
|
|
1281
|
+
}
|
|
1282
|
+
};
|
|
1283
|
+
return UserCodeCCUsersNumberGet2 = _classThis;
|
|
1284
|
+
})();
|
|
1285
|
+
let UserCodeCCCapabilitiesReport = (() => {
|
|
1286
|
+
let _classDecorators = [(0, import_CommandClassDecorators.CCCommand)(import_Types.UserCodeCommand.CapabilitiesReport), (0, import_CommandClassDecorators.ccValueProperty)("supportsAdminCode", UserCodeCCValues.supportsAdminCode), (0, import_CommandClassDecorators.ccValueProperty)("supportsAdminCodeDeactivation", UserCodeCCValues.supportsAdminCodeDeactivation), (0, import_CommandClassDecorators.ccValueProperty)("supportsUserCodeChecksum", UserCodeCCValues.supportsUserCodeChecksum), (0, import_CommandClassDecorators.ccValueProperty)("supportsMultipleUserCodeReport", UserCodeCCValues.supportsMultipleUserCodeReport), (0, import_CommandClassDecorators.ccValueProperty)("supportsMultipleUserCodeSet", UserCodeCCValues.supportsMultipleUserCodeSet), (0, import_CommandClassDecorators.ccValueProperty)("supportedUserIDStatuses", UserCodeCCValues.supportedUserIDStatuses), (0, import_CommandClassDecorators.ccValueProperty)("supportedKeypadModes", UserCodeCCValues.supportedKeypadModes), (0, import_CommandClassDecorators.ccValueProperty)("supportedASCIIChars", UserCodeCCValues.supportedASCIIChars)];
|
|
1287
|
+
let _classDescriptor;
|
|
1288
|
+
let _classExtraInitializers = [];
|
|
1289
|
+
let _classThis;
|
|
1290
|
+
let _classSuper = UserCodeCC;
|
|
1291
|
+
var UserCodeCCCapabilitiesReport2 = class extends _classSuper {
|
|
1292
|
+
static {
|
|
1293
|
+
_classThis = this;
|
|
1294
|
+
}
|
|
1295
|
+
static {
|
|
1296
|
+
const _metadata = typeof Symbol === "function" && Symbol.metadata ? Object.create(_classSuper[Symbol.metadata] ?? null) : void 0;
|
|
1297
|
+
__esDecorate(null, _classDescriptor = { value: _classThis }, _classDecorators, { kind: "class", name: _classThis.name, metadata: _metadata }, null, _classExtraInitializers);
|
|
1298
|
+
UserCodeCCCapabilitiesReport2 = _classThis = _classDescriptor.value;
|
|
1299
|
+
if (_metadata) Object.defineProperty(_classThis, Symbol.metadata, { enumerable: true, configurable: true, writable: true, value: _metadata });
|
|
1300
|
+
__runInitializers(_classThis, _classExtraInitializers);
|
|
1301
|
+
}
|
|
1302
|
+
constructor(options) {
|
|
1303
|
+
super(options);
|
|
1304
|
+
this.supportsAdminCode = options.supportsAdminCode;
|
|
1305
|
+
this.supportsAdminCodeDeactivation = options.supportsAdminCodeDeactivation;
|
|
1306
|
+
this.supportsUserCodeChecksum = options.supportsUserCodeChecksum;
|
|
1307
|
+
this.supportsMultipleUserCodeReport = options.supportsMultipleUserCodeReport;
|
|
1308
|
+
this.supportsMultipleUserCodeSet = options.supportsMultipleUserCodeSet;
|
|
1309
|
+
this.supportedUserIDStatuses = options.supportedUserIDStatuses;
|
|
1310
|
+
this.supportedKeypadModes = options.supportedKeypadModes;
|
|
1311
|
+
this.supportedASCIIChars = options.supportedASCIIChars;
|
|
1312
|
+
}
|
|
1313
|
+
static from(raw, ctx) {
|
|
1314
|
+
let offset = 0;
|
|
1315
|
+
(0, import_safe.validatePayload)(raw.payload.length >= offset + 1);
|
|
1316
|
+
const supportsAdminCode = !!(raw.payload[offset] & 128);
|
|
1317
|
+
const supportsAdminCodeDeactivation = !!(raw.payload[offset] & 64);
|
|
1318
|
+
const statusBitMaskLength = raw.payload[offset] & 31;
|
|
1319
|
+
offset += 1;
|
|
1320
|
+
(0, import_safe.validatePayload)(raw.payload.length >= offset + statusBitMaskLength + 1);
|
|
1321
|
+
const supportedUserIDStatuses = (0, import_safe.parseBitMask)(raw.payload.subarray(offset, offset + statusBitMaskLength), import_Types.UserIDStatus.Available);
|
|
1322
|
+
offset += statusBitMaskLength;
|
|
1323
|
+
const supportsUserCodeChecksum = !!(raw.payload[offset] & 128);
|
|
1324
|
+
const supportsMultipleUserCodeReport = !!(raw.payload[offset] & 64);
|
|
1325
|
+
const supportsMultipleUserCodeSet = !!(raw.payload[offset] & 32);
|
|
1326
|
+
const keypadModesBitMaskLength = raw.payload[offset] & 31;
|
|
1327
|
+
offset += 1;
|
|
1328
|
+
(0, import_safe.validatePayload)(raw.payload.length >= offset + keypadModesBitMaskLength + 1);
|
|
1329
|
+
const supportedKeypadModes = (0, import_safe.parseBitMask)(raw.payload.subarray(offset, offset + keypadModesBitMaskLength), import_Types.KeypadMode.Normal);
|
|
1330
|
+
offset += keypadModesBitMaskLength;
|
|
1331
|
+
const keysBitMaskLength = raw.payload[offset] & 31;
|
|
1332
|
+
offset += 1;
|
|
1333
|
+
(0, import_safe.validatePayload)(raw.payload.length >= offset + keysBitMaskLength);
|
|
1334
|
+
const supportedASCIIChars = import_safe2.Bytes.from((0, import_safe.parseBitMask)(raw.payload.subarray(offset, offset + keysBitMaskLength), 0)).toString("ascii");
|
|
1335
|
+
return new this({
|
|
1336
|
+
nodeId: ctx.sourceNodeId,
|
|
1337
|
+
supportsAdminCode,
|
|
1338
|
+
supportsAdminCodeDeactivation,
|
|
1339
|
+
supportedUserIDStatuses,
|
|
1340
|
+
supportsUserCodeChecksum,
|
|
1341
|
+
supportsMultipleUserCodeReport,
|
|
1342
|
+
supportsMultipleUserCodeSet,
|
|
1343
|
+
supportedKeypadModes,
|
|
1344
|
+
supportedASCIIChars
|
|
1345
|
+
});
|
|
1346
|
+
}
|
|
1347
|
+
supportsAdminCode;
|
|
1348
|
+
supportsAdminCodeDeactivation;
|
|
1349
|
+
supportsUserCodeChecksum;
|
|
1350
|
+
supportsMultipleUserCodeReport;
|
|
1351
|
+
supportsMultipleUserCodeSet;
|
|
1352
|
+
supportedUserIDStatuses;
|
|
1353
|
+
supportedKeypadModes;
|
|
1354
|
+
supportedASCIIChars;
|
|
1355
|
+
serialize(ctx) {
|
|
1356
|
+
const supportedStatusesBitmask = (0, import_safe.encodeBitMask)(this.supportedUserIDStatuses, void 0, import_Types.UserIDStatus.Available);
|
|
1357
|
+
const controlByte1 = (this.supportsAdminCode ? 128 : 0) | (this.supportsAdminCodeDeactivation ? 64 : 0) | supportedStatusesBitmask.length & 31;
|
|
1358
|
+
const supportedKeypadModesBitmask = (0, import_safe.encodeBitMask)(this.supportedKeypadModes, void 0, import_Types.KeypadMode.Normal);
|
|
1359
|
+
const controlByte2 = (this.supportsUserCodeChecksum ? 128 : 0) | (this.supportsMultipleUserCodeReport ? 64 : 0) | (this.supportsMultipleUserCodeSet ? 32 : 0) | supportedKeypadModesBitmask.length & 31;
|
|
1360
|
+
const keysAsNumbers = [...this.supportedASCIIChars].map((char) => char.charCodeAt(0));
|
|
1361
|
+
const supportedKeysBitmask = (0, import_safe.encodeBitMask)(keysAsNumbers, void 0, 0);
|
|
1362
|
+
const controlByte3 = supportedKeysBitmask.length & 31;
|
|
1363
|
+
this.payload = import_safe2.Bytes.concat([
|
|
1364
|
+
import_safe2.Bytes.from([controlByte1]),
|
|
1365
|
+
supportedStatusesBitmask,
|
|
1366
|
+
import_safe2.Bytes.from([controlByte2]),
|
|
1367
|
+
supportedKeypadModesBitmask,
|
|
1368
|
+
import_safe2.Bytes.from([controlByte3]),
|
|
1369
|
+
supportedKeysBitmask
|
|
1370
|
+
]);
|
|
1371
|
+
return super.serialize(ctx);
|
|
1372
|
+
}
|
|
1373
|
+
toLogEntry(ctx) {
|
|
1374
|
+
return {
|
|
1375
|
+
...super.toLogEntry(ctx),
|
|
1376
|
+
message: {
|
|
1377
|
+
"supports admin code": this.supportsAdminCode,
|
|
1378
|
+
"supports admin code deactivation": this.supportsAdminCodeDeactivation,
|
|
1379
|
+
"supports user code checksum": this.supportsUserCodeChecksum,
|
|
1380
|
+
"supports multiple codes in report": this.supportsMultipleUserCodeReport,
|
|
1381
|
+
"supports multiple codes in set": this.supportsMultipleUserCodeSet,
|
|
1382
|
+
"supported user id statuses": this.supportedUserIDStatuses.map((status) => `
|
|
1238
1383
|
\xB7 ${(0, import_safe3.getEnumMemberName)(import_Types.UserIDStatus, status)}`).join(""),
|
|
1239
|
-
|
|
1384
|
+
"supported keypad modes": this.supportedKeypadModes.map((mode) => `
|
|
1240
1385
|
\xB7 ${(0, import_safe3.getEnumMemberName)(import_Types.KeypadMode, mode)}`).join(""),
|
|
1241
|
-
|
|
1386
|
+
"supported ASCII chars": this.supportedASCIIChars
|
|
1387
|
+
}
|
|
1388
|
+
};
|
|
1389
|
+
}
|
|
1390
|
+
};
|
|
1391
|
+
return UserCodeCCCapabilitiesReport2 = _classThis;
|
|
1392
|
+
})();
|
|
1393
|
+
let UserCodeCCCapabilitiesGet = (() => {
|
|
1394
|
+
let _classDecorators = [(0, import_CommandClassDecorators.CCCommand)(import_Types.UserCodeCommand.CapabilitiesGet), (0, import_CommandClassDecorators.expectedCCResponse)(UserCodeCCCapabilitiesReport)];
|
|
1395
|
+
let _classDescriptor;
|
|
1396
|
+
let _classExtraInitializers = [];
|
|
1397
|
+
let _classThis;
|
|
1398
|
+
let _classSuper = UserCodeCC;
|
|
1399
|
+
var UserCodeCCCapabilitiesGet2 = class extends _classSuper {
|
|
1400
|
+
static {
|
|
1401
|
+
_classThis = this;
|
|
1402
|
+
}
|
|
1403
|
+
static {
|
|
1404
|
+
const _metadata = typeof Symbol === "function" && Symbol.metadata ? Object.create(_classSuper[Symbol.metadata] ?? null) : void 0;
|
|
1405
|
+
__esDecorate(null, _classDescriptor = { value: _classThis }, _classDecorators, { kind: "class", name: _classThis.name, metadata: _metadata }, null, _classExtraInitializers);
|
|
1406
|
+
UserCodeCCCapabilitiesGet2 = _classThis = _classDescriptor.value;
|
|
1407
|
+
if (_metadata) Object.defineProperty(_classThis, Symbol.metadata, { enumerable: true, configurable: true, writable: true, value: _metadata });
|
|
1408
|
+
__runInitializers(_classThis, _classExtraInitializers);
|
|
1409
|
+
}
|
|
1410
|
+
};
|
|
1411
|
+
return UserCodeCCCapabilitiesGet2 = _classThis;
|
|
1412
|
+
})();
|
|
1413
|
+
let UserCodeCCKeypadModeSet = (() => {
|
|
1414
|
+
let _classDecorators = [(0, import_CommandClassDecorators.CCCommand)(import_Types.UserCodeCommand.KeypadModeSet), (0, import_CommandClassDecorators.useSupervision)()];
|
|
1415
|
+
let _classDescriptor;
|
|
1416
|
+
let _classExtraInitializers = [];
|
|
1417
|
+
let _classThis;
|
|
1418
|
+
let _classSuper = UserCodeCC;
|
|
1419
|
+
var UserCodeCCKeypadModeSet2 = class extends _classSuper {
|
|
1420
|
+
static {
|
|
1421
|
+
_classThis = this;
|
|
1422
|
+
}
|
|
1423
|
+
static {
|
|
1424
|
+
const _metadata = typeof Symbol === "function" && Symbol.metadata ? Object.create(_classSuper[Symbol.metadata] ?? null) : void 0;
|
|
1425
|
+
__esDecorate(null, _classDescriptor = { value: _classThis }, _classDecorators, { kind: "class", name: _classThis.name, metadata: _metadata }, null, _classExtraInitializers);
|
|
1426
|
+
UserCodeCCKeypadModeSet2 = _classThis = _classDescriptor.value;
|
|
1427
|
+
if (_metadata) Object.defineProperty(_classThis, Symbol.metadata, { enumerable: true, configurable: true, writable: true, value: _metadata });
|
|
1428
|
+
__runInitializers(_classThis, _classExtraInitializers);
|
|
1429
|
+
}
|
|
1430
|
+
constructor(options) {
|
|
1431
|
+
super(options);
|
|
1432
|
+
this.keypadMode = options.keypadMode;
|
|
1433
|
+
}
|
|
1434
|
+
static from(raw, ctx) {
|
|
1435
|
+
(0, import_safe.validatePayload)(raw.payload.length >= 1);
|
|
1436
|
+
const keypadMode = raw.payload[0];
|
|
1437
|
+
return new this({
|
|
1438
|
+
nodeId: ctx.sourceNodeId,
|
|
1439
|
+
keypadMode
|
|
1440
|
+
});
|
|
1441
|
+
}
|
|
1442
|
+
keypadMode;
|
|
1443
|
+
serialize(ctx) {
|
|
1444
|
+
this.payload = import_safe2.Bytes.from([this.keypadMode]);
|
|
1445
|
+
return super.serialize(ctx);
|
|
1446
|
+
}
|
|
1447
|
+
toLogEntry(ctx) {
|
|
1448
|
+
return {
|
|
1449
|
+
...super.toLogEntry(ctx),
|
|
1450
|
+
message: { mode: (0, import_safe3.getEnumMemberName)(import_Types.KeypadMode, this.keypadMode) }
|
|
1451
|
+
};
|
|
1452
|
+
}
|
|
1453
|
+
};
|
|
1454
|
+
return UserCodeCCKeypadModeSet2 = _classThis;
|
|
1455
|
+
})();
|
|
1456
|
+
let UserCodeCCKeypadModeReport = (() => {
|
|
1457
|
+
let _classDecorators = [(0, import_CommandClassDecorators.CCCommand)(import_Types.UserCodeCommand.KeypadModeReport), (0, import_CommandClassDecorators.ccValueProperty)("keypadMode", UserCodeCCValues.keypadMode)];
|
|
1458
|
+
let _classDescriptor;
|
|
1459
|
+
let _classExtraInitializers = [];
|
|
1460
|
+
let _classThis;
|
|
1461
|
+
let _classSuper = UserCodeCC;
|
|
1462
|
+
var UserCodeCCKeypadModeReport2 = class extends _classSuper {
|
|
1463
|
+
static {
|
|
1464
|
+
_classThis = this;
|
|
1465
|
+
}
|
|
1466
|
+
static {
|
|
1467
|
+
const _metadata = typeof Symbol === "function" && Symbol.metadata ? Object.create(_classSuper[Symbol.metadata] ?? null) : void 0;
|
|
1468
|
+
__esDecorate(null, _classDescriptor = { value: _classThis }, _classDecorators, { kind: "class", name: _classThis.name, metadata: _metadata }, null, _classExtraInitializers);
|
|
1469
|
+
UserCodeCCKeypadModeReport2 = _classThis = _classDescriptor.value;
|
|
1470
|
+
if (_metadata) Object.defineProperty(_classThis, Symbol.metadata, { enumerable: true, configurable: true, writable: true, value: _metadata });
|
|
1471
|
+
__runInitializers(_classThis, _classExtraInitializers);
|
|
1472
|
+
}
|
|
1473
|
+
constructor(options) {
|
|
1474
|
+
super(options);
|
|
1475
|
+
this.keypadMode = options.keypadMode;
|
|
1476
|
+
}
|
|
1477
|
+
static from(raw, ctx) {
|
|
1478
|
+
(0, import_safe.validatePayload)(raw.payload.length >= 1);
|
|
1479
|
+
const keypadMode = raw.payload[0];
|
|
1480
|
+
return new this({
|
|
1481
|
+
nodeId: ctx.sourceNodeId,
|
|
1482
|
+
keypadMode
|
|
1483
|
+
});
|
|
1484
|
+
}
|
|
1485
|
+
persistValues(ctx) {
|
|
1486
|
+
if (!super.persistValues(ctx))
|
|
1487
|
+
return false;
|
|
1488
|
+
const supportedKeypadModes = this.getValue(ctx, UserCodeCCValues.supportedKeypadModes) ?? [this.keypadMode];
|
|
1489
|
+
const keypadModeValue = UserCodeCCValues.keypadMode;
|
|
1490
|
+
this.setMetadata(ctx, keypadModeValue, {
|
|
1491
|
+
...keypadModeValue.meta,
|
|
1492
|
+
states: (0, import_safe.enumValuesToMetadataStates)(import_Types.KeypadMode, supportedKeypadModes)
|
|
1493
|
+
});
|
|
1494
|
+
return true;
|
|
1495
|
+
}
|
|
1496
|
+
keypadMode;
|
|
1497
|
+
serialize(ctx) {
|
|
1498
|
+
this.payload = import_safe2.Bytes.from([this.keypadMode]);
|
|
1499
|
+
return super.serialize(ctx);
|
|
1500
|
+
}
|
|
1501
|
+
toLogEntry(ctx) {
|
|
1502
|
+
return {
|
|
1503
|
+
...super.toLogEntry(ctx),
|
|
1504
|
+
message: {
|
|
1505
|
+
keypadMode: (0, import_safe3.getEnumMemberName)(import_Types.KeypadMode, this.keypadMode)
|
|
1506
|
+
}
|
|
1507
|
+
};
|
|
1508
|
+
}
|
|
1509
|
+
};
|
|
1510
|
+
return UserCodeCCKeypadModeReport2 = _classThis;
|
|
1511
|
+
})();
|
|
1512
|
+
let UserCodeCCKeypadModeGet = (() => {
|
|
1513
|
+
let _classDecorators = [(0, import_CommandClassDecorators.CCCommand)(import_Types.UserCodeCommand.KeypadModeGet), (0, import_CommandClassDecorators.expectedCCResponse)(UserCodeCCKeypadModeReport)];
|
|
1514
|
+
let _classDescriptor;
|
|
1515
|
+
let _classExtraInitializers = [];
|
|
1516
|
+
let _classThis;
|
|
1517
|
+
let _classSuper = UserCodeCC;
|
|
1518
|
+
var UserCodeCCKeypadModeGet2 = class extends _classSuper {
|
|
1519
|
+
static {
|
|
1520
|
+
_classThis = this;
|
|
1521
|
+
}
|
|
1522
|
+
static {
|
|
1523
|
+
const _metadata = typeof Symbol === "function" && Symbol.metadata ? Object.create(_classSuper[Symbol.metadata] ?? null) : void 0;
|
|
1524
|
+
__esDecorate(null, _classDescriptor = { value: _classThis }, _classDecorators, { kind: "class", name: _classThis.name, metadata: _metadata }, null, _classExtraInitializers);
|
|
1525
|
+
UserCodeCCKeypadModeGet2 = _classThis = _classDescriptor.value;
|
|
1526
|
+
if (_metadata) Object.defineProperty(_classThis, Symbol.metadata, { enumerable: true, configurable: true, writable: true, value: _metadata });
|
|
1527
|
+
__runInitializers(_classThis, _classExtraInitializers);
|
|
1528
|
+
}
|
|
1529
|
+
};
|
|
1530
|
+
return UserCodeCCKeypadModeGet2 = _classThis;
|
|
1531
|
+
})();
|
|
1532
|
+
let UserCodeCCAdminCodeSet = (() => {
|
|
1533
|
+
let _classDecorators = [(0, import_CommandClassDecorators.CCCommand)(import_Types.UserCodeCommand.AdminCodeSet), (0, import_CommandClassDecorators.useSupervision)()];
|
|
1534
|
+
let _classDescriptor;
|
|
1535
|
+
let _classExtraInitializers = [];
|
|
1536
|
+
let _classThis;
|
|
1537
|
+
let _classSuper = UserCodeCC;
|
|
1538
|
+
var UserCodeCCAdminCodeSet2 = class extends _classSuper {
|
|
1539
|
+
static {
|
|
1540
|
+
_classThis = this;
|
|
1541
|
+
}
|
|
1542
|
+
static {
|
|
1543
|
+
const _metadata = typeof Symbol === "function" && Symbol.metadata ? Object.create(_classSuper[Symbol.metadata] ?? null) : void 0;
|
|
1544
|
+
__esDecorate(null, _classDescriptor = { value: _classThis }, _classDecorators, { kind: "class", name: _classThis.name, metadata: _metadata }, null, _classExtraInitializers);
|
|
1545
|
+
UserCodeCCAdminCodeSet2 = _classThis = _classDescriptor.value;
|
|
1546
|
+
if (_metadata) Object.defineProperty(_classThis, Symbol.metadata, { enumerable: true, configurable: true, writable: true, value: _metadata });
|
|
1547
|
+
__runInitializers(_classThis, _classExtraInitializers);
|
|
1548
|
+
}
|
|
1549
|
+
constructor(options) {
|
|
1550
|
+
super(options);
|
|
1551
|
+
this.adminCode = options.adminCode;
|
|
1552
|
+
}
|
|
1553
|
+
static from(raw, ctx) {
|
|
1554
|
+
(0, import_safe.validatePayload)(raw.payload.length >= 1);
|
|
1555
|
+
const codeLength = raw.payload[0] & 15;
|
|
1556
|
+
(0, import_safe.validatePayload)(raw.payload.length >= 1 + codeLength);
|
|
1557
|
+
const adminCode = raw.payload.subarray(1, 1 + codeLength).toString("ascii");
|
|
1558
|
+
return new this({
|
|
1559
|
+
nodeId: ctx.sourceNodeId,
|
|
1560
|
+
adminCode
|
|
1561
|
+
});
|
|
1562
|
+
}
|
|
1563
|
+
adminCode;
|
|
1564
|
+
serialize(ctx) {
|
|
1565
|
+
this.payload = import_safe2.Bytes.concat([
|
|
1566
|
+
import_safe2.Bytes.from([this.adminCode.length & 15]),
|
|
1567
|
+
import_safe2.Bytes.from(this.adminCode, "ascii")
|
|
1568
|
+
]);
|
|
1569
|
+
return super.serialize(ctx);
|
|
1570
|
+
}
|
|
1571
|
+
toLogEntry(ctx) {
|
|
1572
|
+
return {
|
|
1573
|
+
...super.toLogEntry(ctx),
|
|
1574
|
+
message: { "admin code": userCodeToLogString(this.adminCode) }
|
|
1575
|
+
};
|
|
1576
|
+
}
|
|
1577
|
+
};
|
|
1578
|
+
return UserCodeCCAdminCodeSet2 = _classThis;
|
|
1579
|
+
})();
|
|
1580
|
+
let UserCodeCCAdminCodeReport = (() => {
|
|
1581
|
+
let _classDecorators = [(0, import_CommandClassDecorators.CCCommand)(import_Types.UserCodeCommand.AdminCodeReport), (0, import_CommandClassDecorators.ccValueProperty)("adminCode", UserCodeCCValues.adminCode)];
|
|
1582
|
+
let _classDescriptor;
|
|
1583
|
+
let _classExtraInitializers = [];
|
|
1584
|
+
let _classThis;
|
|
1585
|
+
let _classSuper = UserCodeCC;
|
|
1586
|
+
var UserCodeCCAdminCodeReport2 = class extends _classSuper {
|
|
1587
|
+
static {
|
|
1588
|
+
_classThis = this;
|
|
1589
|
+
}
|
|
1590
|
+
static {
|
|
1591
|
+
const _metadata = typeof Symbol === "function" && Symbol.metadata ? Object.create(_classSuper[Symbol.metadata] ?? null) : void 0;
|
|
1592
|
+
__esDecorate(null, _classDescriptor = { value: _classThis }, _classDecorators, { kind: "class", name: _classThis.name, metadata: _metadata }, null, _classExtraInitializers);
|
|
1593
|
+
UserCodeCCAdminCodeReport2 = _classThis = _classDescriptor.value;
|
|
1594
|
+
if (_metadata) Object.defineProperty(_classThis, Symbol.metadata, { enumerable: true, configurable: true, writable: true, value: _metadata });
|
|
1595
|
+
__runInitializers(_classThis, _classExtraInitializers);
|
|
1596
|
+
}
|
|
1597
|
+
constructor(options) {
|
|
1598
|
+
super(options);
|
|
1599
|
+
this.adminCode = options.adminCode;
|
|
1600
|
+
}
|
|
1601
|
+
static from(raw, ctx) {
|
|
1602
|
+
(0, import_safe.validatePayload)(raw.payload.length >= 1);
|
|
1603
|
+
const codeLength = raw.payload[0] & 15;
|
|
1604
|
+
(0, import_safe.validatePayload)(raw.payload.length >= 1 + codeLength);
|
|
1605
|
+
const adminCode = raw.payload.subarray(1, 1 + codeLength).toString("ascii");
|
|
1606
|
+
return new this({
|
|
1607
|
+
nodeId: ctx.sourceNodeId,
|
|
1608
|
+
adminCode
|
|
1609
|
+
});
|
|
1610
|
+
}
|
|
1611
|
+
adminCode;
|
|
1612
|
+
serialize(ctx) {
|
|
1613
|
+
this.payload = import_safe2.Bytes.concat([
|
|
1614
|
+
import_safe2.Bytes.from([this.adminCode.length & 15]),
|
|
1615
|
+
import_safe2.Bytes.from(this.adminCode, "ascii")
|
|
1616
|
+
]);
|
|
1617
|
+
return super.serialize(ctx);
|
|
1618
|
+
}
|
|
1619
|
+
toLogEntry(ctx) {
|
|
1620
|
+
return {
|
|
1621
|
+
...super.toLogEntry(ctx),
|
|
1622
|
+
message: { "admin code": userCodeToLogString(this.adminCode) }
|
|
1623
|
+
};
|
|
1624
|
+
}
|
|
1625
|
+
};
|
|
1626
|
+
return UserCodeCCAdminCodeReport2 = _classThis;
|
|
1627
|
+
})();
|
|
1628
|
+
let UserCodeCCAdminCodeGet = (() => {
|
|
1629
|
+
let _classDecorators = [(0, import_CommandClassDecorators.CCCommand)(import_Types.UserCodeCommand.AdminCodeGet), (0, import_CommandClassDecorators.expectedCCResponse)(UserCodeCCAdminCodeReport)];
|
|
1630
|
+
let _classDescriptor;
|
|
1631
|
+
let _classExtraInitializers = [];
|
|
1632
|
+
let _classThis;
|
|
1633
|
+
let _classSuper = UserCodeCC;
|
|
1634
|
+
var UserCodeCCAdminCodeGet2 = class extends _classSuper {
|
|
1635
|
+
static {
|
|
1636
|
+
_classThis = this;
|
|
1637
|
+
}
|
|
1638
|
+
static {
|
|
1639
|
+
const _metadata = typeof Symbol === "function" && Symbol.metadata ? Object.create(_classSuper[Symbol.metadata] ?? null) : void 0;
|
|
1640
|
+
__esDecorate(null, _classDescriptor = { value: _classThis }, _classDecorators, { kind: "class", name: _classThis.name, metadata: _metadata }, null, _classExtraInitializers);
|
|
1641
|
+
UserCodeCCAdminCodeGet2 = _classThis = _classDescriptor.value;
|
|
1642
|
+
if (_metadata) Object.defineProperty(_classThis, Symbol.metadata, { enumerable: true, configurable: true, writable: true, value: _metadata });
|
|
1643
|
+
__runInitializers(_classThis, _classExtraInitializers);
|
|
1644
|
+
}
|
|
1645
|
+
};
|
|
1646
|
+
return UserCodeCCAdminCodeGet2 = _classThis;
|
|
1647
|
+
})();
|
|
1648
|
+
let UserCodeCCUserCodeChecksumReport = (() => {
|
|
1649
|
+
let _classDecorators = [(0, import_CommandClassDecorators.CCCommand)(import_Types.UserCodeCommand.UserCodeChecksumReport), (0, import_CommandClassDecorators.ccValueProperty)("userCodeChecksum", UserCodeCCValues.userCodeChecksum)];
|
|
1650
|
+
let _classDescriptor;
|
|
1651
|
+
let _classExtraInitializers = [];
|
|
1652
|
+
let _classThis;
|
|
1653
|
+
let _classSuper = UserCodeCC;
|
|
1654
|
+
var UserCodeCCUserCodeChecksumReport2 = class extends _classSuper {
|
|
1655
|
+
static {
|
|
1656
|
+
_classThis = this;
|
|
1657
|
+
}
|
|
1658
|
+
static {
|
|
1659
|
+
const _metadata = typeof Symbol === "function" && Symbol.metadata ? Object.create(_classSuper[Symbol.metadata] ?? null) : void 0;
|
|
1660
|
+
__esDecorate(null, _classDescriptor = { value: _classThis }, _classDecorators, { kind: "class", name: _classThis.name, metadata: _metadata }, null, _classExtraInitializers);
|
|
1661
|
+
UserCodeCCUserCodeChecksumReport2 = _classThis = _classDescriptor.value;
|
|
1662
|
+
if (_metadata) Object.defineProperty(_classThis, Symbol.metadata, { enumerable: true, configurable: true, writable: true, value: _metadata });
|
|
1663
|
+
__runInitializers(_classThis, _classExtraInitializers);
|
|
1664
|
+
}
|
|
1665
|
+
constructor(options) {
|
|
1666
|
+
super(options);
|
|
1667
|
+
this.userCodeChecksum = options.userCodeChecksum;
|
|
1668
|
+
}
|
|
1669
|
+
static from(raw, ctx) {
|
|
1670
|
+
(0, import_safe.validatePayload)(raw.payload.length >= 2);
|
|
1671
|
+
const userCodeChecksum = raw.payload.readUInt16BE(0);
|
|
1672
|
+
return new this({
|
|
1673
|
+
nodeId: ctx.sourceNodeId,
|
|
1674
|
+
userCodeChecksum
|
|
1675
|
+
});
|
|
1676
|
+
}
|
|
1677
|
+
userCodeChecksum;
|
|
1678
|
+
serialize(ctx) {
|
|
1679
|
+
this.payload = new import_safe2.Bytes(2);
|
|
1680
|
+
this.payload.writeUInt16BE(this.userCodeChecksum, 0);
|
|
1681
|
+
return super.serialize(ctx);
|
|
1682
|
+
}
|
|
1683
|
+
toLogEntry(ctx) {
|
|
1684
|
+
return {
|
|
1685
|
+
...super.toLogEntry(ctx),
|
|
1686
|
+
message: { "user code checksum": (0, import_safe3.num2hex)(this.userCodeChecksum) }
|
|
1687
|
+
};
|
|
1688
|
+
}
|
|
1689
|
+
};
|
|
1690
|
+
return UserCodeCCUserCodeChecksumReport2 = _classThis;
|
|
1691
|
+
})();
|
|
1692
|
+
let UserCodeCCUserCodeChecksumGet = (() => {
|
|
1693
|
+
let _classDecorators = [(0, import_CommandClassDecorators.CCCommand)(import_Types.UserCodeCommand.UserCodeChecksumGet), (0, import_CommandClassDecorators.expectedCCResponse)(UserCodeCCUserCodeChecksumReport)];
|
|
1694
|
+
let _classDescriptor;
|
|
1695
|
+
let _classExtraInitializers = [];
|
|
1696
|
+
let _classThis;
|
|
1697
|
+
let _classSuper = UserCodeCC;
|
|
1698
|
+
var UserCodeCCUserCodeChecksumGet2 = class extends _classSuper {
|
|
1699
|
+
static {
|
|
1700
|
+
_classThis = this;
|
|
1701
|
+
}
|
|
1702
|
+
static {
|
|
1703
|
+
const _metadata = typeof Symbol === "function" && Symbol.metadata ? Object.create(_classSuper[Symbol.metadata] ?? null) : void 0;
|
|
1704
|
+
__esDecorate(null, _classDescriptor = { value: _classThis }, _classDecorators, { kind: "class", name: _classThis.name, metadata: _metadata }, null, _classExtraInitializers);
|
|
1705
|
+
UserCodeCCUserCodeChecksumGet2 = _classThis = _classDescriptor.value;
|
|
1706
|
+
if (_metadata) Object.defineProperty(_classThis, Symbol.metadata, { enumerable: true, configurable: true, writable: true, value: _metadata });
|
|
1707
|
+
__runInitializers(_classThis, _classExtraInitializers);
|
|
1708
|
+
}
|
|
1709
|
+
};
|
|
1710
|
+
return UserCodeCCUserCodeChecksumGet2 = _classThis;
|
|
1711
|
+
})();
|
|
1712
|
+
let UserCodeCCExtendedUserCodeSet = (() => {
|
|
1713
|
+
let _classDecorators = [(0, import_CommandClassDecorators.CCCommand)(import_Types.UserCodeCommand.ExtendedUserCodeSet), (0, import_CommandClassDecorators.useSupervision)()];
|
|
1714
|
+
let _classDescriptor;
|
|
1715
|
+
let _classExtraInitializers = [];
|
|
1716
|
+
let _classThis;
|
|
1717
|
+
let _classSuper = UserCodeCC;
|
|
1718
|
+
var UserCodeCCExtendedUserCodeSet2 = class extends _classSuper {
|
|
1719
|
+
static {
|
|
1720
|
+
_classThis = this;
|
|
1721
|
+
}
|
|
1722
|
+
static {
|
|
1723
|
+
const _metadata = typeof Symbol === "function" && Symbol.metadata ? Object.create(_classSuper[Symbol.metadata] ?? null) : void 0;
|
|
1724
|
+
__esDecorate(null, _classDescriptor = { value: _classThis }, _classDecorators, { kind: "class", name: _classThis.name, metadata: _metadata }, null, _classExtraInitializers);
|
|
1725
|
+
UserCodeCCExtendedUserCodeSet2 = _classThis = _classDescriptor.value;
|
|
1726
|
+
if (_metadata) Object.defineProperty(_classThis, Symbol.metadata, { enumerable: true, configurable: true, writable: true, value: _metadata });
|
|
1727
|
+
__runInitializers(_classThis, _classExtraInitializers);
|
|
1728
|
+
}
|
|
1729
|
+
constructor(options) {
|
|
1730
|
+
super(options);
|
|
1731
|
+
this.userCodes = options.userCodes;
|
|
1732
|
+
}
|
|
1733
|
+
static from(_raw, _ctx) {
|
|
1734
|
+
throw new import_safe.ZWaveError(`${this.name}: deserialization not implemented`, import_safe.ZWaveErrorCodes.Deserialization_NotImplemented);
|
|
1735
|
+
}
|
|
1736
|
+
userCodes;
|
|
1737
|
+
serialize(ctx) {
|
|
1738
|
+
const userCodeBuffers = this.userCodes.map((code) => {
|
|
1739
|
+
const ret = import_safe2.Bytes.concat([
|
|
1740
|
+
import_safe2.Bytes.from([
|
|
1741
|
+
0,
|
|
1742
|
+
0,
|
|
1743
|
+
code.userIdStatus,
|
|
1744
|
+
code.userCode?.length ?? 0
|
|
1745
|
+
]),
|
|
1746
|
+
(0, import_safe2.isUint8Array)(code.userCode) ? code.userCode : import_safe2.Bytes.from(code.userCode ?? "", "ascii")
|
|
1747
|
+
]);
|
|
1748
|
+
ret.writeUInt16BE(code.userId, 0);
|
|
1749
|
+
return ret;
|
|
1750
|
+
});
|
|
1751
|
+
this.payload = import_safe2.Bytes.concat([
|
|
1752
|
+
import_safe2.Bytes.from([this.userCodes.length]),
|
|
1753
|
+
...userCodeBuffers
|
|
1754
|
+
]);
|
|
1755
|
+
return super.serialize(ctx);
|
|
1756
|
+
}
|
|
1757
|
+
toLogEntry(ctx) {
|
|
1758
|
+
const message = {};
|
|
1759
|
+
for (const { userId, userIdStatus, userCode } of this.userCodes) {
|
|
1760
|
+
message[`code #${userId}`] = `${userCodeToLogString(userCode ?? "")} (status: ${(0, import_safe3.getEnumMemberName)(import_Types.UserIDStatus, userIdStatus)})`;
|
|
1242
1761
|
}
|
|
1243
|
-
|
|
1244
|
-
|
|
1245
|
-
|
|
1246
|
-
|
|
1247
|
-
|
|
1248
|
-
|
|
1249
|
-
|
|
1250
|
-
|
|
1251
|
-
|
|
1252
|
-
|
|
1253
|
-
|
|
1254
|
-
|
|
1255
|
-
|
|
1256
|
-
|
|
1257
|
-
|
|
1258
|
-
|
|
1259
|
-
|
|
1260
|
-
|
|
1261
|
-
|
|
1262
|
-
|
|
1263
|
-
|
|
1264
|
-
|
|
1265
|
-
|
|
1266
|
-
|
|
1267
|
-
|
|
1268
|
-
|
|
1269
|
-
|
|
1270
|
-
|
|
1271
|
-
|
|
1272
|
-
|
|
1273
|
-
|
|
1274
|
-
|
|
1275
|
-
|
|
1276
|
-
|
|
1277
|
-
|
|
1278
|
-
|
|
1279
|
-
|
|
1280
|
-
|
|
1281
|
-
|
|
1282
|
-
this.keypadMode = options.keypadMode;
|
|
1283
|
-
}
|
|
1284
|
-
static from(raw, ctx) {
|
|
1285
|
-
(0, import_safe.validatePayload)(raw.payload.length >= 1);
|
|
1286
|
-
const keypadMode = raw.payload[0];
|
|
1287
|
-
return new UserCodeCCKeypadModeSet_1({
|
|
1288
|
-
nodeId: ctx.sourceNodeId,
|
|
1289
|
-
keypadMode
|
|
1290
|
-
});
|
|
1291
|
-
}
|
|
1292
|
-
keypadMode;
|
|
1293
|
-
serialize(ctx) {
|
|
1294
|
-
this.payload = import_safe2.Bytes.from([this.keypadMode]);
|
|
1295
|
-
return super.serialize(ctx);
|
|
1296
|
-
}
|
|
1297
|
-
toLogEntry(ctx) {
|
|
1298
|
-
return {
|
|
1299
|
-
...super.toLogEntry(ctx),
|
|
1300
|
-
message: { mode: (0, import_safe3.getEnumMemberName)(import_Types.KeypadMode, this.keypadMode) }
|
|
1301
|
-
};
|
|
1302
|
-
}
|
|
1303
|
-
};
|
|
1304
|
-
UserCodeCCKeypadModeSet = UserCodeCCKeypadModeSet_1 = __decorate([
|
|
1305
|
-
(0, import_CommandClassDecorators.CCCommand)(import_Types.UserCodeCommand.KeypadModeSet),
|
|
1306
|
-
(0, import_CommandClassDecorators.useSupervision)()
|
|
1307
|
-
], UserCodeCCKeypadModeSet);
|
|
1308
|
-
let UserCodeCCKeypadModeReport = UserCodeCCKeypadModeReport_1 = class UserCodeCCKeypadModeReport2 extends UserCodeCC {
|
|
1309
|
-
constructor(options) {
|
|
1310
|
-
super(options);
|
|
1311
|
-
this.keypadMode = options.keypadMode;
|
|
1312
|
-
}
|
|
1313
|
-
static from(raw, ctx) {
|
|
1314
|
-
(0, import_safe.validatePayload)(raw.payload.length >= 1);
|
|
1315
|
-
const keypadMode = raw.payload[0];
|
|
1316
|
-
return new UserCodeCCKeypadModeReport_1({
|
|
1317
|
-
nodeId: ctx.sourceNodeId,
|
|
1318
|
-
keypadMode
|
|
1319
|
-
});
|
|
1320
|
-
}
|
|
1321
|
-
persistValues(ctx) {
|
|
1322
|
-
if (!super.persistValues(ctx))
|
|
1323
|
-
return false;
|
|
1324
|
-
const supportedKeypadModes = this.getValue(ctx, UserCodeCCValues.supportedKeypadModes) ?? [this.keypadMode];
|
|
1325
|
-
const keypadModeValue = UserCodeCCValues.keypadMode;
|
|
1326
|
-
this.setMetadata(ctx, keypadModeValue, {
|
|
1327
|
-
...keypadModeValue.meta,
|
|
1328
|
-
states: (0, import_safe.enumValuesToMetadataStates)(import_Types.KeypadMode, supportedKeypadModes)
|
|
1329
|
-
});
|
|
1330
|
-
return true;
|
|
1331
|
-
}
|
|
1332
|
-
keypadMode;
|
|
1333
|
-
serialize(ctx) {
|
|
1334
|
-
this.payload = import_safe2.Bytes.from([this.keypadMode]);
|
|
1335
|
-
return super.serialize(ctx);
|
|
1336
|
-
}
|
|
1337
|
-
toLogEntry(ctx) {
|
|
1338
|
-
return {
|
|
1339
|
-
...super.toLogEntry(ctx),
|
|
1340
|
-
message: {
|
|
1341
|
-
keypadMode: (0, import_safe3.getEnumMemberName)(import_Types.KeypadMode, this.keypadMode)
|
|
1762
|
+
return {
|
|
1763
|
+
...super.toLogEntry(ctx),
|
|
1764
|
+
message
|
|
1765
|
+
};
|
|
1766
|
+
}
|
|
1767
|
+
};
|
|
1768
|
+
return UserCodeCCExtendedUserCodeSet2 = _classThis;
|
|
1769
|
+
})();
|
|
1770
|
+
let UserCodeCCExtendedUserCodeReport = (() => {
|
|
1771
|
+
let _classDecorators = [(0, import_CommandClassDecorators.CCCommand)(import_Types.UserCodeCommand.ExtendedUserCodeReport)];
|
|
1772
|
+
let _classDescriptor;
|
|
1773
|
+
let _classExtraInitializers = [];
|
|
1774
|
+
let _classThis;
|
|
1775
|
+
let _classSuper = UserCodeCC;
|
|
1776
|
+
var UserCodeCCExtendedUserCodeReport2 = class extends _classSuper {
|
|
1777
|
+
static {
|
|
1778
|
+
_classThis = this;
|
|
1779
|
+
}
|
|
1780
|
+
static {
|
|
1781
|
+
const _metadata = typeof Symbol === "function" && Symbol.metadata ? Object.create(_classSuper[Symbol.metadata] ?? null) : void 0;
|
|
1782
|
+
__esDecorate(null, _classDescriptor = { value: _classThis }, _classDecorators, { kind: "class", name: _classThis.name, metadata: _metadata }, null, _classExtraInitializers);
|
|
1783
|
+
UserCodeCCExtendedUserCodeReport2 = _classThis = _classDescriptor.value;
|
|
1784
|
+
if (_metadata) Object.defineProperty(_classThis, Symbol.metadata, { enumerable: true, configurable: true, writable: true, value: _metadata });
|
|
1785
|
+
__runInitializers(_classThis, _classExtraInitializers);
|
|
1786
|
+
}
|
|
1787
|
+
constructor(options) {
|
|
1788
|
+
super(options);
|
|
1789
|
+
this.userCodes = options.userCodes;
|
|
1790
|
+
this.nextUserId = options.nextUserId;
|
|
1791
|
+
}
|
|
1792
|
+
static from(raw, ctx) {
|
|
1793
|
+
(0, import_safe.validatePayload)(raw.payload.length >= 1);
|
|
1794
|
+
const numCodes = raw.payload[0];
|
|
1795
|
+
let offset = 1;
|
|
1796
|
+
const userCodes = [];
|
|
1797
|
+
for (let i = 0; i < numCodes; i++) {
|
|
1798
|
+
const { code, bytesRead } = parseExtendedUserCode(raw.payload.subarray(offset));
|
|
1799
|
+
userCodes.push(code);
|
|
1800
|
+
offset += bytesRead;
|
|
1342
1801
|
}
|
|
1343
|
-
|
|
1344
|
-
|
|
1345
|
-
|
|
1346
|
-
|
|
1347
|
-
|
|
1348
|
-
|
|
1349
|
-
|
|
1350
|
-
(0, import_CommandClassDecorators.CCCommand)(import_Types.UserCodeCommand.KeypadModeReport)
|
|
1351
|
-
], UserCodeCCKeypadModeReport);
|
|
1352
|
-
let UserCodeCCKeypadModeGet = class UserCodeCCKeypadModeGet2 extends UserCodeCC {
|
|
1353
|
-
};
|
|
1354
|
-
UserCodeCCKeypadModeGet = __decorate([
|
|
1355
|
-
(0, import_CommandClassDecorators.CCCommand)(import_Types.UserCodeCommand.KeypadModeGet),
|
|
1356
|
-
(0, import_CommandClassDecorators.expectedCCResponse)(UserCodeCCKeypadModeReport)
|
|
1357
|
-
], UserCodeCCKeypadModeGet);
|
|
1358
|
-
let UserCodeCCAdminCodeSet = UserCodeCCAdminCodeSet_1 = class UserCodeCCAdminCodeSet2 extends UserCodeCC {
|
|
1359
|
-
constructor(options) {
|
|
1360
|
-
super(options);
|
|
1361
|
-
this.adminCode = options.adminCode;
|
|
1362
|
-
}
|
|
1363
|
-
static from(raw, ctx) {
|
|
1364
|
-
(0, import_safe.validatePayload)(raw.payload.length >= 1);
|
|
1365
|
-
const codeLength = raw.payload[0] & 15;
|
|
1366
|
-
(0, import_safe.validatePayload)(raw.payload.length >= 1 + codeLength);
|
|
1367
|
-
const adminCode = raw.payload.subarray(1, 1 + codeLength).toString("ascii");
|
|
1368
|
-
return new UserCodeCCAdminCodeSet_1({
|
|
1369
|
-
nodeId: ctx.sourceNodeId,
|
|
1370
|
-
adminCode
|
|
1371
|
-
});
|
|
1372
|
-
}
|
|
1373
|
-
adminCode;
|
|
1374
|
-
serialize(ctx) {
|
|
1375
|
-
this.payload = import_safe2.Bytes.concat([
|
|
1376
|
-
import_safe2.Bytes.from([this.adminCode.length & 15]),
|
|
1377
|
-
import_safe2.Bytes.from(this.adminCode, "ascii")
|
|
1378
|
-
]);
|
|
1379
|
-
return super.serialize(ctx);
|
|
1380
|
-
}
|
|
1381
|
-
toLogEntry(ctx) {
|
|
1382
|
-
return {
|
|
1383
|
-
...super.toLogEntry(ctx),
|
|
1384
|
-
message: { "admin code": userCodeToLogString(this.adminCode) }
|
|
1385
|
-
};
|
|
1386
|
-
}
|
|
1387
|
-
};
|
|
1388
|
-
UserCodeCCAdminCodeSet = UserCodeCCAdminCodeSet_1 = __decorate([
|
|
1389
|
-
(0, import_CommandClassDecorators.CCCommand)(import_Types.UserCodeCommand.AdminCodeSet),
|
|
1390
|
-
(0, import_CommandClassDecorators.useSupervision)()
|
|
1391
|
-
], UserCodeCCAdminCodeSet);
|
|
1392
|
-
let UserCodeCCAdminCodeReport = UserCodeCCAdminCodeReport_1 = class UserCodeCCAdminCodeReport2 extends UserCodeCC {
|
|
1393
|
-
constructor(options) {
|
|
1394
|
-
super(options);
|
|
1395
|
-
this.adminCode = options.adminCode;
|
|
1396
|
-
}
|
|
1397
|
-
static from(raw, ctx) {
|
|
1398
|
-
(0, import_safe.validatePayload)(raw.payload.length >= 1);
|
|
1399
|
-
const codeLength = raw.payload[0] & 15;
|
|
1400
|
-
(0, import_safe.validatePayload)(raw.payload.length >= 1 + codeLength);
|
|
1401
|
-
const adminCode = raw.payload.subarray(1, 1 + codeLength).toString("ascii");
|
|
1402
|
-
return new UserCodeCCAdminCodeReport_1({
|
|
1403
|
-
nodeId: ctx.sourceNodeId,
|
|
1404
|
-
adminCode
|
|
1405
|
-
});
|
|
1406
|
-
}
|
|
1407
|
-
adminCode;
|
|
1408
|
-
serialize(ctx) {
|
|
1409
|
-
this.payload = import_safe2.Bytes.concat([
|
|
1410
|
-
import_safe2.Bytes.from([this.adminCode.length & 15]),
|
|
1411
|
-
import_safe2.Bytes.from(this.adminCode, "ascii")
|
|
1412
|
-
]);
|
|
1413
|
-
return super.serialize(ctx);
|
|
1414
|
-
}
|
|
1415
|
-
toLogEntry(ctx) {
|
|
1416
|
-
return {
|
|
1417
|
-
...super.toLogEntry(ctx),
|
|
1418
|
-
message: { "admin code": userCodeToLogString(this.adminCode) }
|
|
1419
|
-
};
|
|
1420
|
-
}
|
|
1421
|
-
};
|
|
1422
|
-
__decorate([
|
|
1423
|
-
(0, import_CommandClassDecorators.ccValue)(UserCodeCCValues.adminCode)
|
|
1424
|
-
], UserCodeCCAdminCodeReport.prototype, "adminCode", void 0);
|
|
1425
|
-
UserCodeCCAdminCodeReport = UserCodeCCAdminCodeReport_1 = __decorate([
|
|
1426
|
-
(0, import_CommandClassDecorators.CCCommand)(import_Types.UserCodeCommand.AdminCodeReport)
|
|
1427
|
-
], UserCodeCCAdminCodeReport);
|
|
1428
|
-
let UserCodeCCAdminCodeGet = class UserCodeCCAdminCodeGet2 extends UserCodeCC {
|
|
1429
|
-
};
|
|
1430
|
-
UserCodeCCAdminCodeGet = __decorate([
|
|
1431
|
-
(0, import_CommandClassDecorators.CCCommand)(import_Types.UserCodeCommand.AdminCodeGet),
|
|
1432
|
-
(0, import_CommandClassDecorators.expectedCCResponse)(UserCodeCCAdminCodeReport)
|
|
1433
|
-
], UserCodeCCAdminCodeGet);
|
|
1434
|
-
let UserCodeCCUserCodeChecksumReport = UserCodeCCUserCodeChecksumReport_1 = class UserCodeCCUserCodeChecksumReport2 extends UserCodeCC {
|
|
1435
|
-
constructor(options) {
|
|
1436
|
-
super(options);
|
|
1437
|
-
this.userCodeChecksum = options.userCodeChecksum;
|
|
1438
|
-
}
|
|
1439
|
-
static from(raw, ctx) {
|
|
1440
|
-
(0, import_safe.validatePayload)(raw.payload.length >= 2);
|
|
1441
|
-
const userCodeChecksum = raw.payload.readUInt16BE(0);
|
|
1442
|
-
return new UserCodeCCUserCodeChecksumReport_1({
|
|
1443
|
-
nodeId: ctx.sourceNodeId,
|
|
1444
|
-
userCodeChecksum
|
|
1445
|
-
});
|
|
1446
|
-
}
|
|
1447
|
-
userCodeChecksum;
|
|
1448
|
-
serialize(ctx) {
|
|
1449
|
-
this.payload = new import_safe2.Bytes(2);
|
|
1450
|
-
this.payload.writeUInt16BE(this.userCodeChecksum, 0);
|
|
1451
|
-
return super.serialize(ctx);
|
|
1452
|
-
}
|
|
1453
|
-
toLogEntry(ctx) {
|
|
1454
|
-
return {
|
|
1455
|
-
...super.toLogEntry(ctx),
|
|
1456
|
-
message: { "user code checksum": (0, import_safe3.num2hex)(this.userCodeChecksum) }
|
|
1457
|
-
};
|
|
1458
|
-
}
|
|
1459
|
-
};
|
|
1460
|
-
__decorate([
|
|
1461
|
-
(0, import_CommandClassDecorators.ccValue)(UserCodeCCValues.userCodeChecksum)
|
|
1462
|
-
], UserCodeCCUserCodeChecksumReport.prototype, "userCodeChecksum", void 0);
|
|
1463
|
-
UserCodeCCUserCodeChecksumReport = UserCodeCCUserCodeChecksumReport_1 = __decorate([
|
|
1464
|
-
(0, import_CommandClassDecorators.CCCommand)(import_Types.UserCodeCommand.UserCodeChecksumReport)
|
|
1465
|
-
], UserCodeCCUserCodeChecksumReport);
|
|
1466
|
-
let UserCodeCCUserCodeChecksumGet = class UserCodeCCUserCodeChecksumGet2 extends UserCodeCC {
|
|
1467
|
-
};
|
|
1468
|
-
UserCodeCCUserCodeChecksumGet = __decorate([
|
|
1469
|
-
(0, import_CommandClassDecorators.CCCommand)(import_Types.UserCodeCommand.UserCodeChecksumGet),
|
|
1470
|
-
(0, import_CommandClassDecorators.expectedCCResponse)(UserCodeCCUserCodeChecksumReport)
|
|
1471
|
-
], UserCodeCCUserCodeChecksumGet);
|
|
1472
|
-
let UserCodeCCExtendedUserCodeSet = class UserCodeCCExtendedUserCodeSet2 extends UserCodeCC {
|
|
1473
|
-
constructor(options) {
|
|
1474
|
-
super(options);
|
|
1475
|
-
this.userCodes = options.userCodes;
|
|
1476
|
-
}
|
|
1477
|
-
static from(_raw, _ctx) {
|
|
1478
|
-
throw new import_safe.ZWaveError(`${this.name}: deserialization not implemented`, import_safe.ZWaveErrorCodes.Deserialization_NotImplemented);
|
|
1479
|
-
}
|
|
1480
|
-
userCodes;
|
|
1481
|
-
serialize(ctx) {
|
|
1482
|
-
const userCodeBuffers = this.userCodes.map((code) => {
|
|
1483
|
-
const ret = import_safe2.Bytes.concat([
|
|
1484
|
-
import_safe2.Bytes.from([
|
|
1485
|
-
0,
|
|
1486
|
-
0,
|
|
1487
|
-
code.userIdStatus,
|
|
1488
|
-
code.userCode?.length ?? 0
|
|
1489
|
-
]),
|
|
1490
|
-
(0, import_safe2.isUint8Array)(code.userCode) ? code.userCode : import_safe2.Bytes.from(code.userCode ?? "", "ascii")
|
|
1491
|
-
]);
|
|
1492
|
-
ret.writeUInt16BE(code.userId, 0);
|
|
1493
|
-
return ret;
|
|
1494
|
-
});
|
|
1495
|
-
this.payload = import_safe2.Bytes.concat([
|
|
1496
|
-
import_safe2.Bytes.from([this.userCodes.length]),
|
|
1497
|
-
...userCodeBuffers
|
|
1498
|
-
]);
|
|
1499
|
-
return super.serialize(ctx);
|
|
1500
|
-
}
|
|
1501
|
-
toLogEntry(ctx) {
|
|
1502
|
-
const message = {};
|
|
1503
|
-
for (const { userId, userIdStatus, userCode } of this.userCodes) {
|
|
1504
|
-
message[`code #${userId}`] = `${userCodeToLogString(userCode ?? "")} (status: ${(0, import_safe3.getEnumMemberName)(import_Types.UserIDStatus, userIdStatus)})`;
|
|
1505
|
-
}
|
|
1506
|
-
return {
|
|
1507
|
-
...super.toLogEntry(ctx),
|
|
1508
|
-
message
|
|
1509
|
-
};
|
|
1510
|
-
}
|
|
1511
|
-
};
|
|
1512
|
-
UserCodeCCExtendedUserCodeSet = __decorate([
|
|
1513
|
-
(0, import_CommandClassDecorators.CCCommand)(import_Types.UserCodeCommand.ExtendedUserCodeSet),
|
|
1514
|
-
(0, import_CommandClassDecorators.useSupervision)()
|
|
1515
|
-
], UserCodeCCExtendedUserCodeSet);
|
|
1516
|
-
let UserCodeCCExtendedUserCodeReport = UserCodeCCExtendedUserCodeReport_1 = class UserCodeCCExtendedUserCodeReport2 extends UserCodeCC {
|
|
1517
|
-
constructor(options) {
|
|
1518
|
-
super(options);
|
|
1519
|
-
this.userCodes = options.userCodes;
|
|
1520
|
-
this.nextUserId = options.nextUserId;
|
|
1521
|
-
}
|
|
1522
|
-
static from(raw, ctx) {
|
|
1523
|
-
(0, import_safe.validatePayload)(raw.payload.length >= 1);
|
|
1524
|
-
const numCodes = raw.payload[0];
|
|
1525
|
-
let offset = 1;
|
|
1526
|
-
const userCodes = [];
|
|
1527
|
-
for (let i = 0; i < numCodes; i++) {
|
|
1528
|
-
const { code, bytesRead } = parseExtendedUserCode(raw.payload.subarray(offset));
|
|
1529
|
-
userCodes.push(code);
|
|
1530
|
-
offset += bytesRead;
|
|
1531
|
-
}
|
|
1532
|
-
(0, import_safe.validatePayload)(raw.payload.length >= offset + 2);
|
|
1533
|
-
const nextUserId = raw.payload.readUInt16BE(offset);
|
|
1534
|
-
return new UserCodeCCExtendedUserCodeReport_1({
|
|
1535
|
-
nodeId: ctx.sourceNodeId,
|
|
1536
|
-
userCodes,
|
|
1537
|
-
nextUserId
|
|
1538
|
-
});
|
|
1539
|
-
}
|
|
1540
|
-
persistValues(ctx) {
|
|
1541
|
-
if (!super.persistValues(ctx))
|
|
1542
|
-
return false;
|
|
1543
|
-
for (const { userId, userIdStatus, userCode } of this.userCodes) {
|
|
1544
|
-
persistUserCode.call(this, ctx, userId, userIdStatus, userCode);
|
|
1802
|
+
(0, import_safe.validatePayload)(raw.payload.length >= offset + 2);
|
|
1803
|
+
const nextUserId = raw.payload.readUInt16BE(offset);
|
|
1804
|
+
return new this({
|
|
1805
|
+
nodeId: ctx.sourceNodeId,
|
|
1806
|
+
userCodes,
|
|
1807
|
+
nextUserId
|
|
1808
|
+
});
|
|
1545
1809
|
}
|
|
1546
|
-
|
|
1547
|
-
|
|
1548
|
-
|
|
1549
|
-
|
|
1550
|
-
|
|
1551
|
-
const message = {};
|
|
1552
|
-
for (const { userId, userIdStatus, userCode } of this.userCodes) {
|
|
1553
|
-
message[`code #${userId}`] = `${userCodeToLogString(userCode)} (status: ${(0, import_safe3.getEnumMemberName)(import_Types.UserIDStatus, userIdStatus)})`;
|
|
1554
|
-
}
|
|
1555
|
-
message["next user id"] = this.nextUserId;
|
|
1556
|
-
return {
|
|
1557
|
-
...super.toLogEntry(ctx),
|
|
1558
|
-
message
|
|
1559
|
-
};
|
|
1560
|
-
}
|
|
1561
|
-
};
|
|
1562
|
-
UserCodeCCExtendedUserCodeReport = UserCodeCCExtendedUserCodeReport_1 = __decorate([
|
|
1563
|
-
(0, import_CommandClassDecorators.CCCommand)(import_Types.UserCodeCommand.ExtendedUserCodeReport)
|
|
1564
|
-
], UserCodeCCExtendedUserCodeReport);
|
|
1565
|
-
let UserCodeCCExtendedUserCodeGet = class UserCodeCCExtendedUserCodeGet2 extends UserCodeCC {
|
|
1566
|
-
constructor(options) {
|
|
1567
|
-
super(options);
|
|
1568
|
-
this.userId = options.userId;
|
|
1569
|
-
this.reportMore = !!options.reportMore;
|
|
1570
|
-
}
|
|
1571
|
-
static from(_raw, _ctx) {
|
|
1572
|
-
throw new import_safe.ZWaveError(`${this.name}: deserialization not implemented`, import_safe.ZWaveErrorCodes.Deserialization_NotImplemented);
|
|
1573
|
-
}
|
|
1574
|
-
userId;
|
|
1575
|
-
reportMore;
|
|
1576
|
-
serialize(ctx) {
|
|
1577
|
-
this.payload = import_safe2.Bytes.from([0, 0, this.reportMore ? 1 : 0]);
|
|
1578
|
-
this.payload.writeUInt16BE(this.userId, 0);
|
|
1579
|
-
return super.serialize(ctx);
|
|
1580
|
-
}
|
|
1581
|
-
toLogEntry(ctx) {
|
|
1582
|
-
return {
|
|
1583
|
-
...super.toLogEntry(ctx),
|
|
1584
|
-
message: {
|
|
1585
|
-
"user id": this.userId,
|
|
1586
|
-
"report more": this.reportMore
|
|
1810
|
+
persistValues(ctx) {
|
|
1811
|
+
if (!super.persistValues(ctx))
|
|
1812
|
+
return false;
|
|
1813
|
+
for (const { userId, userIdStatus, userCode } of this.userCodes) {
|
|
1814
|
+
persistUserCode.call(this, ctx, userId, userIdStatus, userCode);
|
|
1587
1815
|
}
|
|
1588
|
-
|
|
1589
|
-
|
|
1590
|
-
|
|
1591
|
-
|
|
1592
|
-
|
|
1593
|
-
|
|
1594
|
-
|
|
1816
|
+
return true;
|
|
1817
|
+
}
|
|
1818
|
+
userCodes;
|
|
1819
|
+
nextUserId;
|
|
1820
|
+
toLogEntry(ctx) {
|
|
1821
|
+
const message = {};
|
|
1822
|
+
for (const { userId, userIdStatus, userCode } of this.userCodes) {
|
|
1823
|
+
message[`code #${userId}`] = `${userCodeToLogString(userCode)} (status: ${(0, import_safe3.getEnumMemberName)(import_Types.UserIDStatus, userIdStatus)})`;
|
|
1824
|
+
}
|
|
1825
|
+
message["next user id"] = this.nextUserId;
|
|
1826
|
+
return {
|
|
1827
|
+
...super.toLogEntry(ctx),
|
|
1828
|
+
message
|
|
1829
|
+
};
|
|
1830
|
+
}
|
|
1831
|
+
};
|
|
1832
|
+
return UserCodeCCExtendedUserCodeReport2 = _classThis;
|
|
1833
|
+
})();
|
|
1834
|
+
let UserCodeCCExtendedUserCodeGet = (() => {
|
|
1835
|
+
let _classDecorators = [(0, import_CommandClassDecorators.CCCommand)(import_Types.UserCodeCommand.ExtendedUserCodeGet), (0, import_CommandClassDecorators.expectedCCResponse)(UserCodeCCExtendedUserCodeReport)];
|
|
1836
|
+
let _classDescriptor;
|
|
1837
|
+
let _classExtraInitializers = [];
|
|
1838
|
+
let _classThis;
|
|
1839
|
+
let _classSuper = UserCodeCC;
|
|
1840
|
+
var UserCodeCCExtendedUserCodeGet2 = class extends _classSuper {
|
|
1841
|
+
static {
|
|
1842
|
+
_classThis = this;
|
|
1843
|
+
}
|
|
1844
|
+
static {
|
|
1845
|
+
const _metadata = typeof Symbol === "function" && Symbol.metadata ? Object.create(_classSuper[Symbol.metadata] ?? null) : void 0;
|
|
1846
|
+
__esDecorate(null, _classDescriptor = { value: _classThis }, _classDecorators, { kind: "class", name: _classThis.name, metadata: _metadata }, null, _classExtraInitializers);
|
|
1847
|
+
UserCodeCCExtendedUserCodeGet2 = _classThis = _classDescriptor.value;
|
|
1848
|
+
if (_metadata) Object.defineProperty(_classThis, Symbol.metadata, { enumerable: true, configurable: true, writable: true, value: _metadata });
|
|
1849
|
+
__runInitializers(_classThis, _classExtraInitializers);
|
|
1850
|
+
}
|
|
1851
|
+
constructor(options) {
|
|
1852
|
+
super(options);
|
|
1853
|
+
this.userId = options.userId;
|
|
1854
|
+
this.reportMore = !!options.reportMore;
|
|
1855
|
+
}
|
|
1856
|
+
static from(_raw, _ctx) {
|
|
1857
|
+
throw new import_safe.ZWaveError(`${this.name}: deserialization not implemented`, import_safe.ZWaveErrorCodes.Deserialization_NotImplemented);
|
|
1858
|
+
}
|
|
1859
|
+
userId;
|
|
1860
|
+
reportMore;
|
|
1861
|
+
serialize(ctx) {
|
|
1862
|
+
this.payload = import_safe2.Bytes.from([0, 0, this.reportMore ? 1 : 0]);
|
|
1863
|
+
this.payload.writeUInt16BE(this.userId, 0);
|
|
1864
|
+
return super.serialize(ctx);
|
|
1865
|
+
}
|
|
1866
|
+
toLogEntry(ctx) {
|
|
1867
|
+
return {
|
|
1868
|
+
...super.toLogEntry(ctx),
|
|
1869
|
+
message: {
|
|
1870
|
+
"user id": this.userId,
|
|
1871
|
+
"report more": this.reportMore
|
|
1872
|
+
}
|
|
1873
|
+
};
|
|
1874
|
+
}
|
|
1875
|
+
};
|
|
1876
|
+
return UserCodeCCExtendedUserCodeGet2 = _classThis;
|
|
1877
|
+
})();
|
|
1595
1878
|
// Annotate the CommonJS export names for ESM import in node:
|
|
1596
1879
|
0 && (module.exports = {
|
|
1597
1880
|
UserCodeCC,
|