@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
|
@@ -50,13 +50,45 @@ var import_CommandClass = require("../lib/CommandClass.js");
|
|
|
50
50
|
var import_CommandClassDecorators = require("../lib/CommandClassDecorators.js");
|
|
51
51
|
var import_Values = require("../lib/Values.js");
|
|
52
52
|
var import_Types = require("../lib/_Types.js");
|
|
53
|
-
var
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
53
|
+
var __esDecorate = function(ctor, descriptorIn, decorators, contextIn, initializers, extraInitializers) {
|
|
54
|
+
function accept(f) {
|
|
55
|
+
if (f !== void 0 && typeof f !== "function") throw new TypeError("Function expected");
|
|
56
|
+
return f;
|
|
57
|
+
}
|
|
58
|
+
var kind = contextIn.kind, key = kind === "getter" ? "get" : kind === "setter" ? "set" : "value";
|
|
59
|
+
var target = !descriptorIn && ctor ? contextIn["static"] ? ctor : ctor.prototype : null;
|
|
60
|
+
var descriptor = descriptorIn || (target ? Object.getOwnPropertyDescriptor(target, contextIn.name) : {});
|
|
61
|
+
var _, done = false;
|
|
62
|
+
for (var i = decorators.length - 1; i >= 0; i--) {
|
|
63
|
+
var context = {};
|
|
64
|
+
for (var p in contextIn) context[p] = p === "access" ? {} : contextIn[p];
|
|
65
|
+
for (var p in contextIn.access) context.access[p] = contextIn.access[p];
|
|
66
|
+
context.addInitializer = function(f) {
|
|
67
|
+
if (done) throw new TypeError("Cannot add initializers after decoration has completed");
|
|
68
|
+
extraInitializers.push(accept(f || null));
|
|
69
|
+
};
|
|
70
|
+
var result = (0, decorators[i])(kind === "accessor" ? { get: descriptor.get, set: descriptor.set } : descriptor[key], context);
|
|
71
|
+
if (kind === "accessor") {
|
|
72
|
+
if (result === void 0) continue;
|
|
73
|
+
if (result === null || typeof result !== "object") throw new TypeError("Object expected");
|
|
74
|
+
if (_ = accept(result.get)) descriptor.get = _;
|
|
75
|
+
if (_ = accept(result.set)) descriptor.set = _;
|
|
76
|
+
if (_ = accept(result.init)) initializers.unshift(_);
|
|
77
|
+
} else if (_ = accept(result)) {
|
|
78
|
+
if (kind === "field") initializers.unshift(_);
|
|
79
|
+
else descriptor[key] = _;
|
|
80
|
+
}
|
|
81
|
+
}
|
|
82
|
+
if (target) Object.defineProperty(target, contextIn.name, descriptor);
|
|
83
|
+
done = true;
|
|
84
|
+
};
|
|
85
|
+
var __runInitializers = function(thisArg, initializers, value) {
|
|
86
|
+
var useValue = arguments.length > 2;
|
|
87
|
+
for (var i = 0; i < initializers.length; i++) {
|
|
88
|
+
value = useValue ? initializers[i].call(thisArg, value) : initializers[i].call(thisArg);
|
|
89
|
+
}
|
|
90
|
+
return useValue ? value : void 0;
|
|
58
91
|
};
|
|
59
|
-
var IrrigationCC_1, IrrigationCCSystemInfoReport_1, IrrigationCCSystemStatusReport_1, IrrigationCCSystemConfigReport_1, IrrigationCCValveInfoReport_1, IrrigationCCValveConfigReport_1, IrrigationCCValveTableReport_1;
|
|
60
92
|
function __assertType(argName, typeName, boundHasError) {
|
|
61
93
|
const { ZWaveError: ZWaveError2, ZWaveErrorCodes: ZWaveErrorCodes2 } = require("@zwave-js/core");
|
|
62
94
|
if (boundHasError()) {
|
|
@@ -473,1484 +505,1698 @@ const valveConfigPropertyKeys = [
|
|
|
473
505
|
"useRainSensor",
|
|
474
506
|
"useMoistureSensor"
|
|
475
507
|
];
|
|
476
|
-
let IrrigationCCAPI =
|
|
477
|
-
|
|
478
|
-
|
|
479
|
-
|
|
480
|
-
|
|
481
|
-
|
|
482
|
-
|
|
483
|
-
|
|
484
|
-
|
|
485
|
-
case import_Types.IrrigationCommand.ValveConfigGet:
|
|
486
|
-
case import_Types.IrrigationCommand.ValveRun:
|
|
487
|
-
case import_Types.IrrigationCommand.ValveTableSet:
|
|
488
|
-
case import_Types.IrrigationCommand.ValveTableGet:
|
|
489
|
-
case import_Types.IrrigationCommand.ValveTableRun:
|
|
490
|
-
case import_Types.IrrigationCommand.SystemShutoff:
|
|
491
|
-
return true;
|
|
492
|
-
}
|
|
493
|
-
return super.supportsCommand(cmd);
|
|
494
|
-
}
|
|
495
|
-
// eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types
|
|
496
|
-
async getSystemInfo() {
|
|
497
|
-
this.assertSupportsCommand(import_Types.IrrigationCommand, import_Types.IrrigationCommand.SystemInfoGet);
|
|
498
|
-
const cc = new IrrigationCCSystemInfoGet({
|
|
499
|
-
nodeId: this.endpoint.nodeId,
|
|
500
|
-
endpointIndex: this.endpoint.index
|
|
501
|
-
});
|
|
502
|
-
const response = await this.host.sendCommand(cc, this.commandOptions);
|
|
503
|
-
if (response) {
|
|
504
|
-
return (0, import_safe3.pick)(response, [
|
|
505
|
-
"numValves",
|
|
506
|
-
"numValveTables",
|
|
507
|
-
"supportsMasterValve",
|
|
508
|
-
"maxValveTableSize"
|
|
509
|
-
]);
|
|
508
|
+
let IrrigationCCAPI = (() => {
|
|
509
|
+
let _classDecorators = [(0, import_CommandClassDecorators.API)(import_safe.CommandClasses.Irrigation)];
|
|
510
|
+
let _classDescriptor;
|
|
511
|
+
let _classExtraInitializers = [];
|
|
512
|
+
let _classThis;
|
|
513
|
+
let _classSuper = import_API.CCAPI;
|
|
514
|
+
var IrrigationCCAPI2 = class extends _classSuper {
|
|
515
|
+
static {
|
|
516
|
+
_classThis = this;
|
|
510
517
|
}
|
|
511
|
-
|
|
512
|
-
|
|
513
|
-
|
|
514
|
-
|
|
515
|
-
|
|
516
|
-
|
|
517
|
-
endpointIndex: this.endpoint.index
|
|
518
|
-
});
|
|
519
|
-
const response = await this.host.sendCommand(cc, this.commandOptions);
|
|
520
|
-
if (response) {
|
|
521
|
-
return (0, import_safe3.pick)(response, [
|
|
522
|
-
"systemVoltage",
|
|
523
|
-
"flowSensorActive",
|
|
524
|
-
"pressureSensorActive",
|
|
525
|
-
"rainSensorActive",
|
|
526
|
-
"moistureSensorActive",
|
|
527
|
-
"flow",
|
|
528
|
-
"pressure",
|
|
529
|
-
"shutoffDuration",
|
|
530
|
-
"errorNotProgrammed",
|
|
531
|
-
"errorEmergencyShutdown",
|
|
532
|
-
"errorHighPressure",
|
|
533
|
-
"errorLowPressure",
|
|
534
|
-
"errorValve",
|
|
535
|
-
"masterValveOpen",
|
|
536
|
-
"firstOpenZoneId"
|
|
537
|
-
]);
|
|
518
|
+
static {
|
|
519
|
+
const _metadata = typeof Symbol === "function" && Symbol.metadata ? Object.create(_classSuper[Symbol.metadata] ?? null) : void 0;
|
|
520
|
+
__esDecorate(null, _classDescriptor = { value: _classThis }, _classDecorators, { kind: "class", name: _classThis.name, metadata: _metadata }, null, _classExtraInitializers);
|
|
521
|
+
IrrigationCCAPI2 = _classThis = _classDescriptor.value;
|
|
522
|
+
if (_metadata) Object.defineProperty(_classThis, Symbol.metadata, { enumerable: true, configurable: true, writable: true, value: _metadata });
|
|
523
|
+
__runInitializers(_classThis, _classExtraInitializers);
|
|
538
524
|
}
|
|
539
|
-
|
|
540
|
-
|
|
541
|
-
|
|
542
|
-
|
|
543
|
-
|
|
544
|
-
|
|
545
|
-
|
|
546
|
-
|
|
547
|
-
|
|
548
|
-
|
|
549
|
-
|
|
550
|
-
|
|
551
|
-
|
|
552
|
-
|
|
553
|
-
|
|
554
|
-
|
|
555
|
-
|
|
525
|
+
supportsCommand(cmd) {
|
|
526
|
+
switch (cmd) {
|
|
527
|
+
case import_Types.IrrigationCommand.SystemInfoGet:
|
|
528
|
+
case import_Types.IrrigationCommand.SystemStatusGet:
|
|
529
|
+
case import_Types.IrrigationCommand.SystemConfigSet:
|
|
530
|
+
case import_Types.IrrigationCommand.SystemConfigGet:
|
|
531
|
+
case import_Types.IrrigationCommand.ValveInfoGet:
|
|
532
|
+
case import_Types.IrrigationCommand.ValveConfigSet:
|
|
533
|
+
case import_Types.IrrigationCommand.ValveConfigGet:
|
|
534
|
+
case import_Types.IrrigationCommand.ValveRun:
|
|
535
|
+
case import_Types.IrrigationCommand.ValveTableSet:
|
|
536
|
+
case import_Types.IrrigationCommand.ValveTableGet:
|
|
537
|
+
case import_Types.IrrigationCommand.ValveTableRun:
|
|
538
|
+
case import_Types.IrrigationCommand.SystemShutoff:
|
|
539
|
+
return true;
|
|
540
|
+
}
|
|
541
|
+
return super.supportsCommand(cmd);
|
|
556
542
|
}
|
|
557
|
-
|
|
558
|
-
|
|
559
|
-
|
|
560
|
-
|
|
561
|
-
|
|
562
|
-
|
|
563
|
-
|
|
564
|
-
|
|
565
|
-
|
|
566
|
-
|
|
567
|
-
|
|
568
|
-
|
|
569
|
-
|
|
570
|
-
|
|
571
|
-
|
|
572
|
-
|
|
573
|
-
endpointIndex: this.endpoint.index,
|
|
574
|
-
valveId
|
|
575
|
-
});
|
|
576
|
-
const response = await this.host.sendCommand(cc, this.commandOptions);
|
|
577
|
-
if (response) {
|
|
578
|
-
return (0, import_safe3.pick)(response, [
|
|
579
|
-
"connected",
|
|
580
|
-
"nominalCurrent",
|
|
581
|
-
"errorShortCircuit",
|
|
582
|
-
"errorHighCurrent",
|
|
583
|
-
"errorLowCurrent",
|
|
584
|
-
"errorMaximumFlow",
|
|
585
|
-
"errorHighFlow",
|
|
586
|
-
"errorLowFlow"
|
|
587
|
-
]);
|
|
543
|
+
// eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types
|
|
544
|
+
async getSystemInfo() {
|
|
545
|
+
this.assertSupportsCommand(import_Types.IrrigationCommand, import_Types.IrrigationCommand.SystemInfoGet);
|
|
546
|
+
const cc = new IrrigationCCSystemInfoGet({
|
|
547
|
+
nodeId: this.endpoint.nodeId,
|
|
548
|
+
endpointIndex: this.endpoint.index
|
|
549
|
+
});
|
|
550
|
+
const response = await this.host.sendCommand(cc, this.commandOptions);
|
|
551
|
+
if (response) {
|
|
552
|
+
return (0, import_safe3.pick)(response, [
|
|
553
|
+
"numValves",
|
|
554
|
+
"numValveTables",
|
|
555
|
+
"supportsMasterValve",
|
|
556
|
+
"maxValveTableSize"
|
|
557
|
+
]);
|
|
558
|
+
}
|
|
588
559
|
}
|
|
589
|
-
|
|
590
|
-
|
|
591
|
-
|
|
592
|
-
|
|
593
|
-
|
|
594
|
-
|
|
595
|
-
|
|
596
|
-
|
|
597
|
-
|
|
598
|
-
|
|
599
|
-
|
|
600
|
-
|
|
601
|
-
|
|
602
|
-
|
|
603
|
-
|
|
604
|
-
|
|
605
|
-
|
|
606
|
-
|
|
607
|
-
|
|
608
|
-
|
|
609
|
-
|
|
610
|
-
|
|
611
|
-
|
|
612
|
-
|
|
613
|
-
|
|
614
|
-
|
|
615
|
-
|
|
616
|
-
"useRainSensor",
|
|
617
|
-
"useMoistureSensor"
|
|
618
|
-
]);
|
|
560
|
+
// eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types
|
|
561
|
+
async getSystemStatus() {
|
|
562
|
+
this.assertSupportsCommand(import_Types.IrrigationCommand, import_Types.IrrigationCommand.SystemStatusGet);
|
|
563
|
+
const cc = new IrrigationCCSystemStatusGet({
|
|
564
|
+
nodeId: this.endpoint.nodeId,
|
|
565
|
+
endpointIndex: this.endpoint.index
|
|
566
|
+
});
|
|
567
|
+
const response = await this.host.sendCommand(cc, this.commandOptions);
|
|
568
|
+
if (response) {
|
|
569
|
+
return (0, import_safe3.pick)(response, [
|
|
570
|
+
"systemVoltage",
|
|
571
|
+
"flowSensorActive",
|
|
572
|
+
"pressureSensorActive",
|
|
573
|
+
"rainSensorActive",
|
|
574
|
+
"moistureSensorActive",
|
|
575
|
+
"flow",
|
|
576
|
+
"pressure",
|
|
577
|
+
"shutoffDuration",
|
|
578
|
+
"errorNotProgrammed",
|
|
579
|
+
"errorEmergencyShutdown",
|
|
580
|
+
"errorHighPressure",
|
|
581
|
+
"errorLowPressure",
|
|
582
|
+
"errorValve",
|
|
583
|
+
"masterValveOpen",
|
|
584
|
+
"firstOpenZoneId"
|
|
585
|
+
]);
|
|
586
|
+
}
|
|
619
587
|
}
|
|
620
|
-
|
|
621
|
-
|
|
622
|
-
|
|
623
|
-
|
|
624
|
-
|
|
625
|
-
|
|
626
|
-
|
|
627
|
-
|
|
628
|
-
|
|
629
|
-
|
|
630
|
-
|
|
631
|
-
|
|
632
|
-
|
|
633
|
-
|
|
634
|
-
|
|
635
|
-
|
|
636
|
-
}
|
|
637
|
-
async setValveTable(tableId, entries) {
|
|
638
|
-
__assertType("tableId", "number", __assertType__number.bind(void 0, tableId));
|
|
639
|
-
__assertType("entries", void 0, __assertType__sa__2_ea_2.bind(void 0, entries));
|
|
640
|
-
this.assertSupportsCommand(import_Types.IrrigationCommand, import_Types.IrrigationCommand.ValveTableSet);
|
|
641
|
-
if (!this.endpoint.virtual) {
|
|
642
|
-
const maxValveTableSize = IrrigationCC.getMaxValveTableSizeCached(this.host, this.endpoint);
|
|
643
|
-
if (maxValveTableSize != void 0 && entries.length > maxValveTableSize) {
|
|
644
|
-
throw new import_safe.ZWaveError(`The number of valve table entries must not exceed ${maxValveTableSize}.`, import_safe.ZWaveErrorCodes.Argument_Invalid);
|
|
588
|
+
// eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types
|
|
589
|
+
async getSystemConfig() {
|
|
590
|
+
this.assertSupportsCommand(import_Types.IrrigationCommand, import_Types.IrrigationCommand.SystemConfigGet);
|
|
591
|
+
const cc = new IrrigationCCSystemConfigGet({
|
|
592
|
+
nodeId: this.endpoint.nodeId,
|
|
593
|
+
endpointIndex: this.endpoint.index
|
|
594
|
+
});
|
|
595
|
+
const response = await this.host.sendCommand(cc, this.commandOptions);
|
|
596
|
+
if (response) {
|
|
597
|
+
return (0, import_safe3.pick)(response, [
|
|
598
|
+
"masterValveDelay",
|
|
599
|
+
"highPressureThreshold",
|
|
600
|
+
"lowPressureThreshold",
|
|
601
|
+
"rainSensorPolarity",
|
|
602
|
+
"moistureSensorPolarity"
|
|
603
|
+
]);
|
|
645
604
|
}
|
|
646
605
|
}
|
|
647
|
-
|
|
648
|
-
|
|
649
|
-
|
|
650
|
-
|
|
651
|
-
|
|
652
|
-
|
|
653
|
-
|
|
654
|
-
|
|
655
|
-
|
|
656
|
-
__assertType("tableId", "number", __assertType__number.bind(void 0, tableId));
|
|
657
|
-
this.assertSupportsCommand(import_Types.IrrigationCommand, import_Types.IrrigationCommand.ValveTableGet);
|
|
658
|
-
const cc = new IrrigationCCValveTableGet({
|
|
659
|
-
nodeId: this.endpoint.nodeId,
|
|
660
|
-
endpointIndex: this.endpoint.index,
|
|
661
|
-
tableId
|
|
662
|
-
});
|
|
663
|
-
const response = await this.host.sendCommand(cc, this.commandOptions);
|
|
664
|
-
if (response) {
|
|
665
|
-
return response?.entries;
|
|
606
|
+
async setSystemConfig(config) {
|
|
607
|
+
__assertType("config", "IrrigationCCSystemConfigSetOptions", __assertType__IrrigationCCSystemConfigSetOptions.bind(void 0, config));
|
|
608
|
+
this.assertSupportsCommand(import_Types.IrrigationCommand, import_Types.IrrigationCommand.SystemConfigSet);
|
|
609
|
+
const cc = new IrrigationCCSystemConfigSet({
|
|
610
|
+
nodeId: this.endpoint.nodeId,
|
|
611
|
+
endpointIndex: this.endpoint.index,
|
|
612
|
+
...config
|
|
613
|
+
});
|
|
614
|
+
return this.host.sendCommand(cc, this.commandOptions);
|
|
666
615
|
}
|
|
667
|
-
|
|
668
|
-
|
|
669
|
-
|
|
670
|
-
|
|
671
|
-
|
|
672
|
-
|
|
673
|
-
|
|
674
|
-
|
|
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
|
-
|
|
702
|
-
|
|
703
|
-
|
|
704
|
-
|
|
705
|
-
|
|
706
|
-
|
|
707
|
-
|
|
708
|
-
|
|
709
|
-
|
|
710
|
-
|
|
711
|
-
|
|
712
|
-
|
|
713
|
-
|
|
714
|
-
|
|
715
|
-
|
|
716
|
-
|
|
717
|
-
|
|
718
|
-
|
|
719
|
-
|
|
720
|
-
|
|
721
|
-
|
|
616
|
+
async getValveInfo(valveId) {
|
|
617
|
+
__assertType("valveId", "ValveId", __assertType__ValveId.bind(void 0, valveId));
|
|
618
|
+
this.assertSupportsCommand(import_Types.IrrigationCommand, import_Types.IrrigationCommand.ValveInfoGet);
|
|
619
|
+
const cc = new IrrigationCCValveInfoGet({
|
|
620
|
+
nodeId: this.endpoint.nodeId,
|
|
621
|
+
endpointIndex: this.endpoint.index,
|
|
622
|
+
valveId
|
|
623
|
+
});
|
|
624
|
+
const response = await this.host.sendCommand(cc, this.commandOptions);
|
|
625
|
+
if (response) {
|
|
626
|
+
return (0, import_safe3.pick)(response, [
|
|
627
|
+
"connected",
|
|
628
|
+
"nominalCurrent",
|
|
629
|
+
"errorShortCircuit",
|
|
630
|
+
"errorHighCurrent",
|
|
631
|
+
"errorLowCurrent",
|
|
632
|
+
"errorMaximumFlow",
|
|
633
|
+
"errorHighFlow",
|
|
634
|
+
"errorLowFlow"
|
|
635
|
+
]);
|
|
636
|
+
}
|
|
637
|
+
}
|
|
638
|
+
async setValveConfig(options) {
|
|
639
|
+
__assertType("options", "IrrigationCCValveConfigSetOptions", __assertType__IrrigationCCValveConfigSetOptions.bind(void 0, options));
|
|
640
|
+
this.assertSupportsCommand(import_Types.IrrigationCommand, import_Types.IrrigationCommand.ValveConfigSet);
|
|
641
|
+
const cc = new IrrigationCCValveConfigSet({
|
|
642
|
+
nodeId: this.endpoint.nodeId,
|
|
643
|
+
endpointIndex: this.endpoint.index,
|
|
644
|
+
...options
|
|
645
|
+
});
|
|
646
|
+
return this.host.sendCommand(cc, this.commandOptions);
|
|
647
|
+
}
|
|
648
|
+
async getValveConfig(valveId) {
|
|
649
|
+
__assertType("valveId", "ValveId", __assertType__ValveId.bind(void 0, valveId));
|
|
650
|
+
this.assertSupportsCommand(import_Types.IrrigationCommand, import_Types.IrrigationCommand.ValveConfigGet);
|
|
651
|
+
const cc = new IrrigationCCValveConfigGet({
|
|
652
|
+
nodeId: this.endpoint.nodeId,
|
|
653
|
+
endpointIndex: this.endpoint.index,
|
|
654
|
+
valveId
|
|
655
|
+
});
|
|
656
|
+
const response = await this.host.sendCommand(cc, this.commandOptions);
|
|
657
|
+
if (response) {
|
|
658
|
+
return (0, import_safe3.pick)(response, [
|
|
659
|
+
"nominalCurrentHighThreshold",
|
|
660
|
+
"nominalCurrentLowThreshold",
|
|
661
|
+
"maximumFlow",
|
|
662
|
+
"highFlowThreshold",
|
|
663
|
+
"lowFlowThreshold",
|
|
664
|
+
"useRainSensor",
|
|
665
|
+
"useMoistureSensor"
|
|
666
|
+
]);
|
|
667
|
+
}
|
|
668
|
+
}
|
|
669
|
+
async runValve(valveId, duration) {
|
|
670
|
+
__assertType("valveId", "ValveId", __assertType__ValveId.bind(void 0, valveId));
|
|
671
|
+
__assertType("duration", "number", __assertType__number.bind(void 0, duration));
|
|
672
|
+
this.assertSupportsCommand(import_Types.IrrigationCommand, import_Types.IrrigationCommand.ValveRun);
|
|
673
|
+
const cc = new IrrigationCCValveRun({
|
|
674
|
+
nodeId: this.endpoint.nodeId,
|
|
675
|
+
endpointIndex: this.endpoint.index,
|
|
676
|
+
valveId,
|
|
677
|
+
duration
|
|
678
|
+
});
|
|
679
|
+
return this.host.sendCommand(cc, this.commandOptions);
|
|
680
|
+
}
|
|
681
|
+
shutoffValve(valveId) {
|
|
682
|
+
__assertType("valveId", "ValveId", __assertType__ValveId.bind(void 0, valveId));
|
|
683
|
+
return this.runValve(valveId, 0);
|
|
684
|
+
}
|
|
685
|
+
async setValveTable(tableId, entries) {
|
|
686
|
+
__assertType("tableId", "number", __assertType__number.bind(void 0, tableId));
|
|
687
|
+
__assertType("entries", void 0, __assertType__sa__2_ea_2.bind(void 0, entries));
|
|
688
|
+
this.assertSupportsCommand(import_Types.IrrigationCommand, import_Types.IrrigationCommand.ValveTableSet);
|
|
689
|
+
if (!this.endpoint.virtual) {
|
|
690
|
+
const maxValveTableSize = IrrigationCC.getMaxValveTableSizeCached(this.host, this.endpoint);
|
|
691
|
+
if (maxValveTableSize != void 0 && entries.length > maxValveTableSize) {
|
|
692
|
+
throw new import_safe.ZWaveError(`The number of valve table entries must not exceed ${maxValveTableSize}.`, import_safe.ZWaveErrorCodes.Argument_Invalid);
|
|
722
693
|
}
|
|
723
|
-
|
|
724
|
-
|
|
725
|
-
|
|
726
|
-
|
|
727
|
-
|
|
728
|
-
|
|
694
|
+
}
|
|
695
|
+
const cc = new IrrigationCCValveTableSet({
|
|
696
|
+
nodeId: this.endpoint.nodeId,
|
|
697
|
+
endpointIndex: this.endpoint.index,
|
|
698
|
+
tableId,
|
|
699
|
+
entries
|
|
700
|
+
});
|
|
701
|
+
return this.host.sendCommand(cc, this.commandOptions);
|
|
702
|
+
}
|
|
703
|
+
async getValveTable(tableId) {
|
|
704
|
+
__assertType("tableId", "number", __assertType__number.bind(void 0, tableId));
|
|
705
|
+
this.assertSupportsCommand(import_Types.IrrigationCommand, import_Types.IrrigationCommand.ValveTableGet);
|
|
706
|
+
const cc = new IrrigationCCValveTableGet({
|
|
707
|
+
nodeId: this.endpoint.nodeId,
|
|
708
|
+
endpointIndex: this.endpoint.index,
|
|
709
|
+
tableId
|
|
710
|
+
});
|
|
711
|
+
const response = await this.host.sendCommand(cc, this.commandOptions);
|
|
712
|
+
if (response) {
|
|
713
|
+
return response?.entries;
|
|
714
|
+
}
|
|
715
|
+
}
|
|
716
|
+
async runTables(tableIDs) {
|
|
717
|
+
__assertType("tableIDs", void 0, __assertType__sa__number_ea_2.bind(void 0, tableIDs));
|
|
718
|
+
this.assertSupportsCommand(import_Types.IrrigationCommand, import_Types.IrrigationCommand.ValveTableRun);
|
|
719
|
+
const cc = new IrrigationCCValveTableRun({
|
|
720
|
+
nodeId: this.endpoint.nodeId,
|
|
721
|
+
endpointIndex: this.endpoint.index,
|
|
722
|
+
tableIDs
|
|
723
|
+
});
|
|
724
|
+
return this.host.sendCommand(cc, this.commandOptions);
|
|
725
|
+
}
|
|
726
|
+
/**
|
|
727
|
+
* Shuts off the entire system for the given duration.
|
|
728
|
+
* @param duration Shutoff duration in hours. A value of 255 will shut off the entire system permanently and prevents schedules from running.
|
|
729
|
+
*/
|
|
730
|
+
async shutoffSystem(duration) {
|
|
731
|
+
__assertType("duration", "number", __assertType__number.bind(void 0, duration));
|
|
732
|
+
this.assertSupportsCommand(import_Types.IrrigationCommand, import_Types.IrrigationCommand.SystemShutoff);
|
|
733
|
+
const cc = new IrrigationCCSystemShutoff({
|
|
734
|
+
nodeId: this.endpoint.nodeId,
|
|
735
|
+
endpointIndex: this.endpoint.index,
|
|
736
|
+
duration
|
|
737
|
+
});
|
|
738
|
+
return this.host.sendCommand(cc, this.commandOptions);
|
|
739
|
+
}
|
|
740
|
+
/** Shuts off the entire system permanently and prevents schedules from running */
|
|
741
|
+
shutoffSystemPermanently() {
|
|
742
|
+
return this.shutoffSystem(255);
|
|
743
|
+
}
|
|
744
|
+
get [import_API.SET_VALUE]() {
|
|
745
|
+
return async function({ property, propertyKey }, value) {
|
|
746
|
+
const valueDB = this.getValueDB();
|
|
747
|
+
if (systemConfigProperties.includes(property)) {
|
|
748
|
+
const options = {};
|
|
749
|
+
for (const prop of systemConfigProperties) {
|
|
750
|
+
if (prop === property)
|
|
729
751
|
continue;
|
|
730
752
|
const valueId = {
|
|
731
753
|
commandClass: this.ccId,
|
|
732
754
|
endpoint: this.endpoint.index,
|
|
733
|
-
property
|
|
734
|
-
propertyKey: prop
|
|
755
|
+
property: prop
|
|
735
756
|
};
|
|
736
757
|
const cachedVal = valueDB.getValue(valueId);
|
|
737
758
|
if (cachedVal == void 0) {
|
|
738
|
-
throw new import_safe.ZWaveError(`The "${property}
|
|
759
|
+
throw new import_safe.ZWaveError(`The "${property}" property cannot be changed before ${prop} is known!`, import_safe.ZWaveErrorCodes.Argument_Invalid);
|
|
739
760
|
}
|
|
740
761
|
options[prop] = cachedVal;
|
|
741
762
|
}
|
|
742
|
-
options[
|
|
743
|
-
return this.
|
|
744
|
-
} else if (
|
|
745
|
-
return;
|
|
746
|
-
} else if (
|
|
747
|
-
if (
|
|
748
|
-
(0, import_API.
|
|
763
|
+
options[property] = value;
|
|
764
|
+
return this.setSystemConfig(options);
|
|
765
|
+
} else if (property === "shutoff") {
|
|
766
|
+
return this.shutoffSystem(0);
|
|
767
|
+
} else if (property === "master" || typeof property === "number" && property >= 1) {
|
|
768
|
+
if (propertyKey == void 0) {
|
|
769
|
+
(0, import_API.throwMissingPropertyKey)(this.ccId, property);
|
|
749
770
|
}
|
|
750
|
-
if (
|
|
751
|
-
const
|
|
752
|
-
|
|
753
|
-
|
|
771
|
+
if (valveConfigPropertyKeys.includes(propertyKey)) {
|
|
772
|
+
const options = {
|
|
773
|
+
valveId: property
|
|
774
|
+
};
|
|
775
|
+
for (const prop of valveConfigPropertyKeys) {
|
|
776
|
+
if (prop === propertyKey)
|
|
777
|
+
continue;
|
|
778
|
+
const valueId = {
|
|
779
|
+
commandClass: this.ccId,
|
|
780
|
+
endpoint: this.endpoint.index,
|
|
781
|
+
property,
|
|
782
|
+
propertyKey: prop
|
|
783
|
+
};
|
|
784
|
+
const cachedVal = valueDB.getValue(valueId);
|
|
785
|
+
if (cachedVal == void 0) {
|
|
786
|
+
throw new import_safe.ZWaveError(`The "${property}_${propertyKey}" property cannot be changed before ${property}_${prop} is known!`, import_safe.ZWaveErrorCodes.Argument_Invalid);
|
|
787
|
+
}
|
|
788
|
+
options[prop] = cachedVal;
|
|
789
|
+
}
|
|
790
|
+
options[propertyKey] = value;
|
|
791
|
+
return this.setValveConfig(options);
|
|
792
|
+
} else if (propertyKey === "duration") {
|
|
793
|
+
return;
|
|
794
|
+
} else if (propertyKey === "startStop") {
|
|
795
|
+
if (typeof value !== "boolean") {
|
|
796
|
+
(0, import_API.throwWrongValueType)(this.ccId, property, "boolean", typeof value);
|
|
797
|
+
}
|
|
798
|
+
if (value) {
|
|
799
|
+
const duration = valueDB.getValue(IrrigationCCValues.valveRunDuration(property).endpoint(this.endpoint.index));
|
|
800
|
+
if (duration == void 0) {
|
|
801
|
+
throw new import_safe.ZWaveError(`Cannot start a valve run without specifying a duration first!`, import_safe.ZWaveErrorCodes.Argument_Invalid);
|
|
802
|
+
}
|
|
803
|
+
return this.runValve(property, duration);
|
|
804
|
+
} else {
|
|
805
|
+
return this.shutoffValve(property);
|
|
754
806
|
}
|
|
755
|
-
return this.runValve(property, duration);
|
|
756
807
|
} else {
|
|
757
|
-
|
|
808
|
+
(0, import_API.throwUnsupportedPropertyKey)(this.ccId, property, propertyKey);
|
|
758
809
|
}
|
|
759
|
-
} else {
|
|
760
|
-
(0, import_API.throwUnsupportedPropertyKey)(this.ccId, property, propertyKey);
|
|
761
810
|
}
|
|
762
|
-
}
|
|
763
|
-
}
|
|
764
|
-
|
|
765
|
-
|
|
766
|
-
|
|
767
|
-
|
|
768
|
-
|
|
769
|
-
|
|
770
|
-
|
|
771
|
-
|
|
772
|
-
|
|
773
|
-
|
|
774
|
-
|
|
775
|
-
|
|
776
|
-
|
|
777
|
-
|
|
778
|
-
|
|
779
|
-
|
|
780
|
-
|
|
781
|
-
|
|
782
|
-
|
|
783
|
-
|
|
784
|
-
|
|
785
|
-
|
|
786
|
-
|
|
787
|
-
|
|
788
|
-
|
|
789
|
-
return (await this.getSystemConfig())?.[property];
|
|
790
|
-
}
|
|
791
|
-
if (property === "master" || typeof property === "number" && property >= 1) {
|
|
792
|
-
switch (propertyKey) {
|
|
793
|
-
case "connected":
|
|
794
|
-
case "nominalCurrent":
|
|
795
|
-
case "errorShortCircuit":
|
|
796
|
-
case "errorHighCurrent":
|
|
797
|
-
case "errorLowCurrent":
|
|
798
|
-
case "errorMaximumFlow":
|
|
799
|
-
case "errorHighFlow":
|
|
800
|
-
case "errorLowFlow":
|
|
801
|
-
return (await this.getValveInfo(property))?.[propertyKey];
|
|
802
|
-
case "nominalCurrentHighThreshold":
|
|
803
|
-
case "nominalCurrentLowThreshold":
|
|
804
|
-
case "maximumFlow":
|
|
805
|
-
case "highFlowThreshold":
|
|
806
|
-
case "lowFlowThreshold":
|
|
807
|
-
case "useRainSensor":
|
|
808
|
-
case "useMoistureSensor":
|
|
809
|
-
return (await this.getValveConfig(property))?.[propertyKey];
|
|
810
|
-
case void 0:
|
|
811
|
-
(0, import_API.throwMissingPropertyKey)(this.ccId, property);
|
|
812
|
-
default:
|
|
813
|
-
(0, import_API.throwUnsupportedPropertyKey)(this.ccId, property, propertyKey);
|
|
811
|
+
};
|
|
812
|
+
}
|
|
813
|
+
get [import_API.POLL_VALUE]() {
|
|
814
|
+
return async function({ property, propertyKey }) {
|
|
815
|
+
switch (property) {
|
|
816
|
+
case "systemVoltage":
|
|
817
|
+
case "flowSensorActive":
|
|
818
|
+
case "pressureSensorActive":
|
|
819
|
+
case "rainSensorActive":
|
|
820
|
+
case "moistureSensorActive":
|
|
821
|
+
case "flow":
|
|
822
|
+
case "pressure":
|
|
823
|
+
case "shutoffDuration":
|
|
824
|
+
case "errorNotProgrammed":
|
|
825
|
+
case "errorEmergencyShutdown":
|
|
826
|
+
case "errorHighPressure":
|
|
827
|
+
case "errorLowPressure":
|
|
828
|
+
case "errorValve":
|
|
829
|
+
case "masterValveOpen":
|
|
830
|
+
case "firstOpenZoneId":
|
|
831
|
+
return (await this.getSystemStatus())?.[property];
|
|
832
|
+
case "masterValveDelay":
|
|
833
|
+
case "highPressureThreshold":
|
|
834
|
+
case "lowPressureThreshold":
|
|
835
|
+
case "rainSensorPolarity":
|
|
836
|
+
case "moistureSensorPolarity":
|
|
837
|
+
return (await this.getSystemConfig())?.[property];
|
|
814
838
|
}
|
|
815
|
-
|
|
816
|
-
|
|
817
|
-
|
|
818
|
-
|
|
819
|
-
|
|
820
|
-
|
|
821
|
-
|
|
822
|
-
|
|
823
|
-
|
|
824
|
-
|
|
825
|
-
|
|
826
|
-
|
|
827
|
-
|
|
828
|
-
|
|
829
|
-
|
|
830
|
-
|
|
831
|
-
|
|
832
|
-
|
|
833
|
-
|
|
834
|
-
|
|
835
|
-
|
|
836
|
-
|
|
837
|
-
|
|
838
|
-
|
|
839
|
-
|
|
840
|
-
|
|
841
|
-
|
|
842
|
-
|
|
843
|
-
|
|
844
|
-
|
|
845
|
-
|
|
846
|
-
|
|
847
|
-
|
|
848
|
-
|
|
849
|
-
|
|
850
|
-
|
|
851
|
-
|
|
852
|
-
|
|
853
|
-
|
|
854
|
-
|
|
855
|
-
}
|
|
856
|
-
|
|
857
|
-
|
|
858
|
-
|
|
859
|
-
|
|
860
|
-
|
|
861
|
-
|
|
862
|
-
|
|
839
|
+
if (property === "master" || typeof property === "number" && property >= 1) {
|
|
840
|
+
switch (propertyKey) {
|
|
841
|
+
case "connected":
|
|
842
|
+
case "nominalCurrent":
|
|
843
|
+
case "errorShortCircuit":
|
|
844
|
+
case "errorHighCurrent":
|
|
845
|
+
case "errorLowCurrent":
|
|
846
|
+
case "errorMaximumFlow":
|
|
847
|
+
case "errorHighFlow":
|
|
848
|
+
case "errorLowFlow":
|
|
849
|
+
return (await this.getValveInfo(property))?.[propertyKey];
|
|
850
|
+
case "nominalCurrentHighThreshold":
|
|
851
|
+
case "nominalCurrentLowThreshold":
|
|
852
|
+
case "maximumFlow":
|
|
853
|
+
case "highFlowThreshold":
|
|
854
|
+
case "lowFlowThreshold":
|
|
855
|
+
case "useRainSensor":
|
|
856
|
+
case "useMoistureSensor":
|
|
857
|
+
return (await this.getValveConfig(property))?.[propertyKey];
|
|
858
|
+
case void 0:
|
|
859
|
+
(0, import_API.throwMissingPropertyKey)(this.ccId, property);
|
|
860
|
+
default:
|
|
861
|
+
(0, import_API.throwUnsupportedPropertyKey)(this.ccId, property, propertyKey);
|
|
862
|
+
}
|
|
863
|
+
}
|
|
864
|
+
(0, import_API.throwUnsupportedProperty)(this.ccId, property);
|
|
865
|
+
};
|
|
866
|
+
}
|
|
867
|
+
};
|
|
868
|
+
return IrrigationCCAPI2 = _classThis;
|
|
869
|
+
})();
|
|
870
|
+
let IrrigationCC = (() => {
|
|
871
|
+
let _classDecorators = [(0, import_CommandClassDecorators.commandClass)(import_safe.CommandClasses.Irrigation), (0, import_CommandClassDecorators.implementedVersion)(1), (0, import_CommandClassDecorators.ccValues)(IrrigationCCValues)];
|
|
872
|
+
let _classDescriptor;
|
|
873
|
+
let _classExtraInitializers = [];
|
|
874
|
+
let _classThis;
|
|
875
|
+
let _classSuper = import_CommandClass.CommandClass;
|
|
876
|
+
var IrrigationCC2 = class extends _classSuper {
|
|
877
|
+
static {
|
|
878
|
+
_classThis = this;
|
|
879
|
+
}
|
|
880
|
+
static {
|
|
881
|
+
const _metadata = typeof Symbol === "function" && Symbol.metadata ? Object.create(_classSuper[Symbol.metadata] ?? null) : void 0;
|
|
882
|
+
__esDecorate(null, _classDescriptor = { value: _classThis }, _classDecorators, { kind: "class", name: _classThis.name, metadata: _metadata }, null, _classExtraInitializers);
|
|
883
|
+
IrrigationCC2 = _classThis = _classDescriptor.value;
|
|
884
|
+
if (_metadata) Object.defineProperty(_classThis, Symbol.metadata, { enumerable: true, configurable: true, writable: true, value: _metadata });
|
|
885
|
+
__runInitializers(_classThis, _classExtraInitializers);
|
|
886
|
+
}
|
|
887
|
+
/**
|
|
888
|
+
* Returns the maximum number of valve table entries reported by the node.
|
|
889
|
+
* This only works AFTER the node has been interviewed.
|
|
890
|
+
*/
|
|
891
|
+
static getMaxValveTableSizeCached(ctx, endpoint) {
|
|
892
|
+
return ctx.getValueDB(endpoint.nodeId).getValue(IrrigationCCValues.maxValveTableSize.endpoint(endpoint.index));
|
|
893
|
+
}
|
|
894
|
+
/**
|
|
895
|
+
* Returns the number of zone valves reported by the node.
|
|
896
|
+
* This only works AFTER the node has been interviewed.
|
|
897
|
+
*/
|
|
898
|
+
static getNumValvesCached(ctx, endpoint) {
|
|
899
|
+
return ctx.getValueDB(endpoint.nodeId).getValue(IrrigationCCValues.numValves.endpoint(endpoint.index));
|
|
900
|
+
}
|
|
901
|
+
/**
|
|
902
|
+
* Returns whether the node supports a master valve
|
|
903
|
+
* This only works AFTER the node has been interviewed.
|
|
904
|
+
*/
|
|
905
|
+
static supportsMasterValveCached(ctx, endpoint) {
|
|
906
|
+
return !!ctx.getValueDB(endpoint.nodeId).getValue(IrrigationCCValues.supportsMasterValve.endpoint(endpoint.index));
|
|
907
|
+
}
|
|
908
|
+
async interview(ctx) {
|
|
909
|
+
const node = this.getNode(ctx);
|
|
910
|
+
const endpoint = this.getEndpoint(ctx);
|
|
911
|
+
const api = import_API.CCAPI.create(import_safe.CommandClasses.Irrigation, ctx, endpoint).withOptions({
|
|
912
|
+
priority: import_safe.MessagePriority.NodeQuery
|
|
913
|
+
});
|
|
863
914
|
ctx.logNode(node.id, {
|
|
864
915
|
endpoint: this.endpointIndex,
|
|
865
|
-
message:
|
|
866
|
-
|
|
916
|
+
message: `Interviewing ${this.ccName}...`,
|
|
917
|
+
direction: "none"
|
|
867
918
|
});
|
|
868
|
-
|
|
869
|
-
|
|
870
|
-
|
|
919
|
+
ctx.logNode(node.id, {
|
|
920
|
+
endpoint: this.endpointIndex,
|
|
921
|
+
message: "Querying irrigation system info...",
|
|
922
|
+
direction: "outbound"
|
|
923
|
+
});
|
|
924
|
+
const systemInfo = await api.getSystemInfo();
|
|
925
|
+
if (!systemInfo) {
|
|
926
|
+
ctx.logNode(node.id, {
|
|
927
|
+
endpoint: this.endpointIndex,
|
|
928
|
+
message: "Time out while querying irrigation system info, skipping interview...",
|
|
929
|
+
level: "warn"
|
|
930
|
+
});
|
|
931
|
+
return;
|
|
932
|
+
}
|
|
933
|
+
const logMessage = `received irrigation system info:
|
|
871
934
|
supports master valve: ${systemInfo.supportsMasterValve}
|
|
872
935
|
no. of valves: ${systemInfo.numValves}
|
|
873
936
|
no. of valve tables: ${systemInfo.numValveTables}
|
|
874
937
|
max. valve table size: ${systemInfo.maxValveTableSize}`;
|
|
875
|
-
ctx.logNode(node.id, {
|
|
876
|
-
endpoint: this.endpointIndex,
|
|
877
|
-
message: logMessage,
|
|
878
|
-
direction: "inbound"
|
|
879
|
-
});
|
|
880
|
-
for (let i = 1; i <= systemInfo.numValves; i++) {
|
|
881
|
-
this.ensureMetadata(ctx, IrrigationCCValues.valveRunDuration(i));
|
|
882
|
-
this.ensureMetadata(ctx, IrrigationCCValues.valveRunStartStop(i));
|
|
883
|
-
}
|
|
884
|
-
this.ensureMetadata(ctx, IrrigationCCValues.shutoffSystem);
|
|
885
|
-
await this.refreshValues(ctx);
|
|
886
|
-
this.setInterviewComplete(ctx, true);
|
|
887
|
-
}
|
|
888
|
-
async refreshValues(ctx) {
|
|
889
|
-
const node = this.getNode(ctx);
|
|
890
|
-
const endpoint = this.getEndpoint(ctx);
|
|
891
|
-
const api = import_API.CCAPI.create(import_safe.CommandClasses.Irrigation, ctx, endpoint).withOptions({
|
|
892
|
-
priority: import_safe.MessagePriority.NodeQuery
|
|
893
|
-
});
|
|
894
|
-
ctx.logNode(node.id, {
|
|
895
|
-
endpoint: this.endpointIndex,
|
|
896
|
-
message: "Querying irrigation system configuration...",
|
|
897
|
-
direction: "outbound"
|
|
898
|
-
});
|
|
899
|
-
const systemConfig = await api.getSystemConfig();
|
|
900
|
-
if (systemConfig) {
|
|
901
|
-
let logMessage = `received irrigation system configuration:
|
|
902
|
-
master valve delay: ${systemConfig.masterValveDelay} seconds
|
|
903
|
-
high pressure threshold: ${systemConfig.highPressureThreshold} kPa
|
|
904
|
-
low pressure threshold: ${systemConfig.lowPressureThreshold} kPa`;
|
|
905
|
-
if (systemConfig.rainSensorPolarity != void 0) {
|
|
906
|
-
logMessage += `
|
|
907
|
-
rain sensor polarity: ${(0, import_safe3.getEnumMemberName)(import_Types.IrrigationSensorPolarity, systemConfig.rainSensorPolarity)}`;
|
|
908
|
-
}
|
|
909
|
-
if (systemConfig.moistureSensorPolarity != void 0) {
|
|
910
|
-
logMessage += `
|
|
911
|
-
moisture sensor polarity: ${(0, import_safe3.getEnumMemberName)(import_Types.IrrigationSensorPolarity, systemConfig.moistureSensorPolarity)}`;
|
|
912
|
-
}
|
|
913
938
|
ctx.logNode(node.id, {
|
|
914
939
|
endpoint: this.endpointIndex,
|
|
915
940
|
message: logMessage,
|
|
916
941
|
direction: "inbound"
|
|
917
942
|
});
|
|
943
|
+
for (let i = 1; i <= systemInfo.numValves; i++) {
|
|
944
|
+
this.ensureMetadata(ctx, IrrigationCCValues.valveRunDuration(i));
|
|
945
|
+
this.ensureMetadata(ctx, IrrigationCCValues.valveRunStartStop(i));
|
|
946
|
+
}
|
|
947
|
+
this.ensureMetadata(ctx, IrrigationCCValues.shutoffSystem);
|
|
948
|
+
await this.refreshValues(ctx);
|
|
949
|
+
this.setInterviewComplete(ctx, true);
|
|
918
950
|
}
|
|
919
|
-
ctx
|
|
920
|
-
|
|
921
|
-
|
|
922
|
-
|
|
923
|
-
|
|
924
|
-
await api.getSystemStatus();
|
|
925
|
-
if (IrrigationCC_1.supportsMasterValveCached(ctx, endpoint)) {
|
|
926
|
-
ctx.logNode(node.id, {
|
|
927
|
-
endpoint: this.endpointIndex,
|
|
928
|
-
message: "Querying master valve configuration...",
|
|
929
|
-
direction: "outbound"
|
|
951
|
+
async refreshValues(ctx) {
|
|
952
|
+
const node = this.getNode(ctx);
|
|
953
|
+
const endpoint = this.getEndpoint(ctx);
|
|
954
|
+
const api = import_API.CCAPI.create(import_safe.CommandClasses.Irrigation, ctx, endpoint).withOptions({
|
|
955
|
+
priority: import_safe.MessagePriority.NodeQuery
|
|
930
956
|
});
|
|
931
|
-
await api.getValveConfig("master");
|
|
932
957
|
ctx.logNode(node.id, {
|
|
933
958
|
endpoint: this.endpointIndex,
|
|
934
|
-
message: "Querying
|
|
959
|
+
message: "Querying irrigation system configuration...",
|
|
935
960
|
direction: "outbound"
|
|
936
961
|
});
|
|
937
|
-
await api.
|
|
938
|
-
|
|
939
|
-
|
|
962
|
+
const systemConfig = await api.getSystemConfig();
|
|
963
|
+
if (systemConfig) {
|
|
964
|
+
let logMessage = `received irrigation system configuration:
|
|
965
|
+
master valve delay: ${systemConfig.masterValveDelay} seconds
|
|
966
|
+
high pressure threshold: ${systemConfig.highPressureThreshold} kPa
|
|
967
|
+
low pressure threshold: ${systemConfig.lowPressureThreshold} kPa`;
|
|
968
|
+
if (systemConfig.rainSensorPolarity != void 0) {
|
|
969
|
+
logMessage += `
|
|
970
|
+
rain sensor polarity: ${(0, import_safe3.getEnumMemberName)(import_Types.IrrigationSensorPolarity, systemConfig.rainSensorPolarity)}`;
|
|
971
|
+
}
|
|
972
|
+
if (systemConfig.moistureSensorPolarity != void 0) {
|
|
973
|
+
logMessage += `
|
|
974
|
+
moisture sensor polarity: ${(0, import_safe3.getEnumMemberName)(import_Types.IrrigationSensorPolarity, systemConfig.moistureSensorPolarity)}`;
|
|
975
|
+
}
|
|
976
|
+
ctx.logNode(node.id, {
|
|
977
|
+
endpoint: this.endpointIndex,
|
|
978
|
+
message: logMessage,
|
|
979
|
+
direction: "inbound"
|
|
980
|
+
});
|
|
981
|
+
}
|
|
940
982
|
ctx.logNode(node.id, {
|
|
941
983
|
endpoint: this.endpointIndex,
|
|
942
|
-
message:
|
|
984
|
+
message: "Querying irrigation system status...",
|
|
943
985
|
direction: "outbound"
|
|
944
986
|
});
|
|
945
|
-
await api.
|
|
946
|
-
|
|
947
|
-
|
|
948
|
-
|
|
949
|
-
|
|
987
|
+
await api.getSystemStatus();
|
|
988
|
+
if (IrrigationCC2.supportsMasterValveCached(ctx, endpoint)) {
|
|
989
|
+
ctx.logNode(node.id, {
|
|
990
|
+
endpoint: this.endpointIndex,
|
|
991
|
+
message: "Querying master valve configuration...",
|
|
992
|
+
direction: "outbound"
|
|
993
|
+
});
|
|
994
|
+
await api.getValveConfig("master");
|
|
995
|
+
ctx.logNode(node.id, {
|
|
996
|
+
endpoint: this.endpointIndex,
|
|
997
|
+
message: "Querying master valve status...",
|
|
998
|
+
direction: "outbound"
|
|
999
|
+
});
|
|
1000
|
+
await api.getValveInfo("master");
|
|
1001
|
+
}
|
|
1002
|
+
for (let i = 1; i <= (IrrigationCC2.getNumValvesCached(ctx, endpoint) ?? 0); i++) {
|
|
1003
|
+
ctx.logNode(node.id, {
|
|
1004
|
+
endpoint: this.endpointIndex,
|
|
1005
|
+
message: `Querying configuration for valve ${(0, import_strings.padStart)(i.toString(), 3, "0")}...`,
|
|
1006
|
+
direction: "outbound"
|
|
1007
|
+
});
|
|
1008
|
+
await api.getValveConfig(i);
|
|
1009
|
+
ctx.logNode(node.id, {
|
|
1010
|
+
endpoint: this.endpointIndex,
|
|
1011
|
+
message: `Querying status for valve ${(0, import_strings.padStart)(i.toString(), 3, "0")}...`,
|
|
1012
|
+
direction: "outbound"
|
|
1013
|
+
});
|
|
1014
|
+
await api.getValveInfo(i);
|
|
1015
|
+
}
|
|
1016
|
+
}
|
|
1017
|
+
translateProperty(ctx, property, propertyKey) {
|
|
1018
|
+
if (property === "master") {
|
|
1019
|
+
return "Master valve";
|
|
1020
|
+
} else if (typeof property === "number") {
|
|
1021
|
+
return `Valve ${(0, import_strings.padStart)(property.toString(), 3, "0")}`;
|
|
1022
|
+
}
|
|
1023
|
+
return super.translateProperty(ctx, property, propertyKey);
|
|
1024
|
+
}
|
|
1025
|
+
};
|
|
1026
|
+
return IrrigationCC2 = _classThis;
|
|
1027
|
+
})();
|
|
1028
|
+
let IrrigationCCSystemInfoReport = (() => {
|
|
1029
|
+
let _classDecorators = [(0, import_CommandClassDecorators.CCCommand)(import_Types.IrrigationCommand.SystemInfoReport), (0, import_CommandClassDecorators.ccValueProperty)("numValves", IrrigationCCValues.numValves), (0, import_CommandClassDecorators.ccValueProperty)("numValveTables", IrrigationCCValues.numValveTables), (0, import_CommandClassDecorators.ccValueProperty)("supportsMasterValve", IrrigationCCValues.supportsMasterValve), (0, import_CommandClassDecorators.ccValueProperty)("maxValveTableSize", IrrigationCCValues.maxValveTableSize)];
|
|
1030
|
+
let _classDescriptor;
|
|
1031
|
+
let _classExtraInitializers = [];
|
|
1032
|
+
let _classThis;
|
|
1033
|
+
let _classSuper = IrrigationCC;
|
|
1034
|
+
var IrrigationCCSystemInfoReport2 = class extends _classSuper {
|
|
1035
|
+
static {
|
|
1036
|
+
_classThis = this;
|
|
1037
|
+
}
|
|
1038
|
+
static {
|
|
1039
|
+
const _metadata = typeof Symbol === "function" && Symbol.metadata ? Object.create(_classSuper[Symbol.metadata] ?? null) : void 0;
|
|
1040
|
+
__esDecorate(null, _classDescriptor = { value: _classThis }, _classDecorators, { kind: "class", name: _classThis.name, metadata: _metadata }, null, _classExtraInitializers);
|
|
1041
|
+
IrrigationCCSystemInfoReport2 = _classThis = _classDescriptor.value;
|
|
1042
|
+
if (_metadata) Object.defineProperty(_classThis, Symbol.metadata, { enumerable: true, configurable: true, writable: true, value: _metadata });
|
|
1043
|
+
__runInitializers(_classThis, _classExtraInitializers);
|
|
1044
|
+
}
|
|
1045
|
+
constructor(options) {
|
|
1046
|
+
super(options);
|
|
1047
|
+
this.supportsMasterValve = options.supportsMasterValve;
|
|
1048
|
+
this.numValves = options.numValves;
|
|
1049
|
+
this.numValveTables = options.numValveTables;
|
|
1050
|
+
this.maxValveTableSize = options.maxValveTableSize;
|
|
1051
|
+
}
|
|
1052
|
+
static from(raw, ctx) {
|
|
1053
|
+
(0, import_safe.validatePayload)(raw.payload.length >= 4);
|
|
1054
|
+
const supportsMasterValve = !!(raw.payload[0] & 1);
|
|
1055
|
+
const numValves = raw.payload[1];
|
|
1056
|
+
const numValveTables = raw.payload[2];
|
|
1057
|
+
const maxValveTableSize = raw.payload[3] & 15;
|
|
1058
|
+
return new this({
|
|
1059
|
+
nodeId: ctx.sourceNodeId,
|
|
1060
|
+
supportsMasterValve,
|
|
1061
|
+
numValves,
|
|
1062
|
+
numValveTables,
|
|
1063
|
+
maxValveTableSize
|
|
950
1064
|
});
|
|
951
|
-
await api.getValveInfo(i);
|
|
952
1065
|
}
|
|
953
|
-
|
|
954
|
-
|
|
955
|
-
|
|
956
|
-
|
|
957
|
-
|
|
958
|
-
return
|
|
1066
|
+
numValves;
|
|
1067
|
+
numValveTables;
|
|
1068
|
+
supportsMasterValve;
|
|
1069
|
+
maxValveTableSize;
|
|
1070
|
+
toLogEntry(ctx) {
|
|
1071
|
+
return {
|
|
1072
|
+
...super.toLogEntry(ctx),
|
|
1073
|
+
message: {
|
|
1074
|
+
"supports master valve": this.supportsMasterValve,
|
|
1075
|
+
"no. of valves": this.numValves,
|
|
1076
|
+
"no. of valve tables": this.numValveTables,
|
|
1077
|
+
"max. valve table size": this.maxValveTableSize
|
|
1078
|
+
}
|
|
1079
|
+
};
|
|
959
1080
|
}
|
|
960
|
-
|
|
961
|
-
|
|
962
|
-
};
|
|
963
|
-
|
|
964
|
-
(0, import_CommandClassDecorators.
|
|
965
|
-
|
|
966
|
-
|
|
967
|
-
|
|
968
|
-
let
|
|
969
|
-
|
|
970
|
-
|
|
971
|
-
|
|
972
|
-
|
|
973
|
-
|
|
974
|
-
|
|
975
|
-
|
|
976
|
-
|
|
977
|
-
|
|
978
|
-
|
|
979
|
-
|
|
980
|
-
|
|
981
|
-
|
|
982
|
-
|
|
983
|
-
|
|
984
|
-
|
|
985
|
-
|
|
986
|
-
|
|
987
|
-
|
|
988
|
-
|
|
989
|
-
|
|
990
|
-
|
|
991
|
-
|
|
992
|
-
|
|
993
|
-
|
|
994
|
-
|
|
995
|
-
|
|
996
|
-
|
|
997
|
-
|
|
998
|
-
|
|
999
|
-
|
|
1000
|
-
|
|
1001
|
-
|
|
1081
|
+
};
|
|
1082
|
+
return IrrigationCCSystemInfoReport2 = _classThis;
|
|
1083
|
+
})();
|
|
1084
|
+
let IrrigationCCSystemInfoGet = (() => {
|
|
1085
|
+
let _classDecorators = [(0, import_CommandClassDecorators.CCCommand)(import_Types.IrrigationCommand.SystemInfoGet), (0, import_CommandClassDecorators.expectedCCResponse)(IrrigationCCSystemInfoReport)];
|
|
1086
|
+
let _classDescriptor;
|
|
1087
|
+
let _classExtraInitializers = [];
|
|
1088
|
+
let _classThis;
|
|
1089
|
+
let _classSuper = IrrigationCC;
|
|
1090
|
+
var IrrigationCCSystemInfoGet2 = class extends _classSuper {
|
|
1091
|
+
static {
|
|
1092
|
+
_classThis = this;
|
|
1093
|
+
}
|
|
1094
|
+
static {
|
|
1095
|
+
const _metadata = typeof Symbol === "function" && Symbol.metadata ? Object.create(_classSuper[Symbol.metadata] ?? null) : void 0;
|
|
1096
|
+
__esDecorate(null, _classDescriptor = { value: _classThis }, _classDecorators, { kind: "class", name: _classThis.name, metadata: _metadata }, null, _classExtraInitializers);
|
|
1097
|
+
IrrigationCCSystemInfoGet2 = _classThis = _classDescriptor.value;
|
|
1098
|
+
if (_metadata) Object.defineProperty(_classThis, Symbol.metadata, { enumerable: true, configurable: true, writable: true, value: _metadata });
|
|
1099
|
+
__runInitializers(_classThis, _classExtraInitializers);
|
|
1100
|
+
}
|
|
1101
|
+
};
|
|
1102
|
+
return IrrigationCCSystemInfoGet2 = _classThis;
|
|
1103
|
+
})();
|
|
1104
|
+
let IrrigationCCSystemStatusReport = (() => {
|
|
1105
|
+
let _classDecorators = [(0, import_CommandClassDecorators.CCCommand)(import_Types.IrrigationCommand.SystemStatusReport), (0, import_CommandClassDecorators.ccValueProperty)("systemVoltage", IrrigationCCValues.systemVoltage), (0, import_CommandClassDecorators.ccValueProperty)("flowSensorActive", IrrigationCCValues.flowSensorActive), (0, import_CommandClassDecorators.ccValueProperty)("pressureSensorActive", IrrigationCCValues.pressureSensorActive), (0, import_CommandClassDecorators.ccValueProperty)("rainSensorActive", IrrigationCCValues.rainSensorActive), (0, import_CommandClassDecorators.ccValueProperty)("moistureSensorActive", IrrigationCCValues.moistureSensorActive), (0, import_CommandClassDecorators.ccValueProperty)("flow", IrrigationCCValues.flow), (0, import_CommandClassDecorators.ccValueProperty)("pressure", IrrigationCCValues.pressure), (0, import_CommandClassDecorators.ccValueProperty)("shutoffDuration", IrrigationCCValues.shutoffDuration), (0, import_CommandClassDecorators.ccValueProperty)("errorNotProgrammed", IrrigationCCValues.errorNotProgrammed), (0, import_CommandClassDecorators.ccValueProperty)("errorEmergencyShutdown", IrrigationCCValues.errorEmergencyShutdown), (0, import_CommandClassDecorators.ccValueProperty)("errorHighPressure", IrrigationCCValues.errorHighPressure), (0, import_CommandClassDecorators.ccValueProperty)("errorLowPressure", IrrigationCCValues.errorLowPressure), (0, import_CommandClassDecorators.ccValueProperty)("errorValve", IrrigationCCValues.errorValve), (0, import_CommandClassDecorators.ccValueProperty)("masterValveOpen", IrrigationCCValues.masterValveOpen), (0, import_CommandClassDecorators.ccValueProperty)("firstOpenZoneId", IrrigationCCValues.firstOpenZoneId)];
|
|
1106
|
+
let _classDescriptor;
|
|
1107
|
+
let _classExtraInitializers = [];
|
|
1108
|
+
let _classThis;
|
|
1109
|
+
let _classSuper = IrrigationCC;
|
|
1110
|
+
var IrrigationCCSystemStatusReport2 = class extends _classSuper {
|
|
1111
|
+
static {
|
|
1112
|
+
_classThis = this;
|
|
1113
|
+
}
|
|
1114
|
+
static {
|
|
1115
|
+
const _metadata = typeof Symbol === "function" && Symbol.metadata ? Object.create(_classSuper[Symbol.metadata] ?? null) : void 0;
|
|
1116
|
+
__esDecorate(null, _classDescriptor = { value: _classThis }, _classDecorators, { kind: "class", name: _classThis.name, metadata: _metadata }, null, _classExtraInitializers);
|
|
1117
|
+
IrrigationCCSystemStatusReport2 = _classThis = _classDescriptor.value;
|
|
1118
|
+
if (_metadata) Object.defineProperty(_classThis, Symbol.metadata, { enumerable: true, configurable: true, writable: true, value: _metadata });
|
|
1119
|
+
__runInitializers(_classThis, _classExtraInitializers);
|
|
1120
|
+
}
|
|
1121
|
+
constructor(options) {
|
|
1122
|
+
super(options);
|
|
1123
|
+
this.systemVoltage = options.systemVoltage;
|
|
1124
|
+
this.flowSensorActive = options.flowSensorActive;
|
|
1125
|
+
this.pressureSensorActive = options.pressureSensorActive;
|
|
1126
|
+
this.rainSensorActive = options.rainSensorActive;
|
|
1127
|
+
this.moistureSensorActive = options.moistureSensorActive;
|
|
1128
|
+
this.flow = options.flow;
|
|
1129
|
+
this.pressure = options.pressure;
|
|
1130
|
+
this.shutoffDuration = options.shutoffDuration;
|
|
1131
|
+
this.errorNotProgrammed = options.errorNotProgrammed;
|
|
1132
|
+
this.errorEmergencyShutdown = options.errorEmergencyShutdown;
|
|
1133
|
+
this.errorHighPressure = options.errorHighPressure;
|
|
1134
|
+
this.errorLowPressure = options.errorLowPressure;
|
|
1135
|
+
this.errorValve = options.errorValve;
|
|
1136
|
+
this.masterValveOpen = options.masterValveOpen;
|
|
1137
|
+
this.firstOpenZoneId = options.firstOpenZoneId;
|
|
1138
|
+
}
|
|
1139
|
+
static from(raw, ctx) {
|
|
1140
|
+
(0, import_safe.validatePayload)(raw.payload.length >= 2);
|
|
1141
|
+
const systemVoltage = raw.payload[0];
|
|
1142
|
+
const flowSensorActive = !!(raw.payload[1] & 1);
|
|
1143
|
+
const pressureSensorActive = !!(raw.payload[1] & 2);
|
|
1144
|
+
const rainSensorActive = !!(raw.payload[1] & 4);
|
|
1145
|
+
const moistureSensorActive = !!(raw.payload[1] & 8);
|
|
1146
|
+
let offset = 2;
|
|
1147
|
+
let flow;
|
|
1148
|
+
{
|
|
1149
|
+
const { value, scale, bytesRead } = (0, import_safe.parseFloatWithScale)(raw.payload.subarray(offset));
|
|
1150
|
+
(0, import_safe.validatePayload)(scale === 0);
|
|
1151
|
+
if (flowSensorActive)
|
|
1152
|
+
flow = value;
|
|
1153
|
+
offset += bytesRead;
|
|
1002
1154
|
}
|
|
1003
|
-
|
|
1004
|
-
|
|
1005
|
-
};
|
|
1006
|
-
|
|
1007
|
-
|
|
1008
|
-
|
|
1009
|
-
|
|
1010
|
-
|
|
1011
|
-
|
|
1012
|
-
|
|
1013
|
-
|
|
1014
|
-
|
|
1015
|
-
|
|
1016
|
-
|
|
1017
|
-
|
|
1018
|
-
|
|
1019
|
-
|
|
1020
|
-
]
|
|
1021
|
-
|
|
1022
|
-
}
|
|
1023
|
-
|
|
1024
|
-
|
|
1025
|
-
|
|
1026
|
-
|
|
1027
|
-
|
|
1028
|
-
|
|
1029
|
-
|
|
1030
|
-
|
|
1031
|
-
|
|
1032
|
-
|
|
1033
|
-
|
|
1034
|
-
|
|
1035
|
-
|
|
1036
|
-
|
|
1037
|
-
|
|
1038
|
-
|
|
1039
|
-
|
|
1040
|
-
|
|
1041
|
-
|
|
1042
|
-
|
|
1043
|
-
|
|
1044
|
-
|
|
1045
|
-
|
|
1046
|
-
|
|
1047
|
-
|
|
1048
|
-
|
|
1049
|
-
|
|
1050
|
-
|
|
1051
|
-
|
|
1052
|
-
|
|
1053
|
-
|
|
1054
|
-
|
|
1055
|
-
|
|
1056
|
-
|
|
1057
|
-
|
|
1058
|
-
|
|
1059
|
-
|
|
1060
|
-
|
|
1061
|
-
|
|
1062
|
-
|
|
1063
|
-
|
|
1064
|
-
|
|
1065
|
-
|
|
1066
|
-
|
|
1067
|
-
|
|
1068
|
-
|
|
1069
|
-
|
|
1070
|
-
|
|
1071
|
-
|
|
1072
|
-
|
|
1073
|
-
|
|
1074
|
-
|
|
1075
|
-
|
|
1076
|
-
|
|
1077
|
-
|
|
1078
|
-
|
|
1079
|
-
|
|
1080
|
-
|
|
1081
|
-
|
|
1082
|
-
|
|
1083
|
-
|
|
1084
|
-
|
|
1085
|
-
flowSensorActive,
|
|
1086
|
-
pressureSensorActive,
|
|
1087
|
-
rainSensorActive,
|
|
1088
|
-
moistureSensorActive,
|
|
1089
|
-
flow,
|
|
1090
|
-
pressure,
|
|
1091
|
-
shutoffDuration,
|
|
1092
|
-
errorNotProgrammed,
|
|
1093
|
-
errorEmergencyShutdown,
|
|
1094
|
-
errorHighPressure,
|
|
1095
|
-
errorLowPressure,
|
|
1096
|
-
errorValve,
|
|
1097
|
-
masterValveOpen,
|
|
1098
|
-
firstOpenZoneId
|
|
1099
|
-
});
|
|
1100
|
-
}
|
|
1101
|
-
systemVoltage;
|
|
1102
|
-
flowSensorActive;
|
|
1103
|
-
pressureSensorActive;
|
|
1104
|
-
rainSensorActive;
|
|
1105
|
-
moistureSensorActive;
|
|
1106
|
-
flow;
|
|
1107
|
-
pressure;
|
|
1108
|
-
shutoffDuration;
|
|
1109
|
-
errorNotProgrammed;
|
|
1110
|
-
errorEmergencyShutdown;
|
|
1111
|
-
errorHighPressure;
|
|
1112
|
-
errorLowPressure;
|
|
1113
|
-
errorValve;
|
|
1114
|
-
masterValveOpen;
|
|
1115
|
-
firstOpenZoneId;
|
|
1116
|
-
toLogEntry(ctx) {
|
|
1117
|
-
const message = {
|
|
1118
|
-
"system voltage": `${this.systemVoltage} V`,
|
|
1119
|
-
"active sensors": [
|
|
1120
|
-
this.flowSensorActive ? "flow" : void 0,
|
|
1121
|
-
this.pressureSensorActive ? "pressure" : void 0,
|
|
1122
|
-
this.rainSensorActive ? "rain" : void 0,
|
|
1123
|
-
this.moistureSensorActive ? "moisture" : void 0
|
|
1124
|
-
].filter(Boolean).join(", ")
|
|
1125
|
-
};
|
|
1126
|
-
if (this.flow != void 0) {
|
|
1127
|
-
message.flow = `${this.flow} l/h`;
|
|
1128
|
-
}
|
|
1129
|
-
if (this.pressure != void 0) {
|
|
1130
|
-
message.pressure = `${this.pressure} kPa`;
|
|
1131
|
-
}
|
|
1132
|
-
message["remaining shutoff duration"] = `${this.shutoffDuration} hours`;
|
|
1133
|
-
message["master valve status"] = this.masterValveOpen ? "open" : "closed";
|
|
1134
|
-
message["first open zone valve"] = this.firstOpenZoneId || "none";
|
|
1135
|
-
const errors = [
|
|
1136
|
-
this.errorNotProgrammed ? "device not programmed" : void 0,
|
|
1137
|
-
this.errorEmergencyShutdown ? "emergency shutdown" : void 0,
|
|
1138
|
-
this.errorHighPressure ? "high pressure threshold triggered" : void 0,
|
|
1139
|
-
this.errorLowPressure ? "low pressure threshold triggered" : void 0,
|
|
1140
|
-
this.errorValve ? "a valve or the master valve has an error" : void 0
|
|
1141
|
-
].filter(Boolean);
|
|
1142
|
-
if (errors.length > 0) {
|
|
1143
|
-
message.errors = errors.map((e) => `
|
|
1155
|
+
let pressure;
|
|
1156
|
+
{
|
|
1157
|
+
const { value, scale, bytesRead } = (0, import_safe.parseFloatWithScale)(raw.payload.subarray(offset));
|
|
1158
|
+
(0, import_safe.validatePayload)(scale === 0);
|
|
1159
|
+
if (pressureSensorActive)
|
|
1160
|
+
pressure = value;
|
|
1161
|
+
offset += bytesRead;
|
|
1162
|
+
}
|
|
1163
|
+
(0, import_safe.validatePayload)(raw.payload.length >= offset + 4);
|
|
1164
|
+
const shutoffDuration = raw.payload[offset];
|
|
1165
|
+
const errorNotProgrammed = !!(raw.payload[offset + 1] & 1);
|
|
1166
|
+
const errorEmergencyShutdown = !!(raw.payload[offset + 1] & 2);
|
|
1167
|
+
const errorHighPressure = !!(raw.payload[offset + 1] & 4);
|
|
1168
|
+
const errorLowPressure = !!(raw.payload[offset + 1] & 8);
|
|
1169
|
+
const errorValve = !!(raw.payload[offset + 1] & 16);
|
|
1170
|
+
const masterValveOpen = !!(raw.payload[offset + 2] & 1);
|
|
1171
|
+
let firstOpenZoneId;
|
|
1172
|
+
if (raw.payload[offset + 3]) {
|
|
1173
|
+
firstOpenZoneId = raw.payload[offset + 3];
|
|
1174
|
+
}
|
|
1175
|
+
return new this({
|
|
1176
|
+
nodeId: ctx.sourceNodeId,
|
|
1177
|
+
systemVoltage,
|
|
1178
|
+
flowSensorActive,
|
|
1179
|
+
pressureSensorActive,
|
|
1180
|
+
rainSensorActive,
|
|
1181
|
+
moistureSensorActive,
|
|
1182
|
+
flow,
|
|
1183
|
+
pressure,
|
|
1184
|
+
shutoffDuration,
|
|
1185
|
+
errorNotProgrammed,
|
|
1186
|
+
errorEmergencyShutdown,
|
|
1187
|
+
errorHighPressure,
|
|
1188
|
+
errorLowPressure,
|
|
1189
|
+
errorValve,
|
|
1190
|
+
masterValveOpen,
|
|
1191
|
+
firstOpenZoneId
|
|
1192
|
+
});
|
|
1193
|
+
}
|
|
1194
|
+
systemVoltage;
|
|
1195
|
+
flowSensorActive;
|
|
1196
|
+
pressureSensorActive;
|
|
1197
|
+
rainSensorActive;
|
|
1198
|
+
moistureSensorActive;
|
|
1199
|
+
flow;
|
|
1200
|
+
pressure;
|
|
1201
|
+
shutoffDuration;
|
|
1202
|
+
errorNotProgrammed;
|
|
1203
|
+
errorEmergencyShutdown;
|
|
1204
|
+
errorHighPressure;
|
|
1205
|
+
errorLowPressure;
|
|
1206
|
+
errorValve;
|
|
1207
|
+
masterValveOpen;
|
|
1208
|
+
firstOpenZoneId;
|
|
1209
|
+
toLogEntry(ctx) {
|
|
1210
|
+
const message = {
|
|
1211
|
+
"system voltage": `${this.systemVoltage} V`,
|
|
1212
|
+
"active sensors": [
|
|
1213
|
+
this.flowSensorActive ? "flow" : void 0,
|
|
1214
|
+
this.pressureSensorActive ? "pressure" : void 0,
|
|
1215
|
+
this.rainSensorActive ? "rain" : void 0,
|
|
1216
|
+
this.moistureSensorActive ? "moisture" : void 0
|
|
1217
|
+
].filter(Boolean).join(", ")
|
|
1218
|
+
};
|
|
1219
|
+
if (this.flow != void 0) {
|
|
1220
|
+
message.flow = `${this.flow} l/h`;
|
|
1221
|
+
}
|
|
1222
|
+
if (this.pressure != void 0) {
|
|
1223
|
+
message.pressure = `${this.pressure} kPa`;
|
|
1224
|
+
}
|
|
1225
|
+
message["remaining shutoff duration"] = `${this.shutoffDuration} hours`;
|
|
1226
|
+
message["master valve status"] = this.masterValveOpen ? "open" : "closed";
|
|
1227
|
+
message["first open zone valve"] = this.firstOpenZoneId || "none";
|
|
1228
|
+
const errors = [
|
|
1229
|
+
this.errorNotProgrammed ? "device not programmed" : void 0,
|
|
1230
|
+
this.errorEmergencyShutdown ? "emergency shutdown" : void 0,
|
|
1231
|
+
this.errorHighPressure ? "high pressure threshold triggered" : void 0,
|
|
1232
|
+
this.errorLowPressure ? "low pressure threshold triggered" : void 0,
|
|
1233
|
+
this.errorValve ? "a valve or the master valve has an error" : void 0
|
|
1234
|
+
].filter(Boolean);
|
|
1235
|
+
if (errors.length > 0) {
|
|
1236
|
+
message.errors = errors.map((e) => `
|
|
1144
1237
|
\xB7 ${e}`).join("");
|
|
1238
|
+
}
|
|
1239
|
+
return {
|
|
1240
|
+
...super.toLogEntry(ctx),
|
|
1241
|
+
message
|
|
1242
|
+
};
|
|
1145
1243
|
}
|
|
1146
|
-
|
|
1147
|
-
|
|
1148
|
-
|
|
1149
|
-
|
|
1150
|
-
|
|
1151
|
-
|
|
1152
|
-
|
|
1153
|
-
|
|
1154
|
-
|
|
1155
|
-
|
|
1156
|
-
|
|
1157
|
-
|
|
1158
|
-
__decorate([
|
|
1159
|
-
(0, import_CommandClassDecorators.ccValue)(IrrigationCCValues.pressureSensorActive)
|
|
1160
|
-
], IrrigationCCSystemStatusReport.prototype, "pressureSensorActive", void 0);
|
|
1161
|
-
__decorate([
|
|
1162
|
-
(0, import_CommandClassDecorators.ccValue)(IrrigationCCValues.rainSensorActive)
|
|
1163
|
-
], IrrigationCCSystemStatusReport.prototype, "rainSensorActive", void 0);
|
|
1164
|
-
__decorate([
|
|
1165
|
-
(0, import_CommandClassDecorators.ccValue)(IrrigationCCValues.moistureSensorActive)
|
|
1166
|
-
], IrrigationCCSystemStatusReport.prototype, "moistureSensorActive", void 0);
|
|
1167
|
-
__decorate([
|
|
1168
|
-
(0, import_CommandClassDecorators.ccValue)(IrrigationCCValues.flow)
|
|
1169
|
-
], IrrigationCCSystemStatusReport.prototype, "flow", void 0);
|
|
1170
|
-
__decorate([
|
|
1171
|
-
(0, import_CommandClassDecorators.ccValue)(IrrigationCCValues.pressure)
|
|
1172
|
-
], IrrigationCCSystemStatusReport.prototype, "pressure", void 0);
|
|
1173
|
-
__decorate([
|
|
1174
|
-
(0, import_CommandClassDecorators.ccValue)(IrrigationCCValues.shutoffDuration)
|
|
1175
|
-
], IrrigationCCSystemStatusReport.prototype, "shutoffDuration", void 0);
|
|
1176
|
-
__decorate([
|
|
1177
|
-
(0, import_CommandClassDecorators.ccValue)(IrrigationCCValues.errorNotProgrammed)
|
|
1178
|
-
], IrrigationCCSystemStatusReport.prototype, "errorNotProgrammed", void 0);
|
|
1179
|
-
__decorate([
|
|
1180
|
-
(0, import_CommandClassDecorators.ccValue)(IrrigationCCValues.errorEmergencyShutdown)
|
|
1181
|
-
], IrrigationCCSystemStatusReport.prototype, "errorEmergencyShutdown", void 0);
|
|
1182
|
-
__decorate([
|
|
1183
|
-
(0, import_CommandClassDecorators.ccValue)(IrrigationCCValues.errorHighPressure)
|
|
1184
|
-
], IrrigationCCSystemStatusReport.prototype, "errorHighPressure", void 0);
|
|
1185
|
-
__decorate([
|
|
1186
|
-
(0, import_CommandClassDecorators.ccValue)(IrrigationCCValues.errorLowPressure)
|
|
1187
|
-
], IrrigationCCSystemStatusReport.prototype, "errorLowPressure", void 0);
|
|
1188
|
-
__decorate([
|
|
1189
|
-
(0, import_CommandClassDecorators.ccValue)(IrrigationCCValues.errorValve)
|
|
1190
|
-
], IrrigationCCSystemStatusReport.prototype, "errorValve", void 0);
|
|
1191
|
-
__decorate([
|
|
1192
|
-
(0, import_CommandClassDecorators.ccValue)(IrrigationCCValues.masterValveOpen)
|
|
1193
|
-
], IrrigationCCSystemStatusReport.prototype, "masterValveOpen", void 0);
|
|
1194
|
-
__decorate([
|
|
1195
|
-
(0, import_CommandClassDecorators.ccValue)(IrrigationCCValues.firstOpenZoneId)
|
|
1196
|
-
], IrrigationCCSystemStatusReport.prototype, "firstOpenZoneId", void 0);
|
|
1197
|
-
IrrigationCCSystemStatusReport = IrrigationCCSystemStatusReport_1 = __decorate([
|
|
1198
|
-
(0, import_CommandClassDecorators.CCCommand)(import_Types.IrrigationCommand.SystemStatusReport)
|
|
1199
|
-
], IrrigationCCSystemStatusReport);
|
|
1200
|
-
let IrrigationCCSystemStatusGet = class IrrigationCCSystemStatusGet2 extends IrrigationCC {
|
|
1201
|
-
};
|
|
1202
|
-
IrrigationCCSystemStatusGet = __decorate([
|
|
1203
|
-
(0, import_CommandClassDecorators.CCCommand)(import_Types.IrrigationCommand.SystemStatusGet),
|
|
1204
|
-
(0, import_CommandClassDecorators.expectedCCResponse)(IrrigationCCSystemStatusReport)
|
|
1205
|
-
], IrrigationCCSystemStatusGet);
|
|
1206
|
-
let IrrigationCCSystemConfigSet = class IrrigationCCSystemConfigSet2 extends IrrigationCC {
|
|
1207
|
-
constructor(options) {
|
|
1208
|
-
super(options);
|
|
1209
|
-
this.masterValveDelay = options.masterValveDelay;
|
|
1210
|
-
this.highPressureThreshold = options.highPressureThreshold;
|
|
1211
|
-
this.lowPressureThreshold = options.lowPressureThreshold;
|
|
1212
|
-
this.rainSensorPolarity = options.rainSensorPolarity;
|
|
1213
|
-
this.moistureSensorPolarity = options.moistureSensorPolarity;
|
|
1214
|
-
}
|
|
1215
|
-
static from(_raw, _ctx) {
|
|
1216
|
-
throw new import_safe.ZWaveError(`${this.name}: deserialization not implemented`, import_safe.ZWaveErrorCodes.Deserialization_NotImplemented);
|
|
1217
|
-
}
|
|
1218
|
-
masterValveDelay;
|
|
1219
|
-
highPressureThreshold;
|
|
1220
|
-
lowPressureThreshold;
|
|
1221
|
-
rainSensorPolarity;
|
|
1222
|
-
moistureSensorPolarity;
|
|
1223
|
-
serialize(ctx) {
|
|
1224
|
-
let polarity = 0;
|
|
1225
|
-
if (this.rainSensorPolarity != void 0)
|
|
1226
|
-
polarity |= 1;
|
|
1227
|
-
if (this.moistureSensorPolarity != void 0)
|
|
1228
|
-
polarity |= 2;
|
|
1229
|
-
if (this.rainSensorPolarity == void 0 && this.moistureSensorPolarity == void 0) {
|
|
1230
|
-
polarity |= 128;
|
|
1231
|
-
}
|
|
1232
|
-
this.payload = import_safe2.Bytes.concat([
|
|
1233
|
-
import_safe2.Bytes.from([this.masterValveDelay]),
|
|
1234
|
-
(0, import_safe.encodeFloatWithScale)(
|
|
1235
|
-
this.highPressureThreshold,
|
|
1236
|
-
0
|
|
1237
|
-
/* kPa */
|
|
1238
|
-
),
|
|
1239
|
-
(0, import_safe.encodeFloatWithScale)(
|
|
1240
|
-
this.lowPressureThreshold,
|
|
1241
|
-
0
|
|
1242
|
-
/* kPa */
|
|
1243
|
-
),
|
|
1244
|
-
import_safe2.Bytes.from([polarity])
|
|
1245
|
-
]);
|
|
1246
|
-
return super.serialize(ctx);
|
|
1247
|
-
}
|
|
1248
|
-
toLogEntry(ctx) {
|
|
1249
|
-
const message = {
|
|
1250
|
-
"master valve delay": `${this.masterValveDelay} s`,
|
|
1251
|
-
"high pressure threshold": `${this.highPressureThreshold} kPa`,
|
|
1252
|
-
"low pressure threshold": `${this.lowPressureThreshold} kPa`
|
|
1253
|
-
};
|
|
1254
|
-
if (this.rainSensorPolarity != void 0) {
|
|
1255
|
-
message["rain sensor polarity"] = (0, import_safe3.getEnumMemberName)(import_Types.IrrigationSensorPolarity, this.rainSensorPolarity);
|
|
1244
|
+
};
|
|
1245
|
+
return IrrigationCCSystemStatusReport2 = _classThis;
|
|
1246
|
+
})();
|
|
1247
|
+
let IrrigationCCSystemStatusGet = (() => {
|
|
1248
|
+
let _classDecorators = [(0, import_CommandClassDecorators.CCCommand)(import_Types.IrrigationCommand.SystemStatusGet), (0, import_CommandClassDecorators.expectedCCResponse)(IrrigationCCSystemStatusReport)];
|
|
1249
|
+
let _classDescriptor;
|
|
1250
|
+
let _classExtraInitializers = [];
|
|
1251
|
+
let _classThis;
|
|
1252
|
+
let _classSuper = IrrigationCC;
|
|
1253
|
+
var IrrigationCCSystemStatusGet2 = class extends _classSuper {
|
|
1254
|
+
static {
|
|
1255
|
+
_classThis = this;
|
|
1256
1256
|
}
|
|
1257
|
-
|
|
1258
|
-
|
|
1257
|
+
static {
|
|
1258
|
+
const _metadata = typeof Symbol === "function" && Symbol.metadata ? Object.create(_classSuper[Symbol.metadata] ?? null) : void 0;
|
|
1259
|
+
__esDecorate(null, _classDescriptor = { value: _classThis }, _classDecorators, { kind: "class", name: _classThis.name, metadata: _metadata }, null, _classExtraInitializers);
|
|
1260
|
+
IrrigationCCSystemStatusGet2 = _classThis = _classDescriptor.value;
|
|
1261
|
+
if (_metadata) Object.defineProperty(_classThis, Symbol.metadata, { enumerable: true, configurable: true, writable: true, value: _metadata });
|
|
1262
|
+
__runInitializers(_classThis, _classExtraInitializers);
|
|
1259
1263
|
}
|
|
1260
|
-
|
|
1261
|
-
|
|
1262
|
-
|
|
1263
|
-
|
|
1264
|
-
|
|
1265
|
-
|
|
1266
|
-
|
|
1267
|
-
|
|
1268
|
-
|
|
1269
|
-
|
|
1270
|
-
|
|
1271
|
-
|
|
1272
|
-
super(options);
|
|
1273
|
-
this.masterValveDelay = options.masterValveDelay;
|
|
1274
|
-
this.highPressureThreshold = options.highPressureThreshold;
|
|
1275
|
-
this.lowPressureThreshold = options.lowPressureThreshold;
|
|
1276
|
-
this.rainSensorPolarity = options.rainSensorPolarity;
|
|
1277
|
-
this.moistureSensorPolarity = options.moistureSensorPolarity;
|
|
1278
|
-
}
|
|
1279
|
-
static from(raw, ctx) {
|
|
1280
|
-
(0, import_safe.validatePayload)(raw.payload.length >= 2);
|
|
1281
|
-
const masterValveDelay = raw.payload[0];
|
|
1282
|
-
let offset = 1;
|
|
1283
|
-
let highPressureThreshold;
|
|
1284
|
-
{
|
|
1285
|
-
const { value, scale, bytesRead } = (0, import_safe.parseFloatWithScale)(raw.payload.subarray(offset));
|
|
1286
|
-
(0, import_safe.validatePayload)(
|
|
1287
|
-
scale === 0
|
|
1288
|
-
/* kPa */
|
|
1289
|
-
);
|
|
1290
|
-
highPressureThreshold = value;
|
|
1291
|
-
offset += bytesRead;
|
|
1292
|
-
}
|
|
1293
|
-
let lowPressureThreshold;
|
|
1294
|
-
{
|
|
1295
|
-
const { value, scale, bytesRead } = (0, import_safe.parseFloatWithScale)(raw.payload.subarray(offset));
|
|
1296
|
-
(0, import_safe.validatePayload)(
|
|
1297
|
-
scale === 0
|
|
1298
|
-
/* kPa */
|
|
1299
|
-
);
|
|
1300
|
-
lowPressureThreshold = value;
|
|
1301
|
-
offset += bytesRead;
|
|
1302
|
-
}
|
|
1303
|
-
(0, import_safe.validatePayload)(raw.payload.length >= offset + 1);
|
|
1304
|
-
const polarity = raw.payload[offset];
|
|
1305
|
-
let rainSensorPolarity;
|
|
1306
|
-
let moistureSensorPolarity;
|
|
1307
|
-
if (!!(polarity & 128)) {
|
|
1308
|
-
rainSensorPolarity = polarity & 1;
|
|
1309
|
-
moistureSensorPolarity = (polarity & 2) >>> 1;
|
|
1310
|
-
}
|
|
1311
|
-
return new IrrigationCCSystemConfigReport_1({
|
|
1312
|
-
nodeId: ctx.sourceNodeId,
|
|
1313
|
-
masterValveDelay,
|
|
1314
|
-
highPressureThreshold,
|
|
1315
|
-
lowPressureThreshold,
|
|
1316
|
-
rainSensorPolarity,
|
|
1317
|
-
moistureSensorPolarity
|
|
1318
|
-
});
|
|
1319
|
-
}
|
|
1320
|
-
masterValveDelay;
|
|
1321
|
-
highPressureThreshold;
|
|
1322
|
-
lowPressureThreshold;
|
|
1323
|
-
rainSensorPolarity;
|
|
1324
|
-
moistureSensorPolarity;
|
|
1325
|
-
toLogEntry(ctx) {
|
|
1326
|
-
const message = {
|
|
1327
|
-
"master valve delay": `${this.masterValveDelay} s`,
|
|
1328
|
-
"high pressure threshold": `${this.highPressureThreshold} kPa`,
|
|
1329
|
-
"low pressure threshold": `${this.lowPressureThreshold} kPa`
|
|
1330
|
-
};
|
|
1331
|
-
if (this.rainSensorPolarity != void 0) {
|
|
1332
|
-
message["rain sensor polarity"] = (0, import_safe3.getEnumMemberName)(import_Types.IrrigationSensorPolarity, this.rainSensorPolarity);
|
|
1264
|
+
};
|
|
1265
|
+
return IrrigationCCSystemStatusGet2 = _classThis;
|
|
1266
|
+
})();
|
|
1267
|
+
let IrrigationCCSystemConfigSet = (() => {
|
|
1268
|
+
let _classDecorators = [(0, import_CommandClassDecorators.CCCommand)(import_Types.IrrigationCommand.SystemConfigSet), (0, import_CommandClassDecorators.useSupervision)()];
|
|
1269
|
+
let _classDescriptor;
|
|
1270
|
+
let _classExtraInitializers = [];
|
|
1271
|
+
let _classThis;
|
|
1272
|
+
let _classSuper = IrrigationCC;
|
|
1273
|
+
var IrrigationCCSystemConfigSet2 = class extends _classSuper {
|
|
1274
|
+
static {
|
|
1275
|
+
_classThis = this;
|
|
1333
1276
|
}
|
|
1334
|
-
|
|
1335
|
-
|
|
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
|
+
IrrigationCCSystemConfigSet2 = _classThis = _classDescriptor.value;
|
|
1281
|
+
if (_metadata) Object.defineProperty(_classThis, Symbol.metadata, { enumerable: true, configurable: true, writable: true, value: _metadata });
|
|
1282
|
+
__runInitializers(_classThis, _classExtraInitializers);
|
|
1336
1283
|
}
|
|
1337
|
-
|
|
1338
|
-
|
|
1339
|
-
|
|
1340
|
-
|
|
1341
|
-
|
|
1342
|
-
|
|
1343
|
-
|
|
1344
|
-
|
|
1345
|
-
|
|
1346
|
-
|
|
1347
|
-
|
|
1348
|
-
|
|
1349
|
-
|
|
1350
|
-
|
|
1351
|
-
|
|
1352
|
-
|
|
1353
|
-
|
|
1354
|
-
|
|
1355
|
-
|
|
1356
|
-
|
|
1357
|
-
|
|
1358
|
-
|
|
1359
|
-
|
|
1360
|
-
|
|
1361
|
-
|
|
1362
|
-
|
|
1363
|
-
|
|
1364
|
-
|
|
1365
|
-
|
|
1366
|
-
|
|
1367
|
-
|
|
1368
|
-
|
|
1369
|
-
|
|
1370
|
-
|
|
1371
|
-
|
|
1372
|
-
|
|
1373
|
-
|
|
1374
|
-
|
|
1375
|
-
|
|
1376
|
-
|
|
1377
|
-
|
|
1378
|
-
|
|
1379
|
-
|
|
1380
|
-
|
|
1381
|
-
|
|
1382
|
-
|
|
1383
|
-
|
|
1384
|
-
|
|
1385
|
-
|
|
1386
|
-
|
|
1387
|
-
|
|
1388
|
-
|
|
1389
|
-
|
|
1390
|
-
|
|
1391
|
-
|
|
1392
|
-
|
|
1393
|
-
|
|
1394
|
-
|
|
1395
|
-
|
|
1396
|
-
|
|
1397
|
-
|
|
1398
|
-
|
|
1399
|
-
|
|
1400
|
-
|
|
1401
|
-
|
|
1402
|
-
|
|
1403
|
-
|
|
1404
|
-
|
|
1405
|
-
|
|
1406
|
-
|
|
1407
|
-
|
|
1408
|
-
|
|
1409
|
-
|
|
1410
|
-
|
|
1411
|
-
|
|
1412
|
-
|
|
1413
|
-
|
|
1414
|
-
|
|
1415
|
-
|
|
1416
|
-
|
|
1417
|
-
|
|
1418
|
-
|
|
1419
|
-
|
|
1420
|
-
|
|
1421
|
-
|
|
1422
|
-
|
|
1423
|
-
|
|
1424
|
-
|
|
1425
|
-
|
|
1426
|
-
|
|
1427
|
-
|
|
1428
|
-
|
|
1429
|
-
|
|
1430
|
-
|
|
1431
|
-
|
|
1432
|
-
|
|
1433
|
-
|
|
1434
|
-
|
|
1435
|
-
|
|
1436
|
-
|
|
1437
|
-
|
|
1438
|
-
|
|
1439
|
-
|
|
1440
|
-
|
|
1441
|
-
|
|
1442
|
-
|
|
1443
|
-
|
|
1444
|
-
|
|
1445
|
-
|
|
1446
|
-
|
|
1447
|
-
|
|
1448
|
-
|
|
1449
|
-
|
|
1450
|
-
|
|
1451
|
-
|
|
1452
|
-
|
|
1453
|
-
|
|
1454
|
-
|
|
1455
|
-
|
|
1456
|
-
|
|
1457
|
-
|
|
1458
|
-
|
|
1459
|
-
|
|
1460
|
-
|
|
1461
|
-
|
|
1462
|
-
|
|
1463
|
-
}
|
|
1464
|
-
|
|
1465
|
-
|
|
1466
|
-
|
|
1467
|
-
|
|
1468
|
-
|
|
1469
|
-
|
|
1470
|
-
|
|
1471
|
-
|
|
1472
|
-
|
|
1473
|
-
|
|
1284
|
+
constructor(options) {
|
|
1285
|
+
super(options);
|
|
1286
|
+
this.masterValveDelay = options.masterValveDelay;
|
|
1287
|
+
this.highPressureThreshold = options.highPressureThreshold;
|
|
1288
|
+
this.lowPressureThreshold = options.lowPressureThreshold;
|
|
1289
|
+
this.rainSensorPolarity = options.rainSensorPolarity;
|
|
1290
|
+
this.moistureSensorPolarity = options.moistureSensorPolarity;
|
|
1291
|
+
}
|
|
1292
|
+
static from(_raw, _ctx) {
|
|
1293
|
+
throw new import_safe.ZWaveError(`${this.name}: deserialization not implemented`, import_safe.ZWaveErrorCodes.Deserialization_NotImplemented);
|
|
1294
|
+
}
|
|
1295
|
+
masterValveDelay;
|
|
1296
|
+
highPressureThreshold;
|
|
1297
|
+
lowPressureThreshold;
|
|
1298
|
+
rainSensorPolarity;
|
|
1299
|
+
moistureSensorPolarity;
|
|
1300
|
+
serialize(ctx) {
|
|
1301
|
+
let polarity = 0;
|
|
1302
|
+
if (this.rainSensorPolarity != void 0)
|
|
1303
|
+
polarity |= 1;
|
|
1304
|
+
if (this.moistureSensorPolarity != void 0)
|
|
1305
|
+
polarity |= 2;
|
|
1306
|
+
if (this.rainSensorPolarity == void 0 && this.moistureSensorPolarity == void 0) {
|
|
1307
|
+
polarity |= 128;
|
|
1308
|
+
}
|
|
1309
|
+
this.payload = import_safe2.Bytes.concat([
|
|
1310
|
+
import_safe2.Bytes.from([this.masterValveDelay]),
|
|
1311
|
+
(0, import_safe.encodeFloatWithScale)(
|
|
1312
|
+
this.highPressureThreshold,
|
|
1313
|
+
0
|
|
1314
|
+
/* kPa */
|
|
1315
|
+
),
|
|
1316
|
+
(0, import_safe.encodeFloatWithScale)(
|
|
1317
|
+
this.lowPressureThreshold,
|
|
1318
|
+
0
|
|
1319
|
+
/* kPa */
|
|
1320
|
+
),
|
|
1321
|
+
import_safe2.Bytes.from([polarity])
|
|
1322
|
+
]);
|
|
1323
|
+
return super.serialize(ctx);
|
|
1324
|
+
}
|
|
1325
|
+
toLogEntry(ctx) {
|
|
1326
|
+
const message = {
|
|
1327
|
+
"master valve delay": `${this.masterValveDelay} s`,
|
|
1328
|
+
"high pressure threshold": `${this.highPressureThreshold} kPa`,
|
|
1329
|
+
"low pressure threshold": `${this.lowPressureThreshold} kPa`
|
|
1330
|
+
};
|
|
1331
|
+
if (this.rainSensorPolarity != void 0) {
|
|
1332
|
+
message["rain sensor polarity"] = (0, import_safe3.getEnumMemberName)(import_Types.IrrigationSensorPolarity, this.rainSensorPolarity);
|
|
1333
|
+
}
|
|
1334
|
+
if (this.moistureSensorPolarity != void 0) {
|
|
1335
|
+
message["moisture sensor polarity"] = (0, import_safe3.getEnumMemberName)(import_Types.IrrigationSensorPolarity, this.moistureSensorPolarity);
|
|
1336
|
+
}
|
|
1337
|
+
return {
|
|
1338
|
+
...super.toLogEntry(ctx),
|
|
1339
|
+
message
|
|
1340
|
+
};
|
|
1341
|
+
}
|
|
1342
|
+
};
|
|
1343
|
+
return IrrigationCCSystemConfigSet2 = _classThis;
|
|
1344
|
+
})();
|
|
1345
|
+
let IrrigationCCSystemConfigReport = (() => {
|
|
1346
|
+
let _classDecorators = [(0, import_CommandClassDecorators.CCCommand)(import_Types.IrrigationCommand.SystemConfigReport), (0, import_CommandClassDecorators.ccValueProperty)("masterValveDelay", IrrigationCCValues.masterValveDelay), (0, import_CommandClassDecorators.ccValueProperty)("highPressureThreshold", IrrigationCCValues.highPressureThreshold), (0, import_CommandClassDecorators.ccValueProperty)("lowPressureThreshold", IrrigationCCValues.lowPressureThreshold), (0, import_CommandClassDecorators.ccValueProperty)("rainSensorPolarity", IrrigationCCValues.rainSensorPolarity), (0, import_CommandClassDecorators.ccValueProperty)("moistureSensorPolarity", IrrigationCCValues.moistureSensorPolarity)];
|
|
1347
|
+
let _classDescriptor;
|
|
1348
|
+
let _classExtraInitializers = [];
|
|
1349
|
+
let _classThis;
|
|
1350
|
+
let _classSuper = IrrigationCC;
|
|
1351
|
+
var IrrigationCCSystemConfigReport2 = class extends _classSuper {
|
|
1352
|
+
static {
|
|
1353
|
+
_classThis = this;
|
|
1354
|
+
}
|
|
1355
|
+
static {
|
|
1356
|
+
const _metadata = typeof Symbol === "function" && Symbol.metadata ? Object.create(_classSuper[Symbol.metadata] ?? null) : void 0;
|
|
1357
|
+
__esDecorate(null, _classDescriptor = { value: _classThis }, _classDecorators, { kind: "class", name: _classThis.name, metadata: _metadata }, null, _classExtraInitializers);
|
|
1358
|
+
IrrigationCCSystemConfigReport2 = _classThis = _classDescriptor.value;
|
|
1359
|
+
if (_metadata) Object.defineProperty(_classThis, Symbol.metadata, { enumerable: true, configurable: true, writable: true, value: _metadata });
|
|
1360
|
+
__runInitializers(_classThis, _classExtraInitializers);
|
|
1361
|
+
}
|
|
1362
|
+
constructor(options) {
|
|
1363
|
+
super(options);
|
|
1364
|
+
this.masterValveDelay = options.masterValveDelay;
|
|
1365
|
+
this.highPressureThreshold = options.highPressureThreshold;
|
|
1366
|
+
this.lowPressureThreshold = options.lowPressureThreshold;
|
|
1367
|
+
this.rainSensorPolarity = options.rainSensorPolarity;
|
|
1368
|
+
this.moistureSensorPolarity = options.moistureSensorPolarity;
|
|
1369
|
+
}
|
|
1370
|
+
static from(raw, ctx) {
|
|
1371
|
+
(0, import_safe.validatePayload)(raw.payload.length >= 2);
|
|
1372
|
+
const masterValveDelay = raw.payload[0];
|
|
1373
|
+
let offset = 1;
|
|
1374
|
+
let highPressureThreshold;
|
|
1375
|
+
{
|
|
1376
|
+
const { value, scale, bytesRead } = (0, import_safe.parseFloatWithScale)(raw.payload.subarray(offset));
|
|
1377
|
+
(0, import_safe.validatePayload)(
|
|
1378
|
+
scale === 0
|
|
1379
|
+
/* kPa */
|
|
1380
|
+
);
|
|
1381
|
+
highPressureThreshold = value;
|
|
1382
|
+
offset += bytesRead;
|
|
1383
|
+
}
|
|
1384
|
+
let lowPressureThreshold;
|
|
1385
|
+
{
|
|
1386
|
+
const { value, scale, bytesRead } = (0, import_safe.parseFloatWithScale)(raw.payload.subarray(offset));
|
|
1387
|
+
(0, import_safe.validatePayload)(
|
|
1388
|
+
scale === 0
|
|
1389
|
+
/* kPa */
|
|
1390
|
+
);
|
|
1391
|
+
lowPressureThreshold = value;
|
|
1392
|
+
offset += bytesRead;
|
|
1393
|
+
}
|
|
1394
|
+
(0, import_safe.validatePayload)(raw.payload.length >= offset + 1);
|
|
1395
|
+
const polarity = raw.payload[offset];
|
|
1396
|
+
let rainSensorPolarity;
|
|
1397
|
+
let moistureSensorPolarity;
|
|
1398
|
+
if (!!(polarity & 128)) {
|
|
1399
|
+
rainSensorPolarity = polarity & 1;
|
|
1400
|
+
moistureSensorPolarity = (polarity & 2) >>> 1;
|
|
1401
|
+
}
|
|
1402
|
+
return new this({
|
|
1403
|
+
nodeId: ctx.sourceNodeId,
|
|
1404
|
+
masterValveDelay,
|
|
1405
|
+
highPressureThreshold,
|
|
1406
|
+
lowPressureThreshold,
|
|
1407
|
+
rainSensorPolarity,
|
|
1408
|
+
moistureSensorPolarity
|
|
1409
|
+
});
|
|
1410
|
+
}
|
|
1411
|
+
masterValveDelay;
|
|
1412
|
+
highPressureThreshold;
|
|
1413
|
+
lowPressureThreshold;
|
|
1414
|
+
rainSensorPolarity;
|
|
1415
|
+
moistureSensorPolarity;
|
|
1416
|
+
toLogEntry(ctx) {
|
|
1417
|
+
const message = {
|
|
1418
|
+
"master valve delay": `${this.masterValveDelay} s`,
|
|
1419
|
+
"high pressure threshold": `${this.highPressureThreshold} kPa`,
|
|
1420
|
+
"low pressure threshold": `${this.lowPressureThreshold} kPa`
|
|
1421
|
+
};
|
|
1422
|
+
if (this.rainSensorPolarity != void 0) {
|
|
1423
|
+
message["rain sensor polarity"] = (0, import_safe3.getEnumMemberName)(import_Types.IrrigationSensorPolarity, this.rainSensorPolarity);
|
|
1424
|
+
}
|
|
1425
|
+
if (this.moistureSensorPolarity != void 0) {
|
|
1426
|
+
message["moisture sensor polarity"] = (0, import_safe3.getEnumMemberName)(import_Types.IrrigationSensorPolarity, this.moistureSensorPolarity);
|
|
1427
|
+
}
|
|
1428
|
+
return {
|
|
1429
|
+
...super.toLogEntry(ctx),
|
|
1430
|
+
message
|
|
1431
|
+
};
|
|
1432
|
+
}
|
|
1433
|
+
};
|
|
1434
|
+
return IrrigationCCSystemConfigReport2 = _classThis;
|
|
1435
|
+
})();
|
|
1436
|
+
let IrrigationCCSystemConfigGet = (() => {
|
|
1437
|
+
let _classDecorators = [(0, import_CommandClassDecorators.CCCommand)(import_Types.IrrigationCommand.SystemConfigGet), (0, import_CommandClassDecorators.expectedCCResponse)(IrrigationCCSystemConfigReport)];
|
|
1438
|
+
let _classDescriptor;
|
|
1439
|
+
let _classExtraInitializers = [];
|
|
1440
|
+
let _classThis;
|
|
1441
|
+
let _classSuper = IrrigationCC;
|
|
1442
|
+
var IrrigationCCSystemConfigGet2 = class extends _classSuper {
|
|
1443
|
+
static {
|
|
1444
|
+
_classThis = this;
|
|
1445
|
+
}
|
|
1446
|
+
static {
|
|
1447
|
+
const _metadata = typeof Symbol === "function" && Symbol.metadata ? Object.create(_classSuper[Symbol.metadata] ?? null) : void 0;
|
|
1448
|
+
__esDecorate(null, _classDescriptor = { value: _classThis }, _classDecorators, { kind: "class", name: _classThis.name, metadata: _metadata }, null, _classExtraInitializers);
|
|
1449
|
+
IrrigationCCSystemConfigGet2 = _classThis = _classDescriptor.value;
|
|
1450
|
+
if (_metadata) Object.defineProperty(_classThis, Symbol.metadata, { enumerable: true, configurable: true, writable: true, value: _metadata });
|
|
1451
|
+
__runInitializers(_classThis, _classExtraInitializers);
|
|
1452
|
+
}
|
|
1453
|
+
};
|
|
1454
|
+
return IrrigationCCSystemConfigGet2 = _classThis;
|
|
1455
|
+
})();
|
|
1456
|
+
let IrrigationCCValveInfoReport = (() => {
|
|
1457
|
+
let _classDecorators = [(0, import_CommandClassDecorators.CCCommand)(import_Types.IrrigationCommand.ValveInfoReport)];
|
|
1458
|
+
let _classDescriptor;
|
|
1459
|
+
let _classExtraInitializers = [];
|
|
1460
|
+
let _classThis;
|
|
1461
|
+
let _classSuper = IrrigationCC;
|
|
1462
|
+
var IrrigationCCValveInfoReport2 = class extends _classSuper {
|
|
1463
|
+
static {
|
|
1464
|
+
_classThis = this;
|
|
1465
|
+
}
|
|
1466
|
+
static {
|
|
1467
|
+
const _metadata = typeof Symbol === "function" && Symbol.metadata ? Object.create(_classSuper[Symbol.metadata] ?? null) : void 0;
|
|
1468
|
+
__esDecorate(null, _classDescriptor = { value: _classThis }, _classDecorators, { kind: "class", name: _classThis.name, metadata: _metadata }, null, _classExtraInitializers);
|
|
1469
|
+
IrrigationCCValveInfoReport2 = _classThis = _classDescriptor.value;
|
|
1470
|
+
if (_metadata) Object.defineProperty(_classThis, Symbol.metadata, { enumerable: true, configurable: true, writable: true, value: _metadata });
|
|
1471
|
+
__runInitializers(_classThis, _classExtraInitializers);
|
|
1472
|
+
}
|
|
1473
|
+
constructor(options) {
|
|
1474
|
+
super(options);
|
|
1475
|
+
this.valveId = options.valveId;
|
|
1476
|
+
this.connected = options.connected;
|
|
1477
|
+
this.nominalCurrent = options.nominalCurrent;
|
|
1478
|
+
this.errorShortCircuit = options.errorShortCircuit;
|
|
1479
|
+
this.errorHighCurrent = options.errorHighCurrent;
|
|
1480
|
+
this.errorLowCurrent = options.errorLowCurrent;
|
|
1481
|
+
this.errorMaximumFlow = options.errorMaximumFlow;
|
|
1482
|
+
this.errorHighFlow = options.errorHighFlow;
|
|
1483
|
+
this.errorLowFlow = options.errorLowFlow;
|
|
1484
|
+
}
|
|
1485
|
+
static from(raw, ctx) {
|
|
1486
|
+
(0, import_safe.validatePayload)(raw.payload.length >= 4);
|
|
1487
|
+
let valveId;
|
|
1488
|
+
if ((raw.payload[0] & 1) === import_Types.ValveType.MasterValve) {
|
|
1489
|
+
valveId = "master";
|
|
1490
|
+
} else {
|
|
1491
|
+
valveId = raw.payload[1];
|
|
1492
|
+
}
|
|
1493
|
+
const connected = !!(raw.payload[0] & 2);
|
|
1494
|
+
const nominalCurrent = 10 * raw.payload[2];
|
|
1495
|
+
const errorShortCircuit = !!(raw.payload[3] & 1);
|
|
1496
|
+
const errorHighCurrent = !!(raw.payload[3] & 2);
|
|
1497
|
+
const errorLowCurrent = !!(raw.payload[3] & 4);
|
|
1498
|
+
let errorMaximumFlow;
|
|
1499
|
+
let errorHighFlow;
|
|
1500
|
+
let errorLowFlow;
|
|
1501
|
+
if (valveId === "master") {
|
|
1502
|
+
errorMaximumFlow = !!(raw.payload[3] & 8);
|
|
1503
|
+
errorHighFlow = !!(raw.payload[3] & 16);
|
|
1504
|
+
errorLowFlow = !!(raw.payload[3] & 32);
|
|
1505
|
+
}
|
|
1506
|
+
return new this({
|
|
1507
|
+
nodeId: ctx.sourceNodeId,
|
|
1508
|
+
valveId,
|
|
1509
|
+
connected,
|
|
1510
|
+
nominalCurrent,
|
|
1511
|
+
errorShortCircuit,
|
|
1512
|
+
errorHighCurrent,
|
|
1513
|
+
errorLowCurrent,
|
|
1514
|
+
errorMaximumFlow,
|
|
1515
|
+
errorHighFlow,
|
|
1516
|
+
errorLowFlow
|
|
1517
|
+
});
|
|
1518
|
+
}
|
|
1519
|
+
valveId;
|
|
1520
|
+
connected;
|
|
1521
|
+
nominalCurrent;
|
|
1522
|
+
errorShortCircuit;
|
|
1523
|
+
errorHighCurrent;
|
|
1524
|
+
errorLowCurrent;
|
|
1525
|
+
errorMaximumFlow;
|
|
1526
|
+
errorHighFlow;
|
|
1527
|
+
errorLowFlow;
|
|
1528
|
+
persistValues(ctx) {
|
|
1529
|
+
if (!super.persistValues(ctx))
|
|
1530
|
+
return false;
|
|
1531
|
+
const valveConnectedValue = IrrigationCCValues.valveConnected(this.valveId);
|
|
1532
|
+
this.ensureMetadata(ctx, valveConnectedValue);
|
|
1533
|
+
this.setValue(ctx, valveConnectedValue, this.connected);
|
|
1534
|
+
const nominalCurrentValue = IrrigationCCValues.nominalCurrent(this.valveId);
|
|
1535
|
+
this.ensureMetadata(ctx, nominalCurrentValue);
|
|
1536
|
+
this.setValue(ctx, nominalCurrentValue, this.nominalCurrent);
|
|
1537
|
+
const errorShortCircuitValue = IrrigationCCValues.errorShortCircuit(this.valveId);
|
|
1538
|
+
this.ensureMetadata(ctx, errorShortCircuitValue);
|
|
1539
|
+
this.setValue(ctx, errorShortCircuitValue, this.errorShortCircuit);
|
|
1540
|
+
const errorHighCurrentValue = IrrigationCCValues.errorHighCurrent(this.valveId);
|
|
1541
|
+
this.ensureMetadata(ctx, errorHighCurrentValue);
|
|
1542
|
+
this.setValue(ctx, errorHighCurrentValue, this.errorHighCurrent);
|
|
1543
|
+
const errorLowCurrentValue = IrrigationCCValues.errorLowCurrent(this.valveId);
|
|
1544
|
+
this.ensureMetadata(ctx, errorLowCurrentValue);
|
|
1545
|
+
this.setValue(ctx, errorLowCurrentValue, this.errorLowCurrent);
|
|
1546
|
+
if (this.errorMaximumFlow != void 0) {
|
|
1547
|
+
const errorMaximumFlowValue = IrrigationCCValues.errorMaximumFlow(this.valveId);
|
|
1548
|
+
this.ensureMetadata(ctx, errorMaximumFlowValue);
|
|
1549
|
+
this.setValue(ctx, errorMaximumFlowValue, this.errorMaximumFlow);
|
|
1550
|
+
}
|
|
1551
|
+
if (this.errorHighFlow != void 0) {
|
|
1552
|
+
const errorHighFlowValue = IrrigationCCValues.errorHighFlow(this.valveId);
|
|
1553
|
+
this.ensureMetadata(ctx, errorHighFlowValue);
|
|
1554
|
+
this.setValue(ctx, errorHighFlowValue, this.errorHighFlow);
|
|
1555
|
+
}
|
|
1556
|
+
if (this.errorLowFlow != void 0) {
|
|
1557
|
+
const errorLowFlowValue = IrrigationCCValues.errorLowFlow(this.valveId);
|
|
1558
|
+
this.ensureMetadata(ctx, errorLowFlowValue);
|
|
1559
|
+
this.setValue(ctx, errorLowFlowValue, this.errorLowFlow);
|
|
1560
|
+
}
|
|
1561
|
+
return true;
|
|
1562
|
+
}
|
|
1563
|
+
toLogEntry(ctx) {
|
|
1564
|
+
const message = {
|
|
1565
|
+
"valve ID": this.valveId,
|
|
1566
|
+
connected: this.connected,
|
|
1567
|
+
"nominal current": `${this.nominalCurrent} mA`
|
|
1568
|
+
};
|
|
1569
|
+
const errors = [
|
|
1570
|
+
this.errorShortCircuit ? "short circuit" : void 0,
|
|
1571
|
+
this.errorHighCurrent ? "current above high threshold" : void 0,
|
|
1572
|
+
this.errorLowCurrent ? "current below low threshold" : void 0,
|
|
1573
|
+
this.errorMaximumFlow ? "maximum flow" : void 0,
|
|
1574
|
+
this.errorHighFlow ? "flow above high threshold" : void 0,
|
|
1575
|
+
this.errorLowFlow ? "flow below low threshold" : void 0
|
|
1576
|
+
].filter(Boolean);
|
|
1577
|
+
if (errors.length > 0) {
|
|
1578
|
+
message.errors = errors.map((e) => `
|
|
1474
1579
|
\xB7 ${e}`).join("");
|
|
1580
|
+
}
|
|
1581
|
+
return {
|
|
1582
|
+
...super.toLogEntry(ctx),
|
|
1583
|
+
message
|
|
1584
|
+
};
|
|
1475
1585
|
}
|
|
1476
|
-
|
|
1477
|
-
|
|
1478
|
-
|
|
1479
|
-
};
|
|
1480
|
-
}
|
|
1481
|
-
};
|
|
1482
|
-
IrrigationCCValveInfoReport = IrrigationCCValveInfoReport_1 = __decorate([
|
|
1483
|
-
(0, import_CommandClassDecorators.CCCommand)(import_Types.IrrigationCommand.ValveInfoReport)
|
|
1484
|
-
], IrrigationCCValveInfoReport);
|
|
1586
|
+
};
|
|
1587
|
+
return IrrigationCCValveInfoReport2 = _classThis;
|
|
1588
|
+
})();
|
|
1485
1589
|
function testResponseForIrrigationCommandWithValveId(sent, received) {
|
|
1486
1590
|
return received.valveId === sent.valveId;
|
|
1487
1591
|
}
|
|
1488
|
-
let IrrigationCCValveInfoGet =
|
|
1489
|
-
|
|
1490
|
-
|
|
1491
|
-
|
|
1492
|
-
|
|
1493
|
-
|
|
1494
|
-
|
|
1495
|
-
|
|
1496
|
-
|
|
1497
|
-
|
|
1498
|
-
|
|
1499
|
-
|
|
1500
|
-
|
|
1501
|
-
|
|
1502
|
-
|
|
1503
|
-
|
|
1504
|
-
|
|
1505
|
-
|
|
1506
|
-
|
|
1507
|
-
|
|
1508
|
-
|
|
1592
|
+
let IrrigationCCValveInfoGet = (() => {
|
|
1593
|
+
let _classDecorators = [(0, import_CommandClassDecorators.CCCommand)(import_Types.IrrigationCommand.ValveInfoGet), (0, import_CommandClassDecorators.expectedCCResponse)(IrrigationCCValveInfoReport, testResponseForIrrigationCommandWithValveId)];
|
|
1594
|
+
let _classDescriptor;
|
|
1595
|
+
let _classExtraInitializers = [];
|
|
1596
|
+
let _classThis;
|
|
1597
|
+
let _classSuper = IrrigationCC;
|
|
1598
|
+
var IrrigationCCValveInfoGet2 = class extends _classSuper {
|
|
1599
|
+
static {
|
|
1600
|
+
_classThis = this;
|
|
1601
|
+
}
|
|
1602
|
+
static {
|
|
1603
|
+
const _metadata = typeof Symbol === "function" && Symbol.metadata ? Object.create(_classSuper[Symbol.metadata] ?? null) : void 0;
|
|
1604
|
+
__esDecorate(null, _classDescriptor = { value: _classThis }, _classDecorators, { kind: "class", name: _classThis.name, metadata: _metadata }, null, _classExtraInitializers);
|
|
1605
|
+
IrrigationCCValveInfoGet2 = _classThis = _classDescriptor.value;
|
|
1606
|
+
if (_metadata) Object.defineProperty(_classThis, Symbol.metadata, { enumerable: true, configurable: true, writable: true, value: _metadata });
|
|
1607
|
+
__runInitializers(_classThis, _classExtraInitializers);
|
|
1608
|
+
}
|
|
1609
|
+
constructor(options) {
|
|
1610
|
+
super(options);
|
|
1611
|
+
this.valveId = options.valveId;
|
|
1612
|
+
}
|
|
1613
|
+
static from(_raw, _ctx) {
|
|
1614
|
+
throw new import_safe.ZWaveError(`${this.name}: deserialization not implemented`, import_safe.ZWaveErrorCodes.Deserialization_NotImplemented);
|
|
1615
|
+
}
|
|
1616
|
+
valveId;
|
|
1617
|
+
serialize(ctx) {
|
|
1618
|
+
this.payload = import_safe2.Bytes.from([
|
|
1619
|
+
this.valveId === "master" ? 1 : 0,
|
|
1620
|
+
this.valveId === "master" ? 1 : this.valveId || 1
|
|
1621
|
+
]);
|
|
1622
|
+
return super.serialize(ctx);
|
|
1623
|
+
}
|
|
1624
|
+
toLogEntry(ctx) {
|
|
1625
|
+
return {
|
|
1626
|
+
...super.toLogEntry(ctx),
|
|
1627
|
+
message: {
|
|
1628
|
+
"valve ID": this.valveId
|
|
1629
|
+
}
|
|
1630
|
+
};
|
|
1631
|
+
}
|
|
1632
|
+
};
|
|
1633
|
+
return IrrigationCCValveInfoGet2 = _classThis;
|
|
1634
|
+
})();
|
|
1635
|
+
let IrrigationCCValveConfigSet = (() => {
|
|
1636
|
+
let _classDecorators = [(0, import_CommandClassDecorators.CCCommand)(import_Types.IrrigationCommand.ValveConfigSet), (0, import_CommandClassDecorators.useSupervision)()];
|
|
1637
|
+
let _classDescriptor;
|
|
1638
|
+
let _classExtraInitializers = [];
|
|
1639
|
+
let _classThis;
|
|
1640
|
+
let _classSuper = IrrigationCC;
|
|
1641
|
+
var IrrigationCCValveConfigSet2 = class extends _classSuper {
|
|
1642
|
+
static {
|
|
1643
|
+
_classThis = this;
|
|
1644
|
+
}
|
|
1645
|
+
static {
|
|
1646
|
+
const _metadata = typeof Symbol === "function" && Symbol.metadata ? Object.create(_classSuper[Symbol.metadata] ?? null) : void 0;
|
|
1647
|
+
__esDecorate(null, _classDescriptor = { value: _classThis }, _classDecorators, { kind: "class", name: _classThis.name, metadata: _metadata }, null, _classExtraInitializers);
|
|
1648
|
+
IrrigationCCValveConfigSet2 = _classThis = _classDescriptor.value;
|
|
1649
|
+
if (_metadata) Object.defineProperty(_classThis, Symbol.metadata, { enumerable: true, configurable: true, writable: true, value: _metadata });
|
|
1650
|
+
__runInitializers(_classThis, _classExtraInitializers);
|
|
1651
|
+
}
|
|
1652
|
+
constructor(options) {
|
|
1653
|
+
super(options);
|
|
1654
|
+
this.valveId = options.valveId;
|
|
1655
|
+
this.nominalCurrentHighThreshold = options.nominalCurrentHighThreshold;
|
|
1656
|
+
this.nominalCurrentLowThreshold = options.nominalCurrentLowThreshold;
|
|
1657
|
+
this.maximumFlow = options.maximumFlow;
|
|
1658
|
+
this.highFlowThreshold = options.highFlowThreshold;
|
|
1659
|
+
this.lowFlowThreshold = options.lowFlowThreshold;
|
|
1660
|
+
this.useRainSensor = options.useRainSensor;
|
|
1661
|
+
this.useMoistureSensor = options.useMoistureSensor;
|
|
1662
|
+
}
|
|
1663
|
+
static from(_raw, _ctx) {
|
|
1664
|
+
throw new import_safe.ZWaveError(`${this.name}: deserialization not implemented`, import_safe.ZWaveErrorCodes.Deserialization_NotImplemented);
|
|
1665
|
+
}
|
|
1666
|
+
valveId;
|
|
1667
|
+
nominalCurrentHighThreshold;
|
|
1668
|
+
nominalCurrentLowThreshold;
|
|
1669
|
+
maximumFlow;
|
|
1670
|
+
highFlowThreshold;
|
|
1671
|
+
lowFlowThreshold;
|
|
1672
|
+
useRainSensor;
|
|
1673
|
+
useMoistureSensor;
|
|
1674
|
+
serialize(ctx) {
|
|
1675
|
+
this.payload = import_safe2.Bytes.concat([
|
|
1676
|
+
import_safe2.Bytes.from([
|
|
1677
|
+
this.valveId === "master" ? 1 : 0,
|
|
1678
|
+
this.valveId === "master" ? 1 : this.valveId || 1,
|
|
1679
|
+
Math.floor(this.nominalCurrentHighThreshold / 10),
|
|
1680
|
+
Math.floor(this.nominalCurrentLowThreshold / 10)
|
|
1681
|
+
]),
|
|
1682
|
+
(0, import_safe.encodeFloatWithScale)(
|
|
1683
|
+
this.maximumFlow,
|
|
1684
|
+
0
|
|
1685
|
+
/* l/h */
|
|
1686
|
+
),
|
|
1687
|
+
(0, import_safe.encodeFloatWithScale)(
|
|
1688
|
+
this.highFlowThreshold,
|
|
1689
|
+
0
|
|
1690
|
+
/* l/h */
|
|
1691
|
+
),
|
|
1692
|
+
(0, import_safe.encodeFloatWithScale)(
|
|
1693
|
+
this.lowFlowThreshold,
|
|
1694
|
+
0
|
|
1695
|
+
/* l/h */
|
|
1696
|
+
),
|
|
1697
|
+
import_safe2.Bytes.from([
|
|
1698
|
+
(this.useRainSensor ? 1 : 0) | (this.useMoistureSensor ? 2 : 0)
|
|
1699
|
+
])
|
|
1700
|
+
]);
|
|
1701
|
+
return super.serialize(ctx);
|
|
1702
|
+
}
|
|
1703
|
+
toLogEntry(ctx) {
|
|
1704
|
+
return {
|
|
1705
|
+
...super.toLogEntry(ctx),
|
|
1706
|
+
message: {
|
|
1707
|
+
"valve ID": this.valveId,
|
|
1708
|
+
"nominal current high threshold": `${this.nominalCurrentHighThreshold} mA`,
|
|
1709
|
+
"nominal current low threshold": `${this.nominalCurrentLowThreshold} mA`,
|
|
1710
|
+
"maximum flow": `${this.maximumFlow} l/h`,
|
|
1711
|
+
"high flow threshold": `${this.highFlowThreshold} l/h`,
|
|
1712
|
+
"low flow threshold": `${this.lowFlowThreshold} l/h`,
|
|
1713
|
+
"use rain sensor": this.useRainSensor,
|
|
1714
|
+
"use moisture sensor": this.useMoistureSensor
|
|
1715
|
+
}
|
|
1716
|
+
};
|
|
1717
|
+
}
|
|
1718
|
+
};
|
|
1719
|
+
return IrrigationCCValveConfigSet2 = _classThis;
|
|
1720
|
+
})();
|
|
1721
|
+
let IrrigationCCValveConfigReport = (() => {
|
|
1722
|
+
let _classDecorators = [(0, import_CommandClassDecorators.CCCommand)(import_Types.IrrigationCommand.ValveConfigReport)];
|
|
1723
|
+
let _classDescriptor;
|
|
1724
|
+
let _classExtraInitializers = [];
|
|
1725
|
+
let _classThis;
|
|
1726
|
+
let _classSuper = IrrigationCC;
|
|
1727
|
+
var IrrigationCCValveConfigReport2 = class extends _classSuper {
|
|
1728
|
+
static {
|
|
1729
|
+
_classThis = this;
|
|
1730
|
+
}
|
|
1731
|
+
static {
|
|
1732
|
+
const _metadata = typeof Symbol === "function" && Symbol.metadata ? Object.create(_classSuper[Symbol.metadata] ?? null) : void 0;
|
|
1733
|
+
__esDecorate(null, _classDescriptor = { value: _classThis }, _classDecorators, { kind: "class", name: _classThis.name, metadata: _metadata }, null, _classExtraInitializers);
|
|
1734
|
+
IrrigationCCValveConfigReport2 = _classThis = _classDescriptor.value;
|
|
1735
|
+
if (_metadata) Object.defineProperty(_classThis, Symbol.metadata, { enumerable: true, configurable: true, writable: true, value: _metadata });
|
|
1736
|
+
__runInitializers(_classThis, _classExtraInitializers);
|
|
1737
|
+
}
|
|
1738
|
+
constructor(options) {
|
|
1739
|
+
super(options);
|
|
1740
|
+
this.valveId = options.valveId;
|
|
1741
|
+
this.nominalCurrentHighThreshold = options.nominalCurrentHighThreshold;
|
|
1742
|
+
this.nominalCurrentLowThreshold = options.nominalCurrentLowThreshold;
|
|
1743
|
+
this.maximumFlow = options.maximumFlow;
|
|
1744
|
+
this.highFlowThreshold = options.highFlowThreshold;
|
|
1745
|
+
this.lowFlowThreshold = options.lowFlowThreshold;
|
|
1746
|
+
this.useRainSensor = options.useRainSensor;
|
|
1747
|
+
this.useMoistureSensor = options.useMoistureSensor;
|
|
1748
|
+
}
|
|
1749
|
+
static from(raw, ctx) {
|
|
1750
|
+
(0, import_safe.validatePayload)(raw.payload.length >= 4);
|
|
1751
|
+
let valveId;
|
|
1752
|
+
if ((raw.payload[0] & 1) === import_Types.ValveType.MasterValve) {
|
|
1753
|
+
valveId = "master";
|
|
1754
|
+
} else {
|
|
1755
|
+
valveId = raw.payload[1];
|
|
1509
1756
|
}
|
|
1510
|
-
|
|
1511
|
-
|
|
1512
|
-
|
|
1513
|
-
|
|
1514
|
-
|
|
1515
|
-
|
|
1516
|
-
|
|
1517
|
-
|
|
1518
|
-
|
|
1519
|
-
|
|
1520
|
-
|
|
1521
|
-
|
|
1522
|
-
|
|
1523
|
-
|
|
1524
|
-
|
|
1525
|
-
|
|
1526
|
-
|
|
1527
|
-
|
|
1528
|
-
|
|
1529
|
-
|
|
1530
|
-
|
|
1531
|
-
|
|
1532
|
-
|
|
1533
|
-
|
|
1534
|
-
|
|
1535
|
-
|
|
1536
|
-
|
|
1537
|
-
|
|
1538
|
-
|
|
1539
|
-
|
|
1540
|
-
|
|
1541
|
-
|
|
1542
|
-
|
|
1757
|
+
const nominalCurrentHighThreshold = 10 * raw.payload[2];
|
|
1758
|
+
const nominalCurrentLowThreshold = 10 * raw.payload[3];
|
|
1759
|
+
let offset = 4;
|
|
1760
|
+
let maximumFlow;
|
|
1761
|
+
{
|
|
1762
|
+
const { value, scale, bytesRead } = (0, import_safe.parseFloatWithScale)(raw.payload.subarray(offset));
|
|
1763
|
+
(0, import_safe.validatePayload)(
|
|
1764
|
+
scale === 0
|
|
1765
|
+
/* l/h */
|
|
1766
|
+
);
|
|
1767
|
+
maximumFlow = value;
|
|
1768
|
+
offset += bytesRead;
|
|
1769
|
+
}
|
|
1770
|
+
let highFlowThreshold;
|
|
1771
|
+
{
|
|
1772
|
+
const { value, scale, bytesRead } = (0, import_safe.parseFloatWithScale)(raw.payload.subarray(offset));
|
|
1773
|
+
(0, import_safe.validatePayload)(
|
|
1774
|
+
scale === 0
|
|
1775
|
+
/* l/h */
|
|
1776
|
+
);
|
|
1777
|
+
highFlowThreshold = value;
|
|
1778
|
+
offset += bytesRead;
|
|
1779
|
+
}
|
|
1780
|
+
let lowFlowThreshold;
|
|
1781
|
+
{
|
|
1782
|
+
const { value, scale, bytesRead } = (0, import_safe.parseFloatWithScale)(raw.payload.subarray(offset));
|
|
1783
|
+
(0, import_safe.validatePayload)(
|
|
1784
|
+
scale === 0
|
|
1785
|
+
/* l/h */
|
|
1786
|
+
);
|
|
1787
|
+
lowFlowThreshold = value;
|
|
1788
|
+
offset += bytesRead;
|
|
1789
|
+
}
|
|
1790
|
+
(0, import_safe.validatePayload)(raw.payload.length >= offset + 1);
|
|
1791
|
+
const useRainSensor = !!(raw.payload[offset] & 1);
|
|
1792
|
+
const useMoistureSensor = !!(raw.payload[offset] & 2);
|
|
1793
|
+
return new this({
|
|
1794
|
+
nodeId: ctx.sourceNodeId,
|
|
1795
|
+
valveId,
|
|
1796
|
+
nominalCurrentHighThreshold,
|
|
1797
|
+
nominalCurrentLowThreshold,
|
|
1798
|
+
maximumFlow,
|
|
1799
|
+
highFlowThreshold,
|
|
1800
|
+
lowFlowThreshold,
|
|
1801
|
+
useRainSensor,
|
|
1802
|
+
useMoistureSensor
|
|
1803
|
+
});
|
|
1804
|
+
}
|
|
1805
|
+
persistValues(ctx) {
|
|
1806
|
+
if (!super.persistValues(ctx))
|
|
1807
|
+
return false;
|
|
1808
|
+
const nominalCurrentHighThresholdValue = IrrigationCCValues.nominalCurrentHighThreshold(this.valveId);
|
|
1809
|
+
this.ensureMetadata(ctx, nominalCurrentHighThresholdValue);
|
|
1810
|
+
this.setValue(ctx, nominalCurrentHighThresholdValue, this.nominalCurrentHighThreshold);
|
|
1811
|
+
const nominalCurrentLowThresholdValue = IrrigationCCValues.nominalCurrentLowThreshold(this.valveId);
|
|
1812
|
+
this.ensureMetadata(ctx, nominalCurrentLowThresholdValue);
|
|
1813
|
+
this.setValue(ctx, nominalCurrentLowThresholdValue, this.nominalCurrentLowThreshold);
|
|
1814
|
+
const maximumFlowValue = IrrigationCCValues.maximumFlow(this.valveId);
|
|
1815
|
+
this.ensureMetadata(ctx, maximumFlowValue);
|
|
1816
|
+
this.setValue(ctx, maximumFlowValue, this.maximumFlow);
|
|
1817
|
+
const highFlowThresholdValue = IrrigationCCValues.highFlowThreshold(this.valveId);
|
|
1818
|
+
this.ensureMetadata(ctx, highFlowThresholdValue);
|
|
1819
|
+
this.setValue(ctx, highFlowThresholdValue, this.highFlowThreshold);
|
|
1820
|
+
const lowFlowThresholdValue = IrrigationCCValues.lowFlowThreshold(this.valveId);
|
|
1821
|
+
this.ensureMetadata(ctx, lowFlowThresholdValue);
|
|
1822
|
+
this.setValue(ctx, lowFlowThresholdValue, this.lowFlowThreshold);
|
|
1823
|
+
const useRainSensorValue = IrrigationCCValues.useRainSensor(this.valveId);
|
|
1824
|
+
this.ensureMetadata(ctx, useRainSensorValue);
|
|
1825
|
+
this.setValue(ctx, useRainSensorValue, this.useRainSensor);
|
|
1826
|
+
const useMoistureSensorValue = IrrigationCCValues.useMoistureSensor(this.valveId);
|
|
1827
|
+
this.ensureMetadata(ctx, useMoistureSensorValue);
|
|
1828
|
+
this.setValue(ctx, useMoistureSensorValue, this.useMoistureSensor);
|
|
1829
|
+
return true;
|
|
1830
|
+
}
|
|
1831
|
+
valveId;
|
|
1832
|
+
nominalCurrentHighThreshold;
|
|
1833
|
+
nominalCurrentLowThreshold;
|
|
1834
|
+
maximumFlow;
|
|
1835
|
+
highFlowThreshold;
|
|
1836
|
+
lowFlowThreshold;
|
|
1837
|
+
useRainSensor;
|
|
1838
|
+
useMoistureSensor;
|
|
1839
|
+
toLogEntry(ctx) {
|
|
1840
|
+
return {
|
|
1841
|
+
...super.toLogEntry(ctx),
|
|
1842
|
+
message: {
|
|
1843
|
+
"valve ID": this.valveId,
|
|
1844
|
+
"nominal current high threshold": `${this.nominalCurrentHighThreshold} mA`,
|
|
1845
|
+
"nominal current low threshold": `${this.nominalCurrentLowThreshold} mA`,
|
|
1846
|
+
"maximum flow": `${this.maximumFlow} l/h`,
|
|
1847
|
+
"high flow threshold": `${this.highFlowThreshold} l/h`,
|
|
1848
|
+
"low flow threshold": `${this.lowFlowThreshold} l/h`,
|
|
1849
|
+
"use rain sensor": this.useRainSensor,
|
|
1850
|
+
"use moisture sensor": this.useMoistureSensor
|
|
1851
|
+
}
|
|
1852
|
+
};
|
|
1853
|
+
}
|
|
1854
|
+
};
|
|
1855
|
+
return IrrigationCCValveConfigReport2 = _classThis;
|
|
1856
|
+
})();
|
|
1857
|
+
let IrrigationCCValveConfigGet = (() => {
|
|
1858
|
+
let _classDecorators = [(0, import_CommandClassDecorators.CCCommand)(import_Types.IrrigationCommand.ValveConfigGet), (0, import_CommandClassDecorators.expectedCCResponse)(IrrigationCCValveConfigReport, testResponseForIrrigationCommandWithValveId)];
|
|
1859
|
+
let _classDescriptor;
|
|
1860
|
+
let _classExtraInitializers = [];
|
|
1861
|
+
let _classThis;
|
|
1862
|
+
let _classSuper = IrrigationCC;
|
|
1863
|
+
var IrrigationCCValveConfigGet2 = class extends _classSuper {
|
|
1864
|
+
static {
|
|
1865
|
+
_classThis = this;
|
|
1866
|
+
}
|
|
1867
|
+
static {
|
|
1868
|
+
const _metadata = typeof Symbol === "function" && Symbol.metadata ? Object.create(_classSuper[Symbol.metadata] ?? null) : void 0;
|
|
1869
|
+
__esDecorate(null, _classDescriptor = { value: _classThis }, _classDecorators, { kind: "class", name: _classThis.name, metadata: _metadata }, null, _classExtraInitializers);
|
|
1870
|
+
IrrigationCCValveConfigGet2 = _classThis = _classDescriptor.value;
|
|
1871
|
+
if (_metadata) Object.defineProperty(_classThis, Symbol.metadata, { enumerable: true, configurable: true, writable: true, value: _metadata });
|
|
1872
|
+
__runInitializers(_classThis, _classExtraInitializers);
|
|
1873
|
+
}
|
|
1874
|
+
constructor(options) {
|
|
1875
|
+
super(options);
|
|
1876
|
+
this.valveId = options.valveId;
|
|
1877
|
+
}
|
|
1878
|
+
static from(_raw, _ctx) {
|
|
1879
|
+
throw new import_safe.ZWaveError(`${this.name}: deserialization not implemented`, import_safe.ZWaveErrorCodes.Deserialization_NotImplemented);
|
|
1880
|
+
}
|
|
1881
|
+
valveId;
|
|
1882
|
+
serialize(ctx) {
|
|
1883
|
+
this.payload = import_safe2.Bytes.from([
|
|
1884
|
+
this.valveId === "master" ? 1 : 0,
|
|
1885
|
+
this.valveId === "master" ? 1 : this.valveId || 1
|
|
1886
|
+
]);
|
|
1887
|
+
return super.serialize(ctx);
|
|
1888
|
+
}
|
|
1889
|
+
toLogEntry(ctx) {
|
|
1890
|
+
return {
|
|
1891
|
+
...super.toLogEntry(ctx),
|
|
1892
|
+
message: {
|
|
1893
|
+
"valve ID": this.valveId
|
|
1894
|
+
}
|
|
1895
|
+
};
|
|
1896
|
+
}
|
|
1897
|
+
};
|
|
1898
|
+
return IrrigationCCValveConfigGet2 = _classThis;
|
|
1899
|
+
})();
|
|
1900
|
+
let IrrigationCCValveRun = (() => {
|
|
1901
|
+
let _classDecorators = [(0, import_CommandClassDecorators.CCCommand)(import_Types.IrrigationCommand.ValveRun), (0, import_CommandClassDecorators.useSupervision)()];
|
|
1902
|
+
let _classDescriptor;
|
|
1903
|
+
let _classExtraInitializers = [];
|
|
1904
|
+
let _classThis;
|
|
1905
|
+
let _classSuper = IrrigationCC;
|
|
1906
|
+
var IrrigationCCValveRun2 = class extends _classSuper {
|
|
1907
|
+
static {
|
|
1908
|
+
_classThis = this;
|
|
1909
|
+
}
|
|
1910
|
+
static {
|
|
1911
|
+
const _metadata = typeof Symbol === "function" && Symbol.metadata ? Object.create(_classSuper[Symbol.metadata] ?? null) : void 0;
|
|
1912
|
+
__esDecorate(null, _classDescriptor = { value: _classThis }, _classDecorators, { kind: "class", name: _classThis.name, metadata: _metadata }, null, _classExtraInitializers);
|
|
1913
|
+
IrrigationCCValveRun2 = _classThis = _classDescriptor.value;
|
|
1914
|
+
if (_metadata) Object.defineProperty(_classThis, Symbol.metadata, { enumerable: true, configurable: true, writable: true, value: _metadata });
|
|
1915
|
+
__runInitializers(_classThis, _classExtraInitializers);
|
|
1916
|
+
}
|
|
1917
|
+
constructor(options) {
|
|
1918
|
+
super(options);
|
|
1919
|
+
this.valveId = options.valveId;
|
|
1920
|
+
this.duration = options.duration;
|
|
1921
|
+
}
|
|
1922
|
+
static from(_raw, _ctx) {
|
|
1923
|
+
throw new import_safe.ZWaveError(`${this.name}: deserialization not implemented`, import_safe.ZWaveErrorCodes.Deserialization_NotImplemented);
|
|
1924
|
+
}
|
|
1925
|
+
valveId;
|
|
1926
|
+
duration;
|
|
1927
|
+
serialize(ctx) {
|
|
1928
|
+
this.payload = import_safe2.Bytes.from([
|
|
1543
1929
|
this.valveId === "master" ? 1 : 0,
|
|
1544
1930
|
this.valveId === "master" ? 1 : this.valveId || 1,
|
|
1545
|
-
|
|
1546
|
-
Math.floor(this.nominalCurrentLowThreshold / 10)
|
|
1547
|
-
]),
|
|
1548
|
-
(0, import_safe.encodeFloatWithScale)(
|
|
1549
|
-
this.maximumFlow,
|
|
1931
|
+
0,
|
|
1550
1932
|
0
|
|
1551
|
-
|
|
1552
|
-
)
|
|
1553
|
-
|
|
1554
|
-
|
|
1555
|
-
|
|
1556
|
-
|
|
1557
|
-
),
|
|
1558
|
-
(0, import_safe.encodeFloatWithScale)(
|
|
1559
|
-
this.lowFlowThreshold,
|
|
1560
|
-
0
|
|
1561
|
-
/* l/h */
|
|
1562
|
-
),
|
|
1563
|
-
import_safe2.Bytes.from([
|
|
1564
|
-
(this.useRainSensor ? 1 : 0) | (this.useMoistureSensor ? 2 : 0)
|
|
1565
|
-
])
|
|
1566
|
-
]);
|
|
1567
|
-
return super.serialize(ctx);
|
|
1568
|
-
}
|
|
1569
|
-
toLogEntry(ctx) {
|
|
1570
|
-
return {
|
|
1571
|
-
...super.toLogEntry(ctx),
|
|
1572
|
-
message: {
|
|
1573
|
-
"valve ID": this.valveId,
|
|
1574
|
-
"nominal current high threshold": `${this.nominalCurrentHighThreshold} mA`,
|
|
1575
|
-
"nominal current low threshold": `${this.nominalCurrentLowThreshold} mA`,
|
|
1576
|
-
"maximum flow": `${this.maximumFlow} l/h`,
|
|
1577
|
-
"high flow threshold": `${this.highFlowThreshold} l/h`,
|
|
1578
|
-
"low flow threshold": `${this.lowFlowThreshold} l/h`,
|
|
1579
|
-
"use rain sensor": this.useRainSensor,
|
|
1580
|
-
"use moisture sensor": this.useMoistureSensor
|
|
1581
|
-
}
|
|
1582
|
-
};
|
|
1583
|
-
}
|
|
1584
|
-
};
|
|
1585
|
-
IrrigationCCValveConfigSet = __decorate([
|
|
1586
|
-
(0, import_CommandClassDecorators.CCCommand)(import_Types.IrrigationCommand.ValveConfigSet),
|
|
1587
|
-
(0, import_CommandClassDecorators.useSupervision)()
|
|
1588
|
-
], IrrigationCCValveConfigSet);
|
|
1589
|
-
let IrrigationCCValveConfigReport = IrrigationCCValveConfigReport_1 = class IrrigationCCValveConfigReport2 extends IrrigationCC {
|
|
1590
|
-
constructor(options) {
|
|
1591
|
-
super(options);
|
|
1592
|
-
this.valveId = options.valveId;
|
|
1593
|
-
this.nominalCurrentHighThreshold = options.nominalCurrentHighThreshold;
|
|
1594
|
-
this.nominalCurrentLowThreshold = options.nominalCurrentLowThreshold;
|
|
1595
|
-
this.maximumFlow = options.maximumFlow;
|
|
1596
|
-
this.highFlowThreshold = options.highFlowThreshold;
|
|
1597
|
-
this.lowFlowThreshold = options.lowFlowThreshold;
|
|
1598
|
-
this.useRainSensor = options.useRainSensor;
|
|
1599
|
-
this.useMoistureSensor = options.useMoistureSensor;
|
|
1600
|
-
}
|
|
1601
|
-
static from(raw, ctx) {
|
|
1602
|
-
(0, import_safe.validatePayload)(raw.payload.length >= 4);
|
|
1603
|
-
let valveId;
|
|
1604
|
-
if ((raw.payload[0] & 1) === import_Types.ValveType.MasterValve) {
|
|
1605
|
-
valveId = "master";
|
|
1606
|
-
} else {
|
|
1607
|
-
valveId = raw.payload[1];
|
|
1608
|
-
}
|
|
1609
|
-
const nominalCurrentHighThreshold = 10 * raw.payload[2];
|
|
1610
|
-
const nominalCurrentLowThreshold = 10 * raw.payload[3];
|
|
1611
|
-
let offset = 4;
|
|
1612
|
-
let maximumFlow;
|
|
1613
|
-
{
|
|
1614
|
-
const { value, scale, bytesRead } = (0, import_safe.parseFloatWithScale)(raw.payload.subarray(offset));
|
|
1615
|
-
(0, import_safe.validatePayload)(
|
|
1616
|
-
scale === 0
|
|
1617
|
-
/* l/h */
|
|
1618
|
-
);
|
|
1619
|
-
maximumFlow = value;
|
|
1620
|
-
offset += bytesRead;
|
|
1621
|
-
}
|
|
1622
|
-
let highFlowThreshold;
|
|
1623
|
-
{
|
|
1624
|
-
const { value, scale, bytesRead } = (0, import_safe.parseFloatWithScale)(raw.payload.subarray(offset));
|
|
1625
|
-
(0, import_safe.validatePayload)(
|
|
1626
|
-
scale === 0
|
|
1627
|
-
/* l/h */
|
|
1628
|
-
);
|
|
1629
|
-
highFlowThreshold = value;
|
|
1630
|
-
offset += bytesRead;
|
|
1631
|
-
}
|
|
1632
|
-
let lowFlowThreshold;
|
|
1633
|
-
{
|
|
1634
|
-
const { value, scale, bytesRead } = (0, import_safe.parseFloatWithScale)(raw.payload.subarray(offset));
|
|
1635
|
-
(0, import_safe.validatePayload)(
|
|
1636
|
-
scale === 0
|
|
1637
|
-
/* l/h */
|
|
1638
|
-
);
|
|
1639
|
-
lowFlowThreshold = value;
|
|
1640
|
-
offset += bytesRead;
|
|
1641
|
-
}
|
|
1642
|
-
(0, import_safe.validatePayload)(raw.payload.length >= offset + 1);
|
|
1643
|
-
const useRainSensor = !!(raw.payload[offset] & 1);
|
|
1644
|
-
const useMoistureSensor = !!(raw.payload[offset] & 2);
|
|
1645
|
-
return new IrrigationCCValveConfigReport_1({
|
|
1646
|
-
nodeId: ctx.sourceNodeId,
|
|
1647
|
-
valveId,
|
|
1648
|
-
nominalCurrentHighThreshold,
|
|
1649
|
-
nominalCurrentLowThreshold,
|
|
1650
|
-
maximumFlow,
|
|
1651
|
-
highFlowThreshold,
|
|
1652
|
-
lowFlowThreshold,
|
|
1653
|
-
useRainSensor,
|
|
1654
|
-
useMoistureSensor
|
|
1655
|
-
});
|
|
1656
|
-
}
|
|
1657
|
-
persistValues(ctx) {
|
|
1658
|
-
if (!super.persistValues(ctx))
|
|
1659
|
-
return false;
|
|
1660
|
-
const nominalCurrentHighThresholdValue = IrrigationCCValues.nominalCurrentHighThreshold(this.valveId);
|
|
1661
|
-
this.ensureMetadata(ctx, nominalCurrentHighThresholdValue);
|
|
1662
|
-
this.setValue(ctx, nominalCurrentHighThresholdValue, this.nominalCurrentHighThreshold);
|
|
1663
|
-
const nominalCurrentLowThresholdValue = IrrigationCCValues.nominalCurrentLowThreshold(this.valveId);
|
|
1664
|
-
this.ensureMetadata(ctx, nominalCurrentLowThresholdValue);
|
|
1665
|
-
this.setValue(ctx, nominalCurrentLowThresholdValue, this.nominalCurrentLowThreshold);
|
|
1666
|
-
const maximumFlowValue = IrrigationCCValues.maximumFlow(this.valveId);
|
|
1667
|
-
this.ensureMetadata(ctx, maximumFlowValue);
|
|
1668
|
-
this.setValue(ctx, maximumFlowValue, this.maximumFlow);
|
|
1669
|
-
const highFlowThresholdValue = IrrigationCCValues.highFlowThreshold(this.valveId);
|
|
1670
|
-
this.ensureMetadata(ctx, highFlowThresholdValue);
|
|
1671
|
-
this.setValue(ctx, highFlowThresholdValue, this.highFlowThreshold);
|
|
1672
|
-
const lowFlowThresholdValue = IrrigationCCValues.lowFlowThreshold(this.valveId);
|
|
1673
|
-
this.ensureMetadata(ctx, lowFlowThresholdValue);
|
|
1674
|
-
this.setValue(ctx, lowFlowThresholdValue, this.lowFlowThreshold);
|
|
1675
|
-
const useRainSensorValue = IrrigationCCValues.useRainSensor(this.valveId);
|
|
1676
|
-
this.ensureMetadata(ctx, useRainSensorValue);
|
|
1677
|
-
this.setValue(ctx, useRainSensorValue, this.useRainSensor);
|
|
1678
|
-
const useMoistureSensorValue = IrrigationCCValues.useMoistureSensor(this.valveId);
|
|
1679
|
-
this.ensureMetadata(ctx, useMoistureSensorValue);
|
|
1680
|
-
this.setValue(ctx, useMoistureSensorValue, this.useMoistureSensor);
|
|
1681
|
-
return true;
|
|
1682
|
-
}
|
|
1683
|
-
valveId;
|
|
1684
|
-
nominalCurrentHighThreshold;
|
|
1685
|
-
nominalCurrentLowThreshold;
|
|
1686
|
-
maximumFlow;
|
|
1687
|
-
highFlowThreshold;
|
|
1688
|
-
lowFlowThreshold;
|
|
1689
|
-
useRainSensor;
|
|
1690
|
-
useMoistureSensor;
|
|
1691
|
-
toLogEntry(ctx) {
|
|
1692
|
-
return {
|
|
1693
|
-
...super.toLogEntry(ctx),
|
|
1694
|
-
message: {
|
|
1695
|
-
"valve ID": this.valveId,
|
|
1696
|
-
"nominal current high threshold": `${this.nominalCurrentHighThreshold} mA`,
|
|
1697
|
-
"nominal current low threshold": `${this.nominalCurrentLowThreshold} mA`,
|
|
1698
|
-
"maximum flow": `${this.maximumFlow} l/h`,
|
|
1699
|
-
"high flow threshold": `${this.highFlowThreshold} l/h`,
|
|
1700
|
-
"low flow threshold": `${this.lowFlowThreshold} l/h`,
|
|
1701
|
-
"use rain sensor": this.useRainSensor,
|
|
1702
|
-
"use moisture sensor": this.useMoistureSensor
|
|
1703
|
-
}
|
|
1704
|
-
};
|
|
1705
|
-
}
|
|
1706
|
-
};
|
|
1707
|
-
IrrigationCCValveConfigReport = IrrigationCCValveConfigReport_1 = __decorate([
|
|
1708
|
-
(0, import_CommandClassDecorators.CCCommand)(import_Types.IrrigationCommand.ValveConfigReport)
|
|
1709
|
-
], IrrigationCCValveConfigReport);
|
|
1710
|
-
let IrrigationCCValveConfigGet = class IrrigationCCValveConfigGet2 extends IrrigationCC {
|
|
1711
|
-
constructor(options) {
|
|
1712
|
-
super(options);
|
|
1713
|
-
this.valveId = options.valveId;
|
|
1714
|
-
}
|
|
1715
|
-
static from(_raw, _ctx) {
|
|
1716
|
-
throw new import_safe.ZWaveError(`${this.name}: deserialization not implemented`, import_safe.ZWaveErrorCodes.Deserialization_NotImplemented);
|
|
1717
|
-
}
|
|
1718
|
-
valveId;
|
|
1719
|
-
serialize(ctx) {
|
|
1720
|
-
this.payload = import_safe2.Bytes.from([
|
|
1721
|
-
this.valveId === "master" ? 1 : 0,
|
|
1722
|
-
this.valveId === "master" ? 1 : this.valveId || 1
|
|
1723
|
-
]);
|
|
1724
|
-
return super.serialize(ctx);
|
|
1725
|
-
}
|
|
1726
|
-
toLogEntry(ctx) {
|
|
1727
|
-
return {
|
|
1728
|
-
...super.toLogEntry(ctx),
|
|
1729
|
-
message: {
|
|
1933
|
+
]);
|
|
1934
|
+
this.payload.writeUInt16BE(this.duration, 2);
|
|
1935
|
+
return super.serialize(ctx);
|
|
1936
|
+
}
|
|
1937
|
+
toLogEntry(ctx) {
|
|
1938
|
+
const message = {
|
|
1730
1939
|
"valve ID": this.valveId
|
|
1731
|
-
}
|
|
1732
|
-
|
|
1733
|
-
|
|
1734
|
-
};
|
|
1735
|
-
IrrigationCCValveConfigGet = __decorate([
|
|
1736
|
-
(0, import_CommandClassDecorators.CCCommand)(import_Types.IrrigationCommand.ValveConfigGet),
|
|
1737
|
-
(0, import_CommandClassDecorators.expectedCCResponse)(IrrigationCCValveConfigReport, testResponseForIrrigationCommandWithValveId)
|
|
1738
|
-
], IrrigationCCValveConfigGet);
|
|
1739
|
-
let IrrigationCCValveRun = class IrrigationCCValveRun2 extends IrrigationCC {
|
|
1740
|
-
constructor(options) {
|
|
1741
|
-
super(options);
|
|
1742
|
-
this.valveId = options.valveId;
|
|
1743
|
-
this.duration = options.duration;
|
|
1744
|
-
}
|
|
1745
|
-
static from(_raw, _ctx) {
|
|
1746
|
-
throw new import_safe.ZWaveError(`${this.name}: deserialization not implemented`, import_safe.ZWaveErrorCodes.Deserialization_NotImplemented);
|
|
1747
|
-
}
|
|
1748
|
-
valveId;
|
|
1749
|
-
duration;
|
|
1750
|
-
serialize(ctx) {
|
|
1751
|
-
this.payload = import_safe2.Bytes.from([
|
|
1752
|
-
this.valveId === "master" ? 1 : 0,
|
|
1753
|
-
this.valveId === "master" ? 1 : this.valveId || 1,
|
|
1754
|
-
0,
|
|
1755
|
-
0
|
|
1756
|
-
]);
|
|
1757
|
-
this.payload.writeUInt16BE(this.duration, 2);
|
|
1758
|
-
return super.serialize(ctx);
|
|
1759
|
-
}
|
|
1760
|
-
toLogEntry(ctx) {
|
|
1761
|
-
const message = {
|
|
1762
|
-
"valve ID": this.valveId
|
|
1763
|
-
};
|
|
1764
|
-
if (this.duration) {
|
|
1765
|
-
message.duration = `${this.duration} s`;
|
|
1766
|
-
} else {
|
|
1767
|
-
message.action = "turn off";
|
|
1768
|
-
}
|
|
1769
|
-
return {
|
|
1770
|
-
...super.toLogEntry(ctx),
|
|
1771
|
-
message
|
|
1772
|
-
};
|
|
1773
|
-
}
|
|
1774
|
-
};
|
|
1775
|
-
IrrigationCCValveRun = __decorate([
|
|
1776
|
-
(0, import_CommandClassDecorators.CCCommand)(import_Types.IrrigationCommand.ValveRun),
|
|
1777
|
-
(0, import_CommandClassDecorators.useSupervision)()
|
|
1778
|
-
], IrrigationCCValveRun);
|
|
1779
|
-
let IrrigationCCValveTableSet = class IrrigationCCValveTableSet2 extends IrrigationCC {
|
|
1780
|
-
constructor(options) {
|
|
1781
|
-
super(options);
|
|
1782
|
-
this.tableId = options.tableId;
|
|
1783
|
-
this.entries = options.entries;
|
|
1784
|
-
}
|
|
1785
|
-
static from(_raw, _ctx) {
|
|
1786
|
-
throw new import_safe.ZWaveError(`${this.name}: deserialization not implemented`, import_safe.ZWaveErrorCodes.Deserialization_NotImplemented);
|
|
1787
|
-
}
|
|
1788
|
-
tableId;
|
|
1789
|
-
entries;
|
|
1790
|
-
serialize(ctx) {
|
|
1791
|
-
this.payload = new import_safe2.Bytes(1 + this.entries.length * 3);
|
|
1792
|
-
this.payload[0] = this.tableId;
|
|
1793
|
-
for (let i = 0; i < this.entries.length; i++) {
|
|
1794
|
-
const entry = this.entries[i];
|
|
1795
|
-
const offset = 1 + i * 3;
|
|
1796
|
-
this.payload[offset] = entry.valveId;
|
|
1797
|
-
this.payload.writeUInt16BE(entry.duration, offset + 1);
|
|
1798
|
-
}
|
|
1799
|
-
return super.serialize(ctx);
|
|
1800
|
-
}
|
|
1801
|
-
toLogEntry(ctx) {
|
|
1802
|
-
const message = {
|
|
1803
|
-
"table ID": this.tableId
|
|
1804
|
-
};
|
|
1805
|
-
for (let i = 0; i < this.entries.length; i++) {
|
|
1806
|
-
const entry = this.entries[i];
|
|
1807
|
-
const valveLabel = (0, import_strings.padStart)(entry.valveId.toString(), 3, "0");
|
|
1808
|
-
if (entry.duration) {
|
|
1809
|
-
message[`valve ${valveLabel} duration`] = `${entry.duration} s`;
|
|
1940
|
+
};
|
|
1941
|
+
if (this.duration) {
|
|
1942
|
+
message.duration = `${this.duration} s`;
|
|
1810
1943
|
} else {
|
|
1811
|
-
message
|
|
1944
|
+
message.action = "turn off";
|
|
1812
1945
|
}
|
|
1946
|
+
return {
|
|
1947
|
+
...super.toLogEntry(ctx),
|
|
1948
|
+
message
|
|
1949
|
+
};
|
|
1813
1950
|
}
|
|
1814
|
-
|
|
1815
|
-
|
|
1816
|
-
|
|
1817
|
-
|
|
1818
|
-
|
|
1819
|
-
|
|
1820
|
-
|
|
1821
|
-
|
|
1822
|
-
|
|
1823
|
-
|
|
1824
|
-
|
|
1825
|
-
|
|
1826
|
-
|
|
1827
|
-
|
|
1828
|
-
|
|
1829
|
-
|
|
1830
|
-
|
|
1831
|
-
|
|
1832
|
-
|
|
1833
|
-
|
|
1834
|
-
|
|
1835
|
-
|
|
1836
|
-
|
|
1837
|
-
|
|
1951
|
+
};
|
|
1952
|
+
return IrrigationCCValveRun2 = _classThis;
|
|
1953
|
+
})();
|
|
1954
|
+
let IrrigationCCValveTableSet = (() => {
|
|
1955
|
+
let _classDecorators = [(0, import_CommandClassDecorators.CCCommand)(import_Types.IrrigationCommand.ValveTableSet), (0, import_CommandClassDecorators.useSupervision)()];
|
|
1956
|
+
let _classDescriptor;
|
|
1957
|
+
let _classExtraInitializers = [];
|
|
1958
|
+
let _classThis;
|
|
1959
|
+
let _classSuper = IrrigationCC;
|
|
1960
|
+
var IrrigationCCValveTableSet2 = class extends _classSuper {
|
|
1961
|
+
static {
|
|
1962
|
+
_classThis = this;
|
|
1963
|
+
}
|
|
1964
|
+
static {
|
|
1965
|
+
const _metadata = typeof Symbol === "function" && Symbol.metadata ? Object.create(_classSuper[Symbol.metadata] ?? null) : void 0;
|
|
1966
|
+
__esDecorate(null, _classDescriptor = { value: _classThis }, _classDecorators, { kind: "class", name: _classThis.name, metadata: _metadata }, null, _classExtraInitializers);
|
|
1967
|
+
IrrigationCCValveTableSet2 = _classThis = _classDescriptor.value;
|
|
1968
|
+
if (_metadata) Object.defineProperty(_classThis, Symbol.metadata, { enumerable: true, configurable: true, writable: true, value: _metadata });
|
|
1969
|
+
__runInitializers(_classThis, _classExtraInitializers);
|
|
1970
|
+
}
|
|
1971
|
+
constructor(options) {
|
|
1972
|
+
super(options);
|
|
1973
|
+
this.tableId = options.tableId;
|
|
1974
|
+
this.entries = options.entries;
|
|
1975
|
+
}
|
|
1976
|
+
static from(_raw, _ctx) {
|
|
1977
|
+
throw new import_safe.ZWaveError(`${this.name}: deserialization not implemented`, import_safe.ZWaveErrorCodes.Deserialization_NotImplemented);
|
|
1978
|
+
}
|
|
1979
|
+
tableId;
|
|
1980
|
+
entries;
|
|
1981
|
+
serialize(ctx) {
|
|
1982
|
+
this.payload = new import_safe2.Bytes(1 + this.entries.length * 3);
|
|
1983
|
+
this.payload[0] = this.tableId;
|
|
1984
|
+
for (let i = 0; i < this.entries.length; i++) {
|
|
1985
|
+
const entry = this.entries[i];
|
|
1986
|
+
const offset = 1 + i * 3;
|
|
1987
|
+
this.payload[offset] = entry.valveId;
|
|
1988
|
+
this.payload.writeUInt16BE(entry.duration, offset + 1);
|
|
1989
|
+
}
|
|
1990
|
+
return super.serialize(ctx);
|
|
1991
|
+
}
|
|
1992
|
+
toLogEntry(ctx) {
|
|
1993
|
+
const message = {
|
|
1994
|
+
"table ID": this.tableId
|
|
1995
|
+
};
|
|
1996
|
+
for (let i = 0; i < this.entries.length; i++) {
|
|
1997
|
+
const entry = this.entries[i];
|
|
1998
|
+
const valveLabel = (0, import_strings.padStart)(entry.valveId.toString(), 3, "0");
|
|
1999
|
+
if (entry.duration) {
|
|
2000
|
+
message[`valve ${valveLabel} duration`] = `${entry.duration} s`;
|
|
2001
|
+
} else {
|
|
2002
|
+
message[`valve ${valveLabel} action`] = `turn off`;
|
|
2003
|
+
}
|
|
2004
|
+
}
|
|
2005
|
+
return {
|
|
2006
|
+
...super.toLogEntry(ctx),
|
|
2007
|
+
message
|
|
2008
|
+
};
|
|
2009
|
+
}
|
|
2010
|
+
};
|
|
2011
|
+
return IrrigationCCValveTableSet2 = _classThis;
|
|
2012
|
+
})();
|
|
2013
|
+
let IrrigationCCValveTableReport = (() => {
|
|
2014
|
+
let _classDecorators = [(0, import_CommandClassDecorators.CCCommand)(import_Types.IrrigationCommand.ValveTableReport)];
|
|
2015
|
+
let _classDescriptor;
|
|
2016
|
+
let _classExtraInitializers = [];
|
|
2017
|
+
let _classThis;
|
|
2018
|
+
let _classSuper = IrrigationCC;
|
|
2019
|
+
var IrrigationCCValveTableReport2 = class extends _classSuper {
|
|
2020
|
+
static {
|
|
2021
|
+
_classThis = this;
|
|
2022
|
+
}
|
|
2023
|
+
static {
|
|
2024
|
+
const _metadata = typeof Symbol === "function" && Symbol.metadata ? Object.create(_classSuper[Symbol.metadata] ?? null) : void 0;
|
|
2025
|
+
__esDecorate(null, _classDescriptor = { value: _classThis }, _classDecorators, { kind: "class", name: _classThis.name, metadata: _metadata }, null, _classExtraInitializers);
|
|
2026
|
+
IrrigationCCValveTableReport2 = _classThis = _classDescriptor.value;
|
|
2027
|
+
if (_metadata) Object.defineProperty(_classThis, Symbol.metadata, { enumerable: true, configurable: true, writable: true, value: _metadata });
|
|
2028
|
+
__runInitializers(_classThis, _classExtraInitializers);
|
|
2029
|
+
}
|
|
2030
|
+
constructor(options) {
|
|
2031
|
+
super(options);
|
|
2032
|
+
this.tableId = options.tableId;
|
|
2033
|
+
this.entries = options.entries;
|
|
2034
|
+
}
|
|
2035
|
+
static from(raw, ctx) {
|
|
2036
|
+
(0, import_safe.validatePayload)((raw.payload.length - 1) % 3 === 0);
|
|
2037
|
+
const tableId = raw.payload[0];
|
|
2038
|
+
const entries = [];
|
|
2039
|
+
for (let offset = 1; offset < raw.payload.length; offset += 3) {
|
|
2040
|
+
entries.push({
|
|
2041
|
+
valveId: raw.payload[offset],
|
|
2042
|
+
duration: raw.payload.readUInt16BE(offset + 1)
|
|
2043
|
+
});
|
|
2044
|
+
}
|
|
2045
|
+
return new this({
|
|
2046
|
+
nodeId: ctx.sourceNodeId,
|
|
2047
|
+
tableId,
|
|
2048
|
+
entries
|
|
1838
2049
|
});
|
|
1839
2050
|
}
|
|
1840
|
-
|
|
1841
|
-
|
|
1842
|
-
|
|
1843
|
-
|
|
1844
|
-
|
|
1845
|
-
|
|
1846
|
-
|
|
1847
|
-
|
|
1848
|
-
|
|
1849
|
-
|
|
1850
|
-
|
|
1851
|
-
|
|
1852
|
-
|
|
1853
|
-
|
|
1854
|
-
const valveLabel = (0, import_strings.padStart)(entry.valveId.toString(), 3, "0");
|
|
1855
|
-
if (entry.duration) {
|
|
1856
|
-
message[`valve ${valveLabel} duration`] = `${entry.duration} s`;
|
|
1857
|
-
} else {
|
|
1858
|
-
message[`valve ${valveLabel} action`] = `turn off`;
|
|
2051
|
+
tableId;
|
|
2052
|
+
entries;
|
|
2053
|
+
toLogEntry(ctx) {
|
|
2054
|
+
const message = {
|
|
2055
|
+
"table ID": this.tableId
|
|
2056
|
+
};
|
|
2057
|
+
for (let i = 0; i < this.entries.length; i++) {
|
|
2058
|
+
const entry = this.entries[i];
|
|
2059
|
+
const valveLabel = (0, import_strings.padStart)(entry.valveId.toString(), 3, "0");
|
|
2060
|
+
if (entry.duration) {
|
|
2061
|
+
message[`valve ${valveLabel} duration`] = `${entry.duration} s`;
|
|
2062
|
+
} else {
|
|
2063
|
+
message[`valve ${valveLabel} action`] = `turn off`;
|
|
2064
|
+
}
|
|
1859
2065
|
}
|
|
2066
|
+
return {
|
|
2067
|
+
...super.toLogEntry(ctx),
|
|
2068
|
+
message
|
|
2069
|
+
};
|
|
1860
2070
|
}
|
|
1861
|
-
|
|
1862
|
-
|
|
1863
|
-
|
|
1864
|
-
};
|
|
1865
|
-
}
|
|
1866
|
-
};
|
|
1867
|
-
IrrigationCCValveTableReport = IrrigationCCValveTableReport_1 = __decorate([
|
|
1868
|
-
(0, import_CommandClassDecorators.CCCommand)(import_Types.IrrigationCommand.ValveTableReport)
|
|
1869
|
-
], IrrigationCCValveTableReport);
|
|
2071
|
+
};
|
|
2072
|
+
return IrrigationCCValveTableReport2 = _classThis;
|
|
2073
|
+
})();
|
|
1870
2074
|
function testResponseForIrrigationValveTableGet(sent, received) {
|
|
1871
2075
|
return received.tableId === sent.tableId;
|
|
1872
2076
|
}
|
|
1873
|
-
let IrrigationCCValveTableGet =
|
|
1874
|
-
|
|
1875
|
-
|
|
1876
|
-
|
|
1877
|
-
|
|
1878
|
-
|
|
1879
|
-
|
|
1880
|
-
|
|
1881
|
-
|
|
1882
|
-
serialize(ctx) {
|
|
1883
|
-
this.payload = import_safe2.Bytes.from([this.tableId]);
|
|
1884
|
-
return super.serialize(ctx);
|
|
1885
|
-
}
|
|
1886
|
-
toLogEntry(ctx) {
|
|
1887
|
-
return {
|
|
1888
|
-
...super.toLogEntry(ctx),
|
|
1889
|
-
message: {
|
|
1890
|
-
"table ID": this.tableId
|
|
1891
|
-
}
|
|
1892
|
-
};
|
|
1893
|
-
}
|
|
1894
|
-
};
|
|
1895
|
-
IrrigationCCValveTableGet = __decorate([
|
|
1896
|
-
(0, import_CommandClassDecorators.CCCommand)(import_Types.IrrigationCommand.ValveTableGet),
|
|
1897
|
-
(0, import_CommandClassDecorators.expectedCCResponse)(IrrigationCCValveTableReport, testResponseForIrrigationValveTableGet)
|
|
1898
|
-
], IrrigationCCValveTableGet);
|
|
1899
|
-
let IrrigationCCValveTableRun = class IrrigationCCValveTableRun2 extends IrrigationCC {
|
|
1900
|
-
constructor(options) {
|
|
1901
|
-
super(options);
|
|
1902
|
-
this.tableIDs = options.tableIDs;
|
|
1903
|
-
if (this.tableIDs.length < 1) {
|
|
1904
|
-
throw new import_safe.ZWaveError(`${this.constructor.name}: At least one table ID must be specified.`, import_safe.ZWaveErrorCodes.Argument_Invalid);
|
|
2077
|
+
let IrrigationCCValveTableGet = (() => {
|
|
2078
|
+
let _classDecorators = [(0, import_CommandClassDecorators.CCCommand)(import_Types.IrrigationCommand.ValveTableGet), (0, import_CommandClassDecorators.expectedCCResponse)(IrrigationCCValveTableReport, testResponseForIrrigationValveTableGet)];
|
|
2079
|
+
let _classDescriptor;
|
|
2080
|
+
let _classExtraInitializers = [];
|
|
2081
|
+
let _classThis;
|
|
2082
|
+
let _classSuper = IrrigationCC;
|
|
2083
|
+
var IrrigationCCValveTableGet2 = class extends _classSuper {
|
|
2084
|
+
static {
|
|
2085
|
+
_classThis = this;
|
|
1905
2086
|
}
|
|
1906
|
-
|
|
1907
|
-
|
|
1908
|
-
|
|
1909
|
-
|
|
1910
|
-
|
|
1911
|
-
|
|
1912
|
-
|
|
1913
|
-
|
|
1914
|
-
|
|
1915
|
-
|
|
1916
|
-
|
|
1917
|
-
|
|
1918
|
-
|
|
1919
|
-
|
|
1920
|
-
|
|
1921
|
-
|
|
1922
|
-
|
|
1923
|
-
|
|
1924
|
-
|
|
1925
|
-
|
|
1926
|
-
|
|
1927
|
-
|
|
1928
|
-
|
|
1929
|
-
|
|
1930
|
-
|
|
1931
|
-
|
|
1932
|
-
|
|
1933
|
-
|
|
1934
|
-
|
|
1935
|
-
|
|
1936
|
-
|
|
1937
|
-
|
|
1938
|
-
|
|
1939
|
-
|
|
1940
|
-
|
|
1941
|
-
|
|
1942
|
-
|
|
1943
|
-
|
|
1944
|
-
|
|
1945
|
-
|
|
2087
|
+
static {
|
|
2088
|
+
const _metadata = typeof Symbol === "function" && Symbol.metadata ? Object.create(_classSuper[Symbol.metadata] ?? null) : void 0;
|
|
2089
|
+
__esDecorate(null, _classDescriptor = { value: _classThis }, _classDecorators, { kind: "class", name: _classThis.name, metadata: _metadata }, null, _classExtraInitializers);
|
|
2090
|
+
IrrigationCCValveTableGet2 = _classThis = _classDescriptor.value;
|
|
2091
|
+
if (_metadata) Object.defineProperty(_classThis, Symbol.metadata, { enumerable: true, configurable: true, writable: true, value: _metadata });
|
|
2092
|
+
__runInitializers(_classThis, _classExtraInitializers);
|
|
2093
|
+
}
|
|
2094
|
+
constructor(options) {
|
|
2095
|
+
super(options);
|
|
2096
|
+
this.tableId = options.tableId;
|
|
2097
|
+
}
|
|
2098
|
+
static from(_raw, _ctx) {
|
|
2099
|
+
throw new import_safe.ZWaveError(`${this.name}: deserialization not implemented`, import_safe.ZWaveErrorCodes.Deserialization_NotImplemented);
|
|
2100
|
+
}
|
|
2101
|
+
tableId;
|
|
2102
|
+
serialize(ctx) {
|
|
2103
|
+
this.payload = import_safe2.Bytes.from([this.tableId]);
|
|
2104
|
+
return super.serialize(ctx);
|
|
2105
|
+
}
|
|
2106
|
+
toLogEntry(ctx) {
|
|
2107
|
+
return {
|
|
2108
|
+
...super.toLogEntry(ctx),
|
|
2109
|
+
message: {
|
|
2110
|
+
"table ID": this.tableId
|
|
2111
|
+
}
|
|
2112
|
+
};
|
|
2113
|
+
}
|
|
2114
|
+
};
|
|
2115
|
+
return IrrigationCCValveTableGet2 = _classThis;
|
|
2116
|
+
})();
|
|
2117
|
+
let IrrigationCCValveTableRun = (() => {
|
|
2118
|
+
let _classDecorators = [(0, import_CommandClassDecorators.CCCommand)(import_Types.IrrigationCommand.ValveTableRun), (0, import_CommandClassDecorators.useSupervision)()];
|
|
2119
|
+
let _classDescriptor;
|
|
2120
|
+
let _classExtraInitializers = [];
|
|
2121
|
+
let _classThis;
|
|
2122
|
+
let _classSuper = IrrigationCC;
|
|
2123
|
+
var IrrigationCCValveTableRun2 = class extends _classSuper {
|
|
2124
|
+
static {
|
|
2125
|
+
_classThis = this;
|
|
2126
|
+
}
|
|
2127
|
+
static {
|
|
2128
|
+
const _metadata = typeof Symbol === "function" && Symbol.metadata ? Object.create(_classSuper[Symbol.metadata] ?? null) : void 0;
|
|
2129
|
+
__esDecorate(null, _classDescriptor = { value: _classThis }, _classDecorators, { kind: "class", name: _classThis.name, metadata: _metadata }, null, _classExtraInitializers);
|
|
2130
|
+
IrrigationCCValveTableRun2 = _classThis = _classDescriptor.value;
|
|
2131
|
+
if (_metadata) Object.defineProperty(_classThis, Symbol.metadata, { enumerable: true, configurable: true, writable: true, value: _metadata });
|
|
2132
|
+
__runInitializers(_classThis, _classExtraInitializers);
|
|
2133
|
+
}
|
|
2134
|
+
constructor(options) {
|
|
2135
|
+
super(options);
|
|
2136
|
+
this.tableIDs = options.tableIDs;
|
|
2137
|
+
if (this.tableIDs.length < 1) {
|
|
2138
|
+
throw new import_safe.ZWaveError(`${this.constructor.name}: At least one table ID must be specified.`, import_safe.ZWaveErrorCodes.Argument_Invalid);
|
|
1946
2139
|
}
|
|
1947
|
-
}
|
|
1948
|
-
|
|
1949
|
-
};
|
|
1950
|
-
|
|
1951
|
-
|
|
1952
|
-
|
|
1953
|
-
|
|
2140
|
+
}
|
|
2141
|
+
static from(_raw, _ctx) {
|
|
2142
|
+
throw new import_safe.ZWaveError(`${this.name}: deserialization not implemented`, import_safe.ZWaveErrorCodes.Deserialization_NotImplemented);
|
|
2143
|
+
}
|
|
2144
|
+
tableIDs;
|
|
2145
|
+
serialize(ctx) {
|
|
2146
|
+
this.payload = import_safe2.Bytes.from(this.tableIDs);
|
|
2147
|
+
return super.serialize(ctx);
|
|
2148
|
+
}
|
|
2149
|
+
toLogEntry(ctx) {
|
|
2150
|
+
return {
|
|
2151
|
+
...super.toLogEntry(ctx),
|
|
2152
|
+
message: {
|
|
2153
|
+
"table IDs": this.tableIDs.map((id) => (0, import_strings.padStart)(id.toString(), 3, "0")).join(", ")
|
|
2154
|
+
}
|
|
2155
|
+
};
|
|
2156
|
+
}
|
|
2157
|
+
};
|
|
2158
|
+
return IrrigationCCValveTableRun2 = _classThis;
|
|
2159
|
+
})();
|
|
2160
|
+
let IrrigationCCSystemShutoff = (() => {
|
|
2161
|
+
let _classDecorators = [(0, import_CommandClassDecorators.CCCommand)(import_Types.IrrigationCommand.SystemShutoff), (0, import_CommandClassDecorators.useSupervision)()];
|
|
2162
|
+
let _classDescriptor;
|
|
2163
|
+
let _classExtraInitializers = [];
|
|
2164
|
+
let _classThis;
|
|
2165
|
+
let _classSuper = IrrigationCC;
|
|
2166
|
+
var IrrigationCCSystemShutoff2 = class extends _classSuper {
|
|
2167
|
+
static {
|
|
2168
|
+
_classThis = this;
|
|
2169
|
+
}
|
|
2170
|
+
static {
|
|
2171
|
+
const _metadata = typeof Symbol === "function" && Symbol.metadata ? Object.create(_classSuper[Symbol.metadata] ?? null) : void 0;
|
|
2172
|
+
__esDecorate(null, _classDescriptor = { value: _classThis }, _classDecorators, { kind: "class", name: _classThis.name, metadata: _metadata }, null, _classExtraInitializers);
|
|
2173
|
+
IrrigationCCSystemShutoff2 = _classThis = _classDescriptor.value;
|
|
2174
|
+
if (_metadata) Object.defineProperty(_classThis, Symbol.metadata, { enumerable: true, configurable: true, writable: true, value: _metadata });
|
|
2175
|
+
__runInitializers(_classThis, _classExtraInitializers);
|
|
2176
|
+
}
|
|
2177
|
+
constructor(options) {
|
|
2178
|
+
super(options);
|
|
2179
|
+
this.duration = options.duration;
|
|
2180
|
+
}
|
|
2181
|
+
static from(_raw, _ctx) {
|
|
2182
|
+
throw new import_safe.ZWaveError(`${this.name}: deserialization not implemented`, import_safe.ZWaveErrorCodes.Deserialization_NotImplemented);
|
|
2183
|
+
}
|
|
2184
|
+
duration;
|
|
2185
|
+
serialize(ctx) {
|
|
2186
|
+
this.payload = import_safe2.Bytes.from([this.duration ?? 255]);
|
|
2187
|
+
return super.serialize(ctx);
|
|
2188
|
+
}
|
|
2189
|
+
toLogEntry(ctx) {
|
|
2190
|
+
return {
|
|
2191
|
+
...super.toLogEntry(ctx),
|
|
2192
|
+
message: {
|
|
2193
|
+
duration: this.duration === 0 ? "temporarily" : this.duration === 255 || this.duration === void 0 ? "permanently" : `${this.duration} hours`
|
|
2194
|
+
}
|
|
2195
|
+
};
|
|
2196
|
+
}
|
|
2197
|
+
};
|
|
2198
|
+
return IrrigationCCSystemShutoff2 = _classThis;
|
|
2199
|
+
})();
|
|
1954
2200
|
// Annotate the CommonJS export names for ESM import in node:
|
|
1955
2201
|
0 && (module.exports = {
|
|
1956
2202
|
IrrigationCC,
|