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