@zwave-js/cc 14.0.0-beta.4 → 14.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/build/cjs/cc/AlarmSensorCC.js +381 -266
- package/build/cjs/cc/AlarmSensorCC.js.map +3 -3
- package/build/cjs/cc/AssociationCC.js +669 -503
- package/build/cjs/cc/AssociationCC.js.map +3 -3
- package/build/cjs/cc/AssociationGroupInfoCC.js +633 -492
- package/build/cjs/cc/AssociationGroupInfoCC.js.map +3 -3
- package/build/cjs/cc/BarrierOperatorCC.js +595 -429
- package/build/cjs/cc/BarrierOperatorCC.js.map +3 -3
- package/build/cjs/cc/BasicCC.js +354 -260
- package/build/cjs/cc/BasicCC.js.map +3 -3
- package/build/cjs/cc/BatteryCC.js +427 -345
- package/build/cjs/cc/BatteryCC.js.map +3 -3
- package/build/cjs/cc/BinarySensorCC.js +391 -276
- package/build/cjs/cc/BinarySensorCC.js.map +3 -3
- package/build/cjs/cc/BinarySwitchCC.js +347 -253
- package/build/cjs/cc/BinarySwitchCC.js.map +3 -3
- package/build/cjs/cc/CRC16CC.js +160 -85
- package/build/cjs/cc/CRC16CC.js.map +3 -3
- package/build/cjs/cc/CentralSceneCC.js +459 -324
- package/build/cjs/cc/CentralSceneCC.js.map +3 -3
- package/build/cjs/cc/ClimateControlScheduleCC.js +459 -293
- package/build/cjs/cc/ClimateControlScheduleCC.js.map +3 -3
- package/build/cjs/cc/ClockCC.js +254 -150
- package/build/cjs/cc/ClockCC.js.map +3 -3
- package/build/cjs/cc/ColorSwitchCC.js +758 -610
- package/build/cjs/cc/ColorSwitchCC.js.map +3 -3
- package/build/cjs/cc/ConfigurationCC.js +1700 -1453
- package/build/cjs/cc/ConfigurationCC.js.map +3 -3
- package/build/cjs/cc/DeviceResetLocallyCC.js +125 -49
- package/build/cjs/cc/DeviceResetLocallyCC.js.map +3 -3
- package/build/cjs/cc/DoorLockCC.js +904 -777
- package/build/cjs/cc/DoorLockCC.js.map +3 -3
- package/build/cjs/cc/DoorLockLoggingCC.js +321 -206
- package/build/cjs/cc/DoorLockLoggingCC.js.map +3 -3
- package/build/cjs/cc/EnergyProductionCC.js +249 -160
- package/build/cjs/cc/EnergyProductionCC.js.map +3 -3
- package/build/cjs/cc/EntryControlCC.js +619 -458
- package/build/cjs/cc/EntryControlCC.js.map +3 -3
- package/build/cjs/cc/FirmwareUpdateMetaDataCC.js +898 -698
- package/build/cjs/cc/FirmwareUpdateMetaDataCC.js.map +3 -3
- package/build/cjs/cc/HailCC.js +57 -11
- package/build/cjs/cc/HailCC.js.map +2 -2
- package/build/cjs/cc/HumidityControlModeCC.js +359 -233
- package/build/cjs/cc/HumidityControlModeCC.js.map +3 -3
- package/build/cjs/cc/HumidityControlOperatingStateCC.js +189 -103
- package/build/cjs/cc/HumidityControlOperatingStateCC.js.map +3 -3
- package/build/cjs/cc/HumidityControlSetpointCC.js +682 -495
- package/build/cjs/cc/HumidityControlSetpointCC.js.map +3 -3
- package/build/cjs/cc/InclusionControllerCC.js +205 -114
- package/build/cjs/cc/InclusionControllerCC.js.map +3 -3
- package/build/cjs/cc/IndicatorCC.js +897 -736
- package/build/cjs/cc/IndicatorCC.js.map +3 -3
- package/build/cjs/cc/IrrigationCC.js +1651 -1405
- package/build/cjs/cc/IrrigationCC.js.map +3 -3
- package/build/cjs/cc/LanguageCC.js +268 -171
- package/build/cjs/cc/LanguageCC.js.map +3 -3
- package/build/cjs/cc/LockCC.js +254 -154
- package/build/cjs/cc/LockCC.js.map +3 -3
- package/build/cjs/cc/ManufacturerProprietaryCC.js +189 -129
- package/build/cjs/cc/ManufacturerProprietaryCC.js.map +2 -2
- package/build/cjs/cc/ManufacturerSpecificCC.js +319 -213
- package/build/cjs/cc/ManufacturerSpecificCC.js.map +3 -3
- package/build/cjs/cc/MeterCC.js +827 -707
- package/build/cjs/cc/MeterCC.js.map +3 -3
- package/build/cjs/cc/MultiChannelAssociationCC.js +612 -478
- package/build/cjs/cc/MultiChannelAssociationCC.js.map +3 -3
- package/build/cjs/cc/MultiChannelCC.js +1037 -819
- package/build/cjs/cc/MultiChannelCC.js.map +3 -3
- package/build/cjs/cc/MultiCommandCC.js +172 -97
- package/build/cjs/cc/MultiCommandCC.js.map +3 -3
- package/build/cjs/cc/MultilevelSensorCC.js +589 -449
- package/build/cjs/cc/MultilevelSensorCC.js.map +3 -3
- package/build/cjs/cc/MultilevelSwitchCC.js +587 -439
- package/build/cjs/cc/MultilevelSwitchCC.js.map +3 -3
- package/build/cjs/cc/NoOperationCC.js +89 -27
- package/build/cjs/cc/NoOperationCC.js.map +2 -2
- package/build/cjs/cc/NodeNamingCC.js +417 -277
- package/build/cjs/cc/NodeNamingCC.js.map +3 -3
- package/build/cjs/cc/NotificationCC.js +972 -818
- package/build/cjs/cc/NotificationCC.js.map +3 -3
- package/build/cjs/cc/PowerlevelCC.js +450 -303
- package/build/cjs/cc/PowerlevelCC.js.map +3 -3
- package/build/cjs/cc/ProtectionCC.js +686 -494
- package/build/cjs/cc/ProtectionCC.js.map +3 -3
- package/build/cjs/cc/SceneActivationCC.js +165 -97
- package/build/cjs/cc/SceneActivationCC.js.map +3 -3
- package/build/cjs/cc/SceneActuatorConfigurationCC.js +346 -243
- package/build/cjs/cc/SceneActuatorConfigurationCC.js.map +3 -3
- package/build/cjs/cc/SceneControllerConfigurationCC.js +401 -298
- package/build/cjs/cc/SceneControllerConfigurationCC.js.map +3 -3
- package/build/cjs/cc/ScheduleEntryLockCC.js +1552 -1272
- package/build/cjs/cc/ScheduleEntryLockCC.js.map +3 -3
- package/build/cjs/cc/Security2CC.js +1483 -1219
- package/build/cjs/cc/Security2CC.js.map +3 -3
- package/build/cjs/cc/SecurityCC.js +839 -619
- package/build/cjs/cc/SecurityCC.js.map +3 -3
- package/build/cjs/cc/SoundSwitchCC.js +707 -515
- package/build/cjs/cc/SoundSwitchCC.js.map +3 -3
- package/build/cjs/cc/SupervisionCC.js +327 -237
- package/build/cjs/cc/SupervisionCC.js.map +3 -3
- package/build/cjs/cc/ThermostatFanModeCC.js +386 -263
- package/build/cjs/cc/ThermostatFanModeCC.js.map +3 -3
- package/build/cjs/cc/ThermostatFanStateCC.js +192 -106
- package/build/cjs/cc/ThermostatFanStateCC.js.map +3 -3
- package/build/cjs/cc/ThermostatModeCC.js +425 -302
- package/build/cjs/cc/ThermostatModeCC.js.map +3 -3
- package/build/cjs/cc/ThermostatOperatingStateCC.js +188 -102
- package/build/cjs/cc/ThermostatOperatingStateCC.js.map +3 -3
- package/build/cjs/cc/ThermostatSetbackCC.js +277 -173
- package/build/cjs/cc/ThermostatSetbackCC.js.map +3 -3
- package/build/cjs/cc/ThermostatSetpointCC.js +645 -491
- package/build/cjs/cc/ThermostatSetpointCC.js.map +3 -3
- package/build/cjs/cc/TimeCC.js +515 -353
- package/build/cjs/cc/TimeCC.js.map +3 -3
- package/build/cjs/cc/TimeParametersCC.js +302 -202
- package/build/cjs/cc/TimeParametersCC.js.map +3 -3
- package/build/cjs/cc/TransportServiceCC.js +433 -315
- package/build/cjs/cc/TransportServiceCC.js.map +3 -3
- package/build/cjs/cc/UserCodeCC.js +1385 -1102
- package/build/cjs/cc/UserCodeCC.js.map +3 -3
- package/build/cjs/cc/VersionCC.js +696 -562
- package/build/cjs/cc/VersionCC.js.map +3 -3
- package/build/cjs/cc/WakeUpCC.js +499 -346
- package/build/cjs/cc/WakeUpCC.js.map +3 -3
- package/build/cjs/cc/WindowCoveringCC.js +626 -478
- package/build/cjs/cc/WindowCoveringCC.js.map +3 -3
- package/build/cjs/cc/ZWaveLongRangeCC.js +57 -10
- package/build/cjs/cc/ZWaveLongRangeCC.js.map +2 -2
- package/build/cjs/cc/ZWavePlusCC.js +233 -159
- package/build/cjs/cc/ZWavePlusCC.js.map +3 -3
- package/build/cjs/cc/ZWaveProtocolCC.js +1515 -948
- package/build/cjs/cc/ZWaveProtocolCC.js.map +3 -3
- package/build/cjs/cc/manufacturerProprietary/Decorators.d.ts +4 -4
- package/build/cjs/cc/manufacturerProprietary/Decorators.js.map +1 -1
- package/build/cjs/cc/manufacturerProprietary/FibaroCC.js +395 -274
- package/build/cjs/cc/manufacturerProprietary/FibaroCC.js.map +3 -3
- package/build/cjs/lib/CommandClassDecorators.d.ts +11 -15
- package/build/cjs/lib/CommandClassDecorators.js +19 -20
- package/build/cjs/lib/CommandClassDecorators.js.map +2 -2
- package/build/cjs/lib/Security2/Extension.d.ts +1 -1
- package/build/cjs/lib/Security2/Extension.js +217 -126
- package/build/cjs/lib/Security2/Extension.js.map +3 -3
- package/build/esm/cc/AlarmSensorCC.d.ts.map +1 -1
- package/build/esm/cc/AlarmSensorCC.js +389 -291
- package/build/esm/cc/AlarmSensorCC.js.map +1 -1
- package/build/esm/cc/AssociationCC.d.ts.map +1 -1
- package/build/esm/cc/AssociationCC.js +678 -537
- package/build/esm/cc/AssociationCC.js.map +1 -1
- package/build/esm/cc/AssociationGroupInfoCC.d.ts.map +1 -1
- package/build/esm/cc/AssociationGroupInfoCC.js +659 -539
- package/build/esm/cc/AssociationGroupInfoCC.js.map +1 -1
- package/build/esm/cc/BarrierOperatorCC.d.ts.map +1 -1
- package/build/esm/cc/BarrierOperatorCC.js +634 -493
- package/build/esm/cc/BarrierOperatorCC.js.map +1 -1
- package/build/esm/cc/BasicCC.d.ts.map +1 -1
- package/build/esm/cc/BasicCC.js +380 -302
- package/build/esm/cc/BasicCC.js.map +1 -1
- package/build/esm/cc/BatteryCC.d.ts.map +1 -1
- package/build/esm/cc/BatteryCC.js +449 -384
- package/build/esm/cc/BatteryCC.js.map +1 -1
- package/build/esm/cc/BinarySensorCC.d.ts.map +1 -1
- package/build/esm/cc/BinarySensorCC.js +395 -297
- package/build/esm/cc/BinarySensorCC.js.map +1 -1
- package/build/esm/cc/BinarySwitchCC.d.ts.map +1 -1
- package/build/esm/cc/BinarySwitchCC.js +353 -274
- package/build/esm/cc/BinarySwitchCC.js.map +1 -1
- package/build/esm/cc/CRC16CC.js +162 -98
- package/build/esm/cc/CRC16CC.js.map +1 -1
- package/build/esm/cc/CentralSceneCC.d.ts.map +1 -1
- package/build/esm/cc/CentralSceneCC.js +465 -351
- package/build/esm/cc/CentralSceneCC.js.map +1 -1
- package/build/esm/cc/ClimateControlScheduleCC.d.ts.map +1 -1
- package/build/esm/cc/ClimateControlScheduleCC.js +454 -313
- package/build/esm/cc/ClimateControlScheduleCC.js.map +1 -1
- package/build/esm/cc/ClockCC.js +248 -159
- package/build/esm/cc/ClockCC.js.map +1 -1
- package/build/esm/cc/ColorSwitchCC.d.ts.map +1 -1
- package/build/esm/cc/ColorSwitchCC.js +802 -677
- package/build/esm/cc/ColorSwitchCC.js.map +1 -1
- package/build/esm/cc/ConfigurationCC.js +1899 -1687
- package/build/esm/cc/ConfigurationCC.js.map +1 -1
- package/build/esm/cc/DeviceResetLocallyCC.js +124 -59
- package/build/esm/cc/DeviceResetLocallyCC.js.map +1 -1
- package/build/esm/cc/DoorLockCC.d.ts.map +1 -1
- package/build/esm/cc/DoorLockCC.js +951 -849
- package/build/esm/cc/DoorLockCC.js.map +1 -1
- package/build/esm/cc/DoorLockLoggingCC.d.ts.map +1 -1
- package/build/esm/cc/DoorLockLoggingCC.js +316 -218
- package/build/esm/cc/DoorLockLoggingCC.js.map +1 -1
- package/build/esm/cc/EnergyProductionCC.js +240 -164
- package/build/esm/cc/EnergyProductionCC.js.map +1 -1
- package/build/esm/cc/EntryControlCC.d.ts.map +1 -1
- package/build/esm/cc/EntryControlCC.js +629 -493
- package/build/esm/cc/EntryControlCC.js.map +1 -1
- package/build/esm/cc/FirmwareUpdateMetaDataCC.d.ts.map +1 -1
- package/build/esm/cc/FirmwareUpdateMetaDataCC.js +938 -769
- package/build/esm/cc/FirmwareUpdateMetaDataCC.js.map +1 -1
- package/build/esm/cc/HailCC.js +51 -12
- package/build/esm/cc/HailCC.js.map +1 -1
- package/build/esm/cc/HumidityControlModeCC.d.ts.map +1 -1
- package/build/esm/cc/HumidityControlModeCC.js +357 -250
- package/build/esm/cc/HumidityControlModeCC.js.map +1 -1
- package/build/esm/cc/HumidityControlOperatingStateCC.d.ts.map +1 -1
- package/build/esm/cc/HumidityControlOperatingStateCC.js +182 -109
- package/build/esm/cc/HumidityControlOperatingStateCC.js.map +1 -1
- package/build/esm/cc/HumidityControlSetpointCC.d.ts.map +1 -1
- package/build/esm/cc/HumidityControlSetpointCC.js +706 -546
- package/build/esm/cc/HumidityControlSetpointCC.js.map +1 -1
- package/build/esm/cc/InclusionControllerCC.js +197 -119
- package/build/esm/cc/InclusionControllerCC.js.map +1 -1
- package/build/esm/cc/IndicatorCC.js +973 -835
- package/build/esm/cc/IndicatorCC.js.map +1 -1
- package/build/esm/cc/IrrigationCC.d.ts.map +1 -1
- package/build/esm/cc/IrrigationCC.js +1697 -1496
- package/build/esm/cc/IrrigationCC.js.map +1 -1
- package/build/esm/cc/LanguageCC.d.ts.map +1 -1
- package/build/esm/cc/LanguageCC.js +266 -184
- package/build/esm/cc/LanguageCC.js.map +1 -1
- package/build/esm/cc/LockCC.d.ts.map +1 -1
- package/build/esm/cc/LockCC.js +247 -162
- package/build/esm/cc/LockCC.js.map +1 -1
- package/build/esm/cc/ManufacturerProprietaryCC.js +192 -141
- package/build/esm/cc/ManufacturerProprietaryCC.js.map +1 -1
- package/build/esm/cc/ManufacturerSpecificCC.d.ts.map +1 -1
- package/build/esm/cc/ManufacturerSpecificCC.js +312 -223
- package/build/esm/cc/ManufacturerSpecificCC.js.map +1 -1
- package/build/esm/cc/MeterCC.d.ts.map +1 -1
- package/build/esm/cc/MeterCC.js +896 -795
- package/build/esm/cc/MeterCC.js.map +1 -1
- package/build/esm/cc/MultiChannelAssociationCC.d.ts.map +1 -1
- package/build/esm/cc/MultiChannelAssociationCC.js +631 -518
- package/build/esm/cc/MultiChannelAssociationCC.js.map +1 -1
- package/build/esm/cc/MultiChannelCC.d.ts.map +1 -1
- package/build/esm/cc/MultiChannelCC.js +1106 -921
- package/build/esm/cc/MultiChannelCC.js.map +1 -1
- package/build/esm/cc/MultiCommandCC.js +166 -102
- package/build/esm/cc/MultiCommandCC.js.map +1 -1
- package/build/esm/cc/MultilevelSensorCC.d.ts.map +1 -1
- package/build/esm/cc/MultilevelSensorCC.js +616 -497
- package/build/esm/cc/MultilevelSensorCC.js.map +1 -1
- package/build/esm/cc/MultilevelSwitchCC.d.ts.map +1 -1
- package/build/esm/cc/MultilevelSwitchCC.js +621 -496
- package/build/esm/cc/MultilevelSwitchCC.js.map +1 -1
- package/build/esm/cc/NoOperationCC.js +82 -29
- package/build/esm/cc/NoOperationCC.js.map +1 -1
- package/build/esm/cc/NodeNamingCC.d.ts.map +1 -1
- package/build/esm/cc/NodeNamingCC.js +413 -294
- package/build/esm/cc/NodeNamingCC.js.map +1 -1
- package/build/esm/cc/NotificationCC.d.ts.map +1 -1
- package/build/esm/cc/NotificationCC.js +1097 -966
- package/build/esm/cc/NotificationCC.js.map +1 -1
- package/build/esm/cc/PowerlevelCC.js +437 -311
- package/build/esm/cc/PowerlevelCC.js.map +1 -1
- package/build/esm/cc/ProtectionCC.d.ts.map +1 -1
- package/build/esm/cc/ProtectionCC.js +704 -543
- package/build/esm/cc/ProtectionCC.js.map +1 -1
- package/build/esm/cc/SceneActivationCC.d.ts.map +1 -1
- package/build/esm/cc/SceneActivationCC.js +157 -100
- package/build/esm/cc/SceneActivationCC.js.map +1 -1
- package/build/esm/cc/SceneActuatorConfigurationCC.js +357 -269
- package/build/esm/cc/SceneActuatorConfigurationCC.js.map +1 -1
- package/build/esm/cc/SceneControllerConfigurationCC.js +434 -346
- package/build/esm/cc/SceneControllerConfigurationCC.js.map +1 -1
- package/build/esm/cc/ScheduleEntryLockCC.d.ts.map +1 -1
- package/build/esm/cc/ScheduleEntryLockCC.js +1596 -1357
- package/build/esm/cc/ScheduleEntryLockCC.js.map +1 -1
- package/build/esm/cc/Security2CC.js +1633 -1406
- package/build/esm/cc/Security2CC.js.map +1 -1
- package/build/esm/cc/SecurityCC.js +876 -687
- package/build/esm/cc/SecurityCC.js.map +1 -1
- package/build/esm/cc/SoundSwitchCC.d.ts.map +1 -1
- package/build/esm/cc/SoundSwitchCC.js +689 -526
- package/build/esm/cc/SoundSwitchCC.js.map +1 -1
- package/build/esm/cc/SupervisionCC.js +349 -272
- package/build/esm/cc/SupervisionCC.js.map +1 -1
- package/build/esm/cc/ThermostatFanModeCC.d.ts.map +1 -1
- package/build/esm/cc/ThermostatFanModeCC.js +388 -284
- package/build/esm/cc/ThermostatFanModeCC.js.map +1 -1
- package/build/esm/cc/ThermostatFanStateCC.d.ts.map +1 -1
- package/build/esm/cc/ThermostatFanStateCC.js +184 -111
- package/build/esm/cc/ThermostatFanStateCC.js.map +1 -1
- package/build/esm/cc/ThermostatModeCC.d.ts.map +1 -1
- package/build/esm/cc/ThermostatModeCC.js +435 -331
- package/build/esm/cc/ThermostatModeCC.js.map +1 -1
- package/build/esm/cc/ThermostatOperatingStateCC.d.ts.map +1 -1
- package/build/esm/cc/ThermostatOperatingStateCC.js +180 -107
- package/build/esm/cc/ThermostatOperatingStateCC.js.map +1 -1
- package/build/esm/cc/ThermostatSetbackCC.js +274 -185
- package/build/esm/cc/ThermostatSetbackCC.js.map +1 -1
- package/build/esm/cc/ThermostatSetpointCC.d.ts.map +1 -1
- package/build/esm/cc/ThermostatSetpointCC.js +674 -543
- package/build/esm/cc/ThermostatSetpointCC.js.map +1 -1
- package/build/esm/cc/TimeCC.js +499 -360
- package/build/esm/cc/TimeCC.js.map +1 -1
- package/build/esm/cc/TimeParametersCC.d.ts.map +1 -1
- package/build/esm/cc/TimeParametersCC.js +296 -211
- package/build/esm/cc/TimeParametersCC.js.map +1 -1
- package/build/esm/cc/TransportServiceCC.js +464 -363
- package/build/esm/cc/TransportServiceCC.js.map +1 -1
- package/build/esm/cc/UserCodeCC.d.ts.map +1 -1
- package/build/esm/cc/UserCodeCC.js +1443 -1205
- package/build/esm/cc/UserCodeCC.js.map +1 -1
- package/build/esm/cc/VersionCC.d.ts.map +1 -1
- package/build/esm/cc/VersionCC.js +744 -635
- package/build/esm/cc/VersionCC.js.map +1 -1
- package/build/esm/cc/WakeUpCC.d.ts.map +1 -1
- package/build/esm/cc/WakeUpCC.js +494 -364
- package/build/esm/cc/WakeUpCC.js.map +1 -1
- package/build/esm/cc/WindowCoveringCC.d.ts.map +1 -1
- package/build/esm/cc/WindowCoveringCC.js +655 -530
- package/build/esm/cc/WindowCoveringCC.js.map +1 -1
- package/build/esm/cc/ZWaveLongRangeCC.js +51 -11
- package/build/esm/cc/ZWaveLongRangeCC.js.map +1 -1
- package/build/esm/cc/ZWavePlusCC.d.ts.map +1 -1
- package/build/esm/cc/ZWavePlusCC.js +223 -162
- package/build/esm/cc/ZWavePlusCC.js.map +1 -1
- package/build/esm/cc/ZWaveProtocolCC.js +1443 -953
- package/build/esm/cc/ZWaveProtocolCC.js.map +1 -1
- package/build/esm/cc/manufacturerProprietary/Decorators.d.ts +4 -4
- package/build/esm/cc/manufacturerProprietary/Decorators.d.ts.map +1 -1
- package/build/esm/cc/manufacturerProprietary/FibaroCC.js +390 -286
- package/build/esm/cc/manufacturerProprietary/FibaroCC.js.map +1 -1
- package/build/esm/lib/CommandClassDecorators.d.ts +11 -15
- package/build/esm/lib/CommandClassDecorators.d.ts.map +1 -1
- package/build/esm/lib/CommandClassDecorators.js +24 -24
- package/build/esm/lib/CommandClassDecorators.js.map +1 -1
- package/build/esm/lib/Security2/Extension.d.ts +1 -1
- package/build/esm/lib/Security2/Extension.d.ts.map +1 -1
- package/build/esm/lib/Security2/Extension.js +207 -123
- package/build/esm/lib/Security2/Extension.js.map +1 -1
- package/package.json +6 -6
|
@@ -40,13 +40,45 @@ var import_CommandClass = require("../lib/CommandClass.js");
|
|
|
40
40
|
var import_CommandClassDecorators = require("../lib/CommandClassDecorators.js");
|
|
41
41
|
var import_Values = require("../lib/Values.js");
|
|
42
42
|
var import_Types = require("../lib/_Types.js");
|
|
43
|
-
var
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
43
|
+
var __esDecorate = function(ctor, descriptorIn, decorators, contextIn, initializers, extraInitializers) {
|
|
44
|
+
function accept(f) {
|
|
45
|
+
if (f !== void 0 && typeof f !== "function") throw new TypeError("Function expected");
|
|
46
|
+
return f;
|
|
47
|
+
}
|
|
48
|
+
var kind = contextIn.kind, key = kind === "getter" ? "get" : kind === "setter" ? "set" : "value";
|
|
49
|
+
var target = !descriptorIn && ctor ? contextIn["static"] ? ctor : ctor.prototype : null;
|
|
50
|
+
var descriptor = descriptorIn || (target ? Object.getOwnPropertyDescriptor(target, contextIn.name) : {});
|
|
51
|
+
var _, done = false;
|
|
52
|
+
for (var i = decorators.length - 1; i >= 0; i--) {
|
|
53
|
+
var context = {};
|
|
54
|
+
for (var p in contextIn) context[p] = p === "access" ? {} : contextIn[p];
|
|
55
|
+
for (var p in contextIn.access) context.access[p] = contextIn.access[p];
|
|
56
|
+
context.addInitializer = function(f) {
|
|
57
|
+
if (done) throw new TypeError("Cannot add initializers after decoration has completed");
|
|
58
|
+
extraInitializers.push(accept(f || null));
|
|
59
|
+
};
|
|
60
|
+
var result = (0, decorators[i])(kind === "accessor" ? { get: descriptor.get, set: descriptor.set } : descriptor[key], context);
|
|
61
|
+
if (kind === "accessor") {
|
|
62
|
+
if (result === void 0) continue;
|
|
63
|
+
if (result === null || typeof result !== "object") throw new TypeError("Object expected");
|
|
64
|
+
if (_ = accept(result.get)) descriptor.get = _;
|
|
65
|
+
if (_ = accept(result.set)) descriptor.set = _;
|
|
66
|
+
if (_ = accept(result.init)) initializers.unshift(_);
|
|
67
|
+
} else if (_ = accept(result)) {
|
|
68
|
+
if (kind === "field") initializers.unshift(_);
|
|
69
|
+
else descriptor[key] = _;
|
|
70
|
+
}
|
|
71
|
+
}
|
|
72
|
+
if (target) Object.defineProperty(target, contextIn.name, descriptor);
|
|
73
|
+
done = true;
|
|
74
|
+
};
|
|
75
|
+
var __runInitializers = function(thisArg, initializers, value) {
|
|
76
|
+
var useValue = arguments.length > 2;
|
|
77
|
+
for (var i = 0; i < initializers.length; i++) {
|
|
78
|
+
value = useValue ? initializers[i].call(thisArg, value) : initializers[i].call(thisArg);
|
|
79
|
+
}
|
|
80
|
+
return useValue ? value : void 0;
|
|
48
81
|
};
|
|
49
|
-
var IndicatorCCSet_1, IndicatorCCReport_1, IndicatorCCGet_1, IndicatorCCSupportedReport_1, IndicatorCCSupportedGet_1, IndicatorCCDescriptionReport_1, IndicatorCCDescriptionGet_1;
|
|
50
82
|
function __assertType(argName, typeName, boundHasError) {
|
|
51
83
|
const { ZWaveError: ZWaveError2, ZWaveErrorCodes: ZWaveErrorCodes2 } = require("@zwave-js/core");
|
|
52
84
|
if (boundHasError()) {
|
|
@@ -414,810 +446,939 @@ function getIndicatorName(indicatorId) {
|
|
|
414
446
|
}
|
|
415
447
|
}
|
|
416
448
|
const MAX_INDICATOR_OBJECTS = 31;
|
|
417
|
-
let IndicatorCCAPI =
|
|
418
|
-
|
|
419
|
-
|
|
420
|
-
|
|
421
|
-
|
|
422
|
-
|
|
423
|
-
|
|
424
|
-
|
|
425
|
-
|
|
426
|
-
|
|
427
|
-
|
|
428
|
-
|
|
429
|
-
|
|
430
|
-
|
|
431
|
-
|
|
432
|
-
|
|
433
|
-
|
|
434
|
-
|
|
435
|
-
|
|
436
|
-
|
|
437
|
-
|
|
438
|
-
|
|
439
|
-
|
|
440
|
-
|
|
441
|
-
|
|
442
|
-
|
|
443
|
-
|
|
444
|
-
|
|
445
|
-
|
|
446
|
-
|
|
447
|
-
|
|
448
|
-
|
|
449
|
-
|
|
450
|
-
|
|
451
|
-
|
|
452
|
-
|
|
453
|
-
|
|
449
|
+
let IndicatorCCAPI = (() => {
|
|
450
|
+
let _classDecorators = [(0, import_CommandClassDecorators.API)(import_safe.CommandClasses.Indicator)];
|
|
451
|
+
let _classDescriptor;
|
|
452
|
+
let _classExtraInitializers = [];
|
|
453
|
+
let _classThis;
|
|
454
|
+
let _classSuper = import_API.CCAPI;
|
|
455
|
+
var IndicatorCCAPI2 = class extends _classSuper {
|
|
456
|
+
static {
|
|
457
|
+
_classThis = this;
|
|
458
|
+
}
|
|
459
|
+
static {
|
|
460
|
+
const _metadata = typeof Symbol === "function" && Symbol.metadata ? Object.create(_classSuper[Symbol.metadata] ?? null) : void 0;
|
|
461
|
+
__esDecorate(null, _classDescriptor = { value: _classThis }, _classDecorators, { kind: "class", name: _classThis.name, metadata: _metadata }, null, _classExtraInitializers);
|
|
462
|
+
IndicatorCCAPI2 = _classThis = _classDescriptor.value;
|
|
463
|
+
if (_metadata) Object.defineProperty(_classThis, Symbol.metadata, { enumerable: true, configurable: true, writable: true, value: _metadata });
|
|
464
|
+
__runInitializers(_classThis, _classExtraInitializers);
|
|
465
|
+
}
|
|
466
|
+
supportsCommand(cmd) {
|
|
467
|
+
switch (cmd) {
|
|
468
|
+
case import_Types.IndicatorCommand.Get:
|
|
469
|
+
case import_Types.IndicatorCommand.Report:
|
|
470
|
+
return this.isSinglecast();
|
|
471
|
+
case import_Types.IndicatorCommand.Set:
|
|
472
|
+
return true;
|
|
473
|
+
// This is mandatory
|
|
474
|
+
case import_Types.IndicatorCommand.SupportedGet:
|
|
475
|
+
case import_Types.IndicatorCommand.SupportedReport:
|
|
476
|
+
return this.version >= 2 && this.isSinglecast();
|
|
477
|
+
case import_Types.IndicatorCommand.DescriptionGet:
|
|
478
|
+
case import_Types.IndicatorCommand.DescriptionReport:
|
|
479
|
+
return this.version >= 4 && this.isSinglecast();
|
|
480
|
+
}
|
|
481
|
+
return super.supportsCommand(cmd);
|
|
482
|
+
}
|
|
483
|
+
get [import_API.SET_VALUE]() {
|
|
484
|
+
return async function({ property, propertyKey }, value) {
|
|
485
|
+
if (property === "value") {
|
|
486
|
+
if (typeof value !== "number") {
|
|
487
|
+
(0, import_API.throwWrongValueType)(this.ccId, property, "number", typeof value);
|
|
488
|
+
}
|
|
489
|
+
return this.set(value);
|
|
490
|
+
} else if (typeof property === "number" && typeof propertyKey === "number") {
|
|
491
|
+
const indicatorId = property;
|
|
492
|
+
const propertyId = propertyKey;
|
|
493
|
+
const expectedType = getIndicatorMetadata(indicatorId, propertyId).type;
|
|
494
|
+
if (typeof value !== expectedType) {
|
|
495
|
+
(0, import_API.throwWrongValueType)(this.ccId, property, expectedType, typeof value);
|
|
454
496
|
}
|
|
455
|
-
|
|
456
|
-
|
|
457
|
-
|
|
458
|
-
|
|
497
|
+
return this.set([
|
|
498
|
+
{
|
|
499
|
+
indicatorId: property,
|
|
500
|
+
propertyId: propertyKey,
|
|
501
|
+
value
|
|
502
|
+
}
|
|
503
|
+
]);
|
|
504
|
+
} else if (property === "identify") {
|
|
505
|
+
if (typeof value !== "boolean") {
|
|
506
|
+
(0, import_API.throwWrongValueType)(this.ccId, property, "boolean", typeof value);
|
|
507
|
+
}
|
|
508
|
+
return this.identify();
|
|
509
|
+
} else {
|
|
510
|
+
(0, import_API.throwUnsupportedProperty)(this.ccId, property);
|
|
511
|
+
}
|
|
512
|
+
};
|
|
513
|
+
}
|
|
514
|
+
get [import_API.POLL_VALUE]() {
|
|
515
|
+
return async function({ property }) {
|
|
516
|
+
if (property === "value")
|
|
517
|
+
return this.get();
|
|
518
|
+
if (typeof property === "number") {
|
|
519
|
+
return this.get(property);
|
|
459
520
|
}
|
|
460
|
-
return this.identify();
|
|
461
|
-
} else {
|
|
462
521
|
(0, import_API.throwUnsupportedProperty)(this.ccId, property);
|
|
463
|
-
}
|
|
464
|
-
};
|
|
465
|
-
}
|
|
466
|
-
get [import_API.POLL_VALUE]() {
|
|
467
|
-
return async function({ property }) {
|
|
468
|
-
if (property === "value")
|
|
469
|
-
return this.get();
|
|
470
|
-
if (typeof property === "number") {
|
|
471
|
-
return this.get(property);
|
|
472
|
-
}
|
|
473
|
-
(0, import_API.throwUnsupportedProperty)(this.ccId, property);
|
|
474
|
-
};
|
|
475
|
-
}
|
|
476
|
-
async get(indicatorId) {
|
|
477
|
-
__assertType("indicatorId", "(optional) number", __assertType__optional_number.bind(void 0, indicatorId));
|
|
478
|
-
this.assertSupportsCommand(import_Types.IndicatorCommand, import_Types.IndicatorCommand.Get);
|
|
479
|
-
const cc = new IndicatorCCGet({
|
|
480
|
-
nodeId: this.endpoint.nodeId,
|
|
481
|
-
endpointIndex: this.endpoint.index,
|
|
482
|
-
indicatorId
|
|
483
|
-
});
|
|
484
|
-
const response = await this.host.sendCommand(cc, this.commandOptions);
|
|
485
|
-
if (!response)
|
|
486
|
-
return;
|
|
487
|
-
if (response.values)
|
|
488
|
-
return response.values;
|
|
489
|
-
return response.indicator0Value;
|
|
490
|
-
}
|
|
491
|
-
async set(value) {
|
|
492
|
-
__assertType("value", void 0, __assertType__su__number_sa__5_ea_5_5_5_eu.bind(void 0, value));
|
|
493
|
-
this.assertSupportsCommand(import_Types.IndicatorCommand, import_Types.IndicatorCommand.Set);
|
|
494
|
-
if (this.version === 1 && typeof value !== "number") {
|
|
495
|
-
throw new import_safe.ZWaveError(`Node ${this.endpoint.nodeId} only supports IndicatorCC V1 which requires a single value to be set`, import_safe.ZWaveErrorCodes.Argument_Invalid);
|
|
496
|
-
} else if (this.version >= 2 && (0, import_typeguards.isArray)(value) && value.length > MAX_INDICATOR_OBJECTS) {
|
|
497
|
-
throw new import_safe.ZWaveError(`Only ${MAX_INDICATOR_OBJECTS} indicator values can be set at a time!`, import_safe.ZWaveErrorCodes.Argument_Invalid);
|
|
498
|
-
}
|
|
499
|
-
const cc = new IndicatorCCSet({
|
|
500
|
-
nodeId: this.endpoint.nodeId,
|
|
501
|
-
endpointIndex: this.endpoint.index,
|
|
502
|
-
...typeof value === "number" ? { value } : { values: value }
|
|
503
|
-
});
|
|
504
|
-
return this.host.sendCommand(cc, this.commandOptions);
|
|
505
|
-
}
|
|
506
|
-
async sendReport(options) {
|
|
507
|
-
__assertType("options", "IndicatorCCReportOptions", __assertType__IndicatorCCReportOptions.bind(void 0, options));
|
|
508
|
-
this.assertSupportsCommand(import_Types.IndicatorCommand, import_Types.IndicatorCommand.Report);
|
|
509
|
-
const cc = new IndicatorCCReport({
|
|
510
|
-
nodeId: this.endpoint.nodeId,
|
|
511
|
-
endpointIndex: this.endpoint.index,
|
|
512
|
-
...options
|
|
513
|
-
});
|
|
514
|
-
await this.host.sendCommand(cc, this.commandOptions);
|
|
515
|
-
}
|
|
516
|
-
async getSupported(indicatorId) {
|
|
517
|
-
__assertType("indicatorId", "number", __assertType__number.bind(void 0, indicatorId));
|
|
518
|
-
this.assertSupportsCommand(import_Types.IndicatorCommand, import_Types.IndicatorCommand.SupportedGet);
|
|
519
|
-
const cc = new IndicatorCCSupportedGet({
|
|
520
|
-
nodeId: this.endpoint.nodeId,
|
|
521
|
-
endpointIndex: this.endpoint.index,
|
|
522
|
-
indicatorId
|
|
523
|
-
});
|
|
524
|
-
const response = await this.host.sendCommand(cc, this.commandOptions);
|
|
525
|
-
if (response) {
|
|
526
|
-
return {
|
|
527
|
-
// Include the actual indicator ID if 0x00 was requested
|
|
528
|
-
...indicatorId === 0 ? { indicatorId: response.indicatorId } : void 0,
|
|
529
|
-
supportedProperties: response.supportedProperties,
|
|
530
|
-
nextIndicatorId: response.nextIndicatorId
|
|
531
522
|
};
|
|
532
523
|
}
|
|
533
|
-
|
|
534
|
-
|
|
535
|
-
|
|
536
|
-
|
|
537
|
-
|
|
538
|
-
|
|
539
|
-
|
|
540
|
-
|
|
541
|
-
|
|
542
|
-
|
|
543
|
-
|
|
544
|
-
|
|
545
|
-
|
|
546
|
-
|
|
547
|
-
|
|
548
|
-
|
|
549
|
-
|
|
550
|
-
|
|
551
|
-
|
|
552
|
-
|
|
553
|
-
|
|
554
|
-
|
|
555
|
-
indicatorId,
|
|
556
|
-
description
|
|
557
|
-
});
|
|
558
|
-
await this.host.sendCommand(cc, this.commandOptions);
|
|
559
|
-
}
|
|
560
|
-
/**
|
|
561
|
-
* Instructs the node to identify itself. Available starting with V3 of this CC.
|
|
562
|
-
*/
|
|
563
|
-
async identify() {
|
|
564
|
-
if (this.version < 3) {
|
|
565
|
-
throw new import_safe.ZWaveError(`The identify command is only supported in Indicator CC version 3 and above`, import_safe.ZWaveErrorCodes.CC_NotSupported);
|
|
566
|
-
}
|
|
567
|
-
return this.set([
|
|
568
|
-
{
|
|
569
|
-
indicatorId: 80,
|
|
570
|
-
propertyId: 3,
|
|
571
|
-
value: 8
|
|
572
|
-
},
|
|
573
|
-
{
|
|
574
|
-
indicatorId: 80,
|
|
575
|
-
propertyId: 4,
|
|
576
|
-
value: 3
|
|
577
|
-
},
|
|
578
|
-
{
|
|
579
|
-
indicatorId: 80,
|
|
580
|
-
propertyId: 5,
|
|
581
|
-
value: 6
|
|
524
|
+
async get(indicatorId) {
|
|
525
|
+
__assertType("indicatorId", "(optional) number", __assertType__optional_number.bind(void 0, indicatorId));
|
|
526
|
+
this.assertSupportsCommand(import_Types.IndicatorCommand, import_Types.IndicatorCommand.Get);
|
|
527
|
+
const cc = new IndicatorCCGet({
|
|
528
|
+
nodeId: this.endpoint.nodeId,
|
|
529
|
+
endpointIndex: this.endpoint.index,
|
|
530
|
+
indicatorId
|
|
531
|
+
});
|
|
532
|
+
const response = await this.host.sendCommand(cc, this.commandOptions);
|
|
533
|
+
if (!response)
|
|
534
|
+
return;
|
|
535
|
+
if (response.values)
|
|
536
|
+
return response.values;
|
|
537
|
+
return response.indicator0Value;
|
|
538
|
+
}
|
|
539
|
+
async set(value) {
|
|
540
|
+
__assertType("value", void 0, __assertType__su__number_sa__5_ea_5_5_5_eu.bind(void 0, value));
|
|
541
|
+
this.assertSupportsCommand(import_Types.IndicatorCommand, import_Types.IndicatorCommand.Set);
|
|
542
|
+
if (this.version === 1 && typeof value !== "number") {
|
|
543
|
+
throw new import_safe.ZWaveError(`Node ${this.endpoint.nodeId} only supports IndicatorCC V1 which requires a single value to be set`, import_safe.ZWaveErrorCodes.Argument_Invalid);
|
|
544
|
+
} else if (this.version >= 2 && (0, import_typeguards.isArray)(value) && value.length > MAX_INDICATOR_OBJECTS) {
|
|
545
|
+
throw new import_safe.ZWaveError(`Only ${MAX_INDICATOR_OBJECTS} indicator values can be set at a time!`, import_safe.ZWaveErrorCodes.Argument_Invalid);
|
|
582
546
|
}
|
|
583
|
-
|
|
584
|
-
|
|
585
|
-
|
|
586
|
-
|
|
587
|
-
|
|
588
|
-
|
|
589
|
-
|
|
590
|
-
|
|
591
|
-
|
|
592
|
-
|
|
593
|
-
|
|
594
|
-
|
|
595
|
-
|
|
596
|
-
|
|
597
|
-
|
|
598
|
-
|
|
599
|
-
|
|
600
|
-
|
|
601
|
-
|
|
602
|
-
|
|
603
|
-
|
|
604
|
-
|
|
605
|
-
|
|
606
|
-
|
|
607
|
-
|
|
547
|
+
const cc = new IndicatorCCSet({
|
|
548
|
+
nodeId: this.endpoint.nodeId,
|
|
549
|
+
endpointIndex: this.endpoint.index,
|
|
550
|
+
...typeof value === "number" ? { value } : { values: value }
|
|
551
|
+
});
|
|
552
|
+
return this.host.sendCommand(cc, this.commandOptions);
|
|
553
|
+
}
|
|
554
|
+
async sendReport(options) {
|
|
555
|
+
__assertType("options", "IndicatorCCReportOptions", __assertType__IndicatorCCReportOptions.bind(void 0, options));
|
|
556
|
+
this.assertSupportsCommand(import_Types.IndicatorCommand, import_Types.IndicatorCommand.Report);
|
|
557
|
+
const cc = new IndicatorCCReport({
|
|
558
|
+
nodeId: this.endpoint.nodeId,
|
|
559
|
+
endpointIndex: this.endpoint.index,
|
|
560
|
+
...options
|
|
561
|
+
});
|
|
562
|
+
await this.host.sendCommand(cc, this.commandOptions);
|
|
563
|
+
}
|
|
564
|
+
async getSupported(indicatorId) {
|
|
565
|
+
__assertType("indicatorId", "number", __assertType__number.bind(void 0, indicatorId));
|
|
566
|
+
this.assertSupportsCommand(import_Types.IndicatorCommand, import_Types.IndicatorCommand.SupportedGet);
|
|
567
|
+
const cc = new IndicatorCCSupportedGet({
|
|
568
|
+
nodeId: this.endpoint.nodeId,
|
|
569
|
+
endpointIndex: this.endpoint.index,
|
|
570
|
+
indicatorId
|
|
571
|
+
});
|
|
572
|
+
const response = await this.host.sendCommand(cc, this.commandOptions);
|
|
573
|
+
if (response) {
|
|
574
|
+
return {
|
|
575
|
+
// Include the actual indicator ID if 0x00 was requested
|
|
576
|
+
...indicatorId === 0 ? { indicatorId: response.indicatorId } : void 0,
|
|
577
|
+
supportedProperties: response.supportedProperties,
|
|
578
|
+
nextIndicatorId: response.nextIndicatorId
|
|
579
|
+
};
|
|
608
580
|
}
|
|
609
581
|
}
|
|
610
|
-
|
|
611
|
-
|
|
612
|
-
|
|
613
|
-
|
|
614
|
-
|
|
615
|
-
const
|
|
616
|
-
|
|
617
|
-
|
|
618
|
-
|
|
619
|
-
|
|
620
|
-
|
|
621
|
-
|
|
622
|
-
|
|
623
|
-
|
|
624
|
-
|
|
625
|
-
|
|
582
|
+
async reportSupported(indicatorId, supportedProperties, nextIndicatorId) {
|
|
583
|
+
__assertType("indicatorId", "number", __assertType__number.bind(void 0, indicatorId));
|
|
584
|
+
__assertType("supportedProperties", void 0, __assertType__sa__number_ea_2.bind(void 0, supportedProperties));
|
|
585
|
+
__assertType("nextIndicatorId", "number", __assertType__number.bind(void 0, nextIndicatorId));
|
|
586
|
+
this.assertSupportsCommand(import_Types.IndicatorCommand, import_Types.IndicatorCommand.SupportedReport);
|
|
587
|
+
const cc = new IndicatorCCSupportedReport({
|
|
588
|
+
nodeId: this.endpoint.nodeId,
|
|
589
|
+
endpointIndex: this.endpoint.index,
|
|
590
|
+
indicatorId,
|
|
591
|
+
supportedProperties,
|
|
592
|
+
nextIndicatorId
|
|
593
|
+
});
|
|
594
|
+
await this.host.sendCommand(cc, this.commandOptions);
|
|
595
|
+
}
|
|
596
|
+
async reportDescription(indicatorId, description) {
|
|
597
|
+
__assertType("indicatorId", "number", __assertType__number.bind(void 0, indicatorId));
|
|
598
|
+
__assertType("description", "string", __assertType__string.bind(void 0, description));
|
|
599
|
+
this.assertSupportsCommand(import_Types.IndicatorCommand, import_Types.IndicatorCommand.DescriptionReport);
|
|
600
|
+
const cc = new IndicatorCCDescriptionReport({
|
|
601
|
+
nodeId: this.endpoint.nodeId,
|
|
602
|
+
endpointIndex: this.endpoint.index,
|
|
603
|
+
indicatorId,
|
|
604
|
+
description
|
|
605
|
+
});
|
|
606
|
+
await this.host.sendCommand(cc, this.commandOptions);
|
|
607
|
+
}
|
|
608
|
+
/**
|
|
609
|
+
* Instructs the node to identify itself. Available starting with V3 of this CC.
|
|
610
|
+
*/
|
|
611
|
+
async identify() {
|
|
612
|
+
if (this.version < 3) {
|
|
613
|
+
throw new import_safe.ZWaveError(`The identify command is only supported in Indicator CC version 3 and above`, import_safe.ZWaveErrorCodes.CC_NotSupported);
|
|
626
614
|
}
|
|
627
|
-
|
|
628
|
-
|
|
629
|
-
|
|
615
|
+
return this.set([
|
|
616
|
+
{
|
|
617
|
+
indicatorId: 80,
|
|
618
|
+
propertyId: 3,
|
|
619
|
+
value: 8
|
|
620
|
+
},
|
|
621
|
+
{
|
|
622
|
+
indicatorId: 80,
|
|
623
|
+
propertyId: 4,
|
|
624
|
+
value: 3
|
|
625
|
+
},
|
|
626
|
+
{
|
|
627
|
+
indicatorId: 80,
|
|
628
|
+
propertyId: 5,
|
|
629
|
+
value: 6
|
|
630
630
|
}
|
|
631
|
-
|
|
632
|
-
|
|
633
|
-
|
|
634
|
-
|
|
635
|
-
|
|
631
|
+
]);
|
|
632
|
+
}
|
|
633
|
+
/**
|
|
634
|
+
* Set a timeout for a given indicator ID after which the indicator will be turned off.
|
|
635
|
+
* @param timeout The timeout in one of the supported forms:
|
|
636
|
+
* - a timeout string in the form `12h18m17.59s`. All parts (hours, minutes, seconds, hundredths) are optional, but must be specified in this order. An empty string will be treated like `undefined`.
|
|
637
|
+
* - an object specifying the timeout parts. An empty object will be treated like `undefined`.
|
|
638
|
+
* - `undefined` to disable the timeout.
|
|
639
|
+
*/
|
|
640
|
+
async setTimeout(indicatorId, timeout) {
|
|
641
|
+
__assertType("indicatorId", "number", __assertType__number.bind(void 0, indicatorId));
|
|
642
|
+
__assertType("timeout", void 0, __assertType__su__undefined__string__3_eu.bind(void 0, timeout));
|
|
643
|
+
this.assertPhysicalEndpoint(this.endpoint);
|
|
644
|
+
if (this.version < 3) {
|
|
645
|
+
throw new import_safe.ZWaveError(`The setTimeout command is only supported in Indicator CC version 3 and above`, import_safe.ZWaveErrorCodes.CC_NotSupported);
|
|
636
646
|
}
|
|
637
|
-
if (
|
|
638
|
-
if (
|
|
639
|
-
|
|
647
|
+
if (typeof timeout === "string") {
|
|
648
|
+
if (timeout === "") {
|
|
649
|
+
timeout = void 0;
|
|
650
|
+
} else {
|
|
651
|
+
const parsed = parseIndicatorTimeoutString(timeout);
|
|
652
|
+
if (!parsed) {
|
|
653
|
+
throw new import_safe.ZWaveError(`The timeout string "${timeout}" is not valid`, import_safe.ZWaveErrorCodes.Argument_Invalid);
|
|
654
|
+
}
|
|
655
|
+
timeout = parsed;
|
|
640
656
|
}
|
|
641
|
-
objects.push({
|
|
642
|
-
indicatorId,
|
|
643
|
-
propertyId: 7,
|
|
644
|
-
value: seconds
|
|
645
|
-
});
|
|
646
657
|
}
|
|
647
|
-
|
|
648
|
-
|
|
649
|
-
|
|
658
|
+
const supportedPropertyIDs = IndicatorCC.getSupportedPropertyIDsCached(this.host, this.endpoint, indicatorId);
|
|
659
|
+
const objects = [];
|
|
660
|
+
if (timeout) {
|
|
661
|
+
const hours = timeout.hours ?? 0;
|
|
662
|
+
const minutes = timeout.minutes ?? 0;
|
|
663
|
+
const seconds = Math.floor(timeout.seconds ?? 0);
|
|
664
|
+
const hundredths = Math.round((timeout.seconds ?? 0) % 1 * 100);
|
|
665
|
+
if (hours) {
|
|
666
|
+
if (!supportedPropertyIDs?.includes(10)) {
|
|
667
|
+
throw new import_safe.ZWaveError(`The indicator ${indicatorId} does not support setting the timeout in hours`, import_safe.ZWaveErrorCodes.Argument_Invalid);
|
|
668
|
+
}
|
|
669
|
+
objects.push({
|
|
670
|
+
indicatorId,
|
|
671
|
+
propertyId: 10,
|
|
672
|
+
value: hours
|
|
673
|
+
});
|
|
674
|
+
}
|
|
675
|
+
if (minutes) {
|
|
676
|
+
if (!supportedPropertyIDs?.includes(6)) {
|
|
677
|
+
throw new import_safe.ZWaveError(`The indicator ${indicatorId} does not support setting the timeout in minutes`, import_safe.ZWaveErrorCodes.Argument_Invalid);
|
|
678
|
+
}
|
|
679
|
+
objects.push({
|
|
680
|
+
indicatorId,
|
|
681
|
+
propertyId: 6,
|
|
682
|
+
value: minutes
|
|
683
|
+
});
|
|
650
684
|
}
|
|
651
|
-
|
|
685
|
+
if (seconds) {
|
|
686
|
+
if (!supportedPropertyIDs?.includes(7)) {
|
|
687
|
+
throw new import_safe.ZWaveError(`The indicator ${indicatorId} does not support setting the timeout in seconds`, import_safe.ZWaveErrorCodes.Argument_Invalid);
|
|
688
|
+
}
|
|
689
|
+
objects.push({
|
|
690
|
+
indicatorId,
|
|
691
|
+
propertyId: 7,
|
|
692
|
+
value: seconds
|
|
693
|
+
});
|
|
694
|
+
}
|
|
695
|
+
if (hundredths) {
|
|
696
|
+
if (!supportedPropertyIDs?.includes(8)) {
|
|
697
|
+
throw new import_safe.ZWaveError(`The indicator ${indicatorId} does not support setting the timeout in 1/100 seconds`, import_safe.ZWaveErrorCodes.Argument_Invalid);
|
|
698
|
+
}
|
|
699
|
+
objects.push({
|
|
700
|
+
indicatorId,
|
|
701
|
+
propertyId: 8,
|
|
702
|
+
value: hundredths
|
|
703
|
+
});
|
|
704
|
+
}
|
|
705
|
+
}
|
|
706
|
+
if (!objects.length) {
|
|
707
|
+
objects.push(...(supportedPropertyIDs ?? []).map((p) => ({
|
|
652
708
|
indicatorId,
|
|
653
|
-
propertyId:
|
|
654
|
-
value:
|
|
655
|
-
});
|
|
709
|
+
propertyId: p,
|
|
710
|
+
value: 0
|
|
711
|
+
})));
|
|
656
712
|
}
|
|
713
|
+
return this.set(objects);
|
|
657
714
|
}
|
|
658
|
-
|
|
659
|
-
|
|
660
|
-
|
|
661
|
-
|
|
662
|
-
|
|
663
|
-
|
|
715
|
+
/**
|
|
716
|
+
* Returns the timeout after which the given indicator will be turned off.
|
|
717
|
+
*/
|
|
718
|
+
async getTimeout(indicatorId) {
|
|
719
|
+
__assertType("indicatorId", "number", __assertType__number.bind(void 0, indicatorId));
|
|
720
|
+
const values = await this.get(indicatorId);
|
|
721
|
+
if (!(0, import_typeguards.isArray)(values))
|
|
722
|
+
return;
|
|
723
|
+
return indicatorObjectsToTimeout(values);
|
|
664
724
|
}
|
|
665
|
-
|
|
666
|
-
|
|
667
|
-
|
|
668
|
-
|
|
669
|
-
|
|
670
|
-
|
|
671
|
-
|
|
672
|
-
|
|
673
|
-
|
|
674
|
-
return;
|
|
675
|
-
|
|
676
|
-
}
|
|
677
|
-
|
|
678
|
-
|
|
679
|
-
|
|
680
|
-
|
|
681
|
-
|
|
682
|
-
|
|
683
|
-
|
|
684
|
-
|
|
685
|
-
|
|
686
|
-
|
|
687
|
-
|
|
688
|
-
}
|
|
689
|
-
|
|
690
|
-
|
|
691
|
-
|
|
692
|
-
|
|
693
|
-
|
|
694
|
-
|
|
695
|
-
|
|
696
|
-
|
|
697
|
-
|
|
698
|
-
|
|
699
|
-
|
|
700
|
-
|
|
701
|
-
message: `Interviewing ${this.ccName}...`,
|
|
702
|
-
direction: "none"
|
|
703
|
-
});
|
|
704
|
-
if (api.version > 1) {
|
|
705
|
-
ctx.logNode(node.id, {
|
|
706
|
-
endpoint: this.endpointIndex,
|
|
707
|
-
message: "scanning supported indicator IDs...",
|
|
708
|
-
direction: "outbound"
|
|
725
|
+
async getDescription(indicatorId) {
|
|
726
|
+
__assertType("indicatorId", "number", __assertType__number.bind(void 0, indicatorId));
|
|
727
|
+
this.assertSupportsCommand(import_Types.IndicatorCommand, import_Types.IndicatorCommand.DescriptionGet);
|
|
728
|
+
const cc = new IndicatorCCDescriptionGet({
|
|
729
|
+
nodeId: this.endpoint.nodeId,
|
|
730
|
+
endpointIndex: this.endpoint.index,
|
|
731
|
+
indicatorId
|
|
732
|
+
});
|
|
733
|
+
const response = await this.host.sendCommand(cc, this.commandOptions);
|
|
734
|
+
return response?.description;
|
|
735
|
+
}
|
|
736
|
+
};
|
|
737
|
+
return IndicatorCCAPI2 = _classThis;
|
|
738
|
+
})();
|
|
739
|
+
let IndicatorCC = (() => {
|
|
740
|
+
let _classDecorators = [(0, import_CommandClassDecorators.commandClass)(import_safe.CommandClasses.Indicator), (0, import_CommandClassDecorators.implementedVersion)(4), (0, import_CommandClassDecorators.ccValues)(IndicatorCCValues)];
|
|
741
|
+
let _classDescriptor;
|
|
742
|
+
let _classExtraInitializers = [];
|
|
743
|
+
let _classThis;
|
|
744
|
+
let _classSuper = import_CommandClass.CommandClass;
|
|
745
|
+
var IndicatorCC2 = class extends _classSuper {
|
|
746
|
+
static {
|
|
747
|
+
_classThis = this;
|
|
748
|
+
}
|
|
749
|
+
static {
|
|
750
|
+
const _metadata = typeof Symbol === "function" && Symbol.metadata ? Object.create(_classSuper[Symbol.metadata] ?? null) : void 0;
|
|
751
|
+
__esDecorate(null, _classDescriptor = { value: _classThis }, _classDecorators, { kind: "class", name: _classThis.name, metadata: _metadata }, null, _classExtraInitializers);
|
|
752
|
+
IndicatorCC2 = _classThis = _classDescriptor.value;
|
|
753
|
+
if (_metadata) Object.defineProperty(_classThis, Symbol.metadata, { enumerable: true, configurable: true, writable: true, value: _metadata });
|
|
754
|
+
__runInitializers(_classThis, _classExtraInitializers);
|
|
755
|
+
}
|
|
756
|
+
async interview(ctx) {
|
|
757
|
+
const node = this.getNode(ctx);
|
|
758
|
+
const endpoint = this.getEndpoint(ctx);
|
|
759
|
+
const api = import_API.CCAPI.create(import_safe.CommandClasses.Indicator, ctx, endpoint).withOptions({
|
|
760
|
+
priority: import_safe.MessagePriority.NodeQuery
|
|
709
761
|
});
|
|
710
|
-
let curId = 0;
|
|
711
|
-
const supportedIndicatorIds = [];
|
|
712
|
-
do {
|
|
713
|
-
const supportedResponse = await api.getSupported(curId);
|
|
714
|
-
if (!supportedResponse) {
|
|
715
|
-
ctx.logNode(node.id, {
|
|
716
|
-
endpoint: this.endpointIndex,
|
|
717
|
-
message: "Time out while scanning supported indicator IDs, skipping interview...",
|
|
718
|
-
level: "warn"
|
|
719
|
-
});
|
|
720
|
-
return;
|
|
721
|
-
}
|
|
722
|
-
supportedIndicatorIds.push(supportedResponse.indicatorId ?? curId);
|
|
723
|
-
curId = supportedResponse.nextIndicatorId;
|
|
724
|
-
} while (curId !== 0);
|
|
725
|
-
this.setValue(ctx, IndicatorCCValues.supportedIndicatorIds, supportedIndicatorIds);
|
|
726
|
-
const logMessage = `supported indicator IDs: ${supportedIndicatorIds.join(", ")}`;
|
|
727
762
|
ctx.logNode(node.id, {
|
|
728
763
|
endpoint: this.endpointIndex,
|
|
729
|
-
message:
|
|
730
|
-
direction: "
|
|
764
|
+
message: `Interviewing ${this.ccName}...`,
|
|
765
|
+
direction: "none"
|
|
731
766
|
});
|
|
732
|
-
if (api.version
|
|
733
|
-
|
|
734
|
-
|
|
735
|
-
|
|
736
|
-
|
|
737
|
-
|
|
738
|
-
|
|
739
|
-
|
|
740
|
-
|
|
741
|
-
|
|
767
|
+
if (api.version > 1) {
|
|
768
|
+
ctx.logNode(node.id, {
|
|
769
|
+
endpoint: this.endpointIndex,
|
|
770
|
+
message: "scanning supported indicator IDs...",
|
|
771
|
+
direction: "outbound"
|
|
772
|
+
});
|
|
773
|
+
let curId = 0;
|
|
774
|
+
const supportedIndicatorIds = [];
|
|
775
|
+
do {
|
|
776
|
+
const supportedResponse = await api.getSupported(curId);
|
|
777
|
+
if (!supportedResponse) {
|
|
778
|
+
ctx.logNode(node.id, {
|
|
779
|
+
endpoint: this.endpointIndex,
|
|
780
|
+
message: "Time out while scanning supported indicator IDs, skipping interview...",
|
|
781
|
+
level: "warn"
|
|
782
|
+
});
|
|
783
|
+
return;
|
|
784
|
+
}
|
|
785
|
+
supportedIndicatorIds.push(supportedResponse.indicatorId ?? curId);
|
|
786
|
+
curId = supportedResponse.nextIndicatorId;
|
|
787
|
+
} while (curId !== 0);
|
|
788
|
+
this.setValue(ctx, IndicatorCCValues.supportedIndicatorIds, supportedIndicatorIds);
|
|
789
|
+
const logMessage = `supported indicator IDs: ${supportedIndicatorIds.join(", ")}`;
|
|
790
|
+
ctx.logNode(node.id, {
|
|
791
|
+
endpoint: this.endpointIndex,
|
|
792
|
+
message: logMessage,
|
|
793
|
+
direction: "inbound"
|
|
794
|
+
});
|
|
795
|
+
if (api.version >= 4) {
|
|
796
|
+
const manufacturerDefinedIndicatorIds = supportedIndicatorIds.filter((id) => isManufacturerDefinedIndicator(id));
|
|
797
|
+
if (manufacturerDefinedIndicatorIds.length > 0) {
|
|
798
|
+
ctx.logNode(node.id, {
|
|
799
|
+
endpoint: this.endpointIndex,
|
|
800
|
+
message: "retrieving description for manufacturer-defined indicator IDs...",
|
|
801
|
+
direction: "outbound"
|
|
802
|
+
});
|
|
803
|
+
for (const id of manufacturerDefinedIndicatorIds) {
|
|
804
|
+
await api.getDescription(id);
|
|
805
|
+
}
|
|
742
806
|
}
|
|
743
807
|
}
|
|
744
808
|
}
|
|
809
|
+
await this.refreshValues(ctx);
|
|
810
|
+
this.setInterviewComplete(ctx, true);
|
|
745
811
|
}
|
|
746
|
-
|
|
747
|
-
|
|
748
|
-
|
|
749
|
-
|
|
750
|
-
|
|
751
|
-
const endpoint = this.getEndpoint(ctx);
|
|
752
|
-
const api = import_API.CCAPI.create(import_safe.CommandClasses.Indicator, ctx, endpoint).withOptions({
|
|
753
|
-
priority: import_safe.MessagePriority.NodeQuery
|
|
754
|
-
});
|
|
755
|
-
if (api.version === 1) {
|
|
756
|
-
ctx.logNode(node.id, {
|
|
757
|
-
endpoint: this.endpointIndex,
|
|
758
|
-
message: "requesting current indicator value...",
|
|
759
|
-
direction: "outbound"
|
|
812
|
+
async refreshValues(ctx) {
|
|
813
|
+
const node = this.getNode(ctx);
|
|
814
|
+
const endpoint = this.getEndpoint(ctx);
|
|
815
|
+
const api = import_API.CCAPI.create(import_safe.CommandClasses.Indicator, ctx, endpoint).withOptions({
|
|
816
|
+
priority: import_safe.MessagePriority.NodeQuery
|
|
760
817
|
});
|
|
761
|
-
|
|
762
|
-
} else {
|
|
763
|
-
const supportedIndicatorIds = this.getValue(ctx, IndicatorCCValues.supportedIndicatorIds) ?? [];
|
|
764
|
-
for (const indicatorId of supportedIndicatorIds) {
|
|
818
|
+
if (api.version === 1) {
|
|
765
819
|
ctx.logNode(node.id, {
|
|
766
820
|
endpoint: this.endpointIndex,
|
|
767
|
-
message:
|
|
821
|
+
message: "requesting current indicator value...",
|
|
768
822
|
direction: "outbound"
|
|
769
823
|
});
|
|
770
|
-
await api.get(
|
|
824
|
+
await api.get();
|
|
825
|
+
} else {
|
|
826
|
+
const supportedIndicatorIds = this.getValue(ctx, IndicatorCCValues.supportedIndicatorIds) ?? [];
|
|
827
|
+
for (const indicatorId of supportedIndicatorIds) {
|
|
828
|
+
ctx.logNode(node.id, {
|
|
829
|
+
endpoint: this.endpointIndex,
|
|
830
|
+
message: `requesting current indicator value (id = ${(0, import_safe3.num2hex)(indicatorId)})...`,
|
|
831
|
+
direction: "outbound"
|
|
832
|
+
});
|
|
833
|
+
await api.get(indicatorId);
|
|
834
|
+
}
|
|
771
835
|
}
|
|
772
836
|
}
|
|
773
|
-
|
|
774
|
-
|
|
775
|
-
|
|
776
|
-
|
|
777
|
-
|
|
778
|
-
|
|
779
|
-
|
|
780
|
-
|
|
781
|
-
|
|
782
|
-
return super.translatePropertyKey(ctx, property, propertyKey);
|
|
783
|
-
}
|
|
784
|
-
translateProperty(ctx, property, propertyKey) {
|
|
785
|
-
if (typeof property === "number" && typeof propertyKey === "number") {
|
|
786
|
-
if (property in import_safe.Indicator)
|
|
787
|
-
return import_safe.Indicator[property];
|
|
837
|
+
translatePropertyKey(ctx, property, propertyKey) {
|
|
838
|
+
if (property === "value") {
|
|
839
|
+
return void 0;
|
|
840
|
+
} else if (typeof property === "number" && typeof propertyKey === "number") {
|
|
841
|
+
const prop = (0, import_safe.getIndicatorProperty)(propertyKey);
|
|
842
|
+
if (prop)
|
|
843
|
+
return prop.label;
|
|
844
|
+
}
|
|
845
|
+
return super.translatePropertyKey(ctx, property, propertyKey);
|
|
788
846
|
}
|
|
789
|
-
|
|
790
|
-
|
|
791
|
-
|
|
792
|
-
|
|
793
|
-
|
|
794
|
-
return
|
|
795
|
-
return supportedIndicatorIds.some((indicatorId) => !!this.getValue(ctx, IndicatorCCValues.supportedPropertyIDs(indicatorId))?.length);
|
|
796
|
-
}
|
|
797
|
-
static getSupportedPropertyIDsCached(ctx, endpoint, indicatorId) {
|
|
798
|
-
return ctx.getValueDB(endpoint.nodeId).getValue(IndicatorCCValues.supportedPropertyIDs(indicatorId).endpoint(endpoint.index));
|
|
799
|
-
}
|
|
800
|
-
};
|
|
801
|
-
IndicatorCC = __decorate([
|
|
802
|
-
(0, import_CommandClassDecorators.commandClass)(import_safe.CommandClasses.Indicator),
|
|
803
|
-
(0, import_CommandClassDecorators.implementedVersion)(4),
|
|
804
|
-
(0, import_CommandClassDecorators.ccValues)(IndicatorCCValues)
|
|
805
|
-
], IndicatorCC);
|
|
806
|
-
let IndicatorCCSet = IndicatorCCSet_1 = class IndicatorCCSet2 extends IndicatorCC {
|
|
807
|
-
constructor(options) {
|
|
808
|
-
super(options);
|
|
809
|
-
if ("value" in options) {
|
|
810
|
-
this.indicator0Value = options.value;
|
|
811
|
-
} else {
|
|
812
|
-
this.values = options.values;
|
|
847
|
+
translateProperty(ctx, property, propertyKey) {
|
|
848
|
+
if (typeof property === "number" && typeof propertyKey === "number") {
|
|
849
|
+
if (property in import_safe.Indicator)
|
|
850
|
+
return import_safe.Indicator[property];
|
|
851
|
+
}
|
|
852
|
+
return super.translateProperty(ctx, property, propertyKey);
|
|
813
853
|
}
|
|
814
|
-
|
|
815
|
-
|
|
816
|
-
|
|
817
|
-
|
|
818
|
-
|
|
819
|
-
const indicator0Value = raw.payload[0];
|
|
820
|
-
return new IndicatorCCSet_1({
|
|
821
|
-
nodeId: ctx.sourceNodeId,
|
|
822
|
-
value: indicator0Value
|
|
823
|
-
});
|
|
854
|
+
supportsV2Indicators(ctx) {
|
|
855
|
+
const supportedIndicatorIds = this.getValue(ctx, IndicatorCCValues.supportedIndicatorIds);
|
|
856
|
+
if (!supportedIndicatorIds?.length)
|
|
857
|
+
return false;
|
|
858
|
+
return supportedIndicatorIds.some((indicatorId) => !!this.getValue(ctx, IndicatorCCValues.supportedPropertyIDs(indicatorId))?.length);
|
|
824
859
|
}
|
|
825
|
-
(
|
|
826
|
-
|
|
827
|
-
for (let i = 0; i < objCount; i++) {
|
|
828
|
-
const offset = 2 + 3 * i;
|
|
829
|
-
const value = {
|
|
830
|
-
indicatorId: raw.payload[offset],
|
|
831
|
-
propertyId: raw.payload[offset + 1],
|
|
832
|
-
value: raw.payload[offset + 2]
|
|
833
|
-
};
|
|
834
|
-
values.push(value);
|
|
860
|
+
static getSupportedPropertyIDsCached(ctx, endpoint, indicatorId) {
|
|
861
|
+
return ctx.getValueDB(endpoint.nodeId).getValue(IndicatorCCValues.supportedPropertyIDs(indicatorId).endpoint(endpoint.index));
|
|
835
862
|
}
|
|
836
|
-
|
|
837
|
-
|
|
838
|
-
|
|
839
|
-
|
|
840
|
-
|
|
841
|
-
|
|
842
|
-
|
|
843
|
-
|
|
844
|
-
|
|
845
|
-
|
|
846
|
-
|
|
847
|
-
|
|
863
|
+
};
|
|
864
|
+
return IndicatorCC2 = _classThis;
|
|
865
|
+
})();
|
|
866
|
+
let IndicatorCCSet = (() => {
|
|
867
|
+
let _classDecorators = [(0, import_CommandClassDecorators.CCCommand)(import_Types.IndicatorCommand.Set), (0, import_CommandClassDecorators.useSupervision)()];
|
|
868
|
+
let _classDescriptor;
|
|
869
|
+
let _classExtraInitializers = [];
|
|
870
|
+
let _classThis;
|
|
871
|
+
let _classSuper = IndicatorCC;
|
|
872
|
+
var IndicatorCCSet2 = class extends _classSuper {
|
|
873
|
+
static {
|
|
874
|
+
_classThis = this;
|
|
875
|
+
}
|
|
876
|
+
static {
|
|
877
|
+
const _metadata = typeof Symbol === "function" && Symbol.metadata ? Object.create(_classSuper[Symbol.metadata] ?? null) : void 0;
|
|
878
|
+
__esDecorate(null, _classDescriptor = { value: _classThis }, _classDecorators, { kind: "class", name: _classThis.name, metadata: _metadata }, null, _classExtraInitializers);
|
|
879
|
+
IndicatorCCSet2 = _classThis = _classDescriptor.value;
|
|
880
|
+
if (_metadata) Object.defineProperty(_classThis, Symbol.metadata, { enumerable: true, configurable: true, writable: true, value: _metadata });
|
|
881
|
+
__runInitializers(_classThis, _classExtraInitializers);
|
|
882
|
+
}
|
|
883
|
+
constructor(options) {
|
|
884
|
+
super(options);
|
|
885
|
+
if ("value" in options) {
|
|
886
|
+
this.indicator0Value = options.value;
|
|
887
|
+
} else {
|
|
888
|
+
this.values = options.values;
|
|
889
|
+
}
|
|
890
|
+
}
|
|
891
|
+
static from(raw, ctx) {
|
|
892
|
+
(0, import_safe.validatePayload)(raw.payload.length >= 1);
|
|
893
|
+
const objCount = raw.payload.length >= 2 ? raw.payload[1] & 31 : 0;
|
|
894
|
+
if (objCount === 0) {
|
|
895
|
+
const indicator0Value = raw.payload[0];
|
|
896
|
+
return new this({
|
|
897
|
+
nodeId: ctx.sourceNodeId,
|
|
898
|
+
value: indicator0Value
|
|
899
|
+
});
|
|
900
|
+
}
|
|
901
|
+
(0, import_safe.validatePayload)(raw.payload.length >= 2 + 3 * objCount);
|
|
902
|
+
const values = [];
|
|
848
903
|
for (let i = 0; i < objCount; i++) {
|
|
849
904
|
const offset = 2 + 3 * i;
|
|
850
|
-
|
|
851
|
-
|
|
852
|
-
|
|
853
|
-
|
|
905
|
+
const value = {
|
|
906
|
+
indicatorId: raw.payload[offset],
|
|
907
|
+
propertyId: raw.payload[offset + 1],
|
|
908
|
+
value: raw.payload[offset + 2]
|
|
909
|
+
};
|
|
910
|
+
values.push(value);
|
|
854
911
|
}
|
|
855
|
-
|
|
856
|
-
|
|
912
|
+
return new this({
|
|
913
|
+
nodeId: ctx.sourceNodeId,
|
|
914
|
+
values
|
|
915
|
+
});
|
|
857
916
|
}
|
|
858
|
-
|
|
859
|
-
|
|
860
|
-
|
|
861
|
-
|
|
862
|
-
|
|
863
|
-
|
|
917
|
+
indicator0Value;
|
|
918
|
+
values;
|
|
919
|
+
serialize(ctx) {
|
|
920
|
+
if (this.values != void 0) {
|
|
921
|
+
this.payload = import_safe2.Bytes.alloc(2 + 3 * this.values.length, 0);
|
|
922
|
+
const objCount = this.values.length & MAX_INDICATOR_OBJECTS;
|
|
923
|
+
this.payload[1] = objCount;
|
|
924
|
+
for (let i = 0; i < objCount; i++) {
|
|
925
|
+
const offset = 2 + 3 * i;
|
|
926
|
+
this.payload[offset] = this.values[i].indicatorId;
|
|
927
|
+
this.payload[offset + 1] = this.values[i].propertyId;
|
|
928
|
+
const value = this.values[i].value;
|
|
929
|
+
this.payload[offset + 2] = value === true ? 255 : value === false ? 0 : value;
|
|
930
|
+
}
|
|
931
|
+
} else {
|
|
932
|
+
this.payload = import_safe2.Bytes.from([this.indicator0Value ?? 0]);
|
|
933
|
+
}
|
|
934
|
+
return super.serialize(ctx);
|
|
864
935
|
}
|
|
865
|
-
|
|
866
|
-
message
|
|
936
|
+
toLogEntry(ctx) {
|
|
937
|
+
const message = {};
|
|
938
|
+
if (this.indicator0Value != void 0) {
|
|
939
|
+
message["indicator 0 value"] = this.indicator0Value;
|
|
940
|
+
}
|
|
941
|
+
if (this.values != void 0) {
|
|
942
|
+
message.values = `${this.values.map((v) => `
|
|
867
943
|
\xB7 indicatorId: ${v.indicatorId}
|
|
868
944
|
propertyId: ${v.propertyId}
|
|
869
945
|
value: ${v.value}`).join("")}`;
|
|
870
|
-
}
|
|
871
|
-
return {
|
|
872
|
-
...super.toLogEntry(ctx),
|
|
873
|
-
message
|
|
874
|
-
};
|
|
875
|
-
}
|
|
876
|
-
};
|
|
877
|
-
IndicatorCCSet = IndicatorCCSet_1 = __decorate([
|
|
878
|
-
(0, import_CommandClassDecorators.CCCommand)(import_Types.IndicatorCommand.Set),
|
|
879
|
-
(0, import_CommandClassDecorators.useSupervision)()
|
|
880
|
-
], IndicatorCCSet);
|
|
881
|
-
let IndicatorCCReport = IndicatorCCReport_1 = class IndicatorCCReport2 extends IndicatorCC {
|
|
882
|
-
constructor(options) {
|
|
883
|
-
super(options);
|
|
884
|
-
if ("value" in options) {
|
|
885
|
-
this.indicator0Value = options.value;
|
|
886
|
-
} else if ("values" in options) {
|
|
887
|
-
if (options.values.length > MAX_INDICATOR_OBJECTS) {
|
|
888
|
-
throw new import_safe.ZWaveError(`Only ${MAX_INDICATOR_OBJECTS} indicator values can be set at a time!`, import_safe.ZWaveErrorCodes.Argument_Invalid);
|
|
889
946
|
}
|
|
890
|
-
|
|
947
|
+
return {
|
|
948
|
+
...super.toLogEntry(ctx),
|
|
949
|
+
message
|
|
950
|
+
};
|
|
891
951
|
}
|
|
892
|
-
}
|
|
893
|
-
|
|
894
|
-
|
|
895
|
-
|
|
896
|
-
|
|
897
|
-
|
|
898
|
-
|
|
899
|
-
|
|
900
|
-
|
|
901
|
-
|
|
952
|
+
};
|
|
953
|
+
return IndicatorCCSet2 = _classThis;
|
|
954
|
+
})();
|
|
955
|
+
let IndicatorCCReport = (() => {
|
|
956
|
+
let _classDecorators = [(0, import_CommandClassDecorators.CCCommand)(import_Types.IndicatorCommand.Report)];
|
|
957
|
+
let _classDescriptor;
|
|
958
|
+
let _classExtraInitializers = [];
|
|
959
|
+
let _classThis;
|
|
960
|
+
let _classSuper = IndicatorCC;
|
|
961
|
+
var IndicatorCCReport2 = class extends _classSuper {
|
|
962
|
+
static {
|
|
963
|
+
_classThis = this;
|
|
902
964
|
}
|
|
903
|
-
|
|
904
|
-
|
|
905
|
-
|
|
906
|
-
|
|
907
|
-
|
|
908
|
-
|
|
909
|
-
propertyId: raw.payload[offset + 1],
|
|
910
|
-
value: raw.payload[offset + 2]
|
|
911
|
-
};
|
|
912
|
-
values.push(value);
|
|
965
|
+
static {
|
|
966
|
+
const _metadata = typeof Symbol === "function" && Symbol.metadata ? Object.create(_classSuper[Symbol.metadata] ?? null) : void 0;
|
|
967
|
+
__esDecorate(null, _classDescriptor = { value: _classThis }, _classDecorators, { kind: "class", name: _classThis.name, metadata: _metadata }, null, _classExtraInitializers);
|
|
968
|
+
IndicatorCCReport2 = _classThis = _classDescriptor.value;
|
|
969
|
+
if (_metadata) Object.defineProperty(_classThis, Symbol.metadata, { enumerable: true, configurable: true, writable: true, value: _metadata });
|
|
970
|
+
__runInitializers(_classThis, _classExtraInitializers);
|
|
913
971
|
}
|
|
914
|
-
|
|
915
|
-
|
|
916
|
-
|
|
917
|
-
|
|
918
|
-
|
|
919
|
-
|
|
920
|
-
|
|
921
|
-
return false;
|
|
922
|
-
if (this.indicator0Value != void 0) {
|
|
923
|
-
if (!this.supportsV2Indicators(ctx)) {
|
|
924
|
-
const valueV1 = IndicatorCCValues.valueV1;
|
|
925
|
-
this.setMetadata(ctx, valueV1);
|
|
926
|
-
this.setValue(ctx, valueV1, this.indicator0Value);
|
|
927
|
-
} else {
|
|
928
|
-
if (this.isSinglecast()) {
|
|
929
|
-
ctx.logNode(this.nodeId, {
|
|
930
|
-
message: `ignoring V1 indicator report because the node supports V2 indicators`,
|
|
931
|
-
direction: "none",
|
|
932
|
-
endpoint: this.endpointIndex
|
|
933
|
-
});
|
|
972
|
+
constructor(options) {
|
|
973
|
+
super(options);
|
|
974
|
+
if ("value" in options) {
|
|
975
|
+
this.indicator0Value = options.value;
|
|
976
|
+
} else if ("values" in options) {
|
|
977
|
+
if (options.values.length > MAX_INDICATOR_OBJECTS) {
|
|
978
|
+
throw new import_safe.ZWaveError(`Only ${MAX_INDICATOR_OBJECTS} indicator values can be set at a time!`, import_safe.ZWaveErrorCodes.Argument_Invalid);
|
|
934
979
|
}
|
|
935
|
-
|
|
936
|
-
} else if (this.values) {
|
|
937
|
-
for (const value of this.values) {
|
|
938
|
-
this.setIndicatorValue(ctx, value);
|
|
939
|
-
}
|
|
940
|
-
const timeout = indicatorObjectsToTimeout(this.values);
|
|
941
|
-
if (timeout) {
|
|
942
|
-
let timeoutString = "";
|
|
943
|
-
if (timeout?.hours)
|
|
944
|
-
timeoutString += `${timeout.hours}h`;
|
|
945
|
-
if (timeout?.minutes)
|
|
946
|
-
timeoutString += `${timeout.minutes}m`;
|
|
947
|
-
if (timeout?.seconds)
|
|
948
|
-
timeoutString += `${timeout.seconds}s`;
|
|
949
|
-
this.setValue(ctx, IndicatorCCValues.timeout, timeoutString);
|
|
980
|
+
this.values = options.values;
|
|
950
981
|
}
|
|
951
982
|
}
|
|
952
|
-
|
|
953
|
-
|
|
954
|
-
|
|
955
|
-
|
|
956
|
-
|
|
957
|
-
|
|
958
|
-
|
|
959
|
-
|
|
960
|
-
|
|
961
|
-
|
|
962
|
-
|
|
963
|
-
|
|
964
|
-
this.setValue(ctx, valueV2, value.value);
|
|
965
|
-
}
|
|
966
|
-
serialize(ctx) {
|
|
967
|
-
if (this.values != void 0) {
|
|
968
|
-
this.payload = import_safe2.Bytes.alloc(2 + 3 * this.values.length, 0);
|
|
969
|
-
const objCount = this.values.length & MAX_INDICATOR_OBJECTS;
|
|
970
|
-
this.payload[1] = objCount;
|
|
983
|
+
static from(raw, ctx) {
|
|
984
|
+
(0, import_safe.validatePayload)(raw.payload.length >= 1);
|
|
985
|
+
const objCount = raw.payload.length >= 2 ? raw.payload[1] & 31 : 0;
|
|
986
|
+
if (objCount === 0) {
|
|
987
|
+
const indicator0Value = raw.payload[0];
|
|
988
|
+
return new this({
|
|
989
|
+
nodeId: ctx.sourceNodeId,
|
|
990
|
+
value: indicator0Value
|
|
991
|
+
});
|
|
992
|
+
}
|
|
993
|
+
(0, import_safe.validatePayload)(raw.payload.length >= 2 + 3 * objCount);
|
|
994
|
+
const values = [];
|
|
971
995
|
for (let i = 0; i < objCount; i++) {
|
|
972
996
|
const offset = 2 + 3 * i;
|
|
973
|
-
|
|
974
|
-
|
|
975
|
-
|
|
976
|
-
|
|
997
|
+
const value = {
|
|
998
|
+
indicatorId: raw.payload[offset],
|
|
999
|
+
propertyId: raw.payload[offset + 1],
|
|
1000
|
+
value: raw.payload[offset + 2]
|
|
1001
|
+
};
|
|
1002
|
+
values.push(value);
|
|
977
1003
|
}
|
|
978
|
-
|
|
979
|
-
|
|
1004
|
+
return new this({
|
|
1005
|
+
nodeId: ctx.sourceNodeId,
|
|
1006
|
+
values
|
|
1007
|
+
});
|
|
980
1008
|
}
|
|
981
|
-
|
|
982
|
-
|
|
983
|
-
|
|
984
|
-
|
|
985
|
-
|
|
986
|
-
|
|
1009
|
+
persistValues(ctx) {
|
|
1010
|
+
if (!super.persistValues(ctx))
|
|
1011
|
+
return false;
|
|
1012
|
+
if (this.indicator0Value != void 0) {
|
|
1013
|
+
if (!this.supportsV2Indicators(ctx)) {
|
|
1014
|
+
const valueV1 = IndicatorCCValues.valueV1;
|
|
1015
|
+
this.setMetadata(ctx, valueV1);
|
|
1016
|
+
this.setValue(ctx, valueV1, this.indicator0Value);
|
|
1017
|
+
} else {
|
|
1018
|
+
if (this.isSinglecast()) {
|
|
1019
|
+
ctx.logNode(this.nodeId, {
|
|
1020
|
+
message: `ignoring V1 indicator report because the node supports V2 indicators`,
|
|
1021
|
+
direction: "none",
|
|
1022
|
+
endpoint: this.endpointIndex
|
|
1023
|
+
});
|
|
1024
|
+
}
|
|
1025
|
+
}
|
|
1026
|
+
} else if (this.values) {
|
|
1027
|
+
for (const value of this.values) {
|
|
1028
|
+
this.setIndicatorValue(ctx, value);
|
|
1029
|
+
}
|
|
1030
|
+
const timeout = indicatorObjectsToTimeout(this.values);
|
|
1031
|
+
if (timeout) {
|
|
1032
|
+
let timeoutString = "";
|
|
1033
|
+
if (timeout?.hours)
|
|
1034
|
+
timeoutString += `${timeout.hours}h`;
|
|
1035
|
+
if (timeout?.minutes)
|
|
1036
|
+
timeoutString += `${timeout.minutes}m`;
|
|
1037
|
+
if (timeout?.seconds)
|
|
1038
|
+
timeoutString += `${timeout.seconds}s`;
|
|
1039
|
+
this.setValue(ctx, IndicatorCCValues.timeout, timeoutString);
|
|
1040
|
+
}
|
|
1041
|
+
}
|
|
1042
|
+
return true;
|
|
1043
|
+
}
|
|
1044
|
+
indicator0Value;
|
|
1045
|
+
values;
|
|
1046
|
+
setIndicatorValue(ctx, value) {
|
|
1047
|
+
const overrideIndicatorLabel = isManufacturerDefinedIndicator(value.indicatorId) ? this.getValue(ctx, IndicatorCCValues.indicatorDescription(value.indicatorId)) : void 0;
|
|
1048
|
+
const metadata = getIndicatorMetadata(value.indicatorId, value.propertyId, overrideIndicatorLabel);
|
|
1049
|
+
if (metadata.type === "boolean") {
|
|
1050
|
+
value.value = !!value.value;
|
|
1051
|
+
}
|
|
1052
|
+
const valueV2 = IndicatorCCValues.valueV2(value.indicatorId, value.propertyId);
|
|
1053
|
+
this.setMetadata(ctx, valueV2, metadata);
|
|
1054
|
+
this.setValue(ctx, valueV2, value.value);
|
|
1055
|
+
}
|
|
1056
|
+
serialize(ctx) {
|
|
1057
|
+
if (this.values != void 0) {
|
|
1058
|
+
this.payload = import_safe2.Bytes.alloc(2 + 3 * this.values.length, 0);
|
|
1059
|
+
const objCount = this.values.length & MAX_INDICATOR_OBJECTS;
|
|
1060
|
+
this.payload[1] = objCount;
|
|
1061
|
+
for (let i = 0; i < objCount; i++) {
|
|
1062
|
+
const offset = 2 + 3 * i;
|
|
1063
|
+
this.payload[offset] = this.values[i].indicatorId;
|
|
1064
|
+
this.payload[offset + 1] = this.values[i].propertyId;
|
|
1065
|
+
const value = this.values[i].value;
|
|
1066
|
+
this.payload[offset + 2] = value === true ? 255 : value === false ? 0 : value;
|
|
1067
|
+
}
|
|
1068
|
+
} else {
|
|
1069
|
+
this.payload = import_safe2.Bytes.from([this.indicator0Value ?? 0]);
|
|
1070
|
+
}
|
|
1071
|
+
return super.serialize(ctx);
|
|
987
1072
|
}
|
|
988
|
-
|
|
989
|
-
message
|
|
1073
|
+
toLogEntry(ctx) {
|
|
1074
|
+
const message = {};
|
|
1075
|
+
if (this.indicator0Value != void 0) {
|
|
1076
|
+
message["indicator 0 value"] = this.indicator0Value;
|
|
1077
|
+
}
|
|
1078
|
+
if (this.values != void 0) {
|
|
1079
|
+
message.values = `${this.values.map((v) => `
|
|
990
1080
|
\xB7 indicatorId: ${v.indicatorId}
|
|
991
1081
|
propertyId: ${v.propertyId}
|
|
992
1082
|
value: ${v.value}`).join("")}`;
|
|
1083
|
+
}
|
|
1084
|
+
return {
|
|
1085
|
+
...super.toLogEntry(ctx),
|
|
1086
|
+
message
|
|
1087
|
+
};
|
|
993
1088
|
}
|
|
994
|
-
|
|
995
|
-
|
|
996
|
-
|
|
997
|
-
|
|
998
|
-
|
|
999
|
-
|
|
1000
|
-
|
|
1001
|
-
|
|
1002
|
-
|
|
1003
|
-
|
|
1004
|
-
|
|
1005
|
-
|
|
1006
|
-
this.indicatorId = options.indicatorId;
|
|
1007
|
-
}
|
|
1008
|
-
static from(raw, ctx) {
|
|
1009
|
-
let indicatorId;
|
|
1010
|
-
if (raw.payload.length > 0) {
|
|
1011
|
-
indicatorId = raw.payload[0];
|
|
1012
|
-
}
|
|
1013
|
-
return new IndicatorCCGet_1({
|
|
1014
|
-
nodeId: ctx.sourceNodeId,
|
|
1015
|
-
indicatorId
|
|
1016
|
-
});
|
|
1017
|
-
}
|
|
1018
|
-
indicatorId;
|
|
1019
|
-
serialize(ctx) {
|
|
1020
|
-
if (this.indicatorId != void 0) {
|
|
1021
|
-
this.payload = import_safe2.Bytes.from([this.indicatorId]);
|
|
1089
|
+
};
|
|
1090
|
+
return IndicatorCCReport2 = _classThis;
|
|
1091
|
+
})();
|
|
1092
|
+
let IndicatorCCGet = (() => {
|
|
1093
|
+
let _classDecorators = [(0, import_CommandClassDecorators.CCCommand)(import_Types.IndicatorCommand.Get), (0, import_CommandClassDecorators.expectedCCResponse)(IndicatorCCReport)];
|
|
1094
|
+
let _classDescriptor;
|
|
1095
|
+
let _classExtraInitializers = [];
|
|
1096
|
+
let _classThis;
|
|
1097
|
+
let _classSuper = IndicatorCC;
|
|
1098
|
+
var IndicatorCCGet2 = class extends _classSuper {
|
|
1099
|
+
static {
|
|
1100
|
+
_classThis = this;
|
|
1022
1101
|
}
|
|
1023
|
-
|
|
1024
|
-
|
|
1025
|
-
|
|
1026
|
-
|
|
1027
|
-
|
|
1028
|
-
|
|
1029
|
-
|
|
1102
|
+
static {
|
|
1103
|
+
const _metadata = typeof Symbol === "function" && Symbol.metadata ? Object.create(_classSuper[Symbol.metadata] ?? null) : void 0;
|
|
1104
|
+
__esDecorate(null, _classDescriptor = { value: _classThis }, _classDecorators, { kind: "class", name: _classThis.name, metadata: _metadata }, null, _classExtraInitializers);
|
|
1105
|
+
IndicatorCCGet2 = _classThis = _classDescriptor.value;
|
|
1106
|
+
if (_metadata) Object.defineProperty(_classThis, Symbol.metadata, { enumerable: true, configurable: true, writable: true, value: _metadata });
|
|
1107
|
+
__runInitializers(_classThis, _classExtraInitializers);
|
|
1108
|
+
}
|
|
1109
|
+
constructor(options) {
|
|
1110
|
+
super(options);
|
|
1111
|
+
this.indicatorId = options.indicatorId;
|
|
1112
|
+
}
|
|
1113
|
+
static from(raw, ctx) {
|
|
1114
|
+
let indicatorId;
|
|
1115
|
+
if (raw.payload.length > 0) {
|
|
1116
|
+
indicatorId = raw.payload[0];
|
|
1030
1117
|
}
|
|
1031
|
-
|
|
1032
|
-
|
|
1033
|
-
|
|
1034
|
-
|
|
1035
|
-
(0, import_CommandClassDecorators.CCCommand)(import_Types.IndicatorCommand.Get),
|
|
1036
|
-
(0, import_CommandClassDecorators.expectedCCResponse)(IndicatorCCReport)
|
|
1037
|
-
], IndicatorCCGet);
|
|
1038
|
-
let IndicatorCCSupportedReport = IndicatorCCSupportedReport_1 = class IndicatorCCSupportedReport2 extends IndicatorCC {
|
|
1039
|
-
constructor(options) {
|
|
1040
|
-
super(options);
|
|
1041
|
-
this.indicatorId = options.indicatorId;
|
|
1042
|
-
this.nextIndicatorId = options.nextIndicatorId;
|
|
1043
|
-
this.supportedProperties = options.supportedProperties;
|
|
1044
|
-
}
|
|
1045
|
-
static from(raw, ctx) {
|
|
1046
|
-
(0, import_safe.validatePayload)(raw.payload.length >= 3);
|
|
1047
|
-
const indicatorId = raw.payload[0];
|
|
1048
|
-
const nextIndicatorId = raw.payload[1];
|
|
1049
|
-
const bitMaskLength = raw.payload[2] & 31;
|
|
1050
|
-
let supportedProperties;
|
|
1051
|
-
if (bitMaskLength === 0) {
|
|
1052
|
-
supportedProperties = [];
|
|
1053
|
-
} else {
|
|
1054
|
-
(0, import_safe.validatePayload)(raw.payload.length >= 3 + bitMaskLength);
|
|
1055
|
-
supportedProperties = (0, import_safe.parseBitMask)(raw.payload.subarray(3, 3 + bitMaskLength), 0).filter((v) => v !== 0);
|
|
1056
|
-
}
|
|
1057
|
-
return new IndicatorCCSupportedReport_1({
|
|
1058
|
-
nodeId: ctx.sourceNodeId,
|
|
1059
|
-
indicatorId,
|
|
1060
|
-
nextIndicatorId,
|
|
1061
|
-
supportedProperties
|
|
1062
|
-
});
|
|
1063
|
-
}
|
|
1064
|
-
persistValues(ctx) {
|
|
1065
|
-
if (!super.persistValues(ctx))
|
|
1066
|
-
return false;
|
|
1067
|
-
if (this.indicatorId !== 0) {
|
|
1068
|
-
this.setValue(ctx, IndicatorCCValues.supportedPropertyIDs(this.indicatorId), this.supportedProperties);
|
|
1118
|
+
return new this({
|
|
1119
|
+
nodeId: ctx.sourceNodeId,
|
|
1120
|
+
indicatorId
|
|
1121
|
+
});
|
|
1069
1122
|
}
|
|
1070
|
-
|
|
1071
|
-
|
|
1072
|
-
|
|
1073
|
-
|
|
1074
|
-
supportedProperties;
|
|
1075
|
-
serialize(ctx) {
|
|
1076
|
-
const bitmask = this.supportedProperties.length > 0 ? (0, import_safe.encodeBitMask)(this.supportedProperties, void 0, 0) : new import_safe2.Bytes();
|
|
1077
|
-
this.payload = import_safe2.Bytes.concat([
|
|
1078
|
-
import_safe2.Bytes.from([
|
|
1079
|
-
this.indicatorId,
|
|
1080
|
-
this.nextIndicatorId,
|
|
1081
|
-
bitmask.length
|
|
1082
|
-
]),
|
|
1083
|
-
bitmask
|
|
1084
|
-
]);
|
|
1085
|
-
return super.serialize(ctx);
|
|
1086
|
-
}
|
|
1087
|
-
toLogEntry(ctx) {
|
|
1088
|
-
return {
|
|
1089
|
-
...super.toLogEntry(ctx),
|
|
1090
|
-
message: {
|
|
1091
|
-
indicator: getIndicatorName(this.indicatorId),
|
|
1092
|
-
"supported properties": `${this.supportedProperties.map((id) => (0, import_safe.getIndicatorProperty)(id)?.label ?? `Unknown (${(0, import_safe3.num2hex)(id)})`).join(", ")}`,
|
|
1093
|
-
"next indicator": getIndicatorName(this.nextIndicatorId)
|
|
1123
|
+
indicatorId;
|
|
1124
|
+
serialize(ctx) {
|
|
1125
|
+
if (this.indicatorId != void 0) {
|
|
1126
|
+
this.payload = import_safe2.Bytes.from([this.indicatorId]);
|
|
1094
1127
|
}
|
|
1095
|
-
|
|
1096
|
-
|
|
1097
|
-
|
|
1098
|
-
|
|
1099
|
-
|
|
1100
|
-
|
|
1128
|
+
return super.serialize(ctx);
|
|
1129
|
+
}
|
|
1130
|
+
toLogEntry(ctx) {
|
|
1131
|
+
return {
|
|
1132
|
+
...super.toLogEntry(ctx),
|
|
1133
|
+
message: {
|
|
1134
|
+
indicator: getIndicatorName(this.indicatorId)
|
|
1135
|
+
}
|
|
1136
|
+
};
|
|
1137
|
+
}
|
|
1138
|
+
};
|
|
1139
|
+
return IndicatorCCGet2 = _classThis;
|
|
1140
|
+
})();
|
|
1141
|
+
let IndicatorCCSupportedReport = (() => {
|
|
1142
|
+
let _classDecorators = [(0, import_CommandClassDecorators.CCCommand)(import_Types.IndicatorCommand.SupportedReport)];
|
|
1143
|
+
let _classDescriptor;
|
|
1144
|
+
let _classExtraInitializers = [];
|
|
1145
|
+
let _classThis;
|
|
1146
|
+
let _classSuper = IndicatorCC;
|
|
1147
|
+
var IndicatorCCSupportedReport2 = class extends _classSuper {
|
|
1148
|
+
static {
|
|
1149
|
+
_classThis = this;
|
|
1150
|
+
}
|
|
1151
|
+
static {
|
|
1152
|
+
const _metadata = typeof Symbol === "function" && Symbol.metadata ? Object.create(_classSuper[Symbol.metadata] ?? null) : void 0;
|
|
1153
|
+
__esDecorate(null, _classDescriptor = { value: _classThis }, _classDecorators, { kind: "class", name: _classThis.name, metadata: _metadata }, null, _classExtraInitializers);
|
|
1154
|
+
IndicatorCCSupportedReport2 = _classThis = _classDescriptor.value;
|
|
1155
|
+
if (_metadata) Object.defineProperty(_classThis, Symbol.metadata, { enumerable: true, configurable: true, writable: true, value: _metadata });
|
|
1156
|
+
__runInitializers(_classThis, _classExtraInitializers);
|
|
1157
|
+
}
|
|
1158
|
+
constructor(options) {
|
|
1159
|
+
super(options);
|
|
1160
|
+
this.indicatorId = options.indicatorId;
|
|
1161
|
+
this.nextIndicatorId = options.nextIndicatorId;
|
|
1162
|
+
this.supportedProperties = options.supportedProperties;
|
|
1163
|
+
}
|
|
1164
|
+
static from(raw, ctx) {
|
|
1165
|
+
(0, import_safe.validatePayload)(raw.payload.length >= 3);
|
|
1166
|
+
const indicatorId = raw.payload[0];
|
|
1167
|
+
const nextIndicatorId = raw.payload[1];
|
|
1168
|
+
const bitMaskLength = raw.payload[2] & 31;
|
|
1169
|
+
let supportedProperties;
|
|
1170
|
+
if (bitMaskLength === 0) {
|
|
1171
|
+
supportedProperties = [];
|
|
1172
|
+
} else {
|
|
1173
|
+
(0, import_safe.validatePayload)(raw.payload.length >= 3 + bitMaskLength);
|
|
1174
|
+
supportedProperties = (0, import_safe.parseBitMask)(raw.payload.subarray(3, 3 + bitMaskLength), 0).filter((v) => v !== 0);
|
|
1175
|
+
}
|
|
1176
|
+
return new this({
|
|
1177
|
+
nodeId: ctx.sourceNodeId,
|
|
1178
|
+
indicatorId,
|
|
1179
|
+
nextIndicatorId,
|
|
1180
|
+
supportedProperties
|
|
1181
|
+
});
|
|
1182
|
+
}
|
|
1183
|
+
persistValues(ctx) {
|
|
1184
|
+
if (!super.persistValues(ctx))
|
|
1185
|
+
return false;
|
|
1186
|
+
if (this.indicatorId !== 0) {
|
|
1187
|
+
this.setValue(ctx, IndicatorCCValues.supportedPropertyIDs(this.indicatorId), this.supportedProperties);
|
|
1188
|
+
}
|
|
1189
|
+
return true;
|
|
1190
|
+
}
|
|
1191
|
+
indicatorId;
|
|
1192
|
+
nextIndicatorId;
|
|
1193
|
+
supportedProperties;
|
|
1194
|
+
serialize(ctx) {
|
|
1195
|
+
const bitmask = this.supportedProperties.length > 0 ? (0, import_safe.encodeBitMask)(this.supportedProperties, void 0, 0) : new import_safe2.Bytes();
|
|
1196
|
+
this.payload = import_safe2.Bytes.concat([
|
|
1197
|
+
import_safe2.Bytes.from([
|
|
1198
|
+
this.indicatorId,
|
|
1199
|
+
this.nextIndicatorId,
|
|
1200
|
+
bitmask.length
|
|
1201
|
+
]),
|
|
1202
|
+
bitmask
|
|
1203
|
+
]);
|
|
1204
|
+
return super.serialize(ctx);
|
|
1205
|
+
}
|
|
1206
|
+
toLogEntry(ctx) {
|
|
1207
|
+
return {
|
|
1208
|
+
...super.toLogEntry(ctx),
|
|
1209
|
+
message: {
|
|
1210
|
+
indicator: getIndicatorName(this.indicatorId),
|
|
1211
|
+
"supported properties": `${this.supportedProperties.map((id) => (0, import_safe.getIndicatorProperty)(id)?.label ?? `Unknown (${(0, import_safe3.num2hex)(id)})`).join(", ")}`,
|
|
1212
|
+
"next indicator": getIndicatorName(this.nextIndicatorId)
|
|
1213
|
+
}
|
|
1214
|
+
};
|
|
1215
|
+
}
|
|
1216
|
+
};
|
|
1217
|
+
return IndicatorCCSupportedReport2 = _classThis;
|
|
1218
|
+
})();
|
|
1101
1219
|
function testResponseForIndicatorSupportedGet(sent, received) {
|
|
1102
1220
|
return sent.indicatorId === 0 || received.indicatorId === sent.indicatorId;
|
|
1103
1221
|
}
|
|
1104
|
-
let IndicatorCCSupportedGet =
|
|
1105
|
-
|
|
1106
|
-
|
|
1107
|
-
|
|
1108
|
-
|
|
1109
|
-
|
|
1110
|
-
|
|
1111
|
-
|
|
1112
|
-
|
|
1113
|
-
|
|
1114
|
-
|
|
1115
|
-
|
|
1116
|
-
|
|
1117
|
-
|
|
1118
|
-
|
|
1119
|
-
|
|
1120
|
-
|
|
1121
|
-
|
|
1122
|
-
|
|
1123
|
-
|
|
1124
|
-
|
|
1125
|
-
|
|
1126
|
-
|
|
1127
|
-
|
|
1128
|
-
|
|
1129
|
-
|
|
1130
|
-
|
|
1131
|
-
|
|
1132
|
-
|
|
1133
|
-
|
|
1134
|
-
|
|
1135
|
-
|
|
1136
|
-
|
|
1137
|
-
|
|
1138
|
-
|
|
1139
|
-
|
|
1140
|
-
|
|
1141
|
-
|
|
1142
|
-
|
|
1143
|
-
|
|
1144
|
-
|
|
1145
|
-
|
|
1146
|
-
|
|
1147
|
-
|
|
1148
|
-
|
|
1149
|
-
|
|
1150
|
-
|
|
1151
|
-
|
|
1152
|
-
|
|
1153
|
-
|
|
1154
|
-
|
|
1155
|
-
|
|
1156
|
-
|
|
1157
|
-
|
|
1158
|
-
|
|
1159
|
-
|
|
1160
|
-
|
|
1161
|
-
|
|
1162
|
-
|
|
1163
|
-
|
|
1164
|
-
|
|
1165
|
-
|
|
1166
|
-
|
|
1167
|
-
|
|
1168
|
-
|
|
1169
|
-
|
|
1170
|
-
|
|
1171
|
-
|
|
1172
|
-
|
|
1173
|
-
|
|
1174
|
-
|
|
1175
|
-
|
|
1176
|
-
|
|
1222
|
+
let IndicatorCCSupportedGet = (() => {
|
|
1223
|
+
let _classDecorators = [(0, import_CommandClassDecorators.CCCommand)(import_Types.IndicatorCommand.SupportedGet), (0, import_CommandClassDecorators.expectedCCResponse)(IndicatorCCSupportedReport, testResponseForIndicatorSupportedGet)];
|
|
1224
|
+
let _classDescriptor;
|
|
1225
|
+
let _classExtraInitializers = [];
|
|
1226
|
+
let _classThis;
|
|
1227
|
+
let _classSuper = IndicatorCC;
|
|
1228
|
+
var IndicatorCCSupportedGet2 = class extends _classSuper {
|
|
1229
|
+
static {
|
|
1230
|
+
_classThis = this;
|
|
1231
|
+
}
|
|
1232
|
+
static {
|
|
1233
|
+
const _metadata = typeof Symbol === "function" && Symbol.metadata ? Object.create(_classSuper[Symbol.metadata] ?? null) : void 0;
|
|
1234
|
+
__esDecorate(null, _classDescriptor = { value: _classThis }, _classDecorators, { kind: "class", name: _classThis.name, metadata: _metadata }, null, _classExtraInitializers);
|
|
1235
|
+
IndicatorCCSupportedGet2 = _classThis = _classDescriptor.value;
|
|
1236
|
+
if (_metadata) Object.defineProperty(_classThis, Symbol.metadata, { enumerable: true, configurable: true, writable: true, value: _metadata });
|
|
1237
|
+
__runInitializers(_classThis, _classExtraInitializers);
|
|
1238
|
+
}
|
|
1239
|
+
constructor(options) {
|
|
1240
|
+
super(options);
|
|
1241
|
+
this.indicatorId = options.indicatorId;
|
|
1242
|
+
}
|
|
1243
|
+
static from(raw, ctx) {
|
|
1244
|
+
(0, import_safe.validatePayload)(raw.payload.length >= 1);
|
|
1245
|
+
const indicatorId = raw.payload[0];
|
|
1246
|
+
return new this({
|
|
1247
|
+
nodeId: ctx.sourceNodeId,
|
|
1248
|
+
indicatorId
|
|
1249
|
+
});
|
|
1250
|
+
}
|
|
1251
|
+
indicatorId;
|
|
1252
|
+
serialize(ctx) {
|
|
1253
|
+
this.payload = import_safe2.Bytes.from([this.indicatorId]);
|
|
1254
|
+
return super.serialize(ctx);
|
|
1255
|
+
}
|
|
1256
|
+
toLogEntry(ctx) {
|
|
1257
|
+
return {
|
|
1258
|
+
...super.toLogEntry(ctx),
|
|
1259
|
+
message: {
|
|
1260
|
+
indicator: getIndicatorName(this.indicatorId)
|
|
1261
|
+
}
|
|
1262
|
+
};
|
|
1263
|
+
}
|
|
1264
|
+
};
|
|
1265
|
+
return IndicatorCCSupportedGet2 = _classThis;
|
|
1266
|
+
})();
|
|
1267
|
+
let IndicatorCCDescriptionReport = (() => {
|
|
1268
|
+
let _classDecorators = [(0, import_CommandClassDecorators.CCCommand)(import_Types.IndicatorCommand.DescriptionReport)];
|
|
1269
|
+
let _classDescriptor;
|
|
1270
|
+
let _classExtraInitializers = [];
|
|
1271
|
+
let _classThis;
|
|
1272
|
+
let _classSuper = IndicatorCC;
|
|
1273
|
+
var IndicatorCCDescriptionReport2 = class extends _classSuper {
|
|
1274
|
+
static {
|
|
1275
|
+
_classThis = this;
|
|
1276
|
+
}
|
|
1277
|
+
static {
|
|
1278
|
+
const _metadata = typeof Symbol === "function" && Symbol.metadata ? Object.create(_classSuper[Symbol.metadata] ?? null) : void 0;
|
|
1279
|
+
__esDecorate(null, _classDescriptor = { value: _classThis }, _classDecorators, { kind: "class", name: _classThis.name, metadata: _metadata }, null, _classExtraInitializers);
|
|
1280
|
+
IndicatorCCDescriptionReport2 = _classThis = _classDescriptor.value;
|
|
1281
|
+
if (_metadata) Object.defineProperty(_classThis, Symbol.metadata, { enumerable: true, configurable: true, writable: true, value: _metadata });
|
|
1282
|
+
__runInitializers(_classThis, _classExtraInitializers);
|
|
1283
|
+
}
|
|
1284
|
+
constructor(options) {
|
|
1285
|
+
super(options);
|
|
1286
|
+
this.indicatorId = options.indicatorId;
|
|
1287
|
+
this.description = options.description;
|
|
1288
|
+
}
|
|
1289
|
+
static from(raw, ctx) {
|
|
1290
|
+
(0, import_safe.validatePayload)(raw.payload.length >= 2);
|
|
1291
|
+
const indicatorId = raw.payload[0];
|
|
1292
|
+
const descrptionLength = raw.payload[1];
|
|
1293
|
+
(0, import_safe.validatePayload)(raw.payload.length >= 2 + descrptionLength);
|
|
1294
|
+
const description = raw.payload.subarray(2, 2 + descrptionLength).toString("utf8");
|
|
1295
|
+
return new this({
|
|
1296
|
+
nodeId: ctx.sourceNodeId,
|
|
1297
|
+
indicatorId,
|
|
1298
|
+
description
|
|
1299
|
+
});
|
|
1300
|
+
}
|
|
1301
|
+
indicatorId;
|
|
1302
|
+
description;
|
|
1303
|
+
persistValues(ctx) {
|
|
1304
|
+
if (!super.persistValues(ctx))
|
|
1305
|
+
return false;
|
|
1306
|
+
if (this.description) {
|
|
1307
|
+
this.setValue(ctx, IndicatorCCValues.indicatorDescription(this.indicatorId), this.description);
|
|
1177
1308
|
}
|
|
1178
|
-
|
|
1179
|
-
|
|
1180
|
-
|
|
1181
|
-
|
|
1182
|
-
|
|
1183
|
-
|
|
1309
|
+
return true;
|
|
1310
|
+
}
|
|
1311
|
+
serialize(ctx) {
|
|
1312
|
+
const description = import_safe2.Bytes.from(this.description, "utf8");
|
|
1313
|
+
this.payload = import_safe2.Bytes.concat([
|
|
1314
|
+
import_safe2.Bytes.from([this.indicatorId, description.length]),
|
|
1315
|
+
description
|
|
1316
|
+
]);
|
|
1317
|
+
return super.serialize(ctx);
|
|
1318
|
+
}
|
|
1319
|
+
toLogEntry(ctx) {
|
|
1320
|
+
return {
|
|
1321
|
+
...super.toLogEntry(ctx),
|
|
1322
|
+
message: {
|
|
1323
|
+
"indicator ID": this.indicatorId,
|
|
1324
|
+
description: this.description || "(none)"
|
|
1325
|
+
}
|
|
1326
|
+
};
|
|
1327
|
+
}
|
|
1328
|
+
};
|
|
1329
|
+
return IndicatorCCDescriptionReport2 = _classThis;
|
|
1330
|
+
})();
|
|
1184
1331
|
function testResponseForIndicatorDescriptionGet(sent, received) {
|
|
1185
1332
|
return received.indicatorId === sent.indicatorId;
|
|
1186
1333
|
}
|
|
1187
|
-
let IndicatorCCDescriptionGet =
|
|
1188
|
-
|
|
1189
|
-
|
|
1190
|
-
|
|
1191
|
-
|
|
1192
|
-
|
|
1334
|
+
let IndicatorCCDescriptionGet = (() => {
|
|
1335
|
+
let _classDecorators = [(0, import_CommandClassDecorators.CCCommand)(import_Types.IndicatorCommand.DescriptionGet), (0, import_CommandClassDecorators.expectedCCResponse)(IndicatorCCDescriptionReport, testResponseForIndicatorDescriptionGet)];
|
|
1336
|
+
let _classDescriptor;
|
|
1337
|
+
let _classExtraInitializers = [];
|
|
1338
|
+
let _classThis;
|
|
1339
|
+
let _classSuper = IndicatorCC;
|
|
1340
|
+
var IndicatorCCDescriptionGet2 = class extends _classSuper {
|
|
1341
|
+
static {
|
|
1342
|
+
_classThis = this;
|
|
1193
1343
|
}
|
|
1194
|
-
|
|
1195
|
-
|
|
1196
|
-
|
|
1197
|
-
|
|
1198
|
-
|
|
1199
|
-
|
|
1200
|
-
|
|
1201
|
-
|
|
1202
|
-
|
|
1203
|
-
|
|
1204
|
-
|
|
1205
|
-
|
|
1206
|
-
return super.serialize(ctx);
|
|
1207
|
-
}
|
|
1208
|
-
toLogEntry(ctx) {
|
|
1209
|
-
return {
|
|
1210
|
-
...super.toLogEntry(ctx),
|
|
1211
|
-
message: {
|
|
1212
|
-
"indicator ID": this.indicatorId
|
|
1344
|
+
static {
|
|
1345
|
+
const _metadata = typeof Symbol === "function" && Symbol.metadata ? Object.create(_classSuper[Symbol.metadata] ?? null) : void 0;
|
|
1346
|
+
__esDecorate(null, _classDescriptor = { value: _classThis }, _classDecorators, { kind: "class", name: _classThis.name, metadata: _metadata }, null, _classExtraInitializers);
|
|
1347
|
+
IndicatorCCDescriptionGet2 = _classThis = _classDescriptor.value;
|
|
1348
|
+
if (_metadata) Object.defineProperty(_classThis, Symbol.metadata, { enumerable: true, configurable: true, writable: true, value: _metadata });
|
|
1349
|
+
__runInitializers(_classThis, _classExtraInitializers);
|
|
1350
|
+
}
|
|
1351
|
+
constructor(options) {
|
|
1352
|
+
super(options);
|
|
1353
|
+
this.indicatorId = options.indicatorId;
|
|
1354
|
+
if (!isManufacturerDefinedIndicator(this.indicatorId)) {
|
|
1355
|
+
throw new import_safe.ZWaveError("The indicator ID must be between 0x80 and 0x9f", import_safe.ZWaveErrorCodes.Argument_Invalid);
|
|
1213
1356
|
}
|
|
1214
|
-
}
|
|
1215
|
-
|
|
1216
|
-
|
|
1217
|
-
|
|
1218
|
-
|
|
1219
|
-
|
|
1220
|
-
|
|
1357
|
+
}
|
|
1358
|
+
static from(raw, ctx) {
|
|
1359
|
+
(0, import_safe.validatePayload)(raw.payload.length >= 1);
|
|
1360
|
+
const indicatorId = raw.payload[0];
|
|
1361
|
+
return new this({
|
|
1362
|
+
nodeId: ctx.sourceNodeId,
|
|
1363
|
+
indicatorId
|
|
1364
|
+
});
|
|
1365
|
+
}
|
|
1366
|
+
indicatorId;
|
|
1367
|
+
serialize(ctx) {
|
|
1368
|
+
this.payload = import_safe2.Bytes.from([this.indicatorId]);
|
|
1369
|
+
return super.serialize(ctx);
|
|
1370
|
+
}
|
|
1371
|
+
toLogEntry(ctx) {
|
|
1372
|
+
return {
|
|
1373
|
+
...super.toLogEntry(ctx),
|
|
1374
|
+
message: {
|
|
1375
|
+
"indicator ID": this.indicatorId
|
|
1376
|
+
}
|
|
1377
|
+
};
|
|
1378
|
+
}
|
|
1379
|
+
};
|
|
1380
|
+
return IndicatorCCDescriptionGet2 = _classThis;
|
|
1381
|
+
})();
|
|
1221
1382
|
// Annotate the CommonJS export names for ESM import in node:
|
|
1222
1383
|
0 && (module.exports = {
|
|
1223
1384
|
IndicatorCC,
|