@zwave-js/cc 14.0.0-beta.4 → 14.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/build/cjs/cc/AlarmSensorCC.js +381 -266
- package/build/cjs/cc/AlarmSensorCC.js.map +3 -3
- package/build/cjs/cc/AssociationCC.js +669 -503
- package/build/cjs/cc/AssociationCC.js.map +3 -3
- package/build/cjs/cc/AssociationGroupInfoCC.js +633 -492
- package/build/cjs/cc/AssociationGroupInfoCC.js.map +3 -3
- package/build/cjs/cc/BarrierOperatorCC.js +595 -429
- package/build/cjs/cc/BarrierOperatorCC.js.map +3 -3
- package/build/cjs/cc/BasicCC.js +354 -260
- package/build/cjs/cc/BasicCC.js.map +3 -3
- package/build/cjs/cc/BatteryCC.js +427 -345
- package/build/cjs/cc/BatteryCC.js.map +3 -3
- package/build/cjs/cc/BinarySensorCC.js +391 -276
- package/build/cjs/cc/BinarySensorCC.js.map +3 -3
- package/build/cjs/cc/BinarySwitchCC.js +347 -253
- package/build/cjs/cc/BinarySwitchCC.js.map +3 -3
- package/build/cjs/cc/CRC16CC.js +160 -85
- package/build/cjs/cc/CRC16CC.js.map +3 -3
- package/build/cjs/cc/CentralSceneCC.js +459 -324
- package/build/cjs/cc/CentralSceneCC.js.map +3 -3
- package/build/cjs/cc/ClimateControlScheduleCC.js +459 -293
- package/build/cjs/cc/ClimateControlScheduleCC.js.map +3 -3
- package/build/cjs/cc/ClockCC.js +254 -150
- package/build/cjs/cc/ClockCC.js.map +3 -3
- package/build/cjs/cc/ColorSwitchCC.js +758 -610
- package/build/cjs/cc/ColorSwitchCC.js.map +3 -3
- package/build/cjs/cc/ConfigurationCC.js +1700 -1453
- package/build/cjs/cc/ConfigurationCC.js.map +3 -3
- package/build/cjs/cc/DeviceResetLocallyCC.js +125 -49
- package/build/cjs/cc/DeviceResetLocallyCC.js.map +3 -3
- package/build/cjs/cc/DoorLockCC.js +904 -777
- package/build/cjs/cc/DoorLockCC.js.map +3 -3
- package/build/cjs/cc/DoorLockLoggingCC.js +321 -206
- package/build/cjs/cc/DoorLockLoggingCC.js.map +3 -3
- package/build/cjs/cc/EnergyProductionCC.js +249 -160
- package/build/cjs/cc/EnergyProductionCC.js.map +3 -3
- package/build/cjs/cc/EntryControlCC.js +619 -458
- package/build/cjs/cc/EntryControlCC.js.map +3 -3
- package/build/cjs/cc/FirmwareUpdateMetaDataCC.js +898 -698
- package/build/cjs/cc/FirmwareUpdateMetaDataCC.js.map +3 -3
- package/build/cjs/cc/HailCC.js +57 -11
- package/build/cjs/cc/HailCC.js.map +2 -2
- package/build/cjs/cc/HumidityControlModeCC.js +359 -233
- package/build/cjs/cc/HumidityControlModeCC.js.map +3 -3
- package/build/cjs/cc/HumidityControlOperatingStateCC.js +189 -103
- package/build/cjs/cc/HumidityControlOperatingStateCC.js.map +3 -3
- package/build/cjs/cc/HumidityControlSetpointCC.js +682 -495
- package/build/cjs/cc/HumidityControlSetpointCC.js.map +3 -3
- package/build/cjs/cc/InclusionControllerCC.js +205 -114
- package/build/cjs/cc/InclusionControllerCC.js.map +3 -3
- package/build/cjs/cc/IndicatorCC.js +897 -736
- package/build/cjs/cc/IndicatorCC.js.map +3 -3
- package/build/cjs/cc/IrrigationCC.js +1651 -1405
- package/build/cjs/cc/IrrigationCC.js.map +3 -3
- package/build/cjs/cc/LanguageCC.js +268 -171
- package/build/cjs/cc/LanguageCC.js.map +3 -3
- package/build/cjs/cc/LockCC.js +254 -154
- package/build/cjs/cc/LockCC.js.map +3 -3
- package/build/cjs/cc/ManufacturerProprietaryCC.js +189 -129
- package/build/cjs/cc/ManufacturerProprietaryCC.js.map +2 -2
- package/build/cjs/cc/ManufacturerSpecificCC.js +319 -213
- package/build/cjs/cc/ManufacturerSpecificCC.js.map +3 -3
- package/build/cjs/cc/MeterCC.js +827 -707
- package/build/cjs/cc/MeterCC.js.map +3 -3
- package/build/cjs/cc/MultiChannelAssociationCC.js +612 -478
- package/build/cjs/cc/MultiChannelAssociationCC.js.map +3 -3
- package/build/cjs/cc/MultiChannelCC.js +1037 -819
- package/build/cjs/cc/MultiChannelCC.js.map +3 -3
- package/build/cjs/cc/MultiCommandCC.js +172 -97
- package/build/cjs/cc/MultiCommandCC.js.map +3 -3
- package/build/cjs/cc/MultilevelSensorCC.js +589 -449
- package/build/cjs/cc/MultilevelSensorCC.js.map +3 -3
- package/build/cjs/cc/MultilevelSwitchCC.js +587 -439
- package/build/cjs/cc/MultilevelSwitchCC.js.map +3 -3
- package/build/cjs/cc/NoOperationCC.js +89 -27
- package/build/cjs/cc/NoOperationCC.js.map +2 -2
- package/build/cjs/cc/NodeNamingCC.js +417 -277
- package/build/cjs/cc/NodeNamingCC.js.map +3 -3
- package/build/cjs/cc/NotificationCC.js +972 -818
- package/build/cjs/cc/NotificationCC.js.map +3 -3
- package/build/cjs/cc/PowerlevelCC.js +450 -303
- package/build/cjs/cc/PowerlevelCC.js.map +3 -3
- package/build/cjs/cc/ProtectionCC.js +686 -494
- package/build/cjs/cc/ProtectionCC.js.map +3 -3
- package/build/cjs/cc/SceneActivationCC.js +165 -97
- package/build/cjs/cc/SceneActivationCC.js.map +3 -3
- package/build/cjs/cc/SceneActuatorConfigurationCC.js +346 -243
- package/build/cjs/cc/SceneActuatorConfigurationCC.js.map +3 -3
- package/build/cjs/cc/SceneControllerConfigurationCC.js +401 -298
- package/build/cjs/cc/SceneControllerConfigurationCC.js.map +3 -3
- package/build/cjs/cc/ScheduleEntryLockCC.js +1552 -1272
- package/build/cjs/cc/ScheduleEntryLockCC.js.map +3 -3
- package/build/cjs/cc/Security2CC.js +1483 -1219
- package/build/cjs/cc/Security2CC.js.map +3 -3
- package/build/cjs/cc/SecurityCC.js +839 -619
- package/build/cjs/cc/SecurityCC.js.map +3 -3
- package/build/cjs/cc/SoundSwitchCC.js +707 -515
- package/build/cjs/cc/SoundSwitchCC.js.map +3 -3
- package/build/cjs/cc/SupervisionCC.js +327 -237
- package/build/cjs/cc/SupervisionCC.js.map +3 -3
- package/build/cjs/cc/ThermostatFanModeCC.js +386 -263
- package/build/cjs/cc/ThermostatFanModeCC.js.map +3 -3
- package/build/cjs/cc/ThermostatFanStateCC.js +192 -106
- package/build/cjs/cc/ThermostatFanStateCC.js.map +3 -3
- package/build/cjs/cc/ThermostatModeCC.js +425 -302
- package/build/cjs/cc/ThermostatModeCC.js.map +3 -3
- package/build/cjs/cc/ThermostatOperatingStateCC.js +188 -102
- package/build/cjs/cc/ThermostatOperatingStateCC.js.map +3 -3
- package/build/cjs/cc/ThermostatSetbackCC.js +277 -173
- package/build/cjs/cc/ThermostatSetbackCC.js.map +3 -3
- package/build/cjs/cc/ThermostatSetpointCC.js +645 -491
- package/build/cjs/cc/ThermostatSetpointCC.js.map +3 -3
- package/build/cjs/cc/TimeCC.js +515 -353
- package/build/cjs/cc/TimeCC.js.map +3 -3
- package/build/cjs/cc/TimeParametersCC.js +302 -202
- package/build/cjs/cc/TimeParametersCC.js.map +3 -3
- package/build/cjs/cc/TransportServiceCC.js +433 -315
- package/build/cjs/cc/TransportServiceCC.js.map +3 -3
- package/build/cjs/cc/UserCodeCC.js +1385 -1102
- package/build/cjs/cc/UserCodeCC.js.map +3 -3
- package/build/cjs/cc/VersionCC.js +696 -562
- package/build/cjs/cc/VersionCC.js.map +3 -3
- package/build/cjs/cc/WakeUpCC.js +499 -346
- package/build/cjs/cc/WakeUpCC.js.map +3 -3
- package/build/cjs/cc/WindowCoveringCC.js +626 -478
- package/build/cjs/cc/WindowCoveringCC.js.map +3 -3
- package/build/cjs/cc/ZWaveLongRangeCC.js +57 -10
- package/build/cjs/cc/ZWaveLongRangeCC.js.map +2 -2
- package/build/cjs/cc/ZWavePlusCC.js +233 -159
- package/build/cjs/cc/ZWavePlusCC.js.map +3 -3
- package/build/cjs/cc/ZWaveProtocolCC.js +1515 -948
- package/build/cjs/cc/ZWaveProtocolCC.js.map +3 -3
- package/build/cjs/cc/manufacturerProprietary/Decorators.d.ts +4 -4
- package/build/cjs/cc/manufacturerProprietary/Decorators.js.map +1 -1
- package/build/cjs/cc/manufacturerProprietary/FibaroCC.js +395 -274
- package/build/cjs/cc/manufacturerProprietary/FibaroCC.js.map +3 -3
- package/build/cjs/lib/CommandClassDecorators.d.ts +11 -15
- package/build/cjs/lib/CommandClassDecorators.js +19 -20
- package/build/cjs/lib/CommandClassDecorators.js.map +2 -2
- package/build/cjs/lib/Security2/Extension.d.ts +1 -1
- package/build/cjs/lib/Security2/Extension.js +217 -126
- package/build/cjs/lib/Security2/Extension.js.map +3 -3
- package/build/esm/cc/AlarmSensorCC.d.ts.map +1 -1
- package/build/esm/cc/AlarmSensorCC.js +389 -291
- package/build/esm/cc/AlarmSensorCC.js.map +1 -1
- package/build/esm/cc/AssociationCC.d.ts.map +1 -1
- package/build/esm/cc/AssociationCC.js +678 -537
- package/build/esm/cc/AssociationCC.js.map +1 -1
- package/build/esm/cc/AssociationGroupInfoCC.d.ts.map +1 -1
- package/build/esm/cc/AssociationGroupInfoCC.js +659 -539
- package/build/esm/cc/AssociationGroupInfoCC.js.map +1 -1
- package/build/esm/cc/BarrierOperatorCC.d.ts.map +1 -1
- package/build/esm/cc/BarrierOperatorCC.js +634 -493
- package/build/esm/cc/BarrierOperatorCC.js.map +1 -1
- package/build/esm/cc/BasicCC.d.ts.map +1 -1
- package/build/esm/cc/BasicCC.js +380 -302
- package/build/esm/cc/BasicCC.js.map +1 -1
- package/build/esm/cc/BatteryCC.d.ts.map +1 -1
- package/build/esm/cc/BatteryCC.js +449 -384
- package/build/esm/cc/BatteryCC.js.map +1 -1
- package/build/esm/cc/BinarySensorCC.d.ts.map +1 -1
- package/build/esm/cc/BinarySensorCC.js +395 -297
- package/build/esm/cc/BinarySensorCC.js.map +1 -1
- package/build/esm/cc/BinarySwitchCC.d.ts.map +1 -1
- package/build/esm/cc/BinarySwitchCC.js +353 -274
- package/build/esm/cc/BinarySwitchCC.js.map +1 -1
- package/build/esm/cc/CRC16CC.js +162 -98
- package/build/esm/cc/CRC16CC.js.map +1 -1
- package/build/esm/cc/CentralSceneCC.d.ts.map +1 -1
- package/build/esm/cc/CentralSceneCC.js +465 -351
- package/build/esm/cc/CentralSceneCC.js.map +1 -1
- package/build/esm/cc/ClimateControlScheduleCC.d.ts.map +1 -1
- package/build/esm/cc/ClimateControlScheduleCC.js +454 -313
- package/build/esm/cc/ClimateControlScheduleCC.js.map +1 -1
- package/build/esm/cc/ClockCC.js +248 -159
- package/build/esm/cc/ClockCC.js.map +1 -1
- package/build/esm/cc/ColorSwitchCC.d.ts.map +1 -1
- package/build/esm/cc/ColorSwitchCC.js +802 -677
- package/build/esm/cc/ColorSwitchCC.js.map +1 -1
- package/build/esm/cc/ConfigurationCC.js +1899 -1687
- package/build/esm/cc/ConfigurationCC.js.map +1 -1
- package/build/esm/cc/DeviceResetLocallyCC.js +124 -59
- package/build/esm/cc/DeviceResetLocallyCC.js.map +1 -1
- package/build/esm/cc/DoorLockCC.d.ts.map +1 -1
- package/build/esm/cc/DoorLockCC.js +951 -849
- package/build/esm/cc/DoorLockCC.js.map +1 -1
- package/build/esm/cc/DoorLockLoggingCC.d.ts.map +1 -1
- package/build/esm/cc/DoorLockLoggingCC.js +316 -218
- package/build/esm/cc/DoorLockLoggingCC.js.map +1 -1
- package/build/esm/cc/EnergyProductionCC.js +240 -164
- package/build/esm/cc/EnergyProductionCC.js.map +1 -1
- package/build/esm/cc/EntryControlCC.d.ts.map +1 -1
- package/build/esm/cc/EntryControlCC.js +629 -493
- package/build/esm/cc/EntryControlCC.js.map +1 -1
- package/build/esm/cc/FirmwareUpdateMetaDataCC.d.ts.map +1 -1
- package/build/esm/cc/FirmwareUpdateMetaDataCC.js +938 -769
- package/build/esm/cc/FirmwareUpdateMetaDataCC.js.map +1 -1
- package/build/esm/cc/HailCC.js +51 -12
- package/build/esm/cc/HailCC.js.map +1 -1
- package/build/esm/cc/HumidityControlModeCC.d.ts.map +1 -1
- package/build/esm/cc/HumidityControlModeCC.js +357 -250
- package/build/esm/cc/HumidityControlModeCC.js.map +1 -1
- package/build/esm/cc/HumidityControlOperatingStateCC.d.ts.map +1 -1
- package/build/esm/cc/HumidityControlOperatingStateCC.js +182 -109
- package/build/esm/cc/HumidityControlOperatingStateCC.js.map +1 -1
- package/build/esm/cc/HumidityControlSetpointCC.d.ts.map +1 -1
- package/build/esm/cc/HumidityControlSetpointCC.js +706 -546
- package/build/esm/cc/HumidityControlSetpointCC.js.map +1 -1
- package/build/esm/cc/InclusionControllerCC.js +197 -119
- package/build/esm/cc/InclusionControllerCC.js.map +1 -1
- package/build/esm/cc/IndicatorCC.js +973 -835
- package/build/esm/cc/IndicatorCC.js.map +1 -1
- package/build/esm/cc/IrrigationCC.d.ts.map +1 -1
- package/build/esm/cc/IrrigationCC.js +1697 -1496
- package/build/esm/cc/IrrigationCC.js.map +1 -1
- package/build/esm/cc/LanguageCC.d.ts.map +1 -1
- package/build/esm/cc/LanguageCC.js +266 -184
- package/build/esm/cc/LanguageCC.js.map +1 -1
- package/build/esm/cc/LockCC.d.ts.map +1 -1
- package/build/esm/cc/LockCC.js +247 -162
- package/build/esm/cc/LockCC.js.map +1 -1
- package/build/esm/cc/ManufacturerProprietaryCC.js +192 -141
- package/build/esm/cc/ManufacturerProprietaryCC.js.map +1 -1
- package/build/esm/cc/ManufacturerSpecificCC.d.ts.map +1 -1
- package/build/esm/cc/ManufacturerSpecificCC.js +312 -223
- package/build/esm/cc/ManufacturerSpecificCC.js.map +1 -1
- package/build/esm/cc/MeterCC.d.ts.map +1 -1
- package/build/esm/cc/MeterCC.js +896 -795
- package/build/esm/cc/MeterCC.js.map +1 -1
- package/build/esm/cc/MultiChannelAssociationCC.d.ts.map +1 -1
- package/build/esm/cc/MultiChannelAssociationCC.js +631 -518
- package/build/esm/cc/MultiChannelAssociationCC.js.map +1 -1
- package/build/esm/cc/MultiChannelCC.d.ts.map +1 -1
- package/build/esm/cc/MultiChannelCC.js +1106 -921
- package/build/esm/cc/MultiChannelCC.js.map +1 -1
- package/build/esm/cc/MultiCommandCC.js +166 -102
- package/build/esm/cc/MultiCommandCC.js.map +1 -1
- package/build/esm/cc/MultilevelSensorCC.d.ts.map +1 -1
- package/build/esm/cc/MultilevelSensorCC.js +616 -497
- package/build/esm/cc/MultilevelSensorCC.js.map +1 -1
- package/build/esm/cc/MultilevelSwitchCC.d.ts.map +1 -1
- package/build/esm/cc/MultilevelSwitchCC.js +621 -496
- package/build/esm/cc/MultilevelSwitchCC.js.map +1 -1
- package/build/esm/cc/NoOperationCC.js +82 -29
- package/build/esm/cc/NoOperationCC.js.map +1 -1
- package/build/esm/cc/NodeNamingCC.d.ts.map +1 -1
- package/build/esm/cc/NodeNamingCC.js +413 -294
- package/build/esm/cc/NodeNamingCC.js.map +1 -1
- package/build/esm/cc/NotificationCC.d.ts.map +1 -1
- package/build/esm/cc/NotificationCC.js +1097 -966
- package/build/esm/cc/NotificationCC.js.map +1 -1
- package/build/esm/cc/PowerlevelCC.js +437 -311
- package/build/esm/cc/PowerlevelCC.js.map +1 -1
- package/build/esm/cc/ProtectionCC.d.ts.map +1 -1
- package/build/esm/cc/ProtectionCC.js +704 -543
- package/build/esm/cc/ProtectionCC.js.map +1 -1
- package/build/esm/cc/SceneActivationCC.d.ts.map +1 -1
- package/build/esm/cc/SceneActivationCC.js +157 -100
- package/build/esm/cc/SceneActivationCC.js.map +1 -1
- package/build/esm/cc/SceneActuatorConfigurationCC.js +357 -269
- package/build/esm/cc/SceneActuatorConfigurationCC.js.map +1 -1
- package/build/esm/cc/SceneControllerConfigurationCC.js +434 -346
- package/build/esm/cc/SceneControllerConfigurationCC.js.map +1 -1
- package/build/esm/cc/ScheduleEntryLockCC.d.ts.map +1 -1
- package/build/esm/cc/ScheduleEntryLockCC.js +1596 -1357
- package/build/esm/cc/ScheduleEntryLockCC.js.map +1 -1
- package/build/esm/cc/Security2CC.js +1633 -1406
- package/build/esm/cc/Security2CC.js.map +1 -1
- package/build/esm/cc/SecurityCC.js +876 -687
- package/build/esm/cc/SecurityCC.js.map +1 -1
- package/build/esm/cc/SoundSwitchCC.d.ts.map +1 -1
- package/build/esm/cc/SoundSwitchCC.js +689 -526
- package/build/esm/cc/SoundSwitchCC.js.map +1 -1
- package/build/esm/cc/SupervisionCC.js +349 -272
- package/build/esm/cc/SupervisionCC.js.map +1 -1
- package/build/esm/cc/ThermostatFanModeCC.d.ts.map +1 -1
- package/build/esm/cc/ThermostatFanModeCC.js +388 -284
- package/build/esm/cc/ThermostatFanModeCC.js.map +1 -1
- package/build/esm/cc/ThermostatFanStateCC.d.ts.map +1 -1
- package/build/esm/cc/ThermostatFanStateCC.js +184 -111
- package/build/esm/cc/ThermostatFanStateCC.js.map +1 -1
- package/build/esm/cc/ThermostatModeCC.d.ts.map +1 -1
- package/build/esm/cc/ThermostatModeCC.js +435 -331
- package/build/esm/cc/ThermostatModeCC.js.map +1 -1
- package/build/esm/cc/ThermostatOperatingStateCC.d.ts.map +1 -1
- package/build/esm/cc/ThermostatOperatingStateCC.js +180 -107
- package/build/esm/cc/ThermostatOperatingStateCC.js.map +1 -1
- package/build/esm/cc/ThermostatSetbackCC.js +274 -185
- package/build/esm/cc/ThermostatSetbackCC.js.map +1 -1
- package/build/esm/cc/ThermostatSetpointCC.d.ts.map +1 -1
- package/build/esm/cc/ThermostatSetpointCC.js +674 -543
- package/build/esm/cc/ThermostatSetpointCC.js.map +1 -1
- package/build/esm/cc/TimeCC.js +499 -360
- package/build/esm/cc/TimeCC.js.map +1 -1
- package/build/esm/cc/TimeParametersCC.d.ts.map +1 -1
- package/build/esm/cc/TimeParametersCC.js +296 -211
- package/build/esm/cc/TimeParametersCC.js.map +1 -1
- package/build/esm/cc/TransportServiceCC.js +464 -363
- package/build/esm/cc/TransportServiceCC.js.map +1 -1
- package/build/esm/cc/UserCodeCC.d.ts.map +1 -1
- package/build/esm/cc/UserCodeCC.js +1443 -1205
- package/build/esm/cc/UserCodeCC.js.map +1 -1
- package/build/esm/cc/VersionCC.d.ts.map +1 -1
- package/build/esm/cc/VersionCC.js +744 -635
- package/build/esm/cc/VersionCC.js.map +1 -1
- package/build/esm/cc/WakeUpCC.d.ts.map +1 -1
- package/build/esm/cc/WakeUpCC.js +494 -364
- package/build/esm/cc/WakeUpCC.js.map +1 -1
- package/build/esm/cc/WindowCoveringCC.d.ts.map +1 -1
- package/build/esm/cc/WindowCoveringCC.js +655 -530
- package/build/esm/cc/WindowCoveringCC.js.map +1 -1
- package/build/esm/cc/ZWaveLongRangeCC.js +51 -11
- package/build/esm/cc/ZWaveLongRangeCC.js.map +1 -1
- package/build/esm/cc/ZWavePlusCC.d.ts.map +1 -1
- package/build/esm/cc/ZWavePlusCC.js +223 -162
- package/build/esm/cc/ZWavePlusCC.js.map +1 -1
- package/build/esm/cc/ZWaveProtocolCC.js +1443 -953
- package/build/esm/cc/ZWaveProtocolCC.js.map +1 -1
- package/build/esm/cc/manufacturerProprietary/Decorators.d.ts +4 -4
- package/build/esm/cc/manufacturerProprietary/Decorators.d.ts.map +1 -1
- package/build/esm/cc/manufacturerProprietary/FibaroCC.js +390 -286
- package/build/esm/cc/manufacturerProprietary/FibaroCC.js.map +1 -1
- package/build/esm/lib/CommandClassDecorators.d.ts +11 -15
- package/build/esm/lib/CommandClassDecorators.d.ts.map +1 -1
- package/build/esm/lib/CommandClassDecorators.js +24 -24
- package/build/esm/lib/CommandClassDecorators.js.map +1 -1
- package/build/esm/lib/Security2/Extension.d.ts +1 -1
- package/build/esm/lib/Security2/Extension.d.ts.map +1 -1
- package/build/esm/lib/Security2/Extension.js +207 -123
- package/build/esm/lib/Security2/Extension.js.map +1 -1
- package/package.json +6 -6
|
@@ -1,10 +1,37 @@
|
|
|
1
|
-
var
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
1
|
+
var __esDecorate = (this && this.__esDecorate) || function (ctor, descriptorIn, decorators, contextIn, initializers, extraInitializers) {
|
|
2
|
+
function accept(f) { if (f !== void 0 && typeof f !== "function") throw new TypeError("Function expected"); return f; }
|
|
3
|
+
var kind = contextIn.kind, key = kind === "getter" ? "get" : kind === "setter" ? "set" : "value";
|
|
4
|
+
var target = !descriptorIn && ctor ? contextIn["static"] ? ctor : ctor.prototype : null;
|
|
5
|
+
var descriptor = descriptorIn || (target ? Object.getOwnPropertyDescriptor(target, contextIn.name) : {});
|
|
6
|
+
var _, done = false;
|
|
7
|
+
for (var i = decorators.length - 1; i >= 0; i--) {
|
|
8
|
+
var context = {};
|
|
9
|
+
for (var p in contextIn) context[p] = p === "access" ? {} : contextIn[p];
|
|
10
|
+
for (var p in contextIn.access) context.access[p] = contextIn.access[p];
|
|
11
|
+
context.addInitializer = function (f) { if (done) throw new TypeError("Cannot add initializers after decoration has completed"); extraInitializers.push(accept(f || null)); };
|
|
12
|
+
var result = (0, decorators[i])(kind === "accessor" ? { get: descriptor.get, set: descriptor.set } : descriptor[key], context);
|
|
13
|
+
if (kind === "accessor") {
|
|
14
|
+
if (result === void 0) continue;
|
|
15
|
+
if (result === null || typeof result !== "object") throw new TypeError("Object expected");
|
|
16
|
+
if (_ = accept(result.get)) descriptor.get = _;
|
|
17
|
+
if (_ = accept(result.set)) descriptor.set = _;
|
|
18
|
+
if (_ = accept(result.init)) initializers.unshift(_);
|
|
19
|
+
}
|
|
20
|
+
else if (_ = accept(result)) {
|
|
21
|
+
if (kind === "field") initializers.unshift(_);
|
|
22
|
+
else descriptor[key] = _;
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
if (target) Object.defineProperty(target, contextIn.name, descriptor);
|
|
26
|
+
done = true;
|
|
27
|
+
};
|
|
28
|
+
var __runInitializers = (this && this.__runInitializers) || function (thisArg, initializers, value) {
|
|
29
|
+
var useValue = arguments.length > 2;
|
|
30
|
+
for (var i = 0; i < initializers.length; i++) {
|
|
31
|
+
value = useValue ? initializers[i].call(thisArg, value) : initializers[i].call(thisArg);
|
|
32
|
+
}
|
|
33
|
+
return useValue ? value : void 0;
|
|
6
34
|
};
|
|
7
|
-
var AlarmSensorCCReport_1, AlarmSensorCCSupportedReport_1;
|
|
8
35
|
function __assertType(argName, typeName, boundHasError) {
|
|
9
36
|
const { ZWaveError, ZWaveErrorCodes } = require("@zwave-js/core");
|
|
10
37
|
if (boundHasError()) {
|
|
@@ -30,7 +57,7 @@ import { Bytes } from "@zwave-js/shared/safe";
|
|
|
30
57
|
import { getEnumMemberName, isEnumMember, pick } from "@zwave-js/shared/safe";
|
|
31
58
|
import { CCAPI, PhysicalCCAPI } from "../lib/API.js";
|
|
32
59
|
import { CommandClass, } from "../lib/CommandClass.js";
|
|
33
|
-
import { API, CCCommand,
|
|
60
|
+
import { API, CCCommand, ccValueProperty, ccValues, commandClass, expectedCCResponse, implementedVersion, } from "../lib/CommandClassDecorators.js";
|
|
34
61
|
import { V } from "../lib/Values.js";
|
|
35
62
|
import { AlarmSensorCommand, AlarmSensorType } from "../lib/_Types.js";
|
|
36
63
|
export const AlarmSensorCCValues = Object.freeze({
|
|
@@ -73,320 +100,391 @@ export const AlarmSensorCCValues = Object.freeze({
|
|
|
73
100
|
}),
|
|
74
101
|
});
|
|
75
102
|
// @noSetValueAPI This CC is read-only
|
|
76
|
-
let AlarmSensorCCAPI =
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
103
|
+
let AlarmSensorCCAPI = (() => {
|
|
104
|
+
let _classDecorators = [API(CommandClasses["Alarm Sensor"])];
|
|
105
|
+
let _classDescriptor;
|
|
106
|
+
let _classExtraInitializers = [];
|
|
107
|
+
let _classThis;
|
|
108
|
+
let _classSuper = PhysicalCCAPI;
|
|
109
|
+
var AlarmSensorCCAPI = class extends _classSuper {
|
|
110
|
+
static { _classThis = this; }
|
|
111
|
+
static {
|
|
112
|
+
const _metadata = typeof Symbol === "function" && Symbol.metadata ? Object.create(_classSuper[Symbol.metadata] ?? null) : void 0;
|
|
113
|
+
__esDecorate(null, _classDescriptor = { value: _classThis }, _classDecorators, { kind: "class", name: _classThis.name, metadata: _metadata }, null, _classExtraInitializers);
|
|
114
|
+
AlarmSensorCCAPI = _classThis = _classDescriptor.value;
|
|
115
|
+
if (_metadata) Object.defineProperty(_classThis, Symbol.metadata, { enumerable: true, configurable: true, writable: true, value: _metadata });
|
|
116
|
+
__runInitializers(_classThis, _classExtraInitializers);
|
|
82
117
|
}
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
async getSupportedSensorTypes() {
|
|
103
|
-
this.assertSupportsCommand(AlarmSensorCommand, AlarmSensorCommand.SupportedGet);
|
|
104
|
-
const cc = new AlarmSensorCCSupportedGet({
|
|
105
|
-
nodeId: this.endpoint.nodeId,
|
|
106
|
-
endpointIndex: this.endpoint.index,
|
|
107
|
-
});
|
|
108
|
-
const response = await this.host.sendCommand(cc, this.commandOptions);
|
|
109
|
-
if (response)
|
|
110
|
-
return response.supportedSensorTypes;
|
|
111
|
-
}
|
|
112
|
-
};
|
|
113
|
-
AlarmSensorCCAPI = __decorate([
|
|
114
|
-
API(CommandClasses["Alarm Sensor"])
|
|
115
|
-
], AlarmSensorCCAPI);
|
|
116
|
-
export { AlarmSensorCCAPI };
|
|
117
|
-
let AlarmSensorCC = class AlarmSensorCC extends CommandClass {
|
|
118
|
-
async interview(ctx) {
|
|
119
|
-
const node = this.getNode(ctx);
|
|
120
|
-
const endpoint = this.getEndpoint(ctx);
|
|
121
|
-
// Skip the interview in favor of Notification CC if possible
|
|
122
|
-
if (endpoint.supportsCC(CommandClasses.Notification)) {
|
|
123
|
-
ctx.logNode(node.id, {
|
|
124
|
-
endpoint: this.endpointIndex,
|
|
125
|
-
message: `${this.constructor.name}: skipping interview because Notification CC is supported...`,
|
|
126
|
-
direction: "none",
|
|
118
|
+
supportsCommand(cmd) {
|
|
119
|
+
switch (cmd) {
|
|
120
|
+
case AlarmSensorCommand.Get:
|
|
121
|
+
case AlarmSensorCommand.SupportedGet:
|
|
122
|
+
return true; // This is mandatory
|
|
123
|
+
}
|
|
124
|
+
return super.supportsCommand(cmd);
|
|
125
|
+
}
|
|
126
|
+
/**
|
|
127
|
+
* Retrieves the current value from this sensor
|
|
128
|
+
* @param sensorType The (optional) sensor type to retrieve the value for
|
|
129
|
+
*/
|
|
130
|
+
async get(sensorType) {
|
|
131
|
+
__assertType("sensorType", "(optional) AlarmSensorType", __assertType__optional_AlarmSensorType.bind(void 0, sensorType));
|
|
132
|
+
this.assertSupportsCommand(AlarmSensorCommand, AlarmSensorCommand.Get);
|
|
133
|
+
const cc = new AlarmSensorCCGet({
|
|
134
|
+
nodeId: this.endpoint.nodeId,
|
|
135
|
+
endpointIndex: this.endpoint.index,
|
|
136
|
+
sensorType,
|
|
127
137
|
});
|
|
128
|
-
this.
|
|
129
|
-
|
|
138
|
+
const response = await this.host.sendCommand(cc, this.commandOptions);
|
|
139
|
+
if (response)
|
|
140
|
+
return pick(response, ["state", "severity", "duration"]);
|
|
130
141
|
}
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
direction: "none",
|
|
138
|
-
});
|
|
139
|
-
// Find out which sensor types this sensor supports
|
|
140
|
-
ctx.logNode(node.id, {
|
|
141
|
-
endpoint: this.endpointIndex,
|
|
142
|
-
message: "querying supported sensor types...",
|
|
143
|
-
direction: "outbound",
|
|
144
|
-
});
|
|
145
|
-
const supportedSensorTypes = await api.getSupportedSensorTypes();
|
|
146
|
-
if (supportedSensorTypes) {
|
|
147
|
-
const logMessage = `received supported sensor types: ${supportedSensorTypes
|
|
148
|
-
.map((type) => getEnumMemberName(AlarmSensorType, type))
|
|
149
|
-
.map((name) => `\n· ${name}`)
|
|
150
|
-
.join("")}`;
|
|
151
|
-
ctx.logNode(node.id, {
|
|
152
|
-
endpoint: this.endpointIndex,
|
|
153
|
-
message: logMessage,
|
|
154
|
-
direction: "inbound",
|
|
142
|
+
// eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types
|
|
143
|
+
async getSupportedSensorTypes() {
|
|
144
|
+
this.assertSupportsCommand(AlarmSensorCommand, AlarmSensorCommand.SupportedGet);
|
|
145
|
+
const cc = new AlarmSensorCCSupportedGet({
|
|
146
|
+
nodeId: this.endpoint.nodeId,
|
|
147
|
+
endpointIndex: this.endpoint.index,
|
|
155
148
|
});
|
|
149
|
+
const response = await this.host.sendCommand(cc, this.commandOptions);
|
|
150
|
+
if (response)
|
|
151
|
+
return response.supportedSensorTypes;
|
|
152
|
+
}
|
|
153
|
+
};
|
|
154
|
+
return AlarmSensorCCAPI = _classThis;
|
|
155
|
+
})();
|
|
156
|
+
export { AlarmSensorCCAPI };
|
|
157
|
+
let AlarmSensorCC = (() => {
|
|
158
|
+
let _classDecorators = [commandClass(CommandClasses["Alarm Sensor"]), implementedVersion(1), ccValues(AlarmSensorCCValues)];
|
|
159
|
+
let _classDescriptor;
|
|
160
|
+
let _classExtraInitializers = [];
|
|
161
|
+
let _classThis;
|
|
162
|
+
let _classSuper = CommandClass;
|
|
163
|
+
var AlarmSensorCC = class extends _classSuper {
|
|
164
|
+
static { _classThis = this; }
|
|
165
|
+
static {
|
|
166
|
+
const _metadata = typeof Symbol === "function" && Symbol.metadata ? Object.create(_classSuper[Symbol.metadata] ?? null) : void 0;
|
|
167
|
+
__esDecorate(null, _classDescriptor = { value: _classThis }, _classDecorators, { kind: "class", name: _classThis.name, metadata: _metadata }, null, _classExtraInitializers);
|
|
168
|
+
AlarmSensorCC = _classThis = _classDescriptor.value;
|
|
169
|
+
if (_metadata) Object.defineProperty(_classThis, Symbol.metadata, { enumerable: true, configurable: true, writable: true, value: _metadata });
|
|
170
|
+
__runInitializers(_classThis, _classExtraInitializers);
|
|
156
171
|
}
|
|
157
|
-
|
|
172
|
+
async interview(ctx) {
|
|
173
|
+
const node = this.getNode(ctx);
|
|
174
|
+
const endpoint = this.getEndpoint(ctx);
|
|
175
|
+
// Skip the interview in favor of Notification CC if possible
|
|
176
|
+
if (endpoint.supportsCC(CommandClasses.Notification)) {
|
|
177
|
+
ctx.logNode(node.id, {
|
|
178
|
+
endpoint: this.endpointIndex,
|
|
179
|
+
message: `${this.constructor.name}: skipping interview because Notification CC is supported...`,
|
|
180
|
+
direction: "none",
|
|
181
|
+
});
|
|
182
|
+
this.setInterviewComplete(ctx, true);
|
|
183
|
+
return;
|
|
184
|
+
}
|
|
185
|
+
const api = CCAPI.create(CommandClasses["Alarm Sensor"], ctx, endpoint).withOptions({
|
|
186
|
+
priority: MessagePriority.NodeQuery,
|
|
187
|
+
});
|
|
158
188
|
ctx.logNode(node.id, {
|
|
159
189
|
endpoint: this.endpointIndex,
|
|
160
|
-
message:
|
|
161
|
-
|
|
190
|
+
message: `Interviewing ${this.ccName}...`,
|
|
191
|
+
direction: "none",
|
|
162
192
|
});
|
|
163
|
-
|
|
164
|
-
}
|
|
165
|
-
// Query (all of) the sensor's current value(s)
|
|
166
|
-
await this.refreshValues(ctx);
|
|
167
|
-
// Remember that the interview is complete
|
|
168
|
-
this.setInterviewComplete(ctx, true);
|
|
169
|
-
}
|
|
170
|
-
async refreshValues(ctx) {
|
|
171
|
-
const node = this.getNode(ctx);
|
|
172
|
-
const endpoint = this.getEndpoint(ctx);
|
|
173
|
-
const api = CCAPI.create(CommandClasses["Alarm Sensor"], ctx, endpoint).withOptions({
|
|
174
|
-
priority: MessagePriority.NodeQuery,
|
|
175
|
-
});
|
|
176
|
-
const supportedSensorTypes = this.getValue(ctx, AlarmSensorCCValues.supportedSensorTypes)
|
|
177
|
-
?? [];
|
|
178
|
-
// Always query (all of) the sensor's current value(s)
|
|
179
|
-
for (const type of supportedSensorTypes) {
|
|
180
|
-
// Some devices report invalid sensor types, but the CC API checks
|
|
181
|
-
// for valid values and throws otherwise.
|
|
182
|
-
if (!isEnumMember(AlarmSensorType, type))
|
|
183
|
-
continue;
|
|
184
|
-
const sensorName = getEnumMemberName(AlarmSensorType, type);
|
|
193
|
+
// Find out which sensor types this sensor supports
|
|
185
194
|
ctx.logNode(node.id, {
|
|
186
195
|
endpoint: this.endpointIndex,
|
|
187
|
-
message:
|
|
196
|
+
message: "querying supported sensor types...",
|
|
188
197
|
direction: "outbound",
|
|
189
198
|
});
|
|
190
|
-
const
|
|
191
|
-
if (
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
severity: ${currentValue.severity}`;
|
|
197
|
-
}
|
|
198
|
-
if (currentValue.duration != undefined) {
|
|
199
|
-
message += `
|
|
200
|
-
duration: ${currentValue.duration}`;
|
|
201
|
-
}
|
|
199
|
+
const supportedSensorTypes = await api.getSupportedSensorTypes();
|
|
200
|
+
if (supportedSensorTypes) {
|
|
201
|
+
const logMessage = `received supported sensor types: ${supportedSensorTypes
|
|
202
|
+
.map((type) => getEnumMemberName(AlarmSensorType, type))
|
|
203
|
+
.map((name) => `\n· ${name}`)
|
|
204
|
+
.join("")}`;
|
|
202
205
|
ctx.logNode(node.id, {
|
|
203
206
|
endpoint: this.endpointIndex,
|
|
204
|
-
message,
|
|
207
|
+
message: logMessage,
|
|
205
208
|
direction: "inbound",
|
|
206
209
|
});
|
|
207
210
|
}
|
|
211
|
+
else {
|
|
212
|
+
ctx.logNode(node.id, {
|
|
213
|
+
endpoint: this.endpointIndex,
|
|
214
|
+
message: "Querying supported sensor types timed out, skipping interview...",
|
|
215
|
+
level: "warn",
|
|
216
|
+
});
|
|
217
|
+
return;
|
|
218
|
+
}
|
|
219
|
+
// Query (all of) the sensor's current value(s)
|
|
220
|
+
await this.refreshValues(ctx);
|
|
221
|
+
// Remember that the interview is complete
|
|
222
|
+
this.setInterviewComplete(ctx, true);
|
|
208
223
|
}
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
};
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
224
|
+
async refreshValues(ctx) {
|
|
225
|
+
const node = this.getNode(ctx);
|
|
226
|
+
const endpoint = this.getEndpoint(ctx);
|
|
227
|
+
const api = CCAPI.create(CommandClasses["Alarm Sensor"], ctx, endpoint).withOptions({
|
|
228
|
+
priority: MessagePriority.NodeQuery,
|
|
229
|
+
});
|
|
230
|
+
const supportedSensorTypes = this.getValue(ctx, AlarmSensorCCValues.supportedSensorTypes)
|
|
231
|
+
?? [];
|
|
232
|
+
// Always query (all of) the sensor's current value(s)
|
|
233
|
+
for (const type of supportedSensorTypes) {
|
|
234
|
+
// Some devices report invalid sensor types, but the CC API checks
|
|
235
|
+
// for valid values and throws otherwise.
|
|
236
|
+
if (!isEnumMember(AlarmSensorType, type))
|
|
237
|
+
continue;
|
|
238
|
+
const sensorName = getEnumMemberName(AlarmSensorType, type);
|
|
239
|
+
ctx.logNode(node.id, {
|
|
240
|
+
endpoint: this.endpointIndex,
|
|
241
|
+
message: `querying current value for ${sensorName}...`,
|
|
242
|
+
direction: "outbound",
|
|
243
|
+
});
|
|
244
|
+
const currentValue = await api.get(type);
|
|
245
|
+
if (currentValue) {
|
|
246
|
+
let message = `received current value for ${sensorName}:
|
|
247
|
+
state: ${currentValue.state}`;
|
|
248
|
+
if (currentValue.severity != undefined) {
|
|
249
|
+
message += `
|
|
250
|
+
severity: ${currentValue.severity}`;
|
|
251
|
+
}
|
|
252
|
+
if (currentValue.duration != undefined) {
|
|
253
|
+
message += `
|
|
254
|
+
duration: ${currentValue.duration}`;
|
|
255
|
+
}
|
|
256
|
+
ctx.logNode(node.id, {
|
|
257
|
+
endpoint: this.endpointIndex,
|
|
258
|
+
message,
|
|
259
|
+
direction: "inbound",
|
|
260
|
+
});
|
|
261
|
+
}
|
|
262
|
+
}
|
|
263
|
+
}
|
|
264
|
+
/**
|
|
265
|
+
* Returns which sensor types are supported.
|
|
266
|
+
* This only works AFTER the interview process
|
|
267
|
+
*/
|
|
268
|
+
static getSupportedSensorTypesCached(ctx, endpoint) {
|
|
269
|
+
return ctx
|
|
270
|
+
.getValueDB(endpoint.nodeId)
|
|
271
|
+
.getValue(AlarmSensorCCValues.supportedSensorTypes.endpoint(endpoint.index));
|
|
272
|
+
}
|
|
273
|
+
createMetadataForSensorType(ctx, sensorType) {
|
|
274
|
+
const stateValue = AlarmSensorCCValues.state(sensorType);
|
|
275
|
+
const severityValue = AlarmSensorCCValues.severity(sensorType);
|
|
276
|
+
const durationValue = AlarmSensorCCValues.duration(sensorType);
|
|
277
|
+
// Always create metadata if it does not exist
|
|
278
|
+
this.ensureMetadata(ctx, stateValue);
|
|
279
|
+
this.ensureMetadata(ctx, severityValue);
|
|
280
|
+
this.ensureMetadata(ctx, durationValue);
|
|
281
|
+
}
|
|
282
|
+
};
|
|
283
|
+
return AlarmSensorCC = _classThis;
|
|
284
|
+
})();
|
|
234
285
|
export { AlarmSensorCC };
|
|
235
|
-
let AlarmSensorCCReport =
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
const state = raw.payload[2] > 0;
|
|
250
|
-
// Severity only ranges from 1 to 100
|
|
251
|
-
let severity;
|
|
252
|
-
if (raw.payload[2] > 0 && raw.payload[2] <= 0x64) {
|
|
253
|
-
severity = raw.payload[2];
|
|
286
|
+
let AlarmSensorCCReport = (() => {
|
|
287
|
+
let _classDecorators = [CCCommand(AlarmSensorCommand.Report)];
|
|
288
|
+
let _classDescriptor;
|
|
289
|
+
let _classExtraInitializers = [];
|
|
290
|
+
let _classThis;
|
|
291
|
+
let _classSuper = AlarmSensorCC;
|
|
292
|
+
var AlarmSensorCCReport = class extends _classSuper {
|
|
293
|
+
static { _classThis = this; }
|
|
294
|
+
static {
|
|
295
|
+
const _metadata = typeof Symbol === "function" && Symbol.metadata ? Object.create(_classSuper[Symbol.metadata] ?? null) : void 0;
|
|
296
|
+
__esDecorate(null, _classDescriptor = { value: _classThis }, _classDecorators, { kind: "class", name: _classThis.name, metadata: _metadata }, null, _classExtraInitializers);
|
|
297
|
+
AlarmSensorCCReport = _classThis = _classDescriptor.value;
|
|
298
|
+
if (_metadata) Object.defineProperty(_classThis, Symbol.metadata, { enumerable: true, configurable: true, writable: true, value: _metadata });
|
|
299
|
+
__runInitializers(_classThis, _classExtraInitializers);
|
|
254
300
|
}
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
state,
|
|
263
|
-
severity,
|
|
264
|
-
duration,
|
|
265
|
-
});
|
|
266
|
-
}
|
|
267
|
-
sensorType;
|
|
268
|
-
state;
|
|
269
|
-
severity;
|
|
270
|
-
duration;
|
|
271
|
-
toLogEntry(ctx) {
|
|
272
|
-
const message = {
|
|
273
|
-
"sensor type": getEnumMemberName(AlarmSensorType, this.sensorType),
|
|
274
|
-
"alarm state": this.state,
|
|
275
|
-
};
|
|
276
|
-
if (this.severity != undefined) {
|
|
277
|
-
message.severity = this.severity;
|
|
301
|
+
constructor(options) {
|
|
302
|
+
super(options);
|
|
303
|
+
// TODO: Check implementation:
|
|
304
|
+
this.sensorType = options.sensorType;
|
|
305
|
+
this.state = options.state;
|
|
306
|
+
this.severity = options.severity;
|
|
307
|
+
this.duration = options.duration;
|
|
278
308
|
}
|
|
279
|
-
|
|
280
|
-
|
|
309
|
+
static from(raw, ctx) {
|
|
310
|
+
validatePayload(raw.payload.length >= 5, raw.payload[1] !== 0xff);
|
|
311
|
+
const sourceNodeId = raw.payload[0];
|
|
312
|
+
const sensorType = raw.payload[1];
|
|
313
|
+
// Any positive value gets interpreted as alarm
|
|
314
|
+
const state = raw.payload[2] > 0;
|
|
315
|
+
// Severity only ranges from 1 to 100
|
|
316
|
+
let severity;
|
|
317
|
+
if (raw.payload[2] > 0 && raw.payload[2] <= 0x64) {
|
|
318
|
+
severity = raw.payload[2];
|
|
319
|
+
}
|
|
320
|
+
// ignore zero durations
|
|
321
|
+
const duration = raw.payload.readUInt16BE(3) || undefined;
|
|
322
|
+
return new this({
|
|
323
|
+
// Alarm Sensor reports may be forwarded by a different node, in this case
|
|
324
|
+
// (and only then!) the payload contains the original node ID
|
|
325
|
+
nodeId: sourceNodeId || ctx.sourceNodeId,
|
|
326
|
+
sensorType,
|
|
327
|
+
state,
|
|
328
|
+
severity,
|
|
329
|
+
duration,
|
|
330
|
+
});
|
|
281
331
|
}
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
};
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
332
|
+
sensorType;
|
|
333
|
+
state;
|
|
334
|
+
severity;
|
|
335
|
+
duration;
|
|
336
|
+
toLogEntry(ctx) {
|
|
337
|
+
const message = {
|
|
338
|
+
"sensor type": getEnumMemberName(AlarmSensorType, this.sensorType),
|
|
339
|
+
"alarm state": this.state,
|
|
340
|
+
};
|
|
341
|
+
if (this.severity != undefined) {
|
|
342
|
+
message.severity = this.severity;
|
|
343
|
+
}
|
|
344
|
+
if (this.duration != undefined) {
|
|
345
|
+
message.duration = `${this.duration} seconds`;
|
|
346
|
+
}
|
|
347
|
+
return {
|
|
348
|
+
...super.toLogEntry(ctx),
|
|
349
|
+
message,
|
|
350
|
+
};
|
|
351
|
+
}
|
|
352
|
+
persistValues(ctx) {
|
|
353
|
+
if (!super.persistValues(ctx))
|
|
354
|
+
return false;
|
|
355
|
+
// Create metadata if it does not exist
|
|
356
|
+
this.createMetadataForSensorType(ctx, this.sensorType);
|
|
357
|
+
const stateValue = AlarmSensorCCValues.state(this.sensorType);
|
|
358
|
+
const severityValue = AlarmSensorCCValues.severity(this.sensorType);
|
|
359
|
+
const durationValue = AlarmSensorCCValues.duration(this.sensorType);
|
|
360
|
+
this.setValue(ctx, stateValue, this.state);
|
|
361
|
+
this.setValue(ctx, severityValue, this.severity);
|
|
362
|
+
this.setValue(ctx, durationValue, this.duration);
|
|
363
|
+
return true;
|
|
364
|
+
}
|
|
365
|
+
};
|
|
366
|
+
return AlarmSensorCCReport = _classThis;
|
|
367
|
+
})();
|
|
304
368
|
export { AlarmSensorCCReport };
|
|
305
369
|
function testResponseForAlarmSensorGet(sent, received) {
|
|
306
370
|
// We expect a Alarm Sensor Report that matches the requested sensor type (if a type was requested)
|
|
307
371
|
return (sent.sensorType === AlarmSensorType.Any
|
|
308
372
|
|| received.sensorType === sent.sensorType);
|
|
309
373
|
}
|
|
310
|
-
let AlarmSensorCCGet =
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
}
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
374
|
+
let AlarmSensorCCGet = (() => {
|
|
375
|
+
let _classDecorators = [CCCommand(AlarmSensorCommand.Get), expectedCCResponse(AlarmSensorCCReport, testResponseForAlarmSensorGet)];
|
|
376
|
+
let _classDescriptor;
|
|
377
|
+
let _classExtraInitializers = [];
|
|
378
|
+
let _classThis;
|
|
379
|
+
let _classSuper = AlarmSensorCC;
|
|
380
|
+
var AlarmSensorCCGet = class extends _classSuper {
|
|
381
|
+
static { _classThis = this; }
|
|
382
|
+
static {
|
|
383
|
+
const _metadata = typeof Symbol === "function" && Symbol.metadata ? Object.create(_classSuper[Symbol.metadata] ?? null) : void 0;
|
|
384
|
+
__esDecorate(null, _classDescriptor = { value: _classThis }, _classDecorators, { kind: "class", name: _classThis.name, metadata: _metadata }, null, _classExtraInitializers);
|
|
385
|
+
AlarmSensorCCGet = _classThis = _classDescriptor.value;
|
|
386
|
+
if (_metadata) Object.defineProperty(_classThis, Symbol.metadata, { enumerable: true, configurable: true, writable: true, value: _metadata });
|
|
387
|
+
__runInitializers(_classThis, _classExtraInitializers);
|
|
388
|
+
}
|
|
389
|
+
constructor(options) {
|
|
390
|
+
super(options);
|
|
391
|
+
this.sensorType = options.sensorType ?? AlarmSensorType.Any;
|
|
392
|
+
}
|
|
393
|
+
static from(_raw, _ctx) {
|
|
394
|
+
// TODO: Deserialize payload
|
|
395
|
+
throw new ZWaveError(`${this.name}: deserialization not implemented`, ZWaveErrorCodes.Deserialization_NotImplemented);
|
|
396
|
+
// return new AlarmSensorCCGet({
|
|
397
|
+
// nodeId: ctx.sourceNodeId,
|
|
398
|
+
// });
|
|
399
|
+
}
|
|
400
|
+
sensorType;
|
|
401
|
+
serialize(ctx) {
|
|
402
|
+
this.payload = Bytes.from([this.sensorType]);
|
|
403
|
+
return super.serialize(ctx);
|
|
404
|
+
}
|
|
405
|
+
toLogEntry(ctx) {
|
|
406
|
+
return {
|
|
407
|
+
...super.toLogEntry(ctx),
|
|
408
|
+
message: {
|
|
409
|
+
"sensor type": getEnumMemberName(AlarmSensorType, this.sensorType),
|
|
410
|
+
},
|
|
411
|
+
};
|
|
412
|
+
}
|
|
413
|
+
};
|
|
414
|
+
return AlarmSensorCCGet = _classThis;
|
|
415
|
+
})();
|
|
340
416
|
export { AlarmSensorCCGet };
|
|
341
|
-
let AlarmSensorCCSupportedReport =
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
});
|
|
356
|
-
}
|
|
357
|
-
supportedSensorTypes;
|
|
358
|
-
persistValues(ctx) {
|
|
359
|
-
if (!super.persistValues(ctx))
|
|
360
|
-
return false;
|
|
361
|
-
// Create metadata for each sensor type
|
|
362
|
-
for (const type of this.supportedSensorTypes) {
|
|
363
|
-
this.createMetadataForSensorType(ctx, type);
|
|
417
|
+
let AlarmSensorCCSupportedReport = (() => {
|
|
418
|
+
let _classDecorators = [CCCommand(AlarmSensorCommand.SupportedReport), ccValueProperty("supportedSensorTypes", AlarmSensorCCValues.supportedSensorTypes)];
|
|
419
|
+
let _classDescriptor;
|
|
420
|
+
let _classExtraInitializers = [];
|
|
421
|
+
let _classThis;
|
|
422
|
+
let _classSuper = AlarmSensorCC;
|
|
423
|
+
var AlarmSensorCCSupportedReport = class extends _classSuper {
|
|
424
|
+
static { _classThis = this; }
|
|
425
|
+
static {
|
|
426
|
+
const _metadata = typeof Symbol === "function" && Symbol.metadata ? Object.create(_classSuper[Symbol.metadata] ?? null) : void 0;
|
|
427
|
+
__esDecorate(null, _classDescriptor = { value: _classThis }, _classDecorators, { kind: "class", name: _classThis.name, metadata: _metadata }, null, _classExtraInitializers);
|
|
428
|
+
AlarmSensorCCSupportedReport = _classThis = _classDescriptor.value;
|
|
429
|
+
if (_metadata) Object.defineProperty(_classThis, Symbol.metadata, { enumerable: true, configurable: true, writable: true, value: _metadata });
|
|
430
|
+
__runInitializers(_classThis, _classExtraInitializers);
|
|
364
431
|
}
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
|
|
383
|
-
|
|
432
|
+
constructor(options) {
|
|
433
|
+
super(options);
|
|
434
|
+
// TODO: Check implementation:
|
|
435
|
+
this.supportedSensorTypes = options.supportedSensorTypes;
|
|
436
|
+
}
|
|
437
|
+
static from(raw, ctx) {
|
|
438
|
+
validatePayload(raw.payload.length >= 1);
|
|
439
|
+
const bitMaskLength = raw.payload[0];
|
|
440
|
+
validatePayload(raw.payload.length >= 1 + bitMaskLength);
|
|
441
|
+
const supportedSensorTypes = parseBitMask(raw.payload.subarray(1, 1 + bitMaskLength), AlarmSensorType["General Purpose"]);
|
|
442
|
+
return new this({
|
|
443
|
+
nodeId: ctx.sourceNodeId,
|
|
444
|
+
supportedSensorTypes,
|
|
445
|
+
});
|
|
446
|
+
}
|
|
447
|
+
supportedSensorTypes;
|
|
448
|
+
persistValues(ctx) {
|
|
449
|
+
if (!super.persistValues(ctx))
|
|
450
|
+
return false;
|
|
451
|
+
// Create metadata for each sensor type
|
|
452
|
+
for (const type of this.supportedSensorTypes) {
|
|
453
|
+
this.createMetadataForSensorType(ctx, type);
|
|
454
|
+
}
|
|
455
|
+
return true;
|
|
456
|
+
}
|
|
457
|
+
toLogEntry(ctx) {
|
|
458
|
+
return {
|
|
459
|
+
...super.toLogEntry(ctx),
|
|
460
|
+
message: {
|
|
461
|
+
"supported sensor types": this.supportedSensorTypes
|
|
462
|
+
.map((t) => getEnumMemberName(AlarmSensorType, t))
|
|
463
|
+
.join(", "),
|
|
464
|
+
},
|
|
465
|
+
};
|
|
466
|
+
}
|
|
467
|
+
};
|
|
468
|
+
return AlarmSensorCCSupportedReport = _classThis;
|
|
469
|
+
})();
|
|
384
470
|
export { AlarmSensorCCSupportedReport };
|
|
385
|
-
let AlarmSensorCCSupportedGet =
|
|
386
|
-
|
|
387
|
-
|
|
388
|
-
|
|
389
|
-
|
|
390
|
-
|
|
471
|
+
let AlarmSensorCCSupportedGet = (() => {
|
|
472
|
+
let _classDecorators = [CCCommand(AlarmSensorCommand.SupportedGet), expectedCCResponse(AlarmSensorCCSupportedReport)];
|
|
473
|
+
let _classDescriptor;
|
|
474
|
+
let _classExtraInitializers = [];
|
|
475
|
+
let _classThis;
|
|
476
|
+
let _classSuper = AlarmSensorCC;
|
|
477
|
+
var AlarmSensorCCSupportedGet = class extends _classSuper {
|
|
478
|
+
static { _classThis = this; }
|
|
479
|
+
static {
|
|
480
|
+
const _metadata = typeof Symbol === "function" && Symbol.metadata ? Object.create(_classSuper[Symbol.metadata] ?? null) : void 0;
|
|
481
|
+
__esDecorate(null, _classDescriptor = { value: _classThis }, _classDecorators, { kind: "class", name: _classThis.name, metadata: _metadata }, null, _classExtraInitializers);
|
|
482
|
+
AlarmSensorCCSupportedGet = _classThis = _classDescriptor.value;
|
|
483
|
+
if (_metadata) Object.defineProperty(_classThis, Symbol.metadata, { enumerable: true, configurable: true, writable: true, value: _metadata });
|
|
484
|
+
__runInitializers(_classThis, _classExtraInitializers);
|
|
485
|
+
}
|
|
486
|
+
};
|
|
487
|
+
return AlarmSensorCCSupportedGet = _classThis;
|
|
488
|
+
})();
|
|
391
489
|
export { AlarmSensorCCSupportedGet };
|
|
392
490
|
//# sourceMappingURL=AlarmSensorCC.js.map
|