@zwave-js/cc 14.0.0-beta.4 → 14.0.0-beta.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/build/cjs/cc/AlarmSensorCC.js +381 -266
- package/build/cjs/cc/AlarmSensorCC.js.map +3 -3
- package/build/cjs/cc/AssociationCC.js +669 -503
- package/build/cjs/cc/AssociationCC.js.map +3 -3
- package/build/cjs/cc/AssociationGroupInfoCC.js +633 -492
- package/build/cjs/cc/AssociationGroupInfoCC.js.map +3 -3
- package/build/cjs/cc/BarrierOperatorCC.js +595 -429
- package/build/cjs/cc/BarrierOperatorCC.js.map +3 -3
- package/build/cjs/cc/BasicCC.js +354 -260
- package/build/cjs/cc/BasicCC.js.map +3 -3
- package/build/cjs/cc/BatteryCC.js +427 -345
- package/build/cjs/cc/BatteryCC.js.map +3 -3
- package/build/cjs/cc/BinarySensorCC.js +391 -276
- package/build/cjs/cc/BinarySensorCC.js.map +3 -3
- package/build/cjs/cc/BinarySwitchCC.js +347 -253
- package/build/cjs/cc/BinarySwitchCC.js.map +3 -3
- package/build/cjs/cc/CRC16CC.js +160 -85
- package/build/cjs/cc/CRC16CC.js.map +3 -3
- package/build/cjs/cc/CentralSceneCC.js +459 -324
- package/build/cjs/cc/CentralSceneCC.js.map +3 -3
- package/build/cjs/cc/ClimateControlScheduleCC.js +459 -293
- package/build/cjs/cc/ClimateControlScheduleCC.js.map +3 -3
- package/build/cjs/cc/ClockCC.js +254 -150
- package/build/cjs/cc/ClockCC.js.map +3 -3
- package/build/cjs/cc/ColorSwitchCC.js +758 -610
- package/build/cjs/cc/ColorSwitchCC.js.map +3 -3
- package/build/cjs/cc/ConfigurationCC.js +1700 -1453
- package/build/cjs/cc/ConfigurationCC.js.map +3 -3
- package/build/cjs/cc/DeviceResetLocallyCC.js +125 -49
- package/build/cjs/cc/DeviceResetLocallyCC.js.map +3 -3
- package/build/cjs/cc/DoorLockCC.js +904 -777
- package/build/cjs/cc/DoorLockCC.js.map +3 -3
- package/build/cjs/cc/DoorLockLoggingCC.js +321 -206
- package/build/cjs/cc/DoorLockLoggingCC.js.map +3 -3
- package/build/cjs/cc/EnergyProductionCC.js +249 -160
- package/build/cjs/cc/EnergyProductionCC.js.map +3 -3
- package/build/cjs/cc/EntryControlCC.js +619 -458
- package/build/cjs/cc/EntryControlCC.js.map +3 -3
- package/build/cjs/cc/FirmwareUpdateMetaDataCC.js +898 -698
- package/build/cjs/cc/FirmwareUpdateMetaDataCC.js.map +3 -3
- package/build/cjs/cc/HailCC.js +57 -11
- package/build/cjs/cc/HailCC.js.map +2 -2
- package/build/cjs/cc/HumidityControlModeCC.js +359 -233
- package/build/cjs/cc/HumidityControlModeCC.js.map +3 -3
- package/build/cjs/cc/HumidityControlOperatingStateCC.js +189 -103
- package/build/cjs/cc/HumidityControlOperatingStateCC.js.map +3 -3
- package/build/cjs/cc/HumidityControlSetpointCC.js +682 -495
- package/build/cjs/cc/HumidityControlSetpointCC.js.map +3 -3
- package/build/cjs/cc/InclusionControllerCC.js +205 -114
- package/build/cjs/cc/InclusionControllerCC.js.map +3 -3
- package/build/cjs/cc/IndicatorCC.js +897 -736
- package/build/cjs/cc/IndicatorCC.js.map +3 -3
- package/build/cjs/cc/IrrigationCC.js +1651 -1405
- package/build/cjs/cc/IrrigationCC.js.map +3 -3
- package/build/cjs/cc/LanguageCC.js +268 -171
- package/build/cjs/cc/LanguageCC.js.map +3 -3
- package/build/cjs/cc/LockCC.js +254 -154
- package/build/cjs/cc/LockCC.js.map +3 -3
- package/build/cjs/cc/ManufacturerProprietaryCC.js +189 -129
- package/build/cjs/cc/ManufacturerProprietaryCC.js.map +2 -2
- package/build/cjs/cc/ManufacturerSpecificCC.js +319 -213
- package/build/cjs/cc/ManufacturerSpecificCC.js.map +3 -3
- package/build/cjs/cc/MeterCC.js +827 -707
- package/build/cjs/cc/MeterCC.js.map +3 -3
- package/build/cjs/cc/MultiChannelAssociationCC.js +612 -478
- package/build/cjs/cc/MultiChannelAssociationCC.js.map +3 -3
- package/build/cjs/cc/MultiChannelCC.js +1037 -819
- package/build/cjs/cc/MultiChannelCC.js.map +3 -3
- package/build/cjs/cc/MultiCommandCC.js +172 -97
- package/build/cjs/cc/MultiCommandCC.js.map +3 -3
- package/build/cjs/cc/MultilevelSensorCC.js +589 -449
- package/build/cjs/cc/MultilevelSensorCC.js.map +3 -3
- package/build/cjs/cc/MultilevelSwitchCC.js +587 -439
- package/build/cjs/cc/MultilevelSwitchCC.js.map +3 -3
- package/build/cjs/cc/NoOperationCC.js +89 -27
- package/build/cjs/cc/NoOperationCC.js.map +2 -2
- package/build/cjs/cc/NodeNamingCC.js +417 -277
- package/build/cjs/cc/NodeNamingCC.js.map +3 -3
- package/build/cjs/cc/NotificationCC.js +972 -818
- package/build/cjs/cc/NotificationCC.js.map +3 -3
- package/build/cjs/cc/PowerlevelCC.js +450 -303
- package/build/cjs/cc/PowerlevelCC.js.map +3 -3
- package/build/cjs/cc/ProtectionCC.js +686 -494
- package/build/cjs/cc/ProtectionCC.js.map +3 -3
- package/build/cjs/cc/SceneActivationCC.js +165 -97
- package/build/cjs/cc/SceneActivationCC.js.map +3 -3
- package/build/cjs/cc/SceneActuatorConfigurationCC.js +346 -243
- package/build/cjs/cc/SceneActuatorConfigurationCC.js.map +3 -3
- package/build/cjs/cc/SceneControllerConfigurationCC.js +401 -298
- package/build/cjs/cc/SceneControllerConfigurationCC.js.map +3 -3
- package/build/cjs/cc/ScheduleEntryLockCC.js +1552 -1272
- package/build/cjs/cc/ScheduleEntryLockCC.js.map +3 -3
- package/build/cjs/cc/Security2CC.js +1483 -1219
- package/build/cjs/cc/Security2CC.js.map +3 -3
- package/build/cjs/cc/SecurityCC.js +839 -619
- package/build/cjs/cc/SecurityCC.js.map +3 -3
- package/build/cjs/cc/SoundSwitchCC.js +707 -515
- package/build/cjs/cc/SoundSwitchCC.js.map +3 -3
- package/build/cjs/cc/SupervisionCC.js +327 -237
- package/build/cjs/cc/SupervisionCC.js.map +3 -3
- package/build/cjs/cc/ThermostatFanModeCC.js +386 -263
- package/build/cjs/cc/ThermostatFanModeCC.js.map +3 -3
- package/build/cjs/cc/ThermostatFanStateCC.js +192 -106
- package/build/cjs/cc/ThermostatFanStateCC.js.map +3 -3
- package/build/cjs/cc/ThermostatModeCC.js +425 -302
- package/build/cjs/cc/ThermostatModeCC.js.map +3 -3
- package/build/cjs/cc/ThermostatOperatingStateCC.js +188 -102
- package/build/cjs/cc/ThermostatOperatingStateCC.js.map +3 -3
- package/build/cjs/cc/ThermostatSetbackCC.js +277 -173
- package/build/cjs/cc/ThermostatSetbackCC.js.map +3 -3
- package/build/cjs/cc/ThermostatSetpointCC.js +645 -491
- package/build/cjs/cc/ThermostatSetpointCC.js.map +3 -3
- package/build/cjs/cc/TimeCC.js +515 -353
- package/build/cjs/cc/TimeCC.js.map +3 -3
- package/build/cjs/cc/TimeParametersCC.js +302 -202
- package/build/cjs/cc/TimeParametersCC.js.map +3 -3
- package/build/cjs/cc/TransportServiceCC.js +433 -315
- package/build/cjs/cc/TransportServiceCC.js.map +3 -3
- package/build/cjs/cc/UserCodeCC.js +1385 -1102
- package/build/cjs/cc/UserCodeCC.js.map +3 -3
- package/build/cjs/cc/VersionCC.js +696 -562
- package/build/cjs/cc/VersionCC.js.map +3 -3
- package/build/cjs/cc/WakeUpCC.js +499 -346
- package/build/cjs/cc/WakeUpCC.js.map +3 -3
- package/build/cjs/cc/WindowCoveringCC.js +626 -478
- package/build/cjs/cc/WindowCoveringCC.js.map +3 -3
- package/build/cjs/cc/ZWaveLongRangeCC.js +57 -10
- package/build/cjs/cc/ZWaveLongRangeCC.js.map +2 -2
- package/build/cjs/cc/ZWavePlusCC.js +233 -159
- package/build/cjs/cc/ZWavePlusCC.js.map +3 -3
- package/build/cjs/cc/ZWaveProtocolCC.js +1515 -948
- package/build/cjs/cc/ZWaveProtocolCC.js.map +3 -3
- package/build/cjs/cc/manufacturerProprietary/Decorators.d.ts +4 -4
- package/build/cjs/cc/manufacturerProprietary/Decorators.js.map +1 -1
- package/build/cjs/cc/manufacturerProprietary/FibaroCC.js +395 -274
- package/build/cjs/cc/manufacturerProprietary/FibaroCC.js.map +3 -3
- package/build/cjs/lib/CommandClassDecorators.d.ts +11 -15
- package/build/cjs/lib/CommandClassDecorators.js +19 -20
- package/build/cjs/lib/CommandClassDecorators.js.map +2 -2
- package/build/cjs/lib/Security2/Extension.d.ts +1 -1
- package/build/cjs/lib/Security2/Extension.js +217 -126
- package/build/cjs/lib/Security2/Extension.js.map +3 -3
- package/build/esm/cc/AlarmSensorCC.d.ts.map +1 -1
- package/build/esm/cc/AlarmSensorCC.js +389 -291
- package/build/esm/cc/AlarmSensorCC.js.map +1 -1
- package/build/esm/cc/AssociationCC.d.ts.map +1 -1
- package/build/esm/cc/AssociationCC.js +678 -537
- package/build/esm/cc/AssociationCC.js.map +1 -1
- package/build/esm/cc/AssociationGroupInfoCC.d.ts.map +1 -1
- package/build/esm/cc/AssociationGroupInfoCC.js +659 -539
- package/build/esm/cc/AssociationGroupInfoCC.js.map +1 -1
- package/build/esm/cc/BarrierOperatorCC.d.ts.map +1 -1
- package/build/esm/cc/BarrierOperatorCC.js +634 -493
- package/build/esm/cc/BarrierOperatorCC.js.map +1 -1
- package/build/esm/cc/BasicCC.d.ts.map +1 -1
- package/build/esm/cc/BasicCC.js +380 -302
- package/build/esm/cc/BasicCC.js.map +1 -1
- package/build/esm/cc/BatteryCC.d.ts.map +1 -1
- package/build/esm/cc/BatteryCC.js +449 -384
- package/build/esm/cc/BatteryCC.js.map +1 -1
- package/build/esm/cc/BinarySensorCC.d.ts.map +1 -1
- package/build/esm/cc/BinarySensorCC.js +395 -297
- package/build/esm/cc/BinarySensorCC.js.map +1 -1
- package/build/esm/cc/BinarySwitchCC.d.ts.map +1 -1
- package/build/esm/cc/BinarySwitchCC.js +353 -274
- package/build/esm/cc/BinarySwitchCC.js.map +1 -1
- package/build/esm/cc/CRC16CC.js +162 -98
- package/build/esm/cc/CRC16CC.js.map +1 -1
- package/build/esm/cc/CentralSceneCC.d.ts.map +1 -1
- package/build/esm/cc/CentralSceneCC.js +465 -351
- package/build/esm/cc/CentralSceneCC.js.map +1 -1
- package/build/esm/cc/ClimateControlScheduleCC.d.ts.map +1 -1
- package/build/esm/cc/ClimateControlScheduleCC.js +454 -313
- package/build/esm/cc/ClimateControlScheduleCC.js.map +1 -1
- package/build/esm/cc/ClockCC.js +248 -159
- package/build/esm/cc/ClockCC.js.map +1 -1
- package/build/esm/cc/ColorSwitchCC.d.ts.map +1 -1
- package/build/esm/cc/ColorSwitchCC.js +802 -677
- package/build/esm/cc/ColorSwitchCC.js.map +1 -1
- package/build/esm/cc/ConfigurationCC.js +1899 -1687
- package/build/esm/cc/ConfigurationCC.js.map +1 -1
- package/build/esm/cc/DeviceResetLocallyCC.js +124 -59
- package/build/esm/cc/DeviceResetLocallyCC.js.map +1 -1
- package/build/esm/cc/DoorLockCC.d.ts.map +1 -1
- package/build/esm/cc/DoorLockCC.js +951 -849
- package/build/esm/cc/DoorLockCC.js.map +1 -1
- package/build/esm/cc/DoorLockLoggingCC.d.ts.map +1 -1
- package/build/esm/cc/DoorLockLoggingCC.js +316 -218
- package/build/esm/cc/DoorLockLoggingCC.js.map +1 -1
- package/build/esm/cc/EnergyProductionCC.js +240 -164
- package/build/esm/cc/EnergyProductionCC.js.map +1 -1
- package/build/esm/cc/EntryControlCC.d.ts.map +1 -1
- package/build/esm/cc/EntryControlCC.js +629 -493
- package/build/esm/cc/EntryControlCC.js.map +1 -1
- package/build/esm/cc/FirmwareUpdateMetaDataCC.d.ts.map +1 -1
- package/build/esm/cc/FirmwareUpdateMetaDataCC.js +938 -769
- package/build/esm/cc/FirmwareUpdateMetaDataCC.js.map +1 -1
- package/build/esm/cc/HailCC.js +51 -12
- package/build/esm/cc/HailCC.js.map +1 -1
- package/build/esm/cc/HumidityControlModeCC.d.ts.map +1 -1
- package/build/esm/cc/HumidityControlModeCC.js +357 -250
- package/build/esm/cc/HumidityControlModeCC.js.map +1 -1
- package/build/esm/cc/HumidityControlOperatingStateCC.d.ts.map +1 -1
- package/build/esm/cc/HumidityControlOperatingStateCC.js +182 -109
- package/build/esm/cc/HumidityControlOperatingStateCC.js.map +1 -1
- package/build/esm/cc/HumidityControlSetpointCC.d.ts.map +1 -1
- package/build/esm/cc/HumidityControlSetpointCC.js +706 -546
- package/build/esm/cc/HumidityControlSetpointCC.js.map +1 -1
- package/build/esm/cc/InclusionControllerCC.js +197 -119
- package/build/esm/cc/InclusionControllerCC.js.map +1 -1
- package/build/esm/cc/IndicatorCC.js +973 -835
- package/build/esm/cc/IndicatorCC.js.map +1 -1
- package/build/esm/cc/IrrigationCC.d.ts.map +1 -1
- package/build/esm/cc/IrrigationCC.js +1697 -1496
- package/build/esm/cc/IrrigationCC.js.map +1 -1
- package/build/esm/cc/LanguageCC.d.ts.map +1 -1
- package/build/esm/cc/LanguageCC.js +266 -184
- package/build/esm/cc/LanguageCC.js.map +1 -1
- package/build/esm/cc/LockCC.d.ts.map +1 -1
- package/build/esm/cc/LockCC.js +247 -162
- package/build/esm/cc/LockCC.js.map +1 -1
- package/build/esm/cc/ManufacturerProprietaryCC.js +192 -141
- package/build/esm/cc/ManufacturerProprietaryCC.js.map +1 -1
- package/build/esm/cc/ManufacturerSpecificCC.d.ts.map +1 -1
- package/build/esm/cc/ManufacturerSpecificCC.js +312 -223
- package/build/esm/cc/ManufacturerSpecificCC.js.map +1 -1
- package/build/esm/cc/MeterCC.d.ts.map +1 -1
- package/build/esm/cc/MeterCC.js +896 -795
- package/build/esm/cc/MeterCC.js.map +1 -1
- package/build/esm/cc/MultiChannelAssociationCC.d.ts.map +1 -1
- package/build/esm/cc/MultiChannelAssociationCC.js +631 -518
- package/build/esm/cc/MultiChannelAssociationCC.js.map +1 -1
- package/build/esm/cc/MultiChannelCC.d.ts.map +1 -1
- package/build/esm/cc/MultiChannelCC.js +1106 -921
- package/build/esm/cc/MultiChannelCC.js.map +1 -1
- package/build/esm/cc/MultiCommandCC.js +166 -102
- package/build/esm/cc/MultiCommandCC.js.map +1 -1
- package/build/esm/cc/MultilevelSensorCC.d.ts.map +1 -1
- package/build/esm/cc/MultilevelSensorCC.js +616 -497
- package/build/esm/cc/MultilevelSensorCC.js.map +1 -1
- package/build/esm/cc/MultilevelSwitchCC.d.ts.map +1 -1
- package/build/esm/cc/MultilevelSwitchCC.js +621 -496
- package/build/esm/cc/MultilevelSwitchCC.js.map +1 -1
- package/build/esm/cc/NoOperationCC.js +82 -29
- package/build/esm/cc/NoOperationCC.js.map +1 -1
- package/build/esm/cc/NodeNamingCC.d.ts.map +1 -1
- package/build/esm/cc/NodeNamingCC.js +413 -294
- package/build/esm/cc/NodeNamingCC.js.map +1 -1
- package/build/esm/cc/NotificationCC.d.ts.map +1 -1
- package/build/esm/cc/NotificationCC.js +1097 -966
- package/build/esm/cc/NotificationCC.js.map +1 -1
- package/build/esm/cc/PowerlevelCC.js +437 -311
- package/build/esm/cc/PowerlevelCC.js.map +1 -1
- package/build/esm/cc/ProtectionCC.d.ts.map +1 -1
- package/build/esm/cc/ProtectionCC.js +704 -543
- package/build/esm/cc/ProtectionCC.js.map +1 -1
- package/build/esm/cc/SceneActivationCC.d.ts.map +1 -1
- package/build/esm/cc/SceneActivationCC.js +157 -100
- package/build/esm/cc/SceneActivationCC.js.map +1 -1
- package/build/esm/cc/SceneActuatorConfigurationCC.js +357 -269
- package/build/esm/cc/SceneActuatorConfigurationCC.js.map +1 -1
- package/build/esm/cc/SceneControllerConfigurationCC.js +434 -346
- package/build/esm/cc/SceneControllerConfigurationCC.js.map +1 -1
- package/build/esm/cc/ScheduleEntryLockCC.d.ts.map +1 -1
- package/build/esm/cc/ScheduleEntryLockCC.js +1596 -1357
- package/build/esm/cc/ScheduleEntryLockCC.js.map +1 -1
- package/build/esm/cc/Security2CC.js +1633 -1406
- package/build/esm/cc/Security2CC.js.map +1 -1
- package/build/esm/cc/SecurityCC.js +876 -687
- package/build/esm/cc/SecurityCC.js.map +1 -1
- package/build/esm/cc/SoundSwitchCC.d.ts.map +1 -1
- package/build/esm/cc/SoundSwitchCC.js +689 -526
- package/build/esm/cc/SoundSwitchCC.js.map +1 -1
- package/build/esm/cc/SupervisionCC.js +349 -272
- package/build/esm/cc/SupervisionCC.js.map +1 -1
- package/build/esm/cc/ThermostatFanModeCC.d.ts.map +1 -1
- package/build/esm/cc/ThermostatFanModeCC.js +388 -284
- package/build/esm/cc/ThermostatFanModeCC.js.map +1 -1
- package/build/esm/cc/ThermostatFanStateCC.d.ts.map +1 -1
- package/build/esm/cc/ThermostatFanStateCC.js +184 -111
- package/build/esm/cc/ThermostatFanStateCC.js.map +1 -1
- package/build/esm/cc/ThermostatModeCC.d.ts.map +1 -1
- package/build/esm/cc/ThermostatModeCC.js +435 -331
- package/build/esm/cc/ThermostatModeCC.js.map +1 -1
- package/build/esm/cc/ThermostatOperatingStateCC.d.ts.map +1 -1
- package/build/esm/cc/ThermostatOperatingStateCC.js +180 -107
- package/build/esm/cc/ThermostatOperatingStateCC.js.map +1 -1
- package/build/esm/cc/ThermostatSetbackCC.js +274 -185
- package/build/esm/cc/ThermostatSetbackCC.js.map +1 -1
- package/build/esm/cc/ThermostatSetpointCC.d.ts.map +1 -1
- package/build/esm/cc/ThermostatSetpointCC.js +674 -543
- package/build/esm/cc/ThermostatSetpointCC.js.map +1 -1
- package/build/esm/cc/TimeCC.js +499 -360
- package/build/esm/cc/TimeCC.js.map +1 -1
- package/build/esm/cc/TimeParametersCC.d.ts.map +1 -1
- package/build/esm/cc/TimeParametersCC.js +296 -211
- package/build/esm/cc/TimeParametersCC.js.map +1 -1
- package/build/esm/cc/TransportServiceCC.js +464 -363
- package/build/esm/cc/TransportServiceCC.js.map +1 -1
- package/build/esm/cc/UserCodeCC.d.ts.map +1 -1
- package/build/esm/cc/UserCodeCC.js +1443 -1205
- package/build/esm/cc/UserCodeCC.js.map +1 -1
- package/build/esm/cc/VersionCC.d.ts.map +1 -1
- package/build/esm/cc/VersionCC.js +744 -635
- package/build/esm/cc/VersionCC.js.map +1 -1
- package/build/esm/cc/WakeUpCC.d.ts.map +1 -1
- package/build/esm/cc/WakeUpCC.js +494 -364
- package/build/esm/cc/WakeUpCC.js.map +1 -1
- package/build/esm/cc/WindowCoveringCC.d.ts.map +1 -1
- package/build/esm/cc/WindowCoveringCC.js +655 -530
- package/build/esm/cc/WindowCoveringCC.js.map +1 -1
- package/build/esm/cc/ZWaveLongRangeCC.js +51 -11
- package/build/esm/cc/ZWaveLongRangeCC.js.map +1 -1
- package/build/esm/cc/ZWavePlusCC.d.ts.map +1 -1
- package/build/esm/cc/ZWavePlusCC.js +223 -162
- package/build/esm/cc/ZWavePlusCC.js.map +1 -1
- package/build/esm/cc/ZWaveProtocolCC.js +1443 -953
- package/build/esm/cc/ZWaveProtocolCC.js.map +1 -1
- package/build/esm/cc/manufacturerProprietary/Decorators.d.ts +4 -4
- package/build/esm/cc/manufacturerProprietary/Decorators.d.ts.map +1 -1
- package/build/esm/cc/manufacturerProprietary/FibaroCC.js +390 -286
- package/build/esm/cc/manufacturerProprietary/FibaroCC.js.map +1 -1
- package/build/esm/lib/CommandClassDecorators.d.ts +11 -15
- package/build/esm/lib/CommandClassDecorators.d.ts.map +1 -1
- package/build/esm/lib/CommandClassDecorators.js +24 -24
- package/build/esm/lib/CommandClassDecorators.js.map +1 -1
- package/build/esm/lib/Security2/Extension.d.ts +1 -1
- package/build/esm/lib/Security2/Extension.d.ts.map +1 -1
- package/build/esm/lib/Security2/Extension.js +207 -123
- package/build/esm/lib/Security2/Extension.js.map +1 -1
- package/package.json +6 -6
|
@@ -1,10 +1,37 @@
|
|
|
1
|
-
var
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
1
|
+
var __esDecorate = (this && this.__esDecorate) || function (ctor, descriptorIn, decorators, contextIn, initializers, extraInitializers) {
|
|
2
|
+
function accept(f) { if (f !== void 0 && typeof f !== "function") throw new TypeError("Function expected"); return f; }
|
|
3
|
+
var kind = contextIn.kind, key = kind === "getter" ? "get" : kind === "setter" ? "set" : "value";
|
|
4
|
+
var target = !descriptorIn && ctor ? contextIn["static"] ? ctor : ctor.prototype : null;
|
|
5
|
+
var descriptor = descriptorIn || (target ? Object.getOwnPropertyDescriptor(target, contextIn.name) : {});
|
|
6
|
+
var _, done = false;
|
|
7
|
+
for (var i = decorators.length - 1; i >= 0; i--) {
|
|
8
|
+
var context = {};
|
|
9
|
+
for (var p in contextIn) context[p] = p === "access" ? {} : contextIn[p];
|
|
10
|
+
for (var p in contextIn.access) context.access[p] = contextIn.access[p];
|
|
11
|
+
context.addInitializer = function (f) { if (done) throw new TypeError("Cannot add initializers after decoration has completed"); extraInitializers.push(accept(f || null)); };
|
|
12
|
+
var result = (0, decorators[i])(kind === "accessor" ? { get: descriptor.get, set: descriptor.set } : descriptor[key], context);
|
|
13
|
+
if (kind === "accessor") {
|
|
14
|
+
if (result === void 0) continue;
|
|
15
|
+
if (result === null || typeof result !== "object") throw new TypeError("Object expected");
|
|
16
|
+
if (_ = accept(result.get)) descriptor.get = _;
|
|
17
|
+
if (_ = accept(result.set)) descriptor.set = _;
|
|
18
|
+
if (_ = accept(result.init)) initializers.unshift(_);
|
|
19
|
+
}
|
|
20
|
+
else if (_ = accept(result)) {
|
|
21
|
+
if (kind === "field") initializers.unshift(_);
|
|
22
|
+
else descriptor[key] = _;
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
if (target) Object.defineProperty(target, contextIn.name, descriptor);
|
|
26
|
+
done = true;
|
|
27
|
+
};
|
|
28
|
+
var __runInitializers = (this && this.__runInitializers) || function (thisArg, initializers, value) {
|
|
29
|
+
var useValue = arguments.length > 2;
|
|
30
|
+
for (var i = 0; i < initializers.length; i++) {
|
|
31
|
+
value = useValue ? initializers[i].call(thisArg, value) : initializers[i].call(thisArg);
|
|
32
|
+
}
|
|
33
|
+
return useValue ? value : void 0;
|
|
6
34
|
};
|
|
7
|
-
var DoorLockCCOperationReport_1, DoorLockCCConfigurationReport_1, DoorLockCCCapabilitiesReport_1;
|
|
8
35
|
function __assertType(argName, typeName, boundHasError) {
|
|
9
36
|
const { ZWaveError, ZWaveErrorCodes } = require("@zwave-js/core");
|
|
10
37
|
if (boundHasError()) {
|
|
@@ -168,7 +195,7 @@ import { getEnumMemberName, pick } from "@zwave-js/shared/safe";
|
|
|
168
195
|
import { isArray } from "alcalzone-shared/typeguards/index.js";
|
|
169
196
|
import { CCAPI, POLL_VALUE, PhysicalCCAPI, SET_VALUE, throwUnsupportedProperty, throwWrongValueType, } from "../lib/API.js";
|
|
170
197
|
import { CommandClass, } from "../lib/CommandClass.js";
|
|
171
|
-
import { API, CCCommand,
|
|
198
|
+
import { API, CCCommand, ccValueProperty, ccValues, commandClass, expectedCCResponse, implementedVersion, useSupervision, } from "../lib/CommandClassDecorators.js";
|
|
172
199
|
import { V } from "../lib/Values.js";
|
|
173
200
|
import { DoorLockCommand, DoorLockMode, DoorLockOperationType, } from "../lib/_Types.js";
|
|
174
201
|
export const DoorLockCCValues = Object.freeze({
|
|
@@ -343,228 +370,255 @@ const configurationSetParameters = [
|
|
|
343
370
|
"twistAssist",
|
|
344
371
|
"blockToBlock",
|
|
345
372
|
];
|
|
346
|
-
let DoorLockCCAPI =
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
373
|
+
let DoorLockCCAPI = (() => {
|
|
374
|
+
let _classDecorators = [API(CommandClasses["Door Lock"])];
|
|
375
|
+
let _classDescriptor;
|
|
376
|
+
let _classExtraInitializers = [];
|
|
377
|
+
let _classThis;
|
|
378
|
+
let _classSuper = PhysicalCCAPI;
|
|
379
|
+
var DoorLockCCAPI = class extends _classSuper {
|
|
380
|
+
static { _classThis = this; }
|
|
381
|
+
static {
|
|
382
|
+
const _metadata = typeof Symbol === "function" && Symbol.metadata ? Object.create(_classSuper[Symbol.metadata] ?? null) : void 0;
|
|
383
|
+
__esDecorate(null, _classDescriptor = { value: _classThis }, _classDecorators, { kind: "class", name: _classThis.name, metadata: _metadata }, null, _classExtraInitializers);
|
|
384
|
+
DoorLockCCAPI = _classThis = _classDescriptor.value;
|
|
385
|
+
if (_metadata) Object.defineProperty(_classThis, Symbol.metadata, { enumerable: true, configurable: true, writable: true, value: _metadata });
|
|
386
|
+
__runInitializers(_classThis, _classExtraInitializers);
|
|
356
387
|
}
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
// Verify the current value after a delay, unless the command was supervised and successful
|
|
367
|
-
if (supervisedCommandSucceeded(result)) {
|
|
368
|
-
this.getValueDB().setValue(DoorLockCCValues.currentMode.endpoint(this.endpoint.index), value);
|
|
369
|
-
}
|
|
370
|
-
else {
|
|
371
|
-
this.schedulePoll({ property }, value);
|
|
372
|
-
}
|
|
373
|
-
return result;
|
|
388
|
+
supportsCommand(cmd) {
|
|
389
|
+
switch (cmd) {
|
|
390
|
+
case DoorLockCommand.OperationSet:
|
|
391
|
+
case DoorLockCommand.OperationGet:
|
|
392
|
+
case DoorLockCommand.ConfigurationSet:
|
|
393
|
+
case DoorLockCommand.ConfigurationGet:
|
|
394
|
+
return true; // This is mandatory
|
|
395
|
+
case DoorLockCommand.CapabilitiesGet:
|
|
396
|
+
return this.version >= 4;
|
|
374
397
|
}
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
|
|
383
|
-
|
|
384
|
-
|
|
385
|
-
|
|
386
|
-
|
|
387
|
-
property: param,
|
|
388
|
-
});
|
|
398
|
+
return super.supportsCommand(cmd);
|
|
399
|
+
}
|
|
400
|
+
get [SET_VALUE]() {
|
|
401
|
+
return async function ({ property }, value) {
|
|
402
|
+
if (property === "targetMode") {
|
|
403
|
+
if (typeof value !== "number") {
|
|
404
|
+
throwWrongValueType(this.ccId, property, "number", typeof value);
|
|
405
|
+
}
|
|
406
|
+
const result = await this.set(value);
|
|
407
|
+
// Verify the current value after a delay, unless the command was supervised and successful
|
|
408
|
+
if (supervisedCommandSucceeded(result)) {
|
|
409
|
+
this.getValueDB().setValue(DoorLockCCValues.currentMode.endpoint(this.endpoint.index), value);
|
|
389
410
|
}
|
|
411
|
+
else {
|
|
412
|
+
this.schedulePoll({ property }, value);
|
|
413
|
+
}
|
|
414
|
+
return result;
|
|
390
415
|
}
|
|
391
|
-
|
|
392
|
-
|
|
393
|
-
|
|
394
|
-
|
|
416
|
+
else if (typeof property === "string"
|
|
417
|
+
&& configurationSetParameters.includes(property)) {
|
|
418
|
+
// checking every type here would create a LOT of duplicate code, so we don't
|
|
419
|
+
// ConfigurationSet expects all parameters --> read the others from cache
|
|
420
|
+
const config = {
|
|
421
|
+
[property]: value,
|
|
422
|
+
};
|
|
423
|
+
for (const param of configurationSetParameters) {
|
|
424
|
+
if (param !== property) {
|
|
425
|
+
config[param] = this.tryGetValueDB()?.getValue({
|
|
426
|
+
commandClass: this.ccId,
|
|
427
|
+
endpoint: this.endpoint.index,
|
|
428
|
+
property: param,
|
|
429
|
+
});
|
|
430
|
+
}
|
|
431
|
+
}
|
|
432
|
+
// Fix insideHandlesCanOpenDoorConfiguration is not iterable
|
|
433
|
+
const allTrue = [true, true, true, true];
|
|
434
|
+
if (!config.insideHandlesCanOpenDoorConfiguration) {
|
|
435
|
+
config.insideHandlesCanOpenDoorConfiguration = allTrue;
|
|
436
|
+
}
|
|
437
|
+
if (!config.outsideHandlesCanOpenDoorConfiguration) {
|
|
438
|
+
config.outsideHandlesCanOpenDoorConfiguration = allTrue;
|
|
439
|
+
}
|
|
440
|
+
const result = await this.setConfiguration(config);
|
|
441
|
+
// Verify the current value after a delay, unless the command was supervised and successful
|
|
442
|
+
if (!supervisedCommandSucceeded(result)) {
|
|
443
|
+
this.schedulePoll({ property }, value);
|
|
444
|
+
}
|
|
445
|
+
return result;
|
|
395
446
|
}
|
|
396
|
-
|
|
397
|
-
|
|
447
|
+
else {
|
|
448
|
+
throwUnsupportedProperty(this.ccId, property);
|
|
398
449
|
}
|
|
399
|
-
|
|
400
|
-
|
|
401
|
-
|
|
402
|
-
|
|
450
|
+
};
|
|
451
|
+
}
|
|
452
|
+
get [POLL_VALUE]() {
|
|
453
|
+
return async function ({ property }) {
|
|
454
|
+
switch (property) {
|
|
455
|
+
case "currentMode":
|
|
456
|
+
case "targetMode":
|
|
457
|
+
case "duration":
|
|
458
|
+
case "outsideHandlesCanOpenDoor":
|
|
459
|
+
case "insideHandlesCanOpenDoor":
|
|
460
|
+
case "latchStatus":
|
|
461
|
+
case "boltStatus":
|
|
462
|
+
case "doorStatus":
|
|
463
|
+
case "lockTimeout":
|
|
464
|
+
return (await this.get())?.[property];
|
|
465
|
+
case "operationType":
|
|
466
|
+
case "outsideHandlesCanOpenDoorConfiguration":
|
|
467
|
+
case "insideHandlesCanOpenDoorConfiguration":
|
|
468
|
+
case "lockTimeoutConfiguration":
|
|
469
|
+
case "autoRelockTime":
|
|
470
|
+
case "holdAndReleaseTime":
|
|
471
|
+
case "twistAssist":
|
|
472
|
+
case "blockToBlock":
|
|
473
|
+
return (await this.getConfiguration())?.[property];
|
|
474
|
+
default:
|
|
475
|
+
throwUnsupportedProperty(this.ccId, property);
|
|
403
476
|
}
|
|
404
|
-
|
|
405
|
-
|
|
406
|
-
|
|
407
|
-
|
|
477
|
+
};
|
|
478
|
+
}
|
|
479
|
+
// eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types
|
|
480
|
+
async getCapabilities() {
|
|
481
|
+
this.assertSupportsCommand(DoorLockCommand, DoorLockCommand.CapabilitiesGet);
|
|
482
|
+
const cc = new DoorLockCCCapabilitiesGet({
|
|
483
|
+
nodeId: this.endpoint.nodeId,
|
|
484
|
+
endpointIndex: this.endpoint.index,
|
|
485
|
+
});
|
|
486
|
+
const response = await this.host.sendCommand(cc, this.commandOptions);
|
|
487
|
+
if (response) {
|
|
488
|
+
return pick(response, [
|
|
489
|
+
"autoRelockSupported",
|
|
490
|
+
"blockToBlockSupported",
|
|
491
|
+
"boltSupported",
|
|
492
|
+
"doorSupported",
|
|
493
|
+
"holdAndReleaseSupported",
|
|
494
|
+
"latchSupported",
|
|
495
|
+
"twistAssistSupported",
|
|
496
|
+
"supportedDoorLockModes",
|
|
497
|
+
"supportedInsideHandles",
|
|
498
|
+
"supportedOperationTypes",
|
|
499
|
+
"supportedOutsideHandles",
|
|
500
|
+
]);
|
|
408
501
|
}
|
|
409
|
-
}
|
|
410
|
-
|
|
411
|
-
|
|
412
|
-
|
|
413
|
-
|
|
414
|
-
|
|
415
|
-
|
|
416
|
-
|
|
417
|
-
|
|
418
|
-
|
|
419
|
-
|
|
420
|
-
|
|
421
|
-
|
|
422
|
-
|
|
423
|
-
|
|
424
|
-
|
|
425
|
-
|
|
426
|
-
|
|
427
|
-
|
|
428
|
-
|
|
429
|
-
|
|
430
|
-
case "twistAssist":
|
|
431
|
-
case "blockToBlock":
|
|
432
|
-
return (await this.getConfiguration())?.[property];
|
|
433
|
-
default:
|
|
434
|
-
throwUnsupportedProperty(this.ccId, property);
|
|
502
|
+
}
|
|
503
|
+
// eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types
|
|
504
|
+
async get() {
|
|
505
|
+
this.assertSupportsCommand(DoorLockCommand, DoorLockCommand.OperationGet);
|
|
506
|
+
const cc = new DoorLockCCOperationGet({
|
|
507
|
+
nodeId: this.endpoint.nodeId,
|
|
508
|
+
endpointIndex: this.endpoint.index,
|
|
509
|
+
});
|
|
510
|
+
const response = await this.host.sendCommand(cc, this.commandOptions);
|
|
511
|
+
if (response) {
|
|
512
|
+
return pick(response, [
|
|
513
|
+
"currentMode",
|
|
514
|
+
"targetMode",
|
|
515
|
+
"duration",
|
|
516
|
+
"outsideHandlesCanOpenDoor",
|
|
517
|
+
"insideHandlesCanOpenDoor",
|
|
518
|
+
"latchStatus",
|
|
519
|
+
"boltStatus",
|
|
520
|
+
"doorStatus",
|
|
521
|
+
"lockTimeout",
|
|
522
|
+
]);
|
|
435
523
|
}
|
|
436
|
-
};
|
|
437
|
-
}
|
|
438
|
-
// eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types
|
|
439
|
-
async getCapabilities() {
|
|
440
|
-
this.assertSupportsCommand(DoorLockCommand, DoorLockCommand.CapabilitiesGet);
|
|
441
|
-
const cc = new DoorLockCCCapabilitiesGet({
|
|
442
|
-
nodeId: this.endpoint.nodeId,
|
|
443
|
-
endpointIndex: this.endpoint.index,
|
|
444
|
-
});
|
|
445
|
-
const response = await this.host.sendCommand(cc, this.commandOptions);
|
|
446
|
-
if (response) {
|
|
447
|
-
return pick(response, [
|
|
448
|
-
"autoRelockSupported",
|
|
449
|
-
"blockToBlockSupported",
|
|
450
|
-
"boltSupported",
|
|
451
|
-
"doorSupported",
|
|
452
|
-
"holdAndReleaseSupported",
|
|
453
|
-
"latchSupported",
|
|
454
|
-
"twistAssistSupported",
|
|
455
|
-
"supportedDoorLockModes",
|
|
456
|
-
"supportedInsideHandles",
|
|
457
|
-
"supportedOperationTypes",
|
|
458
|
-
"supportedOutsideHandles",
|
|
459
|
-
]);
|
|
460
524
|
}
|
|
461
|
-
|
|
462
|
-
|
|
463
|
-
|
|
464
|
-
|
|
465
|
-
|
|
466
|
-
|
|
467
|
-
|
|
468
|
-
|
|
469
|
-
|
|
470
|
-
if (response) {
|
|
471
|
-
return pick(response, [
|
|
472
|
-
"currentMode",
|
|
473
|
-
"targetMode",
|
|
474
|
-
"duration",
|
|
475
|
-
"outsideHandlesCanOpenDoor",
|
|
476
|
-
"insideHandlesCanOpenDoor",
|
|
477
|
-
"latchStatus",
|
|
478
|
-
"boltStatus",
|
|
479
|
-
"doorStatus",
|
|
480
|
-
"lockTimeout",
|
|
481
|
-
]);
|
|
525
|
+
async set(mode) {
|
|
526
|
+
__assertType("mode", "DoorLockMode", __assertType__DoorLockMode.bind(void 0, mode));
|
|
527
|
+
this.assertSupportsCommand(DoorLockCommand, DoorLockCommand.OperationSet);
|
|
528
|
+
const cc = new DoorLockCCOperationSet({
|
|
529
|
+
nodeId: this.endpoint.nodeId,
|
|
530
|
+
endpointIndex: this.endpoint.index,
|
|
531
|
+
mode,
|
|
532
|
+
});
|
|
533
|
+
return this.host.sendCommand(cc, this.commandOptions);
|
|
482
534
|
}
|
|
483
|
-
|
|
484
|
-
|
|
485
|
-
|
|
486
|
-
|
|
487
|
-
|
|
488
|
-
|
|
489
|
-
|
|
490
|
-
|
|
491
|
-
|
|
492
|
-
return this.host.sendCommand(cc, this.commandOptions);
|
|
493
|
-
}
|
|
494
|
-
async setConfiguration(configuration) {
|
|
495
|
-
__assertType("configuration", "DoorLockCCConfigurationSetOptions", __assertType__DoorLockCCConfigurationSetOptions.bind(void 0, configuration));
|
|
496
|
-
this.assertSupportsCommand(DoorLockCommand, DoorLockCommand.ConfigurationSet);
|
|
497
|
-
const cc = new DoorLockCCConfigurationSet({
|
|
498
|
-
nodeId: this.endpoint.nodeId,
|
|
499
|
-
endpointIndex: this.endpoint.index,
|
|
500
|
-
...configuration,
|
|
501
|
-
});
|
|
502
|
-
return this.host.sendCommand(cc, this.commandOptions);
|
|
503
|
-
}
|
|
504
|
-
// eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types
|
|
505
|
-
async getConfiguration() {
|
|
506
|
-
this.assertSupportsCommand(DoorLockCommand, DoorLockCommand.ConfigurationGet);
|
|
507
|
-
const cc = new DoorLockCCConfigurationGet({
|
|
508
|
-
nodeId: this.endpoint.nodeId,
|
|
509
|
-
endpointIndex: this.endpoint.index,
|
|
510
|
-
});
|
|
511
|
-
const response = await this.host.sendCommand(cc, this.commandOptions);
|
|
512
|
-
if (response) {
|
|
513
|
-
return pick(response, [
|
|
514
|
-
"operationType",
|
|
515
|
-
"outsideHandlesCanOpenDoorConfiguration",
|
|
516
|
-
"insideHandlesCanOpenDoorConfiguration",
|
|
517
|
-
"lockTimeoutConfiguration",
|
|
518
|
-
"autoRelockTime",
|
|
519
|
-
"holdAndReleaseTime",
|
|
520
|
-
"twistAssist",
|
|
521
|
-
"blockToBlock",
|
|
522
|
-
]);
|
|
535
|
+
async setConfiguration(configuration) {
|
|
536
|
+
__assertType("configuration", "DoorLockCCConfigurationSetOptions", __assertType__DoorLockCCConfigurationSetOptions.bind(void 0, configuration));
|
|
537
|
+
this.assertSupportsCommand(DoorLockCommand, DoorLockCommand.ConfigurationSet);
|
|
538
|
+
const cc = new DoorLockCCConfigurationSet({
|
|
539
|
+
nodeId: this.endpoint.nodeId,
|
|
540
|
+
endpointIndex: this.endpoint.index,
|
|
541
|
+
...configuration,
|
|
542
|
+
});
|
|
543
|
+
return this.host.sendCommand(cc, this.commandOptions);
|
|
523
544
|
}
|
|
524
|
-
|
|
525
|
-
|
|
526
|
-
|
|
527
|
-
|
|
528
|
-
|
|
545
|
+
// eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types
|
|
546
|
+
async getConfiguration() {
|
|
547
|
+
this.assertSupportsCommand(DoorLockCommand, DoorLockCommand.ConfigurationGet);
|
|
548
|
+
const cc = new DoorLockCCConfigurationGet({
|
|
549
|
+
nodeId: this.endpoint.nodeId,
|
|
550
|
+
endpointIndex: this.endpoint.index,
|
|
551
|
+
});
|
|
552
|
+
const response = await this.host.sendCommand(cc, this.commandOptions);
|
|
553
|
+
if (response) {
|
|
554
|
+
return pick(response, [
|
|
555
|
+
"operationType",
|
|
556
|
+
"outsideHandlesCanOpenDoorConfiguration",
|
|
557
|
+
"insideHandlesCanOpenDoorConfiguration",
|
|
558
|
+
"lockTimeoutConfiguration",
|
|
559
|
+
"autoRelockTime",
|
|
560
|
+
"holdAndReleaseTime",
|
|
561
|
+
"twistAssist",
|
|
562
|
+
"blockToBlock",
|
|
563
|
+
]);
|
|
564
|
+
}
|
|
565
|
+
}
|
|
566
|
+
};
|
|
567
|
+
return DoorLockCCAPI = _classThis;
|
|
568
|
+
})();
|
|
529
569
|
export { DoorLockCCAPI };
|
|
530
|
-
let DoorLockCC =
|
|
531
|
-
|
|
532
|
-
|
|
533
|
-
|
|
534
|
-
|
|
535
|
-
|
|
536
|
-
|
|
537
|
-
|
|
538
|
-
|
|
539
|
-
|
|
540
|
-
|
|
541
|
-
|
|
542
|
-
|
|
543
|
-
|
|
544
|
-
|
|
545
|
-
|
|
546
|
-
|
|
547
|
-
|
|
548
|
-
|
|
549
|
-
|
|
570
|
+
let DoorLockCC = (() => {
|
|
571
|
+
let _classDecorators = [commandClass(CommandClasses["Door Lock"]), implementedVersion(4), ccValues(DoorLockCCValues)];
|
|
572
|
+
let _classDescriptor;
|
|
573
|
+
let _classExtraInitializers = [];
|
|
574
|
+
let _classThis;
|
|
575
|
+
let _classSuper = CommandClass;
|
|
576
|
+
var DoorLockCC = class extends _classSuper {
|
|
577
|
+
static { _classThis = this; }
|
|
578
|
+
static {
|
|
579
|
+
const _metadata = typeof Symbol === "function" && Symbol.metadata ? Object.create(_classSuper[Symbol.metadata] ?? null) : void 0;
|
|
580
|
+
__esDecorate(null, _classDescriptor = { value: _classThis }, _classDecorators, { kind: "class", name: _classThis.name, metadata: _metadata }, null, _classExtraInitializers);
|
|
581
|
+
DoorLockCC = _classThis = _classDescriptor.value;
|
|
582
|
+
if (_metadata) Object.defineProperty(_classThis, Symbol.metadata, { enumerable: true, configurable: true, writable: true, value: _metadata });
|
|
583
|
+
__runInitializers(_classThis, _classExtraInitializers);
|
|
584
|
+
}
|
|
585
|
+
async interview(ctx) {
|
|
586
|
+
const node = this.getNode(ctx);
|
|
587
|
+
const endpoint = this.getEndpoint(ctx);
|
|
588
|
+
const api = CCAPI.create(CommandClasses["Door Lock"], ctx, endpoint).withOptions({
|
|
589
|
+
priority: MessagePriority.NodeQuery,
|
|
590
|
+
});
|
|
550
591
|
ctx.logNode(node.id, {
|
|
551
592
|
endpoint: this.endpointIndex,
|
|
552
|
-
message:
|
|
553
|
-
direction: "
|
|
593
|
+
message: `Interviewing ${this.ccName}...`,
|
|
594
|
+
direction: "none",
|
|
554
595
|
});
|
|
555
|
-
|
|
556
|
-
|
|
557
|
-
|
|
596
|
+
// We need to do some queries after a potential timeout
|
|
597
|
+
// In this case, do now mark this CC as interviewed completely
|
|
598
|
+
let hadCriticalTimeout = false;
|
|
599
|
+
// By default, assume all status sensors to be supported
|
|
600
|
+
let doorSupported = true;
|
|
601
|
+
let boltSupported = true;
|
|
602
|
+
let latchSupported = true;
|
|
603
|
+
if (api.version >= 4) {
|
|
604
|
+
ctx.logNode(node.id, {
|
|
605
|
+
endpoint: this.endpointIndex,
|
|
606
|
+
message: "requesting lock capabilities...",
|
|
607
|
+
direction: "outbound",
|
|
608
|
+
});
|
|
609
|
+
const resp = await api.getCapabilities();
|
|
610
|
+
if (resp) {
|
|
611
|
+
const logMessage = `received lock capabilities:
|
|
558
612
|
supported operation types: ${resp.supportedOperationTypes
|
|
559
|
-
|
|
560
|
-
|
|
613
|
+
.map((t) => getEnumMemberName(DoorLockOperationType, t))
|
|
614
|
+
.join(", ")}
|
|
561
615
|
supported door lock modes: ${resp.supportedDoorLockModes
|
|
562
|
-
|
|
563
|
-
|
|
564
|
-
|
|
616
|
+
.map((t) => getEnumMemberName(DoorLockMode, t))
|
|
617
|
+
.map((str) => `\n· ${str}`)
|
|
618
|
+
.join("")}
|
|
565
619
|
supported outside handles: ${resp.supportedOutsideHandles
|
|
566
|
-
|
|
567
|
-
|
|
620
|
+
.map(String)
|
|
621
|
+
.join(", ")}
|
|
568
622
|
supported inside handles: ${resp.supportedInsideHandles.map(String).join(", ")}
|
|
569
623
|
supports door status: ${resp.doorSupported}
|
|
570
624
|
supports bolt status: ${resp.boltSupported}
|
|
@@ -573,698 +627,746 @@ supports auto-relock: ${resp.autoRelockSupported}
|
|
|
573
627
|
supports hold-and-release: ${resp.holdAndReleaseSupported}
|
|
574
628
|
supports twist assist: ${resp.twistAssistSupported}
|
|
575
629
|
supports block to block: ${resp.blockToBlockSupported}`;
|
|
576
|
-
|
|
577
|
-
|
|
578
|
-
|
|
579
|
-
|
|
580
|
-
|
|
581
|
-
|
|
582
|
-
|
|
583
|
-
|
|
584
|
-
|
|
585
|
-
|
|
586
|
-
|
|
587
|
-
|
|
588
|
-
|
|
589
|
-
|
|
590
|
-
|
|
591
|
-
|
|
592
|
-
|
|
593
|
-
|
|
594
|
-
|
|
630
|
+
ctx.logNode(node.id, {
|
|
631
|
+
endpoint: this.endpointIndex,
|
|
632
|
+
message: logMessage,
|
|
633
|
+
direction: "inbound",
|
|
634
|
+
});
|
|
635
|
+
doorSupported = resp.doorSupported;
|
|
636
|
+
boltSupported = resp.boltSupported;
|
|
637
|
+
latchSupported = resp.latchSupported;
|
|
638
|
+
// Update metadata of settable states
|
|
639
|
+
const targetModeValue = DoorLockCCValues.targetMode;
|
|
640
|
+
this.setMetadata(ctx, targetModeValue, {
|
|
641
|
+
...targetModeValue.meta,
|
|
642
|
+
states: enumValuesToMetadataStates(DoorLockMode, resp.supportedDoorLockModes),
|
|
643
|
+
});
|
|
644
|
+
const operationTypeValue = DoorLockCCValues.operationType;
|
|
645
|
+
this.setMetadata(ctx, operationTypeValue, {
|
|
646
|
+
...operationTypeValue.meta,
|
|
647
|
+
states: enumValuesToMetadataStates(DoorLockOperationType, resp.supportedOperationTypes),
|
|
648
|
+
});
|
|
649
|
+
}
|
|
650
|
+
else {
|
|
651
|
+
hadCriticalTimeout = true;
|
|
652
|
+
}
|
|
595
653
|
}
|
|
596
|
-
|
|
597
|
-
|
|
654
|
+
if (!hadCriticalTimeout) {
|
|
655
|
+
// Save support information for the status values
|
|
656
|
+
const doorStatusValue = DoorLockCCValues.doorStatus;
|
|
657
|
+
if (doorSupported)
|
|
658
|
+
this.setMetadata(ctx, doorStatusValue);
|
|
659
|
+
this.setValue(ctx, DoorLockCCValues.doorSupported, doorSupported);
|
|
660
|
+
const latchStatusValue = DoorLockCCValues.latchStatus;
|
|
661
|
+
if (latchSupported)
|
|
662
|
+
this.setMetadata(ctx, latchStatusValue);
|
|
663
|
+
this.setValue(ctx, DoorLockCCValues.latchSupported, latchSupported);
|
|
664
|
+
const boltStatusValue = DoorLockCCValues.boltStatus;
|
|
665
|
+
if (boltSupported)
|
|
666
|
+
this.setMetadata(ctx, boltStatusValue);
|
|
667
|
+
this.setValue(ctx, DoorLockCCValues.boltSupported, boltSupported);
|
|
598
668
|
}
|
|
669
|
+
await this.refreshValues(ctx);
|
|
670
|
+
// Remember that the interview is complete
|
|
671
|
+
if (!hadCriticalTimeout)
|
|
672
|
+
this.setInterviewComplete(ctx, true);
|
|
599
673
|
}
|
|
600
|
-
|
|
601
|
-
|
|
602
|
-
const
|
|
603
|
-
|
|
604
|
-
|
|
605
|
-
|
|
606
|
-
|
|
607
|
-
|
|
608
|
-
|
|
609
|
-
|
|
610
|
-
|
|
611
|
-
|
|
612
|
-
|
|
613
|
-
|
|
614
|
-
}
|
|
615
|
-
await this.refreshValues(ctx);
|
|
616
|
-
// Remember that the interview is complete
|
|
617
|
-
if (!hadCriticalTimeout)
|
|
618
|
-
this.setInterviewComplete(ctx, true);
|
|
619
|
-
}
|
|
620
|
-
async refreshValues(ctx) {
|
|
621
|
-
const node = this.getNode(ctx);
|
|
622
|
-
const endpoint = this.getEndpoint(ctx);
|
|
623
|
-
const api = CCAPI.create(CommandClasses["Door Lock"], ctx, endpoint).withOptions({
|
|
624
|
-
priority: MessagePriority.NodeQuery,
|
|
625
|
-
});
|
|
626
|
-
ctx.logNode(node.id, {
|
|
627
|
-
endpoint: this.endpointIndex,
|
|
628
|
-
message: "requesting lock configuration...",
|
|
629
|
-
direction: "outbound",
|
|
630
|
-
});
|
|
631
|
-
const config = await api.getConfiguration();
|
|
632
|
-
if (config) {
|
|
633
|
-
let logMessage = `received lock configuration:
|
|
674
|
+
async refreshValues(ctx) {
|
|
675
|
+
const node = this.getNode(ctx);
|
|
676
|
+
const endpoint = this.getEndpoint(ctx);
|
|
677
|
+
const api = CCAPI.create(CommandClasses["Door Lock"], ctx, endpoint).withOptions({
|
|
678
|
+
priority: MessagePriority.NodeQuery,
|
|
679
|
+
});
|
|
680
|
+
ctx.logNode(node.id, {
|
|
681
|
+
endpoint: this.endpointIndex,
|
|
682
|
+
message: "requesting lock configuration...",
|
|
683
|
+
direction: "outbound",
|
|
684
|
+
});
|
|
685
|
+
const config = await api.getConfiguration();
|
|
686
|
+
if (config) {
|
|
687
|
+
let logMessage = `received lock configuration:
|
|
634
688
|
operation type: ${getEnumMemberName(DoorLockOperationType, config.operationType)}`;
|
|
635
|
-
|
|
636
|
-
|
|
689
|
+
if (config.operationType === DoorLockOperationType.Timed) {
|
|
690
|
+
logMessage += `
|
|
637
691
|
lock timeout: ${config.lockTimeoutConfiguration} seconds
|
|
638
692
|
`;
|
|
639
|
-
|
|
640
|
-
|
|
693
|
+
}
|
|
694
|
+
logMessage += `
|
|
641
695
|
outside handles can open door: ${config.outsideHandlesCanOpenDoorConfiguration
|
|
642
|
-
|
|
643
|
-
|
|
696
|
+
.map(String)
|
|
697
|
+
.join(", ")}
|
|
644
698
|
inside handles can open door: ${config.insideHandlesCanOpenDoorConfiguration
|
|
645
|
-
|
|
646
|
-
|
|
647
|
-
|
|
648
|
-
|
|
699
|
+
.map(String)
|
|
700
|
+
.join(", ")}`;
|
|
701
|
+
if (api.version >= 4) {
|
|
702
|
+
logMessage += `
|
|
649
703
|
auto-relock time ${config.autoRelockTime ?? "-"} seconds
|
|
650
704
|
hold-and-release time ${config.holdAndReleaseTime ?? "-"} seconds
|
|
651
705
|
twist assist ${!!config.twistAssist}
|
|
652
706
|
block to block ${!!config.blockToBlock}`;
|
|
707
|
+
}
|
|
708
|
+
ctx.logNode(node.id, {
|
|
709
|
+
endpoint: this.endpointIndex,
|
|
710
|
+
message: logMessage,
|
|
711
|
+
direction: "inbound",
|
|
712
|
+
});
|
|
653
713
|
}
|
|
654
714
|
ctx.logNode(node.id, {
|
|
655
715
|
endpoint: this.endpointIndex,
|
|
656
|
-
message:
|
|
657
|
-
direction: "
|
|
716
|
+
message: "requesting current lock status...",
|
|
717
|
+
direction: "outbound",
|
|
658
718
|
});
|
|
659
|
-
|
|
660
|
-
|
|
661
|
-
|
|
662
|
-
message: "requesting current lock status...",
|
|
663
|
-
direction: "outbound",
|
|
664
|
-
});
|
|
665
|
-
const status = await api.get();
|
|
666
|
-
if (status) {
|
|
667
|
-
let logMessage = `received lock status:
|
|
719
|
+
const status = await api.get();
|
|
720
|
+
if (status) {
|
|
721
|
+
let logMessage = `received lock status:
|
|
668
722
|
current mode: ${getEnumMemberName(DoorLockMode, status.currentMode)}`;
|
|
669
|
-
|
|
670
|
-
|
|
723
|
+
if (status.targetMode != undefined) {
|
|
724
|
+
logMessage += `
|
|
671
725
|
target mode: ${getEnumMemberName(DoorLockMode, status.targetMode)}
|
|
672
726
|
remaining duration: ${status.duration?.toString() ?? "undefined"}`;
|
|
673
|
-
|
|
674
|
-
|
|
675
|
-
|
|
727
|
+
}
|
|
728
|
+
if (status.lockTimeout != undefined) {
|
|
729
|
+
logMessage += `
|
|
676
730
|
lock timeout: ${status.lockTimeout} seconds`;
|
|
677
|
-
|
|
678
|
-
|
|
679
|
-
|
|
731
|
+
}
|
|
732
|
+
if (status.doorStatus != undefined) {
|
|
733
|
+
logMessage += `
|
|
680
734
|
door status: ${status.doorStatus}`;
|
|
681
|
-
|
|
682
|
-
|
|
683
|
-
|
|
735
|
+
}
|
|
736
|
+
if (status.boltStatus != undefined) {
|
|
737
|
+
logMessage += `
|
|
684
738
|
bolt status: ${status.boltStatus}`;
|
|
685
|
-
|
|
686
|
-
|
|
687
|
-
|
|
739
|
+
}
|
|
740
|
+
if (status.latchStatus != undefined) {
|
|
741
|
+
logMessage += `
|
|
688
742
|
latch status: ${status.latchStatus}`;
|
|
743
|
+
}
|
|
744
|
+
ctx.logNode(node.id, {
|
|
745
|
+
endpoint: this.endpointIndex,
|
|
746
|
+
message: logMessage,
|
|
747
|
+
direction: "inbound",
|
|
748
|
+
});
|
|
689
749
|
}
|
|
690
|
-
ctx.logNode(node.id, {
|
|
691
|
-
endpoint: this.endpointIndex,
|
|
692
|
-
message: logMessage,
|
|
693
|
-
direction: "inbound",
|
|
694
|
-
});
|
|
695
750
|
}
|
|
696
|
-
}
|
|
697
|
-
|
|
698
|
-
|
|
699
|
-
commandClass(CommandClasses["Door Lock"]),
|
|
700
|
-
implementedVersion(4),
|
|
701
|
-
ccValues(DoorLockCCValues)
|
|
702
|
-
], DoorLockCC);
|
|
751
|
+
};
|
|
752
|
+
return DoorLockCC = _classThis;
|
|
753
|
+
})();
|
|
703
754
|
export { DoorLockCC };
|
|
704
|
-
let DoorLockCCOperationSet =
|
|
705
|
-
|
|
706
|
-
|
|
707
|
-
|
|
708
|
-
|
|
709
|
-
|
|
710
|
-
|
|
711
|
-
|
|
712
|
-
|
|
713
|
-
|
|
714
|
-
|
|
715
|
-
|
|
716
|
-
|
|
717
|
-
|
|
718
|
-
}
|
|
719
|
-
mode;
|
|
720
|
-
serialize(ctx) {
|
|
721
|
-
this.payload = Bytes.from([this.mode]);
|
|
722
|
-
return super.serialize(ctx);
|
|
723
|
-
}
|
|
724
|
-
toLogEntry(ctx) {
|
|
725
|
-
return {
|
|
726
|
-
...super.toLogEntry(ctx),
|
|
727
|
-
message: {
|
|
728
|
-
"target mode": getEnumMemberName(DoorLockMode, this.mode),
|
|
729
|
-
},
|
|
730
|
-
};
|
|
731
|
-
}
|
|
732
|
-
};
|
|
733
|
-
DoorLockCCOperationSet = __decorate([
|
|
734
|
-
CCCommand(DoorLockCommand.OperationSet),
|
|
735
|
-
useSupervision()
|
|
736
|
-
], DoorLockCCOperationSet);
|
|
737
|
-
export { DoorLockCCOperationSet };
|
|
738
|
-
let DoorLockCCOperationReport = DoorLockCCOperationReport_1 = class DoorLockCCOperationReport extends DoorLockCC {
|
|
739
|
-
constructor(options) {
|
|
740
|
-
super(options);
|
|
741
|
-
// TODO: Check implementation:
|
|
742
|
-
this.currentMode = options.currentMode;
|
|
743
|
-
this.outsideHandlesCanOpenDoor = options.outsideHandlesCanOpenDoor;
|
|
744
|
-
this.insideHandlesCanOpenDoor = options.insideHandlesCanOpenDoor;
|
|
745
|
-
this.doorStatus = options.doorStatus;
|
|
746
|
-
this.boltStatus = options.boltStatus;
|
|
747
|
-
this.latchStatus = options.latchStatus;
|
|
748
|
-
this.lockTimeout = options.lockTimeout;
|
|
749
|
-
this.targetMode = options.targetMode;
|
|
750
|
-
this.duration = options.duration;
|
|
751
|
-
}
|
|
752
|
-
static from(raw, ctx) {
|
|
753
|
-
validatePayload(raw.payload.length >= 5);
|
|
754
|
-
const currentMode = raw.payload[0];
|
|
755
|
-
const outsideHandlesCanOpenDoor = [
|
|
756
|
-
!!(raw.payload[1] & 0b0001_0000),
|
|
757
|
-
!!(raw.payload[1] & 0b0010_0000),
|
|
758
|
-
!!(raw.payload[1] & 0b0100_0000),
|
|
759
|
-
!!(raw.payload[1] & 0b1000_0000),
|
|
760
|
-
];
|
|
761
|
-
const insideHandlesCanOpenDoor = [
|
|
762
|
-
!!(raw.payload[1] & 0b0001),
|
|
763
|
-
!!(raw.payload[1] & 0b0010),
|
|
764
|
-
!!(raw.payload[1] & 0b0100),
|
|
765
|
-
!!(raw.payload[1] & 0b1000),
|
|
766
|
-
];
|
|
767
|
-
const doorStatus = !!(raw.payload[2] & 0b1)
|
|
768
|
-
? "closed"
|
|
769
|
-
: "open";
|
|
770
|
-
const boltStatus = !!(raw.payload[2] & 0b10) ? "unlocked" : "locked";
|
|
771
|
-
const latchStatus = !!(raw.payload[2] & 0b100)
|
|
772
|
-
? "closed"
|
|
773
|
-
: "open";
|
|
774
|
-
// Ignore invalid timeout values
|
|
775
|
-
const lockTimeoutMinutes = raw.payload[3];
|
|
776
|
-
const lockTimeoutSeconds = raw.payload[4];
|
|
777
|
-
let lockTimeout;
|
|
778
|
-
if (lockTimeoutMinutes <= 253 && lockTimeoutSeconds <= 59) {
|
|
779
|
-
lockTimeout = lockTimeoutSeconds + lockTimeoutMinutes * 60;
|
|
755
|
+
let DoorLockCCOperationSet = (() => {
|
|
756
|
+
let _classDecorators = [CCCommand(DoorLockCommand.OperationSet), useSupervision()];
|
|
757
|
+
let _classDescriptor;
|
|
758
|
+
let _classExtraInitializers = [];
|
|
759
|
+
let _classThis;
|
|
760
|
+
let _classSuper = DoorLockCC;
|
|
761
|
+
var DoorLockCCOperationSet = class extends _classSuper {
|
|
762
|
+
static { _classThis = this; }
|
|
763
|
+
static {
|
|
764
|
+
const _metadata = typeof Symbol === "function" && Symbol.metadata ? Object.create(_classSuper[Symbol.metadata] ?? null) : void 0;
|
|
765
|
+
__esDecorate(null, _classDescriptor = { value: _classThis }, _classDecorators, { kind: "class", name: _classThis.name, metadata: _metadata }, null, _classExtraInitializers);
|
|
766
|
+
DoorLockCCOperationSet = _classThis = _classDescriptor.value;
|
|
767
|
+
if (_metadata) Object.defineProperty(_classThis, Symbol.metadata, { enumerable: true, configurable: true, writable: true, value: _metadata });
|
|
768
|
+
__runInitializers(_classThis, _classExtraInitializers);
|
|
780
769
|
}
|
|
781
|
-
|
|
782
|
-
|
|
783
|
-
|
|
784
|
-
|
|
785
|
-
|
|
786
|
-
|
|
787
|
-
return new DoorLockCCOperationReport_1({
|
|
788
|
-
nodeId: ctx.sourceNodeId,
|
|
789
|
-
currentMode,
|
|
790
|
-
outsideHandlesCanOpenDoor,
|
|
791
|
-
insideHandlesCanOpenDoor,
|
|
792
|
-
doorStatus,
|
|
793
|
-
boltStatus,
|
|
794
|
-
latchStatus,
|
|
795
|
-
lockTimeout,
|
|
796
|
-
targetMode,
|
|
797
|
-
duration,
|
|
798
|
-
});
|
|
799
|
-
}
|
|
800
|
-
persistValues(ctx) {
|
|
801
|
-
if (!super.persistValues(ctx))
|
|
802
|
-
return false;
|
|
803
|
-
// Only store the door/bolt/latch status if the lock supports it
|
|
804
|
-
const supportsDoorStatus = !!this.getValue(ctx, DoorLockCCValues.doorSupported);
|
|
805
|
-
if (supportsDoorStatus) {
|
|
806
|
-
this.setValue(ctx, DoorLockCCValues.doorStatus, this.doorStatus);
|
|
807
|
-
}
|
|
808
|
-
const supportsBoltStatus = !!this.getValue(ctx, DoorLockCCValues.boltSupported);
|
|
809
|
-
if (supportsBoltStatus) {
|
|
810
|
-
this.setValue(ctx, DoorLockCCValues.boltStatus, this.boltStatus);
|
|
811
|
-
}
|
|
812
|
-
const supportsLatchStatus = !!this.getValue(ctx, DoorLockCCValues.latchSupported);
|
|
813
|
-
if (supportsLatchStatus) {
|
|
814
|
-
this.setValue(ctx, DoorLockCCValues.latchStatus, this.latchStatus);
|
|
770
|
+
constructor(options) {
|
|
771
|
+
super(options);
|
|
772
|
+
if (options.mode === DoorLockMode.Unknown) {
|
|
773
|
+
throw new ZWaveError(`Unknown is not a valid door lock target state!`, ZWaveErrorCodes.Argument_Invalid);
|
|
774
|
+
}
|
|
775
|
+
this.mode = options.mode;
|
|
815
776
|
}
|
|
816
|
-
|
|
817
|
-
|
|
818
|
-
|
|
819
|
-
|
|
820
|
-
|
|
821
|
-
|
|
822
|
-
insideHandlesCanOpenDoor;
|
|
823
|
-
latchStatus;
|
|
824
|
-
boltStatus;
|
|
825
|
-
doorStatus;
|
|
826
|
-
lockTimeout; // in seconds
|
|
827
|
-
toLogEntry(ctx) {
|
|
828
|
-
const message = {
|
|
829
|
-
"current mode": getEnumMemberName(DoorLockMode, this.currentMode),
|
|
830
|
-
"active outside handles": this.outsideHandlesCanOpenDoor.join(", "),
|
|
831
|
-
"active inside handles": this.insideHandlesCanOpenDoor.join(", "),
|
|
832
|
-
};
|
|
833
|
-
if (this.latchStatus != undefined) {
|
|
834
|
-
message["latch status"] = this.latchStatus;
|
|
777
|
+
static from(_raw, _ctx) {
|
|
778
|
+
// TODO: Deserialize payload
|
|
779
|
+
throw new ZWaveError(`${this.name}: deserialization not implemented`, ZWaveErrorCodes.Deserialization_NotImplemented);
|
|
780
|
+
// return new DoorLockCCOperationSet({
|
|
781
|
+
// nodeId: ctx.sourceNodeId,
|
|
782
|
+
// });
|
|
835
783
|
}
|
|
836
|
-
|
|
837
|
-
|
|
784
|
+
mode;
|
|
785
|
+
serialize(ctx) {
|
|
786
|
+
this.payload = Bytes.from([this.mode]);
|
|
787
|
+
return super.serialize(ctx);
|
|
838
788
|
}
|
|
839
|
-
|
|
840
|
-
|
|
789
|
+
toLogEntry(ctx) {
|
|
790
|
+
return {
|
|
791
|
+
...super.toLogEntry(ctx),
|
|
792
|
+
message: {
|
|
793
|
+
"target mode": getEnumMemberName(DoorLockMode, this.mode),
|
|
794
|
+
},
|
|
795
|
+
};
|
|
841
796
|
}
|
|
842
|
-
|
|
843
|
-
|
|
797
|
+
};
|
|
798
|
+
return DoorLockCCOperationSet = _classThis;
|
|
799
|
+
})();
|
|
800
|
+
export { DoorLockCCOperationSet };
|
|
801
|
+
let DoorLockCCOperationReport = (() => {
|
|
802
|
+
let _classDecorators = [CCCommand(DoorLockCommand.OperationReport), ccValueProperty("currentMode", DoorLockCCValues.currentMode), ccValueProperty("targetMode", DoorLockCCValues.targetMode), ccValueProperty("duration", DoorLockCCValues.duration), ccValueProperty("outsideHandlesCanOpenDoor", DoorLockCCValues.outsideHandlesCanOpenDoor), ccValueProperty("insideHandlesCanOpenDoor", DoorLockCCValues.insideHandlesCanOpenDoor), ccValueProperty("lockTimeout", DoorLockCCValues.lockTimeout)];
|
|
803
|
+
let _classDescriptor;
|
|
804
|
+
let _classExtraInitializers = [];
|
|
805
|
+
let _classThis;
|
|
806
|
+
let _classSuper = DoorLockCC;
|
|
807
|
+
var DoorLockCCOperationReport = class extends _classSuper {
|
|
808
|
+
static { _classThis = this; }
|
|
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
|
+
DoorLockCCOperationReport = _classThis = _classDescriptor.value;
|
|
813
|
+
if (_metadata) Object.defineProperty(_classThis, Symbol.metadata, { enumerable: true, configurable: true, writable: true, value: _metadata });
|
|
814
|
+
__runInitializers(_classThis, _classExtraInitializers);
|
|
844
815
|
}
|
|
845
|
-
|
|
846
|
-
|
|
816
|
+
constructor(options) {
|
|
817
|
+
super(options);
|
|
818
|
+
// TODO: Check implementation:
|
|
819
|
+
this.currentMode = options.currentMode;
|
|
820
|
+
this.outsideHandlesCanOpenDoor = options.outsideHandlesCanOpenDoor;
|
|
821
|
+
this.insideHandlesCanOpenDoor = options.insideHandlesCanOpenDoor;
|
|
822
|
+
this.doorStatus = options.doorStatus;
|
|
823
|
+
this.boltStatus = options.boltStatus;
|
|
824
|
+
this.latchStatus = options.latchStatus;
|
|
825
|
+
this.lockTimeout = options.lockTimeout;
|
|
826
|
+
this.targetMode = options.targetMode;
|
|
827
|
+
this.duration = options.duration;
|
|
847
828
|
}
|
|
848
|
-
|
|
849
|
-
|
|
829
|
+
static from(raw, ctx) {
|
|
830
|
+
validatePayload(raw.payload.length >= 5);
|
|
831
|
+
const currentMode = raw.payload[0];
|
|
832
|
+
const outsideHandlesCanOpenDoor = [
|
|
833
|
+
!!(raw.payload[1] & 0b0001_0000),
|
|
834
|
+
!!(raw.payload[1] & 0b0010_0000),
|
|
835
|
+
!!(raw.payload[1] & 0b0100_0000),
|
|
836
|
+
!!(raw.payload[1] & 0b1000_0000),
|
|
837
|
+
];
|
|
838
|
+
const insideHandlesCanOpenDoor = [
|
|
839
|
+
!!(raw.payload[1] & 0b0001),
|
|
840
|
+
!!(raw.payload[1] & 0b0010),
|
|
841
|
+
!!(raw.payload[1] & 0b0100),
|
|
842
|
+
!!(raw.payload[1] & 0b1000),
|
|
843
|
+
];
|
|
844
|
+
const doorStatus = !!(raw.payload[2] & 0b1)
|
|
845
|
+
? "closed"
|
|
846
|
+
: "open";
|
|
847
|
+
const boltStatus = !!(raw.payload[2] & 0b10) ? "unlocked" : "locked";
|
|
848
|
+
const latchStatus = !!(raw.payload[2] & 0b100)
|
|
849
|
+
? "closed"
|
|
850
|
+
: "open";
|
|
851
|
+
// Ignore invalid timeout values
|
|
852
|
+
const lockTimeoutMinutes = raw.payload[3];
|
|
853
|
+
const lockTimeoutSeconds = raw.payload[4];
|
|
854
|
+
let lockTimeout;
|
|
855
|
+
if (lockTimeoutMinutes <= 253 && lockTimeoutSeconds <= 59) {
|
|
856
|
+
lockTimeout = lockTimeoutSeconds + lockTimeoutMinutes * 60;
|
|
857
|
+
}
|
|
858
|
+
let targetMode;
|
|
859
|
+
let duration;
|
|
860
|
+
if (raw.payload.length >= 7) {
|
|
861
|
+
targetMode = raw.payload[5];
|
|
862
|
+
duration = Duration.parseReport(raw.payload[6]);
|
|
863
|
+
}
|
|
864
|
+
return new this({
|
|
865
|
+
nodeId: ctx.sourceNodeId,
|
|
866
|
+
currentMode,
|
|
867
|
+
outsideHandlesCanOpenDoor,
|
|
868
|
+
insideHandlesCanOpenDoor,
|
|
869
|
+
doorStatus,
|
|
870
|
+
boltStatus,
|
|
871
|
+
latchStatus,
|
|
872
|
+
lockTimeout,
|
|
873
|
+
targetMode,
|
|
874
|
+
duration,
|
|
875
|
+
});
|
|
850
876
|
}
|
|
851
|
-
|
|
852
|
-
|
|
853
|
-
|
|
854
|
-
|
|
855
|
-
|
|
856
|
-
|
|
857
|
-
|
|
858
|
-
|
|
859
|
-
|
|
860
|
-
|
|
861
|
-
|
|
862
|
-
|
|
863
|
-
|
|
864
|
-
|
|
865
|
-
|
|
866
|
-
__decorate([
|
|
867
|
-
ccValue(DoorLockCCValues.outsideHandlesCanOpenDoor)
|
|
868
|
-
], DoorLockCCOperationReport.prototype, "outsideHandlesCanOpenDoor", void 0);
|
|
869
|
-
__decorate([
|
|
870
|
-
ccValue(DoorLockCCValues.insideHandlesCanOpenDoor)
|
|
871
|
-
], DoorLockCCOperationReport.prototype, "insideHandlesCanOpenDoor", void 0);
|
|
872
|
-
__decorate([
|
|
873
|
-
ccValue(DoorLockCCValues.lockTimeout)
|
|
874
|
-
], DoorLockCCOperationReport.prototype, "lockTimeout", void 0);
|
|
875
|
-
DoorLockCCOperationReport = DoorLockCCOperationReport_1 = __decorate([
|
|
876
|
-
CCCommand(DoorLockCommand.OperationReport)
|
|
877
|
-
], DoorLockCCOperationReport);
|
|
878
|
-
export { DoorLockCCOperationReport };
|
|
879
|
-
let DoorLockCCOperationGet = class DoorLockCCOperationGet extends DoorLockCC {
|
|
880
|
-
};
|
|
881
|
-
DoorLockCCOperationGet = __decorate([
|
|
882
|
-
CCCommand(DoorLockCommand.OperationGet),
|
|
883
|
-
expectedCCResponse(DoorLockCCOperationReport)
|
|
884
|
-
], DoorLockCCOperationGet);
|
|
885
|
-
export { DoorLockCCOperationGet };
|
|
886
|
-
let DoorLockCCConfigurationReport = DoorLockCCConfigurationReport_1 = class DoorLockCCConfigurationReport extends DoorLockCC {
|
|
887
|
-
constructor(options) {
|
|
888
|
-
super(options);
|
|
889
|
-
// TODO: Check implementation:
|
|
890
|
-
this.operationType = options.operationType;
|
|
891
|
-
this.outsideHandlesCanOpenDoorConfiguration =
|
|
892
|
-
options.outsideHandlesCanOpenDoorConfiguration;
|
|
893
|
-
this.insideHandlesCanOpenDoorConfiguration =
|
|
894
|
-
options.insideHandlesCanOpenDoorConfiguration;
|
|
895
|
-
this.lockTimeoutConfiguration = options.lockTimeoutConfiguration;
|
|
896
|
-
this.autoRelockTime = options.autoRelockTime;
|
|
897
|
-
this.holdAndReleaseTime = options.holdAndReleaseTime;
|
|
898
|
-
this.twistAssist = options.twistAssist;
|
|
899
|
-
this.blockToBlock = options.blockToBlock;
|
|
900
|
-
}
|
|
901
|
-
static from(raw, ctx) {
|
|
902
|
-
validatePayload(raw.payload.length >= 4);
|
|
903
|
-
const operationType = raw.payload[0];
|
|
904
|
-
const outsideHandlesCanOpenDoorConfiguration = [
|
|
905
|
-
!!(raw.payload[1] & 0b0001_0000),
|
|
906
|
-
!!(raw.payload[1] & 0b0010_0000),
|
|
907
|
-
!!(raw.payload[1] & 0b0100_0000),
|
|
908
|
-
!!(raw.payload[1] & 0b1000_0000),
|
|
909
|
-
];
|
|
910
|
-
const insideHandlesCanOpenDoorConfiguration = [
|
|
911
|
-
!!(raw.payload[1] & 0b0001),
|
|
912
|
-
!!(raw.payload[1] & 0b0010),
|
|
913
|
-
!!(raw.payload[1] & 0b0100),
|
|
914
|
-
!!(raw.payload[1] & 0b1000),
|
|
915
|
-
];
|
|
916
|
-
let lockTimeoutConfiguration;
|
|
917
|
-
if (operationType === DoorLockOperationType.Timed) {
|
|
918
|
-
const lockTimeoutMinutes = raw.payload[2];
|
|
919
|
-
const lockTimeoutSeconds = raw.payload[3];
|
|
920
|
-
if (lockTimeoutMinutes <= 0xfd && lockTimeoutSeconds <= 59) {
|
|
921
|
-
lockTimeoutConfiguration = lockTimeoutSeconds
|
|
922
|
-
+ lockTimeoutMinutes * 60;
|
|
877
|
+
persistValues(ctx) {
|
|
878
|
+
if (!super.persistValues(ctx))
|
|
879
|
+
return false;
|
|
880
|
+
// Only store the door/bolt/latch status if the lock supports it
|
|
881
|
+
const supportsDoorStatus = !!this.getValue(ctx, DoorLockCCValues.doorSupported);
|
|
882
|
+
if (supportsDoorStatus) {
|
|
883
|
+
this.setValue(ctx, DoorLockCCValues.doorStatus, this.doorStatus);
|
|
884
|
+
}
|
|
885
|
+
const supportsBoltStatus = !!this.getValue(ctx, DoorLockCCValues.boltSupported);
|
|
886
|
+
if (supportsBoltStatus) {
|
|
887
|
+
this.setValue(ctx, DoorLockCCValues.boltStatus, this.boltStatus);
|
|
888
|
+
}
|
|
889
|
+
const supportsLatchStatus = !!this.getValue(ctx, DoorLockCCValues.latchSupported);
|
|
890
|
+
if (supportsLatchStatus) {
|
|
891
|
+
this.setValue(ctx, DoorLockCCValues.latchStatus, this.latchStatus);
|
|
923
892
|
}
|
|
893
|
+
return true;
|
|
924
894
|
}
|
|
925
|
-
|
|
926
|
-
|
|
927
|
-
|
|
928
|
-
|
|
929
|
-
|
|
930
|
-
|
|
931
|
-
|
|
932
|
-
|
|
933
|
-
|
|
934
|
-
|
|
895
|
+
currentMode;
|
|
896
|
+
targetMode;
|
|
897
|
+
duration;
|
|
898
|
+
outsideHandlesCanOpenDoor;
|
|
899
|
+
insideHandlesCanOpenDoor;
|
|
900
|
+
latchStatus;
|
|
901
|
+
boltStatus;
|
|
902
|
+
doorStatus;
|
|
903
|
+
lockTimeout; // in seconds
|
|
904
|
+
toLogEntry(ctx) {
|
|
905
|
+
const message = {
|
|
906
|
+
"current mode": getEnumMemberName(DoorLockMode, this.currentMode),
|
|
907
|
+
"active outside handles": this.outsideHandlesCanOpenDoor.join(", "),
|
|
908
|
+
"active inside handles": this.insideHandlesCanOpenDoor.join(", "),
|
|
909
|
+
};
|
|
910
|
+
if (this.latchStatus != undefined) {
|
|
911
|
+
message["latch status"] = this.latchStatus;
|
|
912
|
+
}
|
|
913
|
+
if (this.boltStatus != undefined) {
|
|
914
|
+
message["bolt status"] = this.boltStatus;
|
|
915
|
+
}
|
|
916
|
+
if (this.doorStatus != undefined) {
|
|
917
|
+
message["door status"] = this.doorStatus;
|
|
918
|
+
}
|
|
919
|
+
if (this.targetMode != undefined) {
|
|
920
|
+
message["target mode"] = getEnumMemberName(DoorLockMode, this.targetMode);
|
|
921
|
+
}
|
|
922
|
+
if (this.duration != undefined) {
|
|
923
|
+
message["remaining duration"] = this.duration.toString();
|
|
924
|
+
}
|
|
925
|
+
if (this.lockTimeout != undefined) {
|
|
926
|
+
message["lock timeout"] = `${this.lockTimeout} seconds`;
|
|
927
|
+
}
|
|
928
|
+
return {
|
|
929
|
+
...super.toLogEntry(ctx),
|
|
930
|
+
message,
|
|
931
|
+
};
|
|
935
932
|
}
|
|
936
|
-
|
|
937
|
-
|
|
938
|
-
|
|
939
|
-
|
|
940
|
-
|
|
941
|
-
|
|
942
|
-
|
|
943
|
-
|
|
944
|
-
|
|
945
|
-
|
|
946
|
-
|
|
947
|
-
|
|
948
|
-
|
|
949
|
-
|
|
950
|
-
|
|
951
|
-
|
|
952
|
-
|
|
953
|
-
|
|
954
|
-
autoRelockTime;
|
|
955
|
-
holdAndReleaseTime;
|
|
956
|
-
twistAssist;
|
|
957
|
-
blockToBlock;
|
|
958
|
-
persistValues(ctx) {
|
|
959
|
-
if (!super.persistValues(ctx))
|
|
960
|
-
return false;
|
|
961
|
-
// Only store the autoRelockTime etc. params if the lock supports it
|
|
962
|
-
const supportsAutoRelock = !!this.getValue(ctx, DoorLockCCValues.autoRelockSupported);
|
|
963
|
-
if (supportsAutoRelock) {
|
|
964
|
-
this.setValue(ctx, DoorLockCCValues.autoRelockTime, this.autoRelockTime);
|
|
933
|
+
};
|
|
934
|
+
return DoorLockCCOperationReport = _classThis;
|
|
935
|
+
})();
|
|
936
|
+
export { DoorLockCCOperationReport };
|
|
937
|
+
let DoorLockCCOperationGet = (() => {
|
|
938
|
+
let _classDecorators = [CCCommand(DoorLockCommand.OperationGet), expectedCCResponse(DoorLockCCOperationReport)];
|
|
939
|
+
let _classDescriptor;
|
|
940
|
+
let _classExtraInitializers = [];
|
|
941
|
+
let _classThis;
|
|
942
|
+
let _classSuper = DoorLockCC;
|
|
943
|
+
var DoorLockCCOperationGet = class extends _classSuper {
|
|
944
|
+
static { _classThis = this; }
|
|
945
|
+
static {
|
|
946
|
+
const _metadata = typeof Symbol === "function" && Symbol.metadata ? Object.create(_classSuper[Symbol.metadata] ?? null) : void 0;
|
|
947
|
+
__esDecorate(null, _classDescriptor = { value: _classThis }, _classDecorators, { kind: "class", name: _classThis.name, metadata: _metadata }, null, _classExtraInitializers);
|
|
948
|
+
DoorLockCCOperationGet = _classThis = _classDescriptor.value;
|
|
949
|
+
if (_metadata) Object.defineProperty(_classThis, Symbol.metadata, { enumerable: true, configurable: true, writable: true, value: _metadata });
|
|
950
|
+
__runInitializers(_classThis, _classExtraInitializers);
|
|
965
951
|
}
|
|
966
|
-
|
|
967
|
-
|
|
968
|
-
|
|
952
|
+
};
|
|
953
|
+
return DoorLockCCOperationGet = _classThis;
|
|
954
|
+
})();
|
|
955
|
+
export { DoorLockCCOperationGet };
|
|
956
|
+
let DoorLockCCConfigurationReport = (() => {
|
|
957
|
+
let _classDecorators = [CCCommand(DoorLockCommand.ConfigurationReport), ccValueProperty("operationType", DoorLockCCValues.operationType), ccValueProperty("outsideHandlesCanOpenDoorConfiguration", DoorLockCCValues.outsideHandlesCanOpenDoorConfiguration), ccValueProperty("insideHandlesCanOpenDoorConfiguration", DoorLockCCValues.insideHandlesCanOpenDoorConfiguration), ccValueProperty("lockTimeoutConfiguration", DoorLockCCValues.lockTimeoutConfiguration)];
|
|
958
|
+
let _classDescriptor;
|
|
959
|
+
let _classExtraInitializers = [];
|
|
960
|
+
let _classThis;
|
|
961
|
+
let _classSuper = DoorLockCC;
|
|
962
|
+
var DoorLockCCConfigurationReport = class extends _classSuper {
|
|
963
|
+
static { _classThis = this; }
|
|
964
|
+
static {
|
|
965
|
+
const _metadata = typeof Symbol === "function" && Symbol.metadata ? Object.create(_classSuper[Symbol.metadata] ?? null) : void 0;
|
|
966
|
+
__esDecorate(null, _classDescriptor = { value: _classThis }, _classDecorators, { kind: "class", name: _classThis.name, metadata: _metadata }, null, _classExtraInitializers);
|
|
967
|
+
DoorLockCCConfigurationReport = _classThis = _classDescriptor.value;
|
|
968
|
+
if (_metadata) Object.defineProperty(_classThis, Symbol.metadata, { enumerable: true, configurable: true, writable: true, value: _metadata });
|
|
969
|
+
__runInitializers(_classThis, _classExtraInitializers);
|
|
969
970
|
}
|
|
970
|
-
|
|
971
|
-
|
|
972
|
-
|
|
971
|
+
constructor(options) {
|
|
972
|
+
super(options);
|
|
973
|
+
// TODO: Check implementation:
|
|
974
|
+
this.operationType = options.operationType;
|
|
975
|
+
this.outsideHandlesCanOpenDoorConfiguration =
|
|
976
|
+
options.outsideHandlesCanOpenDoorConfiguration;
|
|
977
|
+
this.insideHandlesCanOpenDoorConfiguration =
|
|
978
|
+
options.insideHandlesCanOpenDoorConfiguration;
|
|
979
|
+
this.lockTimeoutConfiguration = options.lockTimeoutConfiguration;
|
|
980
|
+
this.autoRelockTime = options.autoRelockTime;
|
|
981
|
+
this.holdAndReleaseTime = options.holdAndReleaseTime;
|
|
982
|
+
this.twistAssist = options.twistAssist;
|
|
983
|
+
this.blockToBlock = options.blockToBlock;
|
|
973
984
|
}
|
|
974
|
-
|
|
975
|
-
|
|
976
|
-
|
|
985
|
+
static from(raw, ctx) {
|
|
986
|
+
validatePayload(raw.payload.length >= 4);
|
|
987
|
+
const operationType = raw.payload[0];
|
|
988
|
+
const outsideHandlesCanOpenDoorConfiguration = [
|
|
989
|
+
!!(raw.payload[1] & 0b0001_0000),
|
|
990
|
+
!!(raw.payload[1] & 0b0010_0000),
|
|
991
|
+
!!(raw.payload[1] & 0b0100_0000),
|
|
992
|
+
!!(raw.payload[1] & 0b1000_0000),
|
|
993
|
+
];
|
|
994
|
+
const insideHandlesCanOpenDoorConfiguration = [
|
|
995
|
+
!!(raw.payload[1] & 0b0001),
|
|
996
|
+
!!(raw.payload[1] & 0b0010),
|
|
997
|
+
!!(raw.payload[1] & 0b0100),
|
|
998
|
+
!!(raw.payload[1] & 0b1000),
|
|
999
|
+
];
|
|
1000
|
+
let lockTimeoutConfiguration;
|
|
1001
|
+
if (operationType === DoorLockOperationType.Timed) {
|
|
1002
|
+
const lockTimeoutMinutes = raw.payload[2];
|
|
1003
|
+
const lockTimeoutSeconds = raw.payload[3];
|
|
1004
|
+
if (lockTimeoutMinutes <= 0xfd && lockTimeoutSeconds <= 59) {
|
|
1005
|
+
lockTimeoutConfiguration = lockTimeoutSeconds
|
|
1006
|
+
+ lockTimeoutMinutes * 60;
|
|
1007
|
+
}
|
|
1008
|
+
}
|
|
1009
|
+
let autoRelockTime;
|
|
1010
|
+
let holdAndReleaseTime;
|
|
1011
|
+
let twistAssist;
|
|
1012
|
+
let blockToBlock;
|
|
1013
|
+
if (raw.payload.length >= 5) {
|
|
1014
|
+
autoRelockTime = raw.payload.readUInt16BE(4);
|
|
1015
|
+
holdAndReleaseTime = raw.payload.readUInt16BE(6);
|
|
1016
|
+
const flags = raw.payload[8];
|
|
1017
|
+
twistAssist = !!(flags & 0b1);
|
|
1018
|
+
blockToBlock = !!(flags & 0b10);
|
|
1019
|
+
}
|
|
1020
|
+
return new this({
|
|
1021
|
+
nodeId: ctx.sourceNodeId,
|
|
1022
|
+
operationType,
|
|
1023
|
+
outsideHandlesCanOpenDoorConfiguration,
|
|
1024
|
+
insideHandlesCanOpenDoorConfiguration,
|
|
1025
|
+
lockTimeoutConfiguration,
|
|
1026
|
+
autoRelockTime,
|
|
1027
|
+
holdAndReleaseTime,
|
|
1028
|
+
twistAssist,
|
|
1029
|
+
blockToBlock,
|
|
1030
|
+
});
|
|
977
1031
|
}
|
|
978
|
-
|
|
979
|
-
|
|
980
|
-
|
|
981
|
-
|
|
982
|
-
|
|
983
|
-
|
|
984
|
-
|
|
985
|
-
|
|
986
|
-
|
|
987
|
-
|
|
988
|
-
|
|
989
|
-
|
|
1032
|
+
operationType;
|
|
1033
|
+
outsideHandlesCanOpenDoorConfiguration;
|
|
1034
|
+
insideHandlesCanOpenDoorConfiguration;
|
|
1035
|
+
lockTimeoutConfiguration;
|
|
1036
|
+
// These are not always supported and have to be persisted manually
|
|
1037
|
+
// to avoid unsupported values being exposed to the user
|
|
1038
|
+
autoRelockTime;
|
|
1039
|
+
holdAndReleaseTime;
|
|
1040
|
+
twistAssist;
|
|
1041
|
+
blockToBlock;
|
|
1042
|
+
persistValues(ctx) {
|
|
1043
|
+
if (!super.persistValues(ctx))
|
|
1044
|
+
return false;
|
|
1045
|
+
// Only store the autoRelockTime etc. params if the lock supports it
|
|
1046
|
+
const supportsAutoRelock = !!this.getValue(ctx, DoorLockCCValues.autoRelockSupported);
|
|
1047
|
+
if (supportsAutoRelock) {
|
|
1048
|
+
this.setValue(ctx, DoorLockCCValues.autoRelockTime, this.autoRelockTime);
|
|
1049
|
+
}
|
|
1050
|
+
const supportsHoldAndRelease = !!this.getValue(ctx, DoorLockCCValues.holdAndReleaseSupported);
|
|
1051
|
+
if (supportsHoldAndRelease) {
|
|
1052
|
+
this.setValue(ctx, DoorLockCCValues.holdAndReleaseTime, this.holdAndReleaseTime);
|
|
1053
|
+
}
|
|
1054
|
+
const supportsTwistAssist = !!this.getValue(ctx, DoorLockCCValues.twistAssistSupported);
|
|
1055
|
+
if (supportsTwistAssist) {
|
|
1056
|
+
this.setValue(ctx, DoorLockCCValues.twistAssist, this.twistAssist);
|
|
1057
|
+
}
|
|
1058
|
+
const supportsBlockToBlock = !!this.getValue(ctx, DoorLockCCValues.blockToBlockSupported);
|
|
1059
|
+
if (supportsBlockToBlock) {
|
|
1060
|
+
this.setValue(ctx, DoorLockCCValues.blockToBlock, this.blockToBlock);
|
|
1061
|
+
}
|
|
1062
|
+
return true;
|
|
990
1063
|
}
|
|
991
|
-
|
|
992
|
-
message
|
|
1064
|
+
toLogEntry(ctx) {
|
|
1065
|
+
const message = {
|
|
1066
|
+
"operation type": getEnumMemberName(DoorLockOperationType, this.operationType),
|
|
1067
|
+
"outside handle configuration": this
|
|
1068
|
+
.outsideHandlesCanOpenDoorConfiguration.join(", "),
|
|
1069
|
+
"inside handle configuration": this
|
|
1070
|
+
.insideHandlesCanOpenDoorConfiguration.join(", "),
|
|
1071
|
+
};
|
|
1072
|
+
if (this.lockTimeoutConfiguration != undefined) {
|
|
1073
|
+
message["timed mode duration"] = `${this.lockTimeoutConfiguration} seconds`;
|
|
1074
|
+
}
|
|
1075
|
+
if (this.autoRelockTime != undefined) {
|
|
1076
|
+
message["auto-relock time"] = `${this.autoRelockTime} seconds`;
|
|
1077
|
+
}
|
|
1078
|
+
if (this.holdAndReleaseTime != undefined) {
|
|
1079
|
+
message["hold-and-release time"] = `${this.holdAndReleaseTime} seconds`;
|
|
1080
|
+
}
|
|
1081
|
+
if (this.twistAssist != undefined) {
|
|
1082
|
+
message["twist assist enabled"] = this.twistAssist;
|
|
1083
|
+
}
|
|
1084
|
+
if (this.blockToBlock != undefined) {
|
|
1085
|
+
message["block-to-block enabled"] = this.blockToBlock;
|
|
1086
|
+
}
|
|
1087
|
+
return {
|
|
1088
|
+
...super.toLogEntry(ctx),
|
|
1089
|
+
message,
|
|
1090
|
+
};
|
|
993
1091
|
}
|
|
994
|
-
|
|
995
|
-
|
|
1092
|
+
};
|
|
1093
|
+
return DoorLockCCConfigurationReport = _classThis;
|
|
1094
|
+
})();
|
|
1095
|
+
export { DoorLockCCConfigurationReport };
|
|
1096
|
+
let DoorLockCCConfigurationGet = (() => {
|
|
1097
|
+
let _classDecorators = [CCCommand(DoorLockCommand.ConfigurationGet), expectedCCResponse(DoorLockCCConfigurationReport)];
|
|
1098
|
+
let _classDescriptor;
|
|
1099
|
+
let _classExtraInitializers = [];
|
|
1100
|
+
let _classThis;
|
|
1101
|
+
let _classSuper = DoorLockCC;
|
|
1102
|
+
var DoorLockCCConfigurationGet = class extends _classSuper {
|
|
1103
|
+
static { _classThis = this; }
|
|
1104
|
+
static {
|
|
1105
|
+
const _metadata = typeof Symbol === "function" && Symbol.metadata ? Object.create(_classSuper[Symbol.metadata] ?? null) : void 0;
|
|
1106
|
+
__esDecorate(null, _classDescriptor = { value: _classThis }, _classDecorators, { kind: "class", name: _classThis.name, metadata: _metadata }, null, _classExtraInitializers);
|
|
1107
|
+
DoorLockCCConfigurationGet = _classThis = _classDescriptor.value;
|
|
1108
|
+
if (_metadata) Object.defineProperty(_classThis, Symbol.metadata, { enumerable: true, configurable: true, writable: true, value: _metadata });
|
|
1109
|
+
__runInitializers(_classThis, _classExtraInitializers);
|
|
996
1110
|
}
|
|
997
|
-
|
|
998
|
-
|
|
1111
|
+
};
|
|
1112
|
+
return DoorLockCCConfigurationGet = _classThis;
|
|
1113
|
+
})();
|
|
1114
|
+
export { DoorLockCCConfigurationGet };
|
|
1115
|
+
let DoorLockCCConfigurationSet = (() => {
|
|
1116
|
+
let _classDecorators = [CCCommand(DoorLockCommand.ConfigurationSet), useSupervision()];
|
|
1117
|
+
let _classDescriptor;
|
|
1118
|
+
let _classExtraInitializers = [];
|
|
1119
|
+
let _classThis;
|
|
1120
|
+
let _classSuper = DoorLockCC;
|
|
1121
|
+
var DoorLockCCConfigurationSet = class extends _classSuper {
|
|
1122
|
+
static { _classThis = this; }
|
|
1123
|
+
static {
|
|
1124
|
+
const _metadata = typeof Symbol === "function" && Symbol.metadata ? Object.create(_classSuper[Symbol.metadata] ?? null) : void 0;
|
|
1125
|
+
__esDecorate(null, _classDescriptor = { value: _classThis }, _classDecorators, { kind: "class", name: _classThis.name, metadata: _metadata }, null, _classExtraInitializers);
|
|
1126
|
+
DoorLockCCConfigurationSet = _classThis = _classDescriptor.value;
|
|
1127
|
+
if (_metadata) Object.defineProperty(_classThis, Symbol.metadata, { enumerable: true, configurable: true, writable: true, value: _metadata });
|
|
1128
|
+
__runInitializers(_classThis, _classExtraInitializers);
|
|
999
1129
|
}
|
|
1000
|
-
|
|
1001
|
-
|
|
1130
|
+
constructor(options) {
|
|
1131
|
+
super(options);
|
|
1132
|
+
this.operationType = options.operationType;
|
|
1133
|
+
this.outsideHandlesCanOpenDoorConfiguration =
|
|
1134
|
+
options.outsideHandlesCanOpenDoorConfiguration;
|
|
1135
|
+
this.insideHandlesCanOpenDoorConfiguration =
|
|
1136
|
+
options.insideHandlesCanOpenDoorConfiguration;
|
|
1137
|
+
this.lockTimeoutConfiguration = options.lockTimeoutConfiguration;
|
|
1138
|
+
this.autoRelockTime = options.autoRelockTime;
|
|
1139
|
+
this.holdAndReleaseTime = options.holdAndReleaseTime;
|
|
1140
|
+
this.twistAssist = options.twistAssist;
|
|
1141
|
+
this.blockToBlock = options.blockToBlock;
|
|
1002
1142
|
}
|
|
1003
|
-
|
|
1004
|
-
|
|
1005
|
-
|
|
1006
|
-
|
|
1007
|
-
|
|
1008
|
-
};
|
|
1009
|
-
__decorate([
|
|
1010
|
-
ccValue(DoorLockCCValues.operationType)
|
|
1011
|
-
], DoorLockCCConfigurationReport.prototype, "operationType", void 0);
|
|
1012
|
-
__decorate([
|
|
1013
|
-
ccValue(DoorLockCCValues.outsideHandlesCanOpenDoorConfiguration)
|
|
1014
|
-
], DoorLockCCConfigurationReport.prototype, "outsideHandlesCanOpenDoorConfiguration", void 0);
|
|
1015
|
-
__decorate([
|
|
1016
|
-
ccValue(DoorLockCCValues.insideHandlesCanOpenDoorConfiguration)
|
|
1017
|
-
], DoorLockCCConfigurationReport.prototype, "insideHandlesCanOpenDoorConfiguration", void 0);
|
|
1018
|
-
__decorate([
|
|
1019
|
-
ccValue(DoorLockCCValues.lockTimeoutConfiguration)
|
|
1020
|
-
], DoorLockCCConfigurationReport.prototype, "lockTimeoutConfiguration", void 0);
|
|
1021
|
-
DoorLockCCConfigurationReport = DoorLockCCConfigurationReport_1 = __decorate([
|
|
1022
|
-
CCCommand(DoorLockCommand.ConfigurationReport)
|
|
1023
|
-
], DoorLockCCConfigurationReport);
|
|
1024
|
-
export { DoorLockCCConfigurationReport };
|
|
1025
|
-
let DoorLockCCConfigurationGet = class DoorLockCCConfigurationGet extends DoorLockCC {
|
|
1026
|
-
};
|
|
1027
|
-
DoorLockCCConfigurationGet = __decorate([
|
|
1028
|
-
CCCommand(DoorLockCommand.ConfigurationGet),
|
|
1029
|
-
expectedCCResponse(DoorLockCCConfigurationReport)
|
|
1030
|
-
], DoorLockCCConfigurationGet);
|
|
1031
|
-
export { DoorLockCCConfigurationGet };
|
|
1032
|
-
let DoorLockCCConfigurationSet = class DoorLockCCConfigurationSet extends DoorLockCC {
|
|
1033
|
-
constructor(options) {
|
|
1034
|
-
super(options);
|
|
1035
|
-
this.operationType = options.operationType;
|
|
1036
|
-
this.outsideHandlesCanOpenDoorConfiguration =
|
|
1037
|
-
options.outsideHandlesCanOpenDoorConfiguration;
|
|
1038
|
-
this.insideHandlesCanOpenDoorConfiguration =
|
|
1039
|
-
options.insideHandlesCanOpenDoorConfiguration;
|
|
1040
|
-
this.lockTimeoutConfiguration = options.lockTimeoutConfiguration;
|
|
1041
|
-
this.autoRelockTime = options.autoRelockTime;
|
|
1042
|
-
this.holdAndReleaseTime = options.holdAndReleaseTime;
|
|
1043
|
-
this.twistAssist = options.twistAssist;
|
|
1044
|
-
this.blockToBlock = options.blockToBlock;
|
|
1045
|
-
}
|
|
1046
|
-
static from(_raw, _ctx) {
|
|
1047
|
-
// TODO: Deserialize payload
|
|
1048
|
-
throw new ZWaveError(`${this.name}: deserialization not implemented`, ZWaveErrorCodes.Deserialization_NotImplemented);
|
|
1049
|
-
// return new DoorLockCCConfigurationSet({
|
|
1050
|
-
// nodeId: ctx.sourceNodeId,
|
|
1051
|
-
// });
|
|
1052
|
-
}
|
|
1053
|
-
operationType;
|
|
1054
|
-
outsideHandlesCanOpenDoorConfiguration;
|
|
1055
|
-
insideHandlesCanOpenDoorConfiguration;
|
|
1056
|
-
lockTimeoutConfiguration;
|
|
1057
|
-
autoRelockTime;
|
|
1058
|
-
holdAndReleaseTime;
|
|
1059
|
-
twistAssist;
|
|
1060
|
-
blockToBlock;
|
|
1061
|
-
serialize(ctx) {
|
|
1062
|
-
const insideHandles = isArray(this.insideHandlesCanOpenDoorConfiguration)
|
|
1063
|
-
? this.insideHandlesCanOpenDoorConfiguration
|
|
1064
|
-
: [];
|
|
1065
|
-
const outsideHandles = isArray(this.outsideHandlesCanOpenDoorConfiguration)
|
|
1066
|
-
? this.outsideHandlesCanOpenDoorConfiguration
|
|
1067
|
-
: [];
|
|
1068
|
-
const handles = [...insideHandles, ...outsideHandles]
|
|
1069
|
-
.map((val, i) => (val ? 1 << i : 0))
|
|
1070
|
-
.reduce((acc, cur) => acc | cur, 0);
|
|
1071
|
-
let lockTimeoutMinutes;
|
|
1072
|
-
let lockTimeoutSeconds;
|
|
1073
|
-
if (this.operationType === DoorLockOperationType.Constant) {
|
|
1074
|
-
lockTimeoutMinutes = lockTimeoutSeconds = 0xfe;
|
|
1143
|
+
static from(_raw, _ctx) {
|
|
1144
|
+
// TODO: Deserialize payload
|
|
1145
|
+
throw new ZWaveError(`${this.name}: deserialization not implemented`, ZWaveErrorCodes.Deserialization_NotImplemented);
|
|
1146
|
+
// return new DoorLockCCConfigurationSet({
|
|
1147
|
+
// nodeId: ctx.sourceNodeId,
|
|
1148
|
+
// });
|
|
1075
1149
|
}
|
|
1076
|
-
|
|
1077
|
-
|
|
1078
|
-
|
|
1150
|
+
operationType;
|
|
1151
|
+
outsideHandlesCanOpenDoorConfiguration;
|
|
1152
|
+
insideHandlesCanOpenDoorConfiguration;
|
|
1153
|
+
lockTimeoutConfiguration;
|
|
1154
|
+
autoRelockTime;
|
|
1155
|
+
holdAndReleaseTime;
|
|
1156
|
+
twistAssist;
|
|
1157
|
+
blockToBlock;
|
|
1158
|
+
serialize(ctx) {
|
|
1159
|
+
const insideHandles = isArray(this.insideHandlesCanOpenDoorConfiguration)
|
|
1160
|
+
? this.insideHandlesCanOpenDoorConfiguration
|
|
1161
|
+
: [];
|
|
1162
|
+
const outsideHandles = isArray(this.outsideHandlesCanOpenDoorConfiguration)
|
|
1163
|
+
? this.outsideHandlesCanOpenDoorConfiguration
|
|
1164
|
+
: [];
|
|
1165
|
+
const handles = [...insideHandles, ...outsideHandles]
|
|
1166
|
+
.map((val, i) => (val ? 1 << i : 0))
|
|
1167
|
+
.reduce((acc, cur) => acc | cur, 0);
|
|
1168
|
+
let lockTimeoutMinutes;
|
|
1169
|
+
let lockTimeoutSeconds;
|
|
1170
|
+
if (this.operationType === DoorLockOperationType.Constant) {
|
|
1171
|
+
lockTimeoutMinutes = lockTimeoutSeconds = 0xfe;
|
|
1172
|
+
}
|
|
1173
|
+
else {
|
|
1174
|
+
lockTimeoutMinutes = Math.floor(this.lockTimeoutConfiguration / 60);
|
|
1175
|
+
lockTimeoutSeconds = this.lockTimeoutConfiguration % 60;
|
|
1176
|
+
}
|
|
1177
|
+
const flags = (this.twistAssist ? 0b1 : 0)
|
|
1178
|
+
| (this.blockToBlock ? 0b10 : 0);
|
|
1179
|
+
this.payload = Bytes.from([
|
|
1180
|
+
this.operationType,
|
|
1181
|
+
handles,
|
|
1182
|
+
lockTimeoutMinutes,
|
|
1183
|
+
lockTimeoutSeconds,
|
|
1184
|
+
// placeholder for auto relock time
|
|
1185
|
+
0,
|
|
1186
|
+
0,
|
|
1187
|
+
// placeholder for hold and release time
|
|
1188
|
+
0,
|
|
1189
|
+
0,
|
|
1190
|
+
flags,
|
|
1191
|
+
]);
|
|
1192
|
+
this.payload.writeUInt16BE((this.autoRelockTime ?? 0) & 0xffff, 4);
|
|
1193
|
+
this.payload.writeUInt16BE((this.holdAndReleaseTime ?? 0) & 0xffff, 6);
|
|
1194
|
+
return super.serialize(ctx);
|
|
1079
1195
|
}
|
|
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
|
-
if (this.lockTimeoutConfiguration != undefined) {
|
|
1112
|
-
message["timed mode duration"] = `${this.lockTimeoutConfiguration} seconds`;
|
|
1196
|
+
toLogEntry(ctx) {
|
|
1197
|
+
const insideHandles = isArray(this.insideHandlesCanOpenDoorConfiguration)
|
|
1198
|
+
? this.insideHandlesCanOpenDoorConfiguration
|
|
1199
|
+
: [];
|
|
1200
|
+
const outsideHandles = isArray(this.outsideHandlesCanOpenDoorConfiguration)
|
|
1201
|
+
? this.outsideHandlesCanOpenDoorConfiguration
|
|
1202
|
+
: [];
|
|
1203
|
+
const message = {
|
|
1204
|
+
"operation type": getEnumMemberName(DoorLockOperationType, this.operationType),
|
|
1205
|
+
"outside handle configuration": outsideHandles.join(", "),
|
|
1206
|
+
"inside handle configuration": insideHandles.join(", "),
|
|
1207
|
+
};
|
|
1208
|
+
if (this.lockTimeoutConfiguration != undefined) {
|
|
1209
|
+
message["timed mode duration"] = `${this.lockTimeoutConfiguration} seconds`;
|
|
1210
|
+
}
|
|
1211
|
+
if (this.autoRelockTime != undefined) {
|
|
1212
|
+
message["auto-relock time"] = `${this.autoRelockTime} seconds`;
|
|
1213
|
+
}
|
|
1214
|
+
if (this.holdAndReleaseTime != undefined) {
|
|
1215
|
+
message["hold-and-release time"] = `${this.holdAndReleaseTime} seconds`;
|
|
1216
|
+
}
|
|
1217
|
+
if (this.twistAssist != undefined) {
|
|
1218
|
+
message["enable twist assist"] = this.twistAssist;
|
|
1219
|
+
}
|
|
1220
|
+
if (this.blockToBlock != undefined) {
|
|
1221
|
+
message["enable block-to-block"] = this.blockToBlock;
|
|
1222
|
+
}
|
|
1223
|
+
return {
|
|
1224
|
+
...super.toLogEntry(ctx),
|
|
1225
|
+
message,
|
|
1226
|
+
};
|
|
1113
1227
|
}
|
|
1114
|
-
|
|
1115
|
-
|
|
1228
|
+
};
|
|
1229
|
+
return DoorLockCCConfigurationSet = _classThis;
|
|
1230
|
+
})();
|
|
1231
|
+
export { DoorLockCCConfigurationSet };
|
|
1232
|
+
let DoorLockCCCapabilitiesReport = (() => {
|
|
1233
|
+
let _classDecorators = [CCCommand(DoorLockCommand.CapabilitiesReport), ccValueProperty("supportedOutsideHandles", DoorLockCCValues.supportedOutsideHandles), ccValueProperty("supportedInsideHandles", DoorLockCCValues.supportedInsideHandles), ccValueProperty("autoRelockSupported", DoorLockCCValues.autoRelockSupported), ccValueProperty("holdAndReleaseSupported", DoorLockCCValues.holdAndReleaseSupported), ccValueProperty("twistAssistSupported", DoorLockCCValues.twistAssistSupported), ccValueProperty("blockToBlockSupported", DoorLockCCValues.blockToBlockSupported)];
|
|
1234
|
+
let _classDescriptor;
|
|
1235
|
+
let _classExtraInitializers = [];
|
|
1236
|
+
let _classThis;
|
|
1237
|
+
let _classSuper = DoorLockCC;
|
|
1238
|
+
var DoorLockCCCapabilitiesReport = class extends _classSuper {
|
|
1239
|
+
static { _classThis = this; }
|
|
1240
|
+
static {
|
|
1241
|
+
const _metadata = typeof Symbol === "function" && Symbol.metadata ? Object.create(_classSuper[Symbol.metadata] ?? null) : void 0;
|
|
1242
|
+
__esDecorate(null, _classDescriptor = { value: _classThis }, _classDecorators, { kind: "class", name: _classThis.name, metadata: _metadata }, null, _classExtraInitializers);
|
|
1243
|
+
DoorLockCCCapabilitiesReport = _classThis = _classDescriptor.value;
|
|
1244
|
+
if (_metadata) Object.defineProperty(_classThis, Symbol.metadata, { enumerable: true, configurable: true, writable: true, value: _metadata });
|
|
1245
|
+
__runInitializers(_classThis, _classExtraInitializers);
|
|
1116
1246
|
}
|
|
1117
|
-
|
|
1118
|
-
|
|
1247
|
+
constructor(options) {
|
|
1248
|
+
super(options);
|
|
1249
|
+
// TODO: Check implementation:
|
|
1250
|
+
this.supportedOperationTypes = options.supportedOperationTypes;
|
|
1251
|
+
this.supportedDoorLockModes = options.supportedDoorLockModes;
|
|
1252
|
+
this.supportedOutsideHandles = options.supportedOutsideHandles;
|
|
1253
|
+
this.supportedInsideHandles = options.supportedInsideHandles;
|
|
1254
|
+
this.doorSupported = options.doorSupported;
|
|
1255
|
+
this.boltSupported = options.boltSupported;
|
|
1256
|
+
this.latchSupported = options.latchSupported;
|
|
1257
|
+
this.blockToBlockSupported = options.blockToBlockSupported;
|
|
1258
|
+
this.twistAssistSupported = options.twistAssistSupported;
|
|
1259
|
+
this.holdAndReleaseSupported = options.holdAndReleaseSupported;
|
|
1260
|
+
this.autoRelockSupported = options.autoRelockSupported;
|
|
1119
1261
|
}
|
|
1120
|
-
|
|
1121
|
-
|
|
1262
|
+
static from(raw, ctx) {
|
|
1263
|
+
// parse variable length operation type bit mask
|
|
1264
|
+
validatePayload(raw.payload.length >= 1);
|
|
1265
|
+
const bitMaskLength = raw.payload[0] & 0b11111;
|
|
1266
|
+
let offset = 1;
|
|
1267
|
+
validatePayload(raw.payload.length >= offset + bitMaskLength + 1);
|
|
1268
|
+
const supportedOperationTypes = parseBitMask(raw.payload.subarray(offset, offset + bitMaskLength),
|
|
1269
|
+
// bit 0 is reserved, bitmask starts at 1
|
|
1270
|
+
0);
|
|
1271
|
+
offset += bitMaskLength;
|
|
1272
|
+
// parse variable length door lock mode list
|
|
1273
|
+
const listLength = raw.payload[offset];
|
|
1274
|
+
offset += 1;
|
|
1275
|
+
validatePayload(raw.payload.length >= offset + listLength + 3);
|
|
1276
|
+
const supportedDoorLockModes = [
|
|
1277
|
+
...raw.payload.subarray(offset, offset + listLength),
|
|
1278
|
+
];
|
|
1279
|
+
offset += listLength;
|
|
1280
|
+
const supportedOutsideHandles = [
|
|
1281
|
+
!!(raw.payload[offset] & 0b0001_0000),
|
|
1282
|
+
!!(raw.payload[offset] & 0b0010_0000),
|
|
1283
|
+
!!(raw.payload[offset] & 0b0100_0000),
|
|
1284
|
+
!!(raw.payload[offset] & 0b1000_0000),
|
|
1285
|
+
];
|
|
1286
|
+
const supportedInsideHandles = [
|
|
1287
|
+
!!(raw.payload[offset] & 0b0001),
|
|
1288
|
+
!!(raw.payload[offset] & 0b0010),
|
|
1289
|
+
!!(raw.payload[offset] & 0b0100),
|
|
1290
|
+
!!(raw.payload[offset] & 0b1000),
|
|
1291
|
+
];
|
|
1292
|
+
const doorSupported = !!(raw.payload[offset + 1] & 0b1);
|
|
1293
|
+
const boltSupported = !!(raw.payload[offset + 1] & 0b10);
|
|
1294
|
+
const latchSupported = !!(raw.payload[offset + 1] & 0b100);
|
|
1295
|
+
const blockToBlockSupported = !!(raw.payload[offset + 2] & 0b1);
|
|
1296
|
+
const twistAssistSupported = !!(raw.payload[offset + 2] & 0b10);
|
|
1297
|
+
const holdAndReleaseSupported = !!(raw.payload[offset + 2] & 0b100);
|
|
1298
|
+
const autoRelockSupported = !!(raw.payload[offset + 2] & 0b1000);
|
|
1299
|
+
return new this({
|
|
1300
|
+
nodeId: ctx.sourceNodeId,
|
|
1301
|
+
supportedOperationTypes,
|
|
1302
|
+
supportedDoorLockModes,
|
|
1303
|
+
supportedOutsideHandles,
|
|
1304
|
+
supportedInsideHandles,
|
|
1305
|
+
doorSupported,
|
|
1306
|
+
boltSupported,
|
|
1307
|
+
latchSupported,
|
|
1308
|
+
blockToBlockSupported,
|
|
1309
|
+
twistAssistSupported,
|
|
1310
|
+
holdAndReleaseSupported,
|
|
1311
|
+
autoRelockSupported,
|
|
1312
|
+
});
|
|
1122
1313
|
}
|
|
1123
|
-
|
|
1124
|
-
|
|
1314
|
+
supportedOperationTypes;
|
|
1315
|
+
supportedDoorLockModes;
|
|
1316
|
+
supportedOutsideHandles;
|
|
1317
|
+
supportedInsideHandles;
|
|
1318
|
+
// These 3 are not automatically persisted because in CC version 3
|
|
1319
|
+
// we have to assume them to be supported. In v4 we can query this.
|
|
1320
|
+
latchSupported;
|
|
1321
|
+
boltSupported;
|
|
1322
|
+
doorSupported;
|
|
1323
|
+
autoRelockSupported;
|
|
1324
|
+
holdAndReleaseSupported;
|
|
1325
|
+
twistAssistSupported;
|
|
1326
|
+
blockToBlockSupported;
|
|
1327
|
+
toLogEntry(ctx) {
|
|
1328
|
+
return {
|
|
1329
|
+
...super.toLogEntry(ctx),
|
|
1330
|
+
message: {
|
|
1331
|
+
door: this.doorSupported,
|
|
1332
|
+
bolt: this.boltSupported,
|
|
1333
|
+
latch: this.latchSupported,
|
|
1334
|
+
"block-to-block feature": this.blockToBlockSupported,
|
|
1335
|
+
"twist assist feature": this.twistAssistSupported,
|
|
1336
|
+
"hold-and-release feature": this.holdAndReleaseSupported,
|
|
1337
|
+
"auto-relock feature": this.autoRelockSupported,
|
|
1338
|
+
"operation types": this.supportedOperationTypes
|
|
1339
|
+
.map((t) => `\n· ${getEnumMemberName(DoorLockOperationType, t)}`)
|
|
1340
|
+
.join(""),
|
|
1341
|
+
"door lock modes": this.supportedDoorLockModes
|
|
1342
|
+
.map((t) => `\n· ${getEnumMemberName(DoorLockMode, t)}`)
|
|
1343
|
+
.join(""),
|
|
1344
|
+
"outside handles": this.supportedOutsideHandles.join(", "),
|
|
1345
|
+
"inside handles": this.supportedInsideHandles.join(", "),
|
|
1346
|
+
},
|
|
1347
|
+
};
|
|
1125
1348
|
}
|
|
1126
|
-
|
|
1127
|
-
|
|
1128
|
-
|
|
1129
|
-
};
|
|
1130
|
-
}
|
|
1131
|
-
};
|
|
1132
|
-
DoorLockCCConfigurationSet = __decorate([
|
|
1133
|
-
CCCommand(DoorLockCommand.ConfigurationSet),
|
|
1134
|
-
useSupervision()
|
|
1135
|
-
], DoorLockCCConfigurationSet);
|
|
1136
|
-
export { DoorLockCCConfigurationSet };
|
|
1137
|
-
let DoorLockCCCapabilitiesReport = DoorLockCCCapabilitiesReport_1 = class DoorLockCCCapabilitiesReport extends DoorLockCC {
|
|
1138
|
-
constructor(options) {
|
|
1139
|
-
super(options);
|
|
1140
|
-
// TODO: Check implementation:
|
|
1141
|
-
this.supportedOperationTypes = options.supportedOperationTypes;
|
|
1142
|
-
this.supportedDoorLockModes = options.supportedDoorLockModes;
|
|
1143
|
-
this.supportedOutsideHandles = options.supportedOutsideHandles;
|
|
1144
|
-
this.supportedInsideHandles = options.supportedInsideHandles;
|
|
1145
|
-
this.doorSupported = options.doorSupported;
|
|
1146
|
-
this.boltSupported = options.boltSupported;
|
|
1147
|
-
this.latchSupported = options.latchSupported;
|
|
1148
|
-
this.blockToBlockSupported = options.blockToBlockSupported;
|
|
1149
|
-
this.twistAssistSupported = options.twistAssistSupported;
|
|
1150
|
-
this.holdAndReleaseSupported = options.holdAndReleaseSupported;
|
|
1151
|
-
this.autoRelockSupported = options.autoRelockSupported;
|
|
1152
|
-
}
|
|
1153
|
-
static from(raw, ctx) {
|
|
1154
|
-
// parse variable length operation type bit mask
|
|
1155
|
-
validatePayload(raw.payload.length >= 1);
|
|
1156
|
-
const bitMaskLength = raw.payload[0] & 0b11111;
|
|
1157
|
-
let offset = 1;
|
|
1158
|
-
validatePayload(raw.payload.length >= offset + bitMaskLength + 1);
|
|
1159
|
-
const supportedOperationTypes = parseBitMask(raw.payload.subarray(offset, offset + bitMaskLength),
|
|
1160
|
-
// bit 0 is reserved, bitmask starts at 1
|
|
1161
|
-
0);
|
|
1162
|
-
offset += bitMaskLength;
|
|
1163
|
-
// parse variable length door lock mode list
|
|
1164
|
-
const listLength = raw.payload[offset];
|
|
1165
|
-
offset += 1;
|
|
1166
|
-
validatePayload(raw.payload.length >= offset + listLength + 3);
|
|
1167
|
-
const supportedDoorLockModes = [
|
|
1168
|
-
...raw.payload.subarray(offset, offset + listLength),
|
|
1169
|
-
];
|
|
1170
|
-
offset += listLength;
|
|
1171
|
-
const supportedOutsideHandles = [
|
|
1172
|
-
!!(raw.payload[offset] & 0b0001_0000),
|
|
1173
|
-
!!(raw.payload[offset] & 0b0010_0000),
|
|
1174
|
-
!!(raw.payload[offset] & 0b0100_0000),
|
|
1175
|
-
!!(raw.payload[offset] & 0b1000_0000),
|
|
1176
|
-
];
|
|
1177
|
-
const supportedInsideHandles = [
|
|
1178
|
-
!!(raw.payload[offset] & 0b0001),
|
|
1179
|
-
!!(raw.payload[offset] & 0b0010),
|
|
1180
|
-
!!(raw.payload[offset] & 0b0100),
|
|
1181
|
-
!!(raw.payload[offset] & 0b1000),
|
|
1182
|
-
];
|
|
1183
|
-
const doorSupported = !!(raw.payload[offset + 1] & 0b1);
|
|
1184
|
-
const boltSupported = !!(raw.payload[offset + 1] & 0b10);
|
|
1185
|
-
const latchSupported = !!(raw.payload[offset + 1] & 0b100);
|
|
1186
|
-
const blockToBlockSupported = !!(raw.payload[offset + 2] & 0b1);
|
|
1187
|
-
const twistAssistSupported = !!(raw.payload[offset + 2] & 0b10);
|
|
1188
|
-
const holdAndReleaseSupported = !!(raw.payload[offset + 2] & 0b100);
|
|
1189
|
-
const autoRelockSupported = !!(raw.payload[offset + 2] & 0b1000);
|
|
1190
|
-
return new DoorLockCCCapabilitiesReport_1({
|
|
1191
|
-
nodeId: ctx.sourceNodeId,
|
|
1192
|
-
supportedOperationTypes,
|
|
1193
|
-
supportedDoorLockModes,
|
|
1194
|
-
supportedOutsideHandles,
|
|
1195
|
-
supportedInsideHandles,
|
|
1196
|
-
doorSupported,
|
|
1197
|
-
boltSupported,
|
|
1198
|
-
latchSupported,
|
|
1199
|
-
blockToBlockSupported,
|
|
1200
|
-
twistAssistSupported,
|
|
1201
|
-
holdAndReleaseSupported,
|
|
1202
|
-
autoRelockSupported,
|
|
1203
|
-
});
|
|
1204
|
-
}
|
|
1205
|
-
supportedOperationTypes;
|
|
1206
|
-
supportedDoorLockModes;
|
|
1207
|
-
supportedOutsideHandles;
|
|
1208
|
-
supportedInsideHandles;
|
|
1209
|
-
// These 3 are not automatically persisted because in CC version 3
|
|
1210
|
-
// we have to assume them to be supported. In v4 we can query this.
|
|
1211
|
-
latchSupported;
|
|
1212
|
-
boltSupported;
|
|
1213
|
-
doorSupported;
|
|
1214
|
-
autoRelockSupported;
|
|
1215
|
-
holdAndReleaseSupported;
|
|
1216
|
-
twistAssistSupported;
|
|
1217
|
-
blockToBlockSupported;
|
|
1218
|
-
toLogEntry(ctx) {
|
|
1219
|
-
return {
|
|
1220
|
-
...super.toLogEntry(ctx),
|
|
1221
|
-
message: {
|
|
1222
|
-
door: this.doorSupported,
|
|
1223
|
-
bolt: this.boltSupported,
|
|
1224
|
-
latch: this.latchSupported,
|
|
1225
|
-
"block-to-block feature": this.blockToBlockSupported,
|
|
1226
|
-
"twist assist feature": this.twistAssistSupported,
|
|
1227
|
-
"hold-and-release feature": this.holdAndReleaseSupported,
|
|
1228
|
-
"auto-relock feature": this.autoRelockSupported,
|
|
1229
|
-
"operation types": this.supportedOperationTypes
|
|
1230
|
-
.map((t) => `\n· ${getEnumMemberName(DoorLockOperationType, t)}`)
|
|
1231
|
-
.join(""),
|
|
1232
|
-
"door lock modes": this.supportedDoorLockModes
|
|
1233
|
-
.map((t) => `\n· ${getEnumMemberName(DoorLockMode, t)}`)
|
|
1234
|
-
.join(""),
|
|
1235
|
-
"outside handles": this.supportedOutsideHandles.join(", "),
|
|
1236
|
-
"inside handles": this.supportedInsideHandles.join(", "),
|
|
1237
|
-
},
|
|
1238
|
-
};
|
|
1239
|
-
}
|
|
1240
|
-
};
|
|
1241
|
-
__decorate([
|
|
1242
|
-
ccValue(DoorLockCCValues.supportedOutsideHandles)
|
|
1243
|
-
], DoorLockCCCapabilitiesReport.prototype, "supportedOutsideHandles", void 0);
|
|
1244
|
-
__decorate([
|
|
1245
|
-
ccValue(DoorLockCCValues.supportedInsideHandles)
|
|
1246
|
-
], DoorLockCCCapabilitiesReport.prototype, "supportedInsideHandles", void 0);
|
|
1247
|
-
__decorate([
|
|
1248
|
-
ccValue(DoorLockCCValues.autoRelockSupported)
|
|
1249
|
-
], DoorLockCCCapabilitiesReport.prototype, "autoRelockSupported", void 0);
|
|
1250
|
-
__decorate([
|
|
1251
|
-
ccValue(DoorLockCCValues.holdAndReleaseSupported)
|
|
1252
|
-
], DoorLockCCCapabilitiesReport.prototype, "holdAndReleaseSupported", void 0);
|
|
1253
|
-
__decorate([
|
|
1254
|
-
ccValue(DoorLockCCValues.twistAssistSupported)
|
|
1255
|
-
], DoorLockCCCapabilitiesReport.prototype, "twistAssistSupported", void 0);
|
|
1256
|
-
__decorate([
|
|
1257
|
-
ccValue(DoorLockCCValues.blockToBlockSupported)
|
|
1258
|
-
], DoorLockCCCapabilitiesReport.prototype, "blockToBlockSupported", void 0);
|
|
1259
|
-
DoorLockCCCapabilitiesReport = DoorLockCCCapabilitiesReport_1 = __decorate([
|
|
1260
|
-
CCCommand(DoorLockCommand.CapabilitiesReport)
|
|
1261
|
-
], DoorLockCCCapabilitiesReport);
|
|
1349
|
+
};
|
|
1350
|
+
return DoorLockCCCapabilitiesReport = _classThis;
|
|
1351
|
+
})();
|
|
1262
1352
|
export { DoorLockCCCapabilitiesReport };
|
|
1263
|
-
let DoorLockCCCapabilitiesGet =
|
|
1264
|
-
|
|
1265
|
-
|
|
1266
|
-
|
|
1267
|
-
|
|
1268
|
-
|
|
1353
|
+
let DoorLockCCCapabilitiesGet = (() => {
|
|
1354
|
+
let _classDecorators = [CCCommand(DoorLockCommand.CapabilitiesGet), expectedCCResponse(DoorLockCCCapabilitiesReport)];
|
|
1355
|
+
let _classDescriptor;
|
|
1356
|
+
let _classExtraInitializers = [];
|
|
1357
|
+
let _classThis;
|
|
1358
|
+
let _classSuper = DoorLockCC;
|
|
1359
|
+
var DoorLockCCCapabilitiesGet = class extends _classSuper {
|
|
1360
|
+
static { _classThis = this; }
|
|
1361
|
+
static {
|
|
1362
|
+
const _metadata = typeof Symbol === "function" && Symbol.metadata ? Object.create(_classSuper[Symbol.metadata] ?? null) : void 0;
|
|
1363
|
+
__esDecorate(null, _classDescriptor = { value: _classThis }, _classDecorators, { kind: "class", name: _classThis.name, metadata: _metadata }, null, _classExtraInitializers);
|
|
1364
|
+
DoorLockCCCapabilitiesGet = _classThis = _classDescriptor.value;
|
|
1365
|
+
if (_metadata) Object.defineProperty(_classThis, Symbol.metadata, { enumerable: true, configurable: true, writable: true, value: _metadata });
|
|
1366
|
+
__runInitializers(_classThis, _classExtraInitializers);
|
|
1367
|
+
}
|
|
1368
|
+
};
|
|
1369
|
+
return DoorLockCCCapabilitiesGet = _classThis;
|
|
1370
|
+
})();
|
|
1269
1371
|
export { DoorLockCCCapabilitiesGet };
|
|
1270
1372
|
//# sourceMappingURL=DoorLockCC.js.map
|