@zwave-js/cc 14.0.0-beta.4 → 14.0.0-beta.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/build/cjs/cc/AlarmSensorCC.js +381 -266
- package/build/cjs/cc/AlarmSensorCC.js.map +3 -3
- package/build/cjs/cc/AssociationCC.js +669 -503
- package/build/cjs/cc/AssociationCC.js.map +3 -3
- package/build/cjs/cc/AssociationGroupInfoCC.js +633 -492
- package/build/cjs/cc/AssociationGroupInfoCC.js.map +3 -3
- package/build/cjs/cc/BarrierOperatorCC.js +595 -429
- package/build/cjs/cc/BarrierOperatorCC.js.map +3 -3
- package/build/cjs/cc/BasicCC.js +354 -260
- package/build/cjs/cc/BasicCC.js.map +3 -3
- package/build/cjs/cc/BatteryCC.js +427 -345
- package/build/cjs/cc/BatteryCC.js.map +3 -3
- package/build/cjs/cc/BinarySensorCC.js +391 -276
- package/build/cjs/cc/BinarySensorCC.js.map +3 -3
- package/build/cjs/cc/BinarySwitchCC.js +347 -253
- package/build/cjs/cc/BinarySwitchCC.js.map +3 -3
- package/build/cjs/cc/CRC16CC.js +160 -85
- package/build/cjs/cc/CRC16CC.js.map +3 -3
- package/build/cjs/cc/CentralSceneCC.js +459 -324
- package/build/cjs/cc/CentralSceneCC.js.map +3 -3
- package/build/cjs/cc/ClimateControlScheduleCC.js +459 -293
- package/build/cjs/cc/ClimateControlScheduleCC.js.map +3 -3
- package/build/cjs/cc/ClockCC.js +254 -150
- package/build/cjs/cc/ClockCC.js.map +3 -3
- package/build/cjs/cc/ColorSwitchCC.js +758 -610
- package/build/cjs/cc/ColorSwitchCC.js.map +3 -3
- package/build/cjs/cc/ConfigurationCC.js +1700 -1453
- package/build/cjs/cc/ConfigurationCC.js.map +3 -3
- package/build/cjs/cc/DeviceResetLocallyCC.js +125 -49
- package/build/cjs/cc/DeviceResetLocallyCC.js.map +3 -3
- package/build/cjs/cc/DoorLockCC.js +904 -777
- package/build/cjs/cc/DoorLockCC.js.map +3 -3
- package/build/cjs/cc/DoorLockLoggingCC.js +321 -206
- package/build/cjs/cc/DoorLockLoggingCC.js.map +3 -3
- package/build/cjs/cc/EnergyProductionCC.js +249 -160
- package/build/cjs/cc/EnergyProductionCC.js.map +3 -3
- package/build/cjs/cc/EntryControlCC.js +619 -458
- package/build/cjs/cc/EntryControlCC.js.map +3 -3
- package/build/cjs/cc/FirmwareUpdateMetaDataCC.js +898 -698
- package/build/cjs/cc/FirmwareUpdateMetaDataCC.js.map +3 -3
- package/build/cjs/cc/HailCC.js +57 -11
- package/build/cjs/cc/HailCC.js.map +2 -2
- package/build/cjs/cc/HumidityControlModeCC.js +359 -233
- package/build/cjs/cc/HumidityControlModeCC.js.map +3 -3
- package/build/cjs/cc/HumidityControlOperatingStateCC.js +189 -103
- package/build/cjs/cc/HumidityControlOperatingStateCC.js.map +3 -3
- package/build/cjs/cc/HumidityControlSetpointCC.js +682 -495
- package/build/cjs/cc/HumidityControlSetpointCC.js.map +3 -3
- package/build/cjs/cc/InclusionControllerCC.js +205 -114
- package/build/cjs/cc/InclusionControllerCC.js.map +3 -3
- package/build/cjs/cc/IndicatorCC.js +897 -736
- package/build/cjs/cc/IndicatorCC.js.map +3 -3
- package/build/cjs/cc/IrrigationCC.js +1651 -1405
- package/build/cjs/cc/IrrigationCC.js.map +3 -3
- package/build/cjs/cc/LanguageCC.js +268 -171
- package/build/cjs/cc/LanguageCC.js.map +3 -3
- package/build/cjs/cc/LockCC.js +254 -154
- package/build/cjs/cc/LockCC.js.map +3 -3
- package/build/cjs/cc/ManufacturerProprietaryCC.js +189 -129
- package/build/cjs/cc/ManufacturerProprietaryCC.js.map +2 -2
- package/build/cjs/cc/ManufacturerSpecificCC.js +319 -213
- package/build/cjs/cc/ManufacturerSpecificCC.js.map +3 -3
- package/build/cjs/cc/MeterCC.js +827 -707
- package/build/cjs/cc/MeterCC.js.map +3 -3
- package/build/cjs/cc/MultiChannelAssociationCC.js +612 -478
- package/build/cjs/cc/MultiChannelAssociationCC.js.map +3 -3
- package/build/cjs/cc/MultiChannelCC.js +1037 -819
- package/build/cjs/cc/MultiChannelCC.js.map +3 -3
- package/build/cjs/cc/MultiCommandCC.js +172 -97
- package/build/cjs/cc/MultiCommandCC.js.map +3 -3
- package/build/cjs/cc/MultilevelSensorCC.js +589 -449
- package/build/cjs/cc/MultilevelSensorCC.js.map +3 -3
- package/build/cjs/cc/MultilevelSwitchCC.js +587 -439
- package/build/cjs/cc/MultilevelSwitchCC.js.map +3 -3
- package/build/cjs/cc/NoOperationCC.js +89 -27
- package/build/cjs/cc/NoOperationCC.js.map +2 -2
- package/build/cjs/cc/NodeNamingCC.js +417 -277
- package/build/cjs/cc/NodeNamingCC.js.map +3 -3
- package/build/cjs/cc/NotificationCC.js +972 -818
- package/build/cjs/cc/NotificationCC.js.map +3 -3
- package/build/cjs/cc/PowerlevelCC.js +450 -303
- package/build/cjs/cc/PowerlevelCC.js.map +3 -3
- package/build/cjs/cc/ProtectionCC.js +686 -494
- package/build/cjs/cc/ProtectionCC.js.map +3 -3
- package/build/cjs/cc/SceneActivationCC.js +165 -97
- package/build/cjs/cc/SceneActivationCC.js.map +3 -3
- package/build/cjs/cc/SceneActuatorConfigurationCC.js +346 -243
- package/build/cjs/cc/SceneActuatorConfigurationCC.js.map +3 -3
- package/build/cjs/cc/SceneControllerConfigurationCC.js +401 -298
- package/build/cjs/cc/SceneControllerConfigurationCC.js.map +3 -3
- package/build/cjs/cc/ScheduleEntryLockCC.js +1552 -1272
- package/build/cjs/cc/ScheduleEntryLockCC.js.map +3 -3
- package/build/cjs/cc/Security2CC.js +1483 -1219
- package/build/cjs/cc/Security2CC.js.map +3 -3
- package/build/cjs/cc/SecurityCC.js +839 -619
- package/build/cjs/cc/SecurityCC.js.map +3 -3
- package/build/cjs/cc/SoundSwitchCC.js +707 -515
- package/build/cjs/cc/SoundSwitchCC.js.map +3 -3
- package/build/cjs/cc/SupervisionCC.js +327 -237
- package/build/cjs/cc/SupervisionCC.js.map +3 -3
- package/build/cjs/cc/ThermostatFanModeCC.js +386 -263
- package/build/cjs/cc/ThermostatFanModeCC.js.map +3 -3
- package/build/cjs/cc/ThermostatFanStateCC.js +192 -106
- package/build/cjs/cc/ThermostatFanStateCC.js.map +3 -3
- package/build/cjs/cc/ThermostatModeCC.js +425 -302
- package/build/cjs/cc/ThermostatModeCC.js.map +3 -3
- package/build/cjs/cc/ThermostatOperatingStateCC.js +188 -102
- package/build/cjs/cc/ThermostatOperatingStateCC.js.map +3 -3
- package/build/cjs/cc/ThermostatSetbackCC.js +277 -173
- package/build/cjs/cc/ThermostatSetbackCC.js.map +3 -3
- package/build/cjs/cc/ThermostatSetpointCC.js +645 -491
- package/build/cjs/cc/ThermostatSetpointCC.js.map +3 -3
- package/build/cjs/cc/TimeCC.js +515 -353
- package/build/cjs/cc/TimeCC.js.map +3 -3
- package/build/cjs/cc/TimeParametersCC.js +302 -202
- package/build/cjs/cc/TimeParametersCC.js.map +3 -3
- package/build/cjs/cc/TransportServiceCC.js +433 -315
- package/build/cjs/cc/TransportServiceCC.js.map +3 -3
- package/build/cjs/cc/UserCodeCC.js +1385 -1102
- package/build/cjs/cc/UserCodeCC.js.map +3 -3
- package/build/cjs/cc/VersionCC.js +696 -562
- package/build/cjs/cc/VersionCC.js.map +3 -3
- package/build/cjs/cc/WakeUpCC.js +499 -346
- package/build/cjs/cc/WakeUpCC.js.map +3 -3
- package/build/cjs/cc/WindowCoveringCC.js +626 -478
- package/build/cjs/cc/WindowCoveringCC.js.map +3 -3
- package/build/cjs/cc/ZWaveLongRangeCC.js +57 -10
- package/build/cjs/cc/ZWaveLongRangeCC.js.map +2 -2
- package/build/cjs/cc/ZWavePlusCC.js +233 -159
- package/build/cjs/cc/ZWavePlusCC.js.map +3 -3
- package/build/cjs/cc/ZWaveProtocolCC.js +1515 -948
- package/build/cjs/cc/ZWaveProtocolCC.js.map +3 -3
- package/build/cjs/cc/manufacturerProprietary/Decorators.d.ts +4 -4
- package/build/cjs/cc/manufacturerProprietary/Decorators.js.map +1 -1
- package/build/cjs/cc/manufacturerProprietary/FibaroCC.js +395 -274
- package/build/cjs/cc/manufacturerProprietary/FibaroCC.js.map +3 -3
- package/build/cjs/lib/CommandClassDecorators.d.ts +11 -15
- package/build/cjs/lib/CommandClassDecorators.js +19 -20
- package/build/cjs/lib/CommandClassDecorators.js.map +2 -2
- package/build/cjs/lib/Security2/Extension.d.ts +1 -1
- package/build/cjs/lib/Security2/Extension.js +217 -126
- package/build/cjs/lib/Security2/Extension.js.map +3 -3
- package/build/esm/cc/AlarmSensorCC.d.ts.map +1 -1
- package/build/esm/cc/AlarmSensorCC.js +389 -291
- package/build/esm/cc/AlarmSensorCC.js.map +1 -1
- package/build/esm/cc/AssociationCC.d.ts.map +1 -1
- package/build/esm/cc/AssociationCC.js +678 -537
- package/build/esm/cc/AssociationCC.js.map +1 -1
- package/build/esm/cc/AssociationGroupInfoCC.d.ts.map +1 -1
- package/build/esm/cc/AssociationGroupInfoCC.js +659 -539
- package/build/esm/cc/AssociationGroupInfoCC.js.map +1 -1
- package/build/esm/cc/BarrierOperatorCC.d.ts.map +1 -1
- package/build/esm/cc/BarrierOperatorCC.js +634 -493
- package/build/esm/cc/BarrierOperatorCC.js.map +1 -1
- package/build/esm/cc/BasicCC.d.ts.map +1 -1
- package/build/esm/cc/BasicCC.js +380 -302
- package/build/esm/cc/BasicCC.js.map +1 -1
- package/build/esm/cc/BatteryCC.d.ts.map +1 -1
- package/build/esm/cc/BatteryCC.js +449 -384
- package/build/esm/cc/BatteryCC.js.map +1 -1
- package/build/esm/cc/BinarySensorCC.d.ts.map +1 -1
- package/build/esm/cc/BinarySensorCC.js +395 -297
- package/build/esm/cc/BinarySensorCC.js.map +1 -1
- package/build/esm/cc/BinarySwitchCC.d.ts.map +1 -1
- package/build/esm/cc/BinarySwitchCC.js +353 -274
- package/build/esm/cc/BinarySwitchCC.js.map +1 -1
- package/build/esm/cc/CRC16CC.js +162 -98
- package/build/esm/cc/CRC16CC.js.map +1 -1
- package/build/esm/cc/CentralSceneCC.d.ts.map +1 -1
- package/build/esm/cc/CentralSceneCC.js +465 -351
- package/build/esm/cc/CentralSceneCC.js.map +1 -1
- package/build/esm/cc/ClimateControlScheduleCC.d.ts.map +1 -1
- package/build/esm/cc/ClimateControlScheduleCC.js +454 -313
- package/build/esm/cc/ClimateControlScheduleCC.js.map +1 -1
- package/build/esm/cc/ClockCC.js +248 -159
- package/build/esm/cc/ClockCC.js.map +1 -1
- package/build/esm/cc/ColorSwitchCC.d.ts.map +1 -1
- package/build/esm/cc/ColorSwitchCC.js +802 -677
- package/build/esm/cc/ColorSwitchCC.js.map +1 -1
- package/build/esm/cc/ConfigurationCC.js +1899 -1687
- package/build/esm/cc/ConfigurationCC.js.map +1 -1
- package/build/esm/cc/DeviceResetLocallyCC.js +124 -59
- package/build/esm/cc/DeviceResetLocallyCC.js.map +1 -1
- package/build/esm/cc/DoorLockCC.d.ts.map +1 -1
- package/build/esm/cc/DoorLockCC.js +951 -849
- package/build/esm/cc/DoorLockCC.js.map +1 -1
- package/build/esm/cc/DoorLockLoggingCC.d.ts.map +1 -1
- package/build/esm/cc/DoorLockLoggingCC.js +316 -218
- package/build/esm/cc/DoorLockLoggingCC.js.map +1 -1
- package/build/esm/cc/EnergyProductionCC.js +240 -164
- package/build/esm/cc/EnergyProductionCC.js.map +1 -1
- package/build/esm/cc/EntryControlCC.d.ts.map +1 -1
- package/build/esm/cc/EntryControlCC.js +629 -493
- package/build/esm/cc/EntryControlCC.js.map +1 -1
- package/build/esm/cc/FirmwareUpdateMetaDataCC.d.ts.map +1 -1
- package/build/esm/cc/FirmwareUpdateMetaDataCC.js +938 -769
- package/build/esm/cc/FirmwareUpdateMetaDataCC.js.map +1 -1
- package/build/esm/cc/HailCC.js +51 -12
- package/build/esm/cc/HailCC.js.map +1 -1
- package/build/esm/cc/HumidityControlModeCC.d.ts.map +1 -1
- package/build/esm/cc/HumidityControlModeCC.js +357 -250
- package/build/esm/cc/HumidityControlModeCC.js.map +1 -1
- package/build/esm/cc/HumidityControlOperatingStateCC.d.ts.map +1 -1
- package/build/esm/cc/HumidityControlOperatingStateCC.js +182 -109
- package/build/esm/cc/HumidityControlOperatingStateCC.js.map +1 -1
- package/build/esm/cc/HumidityControlSetpointCC.d.ts.map +1 -1
- package/build/esm/cc/HumidityControlSetpointCC.js +706 -546
- package/build/esm/cc/HumidityControlSetpointCC.js.map +1 -1
- package/build/esm/cc/InclusionControllerCC.js +197 -119
- package/build/esm/cc/InclusionControllerCC.js.map +1 -1
- package/build/esm/cc/IndicatorCC.js +973 -835
- package/build/esm/cc/IndicatorCC.js.map +1 -1
- package/build/esm/cc/IrrigationCC.d.ts.map +1 -1
- package/build/esm/cc/IrrigationCC.js +1697 -1496
- package/build/esm/cc/IrrigationCC.js.map +1 -1
- package/build/esm/cc/LanguageCC.d.ts.map +1 -1
- package/build/esm/cc/LanguageCC.js +266 -184
- package/build/esm/cc/LanguageCC.js.map +1 -1
- package/build/esm/cc/LockCC.d.ts.map +1 -1
- package/build/esm/cc/LockCC.js +247 -162
- package/build/esm/cc/LockCC.js.map +1 -1
- package/build/esm/cc/ManufacturerProprietaryCC.js +192 -141
- package/build/esm/cc/ManufacturerProprietaryCC.js.map +1 -1
- package/build/esm/cc/ManufacturerSpecificCC.d.ts.map +1 -1
- package/build/esm/cc/ManufacturerSpecificCC.js +312 -223
- package/build/esm/cc/ManufacturerSpecificCC.js.map +1 -1
- package/build/esm/cc/MeterCC.d.ts.map +1 -1
- package/build/esm/cc/MeterCC.js +896 -795
- package/build/esm/cc/MeterCC.js.map +1 -1
- package/build/esm/cc/MultiChannelAssociationCC.d.ts.map +1 -1
- package/build/esm/cc/MultiChannelAssociationCC.js +631 -518
- package/build/esm/cc/MultiChannelAssociationCC.js.map +1 -1
- package/build/esm/cc/MultiChannelCC.d.ts.map +1 -1
- package/build/esm/cc/MultiChannelCC.js +1106 -921
- package/build/esm/cc/MultiChannelCC.js.map +1 -1
- package/build/esm/cc/MultiCommandCC.js +166 -102
- package/build/esm/cc/MultiCommandCC.js.map +1 -1
- package/build/esm/cc/MultilevelSensorCC.d.ts.map +1 -1
- package/build/esm/cc/MultilevelSensorCC.js +616 -497
- package/build/esm/cc/MultilevelSensorCC.js.map +1 -1
- package/build/esm/cc/MultilevelSwitchCC.d.ts.map +1 -1
- package/build/esm/cc/MultilevelSwitchCC.js +621 -496
- package/build/esm/cc/MultilevelSwitchCC.js.map +1 -1
- package/build/esm/cc/NoOperationCC.js +82 -29
- package/build/esm/cc/NoOperationCC.js.map +1 -1
- package/build/esm/cc/NodeNamingCC.d.ts.map +1 -1
- package/build/esm/cc/NodeNamingCC.js +413 -294
- package/build/esm/cc/NodeNamingCC.js.map +1 -1
- package/build/esm/cc/NotificationCC.d.ts.map +1 -1
- package/build/esm/cc/NotificationCC.js +1097 -966
- package/build/esm/cc/NotificationCC.js.map +1 -1
- package/build/esm/cc/PowerlevelCC.js +437 -311
- package/build/esm/cc/PowerlevelCC.js.map +1 -1
- package/build/esm/cc/ProtectionCC.d.ts.map +1 -1
- package/build/esm/cc/ProtectionCC.js +704 -543
- package/build/esm/cc/ProtectionCC.js.map +1 -1
- package/build/esm/cc/SceneActivationCC.d.ts.map +1 -1
- package/build/esm/cc/SceneActivationCC.js +157 -100
- package/build/esm/cc/SceneActivationCC.js.map +1 -1
- package/build/esm/cc/SceneActuatorConfigurationCC.js +357 -269
- package/build/esm/cc/SceneActuatorConfigurationCC.js.map +1 -1
- package/build/esm/cc/SceneControllerConfigurationCC.js +434 -346
- package/build/esm/cc/SceneControllerConfigurationCC.js.map +1 -1
- package/build/esm/cc/ScheduleEntryLockCC.d.ts.map +1 -1
- package/build/esm/cc/ScheduleEntryLockCC.js +1596 -1357
- package/build/esm/cc/ScheduleEntryLockCC.js.map +1 -1
- package/build/esm/cc/Security2CC.js +1633 -1406
- package/build/esm/cc/Security2CC.js.map +1 -1
- package/build/esm/cc/SecurityCC.js +876 -687
- package/build/esm/cc/SecurityCC.js.map +1 -1
- package/build/esm/cc/SoundSwitchCC.d.ts.map +1 -1
- package/build/esm/cc/SoundSwitchCC.js +689 -526
- package/build/esm/cc/SoundSwitchCC.js.map +1 -1
- package/build/esm/cc/SupervisionCC.js +349 -272
- package/build/esm/cc/SupervisionCC.js.map +1 -1
- package/build/esm/cc/ThermostatFanModeCC.d.ts.map +1 -1
- package/build/esm/cc/ThermostatFanModeCC.js +388 -284
- package/build/esm/cc/ThermostatFanModeCC.js.map +1 -1
- package/build/esm/cc/ThermostatFanStateCC.d.ts.map +1 -1
- package/build/esm/cc/ThermostatFanStateCC.js +184 -111
- package/build/esm/cc/ThermostatFanStateCC.js.map +1 -1
- package/build/esm/cc/ThermostatModeCC.d.ts.map +1 -1
- package/build/esm/cc/ThermostatModeCC.js +435 -331
- package/build/esm/cc/ThermostatModeCC.js.map +1 -1
- package/build/esm/cc/ThermostatOperatingStateCC.d.ts.map +1 -1
- package/build/esm/cc/ThermostatOperatingStateCC.js +180 -107
- package/build/esm/cc/ThermostatOperatingStateCC.js.map +1 -1
- package/build/esm/cc/ThermostatSetbackCC.js +274 -185
- package/build/esm/cc/ThermostatSetbackCC.js.map +1 -1
- package/build/esm/cc/ThermostatSetpointCC.d.ts.map +1 -1
- package/build/esm/cc/ThermostatSetpointCC.js +674 -543
- package/build/esm/cc/ThermostatSetpointCC.js.map +1 -1
- package/build/esm/cc/TimeCC.js +499 -360
- package/build/esm/cc/TimeCC.js.map +1 -1
- package/build/esm/cc/TimeParametersCC.d.ts.map +1 -1
- package/build/esm/cc/TimeParametersCC.js +296 -211
- package/build/esm/cc/TimeParametersCC.js.map +1 -1
- package/build/esm/cc/TransportServiceCC.js +464 -363
- package/build/esm/cc/TransportServiceCC.js.map +1 -1
- package/build/esm/cc/UserCodeCC.d.ts.map +1 -1
- package/build/esm/cc/UserCodeCC.js +1443 -1205
- package/build/esm/cc/UserCodeCC.js.map +1 -1
- package/build/esm/cc/VersionCC.d.ts.map +1 -1
- package/build/esm/cc/VersionCC.js +744 -635
- package/build/esm/cc/VersionCC.js.map +1 -1
- package/build/esm/cc/WakeUpCC.d.ts.map +1 -1
- package/build/esm/cc/WakeUpCC.js +494 -364
- package/build/esm/cc/WakeUpCC.js.map +1 -1
- package/build/esm/cc/WindowCoveringCC.d.ts.map +1 -1
- package/build/esm/cc/WindowCoveringCC.js +655 -530
- package/build/esm/cc/WindowCoveringCC.js.map +1 -1
- package/build/esm/cc/ZWaveLongRangeCC.js +51 -11
- package/build/esm/cc/ZWaveLongRangeCC.js.map +1 -1
- package/build/esm/cc/ZWavePlusCC.d.ts.map +1 -1
- package/build/esm/cc/ZWavePlusCC.js +223 -162
- package/build/esm/cc/ZWavePlusCC.js.map +1 -1
- package/build/esm/cc/ZWaveProtocolCC.js +1443 -953
- package/build/esm/cc/ZWaveProtocolCC.js.map +1 -1
- package/build/esm/cc/manufacturerProprietary/Decorators.d.ts +4 -4
- package/build/esm/cc/manufacturerProprietary/Decorators.d.ts.map +1 -1
- package/build/esm/cc/manufacturerProprietary/FibaroCC.js +390 -286
- package/build/esm/cc/manufacturerProprietary/FibaroCC.js.map +1 -1
- package/build/esm/lib/CommandClassDecorators.d.ts +11 -15
- package/build/esm/lib/CommandClassDecorators.d.ts.map +1 -1
- package/build/esm/lib/CommandClassDecorators.js +24 -24
- package/build/esm/lib/CommandClassDecorators.js.map +1 -1
- package/build/esm/lib/Security2/Extension.d.ts +1 -1
- package/build/esm/lib/Security2/Extension.d.ts.map +1 -1
- package/build/esm/lib/Security2/Extension.js +207 -123
- package/build/esm/lib/Security2/Extension.js.map +1 -1
- package/package.json +6 -6
|
@@ -38,13 +38,45 @@ var import_CommandClass = require("../lib/CommandClass.js");
|
|
|
38
38
|
var import_CommandClassDecorators = require("../lib/CommandClassDecorators.js");
|
|
39
39
|
var import_Values = require("../lib/Values.js");
|
|
40
40
|
var import_Types = require("../lib/_Types.js");
|
|
41
|
-
var
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
41
|
+
var __esDecorate = function(ctor, descriptorIn, decorators, contextIn, initializers, extraInitializers) {
|
|
42
|
+
function accept(f) {
|
|
43
|
+
if (f !== void 0 && typeof f !== "function") throw new TypeError("Function expected");
|
|
44
|
+
return f;
|
|
45
|
+
}
|
|
46
|
+
var kind = contextIn.kind, key = kind === "getter" ? "get" : kind === "setter" ? "set" : "value";
|
|
47
|
+
var target = !descriptorIn && ctor ? contextIn["static"] ? ctor : ctor.prototype : null;
|
|
48
|
+
var descriptor = descriptorIn || (target ? Object.getOwnPropertyDescriptor(target, contextIn.name) : {});
|
|
49
|
+
var _, done = false;
|
|
50
|
+
for (var i = decorators.length - 1; i >= 0; i--) {
|
|
51
|
+
var context = {};
|
|
52
|
+
for (var p in contextIn) context[p] = p === "access" ? {} : contextIn[p];
|
|
53
|
+
for (var p in contextIn.access) context.access[p] = contextIn.access[p];
|
|
54
|
+
context.addInitializer = function(f) {
|
|
55
|
+
if (done) throw new TypeError("Cannot add initializers after decoration has completed");
|
|
56
|
+
extraInitializers.push(accept(f || null));
|
|
57
|
+
};
|
|
58
|
+
var result = (0, decorators[i])(kind === "accessor" ? { get: descriptor.get, set: descriptor.set } : descriptor[key], context);
|
|
59
|
+
if (kind === "accessor") {
|
|
60
|
+
if (result === void 0) continue;
|
|
61
|
+
if (result === null || typeof result !== "object") throw new TypeError("Object expected");
|
|
62
|
+
if (_ = accept(result.get)) descriptor.get = _;
|
|
63
|
+
if (_ = accept(result.set)) descriptor.set = _;
|
|
64
|
+
if (_ = accept(result.init)) initializers.unshift(_);
|
|
65
|
+
} else if (_ = accept(result)) {
|
|
66
|
+
if (kind === "field") initializers.unshift(_);
|
|
67
|
+
else descriptor[key] = _;
|
|
68
|
+
}
|
|
69
|
+
}
|
|
70
|
+
if (target) Object.defineProperty(target, contextIn.name, descriptor);
|
|
71
|
+
done = true;
|
|
72
|
+
};
|
|
73
|
+
var __runInitializers = function(thisArg, initializers, value) {
|
|
74
|
+
var useValue = arguments.length > 2;
|
|
75
|
+
for (var i = 0; i < initializers.length; i++) {
|
|
76
|
+
value = useValue ? initializers[i].call(thisArg, value) : initializers[i].call(thisArg);
|
|
77
|
+
}
|
|
78
|
+
return useValue ? value : void 0;
|
|
46
79
|
};
|
|
47
|
-
var MultilevelSensorCCReport_1, MultilevelSensorCCGet_1, MultilevelSensorCCSupportedSensorReport_1, MultilevelSensorCCSupportedScaleReport_1, MultilevelSensorCCGetSupportedScale_1;
|
|
48
80
|
function __assertType(argName, typeName, boundHasError) {
|
|
49
81
|
const { ZWaveError, ZWaveErrorCodes } = require("@zwave-js/core");
|
|
50
82
|
if (boundHasError()) {
|
|
@@ -201,154 +233,163 @@ function getPreferredSensorScale(ctx, nodeId, endpointIndex, sensorType, support
|
|
|
201
233
|
return preferred;
|
|
202
234
|
}
|
|
203
235
|
}
|
|
204
|
-
let MultilevelSensorCCAPI =
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
return this.version >= 5;
|
|
236
|
+
let MultilevelSensorCCAPI = (() => {
|
|
237
|
+
let _classDecorators = [(0, import_CommandClassDecorators.API)(import_safe.CommandClasses["Multilevel Sensor"])];
|
|
238
|
+
let _classDescriptor;
|
|
239
|
+
let _classExtraInitializers = [];
|
|
240
|
+
let _classThis;
|
|
241
|
+
let _classSuper = import_API.PhysicalCCAPI;
|
|
242
|
+
var MultilevelSensorCCAPI2 = class extends _classSuper {
|
|
243
|
+
static {
|
|
244
|
+
_classThis = this;
|
|
214
245
|
}
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
246
|
+
static {
|
|
247
|
+
const _metadata = typeof Symbol === "function" && Symbol.metadata ? Object.create(_classSuper[Symbol.metadata] ?? null) : void 0;
|
|
248
|
+
__esDecorate(null, _classDescriptor = { value: _classThis }, _classDecorators, { kind: "class", name: _classThis.name, metadata: _metadata }, null, _classExtraInitializers);
|
|
249
|
+
MultilevelSensorCCAPI2 = _classThis = _classDescriptor.value;
|
|
250
|
+
if (_metadata) Object.defineProperty(_classThis, Symbol.metadata, { enumerable: true, configurable: true, writable: true, value: _metadata });
|
|
251
|
+
__runInitializers(_classThis, _classExtraInitializers);
|
|
252
|
+
}
|
|
253
|
+
supportsCommand(cmd) {
|
|
254
|
+
switch (cmd) {
|
|
255
|
+
case import_Types.MultilevelSensorCommand.Get:
|
|
256
|
+
case import_Types.MultilevelSensorCommand.Report:
|
|
257
|
+
return true;
|
|
258
|
+
// This is mandatory
|
|
259
|
+
case import_Types.MultilevelSensorCommand.GetSupportedSensor:
|
|
260
|
+
case import_Types.MultilevelSensorCommand.GetSupportedScale:
|
|
261
|
+
return this.version >= 5;
|
|
227
262
|
}
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
}) ?? [];
|
|
244
|
-
preferredScale = getPreferredSensorScale(this.host, this.endpoint.nodeId, this.endpoint.index, sensorType, supportedScales);
|
|
245
|
-
}
|
|
246
|
-
const cc = new MultilevelSensorCCGet({
|
|
247
|
-
nodeId: this.endpoint.nodeId,
|
|
248
|
-
endpointIndex: this.endpoint.index,
|
|
249
|
-
sensorType,
|
|
250
|
-
scale: scale ?? preferredScale
|
|
251
|
-
});
|
|
252
|
-
const response = await this.host.sendCommand(cc, this.commandOptions);
|
|
253
|
-
if (!response)
|
|
254
|
-
return;
|
|
255
|
-
const responseScale = (0, import_core.getSensorScale)(response.type, response.scale);
|
|
256
|
-
if (sensorType == void 0) {
|
|
257
|
-
return {
|
|
258
|
-
type: response.type,
|
|
259
|
-
value: response.value,
|
|
260
|
-
scale: responseScale
|
|
261
|
-
};
|
|
262
|
-
} else if (scale == void 0) {
|
|
263
|
-
return {
|
|
264
|
-
value: response.value,
|
|
265
|
-
scale: responseScale
|
|
263
|
+
return super.supportsCommand(cmd);
|
|
264
|
+
}
|
|
265
|
+
get [import_API.POLL_VALUE]() {
|
|
266
|
+
return async function({ property }) {
|
|
267
|
+
const valueId = {
|
|
268
|
+
commandClass: import_safe.CommandClasses["Multilevel Sensor"],
|
|
269
|
+
endpoint: this.endpoint.index,
|
|
270
|
+
property
|
|
271
|
+
};
|
|
272
|
+
const ccSpecific = this.tryGetValueDB()?.getMetadata(valueId)?.ccSpecific;
|
|
273
|
+
if (!ccSpecific) {
|
|
274
|
+
(0, import_API.throwUnsupportedProperty)(this.ccId, property);
|
|
275
|
+
}
|
|
276
|
+
const { sensorType, scale } = ccSpecific;
|
|
277
|
+
return this.get(sensorType, scale);
|
|
266
278
|
};
|
|
267
|
-
} else {
|
|
268
|
-
return response.value;
|
|
269
279
|
}
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
return response?.supportedScales;
|
|
290
|
-
}
|
|
291
|
-
async sendReport(sensorType, scale, value) {
|
|
292
|
-
__assertType("sensorType", "number", __assertType__number.bind(void 0, sensorType));
|
|
293
|
-
__assertType("scale", void 0, __assertType__su__number__2_eu.bind(void 0, scale));
|
|
294
|
-
__assertType("value", "number", __assertType__number.bind(void 0, value));
|
|
295
|
-
this.assertSupportsCommand(import_Types.MultilevelSensorCommand, import_Types.MultilevelSensorCommand.Report);
|
|
296
|
-
const cc = new MultilevelSensorCCReport({
|
|
297
|
-
nodeId: this.endpoint.nodeId,
|
|
298
|
-
endpointIndex: this.endpoint.index,
|
|
299
|
-
type: sensorType,
|
|
300
|
-
scale,
|
|
301
|
-
value
|
|
302
|
-
});
|
|
303
|
-
return this.host.sendCommand(cc, this.commandOptions);
|
|
304
|
-
}
|
|
305
|
-
};
|
|
306
|
-
MultilevelSensorCCAPI = __decorate([
|
|
307
|
-
(0, import_CommandClassDecorators.API)(import_safe.CommandClasses["Multilevel Sensor"])
|
|
308
|
-
], MultilevelSensorCCAPI);
|
|
309
|
-
let MultilevelSensorCC = class MultilevelSensorCC2 extends import_CommandClass.CommandClass {
|
|
310
|
-
async interview(ctx) {
|
|
311
|
-
const node = this.getNode(ctx);
|
|
312
|
-
const endpoint = this.getEndpoint(ctx);
|
|
313
|
-
const api = import_API.CCAPI.create(import_safe.CommandClasses["Multilevel Sensor"], ctx, endpoint).withOptions({
|
|
314
|
-
priority: import_safe.MessagePriority.NodeQuery
|
|
315
|
-
});
|
|
316
|
-
ctx.logNode(node.id, {
|
|
317
|
-
endpoint: this.endpointIndex,
|
|
318
|
-
message: `Interviewing ${this.ccName}...`,
|
|
319
|
-
direction: "none"
|
|
320
|
-
});
|
|
321
|
-
if (api.version >= 5) {
|
|
322
|
-
ctx.logNode(node.id, {
|
|
323
|
-
endpoint: this.endpointIndex,
|
|
324
|
-
message: "retrieving supported sensor types...",
|
|
325
|
-
direction: "outbound"
|
|
280
|
+
async get(sensorType, scale) {
|
|
281
|
+
__assertType("sensorType", "(optional) number", __assertType__optional_number.bind(void 0, sensorType));
|
|
282
|
+
__assertType("scale", "(optional) number", __assertType__optional_number.bind(void 0, scale));
|
|
283
|
+
this.assertSupportsCommand(import_Types.MultilevelSensorCommand, import_Types.MultilevelSensorCommand.Get);
|
|
284
|
+
let preferredScale;
|
|
285
|
+
if (sensorType != void 0 && scale == void 0) {
|
|
286
|
+
const supportedScales = this.tryGetValueDB()?.getValue({
|
|
287
|
+
commandClass: this.ccId,
|
|
288
|
+
endpoint: this.endpoint.index,
|
|
289
|
+
property: "supportedScales",
|
|
290
|
+
propertyKey: sensorType
|
|
291
|
+
}) ?? [];
|
|
292
|
+
preferredScale = getPreferredSensorScale(this.host, this.endpoint.nodeId, this.endpoint.index, sensorType, supportedScales);
|
|
293
|
+
}
|
|
294
|
+
const cc = new MultilevelSensorCCGet({
|
|
295
|
+
nodeId: this.endpoint.nodeId,
|
|
296
|
+
endpointIndex: this.endpoint.index,
|
|
297
|
+
sensorType,
|
|
298
|
+
scale: scale ?? preferredScale
|
|
326
299
|
});
|
|
327
|
-
const
|
|
328
|
-
if (
|
|
329
|
-
const logMessage = "received supported sensor types:\n" + sensorTypes.map((t) => (0, import_core.getSensorName)(t)).map((name) => `\xB7 ${name}`).join("\n");
|
|
330
|
-
ctx.logNode(node.id, {
|
|
331
|
-
endpoint: this.endpointIndex,
|
|
332
|
-
message: logMessage,
|
|
333
|
-
direction: "inbound"
|
|
334
|
-
});
|
|
335
|
-
} else {
|
|
336
|
-
ctx.logNode(node.id, {
|
|
337
|
-
endpoint: this.endpointIndex,
|
|
338
|
-
message: "Querying supported sensor types timed out, skipping interview...",
|
|
339
|
-
level: "warn"
|
|
340
|
-
});
|
|
300
|
+
const response = await this.host.sendCommand(cc, this.commandOptions);
|
|
301
|
+
if (!response)
|
|
341
302
|
return;
|
|
303
|
+
const responseScale = (0, import_core.getSensorScale)(response.type, response.scale);
|
|
304
|
+
if (sensorType == void 0) {
|
|
305
|
+
return {
|
|
306
|
+
type: response.type,
|
|
307
|
+
value: response.value,
|
|
308
|
+
scale: responseScale
|
|
309
|
+
};
|
|
310
|
+
} else if (scale == void 0) {
|
|
311
|
+
return {
|
|
312
|
+
value: response.value,
|
|
313
|
+
scale: responseScale
|
|
314
|
+
};
|
|
315
|
+
} else {
|
|
316
|
+
return response.value;
|
|
342
317
|
}
|
|
343
|
-
|
|
318
|
+
}
|
|
319
|
+
async getSupportedSensorTypes() {
|
|
320
|
+
this.assertSupportsCommand(import_Types.MultilevelSensorCommand, import_Types.MultilevelSensorCommand.GetSupportedSensor);
|
|
321
|
+
const cc = new MultilevelSensorCCGetSupportedSensor({
|
|
322
|
+
nodeId: this.endpoint.nodeId,
|
|
323
|
+
endpointIndex: this.endpoint.index
|
|
324
|
+
});
|
|
325
|
+
const response = await this.host.sendCommand(cc, this.commandOptions);
|
|
326
|
+
return response?.supportedSensorTypes;
|
|
327
|
+
}
|
|
328
|
+
async getSupportedScales(sensorType) {
|
|
329
|
+
__assertType("sensorType", "number", __assertType__number.bind(void 0, sensorType));
|
|
330
|
+
this.assertSupportsCommand(import_Types.MultilevelSensorCommand, import_Types.MultilevelSensorCommand.GetSupportedScale);
|
|
331
|
+
const cc = new MultilevelSensorCCGetSupportedScale({
|
|
332
|
+
nodeId: this.endpoint.nodeId,
|
|
333
|
+
endpointIndex: this.endpoint.index,
|
|
334
|
+
sensorType
|
|
335
|
+
});
|
|
336
|
+
const response = await this.host.sendCommand(cc, this.commandOptions);
|
|
337
|
+
return response?.supportedScales;
|
|
338
|
+
}
|
|
339
|
+
async sendReport(sensorType, scale, value) {
|
|
340
|
+
__assertType("sensorType", "number", __assertType__number.bind(void 0, sensorType));
|
|
341
|
+
__assertType("scale", void 0, __assertType__su__number__2_eu.bind(void 0, scale));
|
|
342
|
+
__assertType("value", "number", __assertType__number.bind(void 0, value));
|
|
343
|
+
this.assertSupportsCommand(import_Types.MultilevelSensorCommand, import_Types.MultilevelSensorCommand.Report);
|
|
344
|
+
const cc = new MultilevelSensorCCReport({
|
|
345
|
+
nodeId: this.endpoint.nodeId,
|
|
346
|
+
endpointIndex: this.endpoint.index,
|
|
347
|
+
type: sensorType,
|
|
348
|
+
scale,
|
|
349
|
+
value
|
|
350
|
+
});
|
|
351
|
+
return this.host.sendCommand(cc, this.commandOptions);
|
|
352
|
+
}
|
|
353
|
+
};
|
|
354
|
+
return MultilevelSensorCCAPI2 = _classThis;
|
|
355
|
+
})();
|
|
356
|
+
let MultilevelSensorCC = (() => {
|
|
357
|
+
let _classDecorators = [(0, import_CommandClassDecorators.commandClass)(import_safe.CommandClasses["Multilevel Sensor"]), (0, import_CommandClassDecorators.implementedVersion)(11), (0, import_CommandClassDecorators.ccValues)(MultilevelSensorCCValues)];
|
|
358
|
+
let _classDescriptor;
|
|
359
|
+
let _classExtraInitializers = [];
|
|
360
|
+
let _classThis;
|
|
361
|
+
let _classSuper = import_CommandClass.CommandClass;
|
|
362
|
+
var MultilevelSensorCC2 = class extends _classSuper {
|
|
363
|
+
static {
|
|
364
|
+
_classThis = this;
|
|
365
|
+
}
|
|
366
|
+
static {
|
|
367
|
+
const _metadata = typeof Symbol === "function" && Symbol.metadata ? Object.create(_classSuper[Symbol.metadata] ?? null) : void 0;
|
|
368
|
+
__esDecorate(null, _classDescriptor = { value: _classThis }, _classDecorators, { kind: "class", name: _classThis.name, metadata: _metadata }, null, _classExtraInitializers);
|
|
369
|
+
MultilevelSensorCC2 = _classThis = _classDescriptor.value;
|
|
370
|
+
if (_metadata) Object.defineProperty(_classThis, Symbol.metadata, { enumerable: true, configurable: true, writable: true, value: _metadata });
|
|
371
|
+
__runInitializers(_classThis, _classExtraInitializers);
|
|
372
|
+
}
|
|
373
|
+
async interview(ctx) {
|
|
374
|
+
const node = this.getNode(ctx);
|
|
375
|
+
const endpoint = this.getEndpoint(ctx);
|
|
376
|
+
const api = import_API.CCAPI.create(import_safe.CommandClasses["Multilevel Sensor"], ctx, endpoint).withOptions({
|
|
377
|
+
priority: import_safe.MessagePriority.NodeQuery
|
|
378
|
+
});
|
|
379
|
+
ctx.logNode(node.id, {
|
|
380
|
+
endpoint: this.endpointIndex,
|
|
381
|
+
message: `Interviewing ${this.ccName}...`,
|
|
382
|
+
direction: "none"
|
|
383
|
+
});
|
|
384
|
+
if (api.version >= 5) {
|
|
344
385
|
ctx.logNode(node.id, {
|
|
345
386
|
endpoint: this.endpointIndex,
|
|
346
|
-
message:
|
|
387
|
+
message: "retrieving supported sensor types...",
|
|
347
388
|
direction: "outbound"
|
|
348
389
|
});
|
|
349
|
-
const
|
|
350
|
-
if (
|
|
351
|
-
const logMessage = "received supported
|
|
390
|
+
const sensorTypes = await api.getSupportedSensorTypes();
|
|
391
|
+
if (sensorTypes) {
|
|
392
|
+
const logMessage = "received supported sensor types:\n" + sensorTypes.map((t) => (0, import_core.getSensorName)(t)).map((name) => `\xB7 ${name}`).join("\n");
|
|
352
393
|
ctx.logNode(node.id, {
|
|
353
394
|
endpoint: this.endpointIndex,
|
|
354
395
|
message: logMessage,
|
|
@@ -357,350 +398,449 @@ let MultilevelSensorCC = class MultilevelSensorCC2 extends import_CommandClass.C
|
|
|
357
398
|
} else {
|
|
358
399
|
ctx.logNode(node.id, {
|
|
359
400
|
endpoint: this.endpointIndex,
|
|
360
|
-
message: "Querying supported
|
|
401
|
+
message: "Querying supported sensor types timed out, skipping interview...",
|
|
361
402
|
level: "warn"
|
|
362
403
|
});
|
|
363
404
|
return;
|
|
364
405
|
}
|
|
406
|
+
for (const type of sensorTypes) {
|
|
407
|
+
ctx.logNode(node.id, {
|
|
408
|
+
endpoint: this.endpointIndex,
|
|
409
|
+
message: `querying supported scales for ${(0, import_core.getSensorName)(type)} sensor`,
|
|
410
|
+
direction: "outbound"
|
|
411
|
+
});
|
|
412
|
+
const sensorScales = await api.getSupportedScales(type);
|
|
413
|
+
if (sensorScales) {
|
|
414
|
+
const logMessage = "received supported scales:\n" + sensorScales.map((s) => ((0, import_core.getSensorScale)(type, s) ?? (0, import_core.getUnknownScale)(s)).label).map((name) => `\xB7 ${name}`).join("\n");
|
|
415
|
+
ctx.logNode(node.id, {
|
|
416
|
+
endpoint: this.endpointIndex,
|
|
417
|
+
message: logMessage,
|
|
418
|
+
direction: "inbound"
|
|
419
|
+
});
|
|
420
|
+
} else {
|
|
421
|
+
ctx.logNode(node.id, {
|
|
422
|
+
endpoint: this.endpointIndex,
|
|
423
|
+
message: "Querying supported scales timed out, skipping interview...",
|
|
424
|
+
level: "warn"
|
|
425
|
+
});
|
|
426
|
+
return;
|
|
427
|
+
}
|
|
428
|
+
}
|
|
365
429
|
}
|
|
430
|
+
await this.refreshValues(ctx);
|
|
431
|
+
this.setInterviewComplete(ctx, true);
|
|
366
432
|
}
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
const endpoint = this.getEndpoint(ctx);
|
|
373
|
-
const api = import_API.CCAPI.create(import_safe.CommandClasses["Multilevel Sensor"], ctx, endpoint).withOptions({
|
|
374
|
-
priority: import_safe.MessagePriority.NodeQuery
|
|
375
|
-
});
|
|
376
|
-
const valueDB = this.getValueDB(ctx);
|
|
377
|
-
if (api.version <= 4) {
|
|
378
|
-
ctx.logNode(node.id, {
|
|
379
|
-
endpoint: this.endpointIndex,
|
|
380
|
-
message: "querying current sensor reading...",
|
|
381
|
-
direction: "outbound"
|
|
433
|
+
async refreshValues(ctx) {
|
|
434
|
+
const node = this.getNode(ctx);
|
|
435
|
+
const endpoint = this.getEndpoint(ctx);
|
|
436
|
+
const api = import_API.CCAPI.create(import_safe.CommandClasses["Multilevel Sensor"], ctx, endpoint).withOptions({
|
|
437
|
+
priority: import_safe.MessagePriority.NodeQuery
|
|
382
438
|
});
|
|
383
|
-
const
|
|
384
|
-
if (
|
|
385
|
-
const sensorScale = (0, import_core.getSensorScale)(mlsResponse.type, mlsResponse.scale.key);
|
|
386
|
-
const logMessage = `received current sensor reading:
|
|
387
|
-
sensor type: ${(0, import_core.getSensorName)(mlsResponse.type)}
|
|
388
|
-
value: ${mlsResponse.value}${sensorScale?.unit ? ` ${sensorScale.unit}` : ""}`;
|
|
439
|
+
const valueDB = this.getValueDB(ctx);
|
|
440
|
+
if (api.version <= 4) {
|
|
389
441
|
ctx.logNode(node.id, {
|
|
390
442
|
endpoint: this.endpointIndex,
|
|
391
|
-
message:
|
|
392
|
-
direction: "inbound"
|
|
393
|
-
});
|
|
394
|
-
}
|
|
395
|
-
} else {
|
|
396
|
-
const sensorTypes = valueDB.getValue({
|
|
397
|
-
commandClass: this.ccId,
|
|
398
|
-
property: "supportedSensorTypes",
|
|
399
|
-
endpoint: this.endpointIndex
|
|
400
|
-
}) || [];
|
|
401
|
-
for (const type of sensorTypes) {
|
|
402
|
-
ctx.logNode(node.id, {
|
|
403
|
-
endpoint: this.endpointIndex,
|
|
404
|
-
message: `querying ${(0, import_core.getSensorName)(type)} sensor reading...`,
|
|
443
|
+
message: "querying current sensor reading...",
|
|
405
444
|
direction: "outbound"
|
|
406
445
|
});
|
|
407
|
-
const
|
|
408
|
-
if (
|
|
409
|
-
const
|
|
446
|
+
const mlsResponse = await api.get();
|
|
447
|
+
if (mlsResponse) {
|
|
448
|
+
const sensorScale = (0, import_core.getSensorScale)(mlsResponse.type, mlsResponse.scale.key);
|
|
449
|
+
const logMessage = `received current sensor reading:
|
|
450
|
+
sensor type: ${(0, import_core.getSensorName)(mlsResponse.type)}
|
|
451
|
+
value: ${mlsResponse.value}${sensorScale?.unit ? ` ${sensorScale.unit}` : ""}`;
|
|
410
452
|
ctx.logNode(node.id, {
|
|
411
453
|
endpoint: this.endpointIndex,
|
|
412
454
|
message: logMessage,
|
|
413
455
|
direction: "inbound"
|
|
414
456
|
});
|
|
415
457
|
}
|
|
458
|
+
} else {
|
|
459
|
+
const sensorTypes = valueDB.getValue({
|
|
460
|
+
commandClass: this.ccId,
|
|
461
|
+
property: "supportedSensorTypes",
|
|
462
|
+
endpoint: this.endpointIndex
|
|
463
|
+
}) || [];
|
|
464
|
+
for (const type of sensorTypes) {
|
|
465
|
+
ctx.logNode(node.id, {
|
|
466
|
+
endpoint: this.endpointIndex,
|
|
467
|
+
message: `querying ${(0, import_core.getSensorName)(type)} sensor reading...`,
|
|
468
|
+
direction: "outbound"
|
|
469
|
+
});
|
|
470
|
+
const value = await api.get(type);
|
|
471
|
+
if (value) {
|
|
472
|
+
const logMessage = `received current ${(0, import_core.getSensorName)(type)} sensor reading: ${value.value} ${value.scale.unit || ""}`;
|
|
473
|
+
ctx.logNode(node.id, {
|
|
474
|
+
endpoint: this.endpointIndex,
|
|
475
|
+
message: logMessage,
|
|
476
|
+
direction: "inbound"
|
|
477
|
+
});
|
|
478
|
+
}
|
|
479
|
+
}
|
|
416
480
|
}
|
|
417
481
|
}
|
|
418
|
-
|
|
419
|
-
|
|
420
|
-
|
|
421
|
-
|
|
422
|
-
|
|
423
|
-
|
|
424
|
-
|
|
425
|
-
|
|
426
|
-
|
|
427
|
-
});
|
|
428
|
-
}
|
|
429
|
-
/**
|
|
430
|
-
* Returns which sensor types are supported.
|
|
431
|
-
* This only works AFTER the interview process
|
|
432
|
-
*/
|
|
433
|
-
static getSupportedSensorTypesCached(ctx, endpoint) {
|
|
434
|
-
return ctx.getValueDB(endpoint.nodeId).getValue(MultilevelSensorCCValues.supportedSensorTypes.endpoint(endpoint.index));
|
|
435
|
-
}
|
|
436
|
-
/**
|
|
437
|
-
* Returns which scales are supported for a given sensor type.
|
|
438
|
-
* This only works AFTER the interview process
|
|
439
|
-
*/
|
|
440
|
-
static getSupportedScalesCached(ctx, endpoint, sensorType) {
|
|
441
|
-
return ctx.getValueDB(endpoint.nodeId).getValue(MultilevelSensorCCValues.supportedScales(sensorType).endpoint(endpoint.index));
|
|
442
|
-
}
|
|
443
|
-
translatePropertyKey(ctx, property, propertyKey) {
|
|
444
|
-
if (property === "values" && typeof propertyKey === "number") {
|
|
445
|
-
const sensor = (0, import_core.getSensor)(propertyKey);
|
|
446
|
-
if (sensor)
|
|
447
|
-
return sensor.label;
|
|
482
|
+
shouldRefreshValues(ctx) {
|
|
483
|
+
const valueDB = ctx.tryGetValueDB(this.nodeId);
|
|
484
|
+
if (!valueDB)
|
|
485
|
+
return true;
|
|
486
|
+
const values = this.getDefinedValueIDs(ctx).filter((v) => MultilevelSensorCCValues.value.is(v));
|
|
487
|
+
return values.every((v) => {
|
|
488
|
+
const lastUpdated = valueDB.getTimestamp(v);
|
|
489
|
+
return lastUpdated == void 0 || Date.now() - lastUpdated > import_core.timespan.hours(6);
|
|
490
|
+
});
|
|
448
491
|
}
|
|
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
|
-
|
|
480
|
-
|
|
481
|
-
|
|
482
|
-
|
|
483
|
-
|
|
484
|
-
|
|
485
|
-
|
|
486
|
-
|
|
492
|
+
/**
|
|
493
|
+
* Returns which sensor types are supported.
|
|
494
|
+
* This only works AFTER the interview process
|
|
495
|
+
*/
|
|
496
|
+
static getSupportedSensorTypesCached(ctx, endpoint) {
|
|
497
|
+
return ctx.getValueDB(endpoint.nodeId).getValue(MultilevelSensorCCValues.supportedSensorTypes.endpoint(endpoint.index));
|
|
498
|
+
}
|
|
499
|
+
/**
|
|
500
|
+
* Returns which scales are supported for a given sensor type.
|
|
501
|
+
* This only works AFTER the interview process
|
|
502
|
+
*/
|
|
503
|
+
static getSupportedScalesCached(ctx, endpoint, sensorType) {
|
|
504
|
+
return ctx.getValueDB(endpoint.nodeId).getValue(MultilevelSensorCCValues.supportedScales(sensorType).endpoint(endpoint.index));
|
|
505
|
+
}
|
|
506
|
+
translatePropertyKey(ctx, property, propertyKey) {
|
|
507
|
+
if (property === "values" && typeof propertyKey === "number") {
|
|
508
|
+
const sensor = (0, import_core.getSensor)(propertyKey);
|
|
509
|
+
if (sensor)
|
|
510
|
+
return sensor.label;
|
|
511
|
+
}
|
|
512
|
+
return super.translatePropertyKey(ctx, property, propertyKey);
|
|
513
|
+
}
|
|
514
|
+
};
|
|
515
|
+
return MultilevelSensorCC2 = _classThis;
|
|
516
|
+
})();
|
|
517
|
+
let MultilevelSensorCCReport = (() => {
|
|
518
|
+
let _classDecorators = [(0, import_CommandClassDecorators.CCCommand)(import_Types.MultilevelSensorCommand.Report), (0, import_CommandClassDecorators.useSupervision)()];
|
|
519
|
+
let _classDescriptor;
|
|
520
|
+
let _classExtraInitializers = [];
|
|
521
|
+
let _classThis;
|
|
522
|
+
let _classSuper = MultilevelSensorCC;
|
|
523
|
+
var MultilevelSensorCCReport2 = class extends _classSuper {
|
|
524
|
+
static {
|
|
525
|
+
_classThis = this;
|
|
526
|
+
}
|
|
527
|
+
static {
|
|
528
|
+
const _metadata = typeof Symbol === "function" && Symbol.metadata ? Object.create(_classSuper[Symbol.metadata] ?? null) : void 0;
|
|
529
|
+
__esDecorate(null, _classDescriptor = { value: _classThis }, _classDecorators, { kind: "class", name: _classThis.name, metadata: _metadata }, null, _classExtraInitializers);
|
|
530
|
+
MultilevelSensorCCReport2 = _classThis = _classDescriptor.value;
|
|
531
|
+
if (_metadata) Object.defineProperty(_classThis, Symbol.metadata, { enumerable: true, configurable: true, writable: true, value: _metadata });
|
|
532
|
+
__runInitializers(_classThis, _classExtraInitializers);
|
|
533
|
+
}
|
|
534
|
+
constructor(options) {
|
|
535
|
+
super(options);
|
|
536
|
+
this.type = options.type;
|
|
537
|
+
this.value = options.value;
|
|
538
|
+
this.scale = typeof options.scale === "number" ? options.scale : options.scale.key;
|
|
539
|
+
}
|
|
540
|
+
static from(raw, ctx) {
|
|
541
|
+
(0, import_safe.validatePayload)(raw.payload.length >= 1);
|
|
542
|
+
const type = raw.payload[0];
|
|
543
|
+
const { value, scale } = (0, import_safe.parseFloatWithScale)(raw.payload.subarray(1));
|
|
544
|
+
return new this({
|
|
545
|
+
nodeId: ctx.sourceNodeId,
|
|
546
|
+
type,
|
|
547
|
+
value,
|
|
548
|
+
scale
|
|
549
|
+
});
|
|
550
|
+
}
|
|
551
|
+
persistValues(ctx) {
|
|
552
|
+
if (!super.persistValues(ctx))
|
|
553
|
+
return false;
|
|
554
|
+
const sensor = (0, import_core.getSensor)(this.type);
|
|
555
|
+
const scale = (0, import_core.getSensorScale)(this.type, this.scale) ?? (0, import_core.getUnknownScale)(this.scale);
|
|
556
|
+
const measurementValidation = !ctx.getDeviceConfig?.(this.nodeId)?.compat?.disableStrictMeasurementValidation;
|
|
557
|
+
const ccVersion = (0, import_CommandClass.getEffectiveCCVersion)(ctx, this);
|
|
558
|
+
if (measurementValidation) {
|
|
559
|
+
if (ccVersion >= 5) {
|
|
560
|
+
const supportedSensorTypes = this.getValue(ctx, MultilevelSensorCCValues.supportedSensorTypes);
|
|
561
|
+
if (supportedSensorTypes?.length) {
|
|
562
|
+
import_safe.validatePayload.withReason(`Unsupported sensor type ${(0, import_core.getSensorName)(this.type)} or corrupted data`)(supportedSensorTypes.includes(this.type));
|
|
563
|
+
}
|
|
564
|
+
const supportedScales = this.getValue(ctx, MultilevelSensorCCValues.supportedScales(this.type));
|
|
565
|
+
if (supportedScales?.length) {
|
|
566
|
+
import_safe.validatePayload.withReason(`Unsupported scale ${scale.label} or corrupted data`)(supportedScales.includes(scale.key));
|
|
567
|
+
}
|
|
568
|
+
} else {
|
|
569
|
+
import_safe.validatePayload.withReason(`Unknown sensor type ${(0, import_safe3.num2hex)(this.type)} or corrupted data`)(!!sensor);
|
|
570
|
+
import_safe.validatePayload.withReason(`Unknown scale ${(0, import_safe3.num2hex)(this.scale)} or corrupted data`)(scale.label !== (0, import_core.getUnknownScale)(this.scale).label);
|
|
571
|
+
}
|
|
572
|
+
}
|
|
573
|
+
const sensorName = (0, import_core.getSensorName)(this.type);
|
|
574
|
+
const sensorValue = MultilevelSensorCCValues.value(sensorName);
|
|
575
|
+
this.setMetadata(ctx, sensorValue, {
|
|
576
|
+
...sensorValue.meta,
|
|
577
|
+
unit: scale.unit,
|
|
578
|
+
ccSpecific: {
|
|
579
|
+
sensorType: this.type,
|
|
580
|
+
scale: scale.key
|
|
487
581
|
}
|
|
488
|
-
|
|
489
|
-
|
|
490
|
-
|
|
582
|
+
});
|
|
583
|
+
this.setValue(ctx, sensorValue, this.value);
|
|
584
|
+
return true;
|
|
585
|
+
}
|
|
586
|
+
type;
|
|
587
|
+
scale;
|
|
588
|
+
value;
|
|
589
|
+
serialize(ctx) {
|
|
590
|
+
this.payload = import_safe2.Bytes.concat([
|
|
591
|
+
import_safe2.Bytes.from([this.type]),
|
|
592
|
+
(0, import_safe.encodeFloatWithScale)(this.value, this.scale)
|
|
593
|
+
]);
|
|
594
|
+
return super.serialize(ctx);
|
|
595
|
+
}
|
|
596
|
+
toLogEntry(ctx) {
|
|
597
|
+
return {
|
|
598
|
+
...super.toLogEntry(ctx),
|
|
599
|
+
message: {
|
|
600
|
+
"sensor type": (0, import_core.getSensorName)(this.type),
|
|
601
|
+
scale: ((0, import_core.getSensorScale)(this.type, this.scale) ?? (0, import_core.getUnknownScale)(this.scale)).label,
|
|
602
|
+
value: this.value
|
|
491
603
|
}
|
|
604
|
+
};
|
|
605
|
+
}
|
|
606
|
+
};
|
|
607
|
+
return MultilevelSensorCCReport2 = _classThis;
|
|
608
|
+
})();
|
|
609
|
+
const testResponseForMultilevelSensorGet = (sent, received) => {
|
|
610
|
+
return sent.sensorType == void 0 || received.type === sent.sensorType;
|
|
611
|
+
};
|
|
612
|
+
let MultilevelSensorCCGet = (() => {
|
|
613
|
+
let _classDecorators = [(0, import_CommandClassDecorators.CCCommand)(import_Types.MultilevelSensorCommand.Get), (0, import_CommandClassDecorators.expectedCCResponse)(MultilevelSensorCCReport, testResponseForMultilevelSensorGet)];
|
|
614
|
+
let _classDescriptor;
|
|
615
|
+
let _classExtraInitializers = [];
|
|
616
|
+
let _classThis;
|
|
617
|
+
let _classSuper = MultilevelSensorCC;
|
|
618
|
+
var MultilevelSensorCCGet2 = class extends _classSuper {
|
|
619
|
+
static {
|
|
620
|
+
_classThis = this;
|
|
621
|
+
}
|
|
622
|
+
static {
|
|
623
|
+
const _metadata = typeof Symbol === "function" && Symbol.metadata ? Object.create(_classSuper[Symbol.metadata] ?? null) : void 0;
|
|
624
|
+
__esDecorate(null, _classDescriptor = { value: _classThis }, _classDecorators, { kind: "class", name: _classThis.name, metadata: _metadata }, null, _classExtraInitializers);
|
|
625
|
+
MultilevelSensorCCGet2 = _classThis = _classDescriptor.value;
|
|
626
|
+
if (_metadata) Object.defineProperty(_classThis, Symbol.metadata, { enumerable: true, configurable: true, writable: true, value: _metadata });
|
|
627
|
+
__runInitializers(_classThis, _classExtraInitializers);
|
|
628
|
+
}
|
|
629
|
+
constructor(options) {
|
|
630
|
+
super(options);
|
|
631
|
+
if ("sensorType" in options) {
|
|
632
|
+
this.sensorType = options.sensorType;
|
|
633
|
+
this.scale = options.scale;
|
|
634
|
+
}
|
|
635
|
+
}
|
|
636
|
+
static from(raw, ctx) {
|
|
637
|
+
if (raw.payload.length >= 2) {
|
|
638
|
+
const sensorType = raw.payload[0];
|
|
639
|
+
const scale = raw.payload[1] >> 3 & 3;
|
|
640
|
+
return new this({
|
|
641
|
+
nodeId: ctx.sourceNodeId,
|
|
642
|
+
sensorType,
|
|
643
|
+
scale
|
|
644
|
+
});
|
|
492
645
|
} else {
|
|
493
|
-
|
|
494
|
-
|
|
646
|
+
return new this({
|
|
647
|
+
nodeId: ctx.sourceNodeId
|
|
648
|
+
});
|
|
495
649
|
}
|
|
496
650
|
}
|
|
497
|
-
|
|
498
|
-
|
|
499
|
-
|
|
500
|
-
|
|
501
|
-
|
|
502
|
-
|
|
503
|
-
|
|
504
|
-
|
|
651
|
+
sensorType;
|
|
652
|
+
scale;
|
|
653
|
+
serialize(ctx) {
|
|
654
|
+
if (this.sensorType != void 0 && this.scale != void 0) {
|
|
655
|
+
this.payload = import_safe2.Bytes.from([
|
|
656
|
+
this.sensorType,
|
|
657
|
+
(this.scale & 3) << 3
|
|
658
|
+
]);
|
|
505
659
|
}
|
|
506
|
-
|
|
507
|
-
|
|
508
|
-
|
|
509
|
-
|
|
510
|
-
|
|
511
|
-
|
|
512
|
-
|
|
513
|
-
|
|
514
|
-
|
|
515
|
-
import_safe2.Bytes.from([this.type]),
|
|
516
|
-
(0, import_safe.encodeFloatWithScale)(this.value, this.scale)
|
|
517
|
-
]);
|
|
518
|
-
return super.serialize(ctx);
|
|
519
|
-
}
|
|
520
|
-
toLogEntry(ctx) {
|
|
521
|
-
return {
|
|
522
|
-
...super.toLogEntry(ctx),
|
|
523
|
-
message: {
|
|
524
|
-
"sensor type": (0, import_core.getSensorName)(this.type),
|
|
525
|
-
scale: ((0, import_core.getSensorScale)(this.type, this.scale) ?? (0, import_core.getUnknownScale)(this.scale)).label,
|
|
526
|
-
value: this.value
|
|
660
|
+
return super.serialize(ctx);
|
|
661
|
+
}
|
|
662
|
+
toLogEntry(ctx) {
|
|
663
|
+
let message = {};
|
|
664
|
+
if (this.sensorType != void 0 && this.scale != void 0) {
|
|
665
|
+
message = {
|
|
666
|
+
"sensor type": (0, import_core.getSensorName)(this.sensorType),
|
|
667
|
+
scale: ((0, import_core.getSensorScale)(this.sensorType, this.scale) ?? (0, import_core.getUnknownScale)(this.scale)).label
|
|
668
|
+
};
|
|
527
669
|
}
|
|
528
|
-
|
|
529
|
-
|
|
530
|
-
|
|
531
|
-
|
|
532
|
-
|
|
533
|
-
|
|
534
|
-
|
|
535
|
-
|
|
536
|
-
|
|
537
|
-
|
|
538
|
-
let
|
|
539
|
-
|
|
540
|
-
|
|
541
|
-
|
|
670
|
+
return {
|
|
671
|
+
...super.toLogEntry(ctx),
|
|
672
|
+
message
|
|
673
|
+
};
|
|
674
|
+
}
|
|
675
|
+
};
|
|
676
|
+
return MultilevelSensorCCGet2 = _classThis;
|
|
677
|
+
})();
|
|
678
|
+
let MultilevelSensorCCSupportedSensorReport = (() => {
|
|
679
|
+
let _classDecorators = [(0, import_CommandClassDecorators.CCCommand)(import_Types.MultilevelSensorCommand.SupportedSensorReport), (0, import_CommandClassDecorators.ccValueProperty)("supportedSensorTypes", MultilevelSensorCCValues.supportedSensorTypes)];
|
|
680
|
+
let _classDescriptor;
|
|
681
|
+
let _classExtraInitializers = [];
|
|
682
|
+
let _classThis;
|
|
683
|
+
let _classSuper = MultilevelSensorCC;
|
|
684
|
+
var MultilevelSensorCCSupportedSensorReport2 = class extends _classSuper {
|
|
685
|
+
static {
|
|
686
|
+
_classThis = this;
|
|
687
|
+
}
|
|
688
|
+
static {
|
|
689
|
+
const _metadata = typeof Symbol === "function" && Symbol.metadata ? Object.create(_classSuper[Symbol.metadata] ?? null) : void 0;
|
|
690
|
+
__esDecorate(null, _classDescriptor = { value: _classThis }, _classDecorators, { kind: "class", name: _classThis.name, metadata: _metadata }, null, _classExtraInitializers);
|
|
691
|
+
MultilevelSensorCCSupportedSensorReport2 = _classThis = _classDescriptor.value;
|
|
692
|
+
if (_metadata) Object.defineProperty(_classThis, Symbol.metadata, { enumerable: true, configurable: true, writable: true, value: _metadata });
|
|
693
|
+
__runInitializers(_classThis, _classExtraInitializers);
|
|
694
|
+
}
|
|
695
|
+
constructor(options) {
|
|
696
|
+
super(options);
|
|
697
|
+
this.supportedSensorTypes = options.supportedSensorTypes;
|
|
698
|
+
}
|
|
699
|
+
static from(raw, ctx) {
|
|
700
|
+
(0, import_safe.validatePayload)(raw.payload.length >= 1);
|
|
701
|
+
const supportedSensorTypes = (0, import_safe.parseBitMask)(raw.payload);
|
|
702
|
+
return new this({
|
|
703
|
+
nodeId: ctx.sourceNodeId,
|
|
704
|
+
supportedSensorTypes
|
|
705
|
+
});
|
|
706
|
+
}
|
|
707
|
+
// TODO: Use this during interview to precreate values
|
|
708
|
+
supportedSensorTypes;
|
|
709
|
+
serialize(ctx) {
|
|
710
|
+
this.payload = (0, import_core.encodeBitMask)(this.supportedSensorTypes);
|
|
711
|
+
return super.serialize(ctx);
|
|
712
|
+
}
|
|
713
|
+
toLogEntry(ctx) {
|
|
714
|
+
return {
|
|
715
|
+
...super.toLogEntry(ctx),
|
|
716
|
+
message: {
|
|
717
|
+
"supported sensor types": this.supportedSensorTypes.map((t) => `
|
|
718
|
+
\xB7 ${(0, import_core.getSensorName)(t)}`).join("")
|
|
719
|
+
}
|
|
720
|
+
};
|
|
721
|
+
}
|
|
722
|
+
};
|
|
723
|
+
return MultilevelSensorCCSupportedSensorReport2 = _classThis;
|
|
724
|
+
})();
|
|
725
|
+
let MultilevelSensorCCGetSupportedSensor = (() => {
|
|
726
|
+
let _classDecorators = [(0, import_CommandClassDecorators.CCCommand)(import_Types.MultilevelSensorCommand.GetSupportedSensor), (0, import_CommandClassDecorators.expectedCCResponse)(MultilevelSensorCCSupportedSensorReport)];
|
|
727
|
+
let _classDescriptor;
|
|
728
|
+
let _classExtraInitializers = [];
|
|
729
|
+
let _classThis;
|
|
730
|
+
let _classSuper = MultilevelSensorCC;
|
|
731
|
+
var MultilevelSensorCCGetSupportedSensor2 = class extends _classSuper {
|
|
732
|
+
static {
|
|
733
|
+
_classThis = this;
|
|
734
|
+
}
|
|
735
|
+
static {
|
|
736
|
+
const _metadata = typeof Symbol === "function" && Symbol.metadata ? Object.create(_classSuper[Symbol.metadata] ?? null) : void 0;
|
|
737
|
+
__esDecorate(null, _classDescriptor = { value: _classThis }, _classDecorators, { kind: "class", name: _classThis.name, metadata: _metadata }, null, _classExtraInitializers);
|
|
738
|
+
MultilevelSensorCCGetSupportedSensor2 = _classThis = _classDescriptor.value;
|
|
739
|
+
if (_metadata) Object.defineProperty(_classThis, Symbol.metadata, { enumerable: true, configurable: true, writable: true, value: _metadata });
|
|
740
|
+
__runInitializers(_classThis, _classExtraInitializers);
|
|
741
|
+
}
|
|
742
|
+
};
|
|
743
|
+
return MultilevelSensorCCGetSupportedSensor2 = _classThis;
|
|
744
|
+
})();
|
|
745
|
+
let MultilevelSensorCCSupportedScaleReport = (() => {
|
|
746
|
+
let _classDecorators = [(0, import_CommandClassDecorators.CCCommand)(import_Types.MultilevelSensorCommand.SupportedScaleReport), (0, import_CommandClassDecorators.ccValueProperty)("supportedScales", MultilevelSensorCCValues.supportedScales, (self) => [self.sensorType])];
|
|
747
|
+
let _classDescriptor;
|
|
748
|
+
let _classExtraInitializers = [];
|
|
749
|
+
let _classThis;
|
|
750
|
+
let _classSuper = MultilevelSensorCC;
|
|
751
|
+
var MultilevelSensorCCSupportedScaleReport2 = class extends _classSuper {
|
|
752
|
+
static {
|
|
753
|
+
_classThis = this;
|
|
754
|
+
}
|
|
755
|
+
static {
|
|
756
|
+
const _metadata = typeof Symbol === "function" && Symbol.metadata ? Object.create(_classSuper[Symbol.metadata] ?? null) : void 0;
|
|
757
|
+
__esDecorate(null, _classDescriptor = { value: _classThis }, _classDecorators, { kind: "class", name: _classThis.name, metadata: _metadata }, null, _classExtraInitializers);
|
|
758
|
+
MultilevelSensorCCSupportedScaleReport2 = _classThis = _classDescriptor.value;
|
|
759
|
+
if (_metadata) Object.defineProperty(_classThis, Symbol.metadata, { enumerable: true, configurable: true, writable: true, value: _metadata });
|
|
760
|
+
__runInitializers(_classThis, _classExtraInitializers);
|
|
761
|
+
}
|
|
762
|
+
constructor(options) {
|
|
763
|
+
super(options);
|
|
542
764
|
this.sensorType = options.sensorType;
|
|
543
|
-
this.
|
|
765
|
+
this.supportedScales = options.supportedScales;
|
|
544
766
|
}
|
|
545
|
-
|
|
546
|
-
|
|
547
|
-
if (raw.payload.length >= 2) {
|
|
767
|
+
static from(raw, ctx) {
|
|
768
|
+
(0, import_safe.validatePayload)(raw.payload.length >= 2);
|
|
548
769
|
const sensorType = raw.payload[0];
|
|
549
|
-
const
|
|
550
|
-
return new
|
|
770
|
+
const supportedScales = (0, import_safe.parseBitMask)(import_safe2.Bytes.from([raw.payload[1] & 15]), 0);
|
|
771
|
+
return new this({
|
|
551
772
|
nodeId: ctx.sourceNodeId,
|
|
552
773
|
sensorType,
|
|
553
|
-
|
|
554
|
-
});
|
|
555
|
-
} else {
|
|
556
|
-
return new MultilevelSensorCCGet_1({
|
|
557
|
-
nodeId: ctx.sourceNodeId
|
|
774
|
+
supportedScales
|
|
558
775
|
});
|
|
559
776
|
}
|
|
560
|
-
|
|
561
|
-
|
|
562
|
-
|
|
563
|
-
|
|
564
|
-
|
|
565
|
-
|
|
566
|
-
this.sensorType,
|
|
567
|
-
(this.scale & 3) << 3
|
|
777
|
+
sensorType;
|
|
778
|
+
supportedScales;
|
|
779
|
+
serialize(ctx) {
|
|
780
|
+
this.payload = import_safe2.Bytes.concat([
|
|
781
|
+
import_safe2.Bytes.from([this.sensorType]),
|
|
782
|
+
(0, import_core.encodeBitMask)(this.supportedScales, 4, 0)
|
|
568
783
|
]);
|
|
784
|
+
return super.serialize(ctx);
|
|
569
785
|
}
|
|
570
|
-
|
|
571
|
-
|
|
572
|
-
|
|
573
|
-
|
|
574
|
-
|
|
575
|
-
|
|
576
|
-
|
|
577
|
-
|
|
786
|
+
toLogEntry(ctx) {
|
|
787
|
+
return {
|
|
788
|
+
...super.toLogEntry(ctx),
|
|
789
|
+
message: {
|
|
790
|
+
"sensor type": (0, import_core.getSensorName)(this.sensorType),
|
|
791
|
+
"supported scales": this.supportedScales.map((s) => `
|
|
792
|
+
\xB7 ${((0, import_core.getSensorScale)(this.sensorType, s) ?? (0, import_core.getUnknownScale)(s)).label}`).join("")
|
|
793
|
+
}
|
|
578
794
|
};
|
|
579
795
|
}
|
|
580
|
-
|
|
581
|
-
|
|
582
|
-
|
|
583
|
-
|
|
584
|
-
|
|
585
|
-
|
|
586
|
-
|
|
587
|
-
|
|
588
|
-
|
|
589
|
-
|
|
590
|
-
|
|
591
|
-
|
|
592
|
-
|
|
593
|
-
|
|
594
|
-
|
|
595
|
-
|
|
596
|
-
|
|
597
|
-
|
|
598
|
-
|
|
599
|
-
|
|
600
|
-
|
|
601
|
-
|
|
602
|
-
|
|
603
|
-
|
|
604
|
-
|
|
605
|
-
|
|
606
|
-
|
|
607
|
-
|
|
608
|
-
|
|
609
|
-
|
|
610
|
-
|
|
611
|
-
|
|
612
|
-
|
|
613
|
-
|
|
614
|
-
|
|
615
|
-
|
|
616
|
-
}
|
|
617
|
-
|
|
618
|
-
|
|
619
|
-
|
|
620
|
-
|
|
621
|
-
|
|
622
|
-
|
|
623
|
-
|
|
624
|
-
|
|
625
|
-
|
|
626
|
-
|
|
627
|
-
|
|
628
|
-
(0, import_CommandClassDecorators.CCCommand)(import_Types.MultilevelSensorCommand.GetSupportedSensor),
|
|
629
|
-
(0, import_CommandClassDecorators.expectedCCResponse)(MultilevelSensorCCSupportedSensorReport)
|
|
630
|
-
], MultilevelSensorCCGetSupportedSensor);
|
|
631
|
-
let MultilevelSensorCCSupportedScaleReport = MultilevelSensorCCSupportedScaleReport_1 = class MultilevelSensorCCSupportedScaleReport2 extends MultilevelSensorCC {
|
|
632
|
-
constructor(options) {
|
|
633
|
-
super(options);
|
|
634
|
-
this.sensorType = options.sensorType;
|
|
635
|
-
this.supportedScales = options.supportedScales;
|
|
636
|
-
}
|
|
637
|
-
static from(raw, ctx) {
|
|
638
|
-
(0, import_safe.validatePayload)(raw.payload.length >= 2);
|
|
639
|
-
const sensorType = raw.payload[0];
|
|
640
|
-
const supportedScales = (0, import_safe.parseBitMask)(import_safe2.Bytes.from([raw.payload[1] & 15]), 0);
|
|
641
|
-
return new MultilevelSensorCCSupportedScaleReport_1({
|
|
642
|
-
nodeId: ctx.sourceNodeId,
|
|
643
|
-
sensorType,
|
|
644
|
-
supportedScales
|
|
645
|
-
});
|
|
646
|
-
}
|
|
647
|
-
sensorType;
|
|
648
|
-
supportedScales;
|
|
649
|
-
serialize(ctx) {
|
|
650
|
-
this.payload = import_safe2.Bytes.concat([
|
|
651
|
-
import_safe2.Bytes.from([this.sensorType]),
|
|
652
|
-
(0, import_core.encodeBitMask)(this.supportedScales, 4, 0)
|
|
653
|
-
]);
|
|
654
|
-
return super.serialize(ctx);
|
|
655
|
-
}
|
|
656
|
-
toLogEntry(ctx) {
|
|
657
|
-
return {
|
|
658
|
-
...super.toLogEntry(ctx),
|
|
659
|
-
message: {
|
|
660
|
-
"sensor type": (0, import_core.getSensorName)(this.sensorType),
|
|
661
|
-
"supported scales": this.supportedScales.map((s) => `
|
|
662
|
-
\xB7 ${((0, import_core.getSensorScale)(this.sensorType, s) ?? (0, import_core.getUnknownScale)(s)).label}`).join("")
|
|
663
|
-
}
|
|
664
|
-
};
|
|
665
|
-
}
|
|
666
|
-
};
|
|
667
|
-
__decorate([
|
|
668
|
-
(0, import_CommandClassDecorators.ccValue)(MultilevelSensorCCValues.supportedScales, (self) => [self.sensorType])
|
|
669
|
-
], MultilevelSensorCCSupportedScaleReport.prototype, "supportedScales", void 0);
|
|
670
|
-
MultilevelSensorCCSupportedScaleReport = MultilevelSensorCCSupportedScaleReport_1 = __decorate([
|
|
671
|
-
(0, import_CommandClassDecorators.CCCommand)(import_Types.MultilevelSensorCommand.SupportedScaleReport)
|
|
672
|
-
], MultilevelSensorCCSupportedScaleReport);
|
|
673
|
-
let MultilevelSensorCCGetSupportedScale = MultilevelSensorCCGetSupportedScale_1 = class MultilevelSensorCCGetSupportedScale2 extends MultilevelSensorCC {
|
|
674
|
-
constructor(options) {
|
|
675
|
-
super(options);
|
|
676
|
-
this.sensorType = options.sensorType;
|
|
677
|
-
}
|
|
678
|
-
static from(raw, ctx) {
|
|
679
|
-
(0, import_safe.validatePayload)(raw.payload.length >= 1);
|
|
680
|
-
const sensorType = raw.payload[0];
|
|
681
|
-
return new MultilevelSensorCCGetSupportedScale_1({
|
|
682
|
-
nodeId: ctx.sourceNodeId,
|
|
683
|
-
sensorType
|
|
684
|
-
});
|
|
685
|
-
}
|
|
686
|
-
sensorType;
|
|
687
|
-
serialize(ctx) {
|
|
688
|
-
this.payload = import_safe2.Bytes.from([this.sensorType]);
|
|
689
|
-
return super.serialize(ctx);
|
|
690
|
-
}
|
|
691
|
-
toLogEntry(ctx) {
|
|
692
|
-
return {
|
|
693
|
-
...super.toLogEntry(ctx),
|
|
694
|
-
message: {
|
|
695
|
-
"sensor type": (0, import_core.getSensorName)(this.sensorType)
|
|
696
|
-
}
|
|
697
|
-
};
|
|
698
|
-
}
|
|
699
|
-
};
|
|
700
|
-
MultilevelSensorCCGetSupportedScale = MultilevelSensorCCGetSupportedScale_1 = __decorate([
|
|
701
|
-
(0, import_CommandClassDecorators.CCCommand)(import_Types.MultilevelSensorCommand.GetSupportedScale),
|
|
702
|
-
(0, import_CommandClassDecorators.expectedCCResponse)(MultilevelSensorCCSupportedScaleReport)
|
|
703
|
-
], MultilevelSensorCCGetSupportedScale);
|
|
796
|
+
};
|
|
797
|
+
return MultilevelSensorCCSupportedScaleReport2 = _classThis;
|
|
798
|
+
})();
|
|
799
|
+
let MultilevelSensorCCGetSupportedScale = (() => {
|
|
800
|
+
let _classDecorators = [(0, import_CommandClassDecorators.CCCommand)(import_Types.MultilevelSensorCommand.GetSupportedScale), (0, import_CommandClassDecorators.expectedCCResponse)(MultilevelSensorCCSupportedScaleReport)];
|
|
801
|
+
let _classDescriptor;
|
|
802
|
+
let _classExtraInitializers = [];
|
|
803
|
+
let _classThis;
|
|
804
|
+
let _classSuper = MultilevelSensorCC;
|
|
805
|
+
var MultilevelSensorCCGetSupportedScale2 = class extends _classSuper {
|
|
806
|
+
static {
|
|
807
|
+
_classThis = this;
|
|
808
|
+
}
|
|
809
|
+
static {
|
|
810
|
+
const _metadata = typeof Symbol === "function" && Symbol.metadata ? Object.create(_classSuper[Symbol.metadata] ?? null) : void 0;
|
|
811
|
+
__esDecorate(null, _classDescriptor = { value: _classThis }, _classDecorators, { kind: "class", name: _classThis.name, metadata: _metadata }, null, _classExtraInitializers);
|
|
812
|
+
MultilevelSensorCCGetSupportedScale2 = _classThis = _classDescriptor.value;
|
|
813
|
+
if (_metadata) Object.defineProperty(_classThis, Symbol.metadata, { enumerable: true, configurable: true, writable: true, value: _metadata });
|
|
814
|
+
__runInitializers(_classThis, _classExtraInitializers);
|
|
815
|
+
}
|
|
816
|
+
constructor(options) {
|
|
817
|
+
super(options);
|
|
818
|
+
this.sensorType = options.sensorType;
|
|
819
|
+
}
|
|
820
|
+
static from(raw, ctx) {
|
|
821
|
+
(0, import_safe.validatePayload)(raw.payload.length >= 1);
|
|
822
|
+
const sensorType = raw.payload[0];
|
|
823
|
+
return new this({
|
|
824
|
+
nodeId: ctx.sourceNodeId,
|
|
825
|
+
sensorType
|
|
826
|
+
});
|
|
827
|
+
}
|
|
828
|
+
sensorType;
|
|
829
|
+
serialize(ctx) {
|
|
830
|
+
this.payload = import_safe2.Bytes.from([this.sensorType]);
|
|
831
|
+
return super.serialize(ctx);
|
|
832
|
+
}
|
|
833
|
+
toLogEntry(ctx) {
|
|
834
|
+
return {
|
|
835
|
+
...super.toLogEntry(ctx),
|
|
836
|
+
message: {
|
|
837
|
+
"sensor type": (0, import_core.getSensorName)(this.sensorType)
|
|
838
|
+
}
|
|
839
|
+
};
|
|
840
|
+
}
|
|
841
|
+
};
|
|
842
|
+
return MultilevelSensorCCGetSupportedScale2 = _classThis;
|
|
843
|
+
})();
|
|
704
844
|
// Annotate the CommonJS export names for ESM import in node:
|
|
705
845
|
0 && (module.exports = {
|
|
706
846
|
MultilevelSensorCC,
|