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