@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
|
@@ -35,13 +35,45 @@ var import_CommandClass = require("../lib/CommandClass.js");
|
|
|
35
35
|
var import_CommandClassDecorators = require("../lib/CommandClassDecorators.js");
|
|
36
36
|
var import_Values = require("../lib/Values.js");
|
|
37
37
|
var import_Types = require("../lib/_Types.js");
|
|
38
|
-
var
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
38
|
+
var __esDecorate = function(ctor, descriptorIn, decorators, contextIn, initializers, extraInitializers) {
|
|
39
|
+
function accept(f) {
|
|
40
|
+
if (f !== void 0 && typeof f !== "function") throw new TypeError("Function expected");
|
|
41
|
+
return f;
|
|
42
|
+
}
|
|
43
|
+
var kind = contextIn.kind, key = kind === "getter" ? "get" : kind === "setter" ? "set" : "value";
|
|
44
|
+
var target = !descriptorIn && ctor ? contextIn["static"] ? ctor : ctor.prototype : null;
|
|
45
|
+
var descriptor = descriptorIn || (target ? Object.getOwnPropertyDescriptor(target, contextIn.name) : {});
|
|
46
|
+
var _, done = false;
|
|
47
|
+
for (var i = decorators.length - 1; i >= 0; i--) {
|
|
48
|
+
var context = {};
|
|
49
|
+
for (var p in contextIn) context[p] = p === "access" ? {} : contextIn[p];
|
|
50
|
+
for (var p in contextIn.access) context.access[p] = contextIn.access[p];
|
|
51
|
+
context.addInitializer = function(f) {
|
|
52
|
+
if (done) throw new TypeError("Cannot add initializers after decoration has completed");
|
|
53
|
+
extraInitializers.push(accept(f || null));
|
|
54
|
+
};
|
|
55
|
+
var result = (0, decorators[i])(kind === "accessor" ? { get: descriptor.get, set: descriptor.set } : descriptor[key], context);
|
|
56
|
+
if (kind === "accessor") {
|
|
57
|
+
if (result === void 0) continue;
|
|
58
|
+
if (result === null || typeof result !== "object") throw new TypeError("Object expected");
|
|
59
|
+
if (_ = accept(result.get)) descriptor.get = _;
|
|
60
|
+
if (_ = accept(result.set)) descriptor.set = _;
|
|
61
|
+
if (_ = accept(result.init)) initializers.unshift(_);
|
|
62
|
+
} else if (_ = accept(result)) {
|
|
63
|
+
if (kind === "field") initializers.unshift(_);
|
|
64
|
+
else descriptor[key] = _;
|
|
65
|
+
}
|
|
66
|
+
}
|
|
67
|
+
if (target) Object.defineProperty(target, contextIn.name, descriptor);
|
|
68
|
+
done = true;
|
|
69
|
+
};
|
|
70
|
+
var __runInitializers = function(thisArg, initializers, value) {
|
|
71
|
+
var useValue = arguments.length > 2;
|
|
72
|
+
for (var i = 0; i < initializers.length; i++) {
|
|
73
|
+
value = useValue ? initializers[i].call(thisArg, value) : initializers[i].call(thisArg);
|
|
74
|
+
}
|
|
75
|
+
return useValue ? value : void 0;
|
|
43
76
|
};
|
|
44
|
-
var BinarySensorCCReport_1, BinarySensorCCGet_1, BinarySensorCCSupportedReport_1;
|
|
45
77
|
function __assertType(argName, typeName, boundHasError) {
|
|
46
78
|
const { ZWaveError, ZWaveErrorCodes } = require("@zwave-js/core");
|
|
47
79
|
if (boundHasError()) {
|
|
@@ -119,305 +151,388 @@ const BinarySensorCCValues = Object.freeze({
|
|
|
119
151
|
)
|
|
120
152
|
})
|
|
121
153
|
});
|
|
122
|
-
let BinarySensorCCAPI =
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
154
|
+
let BinarySensorCCAPI = (() => {
|
|
155
|
+
let _classDecorators = [(0, import_CommandClassDecorators.API)(import_safe.CommandClasses["Binary Sensor"])];
|
|
156
|
+
let _classDescriptor;
|
|
157
|
+
let _classExtraInitializers = [];
|
|
158
|
+
let _classThis;
|
|
159
|
+
let _classSuper = import_API.PhysicalCCAPI;
|
|
160
|
+
var BinarySensorCCAPI2 = class extends _classSuper {
|
|
161
|
+
static {
|
|
162
|
+
_classThis = this;
|
|
163
|
+
}
|
|
164
|
+
static {
|
|
165
|
+
const _metadata = typeof Symbol === "function" && Symbol.metadata ? Object.create(_classSuper[Symbol.metadata] ?? null) : void 0;
|
|
166
|
+
__esDecorate(null, _classDescriptor = { value: _classThis }, _classDecorators, { kind: "class", name: _classThis.name, metadata: _metadata }, null, _classExtraInitializers);
|
|
167
|
+
BinarySensorCCAPI2 = _classThis = _classDescriptor.value;
|
|
168
|
+
if (_metadata) Object.defineProperty(_classThis, Symbol.metadata, { enumerable: true, configurable: true, writable: true, value: _metadata });
|
|
169
|
+
__runInitializers(_classThis, _classExtraInitializers);
|
|
170
|
+
}
|
|
171
|
+
supportsCommand(cmd) {
|
|
172
|
+
switch (cmd) {
|
|
173
|
+
case import_Types.BinarySensorCommand.Get:
|
|
174
|
+
case import_Types.BinarySensorCommand.Report:
|
|
175
|
+
return true;
|
|
176
|
+
// This is mandatory
|
|
177
|
+
case import_Types.BinarySensorCommand.SupportedGet:
|
|
178
|
+
case import_Types.BinarySensorCommand.SupportedReport:
|
|
179
|
+
return this.version >= 2;
|
|
141
180
|
}
|
|
142
|
-
|
|
143
|
-
}
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
nodeId: this.endpoint.nodeId,
|
|
166
|
-
endpointIndex: this.endpoint.index,
|
|
167
|
-
value,
|
|
168
|
-
type: sensorType
|
|
169
|
-
});
|
|
170
|
-
return this.host.sendCommand(cc, this.commandOptions);
|
|
171
|
-
}
|
|
172
|
-
async getSupportedSensorTypes() {
|
|
173
|
-
this.assertSupportsCommand(import_Types.BinarySensorCommand, import_Types.BinarySensorCommand.SupportedGet);
|
|
174
|
-
const cc = new BinarySensorCCSupportedGet({
|
|
175
|
-
nodeId: this.endpoint.nodeId,
|
|
176
|
-
endpointIndex: this.endpoint.index
|
|
177
|
-
});
|
|
178
|
-
const response = await this.host.sendCommand(cc, this.commandOptions);
|
|
179
|
-
return response?.supportedSensorTypes;
|
|
180
|
-
}
|
|
181
|
-
async reportSupportedSensorTypes(supported) {
|
|
182
|
-
__assertType("supported", void 0, __assertType__sa_su__3__4__5__6__7__8__9__10__11__12__13__14__15__16_eu_ea_2.bind(void 0, supported));
|
|
183
|
-
this.assertSupportsCommand(import_Types.BinarySensorCommand, import_Types.BinarySensorCommand.SupportedReport);
|
|
184
|
-
const cc = new BinarySensorCCSupportedReport({
|
|
185
|
-
nodeId: this.endpoint.nodeId,
|
|
186
|
-
endpointIndex: this.endpoint.index,
|
|
187
|
-
supportedSensorTypes: supported
|
|
188
|
-
});
|
|
189
|
-
return this.host.sendCommand(cc, this.commandOptions);
|
|
190
|
-
}
|
|
191
|
-
};
|
|
192
|
-
BinarySensorCCAPI = __decorate([
|
|
193
|
-
(0, import_CommandClassDecorators.API)(import_safe.CommandClasses["Binary Sensor"])
|
|
194
|
-
], BinarySensorCCAPI);
|
|
195
|
-
let BinarySensorCC = class BinarySensorCC2 extends import_CommandClass.CommandClass {
|
|
196
|
-
async interview(ctx) {
|
|
197
|
-
const node = this.getNode(ctx);
|
|
198
|
-
const endpoint = this.getEndpoint(ctx);
|
|
199
|
-
const api = import_API.CCAPI.create(import_safe.CommandClasses["Binary Sensor"], ctx, endpoint).withOptions({
|
|
200
|
-
priority: import_safe.MessagePriority.NodeQuery
|
|
201
|
-
});
|
|
202
|
-
ctx.logNode(node.id, {
|
|
203
|
-
endpoint: this.endpointIndex,
|
|
204
|
-
message: `Interviewing ${this.ccName}...`,
|
|
205
|
-
direction: "none"
|
|
206
|
-
});
|
|
207
|
-
if (api.version >= 2) {
|
|
208
|
-
ctx.logNode(node.id, {
|
|
209
|
-
endpoint: this.endpointIndex,
|
|
210
|
-
message: "querying supported sensor types...",
|
|
211
|
-
direction: "outbound"
|
|
181
|
+
return super.supportsCommand(cmd);
|
|
182
|
+
}
|
|
183
|
+
get [import_API.POLL_VALUE]() {
|
|
184
|
+
return async function({ property }) {
|
|
185
|
+
if (typeof property === "string") {
|
|
186
|
+
const sensorType = import_Types.BinarySensorType[property];
|
|
187
|
+
if (sensorType)
|
|
188
|
+
return this.get(sensorType);
|
|
189
|
+
}
|
|
190
|
+
(0, import_API.throwUnsupportedProperty)(this.ccId, property);
|
|
191
|
+
};
|
|
192
|
+
}
|
|
193
|
+
/**
|
|
194
|
+
* Retrieves the current value from this sensor
|
|
195
|
+
* @param sensorType The (optional) sensor type to retrieve the value for
|
|
196
|
+
*/
|
|
197
|
+
async get(sensorType) {
|
|
198
|
+
__assertType("sensorType", "(optional) BinarySensorType", __assertType__optional_BinarySensorType.bind(void 0, sensorType));
|
|
199
|
+
this.assertSupportsCommand(import_Types.BinarySensorCommand, import_Types.BinarySensorCommand.Get);
|
|
200
|
+
const cc = new BinarySensorCCGet({
|
|
201
|
+
nodeId: this.endpoint.nodeId,
|
|
202
|
+
endpointIndex: this.endpoint.index,
|
|
203
|
+
sensorType
|
|
212
204
|
});
|
|
213
|
-
const
|
|
214
|
-
|
|
215
|
-
const logMessage = `received supported sensor types: ${supportedSensorTypes.map((type) => (0, import_safe3.getEnumMemberName)(import_Types.BinarySensorType, type)).map((name) => `
|
|
216
|
-
\xB7 ${name}`).join("")}`;
|
|
217
|
-
ctx.logNode(node.id, {
|
|
218
|
-
endpoint: this.endpointIndex,
|
|
219
|
-
message: logMessage,
|
|
220
|
-
direction: "inbound"
|
|
221
|
-
});
|
|
222
|
-
} else {
|
|
223
|
-
ctx.logNode(node.id, {
|
|
224
|
-
endpoint: this.endpointIndex,
|
|
225
|
-
message: "Querying supported sensor types timed out, skipping interview...",
|
|
226
|
-
level: "warn"
|
|
227
|
-
});
|
|
228
|
-
return;
|
|
229
|
-
}
|
|
205
|
+
const response = await this.host.sendCommand(cc, this.commandOptions);
|
|
206
|
+
return response?.value;
|
|
230
207
|
}
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
208
|
+
async sendReport(value, sensorType) {
|
|
209
|
+
__assertType("value", "boolean", __assertType__boolean.bind(void 0, value));
|
|
210
|
+
__assertType("sensorType", "(optional) BinarySensorType", __assertType__optional_number.bind(void 0, sensorType));
|
|
211
|
+
this.assertSupportsCommand(import_Types.BinarySensorCommand, import_Types.BinarySensorCommand.Report);
|
|
212
|
+
const cc = new BinarySensorCCReport({
|
|
213
|
+
nodeId: this.endpoint.nodeId,
|
|
214
|
+
endpointIndex: this.endpoint.index,
|
|
215
|
+
value,
|
|
216
|
+
type: sensorType
|
|
217
|
+
});
|
|
218
|
+
return this.host.sendCommand(cc, this.commandOptions);
|
|
219
|
+
}
|
|
220
|
+
async getSupportedSensorTypes() {
|
|
221
|
+
this.assertSupportsCommand(import_Types.BinarySensorCommand, import_Types.BinarySensorCommand.SupportedGet);
|
|
222
|
+
const cc = new BinarySensorCCSupportedGet({
|
|
223
|
+
nodeId: this.endpoint.nodeId,
|
|
224
|
+
endpointIndex: this.endpoint.index
|
|
225
|
+
});
|
|
226
|
+
const response = await this.host.sendCommand(cc, this.commandOptions);
|
|
227
|
+
return response?.supportedSensorTypes;
|
|
228
|
+
}
|
|
229
|
+
async reportSupportedSensorTypes(supported) {
|
|
230
|
+
__assertType("supported", void 0, __assertType__sa_su__3__4__5__6__7__8__9__10__11__12__13__14__15__16_eu_ea_2.bind(void 0, supported));
|
|
231
|
+
this.assertSupportsCommand(import_Types.BinarySensorCommand, import_Types.BinarySensorCommand.SupportedReport);
|
|
232
|
+
const cc = new BinarySensorCCSupportedReport({
|
|
233
|
+
nodeId: this.endpoint.nodeId,
|
|
234
|
+
endpointIndex: this.endpoint.index,
|
|
235
|
+
supportedSensorTypes: supported
|
|
236
|
+
});
|
|
237
|
+
return this.host.sendCommand(cc, this.commandOptions);
|
|
238
|
+
}
|
|
239
|
+
};
|
|
240
|
+
return BinarySensorCCAPI2 = _classThis;
|
|
241
|
+
})();
|
|
242
|
+
let BinarySensorCC = (() => {
|
|
243
|
+
let _classDecorators = [(0, import_CommandClassDecorators.commandClass)(import_safe.CommandClasses["Binary Sensor"]), (0, import_CommandClassDecorators.implementedVersion)(2), (0, import_CommandClassDecorators.ccValues)(BinarySensorCCValues)];
|
|
244
|
+
let _classDescriptor;
|
|
245
|
+
let _classExtraInitializers = [];
|
|
246
|
+
let _classThis;
|
|
247
|
+
let _classSuper = import_CommandClass.CommandClass;
|
|
248
|
+
var BinarySensorCC2 = class extends _classSuper {
|
|
249
|
+
static {
|
|
250
|
+
_classThis = this;
|
|
251
|
+
}
|
|
252
|
+
static {
|
|
253
|
+
const _metadata = typeof Symbol === "function" && Symbol.metadata ? Object.create(_classSuper[Symbol.metadata] ?? null) : void 0;
|
|
254
|
+
__esDecorate(null, _classDescriptor = { value: _classThis }, _classDecorators, { kind: "class", name: _classThis.name, metadata: _metadata }, null, _classExtraInitializers);
|
|
255
|
+
BinarySensorCC2 = _classThis = _classDescriptor.value;
|
|
256
|
+
if (_metadata) Object.defineProperty(_classThis, Symbol.metadata, { enumerable: true, configurable: true, writable: true, value: _metadata });
|
|
257
|
+
__runInitializers(_classThis, _classExtraInitializers);
|
|
258
|
+
}
|
|
259
|
+
async interview(ctx) {
|
|
260
|
+
const node = this.getNode(ctx);
|
|
261
|
+
const endpoint = this.getEndpoint(ctx);
|
|
262
|
+
const api = import_API.CCAPI.create(import_safe.CommandClasses["Binary Sensor"], ctx, endpoint).withOptions({
|
|
263
|
+
priority: import_safe.MessagePriority.NodeQuery
|
|
264
|
+
});
|
|
241
265
|
ctx.logNode(node.id, {
|
|
242
266
|
endpoint: this.endpointIndex,
|
|
243
|
-
message:
|
|
244
|
-
direction: "
|
|
267
|
+
message: `Interviewing ${this.ccName}...`,
|
|
268
|
+
direction: "none"
|
|
245
269
|
});
|
|
246
|
-
|
|
247
|
-
if (currentValue != void 0) {
|
|
270
|
+
if (api.version >= 2) {
|
|
248
271
|
ctx.logNode(node.id, {
|
|
249
272
|
endpoint: this.endpointIndex,
|
|
250
|
-
message:
|
|
251
|
-
direction: "
|
|
273
|
+
message: "querying supported sensor types...",
|
|
274
|
+
direction: "outbound"
|
|
252
275
|
});
|
|
276
|
+
const supportedSensorTypes = await api.getSupportedSensorTypes();
|
|
277
|
+
if (supportedSensorTypes) {
|
|
278
|
+
const logMessage = `received supported sensor types: ${supportedSensorTypes.map((type) => (0, import_safe3.getEnumMemberName)(import_Types.BinarySensorType, type)).map((name) => `
|
|
279
|
+
\xB7 ${name}`).join("")}`;
|
|
280
|
+
ctx.logNode(node.id, {
|
|
281
|
+
endpoint: this.endpointIndex,
|
|
282
|
+
message: logMessage,
|
|
283
|
+
direction: "inbound"
|
|
284
|
+
});
|
|
285
|
+
} else {
|
|
286
|
+
ctx.logNode(node.id, {
|
|
287
|
+
endpoint: this.endpointIndex,
|
|
288
|
+
message: "Querying supported sensor types timed out, skipping interview...",
|
|
289
|
+
level: "warn"
|
|
290
|
+
});
|
|
291
|
+
return;
|
|
292
|
+
}
|
|
253
293
|
}
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
294
|
+
await this.refreshValues(ctx);
|
|
295
|
+
this.setInterviewComplete(ctx, true);
|
|
296
|
+
}
|
|
297
|
+
async refreshValues(ctx) {
|
|
298
|
+
const node = this.getNode(ctx);
|
|
299
|
+
const endpoint = this.getEndpoint(ctx);
|
|
300
|
+
const api = import_API.CCAPI.create(import_safe.CommandClasses["Binary Sensor"], ctx, endpoint).withOptions({
|
|
301
|
+
priority: import_safe.MessagePriority.NodeQuery
|
|
302
|
+
});
|
|
303
|
+
if (api.version === 1) {
|
|
260
304
|
ctx.logNode(node.id, {
|
|
261
305
|
endpoint: this.endpointIndex,
|
|
262
|
-
message:
|
|
306
|
+
message: "querying current value...",
|
|
263
307
|
direction: "outbound"
|
|
264
308
|
});
|
|
265
|
-
const currentValue = await api.get(
|
|
309
|
+
const currentValue = await api.get();
|
|
266
310
|
if (currentValue != void 0) {
|
|
267
311
|
ctx.logNode(node.id, {
|
|
268
312
|
endpoint: this.endpointIndex,
|
|
269
|
-
message: `received current value
|
|
313
|
+
message: `received current value: ${currentValue}`,
|
|
270
314
|
direction: "inbound"
|
|
271
315
|
});
|
|
272
316
|
}
|
|
317
|
+
} else {
|
|
318
|
+
const supportedSensorTypes = this.getValue(ctx, BinarySensorCCValues.supportedSensorTypes) ?? [];
|
|
319
|
+
for (const type of supportedSensorTypes) {
|
|
320
|
+
if (!(0, import_safe3.isEnumMember)(import_Types.BinarySensorType, type))
|
|
321
|
+
continue;
|
|
322
|
+
const sensorName = (0, import_safe3.getEnumMemberName)(import_Types.BinarySensorType, type);
|
|
323
|
+
ctx.logNode(node.id, {
|
|
324
|
+
endpoint: this.endpointIndex,
|
|
325
|
+
message: `querying current value for ${sensorName}...`,
|
|
326
|
+
direction: "outbound"
|
|
327
|
+
});
|
|
328
|
+
const currentValue = await api.get(type);
|
|
329
|
+
if (currentValue != void 0) {
|
|
330
|
+
ctx.logNode(node.id, {
|
|
331
|
+
endpoint: this.endpointIndex,
|
|
332
|
+
message: `received current value for ${sensorName}: ${currentValue}`,
|
|
333
|
+
direction: "inbound"
|
|
334
|
+
});
|
|
335
|
+
}
|
|
336
|
+
}
|
|
273
337
|
}
|
|
274
338
|
}
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
}
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
(0, import_CommandClassDecorators.
|
|
291
|
-
|
|
292
|
-
]
|
|
293
|
-
let
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
}
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
}
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
const supportedSensorTypes = this.getValue(ctx, BinarySensorCCValues.supportedSensorTypes);
|
|
318
|
-
if (supportedSensorTypes?.length) {
|
|
319
|
-
sensorType = supportedSensorTypes[0];
|
|
339
|
+
/**
|
|
340
|
+
* Returns which sensor types are supported.
|
|
341
|
+
* This only works AFTER the interview process
|
|
342
|
+
*/
|
|
343
|
+
static getSupportedSensorTypesCached(ctx, endpoint) {
|
|
344
|
+
return ctx.getValueDB(endpoint.nodeId).getValue(BinarySensorCCValues.supportedSensorTypes.endpoint(endpoint.index));
|
|
345
|
+
}
|
|
346
|
+
setMappedBasicValue(ctx, value) {
|
|
347
|
+
this.setValue(ctx, BinarySensorCCValues.state(import_Types.BinarySensorType.Any), value > 0);
|
|
348
|
+
return true;
|
|
349
|
+
}
|
|
350
|
+
};
|
|
351
|
+
return BinarySensorCC2 = _classThis;
|
|
352
|
+
})();
|
|
353
|
+
let BinarySensorCCReport = (() => {
|
|
354
|
+
let _classDecorators = [(0, import_CommandClassDecorators.CCCommand)(import_Types.BinarySensorCommand.Report)];
|
|
355
|
+
let _classDescriptor;
|
|
356
|
+
let _classExtraInitializers = [];
|
|
357
|
+
let _classThis;
|
|
358
|
+
let _classSuper = BinarySensorCC;
|
|
359
|
+
var BinarySensorCCReport2 = class extends _classSuper {
|
|
360
|
+
static {
|
|
361
|
+
_classThis = this;
|
|
362
|
+
}
|
|
363
|
+
static {
|
|
364
|
+
const _metadata = typeof Symbol === "function" && Symbol.metadata ? Object.create(_classSuper[Symbol.metadata] ?? null) : void 0;
|
|
365
|
+
__esDecorate(null, _classDescriptor = { value: _classThis }, _classDecorators, { kind: "class", name: _classThis.name, metadata: _metadata }, null, _classExtraInitializers);
|
|
366
|
+
BinarySensorCCReport2 = _classThis = _classDescriptor.value;
|
|
367
|
+
if (_metadata) Object.defineProperty(_classThis, Symbol.metadata, { enumerable: true, configurable: true, writable: true, value: _metadata });
|
|
368
|
+
__runInitializers(_classThis, _classExtraInitializers);
|
|
369
|
+
}
|
|
370
|
+
constructor(options) {
|
|
371
|
+
super(options);
|
|
372
|
+
this.type = options.type ?? import_Types.BinarySensorType.Any;
|
|
373
|
+
this.value = options.value;
|
|
374
|
+
}
|
|
375
|
+
static from(raw, ctx) {
|
|
376
|
+
(0, import_safe.validatePayload)(raw.payload.length >= 1);
|
|
377
|
+
const value = raw.payload[0] === 255;
|
|
378
|
+
let type = import_Types.BinarySensorType.Any;
|
|
379
|
+
if (raw.payload.length >= 2) {
|
|
380
|
+
type = raw.payload[1];
|
|
320
381
|
}
|
|
382
|
+
return new this({
|
|
383
|
+
nodeId: ctx.sourceNodeId,
|
|
384
|
+
value,
|
|
385
|
+
type
|
|
386
|
+
});
|
|
321
387
|
}
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
return super.serialize(ctx);
|
|
332
|
-
}
|
|
333
|
-
toLogEntry(ctx) {
|
|
334
|
-
return {
|
|
335
|
-
...super.toLogEntry(ctx),
|
|
336
|
-
message: {
|
|
337
|
-
type: (0, import_safe3.getEnumMemberName)(import_Types.BinarySensorType, this.type),
|
|
338
|
-
value: this.value
|
|
388
|
+
persistValues(ctx) {
|
|
389
|
+
if (!super.persistValues(ctx))
|
|
390
|
+
return false;
|
|
391
|
+
let sensorType = this.type;
|
|
392
|
+
if (sensorType === import_Types.BinarySensorType.Any) {
|
|
393
|
+
const supportedSensorTypes = this.getValue(ctx, BinarySensorCCValues.supportedSensorTypes);
|
|
394
|
+
if (supportedSensorTypes?.length) {
|
|
395
|
+
sensorType = supportedSensorTypes[0];
|
|
396
|
+
}
|
|
339
397
|
}
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
398
|
+
const binarySensorValue = BinarySensorCCValues.state(sensorType);
|
|
399
|
+
this.setMetadata(ctx, binarySensorValue, binarySensorValue.meta);
|
|
400
|
+
this.setValue(ctx, binarySensorValue, this.value);
|
|
401
|
+
return true;
|
|
402
|
+
}
|
|
403
|
+
type;
|
|
404
|
+
value;
|
|
405
|
+
serialize(ctx) {
|
|
406
|
+
this.payload = import_safe2.Bytes.from([this.value ? 255 : 0, this.type]);
|
|
407
|
+
return super.serialize(ctx);
|
|
408
|
+
}
|
|
409
|
+
toLogEntry(ctx) {
|
|
410
|
+
return {
|
|
411
|
+
...super.toLogEntry(ctx),
|
|
412
|
+
message: {
|
|
413
|
+
type: (0, import_safe3.getEnumMemberName)(import_Types.BinarySensorType, this.type),
|
|
414
|
+
value: this.value
|
|
415
|
+
}
|
|
416
|
+
};
|
|
417
|
+
}
|
|
418
|
+
};
|
|
419
|
+
return BinarySensorCCReport2 = _classThis;
|
|
420
|
+
})();
|
|
346
421
|
function testResponseForBinarySensorGet(sent, received) {
|
|
347
422
|
return sent.sensorType == void 0 || sent.sensorType === import_Types.BinarySensorType.Any || received.type === sent.sensorType || received.type === import_Types.BinarySensorType.Any;
|
|
348
423
|
}
|
|
349
|
-
let BinarySensorCCGet =
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
}
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
}
|
|
375
|
-
};
|
|
376
|
-
}
|
|
377
|
-
};
|
|
378
|
-
BinarySensorCCGet = BinarySensorCCGet_1 = __decorate([
|
|
379
|
-
(0, import_CommandClassDecorators.CCCommand)(import_Types.BinarySensorCommand.Get),
|
|
380
|
-
(0, import_CommandClassDecorators.expectedCCResponse)(BinarySensorCCReport, testResponseForBinarySensorGet)
|
|
381
|
-
], BinarySensorCCGet);
|
|
382
|
-
let BinarySensorCCSupportedReport = BinarySensorCCSupportedReport_1 = class BinarySensorCCSupportedReport2 extends BinarySensorCC {
|
|
383
|
-
constructor(options) {
|
|
384
|
-
super(options);
|
|
385
|
-
this.supportedSensorTypes = options.supportedSensorTypes;
|
|
386
|
-
}
|
|
387
|
-
static from(raw, ctx) {
|
|
388
|
-
(0, import_safe.validatePayload)(raw.payload.length >= 1);
|
|
389
|
-
const supportedSensorTypes = (0, import_safe.parseBitMask)(raw.payload, 0).filter((t) => t !== 0);
|
|
390
|
-
return new BinarySensorCCSupportedReport_1({
|
|
391
|
-
nodeId: ctx.sourceNodeId,
|
|
392
|
-
supportedSensorTypes
|
|
393
|
-
});
|
|
394
|
-
}
|
|
395
|
-
supportedSensorTypes;
|
|
396
|
-
serialize(ctx) {
|
|
397
|
-
this.payload = (0, import_safe.encodeBitMask)(this.supportedSensorTypes.filter((t) => t !== import_Types.BinarySensorType.Any), void 0, 0);
|
|
398
|
-
return super.serialize(ctx);
|
|
399
|
-
}
|
|
400
|
-
toLogEntry(ctx) {
|
|
401
|
-
return {
|
|
402
|
-
...super.toLogEntry(ctx),
|
|
403
|
-
message: {
|
|
404
|
-
"supported types": this.supportedSensorTypes.map((type) => (0, import_safe3.getEnumMemberName)(import_Types.BinarySensorType, type)).join(", ")
|
|
424
|
+
let BinarySensorCCGet = (() => {
|
|
425
|
+
let _classDecorators = [(0, import_CommandClassDecorators.CCCommand)(import_Types.BinarySensorCommand.Get), (0, import_CommandClassDecorators.expectedCCResponse)(BinarySensorCCReport, testResponseForBinarySensorGet)];
|
|
426
|
+
let _classDescriptor;
|
|
427
|
+
let _classExtraInitializers = [];
|
|
428
|
+
let _classThis;
|
|
429
|
+
let _classSuper = BinarySensorCC;
|
|
430
|
+
var BinarySensorCCGet2 = class extends _classSuper {
|
|
431
|
+
static {
|
|
432
|
+
_classThis = this;
|
|
433
|
+
}
|
|
434
|
+
static {
|
|
435
|
+
const _metadata = typeof Symbol === "function" && Symbol.metadata ? Object.create(_classSuper[Symbol.metadata] ?? null) : void 0;
|
|
436
|
+
__esDecorate(null, _classDescriptor = { value: _classThis }, _classDecorators, { kind: "class", name: _classThis.name, metadata: _metadata }, null, _classExtraInitializers);
|
|
437
|
+
BinarySensorCCGet2 = _classThis = _classDescriptor.value;
|
|
438
|
+
if (_metadata) Object.defineProperty(_classThis, Symbol.metadata, { enumerable: true, configurable: true, writable: true, value: _metadata });
|
|
439
|
+
__runInitializers(_classThis, _classExtraInitializers);
|
|
440
|
+
}
|
|
441
|
+
constructor(options) {
|
|
442
|
+
super(options);
|
|
443
|
+
this.sensorType = options.sensorType;
|
|
444
|
+
}
|
|
445
|
+
static from(raw, ctx) {
|
|
446
|
+
let sensorType;
|
|
447
|
+
if (raw.payload.length >= 1) {
|
|
448
|
+
sensorType = raw.payload[0];
|
|
405
449
|
}
|
|
406
|
-
|
|
407
|
-
|
|
408
|
-
|
|
409
|
-
|
|
410
|
-
|
|
411
|
-
|
|
412
|
-
|
|
413
|
-
|
|
414
|
-
|
|
415
|
-
|
|
416
|
-
|
|
417
|
-
|
|
418
|
-
|
|
419
|
-
|
|
420
|
-
|
|
450
|
+
return new this({
|
|
451
|
+
nodeId: ctx.sourceNodeId,
|
|
452
|
+
sensorType
|
|
453
|
+
});
|
|
454
|
+
}
|
|
455
|
+
sensorType;
|
|
456
|
+
serialize(ctx) {
|
|
457
|
+
this.payload = import_safe2.Bytes.from([this.sensorType ?? import_Types.BinarySensorType.Any]);
|
|
458
|
+
return super.serialize(ctx);
|
|
459
|
+
}
|
|
460
|
+
toLogEntry(ctx) {
|
|
461
|
+
return {
|
|
462
|
+
...super.toLogEntry(ctx),
|
|
463
|
+
message: {
|
|
464
|
+
type: (0, import_safe3.getEnumMemberName)(import_Types.BinarySensorType, this.sensorType ?? import_Types.BinarySensorType.Any)
|
|
465
|
+
}
|
|
466
|
+
};
|
|
467
|
+
}
|
|
468
|
+
};
|
|
469
|
+
return BinarySensorCCGet2 = _classThis;
|
|
470
|
+
})();
|
|
471
|
+
let BinarySensorCCSupportedReport = (() => {
|
|
472
|
+
let _classDecorators = [(0, import_CommandClassDecorators.CCCommand)(import_Types.BinarySensorCommand.SupportedReport), (0, import_CommandClassDecorators.ccValueProperty)("supportedSensorTypes", BinarySensorCCValues.supportedSensorTypes)];
|
|
473
|
+
let _classDescriptor;
|
|
474
|
+
let _classExtraInitializers = [];
|
|
475
|
+
let _classThis;
|
|
476
|
+
let _classSuper = BinarySensorCC;
|
|
477
|
+
var BinarySensorCCSupportedReport2 = class extends _classSuper {
|
|
478
|
+
static {
|
|
479
|
+
_classThis = this;
|
|
480
|
+
}
|
|
481
|
+
static {
|
|
482
|
+
const _metadata = typeof Symbol === "function" && Symbol.metadata ? Object.create(_classSuper[Symbol.metadata] ?? null) : void 0;
|
|
483
|
+
__esDecorate(null, _classDescriptor = { value: _classThis }, _classDecorators, { kind: "class", name: _classThis.name, metadata: _metadata }, null, _classExtraInitializers);
|
|
484
|
+
BinarySensorCCSupportedReport2 = _classThis = _classDescriptor.value;
|
|
485
|
+
if (_metadata) Object.defineProperty(_classThis, Symbol.metadata, { enumerable: true, configurable: true, writable: true, value: _metadata });
|
|
486
|
+
__runInitializers(_classThis, _classExtraInitializers);
|
|
487
|
+
}
|
|
488
|
+
constructor(options) {
|
|
489
|
+
super(options);
|
|
490
|
+
this.supportedSensorTypes = options.supportedSensorTypes;
|
|
491
|
+
}
|
|
492
|
+
static from(raw, ctx) {
|
|
493
|
+
(0, import_safe.validatePayload)(raw.payload.length >= 1);
|
|
494
|
+
const supportedSensorTypes = (0, import_safe.parseBitMask)(raw.payload, 0).filter((t) => t !== 0);
|
|
495
|
+
return new this({
|
|
496
|
+
nodeId: ctx.sourceNodeId,
|
|
497
|
+
supportedSensorTypes
|
|
498
|
+
});
|
|
499
|
+
}
|
|
500
|
+
supportedSensorTypes;
|
|
501
|
+
serialize(ctx) {
|
|
502
|
+
this.payload = (0, import_safe.encodeBitMask)(this.supportedSensorTypes.filter((t) => t !== import_Types.BinarySensorType.Any), void 0, 0);
|
|
503
|
+
return super.serialize(ctx);
|
|
504
|
+
}
|
|
505
|
+
toLogEntry(ctx) {
|
|
506
|
+
return {
|
|
507
|
+
...super.toLogEntry(ctx),
|
|
508
|
+
message: {
|
|
509
|
+
"supported types": this.supportedSensorTypes.map((type) => (0, import_safe3.getEnumMemberName)(import_Types.BinarySensorType, type)).join(", ")
|
|
510
|
+
}
|
|
511
|
+
};
|
|
512
|
+
}
|
|
513
|
+
};
|
|
514
|
+
return BinarySensorCCSupportedReport2 = _classThis;
|
|
515
|
+
})();
|
|
516
|
+
let BinarySensorCCSupportedGet = (() => {
|
|
517
|
+
let _classDecorators = [(0, import_CommandClassDecorators.CCCommand)(import_Types.BinarySensorCommand.SupportedGet), (0, import_CommandClassDecorators.expectedCCResponse)(BinarySensorCCSupportedReport)];
|
|
518
|
+
let _classDescriptor;
|
|
519
|
+
let _classExtraInitializers = [];
|
|
520
|
+
let _classThis;
|
|
521
|
+
let _classSuper = BinarySensorCC;
|
|
522
|
+
var BinarySensorCCSupportedGet2 = class extends _classSuper {
|
|
523
|
+
static {
|
|
524
|
+
_classThis = this;
|
|
525
|
+
}
|
|
526
|
+
static {
|
|
527
|
+
const _metadata = typeof Symbol === "function" && Symbol.metadata ? Object.create(_classSuper[Symbol.metadata] ?? null) : void 0;
|
|
528
|
+
__esDecorate(null, _classDescriptor = { value: _classThis }, _classDecorators, { kind: "class", name: _classThis.name, metadata: _metadata }, null, _classExtraInitializers);
|
|
529
|
+
BinarySensorCCSupportedGet2 = _classThis = _classDescriptor.value;
|
|
530
|
+
if (_metadata) Object.defineProperty(_classThis, Symbol.metadata, { enumerable: true, configurable: true, writable: true, value: _metadata });
|
|
531
|
+
__runInitializers(_classThis, _classExtraInitializers);
|
|
532
|
+
}
|
|
533
|
+
};
|
|
534
|
+
return BinarySensorCCSupportedGet2 = _classThis;
|
|
535
|
+
})();
|
|
421
536
|
// Annotate the CommonJS export names for ESM import in node:
|
|
422
537
|
0 && (module.exports = {
|
|
423
538
|
BinarySensorCC,
|