@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 MultilevelSensorCCReport_1, MultilevelSensorCCGet_1, MultilevelSensorCCSupportedSensorReport_1, MultilevelSensorCCSupportedScaleReport_1, MultilevelSensorCCGetSupportedScale_1;
|
|
8
35
|
function __assertType(argName, typeName, boundHasError) {
|
|
9
36
|
const { ZWaveError, ZWaveErrorCodes } = require("@zwave-js/core");
|
|
10
37
|
if (boundHasError()) {
|
|
@@ -84,7 +111,7 @@ import { Bytes } from "@zwave-js/shared/safe";
|
|
|
84
111
|
import { num2hex } from "@zwave-js/shared/safe";
|
|
85
112
|
import { CCAPI, POLL_VALUE, PhysicalCCAPI, throwUnsupportedProperty, } from "../lib/API.js";
|
|
86
113
|
import { CommandClass, getEffectiveCCVersion, } from "../lib/CommandClass.js";
|
|
87
|
-
import { API, CCCommand,
|
|
114
|
+
import { API, CCCommand, ccValueProperty, ccValues, commandClass, expectedCCResponse, implementedVersion, useSupervision, } from "../lib/CommandClassDecorators.js";
|
|
88
115
|
import { V } from "../lib/Values.js";
|
|
89
116
|
import { MultilevelSensorCommand, } from "../lib/_Types.js";
|
|
90
117
|
export const MultilevelSensorCCValues = Object.freeze({
|
|
@@ -193,172 +220,170 @@ function getPreferredSensorScale(ctx, nodeId, endpointIndex, sensorType, support
|
|
|
193
220
|
}
|
|
194
221
|
}
|
|
195
222
|
// @noSetValueAPI This CC is read-only
|
|
196
|
-
let MultilevelSensorCCAPI =
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
throwUnsupportedProperty(this.ccId, property);
|
|
223
|
+
let MultilevelSensorCCAPI = (() => {
|
|
224
|
+
let _classDecorators = [API(CommandClasses["Multilevel Sensor"])];
|
|
225
|
+
let _classDescriptor;
|
|
226
|
+
let _classExtraInitializers = [];
|
|
227
|
+
let _classThis;
|
|
228
|
+
let _classSuper = PhysicalCCAPI;
|
|
229
|
+
var MultilevelSensorCCAPI = class extends _classSuper {
|
|
230
|
+
static { _classThis = this; }
|
|
231
|
+
static {
|
|
232
|
+
const _metadata = typeof Symbol === "function" && Symbol.metadata ? Object.create(_classSuper[Symbol.metadata] ?? null) : void 0;
|
|
233
|
+
__esDecorate(null, _classDescriptor = { value: _classThis }, _classDecorators, { kind: "class", name: _classThis.name, metadata: _metadata }, null, _classExtraInitializers);
|
|
234
|
+
MultilevelSensorCCAPI = _classThis = _classDescriptor.value;
|
|
235
|
+
if (_metadata) Object.defineProperty(_classThis, Symbol.metadata, { enumerable: true, configurable: true, writable: true, value: _metadata });
|
|
236
|
+
__runInitializers(_classThis, _classExtraInitializers);
|
|
237
|
+
}
|
|
238
|
+
supportsCommand(cmd) {
|
|
239
|
+
switch (cmd) {
|
|
240
|
+
case MultilevelSensorCommand.Get:
|
|
241
|
+
case MultilevelSensorCommand.Report:
|
|
242
|
+
return true; // This is mandatory
|
|
243
|
+
case MultilevelSensorCommand.GetSupportedSensor:
|
|
244
|
+
case MultilevelSensorCommand.GetSupportedScale:
|
|
245
|
+
return this.version >= 5;
|
|
220
246
|
}
|
|
221
|
-
|
|
222
|
-
return this.get(sensorType, scale);
|
|
223
|
-
};
|
|
224
|
-
}
|
|
225
|
-
async get(sensorType, scale) {
|
|
226
|
-
__assertType("sensorType", "(optional) number", __assertType__optional_number.bind(void 0, sensorType));
|
|
227
|
-
__assertType("scale", "(optional) number", __assertType__optional_number.bind(void 0, scale));
|
|
228
|
-
this.assertSupportsCommand(MultilevelSensorCommand, MultilevelSensorCommand.Get);
|
|
229
|
-
// Figure out the preferred scale if none was given
|
|
230
|
-
let preferredScale;
|
|
231
|
-
if (sensorType != undefined && scale == undefined) {
|
|
232
|
-
const supportedScales = this.tryGetValueDB()?.getValue({
|
|
233
|
-
commandClass: this.ccId,
|
|
234
|
-
endpoint: this.endpoint.index,
|
|
235
|
-
property: "supportedScales",
|
|
236
|
-
propertyKey: sensorType,
|
|
237
|
-
}) ?? [];
|
|
238
|
-
preferredScale = getPreferredSensorScale(this.host, this.endpoint.nodeId, this.endpoint.index, sensorType, supportedScales);
|
|
239
|
-
}
|
|
240
|
-
const cc = new MultilevelSensorCCGet({
|
|
241
|
-
nodeId: this.endpoint.nodeId,
|
|
242
|
-
endpointIndex: this.endpoint.index,
|
|
243
|
-
sensorType: sensorType,
|
|
244
|
-
scale: (scale ?? preferredScale),
|
|
245
|
-
});
|
|
246
|
-
const response = await this.host.sendCommand(cc, this.commandOptions);
|
|
247
|
-
if (!response)
|
|
248
|
-
return;
|
|
249
|
-
const responseScale = getSensorScale(response.type, response.scale);
|
|
250
|
-
if (sensorType == undefined) {
|
|
251
|
-
// Overload #1: return the full response
|
|
252
|
-
return {
|
|
253
|
-
type: response.type,
|
|
254
|
-
value: response.value,
|
|
255
|
-
scale: responseScale,
|
|
256
|
-
};
|
|
247
|
+
return super.supportsCommand(cmd);
|
|
257
248
|
}
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
249
|
+
get [POLL_VALUE]() {
|
|
250
|
+
return async function ({ property }) {
|
|
251
|
+
// Look up the necessary information
|
|
252
|
+
const valueId = {
|
|
253
|
+
commandClass: CommandClasses["Multilevel Sensor"],
|
|
254
|
+
endpoint: this.endpoint.index,
|
|
255
|
+
property,
|
|
256
|
+
};
|
|
257
|
+
const ccSpecific = this.tryGetValueDB()?.getMetadata(valueId)
|
|
258
|
+
?.ccSpecific;
|
|
259
|
+
if (!ccSpecific) {
|
|
260
|
+
throwUnsupportedProperty(this.ccId, property);
|
|
261
|
+
}
|
|
262
|
+
const { sensorType, scale } = ccSpecific;
|
|
263
|
+
return this.get(sensorType, scale);
|
|
263
264
|
};
|
|
264
265
|
}
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
266
|
+
async get(sensorType, scale) {
|
|
267
|
+
__assertType("sensorType", "(optional) number", __assertType__optional_number.bind(void 0, sensorType));
|
|
268
|
+
__assertType("scale", "(optional) number", __assertType__optional_number.bind(void 0, scale));
|
|
269
|
+
this.assertSupportsCommand(MultilevelSensorCommand, MultilevelSensorCommand.Get);
|
|
270
|
+
// Figure out the preferred scale if none was given
|
|
271
|
+
let preferredScale;
|
|
272
|
+
if (sensorType != undefined && scale == undefined) {
|
|
273
|
+
const supportedScales = this.tryGetValueDB()?.getValue({
|
|
274
|
+
commandClass: this.ccId,
|
|
275
|
+
endpoint: this.endpoint.index,
|
|
276
|
+
property: "supportedScales",
|
|
277
|
+
propertyKey: sensorType,
|
|
278
|
+
}) ?? [];
|
|
279
|
+
preferredScale = getPreferredSensorScale(this.host, this.endpoint.nodeId, this.endpoint.index, sensorType, supportedScales);
|
|
280
|
+
}
|
|
281
|
+
const cc = new MultilevelSensorCCGet({
|
|
282
|
+
nodeId: this.endpoint.nodeId,
|
|
283
|
+
endpointIndex: this.endpoint.index,
|
|
284
|
+
sensorType: sensorType,
|
|
285
|
+
scale: (scale ?? preferredScale),
|
|
286
|
+
});
|
|
287
|
+
const response = await this.host.sendCommand(cc, this.commandOptions);
|
|
288
|
+
if (!response)
|
|
289
|
+
return;
|
|
290
|
+
const responseScale = getSensorScale(response.type, response.scale);
|
|
291
|
+
if (sensorType == undefined) {
|
|
292
|
+
// Overload #1: return the full response
|
|
293
|
+
return {
|
|
294
|
+
type: response.type,
|
|
295
|
+
value: response.value,
|
|
296
|
+
scale: responseScale,
|
|
297
|
+
};
|
|
298
|
+
}
|
|
299
|
+
else if (scale == undefined) {
|
|
300
|
+
// Overload #2: return value and scale
|
|
301
|
+
return {
|
|
302
|
+
value: response.value,
|
|
303
|
+
scale: responseScale,
|
|
304
|
+
};
|
|
305
|
+
}
|
|
306
|
+
else {
|
|
307
|
+
// Overload #3: return only the value
|
|
308
|
+
return response.value;
|
|
309
|
+
}
|
|
268
310
|
}
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
}
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
API(CommandClasses["Multilevel Sensor"])
|
|
307
|
-
], MultilevelSensorCCAPI);
|
|
311
|
+
async getSupportedSensorTypes() {
|
|
312
|
+
this.assertSupportsCommand(MultilevelSensorCommand, MultilevelSensorCommand.GetSupportedSensor);
|
|
313
|
+
const cc = new MultilevelSensorCCGetSupportedSensor({
|
|
314
|
+
nodeId: this.endpoint.nodeId,
|
|
315
|
+
endpointIndex: this.endpoint.index,
|
|
316
|
+
});
|
|
317
|
+
const response = await this.host.sendCommand(cc, this.commandOptions);
|
|
318
|
+
return response?.supportedSensorTypes;
|
|
319
|
+
}
|
|
320
|
+
async getSupportedScales(sensorType) {
|
|
321
|
+
__assertType("sensorType", "number", __assertType__number.bind(void 0, sensorType));
|
|
322
|
+
this.assertSupportsCommand(MultilevelSensorCommand, MultilevelSensorCommand.GetSupportedScale);
|
|
323
|
+
const cc = new MultilevelSensorCCGetSupportedScale({
|
|
324
|
+
nodeId: this.endpoint.nodeId,
|
|
325
|
+
endpointIndex: this.endpoint.index,
|
|
326
|
+
sensorType,
|
|
327
|
+
});
|
|
328
|
+
const response = await this.host.sendCommand(cc, this.commandOptions);
|
|
329
|
+
return response?.supportedScales;
|
|
330
|
+
}
|
|
331
|
+
async sendReport(sensorType, scale, value) {
|
|
332
|
+
__assertType("sensorType", "number", __assertType__number.bind(void 0, sensorType));
|
|
333
|
+
__assertType("scale", undefined, __assertType__su__number__2_eu.bind(void 0, scale));
|
|
334
|
+
__assertType("value", "number", __assertType__number.bind(void 0, value));
|
|
335
|
+
this.assertSupportsCommand(MultilevelSensorCommand, MultilevelSensorCommand.Report);
|
|
336
|
+
const cc = new MultilevelSensorCCReport({
|
|
337
|
+
nodeId: this.endpoint.nodeId,
|
|
338
|
+
endpointIndex: this.endpoint.index,
|
|
339
|
+
type: sensorType,
|
|
340
|
+
scale,
|
|
341
|
+
value,
|
|
342
|
+
});
|
|
343
|
+
return this.host.sendCommand(cc, this.commandOptions);
|
|
344
|
+
}
|
|
345
|
+
};
|
|
346
|
+
return MultilevelSensorCCAPI = _classThis;
|
|
347
|
+
})();
|
|
308
348
|
export { MultilevelSensorCCAPI };
|
|
309
|
-
let MultilevelSensorCC =
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
349
|
+
let MultilevelSensorCC = (() => {
|
|
350
|
+
let _classDecorators = [commandClass(CommandClasses["Multilevel Sensor"]), implementedVersion(11), ccValues(MultilevelSensorCCValues)];
|
|
351
|
+
let _classDescriptor;
|
|
352
|
+
let _classExtraInitializers = [];
|
|
353
|
+
let _classThis;
|
|
354
|
+
let _classSuper = CommandClass;
|
|
355
|
+
var MultilevelSensorCC = class extends _classSuper {
|
|
356
|
+
static { _classThis = this; }
|
|
357
|
+
static {
|
|
358
|
+
const _metadata = typeof Symbol === "function" && Symbol.metadata ? Object.create(_classSuper[Symbol.metadata] ?? null) : void 0;
|
|
359
|
+
__esDecorate(null, _classDescriptor = { value: _classThis }, _classDecorators, { kind: "class", name: _classThis.name, metadata: _metadata }, null, _classExtraInitializers);
|
|
360
|
+
MultilevelSensorCC = _classThis = _classDescriptor.value;
|
|
361
|
+
if (_metadata) Object.defineProperty(_classThis, Symbol.metadata, { enumerable: true, configurable: true, writable: true, value: _metadata });
|
|
362
|
+
__runInitializers(_classThis, _classExtraInitializers);
|
|
363
|
+
}
|
|
364
|
+
async interview(ctx) {
|
|
365
|
+
const node = this.getNode(ctx);
|
|
366
|
+
const endpoint = this.getEndpoint(ctx);
|
|
367
|
+
const api = CCAPI.create(CommandClasses["Multilevel Sensor"], ctx, endpoint).withOptions({
|
|
368
|
+
priority: MessagePriority.NodeQuery,
|
|
369
|
+
});
|
|
323
370
|
ctx.logNode(node.id, {
|
|
324
371
|
endpoint: this.endpointIndex,
|
|
325
|
-
message:
|
|
326
|
-
direction: "
|
|
372
|
+
message: `Interviewing ${this.ccName}...`,
|
|
373
|
+
direction: "none",
|
|
327
374
|
});
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
const logMessage = "received supported sensor types:\n"
|
|
331
|
-
+ sensorTypes
|
|
332
|
-
.map((t) => getSensorName(t))
|
|
333
|
-
.map((name) => `· ${name}`)
|
|
334
|
-
.join("\n");
|
|
375
|
+
if (api.version >= 5) {
|
|
376
|
+
// Query the supported sensor types
|
|
335
377
|
ctx.logNode(node.id, {
|
|
336
378
|
endpoint: this.endpointIndex,
|
|
337
|
-
message:
|
|
338
|
-
direction: "inbound",
|
|
339
|
-
});
|
|
340
|
-
}
|
|
341
|
-
else {
|
|
342
|
-
ctx.logNode(node.id, {
|
|
343
|
-
endpoint: this.endpointIndex,
|
|
344
|
-
message: "Querying supported sensor types timed out, skipping interview...",
|
|
345
|
-
level: "warn",
|
|
346
|
-
});
|
|
347
|
-
return;
|
|
348
|
-
}
|
|
349
|
-
// As well as the supported scales for each sensor
|
|
350
|
-
for (const type of sensorTypes) {
|
|
351
|
-
ctx.logNode(node.id, {
|
|
352
|
-
endpoint: this.endpointIndex,
|
|
353
|
-
message: `querying supported scales for ${getSensorName(type)} sensor`,
|
|
379
|
+
message: "retrieving supported sensor types...",
|
|
354
380
|
direction: "outbound",
|
|
355
381
|
});
|
|
356
|
-
const
|
|
357
|
-
if (
|
|
358
|
-
const logMessage = "received supported
|
|
359
|
-
+
|
|
360
|
-
.map((
|
|
361
|
-
?? getUnknownScale(s)).label)
|
|
382
|
+
const sensorTypes = await api.getSupportedSensorTypes();
|
|
383
|
+
if (sensorTypes) {
|
|
384
|
+
const logMessage = "received supported sensor types:\n"
|
|
385
|
+
+ sensorTypes
|
|
386
|
+
.map((t) => getSensorName(t))
|
|
362
387
|
.map((name) => `· ${name}`)
|
|
363
388
|
.join("\n");
|
|
364
389
|
ctx.logNode(node.id, {
|
|
@@ -370,60 +395,66 @@ let MultilevelSensorCC = class MultilevelSensorCC extends CommandClass {
|
|
|
370
395
|
else {
|
|
371
396
|
ctx.logNode(node.id, {
|
|
372
397
|
endpoint: this.endpointIndex,
|
|
373
|
-
message: "Querying supported
|
|
398
|
+
message: "Querying supported sensor types timed out, skipping interview...",
|
|
374
399
|
level: "warn",
|
|
375
400
|
});
|
|
376
401
|
return;
|
|
377
402
|
}
|
|
403
|
+
// As well as the supported scales for each sensor
|
|
404
|
+
for (const type of sensorTypes) {
|
|
405
|
+
ctx.logNode(node.id, {
|
|
406
|
+
endpoint: this.endpointIndex,
|
|
407
|
+
message: `querying supported scales for ${getSensorName(type)} sensor`,
|
|
408
|
+
direction: "outbound",
|
|
409
|
+
});
|
|
410
|
+
const sensorScales = await api.getSupportedScales(type);
|
|
411
|
+
if (sensorScales) {
|
|
412
|
+
const logMessage = "received supported scales:\n"
|
|
413
|
+
+ sensorScales
|
|
414
|
+
.map((s) => (getSensorScale(type, s)
|
|
415
|
+
?? getUnknownScale(s)).label)
|
|
416
|
+
.map((name) => `· ${name}`)
|
|
417
|
+
.join("\n");
|
|
418
|
+
ctx.logNode(node.id, {
|
|
419
|
+
endpoint: this.endpointIndex,
|
|
420
|
+
message: logMessage,
|
|
421
|
+
direction: "inbound",
|
|
422
|
+
});
|
|
423
|
+
}
|
|
424
|
+
else {
|
|
425
|
+
ctx.logNode(node.id, {
|
|
426
|
+
endpoint: this.endpointIndex,
|
|
427
|
+
message: "Querying supported scales timed out, skipping interview...",
|
|
428
|
+
level: "warn",
|
|
429
|
+
});
|
|
430
|
+
return;
|
|
431
|
+
}
|
|
432
|
+
}
|
|
378
433
|
}
|
|
434
|
+
await this.refreshValues(ctx);
|
|
435
|
+
// Remember that the interview is complete
|
|
436
|
+
this.setInterviewComplete(ctx, true);
|
|
379
437
|
}
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
|
|
383
|
-
|
|
384
|
-
|
|
385
|
-
const node = this.getNode(ctx);
|
|
386
|
-
const endpoint = this.getEndpoint(ctx);
|
|
387
|
-
const api = CCAPI.create(CommandClasses["Multilevel Sensor"], ctx, endpoint).withOptions({
|
|
388
|
-
priority: MessagePriority.NodeQuery,
|
|
389
|
-
});
|
|
390
|
-
const valueDB = this.getValueDB(ctx);
|
|
391
|
-
if (api.version <= 4) {
|
|
392
|
-
// Sensors up to V4 only support a single value
|
|
393
|
-
ctx.logNode(node.id, {
|
|
394
|
-
endpoint: this.endpointIndex,
|
|
395
|
-
message: "querying current sensor reading...",
|
|
396
|
-
direction: "outbound",
|
|
438
|
+
async refreshValues(ctx) {
|
|
439
|
+
const node = this.getNode(ctx);
|
|
440
|
+
const endpoint = this.getEndpoint(ctx);
|
|
441
|
+
const api = CCAPI.create(CommandClasses["Multilevel Sensor"], ctx, endpoint).withOptions({
|
|
442
|
+
priority: MessagePriority.NodeQuery,
|
|
397
443
|
});
|
|
398
|
-
const
|
|
399
|
-
if (
|
|
400
|
-
|
|
401
|
-
const logMessage = `received current sensor reading:
|
|
402
|
-
sensor type: ${getSensorName(mlsResponse.type)}
|
|
403
|
-
value: ${mlsResponse.value}${sensorScale?.unit ? ` ${sensorScale.unit}` : ""}`;
|
|
444
|
+
const valueDB = this.getValueDB(ctx);
|
|
445
|
+
if (api.version <= 4) {
|
|
446
|
+
// Sensors up to V4 only support a single value
|
|
404
447
|
ctx.logNode(node.id, {
|
|
405
448
|
endpoint: this.endpointIndex,
|
|
406
|
-
message:
|
|
407
|
-
direction: "inbound",
|
|
408
|
-
});
|
|
409
|
-
}
|
|
410
|
-
}
|
|
411
|
-
else {
|
|
412
|
-
// Query all sensor values
|
|
413
|
-
const sensorTypes = valueDB.getValue({
|
|
414
|
-
commandClass: this.ccId,
|
|
415
|
-
property: "supportedSensorTypes",
|
|
416
|
-
endpoint: this.endpointIndex,
|
|
417
|
-
}) || [];
|
|
418
|
-
for (const type of sensorTypes) {
|
|
419
|
-
ctx.logNode(node.id, {
|
|
420
|
-
endpoint: this.endpointIndex,
|
|
421
|
-
message: `querying ${getSensorName(type)} sensor reading...`,
|
|
449
|
+
message: "querying current sensor reading...",
|
|
422
450
|
direction: "outbound",
|
|
423
451
|
});
|
|
424
|
-
const
|
|
425
|
-
if (
|
|
426
|
-
const
|
|
452
|
+
const mlsResponse = await api.get();
|
|
453
|
+
if (mlsResponse) {
|
|
454
|
+
const sensorScale = getSensorScale(mlsResponse.type, mlsResponse.scale.key);
|
|
455
|
+
const logMessage = `received current sensor reading:
|
|
456
|
+
sensor type: ${getSensorName(mlsResponse.type)}
|
|
457
|
+
value: ${mlsResponse.value}${sensorScale?.unit ? ` ${sensorScale.unit}` : ""}`;
|
|
427
458
|
ctx.logNode(node.id, {
|
|
428
459
|
endpoint: this.endpointIndex,
|
|
429
460
|
message: logMessage,
|
|
@@ -431,323 +462,411 @@ value: ${mlsResponse.value}${sensorScale?.unit ? ` ${sensorScale.unit}` :
|
|
|
431
462
|
});
|
|
432
463
|
}
|
|
433
464
|
}
|
|
465
|
+
else {
|
|
466
|
+
// Query all sensor values
|
|
467
|
+
const sensorTypes = valueDB.getValue({
|
|
468
|
+
commandClass: this.ccId,
|
|
469
|
+
property: "supportedSensorTypes",
|
|
470
|
+
endpoint: this.endpointIndex,
|
|
471
|
+
}) || [];
|
|
472
|
+
for (const type of sensorTypes) {
|
|
473
|
+
ctx.logNode(node.id, {
|
|
474
|
+
endpoint: this.endpointIndex,
|
|
475
|
+
message: `querying ${getSensorName(type)} sensor reading...`,
|
|
476
|
+
direction: "outbound",
|
|
477
|
+
});
|
|
478
|
+
const value = await api.get(type);
|
|
479
|
+
if (value) {
|
|
480
|
+
const logMessage = `received current ${getSensorName(type)} sensor reading: ${value.value} ${value.scale.unit || ""}`;
|
|
481
|
+
ctx.logNode(node.id, {
|
|
482
|
+
endpoint: this.endpointIndex,
|
|
483
|
+
message: logMessage,
|
|
484
|
+
direction: "inbound",
|
|
485
|
+
});
|
|
486
|
+
}
|
|
487
|
+
}
|
|
488
|
+
}
|
|
434
489
|
}
|
|
435
|
-
|
|
436
|
-
|
|
437
|
-
|
|
438
|
-
|
|
439
|
-
|
|
440
|
-
|
|
441
|
-
|
|
442
|
-
|
|
443
|
-
|
|
444
|
-
|
|
445
|
-
|
|
446
|
-
|
|
447
|
-
|
|
448
|
-
}
|
|
449
|
-
|
|
450
|
-
|
|
451
|
-
|
|
452
|
-
|
|
453
|
-
|
|
454
|
-
|
|
455
|
-
|
|
456
|
-
|
|
457
|
-
|
|
458
|
-
|
|
459
|
-
|
|
460
|
-
|
|
461
|
-
|
|
462
|
-
|
|
463
|
-
|
|
464
|
-
|
|
465
|
-
|
|
466
|
-
|
|
467
|
-
|
|
468
|
-
|
|
469
|
-
|
|
470
|
-
|
|
471
|
-
|
|
472
|
-
|
|
473
|
-
|
|
474
|
-
|
|
475
|
-
|
|
476
|
-
}
|
|
477
|
-
|
|
478
|
-
|
|
479
|
-
commandClass(CommandClasses["Multilevel Sensor"]),
|
|
480
|
-
implementedVersion(11),
|
|
481
|
-
ccValues(MultilevelSensorCCValues)
|
|
482
|
-
], MultilevelSensorCC);
|
|
490
|
+
shouldRefreshValues(ctx) {
|
|
491
|
+
// Poll the device when all of the supported values were last updated longer than 6 hours ago.
|
|
492
|
+
// This may lead to some values not being updated, but the user may have disabled some unnecessary
|
|
493
|
+
// reports to reduce traffic.
|
|
494
|
+
const valueDB = ctx.tryGetValueDB(this.nodeId);
|
|
495
|
+
if (!valueDB)
|
|
496
|
+
return true;
|
|
497
|
+
const values = this.getDefinedValueIDs(ctx).filter((v) => MultilevelSensorCCValues.value.is(v));
|
|
498
|
+
return values.every((v) => {
|
|
499
|
+
const lastUpdated = valueDB.getTimestamp(v);
|
|
500
|
+
return (lastUpdated == undefined
|
|
501
|
+
|| Date.now() - lastUpdated > timespan.hours(6));
|
|
502
|
+
});
|
|
503
|
+
}
|
|
504
|
+
/**
|
|
505
|
+
* Returns which sensor types are supported.
|
|
506
|
+
* This only works AFTER the interview process
|
|
507
|
+
*/
|
|
508
|
+
static getSupportedSensorTypesCached(ctx, endpoint) {
|
|
509
|
+
return ctx
|
|
510
|
+
.getValueDB(endpoint.nodeId)
|
|
511
|
+
.getValue(MultilevelSensorCCValues.supportedSensorTypes.endpoint(endpoint.index));
|
|
512
|
+
}
|
|
513
|
+
/**
|
|
514
|
+
* Returns which scales are supported for a given sensor type.
|
|
515
|
+
* This only works AFTER the interview process
|
|
516
|
+
*/
|
|
517
|
+
static getSupportedScalesCached(ctx, endpoint, sensorType) {
|
|
518
|
+
return ctx
|
|
519
|
+
.getValueDB(endpoint.nodeId)
|
|
520
|
+
.getValue(MultilevelSensorCCValues.supportedScales(sensorType).endpoint(endpoint.index));
|
|
521
|
+
}
|
|
522
|
+
translatePropertyKey(ctx, property, propertyKey) {
|
|
523
|
+
// TODO: check this
|
|
524
|
+
if (property === "values" && typeof propertyKey === "number") {
|
|
525
|
+
const sensor = getSensor(propertyKey);
|
|
526
|
+
if (sensor)
|
|
527
|
+
return sensor.label;
|
|
528
|
+
}
|
|
529
|
+
return super.translatePropertyKey(ctx, property, propertyKey);
|
|
530
|
+
}
|
|
531
|
+
};
|
|
532
|
+
return MultilevelSensorCC = _classThis;
|
|
533
|
+
})();
|
|
483
534
|
export { MultilevelSensorCC };
|
|
484
|
-
let MultilevelSensorCCReport =
|
|
485
|
-
|
|
486
|
-
|
|
487
|
-
|
|
488
|
-
|
|
489
|
-
|
|
490
|
-
|
|
491
|
-
|
|
492
|
-
|
|
493
|
-
|
|
494
|
-
|
|
495
|
-
|
|
496
|
-
|
|
497
|
-
|
|
498
|
-
|
|
499
|
-
|
|
500
|
-
|
|
501
|
-
|
|
502
|
-
|
|
503
|
-
|
|
504
|
-
|
|
505
|
-
|
|
506
|
-
|
|
507
|
-
|
|
508
|
-
|
|
509
|
-
|
|
510
|
-
|
|
511
|
-
|
|
512
|
-
|
|
513
|
-
|
|
514
|
-
|
|
515
|
-
|
|
516
|
-
|
|
517
|
-
|
|
518
|
-
|
|
535
|
+
let MultilevelSensorCCReport = (() => {
|
|
536
|
+
let _classDecorators = [CCCommand(MultilevelSensorCommand.Report), useSupervision()];
|
|
537
|
+
let _classDescriptor;
|
|
538
|
+
let _classExtraInitializers = [];
|
|
539
|
+
let _classThis;
|
|
540
|
+
let _classSuper = MultilevelSensorCC;
|
|
541
|
+
var MultilevelSensorCCReport = class extends _classSuper {
|
|
542
|
+
static { _classThis = this; }
|
|
543
|
+
static {
|
|
544
|
+
const _metadata = typeof Symbol === "function" && Symbol.metadata ? Object.create(_classSuper[Symbol.metadata] ?? null) : void 0;
|
|
545
|
+
__esDecorate(null, _classDescriptor = { value: _classThis }, _classDecorators, { kind: "class", name: _classThis.name, metadata: _metadata }, null, _classExtraInitializers);
|
|
546
|
+
MultilevelSensorCCReport = _classThis = _classDescriptor.value;
|
|
547
|
+
if (_metadata) Object.defineProperty(_classThis, Symbol.metadata, { enumerable: true, configurable: true, writable: true, value: _metadata });
|
|
548
|
+
__runInitializers(_classThis, _classExtraInitializers);
|
|
549
|
+
}
|
|
550
|
+
constructor(options) {
|
|
551
|
+
super(options);
|
|
552
|
+
this.type = options.type;
|
|
553
|
+
this.value = options.value;
|
|
554
|
+
this.scale = typeof options.scale === "number"
|
|
555
|
+
? options.scale
|
|
556
|
+
: options.scale.key;
|
|
557
|
+
}
|
|
558
|
+
static from(raw, ctx) {
|
|
559
|
+
validatePayload(raw.payload.length >= 1);
|
|
560
|
+
const type = raw.payload[0];
|
|
561
|
+
// parseFloatWithScale does its own validation
|
|
562
|
+
const { value, scale } = parseFloatWithScale(raw.payload.subarray(1));
|
|
563
|
+
return new this({
|
|
564
|
+
nodeId: ctx.sourceNodeId,
|
|
565
|
+
type,
|
|
566
|
+
value,
|
|
567
|
+
scale,
|
|
568
|
+
});
|
|
569
|
+
}
|
|
570
|
+
persistValues(ctx) {
|
|
571
|
+
if (!super.persistValues(ctx))
|
|
572
|
+
return false;
|
|
573
|
+
const sensor = getSensor(this.type);
|
|
574
|
+
const scale = getSensorScale(this.type, this.scale) ?? getUnknownScale(this.scale);
|
|
575
|
+
// Filter out unknown sensor types and scales, unless the strict validation is disabled
|
|
576
|
+
const measurementValidation = !ctx.getDeviceConfig?.(this.nodeId)?.compat?.disableStrictMeasurementValidation;
|
|
577
|
+
const ccVersion = getEffectiveCCVersion(ctx, this);
|
|
578
|
+
if (measurementValidation) {
|
|
579
|
+
// Filter out unsupported sensor types and scales if possible
|
|
580
|
+
if (ccVersion >= 5) {
|
|
581
|
+
const supportedSensorTypes = this.getValue(ctx, MultilevelSensorCCValues.supportedSensorTypes);
|
|
582
|
+
if (supportedSensorTypes?.length) {
|
|
583
|
+
validatePayload.withReason(`Unsupported sensor type ${getSensorName(this.type)} or corrupted data`)(supportedSensorTypes.includes(this.type));
|
|
584
|
+
}
|
|
585
|
+
const supportedScales = this.getValue(ctx, MultilevelSensorCCValues.supportedScales(this.type));
|
|
586
|
+
if (supportedScales?.length) {
|
|
587
|
+
validatePayload.withReason(`Unsupported scale ${scale.label} or corrupted data`)(supportedScales.includes(scale.key));
|
|
588
|
+
}
|
|
519
589
|
}
|
|
520
|
-
|
|
521
|
-
|
|
522
|
-
|
|
590
|
+
else {
|
|
591
|
+
// We support a higher CC version than the device, so any types and scales it uses should be known to us
|
|
592
|
+
// Filter out unknown ones.
|
|
593
|
+
validatePayload.withReason(`Unknown sensor type ${num2hex(this.type)} or corrupted data`)(!!sensor);
|
|
594
|
+
validatePayload.withReason(`Unknown scale ${num2hex(this.scale)} or corrupted data`)(scale.label !== getUnknownScale(this.scale).label);
|
|
523
595
|
}
|
|
524
596
|
}
|
|
525
|
-
|
|
526
|
-
|
|
527
|
-
|
|
528
|
-
|
|
529
|
-
|
|
530
|
-
|
|
597
|
+
const sensorName = getSensorName(this.type);
|
|
598
|
+
const sensorValue = MultilevelSensorCCValues.value(sensorName);
|
|
599
|
+
this.setMetadata(ctx, sensorValue, {
|
|
600
|
+
...sensorValue.meta,
|
|
601
|
+
unit: scale.unit,
|
|
602
|
+
ccSpecific: {
|
|
603
|
+
sensorType: this.type,
|
|
604
|
+
scale: scale.key,
|
|
605
|
+
},
|
|
606
|
+
});
|
|
607
|
+
this.setValue(ctx, sensorValue, this.value);
|
|
608
|
+
return true;
|
|
531
609
|
}
|
|
532
|
-
|
|
533
|
-
|
|
534
|
-
|
|
535
|
-
|
|
536
|
-
|
|
537
|
-
|
|
538
|
-
|
|
539
|
-
|
|
540
|
-
|
|
541
|
-
}
|
|
542
|
-
|
|
543
|
-
|
|
544
|
-
|
|
545
|
-
|
|
546
|
-
|
|
547
|
-
|
|
548
|
-
|
|
549
|
-
|
|
550
|
-
|
|
551
|
-
|
|
552
|
-
|
|
553
|
-
|
|
554
|
-
|
|
555
|
-
|
|
556
|
-
return {
|
|
557
|
-
...super.toLogEntry(ctx),
|
|
558
|
-
message: {
|
|
559
|
-
"sensor type": getSensorName(this.type),
|
|
560
|
-
scale: (getSensorScale(this.type, this.scale)
|
|
561
|
-
?? getUnknownScale(this.scale)).label,
|
|
562
|
-
value: this.value,
|
|
563
|
-
},
|
|
564
|
-
};
|
|
565
|
-
}
|
|
566
|
-
};
|
|
567
|
-
MultilevelSensorCCReport = MultilevelSensorCCReport_1 = __decorate([
|
|
568
|
-
CCCommand(MultilevelSensorCommand.Report),
|
|
569
|
-
useSupervision()
|
|
570
|
-
], MultilevelSensorCCReport);
|
|
610
|
+
type;
|
|
611
|
+
scale;
|
|
612
|
+
value;
|
|
613
|
+
serialize(ctx) {
|
|
614
|
+
this.payload = Bytes.concat([
|
|
615
|
+
Bytes.from([this.type]),
|
|
616
|
+
encodeFloatWithScale(this.value, this.scale),
|
|
617
|
+
]);
|
|
618
|
+
return super.serialize(ctx);
|
|
619
|
+
}
|
|
620
|
+
toLogEntry(ctx) {
|
|
621
|
+
return {
|
|
622
|
+
...super.toLogEntry(ctx),
|
|
623
|
+
message: {
|
|
624
|
+
"sensor type": getSensorName(this.type),
|
|
625
|
+
scale: (getSensorScale(this.type, this.scale)
|
|
626
|
+
?? getUnknownScale(this.scale)).label,
|
|
627
|
+
value: this.value,
|
|
628
|
+
},
|
|
629
|
+
};
|
|
630
|
+
}
|
|
631
|
+
};
|
|
632
|
+
return MultilevelSensorCCReport = _classThis;
|
|
633
|
+
})();
|
|
571
634
|
export { MultilevelSensorCCReport };
|
|
572
635
|
const testResponseForMultilevelSensorGet = (sent, received) => {
|
|
573
636
|
// We expect a Multilevel Sensor Report that matches the requested sensor type (if a type was requested)
|
|
574
637
|
return sent.sensorType == undefined || received.type === sent.sensorType;
|
|
575
638
|
};
|
|
576
|
-
let MultilevelSensorCCGet =
|
|
577
|
-
|
|
578
|
-
|
|
579
|
-
|
|
639
|
+
let MultilevelSensorCCGet = (() => {
|
|
640
|
+
let _classDecorators = [CCCommand(MultilevelSensorCommand.Get), expectedCCResponse(MultilevelSensorCCReport, testResponseForMultilevelSensorGet)];
|
|
641
|
+
let _classDescriptor;
|
|
642
|
+
let _classExtraInitializers = [];
|
|
643
|
+
let _classThis;
|
|
644
|
+
let _classSuper = MultilevelSensorCC;
|
|
645
|
+
var MultilevelSensorCCGet = class extends _classSuper {
|
|
646
|
+
static { _classThis = this; }
|
|
647
|
+
static {
|
|
648
|
+
const _metadata = typeof Symbol === "function" && Symbol.metadata ? Object.create(_classSuper[Symbol.metadata] ?? null) : void 0;
|
|
649
|
+
__esDecorate(null, _classDescriptor = { value: _classThis }, _classDecorators, { kind: "class", name: _classThis.name, metadata: _metadata }, null, _classExtraInitializers);
|
|
650
|
+
MultilevelSensorCCGet = _classThis = _classDescriptor.value;
|
|
651
|
+
if (_metadata) Object.defineProperty(_classThis, Symbol.metadata, { enumerable: true, configurable: true, writable: true, value: _metadata });
|
|
652
|
+
__runInitializers(_classThis, _classExtraInitializers);
|
|
653
|
+
}
|
|
654
|
+
constructor(options) {
|
|
655
|
+
super(options);
|
|
656
|
+
if ("sensorType" in options) {
|
|
657
|
+
this.sensorType = options.sensorType;
|
|
658
|
+
this.scale = options.scale;
|
|
659
|
+
}
|
|
660
|
+
}
|
|
661
|
+
static from(raw, ctx) {
|
|
662
|
+
if (raw.payload.length >= 2) {
|
|
663
|
+
const sensorType = raw.payload[0];
|
|
664
|
+
const scale = (raw.payload[1] >> 3) & 0b11;
|
|
665
|
+
return new this({
|
|
666
|
+
nodeId: ctx.sourceNodeId,
|
|
667
|
+
sensorType,
|
|
668
|
+
scale,
|
|
669
|
+
});
|
|
670
|
+
}
|
|
671
|
+
else {
|
|
672
|
+
return new this({
|
|
673
|
+
nodeId: ctx.sourceNodeId,
|
|
674
|
+
});
|
|
675
|
+
}
|
|
676
|
+
}
|
|
677
|
+
sensorType;
|
|
678
|
+
scale;
|
|
679
|
+
serialize(ctx) {
|
|
680
|
+
if (this.sensorType != undefined
|
|
681
|
+
&& this.scale != undefined) {
|
|
682
|
+
this.payload = Bytes.from([
|
|
683
|
+
this.sensorType,
|
|
684
|
+
(this.scale & 0b11) << 3,
|
|
685
|
+
]);
|
|
686
|
+
}
|
|
687
|
+
return super.serialize(ctx);
|
|
688
|
+
}
|
|
689
|
+
toLogEntry(ctx) {
|
|
690
|
+
let message = {};
|
|
691
|
+
if (this.sensorType != undefined
|
|
692
|
+
&& this.scale != undefined) {
|
|
693
|
+
message = {
|
|
694
|
+
"sensor type": getSensorName(this.sensorType),
|
|
695
|
+
scale: (getSensorScale(this.sensorType, this.scale) ?? getUnknownScale(this.scale)).label,
|
|
696
|
+
};
|
|
697
|
+
}
|
|
698
|
+
return {
|
|
699
|
+
...super.toLogEntry(ctx),
|
|
700
|
+
message,
|
|
701
|
+
};
|
|
702
|
+
}
|
|
703
|
+
};
|
|
704
|
+
return MultilevelSensorCCGet = _classThis;
|
|
705
|
+
})();
|
|
706
|
+
export { MultilevelSensorCCGet };
|
|
707
|
+
let MultilevelSensorCCSupportedSensorReport = (() => {
|
|
708
|
+
let _classDecorators = [CCCommand(MultilevelSensorCommand.SupportedSensorReport), ccValueProperty("supportedSensorTypes", MultilevelSensorCCValues.supportedSensorTypes)];
|
|
709
|
+
let _classDescriptor;
|
|
710
|
+
let _classExtraInitializers = [];
|
|
711
|
+
let _classThis;
|
|
712
|
+
let _classSuper = MultilevelSensorCC;
|
|
713
|
+
var MultilevelSensorCCSupportedSensorReport = class extends _classSuper {
|
|
714
|
+
static { _classThis = this; }
|
|
715
|
+
static {
|
|
716
|
+
const _metadata = typeof Symbol === "function" && Symbol.metadata ? Object.create(_classSuper[Symbol.metadata] ?? null) : void 0;
|
|
717
|
+
__esDecorate(null, _classDescriptor = { value: _classThis }, _classDecorators, { kind: "class", name: _classThis.name, metadata: _metadata }, null, _classExtraInitializers);
|
|
718
|
+
MultilevelSensorCCSupportedSensorReport = _classThis = _classDescriptor.value;
|
|
719
|
+
if (_metadata) Object.defineProperty(_classThis, Symbol.metadata, { enumerable: true, configurable: true, writable: true, value: _metadata });
|
|
720
|
+
__runInitializers(_classThis, _classExtraInitializers);
|
|
721
|
+
}
|
|
722
|
+
constructor(options) {
|
|
723
|
+
super(options);
|
|
724
|
+
this.supportedSensorTypes = options.supportedSensorTypes;
|
|
725
|
+
}
|
|
726
|
+
static from(raw, ctx) {
|
|
727
|
+
validatePayload(raw.payload.length >= 1);
|
|
728
|
+
const supportedSensorTypes = parseBitMask(raw.payload);
|
|
729
|
+
return new this({
|
|
730
|
+
nodeId: ctx.sourceNodeId,
|
|
731
|
+
supportedSensorTypes,
|
|
732
|
+
});
|
|
733
|
+
}
|
|
734
|
+
// TODO: Use this during interview to precreate values
|
|
735
|
+
supportedSensorTypes;
|
|
736
|
+
serialize(ctx) {
|
|
737
|
+
this.payload = encodeBitMask(this.supportedSensorTypes);
|
|
738
|
+
return super.serialize(ctx);
|
|
739
|
+
}
|
|
740
|
+
toLogEntry(ctx) {
|
|
741
|
+
return {
|
|
742
|
+
...super.toLogEntry(ctx),
|
|
743
|
+
message: {
|
|
744
|
+
"supported sensor types": this.supportedSensorTypes
|
|
745
|
+
.map((t) => `\n· ${getSensorName(t)}`)
|
|
746
|
+
.join(""),
|
|
747
|
+
},
|
|
748
|
+
};
|
|
749
|
+
}
|
|
750
|
+
};
|
|
751
|
+
return MultilevelSensorCCSupportedSensorReport = _classThis;
|
|
752
|
+
})();
|
|
753
|
+
export { MultilevelSensorCCSupportedSensorReport };
|
|
754
|
+
let MultilevelSensorCCGetSupportedSensor = (() => {
|
|
755
|
+
let _classDecorators = [CCCommand(MultilevelSensorCommand.GetSupportedSensor), expectedCCResponse(MultilevelSensorCCSupportedSensorReport)];
|
|
756
|
+
let _classDescriptor;
|
|
757
|
+
let _classExtraInitializers = [];
|
|
758
|
+
let _classThis;
|
|
759
|
+
let _classSuper = MultilevelSensorCC;
|
|
760
|
+
var MultilevelSensorCCGetSupportedSensor = class extends _classSuper {
|
|
761
|
+
static { _classThis = this; }
|
|
762
|
+
static {
|
|
763
|
+
const _metadata = typeof Symbol === "function" && Symbol.metadata ? Object.create(_classSuper[Symbol.metadata] ?? null) : void 0;
|
|
764
|
+
__esDecorate(null, _classDescriptor = { value: _classThis }, _classDecorators, { kind: "class", name: _classThis.name, metadata: _metadata }, null, _classExtraInitializers);
|
|
765
|
+
MultilevelSensorCCGetSupportedSensor = _classThis = _classDescriptor.value;
|
|
766
|
+
if (_metadata) Object.defineProperty(_classThis, Symbol.metadata, { enumerable: true, configurable: true, writable: true, value: _metadata });
|
|
767
|
+
__runInitializers(_classThis, _classExtraInitializers);
|
|
768
|
+
}
|
|
769
|
+
};
|
|
770
|
+
return MultilevelSensorCCGetSupportedSensor = _classThis;
|
|
771
|
+
})();
|
|
772
|
+
export { MultilevelSensorCCGetSupportedSensor };
|
|
773
|
+
let MultilevelSensorCCSupportedScaleReport = (() => {
|
|
774
|
+
let _classDecorators = [CCCommand(MultilevelSensorCommand.SupportedScaleReport), ccValueProperty("supportedScales", MultilevelSensorCCValues.supportedScales, (self) => [self.sensorType])];
|
|
775
|
+
let _classDescriptor;
|
|
776
|
+
let _classExtraInitializers = [];
|
|
777
|
+
let _classThis;
|
|
778
|
+
let _classSuper = MultilevelSensorCC;
|
|
779
|
+
var MultilevelSensorCCSupportedScaleReport = class extends _classSuper {
|
|
780
|
+
static { _classThis = this; }
|
|
781
|
+
static {
|
|
782
|
+
const _metadata = typeof Symbol === "function" && Symbol.metadata ? Object.create(_classSuper[Symbol.metadata] ?? null) : void 0;
|
|
783
|
+
__esDecorate(null, _classDescriptor = { value: _classThis }, _classDecorators, { kind: "class", name: _classThis.name, metadata: _metadata }, null, _classExtraInitializers);
|
|
784
|
+
MultilevelSensorCCSupportedScaleReport = _classThis = _classDescriptor.value;
|
|
785
|
+
if (_metadata) Object.defineProperty(_classThis, Symbol.metadata, { enumerable: true, configurable: true, writable: true, value: _metadata });
|
|
786
|
+
__runInitializers(_classThis, _classExtraInitializers);
|
|
787
|
+
}
|
|
788
|
+
constructor(options) {
|
|
789
|
+
super(options);
|
|
580
790
|
this.sensorType = options.sensorType;
|
|
581
|
-
this.
|
|
791
|
+
this.supportedScales = options.supportedScales;
|
|
582
792
|
}
|
|
583
|
-
|
|
584
|
-
|
|
585
|
-
if (raw.payload.length >= 2) {
|
|
793
|
+
static from(raw, ctx) {
|
|
794
|
+
validatePayload(raw.payload.length >= 2);
|
|
586
795
|
const sensorType = raw.payload[0];
|
|
587
|
-
const
|
|
588
|
-
return new
|
|
796
|
+
const supportedScales = parseBitMask(Bytes.from([raw.payload[1] & 0b1111]), 0);
|
|
797
|
+
return new this({
|
|
589
798
|
nodeId: ctx.sourceNodeId,
|
|
590
799
|
sensorType,
|
|
591
|
-
|
|
800
|
+
supportedScales,
|
|
592
801
|
});
|
|
593
802
|
}
|
|
594
|
-
|
|
595
|
-
|
|
803
|
+
sensorType;
|
|
804
|
+
supportedScales;
|
|
805
|
+
serialize(ctx) {
|
|
806
|
+
this.payload = Bytes.concat([
|
|
807
|
+
Bytes.from([this.sensorType]),
|
|
808
|
+
encodeBitMask(this.supportedScales, 4, 0),
|
|
809
|
+
]);
|
|
810
|
+
return super.serialize(ctx);
|
|
811
|
+
}
|
|
812
|
+
toLogEntry(ctx) {
|
|
813
|
+
return {
|
|
814
|
+
...super.toLogEntry(ctx),
|
|
815
|
+
message: {
|
|
816
|
+
"sensor type": getSensorName(this.sensorType),
|
|
817
|
+
"supported scales": this.supportedScales
|
|
818
|
+
.map((s) => `\n· ${(getSensorScale(this.sensorType, s)
|
|
819
|
+
?? getUnknownScale(s)).label}`)
|
|
820
|
+
.join(""),
|
|
821
|
+
},
|
|
822
|
+
};
|
|
823
|
+
}
|
|
824
|
+
};
|
|
825
|
+
return MultilevelSensorCCSupportedScaleReport = _classThis;
|
|
826
|
+
})();
|
|
827
|
+
export { MultilevelSensorCCSupportedScaleReport };
|
|
828
|
+
let MultilevelSensorCCGetSupportedScale = (() => {
|
|
829
|
+
let _classDecorators = [CCCommand(MultilevelSensorCommand.GetSupportedScale), expectedCCResponse(MultilevelSensorCCSupportedScaleReport)];
|
|
830
|
+
let _classDescriptor;
|
|
831
|
+
let _classExtraInitializers = [];
|
|
832
|
+
let _classThis;
|
|
833
|
+
let _classSuper = MultilevelSensorCC;
|
|
834
|
+
var MultilevelSensorCCGetSupportedScale = class extends _classSuper {
|
|
835
|
+
static { _classThis = this; }
|
|
836
|
+
static {
|
|
837
|
+
const _metadata = typeof Symbol === "function" && Symbol.metadata ? Object.create(_classSuper[Symbol.metadata] ?? null) : void 0;
|
|
838
|
+
__esDecorate(null, _classDescriptor = { value: _classThis }, _classDecorators, { kind: "class", name: _classThis.name, metadata: _metadata }, null, _classExtraInitializers);
|
|
839
|
+
MultilevelSensorCCGetSupportedScale = _classThis = _classDescriptor.value;
|
|
840
|
+
if (_metadata) Object.defineProperty(_classThis, Symbol.metadata, { enumerable: true, configurable: true, writable: true, value: _metadata });
|
|
841
|
+
__runInitializers(_classThis, _classExtraInitializers);
|
|
842
|
+
}
|
|
843
|
+
constructor(options) {
|
|
844
|
+
super(options);
|
|
845
|
+
this.sensorType = options.sensorType;
|
|
846
|
+
}
|
|
847
|
+
static from(raw, ctx) {
|
|
848
|
+
validatePayload(raw.payload.length >= 1);
|
|
849
|
+
const sensorType = raw.payload[0];
|
|
850
|
+
return new this({
|
|
596
851
|
nodeId: ctx.sourceNodeId,
|
|
852
|
+
sensorType,
|
|
597
853
|
});
|
|
598
854
|
}
|
|
599
|
-
|
|
600
|
-
|
|
601
|
-
|
|
602
|
-
|
|
603
|
-
if (this.sensorType != undefined
|
|
604
|
-
&& this.scale != undefined) {
|
|
605
|
-
this.payload = Bytes.from([
|
|
606
|
-
this.sensorType,
|
|
607
|
-
(this.scale & 0b11) << 3,
|
|
608
|
-
]);
|
|
855
|
+
sensorType;
|
|
856
|
+
serialize(ctx) {
|
|
857
|
+
this.payload = Bytes.from([this.sensorType]);
|
|
858
|
+
return super.serialize(ctx);
|
|
609
859
|
}
|
|
610
|
-
|
|
611
|
-
|
|
612
|
-
|
|
613
|
-
|
|
614
|
-
|
|
615
|
-
|
|
616
|
-
message = {
|
|
617
|
-
"sensor type": getSensorName(this.sensorType),
|
|
618
|
-
scale: (getSensorScale(this.sensorType, this.scale) ?? getUnknownScale(this.scale)).label,
|
|
860
|
+
toLogEntry(ctx) {
|
|
861
|
+
return {
|
|
862
|
+
...super.toLogEntry(ctx),
|
|
863
|
+
message: {
|
|
864
|
+
"sensor type": getSensorName(this.sensorType),
|
|
865
|
+
},
|
|
619
866
|
};
|
|
620
867
|
}
|
|
621
|
-
|
|
622
|
-
|
|
623
|
-
|
|
624
|
-
};
|
|
625
|
-
}
|
|
626
|
-
};
|
|
627
|
-
MultilevelSensorCCGet = MultilevelSensorCCGet_1 = __decorate([
|
|
628
|
-
CCCommand(MultilevelSensorCommand.Get),
|
|
629
|
-
expectedCCResponse(MultilevelSensorCCReport, testResponseForMultilevelSensorGet)
|
|
630
|
-
], MultilevelSensorCCGet);
|
|
631
|
-
export { MultilevelSensorCCGet };
|
|
632
|
-
let MultilevelSensorCCSupportedSensorReport = MultilevelSensorCCSupportedSensorReport_1 = class MultilevelSensorCCSupportedSensorReport extends MultilevelSensorCC {
|
|
633
|
-
constructor(options) {
|
|
634
|
-
super(options);
|
|
635
|
-
this.supportedSensorTypes = options.supportedSensorTypes;
|
|
636
|
-
}
|
|
637
|
-
static from(raw, ctx) {
|
|
638
|
-
validatePayload(raw.payload.length >= 1);
|
|
639
|
-
const supportedSensorTypes = parseBitMask(raw.payload);
|
|
640
|
-
return new MultilevelSensorCCSupportedSensorReport_1({
|
|
641
|
-
nodeId: ctx.sourceNodeId,
|
|
642
|
-
supportedSensorTypes,
|
|
643
|
-
});
|
|
644
|
-
}
|
|
645
|
-
// TODO: Use this during interview to precreate values
|
|
646
|
-
supportedSensorTypes;
|
|
647
|
-
serialize(ctx) {
|
|
648
|
-
this.payload = encodeBitMask(this.supportedSensorTypes);
|
|
649
|
-
return super.serialize(ctx);
|
|
650
|
-
}
|
|
651
|
-
toLogEntry(ctx) {
|
|
652
|
-
return {
|
|
653
|
-
...super.toLogEntry(ctx),
|
|
654
|
-
message: {
|
|
655
|
-
"supported sensor types": this.supportedSensorTypes
|
|
656
|
-
.map((t) => `\n· ${getSensorName(t)}`)
|
|
657
|
-
.join(""),
|
|
658
|
-
},
|
|
659
|
-
};
|
|
660
|
-
}
|
|
661
|
-
};
|
|
662
|
-
__decorate([
|
|
663
|
-
ccValue(MultilevelSensorCCValues.supportedSensorTypes)
|
|
664
|
-
], MultilevelSensorCCSupportedSensorReport.prototype, "supportedSensorTypes", void 0);
|
|
665
|
-
MultilevelSensorCCSupportedSensorReport = MultilevelSensorCCSupportedSensorReport_1 = __decorate([
|
|
666
|
-
CCCommand(MultilevelSensorCommand.SupportedSensorReport)
|
|
667
|
-
], MultilevelSensorCCSupportedSensorReport);
|
|
668
|
-
export { MultilevelSensorCCSupportedSensorReport };
|
|
669
|
-
let MultilevelSensorCCGetSupportedSensor = class MultilevelSensorCCGetSupportedSensor extends MultilevelSensorCC {
|
|
670
|
-
};
|
|
671
|
-
MultilevelSensorCCGetSupportedSensor = __decorate([
|
|
672
|
-
CCCommand(MultilevelSensorCommand.GetSupportedSensor),
|
|
673
|
-
expectedCCResponse(MultilevelSensorCCSupportedSensorReport)
|
|
674
|
-
], MultilevelSensorCCGetSupportedSensor);
|
|
675
|
-
export { MultilevelSensorCCGetSupportedSensor };
|
|
676
|
-
let MultilevelSensorCCSupportedScaleReport = MultilevelSensorCCSupportedScaleReport_1 = class MultilevelSensorCCSupportedScaleReport extends MultilevelSensorCC {
|
|
677
|
-
constructor(options) {
|
|
678
|
-
super(options);
|
|
679
|
-
this.sensorType = options.sensorType;
|
|
680
|
-
this.supportedScales = options.supportedScales;
|
|
681
|
-
}
|
|
682
|
-
static from(raw, ctx) {
|
|
683
|
-
validatePayload(raw.payload.length >= 2);
|
|
684
|
-
const sensorType = raw.payload[0];
|
|
685
|
-
const supportedScales = parseBitMask(Bytes.from([raw.payload[1] & 0b1111]), 0);
|
|
686
|
-
return new MultilevelSensorCCSupportedScaleReport_1({
|
|
687
|
-
nodeId: ctx.sourceNodeId,
|
|
688
|
-
sensorType,
|
|
689
|
-
supportedScales,
|
|
690
|
-
});
|
|
691
|
-
}
|
|
692
|
-
sensorType;
|
|
693
|
-
supportedScales;
|
|
694
|
-
serialize(ctx) {
|
|
695
|
-
this.payload = Bytes.concat([
|
|
696
|
-
Bytes.from([this.sensorType]),
|
|
697
|
-
encodeBitMask(this.supportedScales, 4, 0),
|
|
698
|
-
]);
|
|
699
|
-
return super.serialize(ctx);
|
|
700
|
-
}
|
|
701
|
-
toLogEntry(ctx) {
|
|
702
|
-
return {
|
|
703
|
-
...super.toLogEntry(ctx),
|
|
704
|
-
message: {
|
|
705
|
-
"sensor type": getSensorName(this.sensorType),
|
|
706
|
-
"supported scales": this.supportedScales
|
|
707
|
-
.map((s) => `\n· ${(getSensorScale(this.sensorType, s)
|
|
708
|
-
?? getUnknownScale(s)).label}`)
|
|
709
|
-
.join(""),
|
|
710
|
-
},
|
|
711
|
-
};
|
|
712
|
-
}
|
|
713
|
-
};
|
|
714
|
-
__decorate([
|
|
715
|
-
ccValue(MultilevelSensorCCValues.supportedScales, (self) => [self.sensorType])
|
|
716
|
-
], MultilevelSensorCCSupportedScaleReport.prototype, "supportedScales", void 0);
|
|
717
|
-
MultilevelSensorCCSupportedScaleReport = MultilevelSensorCCSupportedScaleReport_1 = __decorate([
|
|
718
|
-
CCCommand(MultilevelSensorCommand.SupportedScaleReport)
|
|
719
|
-
], MultilevelSensorCCSupportedScaleReport);
|
|
720
|
-
export { MultilevelSensorCCSupportedScaleReport };
|
|
721
|
-
let MultilevelSensorCCGetSupportedScale = MultilevelSensorCCGetSupportedScale_1 = class MultilevelSensorCCGetSupportedScale extends MultilevelSensorCC {
|
|
722
|
-
constructor(options) {
|
|
723
|
-
super(options);
|
|
724
|
-
this.sensorType = options.sensorType;
|
|
725
|
-
}
|
|
726
|
-
static from(raw, ctx) {
|
|
727
|
-
validatePayload(raw.payload.length >= 1);
|
|
728
|
-
const sensorType = raw.payload[0];
|
|
729
|
-
return new MultilevelSensorCCGetSupportedScale_1({
|
|
730
|
-
nodeId: ctx.sourceNodeId,
|
|
731
|
-
sensorType,
|
|
732
|
-
});
|
|
733
|
-
}
|
|
734
|
-
sensorType;
|
|
735
|
-
serialize(ctx) {
|
|
736
|
-
this.payload = Bytes.from([this.sensorType]);
|
|
737
|
-
return super.serialize(ctx);
|
|
738
|
-
}
|
|
739
|
-
toLogEntry(ctx) {
|
|
740
|
-
return {
|
|
741
|
-
...super.toLogEntry(ctx),
|
|
742
|
-
message: {
|
|
743
|
-
"sensor type": getSensorName(this.sensorType),
|
|
744
|
-
},
|
|
745
|
-
};
|
|
746
|
-
}
|
|
747
|
-
};
|
|
748
|
-
MultilevelSensorCCGetSupportedScale = MultilevelSensorCCGetSupportedScale_1 = __decorate([
|
|
749
|
-
CCCommand(MultilevelSensorCommand.GetSupportedScale),
|
|
750
|
-
expectedCCResponse(MultilevelSensorCCSupportedScaleReport)
|
|
751
|
-
], MultilevelSensorCCGetSupportedScale);
|
|
868
|
+
};
|
|
869
|
+
return MultilevelSensorCCGetSupportedScale = _classThis;
|
|
870
|
+
})();
|
|
752
871
|
export { MultilevelSensorCCGetSupportedScale };
|
|
753
872
|
//# sourceMappingURL=MultilevelSensorCC.js.map
|