@zwave-js/cc 13.10.1 → 14.0.0-beta.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/build/cc/AlarmSensorCC.d.ts +31 -20
- package/build/cc/AlarmSensorCC.d.ts.map +1 -1
- package/build/cc/AlarmSensorCC.js +106 -87
- package/build/cc/AlarmSensorCC.js.map +1 -1
- package/build/cc/AssociationCC.d.ts +38 -32
- package/build/cc/AssociationCC.d.ts.map +1 -1
- package/build/cc/AssociationCC.js +193 -176
- package/build/cc/AssociationCC.js.map +1 -1
- package/build/cc/AssociationGroupInfoCC.d.ts +42 -36
- package/build/cc/AssociationGroupInfoCC.d.ts.map +1 -1
- package/build/cc/AssociationGroupInfoCC.js +218 -200
- package/build/cc/AssociationGroupInfoCC.js.map +1 -1
- package/build/cc/BarrierOperatorCC.d.ts +41 -24
- package/build/cc/BarrierOperatorCC.d.ts.map +1 -1
- package/build/cc/BarrierOperatorCC.js +143 -109
- package/build/cc/BarrierOperatorCC.js.map +1 -1
- package/build/cc/BasicCC.d.ts +22 -23
- package/build/cc/BasicCC.d.ts.map +1 -1
- package/build/cc/BasicCC.js +83 -77
- package/build/cc/BasicCC.js.map +1 -1
- package/build/cc/BatteryCC.d.ts +22 -14
- package/build/cc/BatteryCC.d.ts.map +1 -1
- package/build/cc/BatteryCC.js +116 -87
- package/build/cc/BatteryCC.js.map +1 -1
- package/build/cc/BinarySensorCC.d.ts +22 -19
- package/build/cc/BinarySensorCC.d.ts.map +1 -1
- package/build/cc/BinarySensorCC.js +103 -93
- package/build/cc/BinarySensorCC.js.map +1 -1
- package/build/cc/BinarySwitchCC.d.ts +20 -20
- package/build/cc/BinarySwitchCC.d.ts.map +1 -1
- package/build/cc/BinarySwitchCC.js +71 -59
- package/build/cc/BinarySwitchCC.js.map +1 -1
- package/build/cc/CRC16CC.d.ts +9 -9
- package/build/cc/CRC16CC.d.ts.map +1 -1
- package/build/cc/CRC16CC.js +36 -36
- package/build/cc/CRC16CC.js.map +1 -1
- package/build/cc/CentralSceneCC.d.ts +34 -16
- package/build/cc/CentralSceneCC.d.ts.map +1 -1
- package/build/cc/CentralSceneCC.js +116 -79
- package/build/cc/CentralSceneCC.js.map +1 -1
- package/build/cc/ClimateControlScheduleCC.d.ts +38 -21
- package/build/cc/ClimateControlScheduleCC.d.ts.map +1 -1
- package/build/cc/ClimateControlScheduleCC.js +113 -81
- package/build/cc/ClimateControlScheduleCC.js.map +1 -1
- package/build/cc/ClockCC.d.ts +18 -11
- package/build/cc/ClockCC.d.ts.map +1 -1
- package/build/cc/ClockCC.js +57 -43
- package/build/cc/ClockCC.js.map +1 -1
- package/build/cc/ColorSwitchCC.d.ts +37 -33
- package/build/cc/ColorSwitchCC.d.ts.map +1 -1
- package/build/cc/ColorSwitchCC.js +216 -189
- package/build/cc/ColorSwitchCC.js.map +1 -1
- package/build/cc/ConfigurationCC.d.ts +89 -74
- package/build/cc/ConfigurationCC.d.ts.map +1 -1
- package/build/cc/ConfigurationCC.js +541 -485
- package/build/cc/ConfigurationCC.js.map +1 -1
- package/build/cc/DeviceResetLocallyCC.d.ts +3 -3
- package/build/cc/DeviceResetLocallyCC.d.ts.map +1 -1
- package/build/cc/DeviceResetLocallyCC.js +14 -14
- package/build/cc/DeviceResetLocallyCC.js.map +1 -1
- package/build/cc/DoorLockCC.d.ts +66 -27
- package/build/cc/DoorLockCC.d.ts.map +1 -1
- package/build/cc/DoorLockCC.js +288 -197
- package/build/cc/DoorLockCC.js.map +1 -1
- package/build/cc/DoorLockLoggingCC.d.ts +23 -13
- package/build/cc/DoorLockLoggingCC.d.ts.map +1 -1
- package/build/cc/DoorLockLoggingCC.js +81 -63
- package/build/cc/DoorLockLoggingCC.js.map +1 -1
- package/build/cc/EnergyProductionCC.d.ts +16 -14
- package/build/cc/EnergyProductionCC.d.ts.map +1 -1
- package/build/cc/EnergyProductionCC.js +58 -52
- package/build/cc/EnergyProductionCC.js.map +1 -1
- package/build/cc/EntryControlCC.d.ts +44 -18
- package/build/cc/EntryControlCC.d.ts.map +1 -1
- package/build/cc/EntryControlCC.js +163 -112
- package/build/cc/EntryControlCC.js.map +1 -1
- package/build/cc/FirmwareUpdateMetaDataCC.d.ts +69 -34
- package/build/cc/FirmwareUpdateMetaDataCC.d.ts.map +1 -1
- package/build/cc/FirmwareUpdateMetaDataCC.js +311 -245
- package/build/cc/FirmwareUpdateMetaDataCC.js.map +1 -1
- package/build/cc/HumidityControlModeCC.d.ts +24 -16
- package/build/cc/HumidityControlModeCC.d.ts.map +1 -1
- package/build/cc/HumidityControlModeCC.js +80 -65
- package/build/cc/HumidityControlModeCC.js.map +1 -1
- package/build/cc/HumidityControlOperatingStateCC.d.ts +11 -7
- package/build/cc/HumidityControlOperatingStateCC.d.ts.map +1 -1
- package/build/cc/HumidityControlOperatingStateCC.js +31 -22
- package/build/cc/HumidityControlOperatingStateCC.js.map +1 -1
- package/build/cc/HumidityControlSetpointCC.d.ts +68 -49
- package/build/cc/HumidityControlSetpointCC.d.ts.map +1 -1
- package/build/cc/HumidityControlSetpointCC.js +203 -181
- package/build/cc/HumidityControlSetpointCC.js.map +1 -1
- package/build/cc/InclusionControllerCC.d.ts +13 -11
- package/build/cc/InclusionControllerCC.d.ts.map +1 -1
- package/build/cc/InclusionControllerCC.js +49 -42
- package/build/cc/InclusionControllerCC.js.map +1 -1
- package/build/cc/IndicatorCC.d.ts +46 -39
- package/build/cc/IndicatorCC.d.ts.map +1 -1
- package/build/cc/IndicatorCC.js +298 -277
- package/build/cc/IndicatorCC.js.map +1 -1
- package/build/cc/IrrigationCC.d.ts +127 -57
- package/build/cc/IrrigationCC.d.ts.map +1 -1
- package/build/cc/IrrigationCC.js +496 -352
- package/build/cc/IrrigationCC.js.map +1 -1
- package/build/cc/LanguageCC.d.ts +17 -11
- package/build/cc/LanguageCC.d.ts.map +1 -1
- package/build/cc/LanguageCC.js +54 -44
- package/build/cc/LanguageCC.js.map +1 -1
- package/build/cc/LockCC.d.ts +16 -11
- package/build/cc/LockCC.d.ts.map +1 -1
- package/build/cc/LockCC.js +48 -38
- package/build/cc/LockCC.js.map +1 -1
- package/build/cc/ManufacturerProprietaryCC.d.ts +12 -11
- package/build/cc/ManufacturerProprietaryCC.d.ts.map +1 -1
- package/build/cc/ManufacturerProprietaryCC.js +45 -50
- package/build/cc/ManufacturerProprietaryCC.js.map +1 -1
- package/build/cc/ManufacturerSpecificCC.d.ts +20 -13
- package/build/cc/ManufacturerSpecificCC.d.ts.map +1 -1
- package/build/cc/ManufacturerSpecificCC.js +79 -63
- package/build/cc/ManufacturerSpecificCC.js.map +1 -1
- package/build/cc/MeterCC.d.ts +30 -26
- package/build/cc/MeterCC.d.ts.map +1 -1
- package/build/cc/MeterCC.js +236 -204
- package/build/cc/MeterCC.js.map +1 -1
- package/build/cc/MultiChannelAssociationCC.d.ts +31 -26
- package/build/cc/MultiChannelAssociationCC.d.ts.map +1 -1
- package/build/cc/MultiChannelAssociationCC.js +177 -168
- package/build/cc/MultiChannelAssociationCC.js.map +1 -1
- package/build/cc/MultiChannelCC.d.ts +70 -49
- package/build/cc/MultiChannelCC.d.ts.map +1 -1
- package/build/cc/MultiChannelCC.js +377 -318
- package/build/cc/MultiChannelCC.js.map +1 -1
- package/build/cc/MultiCommandCC.d.ts +9 -9
- package/build/cc/MultiCommandCC.d.ts.map +1 -1
- package/build/cc/MultiCommandCC.js +35 -36
- package/build/cc/MultiCommandCC.js.map +1 -1
- package/build/cc/MultilevelSensorCC.d.ts +38 -33
- package/build/cc/MultilevelSensorCC.d.ts.map +1 -1
- package/build/cc/MultilevelSensorCC.js +172 -152
- package/build/cc/MultilevelSensorCC.js.map +1 -1
- package/build/cc/MultilevelSwitchCC.d.ts +29 -25
- package/build/cc/MultilevelSwitchCC.d.ts.map +1 -1
- package/build/cc/MultilevelSwitchCC.js +147 -127
- package/build/cc/MultilevelSwitchCC.js.map +1 -1
- package/build/cc/NoOperationCC.d.ts +0 -8
- package/build/cc/NoOperationCC.d.ts.map +1 -1
- package/build/cc/NoOperationCC.js +2 -11
- package/build/cc/NoOperationCC.js.map +1 -1
- package/build/cc/NodeNamingCC.d.ts +27 -17
- package/build/cc/NodeNamingCC.d.ts.map +1 -1
- package/build/cc/NodeNamingCC.js +86 -69
- package/build/cc/NodeNamingCC.js.map +1 -1
- package/build/cc/NotificationCC.d.ts +46 -43
- package/build/cc/NotificationCC.d.ts.map +1 -1
- package/build/cc/NotificationCC.js +317 -303
- package/build/cc/NotificationCC.js.map +1 -1
- package/build/cc/PowerlevelCC.d.ts +22 -18
- package/build/cc/PowerlevelCC.d.ts.map +1 -1
- package/build/cc/PowerlevelCC.js +125 -95
- package/build/cc/PowerlevelCC.js.map +1 -1
- package/build/cc/ProtectionCC.d.ts +49 -26
- package/build/cc/ProtectionCC.d.ts.map +1 -1
- package/build/cc/ProtectionCC.js +172 -126
- package/build/cc/ProtectionCC.js.map +1 -1
- package/build/cc/SceneActivationCC.d.ts +8 -7
- package/build/cc/SceneActivationCC.d.ts.map +1 -1
- package/build/cc/SceneActivationCC.js +28 -23
- package/build/cc/SceneActivationCC.js.map +1 -1
- package/build/cc/SceneActuatorConfigurationCC.d.ts +23 -15
- package/build/cc/SceneActuatorConfigurationCC.d.ts.map +1 -1
- package/build/cc/SceneActuatorConfigurationCC.js +79 -62
- package/build/cc/SceneActuatorConfigurationCC.js.map +1 -1
- package/build/cc/SceneControllerConfigurationCC.d.ts +25 -17
- package/build/cc/SceneControllerConfigurationCC.d.ts.map +1 -1
- package/build/cc/SceneControllerConfigurationCC.js +92 -78
- package/build/cc/SceneControllerConfigurationCC.js.map +1 -1
- package/build/cc/ScheduleEntryLockCC.d.ts +86 -72
- package/build/cc/ScheduleEntryLockCC.d.ts.map +1 -1
- package/build/cc/ScheduleEntryLockCC.js +607 -455
- package/build/cc/ScheduleEntryLockCC.js.map +1 -1
- package/build/cc/Security2CC.d.ts +78 -87
- package/build/cc/Security2CC.d.ts.map +1 -1
- package/build/cc/Security2CC.js +798 -765
- package/build/cc/Security2CC.js.map +1 -1
- package/build/cc/SecurityCC.d.ts +47 -42
- package/build/cc/SecurityCC.d.ts.map +1 -1
- package/build/cc/SecurityCC.js +240 -218
- package/build/cc/SecurityCC.js.map +1 -1
- package/build/cc/SoundSwitchCC.d.ts +36 -29
- package/build/cc/SoundSwitchCC.d.ts.map +1 -1
- package/build/cc/SoundSwitchCC.js +180 -157
- package/build/cc/SoundSwitchCC.js.map +1 -1
- package/build/cc/SupervisionCC.d.ts +17 -14
- package/build/cc/SupervisionCC.d.ts.map +1 -1
- package/build/cc/SupervisionCC.js +86 -66
- package/build/cc/SupervisionCC.js.map +1 -1
- package/build/cc/ThermostatFanModeCC.d.ts +25 -15
- package/build/cc/ThermostatFanModeCC.d.ts.map +1 -1
- package/build/cc/ThermostatFanModeCC.js +79 -60
- package/build/cc/ThermostatFanModeCC.js.map +1 -1
- package/build/cc/ThermostatFanStateCC.d.ts +11 -7
- package/build/cc/ThermostatFanStateCC.d.ts.map +1 -1
- package/build/cc/ThermostatFanStateCC.js +31 -22
- package/build/cc/ThermostatFanStateCC.js.map +1 -1
- package/build/cc/ThermostatModeCC.d.ts +24 -21
- package/build/cc/ThermostatModeCC.d.ts.map +1 -1
- package/build/cc/ThermostatModeCC.js +106 -90
- package/build/cc/ThermostatModeCC.js.map +1 -1
- package/build/cc/ThermostatOperatingStateCC.d.ts +11 -7
- package/build/cc/ThermostatOperatingStateCC.d.ts.map +1 -1
- package/build/cc/ThermostatOperatingStateCC.js +31 -22
- package/build/cc/ThermostatOperatingStateCC.js.map +1 -1
- package/build/cc/ThermostatSetbackCC.d.ts +14 -13
- package/build/cc/ThermostatSetbackCC.d.ts.map +1 -1
- package/build/cc/ThermostatSetbackCC.js +64 -57
- package/build/cc/ThermostatSetbackCC.js.map +1 -1
- package/build/cc/ThermostatSetpointCC.d.ts +38 -57
- package/build/cc/ThermostatSetpointCC.d.ts.map +1 -1
- package/build/cc/ThermostatSetpointCC.js +200 -264
- package/build/cc/ThermostatSetpointCC.js.map +1 -1
- package/build/cc/TimeCC.d.ts +24 -20
- package/build/cc/TimeCC.d.ts.map +1 -1
- package/build/cc/TimeCC.js +119 -108
- package/build/cc/TimeCC.js.map +1 -1
- package/build/cc/TimeParametersCC.d.ts +18 -14
- package/build/cc/TimeParametersCC.d.ts.map +1 -1
- package/build/cc/TimeParametersCC.js +77 -69
- package/build/cc/TimeParametersCC.js.map +1 -1
- package/build/cc/TransportServiceCC.d.ts +29 -32
- package/build/cc/TransportServiceCC.d.ts.map +1 -1
- package/build/cc/TransportServiceCC.js +159 -161
- package/build/cc/TransportServiceCC.js.map +1 -1
- package/build/cc/UserCodeCC.d.ts +83 -66
- package/build/cc/UserCodeCC.d.ts.map +1 -1
- package/build/cc/UserCodeCC.js +449 -402
- package/build/cc/UserCodeCC.js.map +1 -1
- package/build/cc/VersionCC.d.ts +36 -20
- package/build/cc/VersionCC.d.ts.map +1 -1
- package/build/cc/VersionCC.js +190 -149
- package/build/cc/VersionCC.js.map +1 -1
- package/build/cc/WakeUpCC.d.ts +27 -13
- package/build/cc/WakeUpCC.d.ts.map +1 -1
- package/build/cc/WakeUpCC.js +105 -77
- package/build/cc/WakeUpCC.js.map +1 -1
- package/build/cc/WindowCoveringCC.d.ts +39 -27
- package/build/cc/WindowCoveringCC.d.ts.map +1 -1
- package/build/cc/WindowCoveringCC.js +169 -137
- package/build/cc/WindowCoveringCC.js.map +1 -1
- package/build/cc/ZWavePlusCC.d.ts +8 -7
- package/build/cc/ZWavePlusCC.d.ts.map +1 -1
- package/build/cc/ZWavePlusCC.js +44 -37
- package/build/cc/ZWavePlusCC.js.map +1 -1
- package/build/cc/ZWaveProtocolCC.d.ts +111 -84
- package/build/cc/ZWaveProtocolCC.d.ts.map +1 -1
- package/build/cc/ZWaveProtocolCC.js +583 -508
- package/build/cc/ZWaveProtocolCC.js.map +1 -1
- package/build/cc/index.d.ts +37 -34
- package/build/cc/index.d.ts.map +1 -1
- package/build/cc/index.js +6 -7
- package/build/cc/index.js.map +1 -1
- package/build/cc/manufacturerProprietary/FibaroCC.d.ts +29 -24
- package/build/cc/manufacturerProprietary/FibaroCC.d.ts.map +1 -1
- package/build/cc/manufacturerProprietary/FibaroCC.js +109 -112
- package/build/cc/manufacturerProprietary/FibaroCC.js.map +1 -1
- package/build/index.d.ts +0 -1
- package/build/index.d.ts.map +1 -1
- package/build/index.js +0 -1
- package/build/index.js.map +1 -1
- package/build/lib/API.d.ts +21 -18
- package/build/lib/API.d.ts.map +1 -1
- package/build/lib/API.js +25 -49
- package/build/lib/API.js.map +1 -1
- package/build/lib/CommandClass.d.ts +51 -89
- package/build/lib/CommandClass.d.ts.map +1 -1
- package/build/lib/CommandClass.js +177 -249
- package/build/lib/CommandClass.js.map +1 -1
- package/build/lib/EncapsulatingCommandClass.d.ts +1 -15
- package/build/lib/EncapsulatingCommandClass.d.ts.map +1 -1
- package/build/lib/EncapsulatingCommandClass.js.map +1 -1
- package/build/lib/ICommandClassContainer.d.ts +1 -8
- package/build/lib/ICommandClassContainer.d.ts.map +1 -1
- package/build/lib/ICommandClassContainer.js +0 -8
- package/build/lib/ICommandClassContainer.js.map +1 -1
- package/build/lib/Values.d.ts +3 -3
- package/build/lib/Values.d.ts.map +1 -1
- package/build/lib/_Types.d.ts.map +1 -1
- package/build/lib/_Types.js +1 -0
- package/build/lib/_Types.js.map +1 -1
- package/build/lib/utils.d.ts +14 -13
- package/build/lib/utils.d.ts.map +1 -1
- package/build/lib/utils.js +94 -92
- package/build/lib/utils.js.map +1 -1
- package/package.json +4 -5
package/build/cc/IrrigationCC.js
CHANGED
|
@@ -5,7 +5,7 @@ var __decorate = (this && this.__decorate) || function (decorators, target, key,
|
|
|
5
5
|
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
6
6
|
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
7
7
|
};
|
|
8
|
-
var IrrigationCC_1;
|
|
8
|
+
var IrrigationCC_1, IrrigationCCSystemInfoReport_1, IrrigationCCSystemStatusReport_1, IrrigationCCSystemConfigReport_1, IrrigationCCValveInfoReport_1, IrrigationCCValveConfigReport_1, IrrigationCCValveTableReport_1;
|
|
9
9
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
10
10
|
exports.IrrigationCCSystemShutoff = exports.IrrigationCCValveTableRun = exports.IrrigationCCValveTableGet = exports.IrrigationCCValveTableReport = exports.IrrigationCCValveTableSet = exports.IrrigationCCValveRun = exports.IrrigationCCValveConfigGet = exports.IrrigationCCValveConfigReport = exports.IrrigationCCValveConfigSet = exports.IrrigationCCValveInfoGet = exports.IrrigationCCValveInfoReport = exports.IrrigationCCSystemConfigGet = exports.IrrigationCCSystemConfigReport = exports.IrrigationCCSystemConfigSet = exports.IrrigationCCSystemStatusGet = exports.IrrigationCCSystemStatusReport = exports.IrrigationCCSystemInfoGet = exports.IrrigationCCSystemInfoReport = exports.IrrigationCC = exports.IrrigationCCAPI = exports.IrrigationCCValues = void 0;
|
|
11
11
|
function __assertType(argName, typeName, boundHasError) {
|
|
@@ -485,11 +485,11 @@ let IrrigationCCAPI = class IrrigationCCAPI extends API_1.CCAPI {
|
|
|
485
485
|
// eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types
|
|
486
486
|
async getSystemInfo() {
|
|
487
487
|
this.assertSupportsCommand(_Types_1.IrrigationCommand, _Types_1.IrrigationCommand.SystemInfoGet);
|
|
488
|
-
const cc = new IrrigationCCSystemInfoGet(
|
|
488
|
+
const cc = new IrrigationCCSystemInfoGet({
|
|
489
489
|
nodeId: this.endpoint.nodeId,
|
|
490
|
-
|
|
490
|
+
endpointIndex: this.endpoint.index,
|
|
491
491
|
});
|
|
492
|
-
const response = await this.
|
|
492
|
+
const response = await this.host.sendCommand(cc, this.commandOptions);
|
|
493
493
|
if (response) {
|
|
494
494
|
return (0, safe_2.pick)(response, [
|
|
495
495
|
"numValves",
|
|
@@ -502,11 +502,11 @@ let IrrigationCCAPI = class IrrigationCCAPI extends API_1.CCAPI {
|
|
|
502
502
|
// eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types
|
|
503
503
|
async getSystemStatus() {
|
|
504
504
|
this.assertSupportsCommand(_Types_1.IrrigationCommand, _Types_1.IrrigationCommand.SystemStatusGet);
|
|
505
|
-
const cc = new IrrigationCCSystemStatusGet(
|
|
505
|
+
const cc = new IrrigationCCSystemStatusGet({
|
|
506
506
|
nodeId: this.endpoint.nodeId,
|
|
507
|
-
|
|
507
|
+
endpointIndex: this.endpoint.index,
|
|
508
508
|
});
|
|
509
|
-
const response = await this.
|
|
509
|
+
const response = await this.host.sendCommand(cc, this.commandOptions);
|
|
510
510
|
if (response) {
|
|
511
511
|
return (0, safe_2.pick)(response, [
|
|
512
512
|
"systemVoltage",
|
|
@@ -530,11 +530,11 @@ let IrrigationCCAPI = class IrrigationCCAPI extends API_1.CCAPI {
|
|
|
530
530
|
// eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types
|
|
531
531
|
async getSystemConfig() {
|
|
532
532
|
this.assertSupportsCommand(_Types_1.IrrigationCommand, _Types_1.IrrigationCommand.SystemConfigGet);
|
|
533
|
-
const cc = new IrrigationCCSystemConfigGet(
|
|
533
|
+
const cc = new IrrigationCCSystemConfigGet({
|
|
534
534
|
nodeId: this.endpoint.nodeId,
|
|
535
|
-
|
|
535
|
+
endpointIndex: this.endpoint.index,
|
|
536
536
|
});
|
|
537
|
-
const response = await this.
|
|
537
|
+
const response = await this.host.sendCommand(cc, this.commandOptions);
|
|
538
538
|
if (response) {
|
|
539
539
|
return (0, safe_2.pick)(response, [
|
|
540
540
|
"masterValveDelay",
|
|
@@ -548,22 +548,22 @@ let IrrigationCCAPI = class IrrigationCCAPI extends API_1.CCAPI {
|
|
|
548
548
|
async setSystemConfig(config) {
|
|
549
549
|
__assertType("config", "IrrigationCCSystemConfigSetOptions", __assertType__IrrigationCCSystemConfigSetOptions.bind(void 0, config));
|
|
550
550
|
this.assertSupportsCommand(_Types_1.IrrigationCommand, _Types_1.IrrigationCommand.SystemConfigSet);
|
|
551
|
-
const cc = new IrrigationCCSystemConfigSet(
|
|
551
|
+
const cc = new IrrigationCCSystemConfigSet({
|
|
552
552
|
nodeId: this.endpoint.nodeId,
|
|
553
|
-
|
|
553
|
+
endpointIndex: this.endpoint.index,
|
|
554
554
|
...config,
|
|
555
555
|
});
|
|
556
|
-
return this.
|
|
556
|
+
return this.host.sendCommand(cc, this.commandOptions);
|
|
557
557
|
}
|
|
558
558
|
async getValveInfo(valveId) {
|
|
559
559
|
__assertType("valveId", "ValveId", __assertType__ValveId.bind(void 0, valveId));
|
|
560
560
|
this.assertSupportsCommand(_Types_1.IrrigationCommand, _Types_1.IrrigationCommand.ValveInfoGet);
|
|
561
|
-
const cc = new IrrigationCCValveInfoGet(
|
|
561
|
+
const cc = new IrrigationCCValveInfoGet({
|
|
562
562
|
nodeId: this.endpoint.nodeId,
|
|
563
|
-
|
|
563
|
+
endpointIndex: this.endpoint.index,
|
|
564
564
|
valveId,
|
|
565
565
|
});
|
|
566
|
-
const response = await this.
|
|
566
|
+
const response = await this.host.sendCommand(cc, this.commandOptions);
|
|
567
567
|
if (response) {
|
|
568
568
|
return (0, safe_2.pick)(response, [
|
|
569
569
|
"connected",
|
|
@@ -580,22 +580,22 @@ let IrrigationCCAPI = class IrrigationCCAPI extends API_1.CCAPI {
|
|
|
580
580
|
async setValveConfig(options) {
|
|
581
581
|
__assertType("options", "IrrigationCCValveConfigSetOptions", __assertType__IrrigationCCValveConfigSetOptions.bind(void 0, options));
|
|
582
582
|
this.assertSupportsCommand(_Types_1.IrrigationCommand, _Types_1.IrrigationCommand.ValveConfigSet);
|
|
583
|
-
const cc = new IrrigationCCValveConfigSet(
|
|
583
|
+
const cc = new IrrigationCCValveConfigSet({
|
|
584
584
|
nodeId: this.endpoint.nodeId,
|
|
585
|
-
|
|
585
|
+
endpointIndex: this.endpoint.index,
|
|
586
586
|
...options,
|
|
587
587
|
});
|
|
588
|
-
return this.
|
|
588
|
+
return this.host.sendCommand(cc, this.commandOptions);
|
|
589
589
|
}
|
|
590
590
|
async getValveConfig(valveId) {
|
|
591
591
|
__assertType("valveId", "ValveId", __assertType__ValveId.bind(void 0, valveId));
|
|
592
592
|
this.assertSupportsCommand(_Types_1.IrrigationCommand, _Types_1.IrrigationCommand.ValveConfigGet);
|
|
593
|
-
const cc = new IrrigationCCValveConfigGet(
|
|
593
|
+
const cc = new IrrigationCCValveConfigGet({
|
|
594
594
|
nodeId: this.endpoint.nodeId,
|
|
595
|
-
|
|
595
|
+
endpointIndex: this.endpoint.index,
|
|
596
596
|
valveId,
|
|
597
597
|
});
|
|
598
|
-
const response = await this.
|
|
598
|
+
const response = await this.host.sendCommand(cc, this.commandOptions);
|
|
599
599
|
if (response) {
|
|
600
600
|
return (0, safe_2.pick)(response, [
|
|
601
601
|
"nominalCurrentHighThreshold",
|
|
@@ -612,13 +612,13 @@ let IrrigationCCAPI = class IrrigationCCAPI extends API_1.CCAPI {
|
|
|
612
612
|
__assertType("valveId", "ValveId", __assertType__ValveId.bind(void 0, valveId));
|
|
613
613
|
__assertType("duration", "number", __assertType__number.bind(void 0, duration));
|
|
614
614
|
this.assertSupportsCommand(_Types_1.IrrigationCommand, _Types_1.IrrigationCommand.ValveRun);
|
|
615
|
-
const cc = new IrrigationCCValveRun(
|
|
615
|
+
const cc = new IrrigationCCValveRun({
|
|
616
616
|
nodeId: this.endpoint.nodeId,
|
|
617
|
-
|
|
617
|
+
endpointIndex: this.endpoint.index,
|
|
618
618
|
valveId,
|
|
619
619
|
duration,
|
|
620
620
|
});
|
|
621
|
-
return this.
|
|
621
|
+
return this.host.sendCommand(cc, this.commandOptions);
|
|
622
622
|
}
|
|
623
623
|
shutoffValve(valveId) {
|
|
624
624
|
__assertType("valveId", "ValveId", __assertType__ValveId.bind(void 0, valveId));
|
|
@@ -629,29 +629,29 @@ let IrrigationCCAPI = class IrrigationCCAPI extends API_1.CCAPI {
|
|
|
629
629
|
__assertType("entries", undefined, __assertType__sa__2_ea_2.bind(void 0, entries));
|
|
630
630
|
this.assertSupportsCommand(_Types_1.IrrigationCommand, _Types_1.IrrigationCommand.ValveTableSet);
|
|
631
631
|
if (!this.endpoint.virtual) {
|
|
632
|
-
const maxValveTableSize = IrrigationCC.getMaxValveTableSizeCached(this.
|
|
632
|
+
const maxValveTableSize = IrrigationCC.getMaxValveTableSizeCached(this.host, this.endpoint);
|
|
633
633
|
if (maxValveTableSize != undefined
|
|
634
634
|
&& entries.length > maxValveTableSize) {
|
|
635
635
|
throw new safe_1.ZWaveError(`The number of valve table entries must not exceed ${maxValveTableSize}.`, safe_1.ZWaveErrorCodes.Argument_Invalid);
|
|
636
636
|
}
|
|
637
637
|
}
|
|
638
|
-
const cc = new IrrigationCCValveTableSet(
|
|
638
|
+
const cc = new IrrigationCCValveTableSet({
|
|
639
639
|
nodeId: this.endpoint.nodeId,
|
|
640
|
-
|
|
640
|
+
endpointIndex: this.endpoint.index,
|
|
641
641
|
tableId,
|
|
642
642
|
entries,
|
|
643
643
|
});
|
|
644
|
-
return this.
|
|
644
|
+
return this.host.sendCommand(cc, this.commandOptions);
|
|
645
645
|
}
|
|
646
646
|
async getValveTable(tableId) {
|
|
647
647
|
__assertType("tableId", "number", __assertType__number.bind(void 0, tableId));
|
|
648
648
|
this.assertSupportsCommand(_Types_1.IrrigationCommand, _Types_1.IrrigationCommand.ValveTableGet);
|
|
649
|
-
const cc = new IrrigationCCValveTableGet(
|
|
649
|
+
const cc = new IrrigationCCValveTableGet({
|
|
650
650
|
nodeId: this.endpoint.nodeId,
|
|
651
|
-
|
|
651
|
+
endpointIndex: this.endpoint.index,
|
|
652
652
|
tableId,
|
|
653
653
|
});
|
|
654
|
-
const response = await this.
|
|
654
|
+
const response = await this.host.sendCommand(cc, this.commandOptions);
|
|
655
655
|
if (response) {
|
|
656
656
|
return response?.entries;
|
|
657
657
|
}
|
|
@@ -659,12 +659,12 @@ let IrrigationCCAPI = class IrrigationCCAPI extends API_1.CCAPI {
|
|
|
659
659
|
async runTables(tableIDs) {
|
|
660
660
|
__assertType("tableIDs", undefined, __assertType__sa__number_ea_2.bind(void 0, tableIDs));
|
|
661
661
|
this.assertSupportsCommand(_Types_1.IrrigationCommand, _Types_1.IrrigationCommand.ValveTableRun);
|
|
662
|
-
const cc = new IrrigationCCValveTableRun(
|
|
662
|
+
const cc = new IrrigationCCValveTableRun({
|
|
663
663
|
nodeId: this.endpoint.nodeId,
|
|
664
|
-
|
|
664
|
+
endpointIndex: this.endpoint.index,
|
|
665
665
|
tableIDs,
|
|
666
666
|
});
|
|
667
|
-
return this.
|
|
667
|
+
return this.host.sendCommand(cc, this.commandOptions);
|
|
668
668
|
}
|
|
669
669
|
/**
|
|
670
670
|
* Shuts off the entire system for the given duration.
|
|
@@ -673,12 +673,12 @@ let IrrigationCCAPI = class IrrigationCCAPI extends API_1.CCAPI {
|
|
|
673
673
|
async shutoffSystem(duration) {
|
|
674
674
|
__assertType("duration", "number", __assertType__number.bind(void 0, duration));
|
|
675
675
|
this.assertSupportsCommand(_Types_1.IrrigationCommand, _Types_1.IrrigationCommand.SystemShutoff);
|
|
676
|
-
const cc = new IrrigationCCSystemShutoff(
|
|
676
|
+
const cc = new IrrigationCCSystemShutoff({
|
|
677
677
|
nodeId: this.endpoint.nodeId,
|
|
678
|
-
|
|
678
|
+
endpointIndex: this.endpoint.index,
|
|
679
679
|
duration,
|
|
680
680
|
});
|
|
681
|
-
return this.
|
|
681
|
+
return this.host.sendCommand(cc, this.commandOptions);
|
|
682
682
|
}
|
|
683
683
|
/** Shuts off the entire system permanently and prevents schedules from running */
|
|
684
684
|
shutoffSystemPermanently() {
|
|
@@ -833,8 +833,8 @@ let IrrigationCC = IrrigationCC_1 = class IrrigationCC extends CommandClass_1.Co
|
|
|
833
833
|
* Returns the maximum number of valve table entries reported by the node.
|
|
834
834
|
* This only works AFTER the node has been interviewed.
|
|
835
835
|
*/
|
|
836
|
-
static getMaxValveTableSizeCached(
|
|
837
|
-
return
|
|
836
|
+
static getMaxValveTableSizeCached(ctx, endpoint) {
|
|
837
|
+
return ctx
|
|
838
838
|
.getValueDB(endpoint.nodeId)
|
|
839
839
|
.getValue(exports.IrrigationCCValues.maxValveTableSize.endpoint(endpoint.index));
|
|
840
840
|
}
|
|
@@ -842,8 +842,8 @@ let IrrigationCC = IrrigationCC_1 = class IrrigationCC extends CommandClass_1.Co
|
|
|
842
842
|
* Returns the number of zone valves reported by the node.
|
|
843
843
|
* This only works AFTER the node has been interviewed.
|
|
844
844
|
*/
|
|
845
|
-
static getNumValvesCached(
|
|
846
|
-
return
|
|
845
|
+
static getNumValvesCached(ctx, endpoint) {
|
|
846
|
+
return ctx
|
|
847
847
|
.getValueDB(endpoint.nodeId)
|
|
848
848
|
.getValue(exports.IrrigationCCValues.numValves.endpoint(endpoint.index));
|
|
849
849
|
}
|
|
@@ -851,30 +851,30 @@ let IrrigationCC = IrrigationCC_1 = class IrrigationCC extends CommandClass_1.Co
|
|
|
851
851
|
* Returns whether the node supports a master valve
|
|
852
852
|
* This only works AFTER the node has been interviewed.
|
|
853
853
|
*/
|
|
854
|
-
static supportsMasterValveCached(
|
|
855
|
-
return !!
|
|
854
|
+
static supportsMasterValveCached(ctx, endpoint) {
|
|
855
|
+
return !!ctx
|
|
856
856
|
.getValueDB(endpoint.nodeId)
|
|
857
857
|
.getValue(exports.IrrigationCCValues.supportsMasterValve.endpoint(endpoint.index));
|
|
858
858
|
}
|
|
859
|
-
async interview(
|
|
860
|
-
const node = this.getNode(
|
|
861
|
-
const endpoint = this.getEndpoint(
|
|
862
|
-
const api = API_1.CCAPI.create(safe_1.CommandClasses.Irrigation,
|
|
859
|
+
async interview(ctx) {
|
|
860
|
+
const node = this.getNode(ctx);
|
|
861
|
+
const endpoint = this.getEndpoint(ctx);
|
|
862
|
+
const api = API_1.CCAPI.create(safe_1.CommandClasses.Irrigation, ctx, endpoint).withOptions({
|
|
863
863
|
priority: safe_1.MessagePriority.NodeQuery,
|
|
864
864
|
});
|
|
865
|
-
|
|
865
|
+
ctx.logNode(node.id, {
|
|
866
866
|
endpoint: this.endpointIndex,
|
|
867
867
|
message: `Interviewing ${this.ccName}...`,
|
|
868
868
|
direction: "none",
|
|
869
869
|
});
|
|
870
|
-
|
|
870
|
+
ctx.logNode(node.id, {
|
|
871
871
|
endpoint: this.endpointIndex,
|
|
872
872
|
message: "Querying irrigation system info...",
|
|
873
873
|
direction: "outbound",
|
|
874
874
|
});
|
|
875
875
|
const systemInfo = await api.getSystemInfo();
|
|
876
876
|
if (!systemInfo) {
|
|
877
|
-
|
|
877
|
+
ctx.logNode(node.id, {
|
|
878
878
|
endpoint: this.endpointIndex,
|
|
879
879
|
message: "Time out while querying irrigation system info, skipping interview...",
|
|
880
880
|
level: "warn",
|
|
@@ -886,31 +886,31 @@ supports master valve: ${systemInfo.supportsMasterValve}
|
|
|
886
886
|
no. of valves: ${systemInfo.numValves}
|
|
887
887
|
no. of valve tables: ${systemInfo.numValveTables}
|
|
888
888
|
max. valve table size: ${systemInfo.maxValveTableSize}`;
|
|
889
|
-
|
|
889
|
+
ctx.logNode(node.id, {
|
|
890
890
|
endpoint: this.endpointIndex,
|
|
891
891
|
message: logMessage,
|
|
892
892
|
direction: "inbound",
|
|
893
893
|
});
|
|
894
894
|
// For each valve, create the values to start/stop a run
|
|
895
895
|
for (let i = 1; i <= systemInfo.numValves; i++) {
|
|
896
|
-
this.ensureMetadata(
|
|
897
|
-
this.ensureMetadata(
|
|
896
|
+
this.ensureMetadata(ctx, exports.IrrigationCCValues.valveRunDuration(i));
|
|
897
|
+
this.ensureMetadata(ctx, exports.IrrigationCCValues.valveRunStartStop(i));
|
|
898
898
|
}
|
|
899
899
|
// And create a shutoff value
|
|
900
|
-
this.ensureMetadata(
|
|
900
|
+
this.ensureMetadata(ctx, exports.IrrigationCCValues.shutoffSystem);
|
|
901
901
|
// Query current values
|
|
902
|
-
await this.refreshValues(
|
|
902
|
+
await this.refreshValues(ctx);
|
|
903
903
|
// Remember that the interview is complete
|
|
904
|
-
this.setInterviewComplete(
|
|
904
|
+
this.setInterviewComplete(ctx, true);
|
|
905
905
|
}
|
|
906
|
-
async refreshValues(
|
|
907
|
-
const node = this.getNode(
|
|
908
|
-
const endpoint = this.getEndpoint(
|
|
909
|
-
const api = API_1.CCAPI.create(safe_1.CommandClasses.Irrigation,
|
|
906
|
+
async refreshValues(ctx) {
|
|
907
|
+
const node = this.getNode(ctx);
|
|
908
|
+
const endpoint = this.getEndpoint(ctx);
|
|
909
|
+
const api = API_1.CCAPI.create(safe_1.CommandClasses.Irrigation, ctx, endpoint).withOptions({
|
|
910
910
|
priority: safe_1.MessagePriority.NodeQuery,
|
|
911
911
|
});
|
|
912
912
|
// Query the current system config
|
|
913
|
-
|
|
913
|
+
ctx.logNode(node.id, {
|
|
914
914
|
endpoint: this.endpointIndex,
|
|
915
915
|
message: "Querying irrigation system configuration...",
|
|
916
916
|
direction: "outbound",
|
|
@@ -929,7 +929,7 @@ rain sensor polarity: ${(0, safe_2.getEnumMemberName)(_Types_1.IrrigationSen
|
|
|
929
929
|
logMessage += `
|
|
930
930
|
moisture sensor polarity: ${(0, safe_2.getEnumMemberName)(_Types_1.IrrigationSensorPolarity, systemConfig.moistureSensorPolarity)}`;
|
|
931
931
|
}
|
|
932
|
-
|
|
932
|
+
ctx.logNode(node.id, {
|
|
933
933
|
endpoint: this.endpointIndex,
|
|
934
934
|
message: logMessage,
|
|
935
935
|
direction: "inbound",
|
|
@@ -937,35 +937,35 @@ moisture sensor polarity: ${(0, safe_2.getEnumMemberName)(_Types_1.IrrigationSen
|
|
|
937
937
|
}
|
|
938
938
|
// and status
|
|
939
939
|
// Query the current system config
|
|
940
|
-
|
|
940
|
+
ctx.logNode(node.id, {
|
|
941
941
|
endpoint: this.endpointIndex,
|
|
942
942
|
message: "Querying irrigation system status...",
|
|
943
943
|
direction: "outbound",
|
|
944
944
|
});
|
|
945
945
|
await api.getSystemStatus();
|
|
946
946
|
// for each valve, query the current status and configuration
|
|
947
|
-
if (IrrigationCC_1.supportsMasterValveCached(
|
|
948
|
-
|
|
947
|
+
if (IrrigationCC_1.supportsMasterValveCached(ctx, endpoint)) {
|
|
948
|
+
ctx.logNode(node.id, {
|
|
949
949
|
endpoint: this.endpointIndex,
|
|
950
950
|
message: "Querying master valve configuration...",
|
|
951
951
|
direction: "outbound",
|
|
952
952
|
});
|
|
953
953
|
await api.getValveConfig("master");
|
|
954
|
-
|
|
954
|
+
ctx.logNode(node.id, {
|
|
955
955
|
endpoint: this.endpointIndex,
|
|
956
956
|
message: "Querying master valve status...",
|
|
957
957
|
direction: "outbound",
|
|
958
958
|
});
|
|
959
959
|
await api.getValveInfo("master");
|
|
960
960
|
}
|
|
961
|
-
for (let i = 1; i <= (IrrigationCC_1.getNumValvesCached(
|
|
962
|
-
|
|
961
|
+
for (let i = 1; i <= (IrrigationCC_1.getNumValvesCached(ctx, endpoint) ?? 0); i++) {
|
|
962
|
+
ctx.logNode(node.id, {
|
|
963
963
|
endpoint: this.endpointIndex,
|
|
964
964
|
message: `Querying configuration for valve ${(0, strings_1.padStart)(i.toString(), 3, "0")}...`,
|
|
965
965
|
direction: "outbound",
|
|
966
966
|
});
|
|
967
967
|
await api.getValveConfig(i);
|
|
968
|
-
|
|
968
|
+
ctx.logNode(node.id, {
|
|
969
969
|
endpoint: this.endpointIndex,
|
|
970
970
|
message: `Querying status for valve ${(0, strings_1.padStart)(i.toString(), 3, "0")}...`,
|
|
971
971
|
direction: "outbound",
|
|
@@ -973,14 +973,14 @@ moisture sensor polarity: ${(0, safe_2.getEnumMemberName)(_Types_1.IrrigationSen
|
|
|
973
973
|
await api.getValveInfo(i);
|
|
974
974
|
}
|
|
975
975
|
}
|
|
976
|
-
translateProperty(
|
|
976
|
+
translateProperty(ctx, property, propertyKey) {
|
|
977
977
|
if (property === "master") {
|
|
978
978
|
return "Master valve";
|
|
979
979
|
}
|
|
980
980
|
else if (typeof property === "number") {
|
|
981
981
|
return `Valve ${(0, strings_1.padStart)(property.toString(), 3, "0")}`;
|
|
982
982
|
}
|
|
983
|
-
return super.translateProperty(
|
|
983
|
+
return super.translateProperty(ctx, property, propertyKey);
|
|
984
984
|
}
|
|
985
985
|
};
|
|
986
986
|
exports.IrrigationCC = IrrigationCC;
|
|
@@ -989,22 +989,36 @@ exports.IrrigationCC = IrrigationCC = IrrigationCC_1 = __decorate([
|
|
|
989
989
|
(0, CommandClassDecorators_1.implementedVersion)(1),
|
|
990
990
|
(0, CommandClassDecorators_1.ccValues)(exports.IrrigationCCValues)
|
|
991
991
|
], IrrigationCC);
|
|
992
|
-
let IrrigationCCSystemInfoReport = class IrrigationCCSystemInfoReport extends IrrigationCC {
|
|
993
|
-
constructor(
|
|
994
|
-
super(
|
|
995
|
-
|
|
996
|
-
this.supportsMasterValve =
|
|
997
|
-
this.numValves =
|
|
998
|
-
this.numValveTables =
|
|
999
|
-
this.maxValveTableSize =
|
|
992
|
+
let IrrigationCCSystemInfoReport = IrrigationCCSystemInfoReport_1 = class IrrigationCCSystemInfoReport extends IrrigationCC {
|
|
993
|
+
constructor(options) {
|
|
994
|
+
super(options);
|
|
995
|
+
// TODO: Check implementation:
|
|
996
|
+
this.supportsMasterValve = options.supportsMasterValve;
|
|
997
|
+
this.numValves = options.numValves;
|
|
998
|
+
this.numValveTables = options.numValveTables;
|
|
999
|
+
this.maxValveTableSize = options.maxValveTableSize;
|
|
1000
|
+
}
|
|
1001
|
+
static from(raw, ctx) {
|
|
1002
|
+
(0, safe_1.validatePayload)(raw.payload.length >= 4);
|
|
1003
|
+
const supportsMasterValve = !!(raw.payload[0] & 0x01);
|
|
1004
|
+
const numValves = raw.payload[1];
|
|
1005
|
+
const numValveTables = raw.payload[2];
|
|
1006
|
+
const maxValveTableSize = raw.payload[3] & 0b1111;
|
|
1007
|
+
return new IrrigationCCSystemInfoReport_1({
|
|
1008
|
+
nodeId: ctx.sourceNodeId,
|
|
1009
|
+
supportsMasterValve,
|
|
1010
|
+
numValves,
|
|
1011
|
+
numValveTables,
|
|
1012
|
+
maxValveTableSize,
|
|
1013
|
+
});
|
|
1000
1014
|
}
|
|
1001
1015
|
numValves;
|
|
1002
1016
|
numValveTables;
|
|
1003
1017
|
supportsMasterValve;
|
|
1004
1018
|
maxValveTableSize;
|
|
1005
|
-
toLogEntry(
|
|
1019
|
+
toLogEntry(ctx) {
|
|
1006
1020
|
return {
|
|
1007
|
-
...super.toLogEntry(
|
|
1021
|
+
...super.toLogEntry(ctx),
|
|
1008
1022
|
message: {
|
|
1009
1023
|
"supports master valve": this.supportsMasterValve,
|
|
1010
1024
|
"no. of valves": this.numValves,
|
|
@@ -1027,7 +1041,7 @@ __decorate([
|
|
|
1027
1041
|
__decorate([
|
|
1028
1042
|
(0, CommandClassDecorators_1.ccValue)(exports.IrrigationCCValues.maxValveTableSize)
|
|
1029
1043
|
], IrrigationCCSystemInfoReport.prototype, "maxValveTableSize", void 0);
|
|
1030
|
-
exports.IrrigationCCSystemInfoReport = IrrigationCCSystemInfoReport = __decorate([
|
|
1044
|
+
exports.IrrigationCCSystemInfoReport = IrrigationCCSystemInfoReport = IrrigationCCSystemInfoReport_1 = __decorate([
|
|
1031
1045
|
(0, CommandClassDecorators_1.CCCommand)(_Types_1.IrrigationCommand.SystemInfoReport)
|
|
1032
1046
|
], IrrigationCCSystemInfoReport);
|
|
1033
1047
|
let IrrigationCCSystemInfoGet = class IrrigationCCSystemInfoGet extends IrrigationCC {
|
|
@@ -1037,41 +1051,80 @@ exports.IrrigationCCSystemInfoGet = IrrigationCCSystemInfoGet = __decorate([
|
|
|
1037
1051
|
(0, CommandClassDecorators_1.CCCommand)(_Types_1.IrrigationCommand.SystemInfoGet),
|
|
1038
1052
|
(0, CommandClassDecorators_1.expectedCCResponse)(IrrigationCCSystemInfoReport)
|
|
1039
1053
|
], IrrigationCCSystemInfoGet);
|
|
1040
|
-
let IrrigationCCSystemStatusReport = class IrrigationCCSystemStatusReport extends IrrigationCC {
|
|
1041
|
-
constructor(
|
|
1042
|
-
super(
|
|
1043
|
-
|
|
1044
|
-
this.systemVoltage =
|
|
1045
|
-
this.flowSensorActive =
|
|
1046
|
-
this.pressureSensorActive =
|
|
1047
|
-
this.rainSensorActive =
|
|
1048
|
-
this.moistureSensorActive =
|
|
1054
|
+
let IrrigationCCSystemStatusReport = IrrigationCCSystemStatusReport_1 = class IrrigationCCSystemStatusReport extends IrrigationCC {
|
|
1055
|
+
constructor(options) {
|
|
1056
|
+
super(options);
|
|
1057
|
+
// TODO: Check implementation:
|
|
1058
|
+
this.systemVoltage = options.systemVoltage;
|
|
1059
|
+
this.flowSensorActive = options.flowSensorActive;
|
|
1060
|
+
this.pressureSensorActive = options.pressureSensorActive;
|
|
1061
|
+
this.rainSensorActive = options.rainSensorActive;
|
|
1062
|
+
this.moistureSensorActive = options.moistureSensorActive;
|
|
1063
|
+
this.flow = options.flow;
|
|
1064
|
+
this.pressure = options.pressure;
|
|
1065
|
+
this.shutoffDuration = options.shutoffDuration;
|
|
1066
|
+
this.errorNotProgrammed = options.errorNotProgrammed;
|
|
1067
|
+
this.errorEmergencyShutdown = options.errorEmergencyShutdown;
|
|
1068
|
+
this.errorHighPressure = options.errorHighPressure;
|
|
1069
|
+
this.errorLowPressure = options.errorLowPressure;
|
|
1070
|
+
this.errorValve = options.errorValve;
|
|
1071
|
+
this.masterValveOpen = options.masterValveOpen;
|
|
1072
|
+
this.firstOpenZoneId = options.firstOpenZoneId;
|
|
1073
|
+
}
|
|
1074
|
+
static from(raw, ctx) {
|
|
1075
|
+
(0, safe_1.validatePayload)(raw.payload.length >= 2);
|
|
1076
|
+
const systemVoltage = raw.payload[0];
|
|
1077
|
+
const flowSensorActive = !!(raw.payload[1] & 0x01);
|
|
1078
|
+
const pressureSensorActive = !!(raw.payload[1] & 0x02);
|
|
1079
|
+
const rainSensorActive = !!(raw.payload[1] & 0x04);
|
|
1080
|
+
const moistureSensorActive = !!(raw.payload[1] & 0x08);
|
|
1049
1081
|
let offset = 2;
|
|
1082
|
+
let flow;
|
|
1050
1083
|
{
|
|
1051
|
-
const { value, scale, bytesRead } = (0, safe_1.parseFloatWithScale)(
|
|
1084
|
+
const { value, scale, bytesRead } = (0, safe_1.parseFloatWithScale)(raw.payload.subarray(offset));
|
|
1052
1085
|
(0, safe_1.validatePayload)(scale === 0);
|
|
1053
|
-
if (
|
|
1054
|
-
|
|
1086
|
+
if (flowSensorActive)
|
|
1087
|
+
flow = value;
|
|
1055
1088
|
offset += bytesRead;
|
|
1056
1089
|
}
|
|
1090
|
+
let pressure;
|
|
1057
1091
|
{
|
|
1058
|
-
const { value, scale, bytesRead } = (0, safe_1.parseFloatWithScale)(
|
|
1092
|
+
const { value, scale, bytesRead } = (0, safe_1.parseFloatWithScale)(raw.payload.subarray(offset));
|
|
1059
1093
|
(0, safe_1.validatePayload)(scale === 0);
|
|
1060
|
-
if (
|
|
1061
|
-
|
|
1094
|
+
if (pressureSensorActive)
|
|
1095
|
+
pressure = value;
|
|
1062
1096
|
offset += bytesRead;
|
|
1063
1097
|
}
|
|
1064
|
-
(0, safe_1.validatePayload)(
|
|
1065
|
-
|
|
1066
|
-
|
|
1067
|
-
|
|
1068
|
-
|
|
1069
|
-
|
|
1070
|
-
|
|
1071
|
-
|
|
1072
|
-
|
|
1073
|
-
|
|
1074
|
-
|
|
1098
|
+
(0, safe_1.validatePayload)(raw.payload.length >= offset + 4);
|
|
1099
|
+
const shutoffDuration = raw.payload[offset];
|
|
1100
|
+
const errorNotProgrammed = !!(raw.payload[offset + 1] & 0x01);
|
|
1101
|
+
const errorEmergencyShutdown = !!(raw.payload[offset + 1] & 0x02);
|
|
1102
|
+
const errorHighPressure = !!(raw.payload[offset + 1] & 0x04);
|
|
1103
|
+
const errorLowPressure = !!(raw.payload[offset + 1] & 0x08);
|
|
1104
|
+
const errorValve = !!(raw.payload[offset + 1] & 0x10);
|
|
1105
|
+
const masterValveOpen = !!(raw.payload[offset + 2] & 0x01);
|
|
1106
|
+
let firstOpenZoneId;
|
|
1107
|
+
if (raw.payload[offset + 3]) {
|
|
1108
|
+
firstOpenZoneId = raw.payload[offset + 3];
|
|
1109
|
+
}
|
|
1110
|
+
return new IrrigationCCSystemStatusReport_1({
|
|
1111
|
+
nodeId: ctx.sourceNodeId,
|
|
1112
|
+
systemVoltage,
|
|
1113
|
+
flowSensorActive,
|
|
1114
|
+
pressureSensorActive,
|
|
1115
|
+
rainSensorActive,
|
|
1116
|
+
moistureSensorActive,
|
|
1117
|
+
flow,
|
|
1118
|
+
pressure,
|
|
1119
|
+
shutoffDuration,
|
|
1120
|
+
errorNotProgrammed,
|
|
1121
|
+
errorEmergencyShutdown,
|
|
1122
|
+
errorHighPressure,
|
|
1123
|
+
errorLowPressure,
|
|
1124
|
+
errorValve,
|
|
1125
|
+
masterValveOpen,
|
|
1126
|
+
firstOpenZoneId,
|
|
1127
|
+
});
|
|
1075
1128
|
}
|
|
1076
1129
|
systemVoltage;
|
|
1077
1130
|
flowSensorActive;
|
|
@@ -1088,7 +1141,7 @@ let IrrigationCCSystemStatusReport = class IrrigationCCSystemStatusReport extend
|
|
|
1088
1141
|
errorValve;
|
|
1089
1142
|
masterValveOpen;
|
|
1090
1143
|
firstOpenZoneId;
|
|
1091
|
-
toLogEntry(
|
|
1144
|
+
toLogEntry(ctx) {
|
|
1092
1145
|
const message = {
|
|
1093
1146
|
"system voltage": `${this.systemVoltage} V`,
|
|
1094
1147
|
"active sensors": [
|
|
@@ -1128,7 +1181,7 @@ let IrrigationCCSystemStatusReport = class IrrigationCCSystemStatusReport extend
|
|
|
1128
1181
|
message.errors = errors.map((e) => `\n· ${e}`).join("");
|
|
1129
1182
|
}
|
|
1130
1183
|
return {
|
|
1131
|
-
...super.toLogEntry(
|
|
1184
|
+
...super.toLogEntry(ctx),
|
|
1132
1185
|
message,
|
|
1133
1186
|
};
|
|
1134
1187
|
}
|
|
@@ -1179,7 +1232,7 @@ __decorate([
|
|
|
1179
1232
|
__decorate([
|
|
1180
1233
|
(0, CommandClassDecorators_1.ccValue)(exports.IrrigationCCValues.firstOpenZoneId)
|
|
1181
1234
|
], IrrigationCCSystemStatusReport.prototype, "firstOpenZoneId", void 0);
|
|
1182
|
-
exports.IrrigationCCSystemStatusReport = IrrigationCCSystemStatusReport = __decorate([
|
|
1235
|
+
exports.IrrigationCCSystemStatusReport = IrrigationCCSystemStatusReport = IrrigationCCSystemStatusReport_1 = __decorate([
|
|
1183
1236
|
(0, CommandClassDecorators_1.CCCommand)(_Types_1.IrrigationCommand.SystemStatusReport)
|
|
1184
1237
|
], IrrigationCCSystemStatusReport);
|
|
1185
1238
|
let IrrigationCCSystemStatusGet = class IrrigationCCSystemStatusGet extends IrrigationCC {
|
|
@@ -1190,26 +1243,27 @@ exports.IrrigationCCSystemStatusGet = IrrigationCCSystemStatusGet = __decorate([
|
|
|
1190
1243
|
(0, CommandClassDecorators_1.expectedCCResponse)(IrrigationCCSystemStatusReport)
|
|
1191
1244
|
], IrrigationCCSystemStatusGet);
|
|
1192
1245
|
let IrrigationCCSystemConfigSet = class IrrigationCCSystemConfigSet extends IrrigationCC {
|
|
1193
|
-
constructor(
|
|
1194
|
-
super(
|
|
1195
|
-
|
|
1196
|
-
|
|
1197
|
-
|
|
1198
|
-
|
|
1199
|
-
|
|
1200
|
-
|
|
1201
|
-
|
|
1202
|
-
|
|
1203
|
-
|
|
1204
|
-
|
|
1205
|
-
|
|
1246
|
+
constructor(options) {
|
|
1247
|
+
super(options);
|
|
1248
|
+
this.masterValveDelay = options.masterValveDelay;
|
|
1249
|
+
this.highPressureThreshold = options.highPressureThreshold;
|
|
1250
|
+
this.lowPressureThreshold = options.lowPressureThreshold;
|
|
1251
|
+
this.rainSensorPolarity = options.rainSensorPolarity;
|
|
1252
|
+
this.moistureSensorPolarity = options.moistureSensorPolarity;
|
|
1253
|
+
}
|
|
1254
|
+
static from(_raw, _ctx) {
|
|
1255
|
+
// TODO: Deserialize payload
|
|
1256
|
+
throw new safe_1.ZWaveError(`${this.name}: deserialization not implemented`, safe_1.ZWaveErrorCodes.Deserialization_NotImplemented);
|
|
1257
|
+
// return new IrrigationCCSystemConfigSet({
|
|
1258
|
+
// nodeId: ctx.sourceNodeId,
|
|
1259
|
+
// });
|
|
1206
1260
|
}
|
|
1207
1261
|
masterValveDelay;
|
|
1208
1262
|
highPressureThreshold;
|
|
1209
1263
|
lowPressureThreshold;
|
|
1210
1264
|
rainSensorPolarity;
|
|
1211
1265
|
moistureSensorPolarity;
|
|
1212
|
-
serialize() {
|
|
1266
|
+
serialize(ctx) {
|
|
1213
1267
|
let polarity = 0;
|
|
1214
1268
|
if (this.rainSensorPolarity != undefined)
|
|
1215
1269
|
polarity |= 0b1;
|
|
@@ -1226,9 +1280,9 @@ let IrrigationCCSystemConfigSet = class IrrigationCCSystemConfigSet extends Irri
|
|
|
1226
1280
|
(0, safe_1.encodeFloatWithScale)(this.lowPressureThreshold, 0 /* kPa */),
|
|
1227
1281
|
Buffer.from([polarity]),
|
|
1228
1282
|
]);
|
|
1229
|
-
return super.serialize();
|
|
1283
|
+
return super.serialize(ctx);
|
|
1230
1284
|
}
|
|
1231
|
-
toLogEntry(
|
|
1285
|
+
toLogEntry(ctx) {
|
|
1232
1286
|
const message = {
|
|
1233
1287
|
"master valve delay": `${this.masterValveDelay} s`,
|
|
1234
1288
|
"high pressure threshold": `${this.highPressureThreshold} kPa`,
|
|
@@ -1241,7 +1295,7 @@ let IrrigationCCSystemConfigSet = class IrrigationCCSystemConfigSet extends Irri
|
|
|
1241
1295
|
message["moisture sensor polarity"] = (0, safe_2.getEnumMemberName)(_Types_1.IrrigationSensorPolarity, this.moistureSensorPolarity);
|
|
1242
1296
|
}
|
|
1243
1297
|
return {
|
|
1244
|
-
...super.toLogEntry(
|
|
1298
|
+
...super.toLogEntry(ctx),
|
|
1245
1299
|
message,
|
|
1246
1300
|
};
|
|
1247
1301
|
}
|
|
@@ -1251,38 +1305,58 @@ exports.IrrigationCCSystemConfigSet = IrrigationCCSystemConfigSet = __decorate([
|
|
|
1251
1305
|
(0, CommandClassDecorators_1.CCCommand)(_Types_1.IrrigationCommand.SystemConfigSet),
|
|
1252
1306
|
(0, CommandClassDecorators_1.useSupervision)()
|
|
1253
1307
|
], IrrigationCCSystemConfigSet);
|
|
1254
|
-
let IrrigationCCSystemConfigReport = class IrrigationCCSystemConfigReport extends IrrigationCC {
|
|
1255
|
-
constructor(
|
|
1256
|
-
super(
|
|
1257
|
-
|
|
1258
|
-
this.masterValveDelay =
|
|
1308
|
+
let IrrigationCCSystemConfigReport = IrrigationCCSystemConfigReport_1 = class IrrigationCCSystemConfigReport extends IrrigationCC {
|
|
1309
|
+
constructor(options) {
|
|
1310
|
+
super(options);
|
|
1311
|
+
// TODO: Check implementation:
|
|
1312
|
+
this.masterValveDelay = options.masterValveDelay;
|
|
1313
|
+
this.highPressureThreshold = options.highPressureThreshold;
|
|
1314
|
+
this.lowPressureThreshold = options.lowPressureThreshold;
|
|
1315
|
+
this.rainSensorPolarity = options.rainSensorPolarity;
|
|
1316
|
+
this.moistureSensorPolarity = options.moistureSensorPolarity;
|
|
1317
|
+
}
|
|
1318
|
+
static from(raw, ctx) {
|
|
1319
|
+
(0, safe_1.validatePayload)(raw.payload.length >= 2);
|
|
1320
|
+
const masterValveDelay = raw.payload[0];
|
|
1259
1321
|
let offset = 1;
|
|
1322
|
+
let highPressureThreshold;
|
|
1260
1323
|
{
|
|
1261
|
-
const { value, scale, bytesRead } = (0, safe_1.parseFloatWithScale)(
|
|
1324
|
+
const { value, scale, bytesRead } = (0, safe_1.parseFloatWithScale)(raw.payload.subarray(offset));
|
|
1262
1325
|
(0, safe_1.validatePayload)(scale === 0 /* kPa */);
|
|
1263
|
-
|
|
1326
|
+
highPressureThreshold = value;
|
|
1264
1327
|
offset += bytesRead;
|
|
1265
1328
|
}
|
|
1329
|
+
let lowPressureThreshold;
|
|
1266
1330
|
{
|
|
1267
|
-
const { value, scale, bytesRead } = (0, safe_1.parseFloatWithScale)(
|
|
1331
|
+
const { value, scale, bytesRead } = (0, safe_1.parseFloatWithScale)(raw.payload.subarray(offset));
|
|
1268
1332
|
(0, safe_1.validatePayload)(scale === 0 /* kPa */);
|
|
1269
|
-
|
|
1333
|
+
lowPressureThreshold = value;
|
|
1270
1334
|
offset += bytesRead;
|
|
1271
1335
|
}
|
|
1272
|
-
(0, safe_1.validatePayload)(
|
|
1273
|
-
const polarity =
|
|
1336
|
+
(0, safe_1.validatePayload)(raw.payload.length >= offset + 1);
|
|
1337
|
+
const polarity = raw.payload[offset];
|
|
1338
|
+
let rainSensorPolarity;
|
|
1339
|
+
let moistureSensorPolarity;
|
|
1274
1340
|
if (!!(polarity & 0b1000_0000)) {
|
|
1275
1341
|
// The valid bit is set
|
|
1276
|
-
|
|
1277
|
-
|
|
1278
|
-
}
|
|
1342
|
+
rainSensorPolarity = polarity & 0b1;
|
|
1343
|
+
moistureSensorPolarity = (polarity & 0b10) >>> 1;
|
|
1344
|
+
}
|
|
1345
|
+
return new IrrigationCCSystemConfigReport_1({
|
|
1346
|
+
nodeId: ctx.sourceNodeId,
|
|
1347
|
+
masterValveDelay,
|
|
1348
|
+
highPressureThreshold,
|
|
1349
|
+
lowPressureThreshold,
|
|
1350
|
+
rainSensorPolarity,
|
|
1351
|
+
moistureSensorPolarity,
|
|
1352
|
+
});
|
|
1279
1353
|
}
|
|
1280
1354
|
masterValveDelay;
|
|
1281
1355
|
highPressureThreshold;
|
|
1282
1356
|
lowPressureThreshold;
|
|
1283
1357
|
rainSensorPolarity;
|
|
1284
1358
|
moistureSensorPolarity;
|
|
1285
|
-
toLogEntry(
|
|
1359
|
+
toLogEntry(ctx) {
|
|
1286
1360
|
const message = {
|
|
1287
1361
|
"master valve delay": `${this.masterValveDelay} s`,
|
|
1288
1362
|
"high pressure threshold": `${this.highPressureThreshold} kPa`,
|
|
@@ -1295,7 +1369,7 @@ let IrrigationCCSystemConfigReport = class IrrigationCCSystemConfigReport extend
|
|
|
1295
1369
|
message["moisture sensor polarity"] = (0, safe_2.getEnumMemberName)(_Types_1.IrrigationSensorPolarity, this.moistureSensorPolarity);
|
|
1296
1370
|
}
|
|
1297
1371
|
return {
|
|
1298
|
-
...super.toLogEntry(
|
|
1372
|
+
...super.toLogEntry(ctx),
|
|
1299
1373
|
message,
|
|
1300
1374
|
};
|
|
1301
1375
|
}
|
|
@@ -1316,7 +1390,7 @@ __decorate([
|
|
|
1316
1390
|
__decorate([
|
|
1317
1391
|
(0, CommandClassDecorators_1.ccValue)(exports.IrrigationCCValues.moistureSensorPolarity)
|
|
1318
1392
|
], IrrigationCCSystemConfigReport.prototype, "moistureSensorPolarity", void 0);
|
|
1319
|
-
exports.IrrigationCCSystemConfigReport = IrrigationCCSystemConfigReport = __decorate([
|
|
1393
|
+
exports.IrrigationCCSystemConfigReport = IrrigationCCSystemConfigReport = IrrigationCCSystemConfigReport_1 = __decorate([
|
|
1320
1394
|
(0, CommandClassDecorators_1.CCCommand)(_Types_1.IrrigationCommand.SystemConfigReport)
|
|
1321
1395
|
], IrrigationCCSystemConfigReport);
|
|
1322
1396
|
let IrrigationCCSystemConfigGet = class IrrigationCCSystemConfigGet extends IrrigationCC {
|
|
@@ -1326,26 +1400,54 @@ exports.IrrigationCCSystemConfigGet = IrrigationCCSystemConfigGet = __decorate([
|
|
|
1326
1400
|
(0, CommandClassDecorators_1.CCCommand)(_Types_1.IrrigationCommand.SystemConfigGet),
|
|
1327
1401
|
(0, CommandClassDecorators_1.expectedCCResponse)(IrrigationCCSystemConfigReport)
|
|
1328
1402
|
], IrrigationCCSystemConfigGet);
|
|
1329
|
-
let IrrigationCCValveInfoReport = class IrrigationCCValveInfoReport extends IrrigationCC {
|
|
1330
|
-
constructor(
|
|
1331
|
-
super(
|
|
1332
|
-
|
|
1333
|
-
|
|
1334
|
-
|
|
1403
|
+
let IrrigationCCValveInfoReport = IrrigationCCValveInfoReport_1 = class IrrigationCCValveInfoReport extends IrrigationCC {
|
|
1404
|
+
constructor(options) {
|
|
1405
|
+
super(options);
|
|
1406
|
+
// TODO: Check implementation:
|
|
1407
|
+
this.valveId = options.valveId;
|
|
1408
|
+
this.connected = options.connected;
|
|
1409
|
+
this.nominalCurrent = options.nominalCurrent;
|
|
1410
|
+
this.errorShortCircuit = options.errorShortCircuit;
|
|
1411
|
+
this.errorHighCurrent = options.errorHighCurrent;
|
|
1412
|
+
this.errorLowCurrent = options.errorLowCurrent;
|
|
1413
|
+
this.errorMaximumFlow = options.errorMaximumFlow;
|
|
1414
|
+
this.errorHighFlow = options.errorHighFlow;
|
|
1415
|
+
this.errorLowFlow = options.errorLowFlow;
|
|
1416
|
+
}
|
|
1417
|
+
static from(raw, ctx) {
|
|
1418
|
+
(0, safe_1.validatePayload)(raw.payload.length >= 4);
|
|
1419
|
+
let valveId;
|
|
1420
|
+
if ((raw.payload[0] & 0b1) === _Types_1.ValveType.MasterValve) {
|
|
1421
|
+
valveId = "master";
|
|
1335
1422
|
}
|
|
1336
1423
|
else {
|
|
1337
|
-
|
|
1338
|
-
}
|
|
1339
|
-
|
|
1340
|
-
|
|
1341
|
-
|
|
1342
|
-
|
|
1343
|
-
|
|
1344
|
-
|
|
1345
|
-
|
|
1346
|
-
|
|
1347
|
-
|
|
1348
|
-
|
|
1424
|
+
valveId = raw.payload[1];
|
|
1425
|
+
}
|
|
1426
|
+
const connected = !!(raw.payload[0] & 0b10);
|
|
1427
|
+
const nominalCurrent = 10 * raw.payload[2];
|
|
1428
|
+
const errorShortCircuit = !!(raw.payload[3] & 0b1);
|
|
1429
|
+
const errorHighCurrent = !!(raw.payload[3] & 0b10);
|
|
1430
|
+
const errorLowCurrent = !!(raw.payload[3] & 0b100);
|
|
1431
|
+
let errorMaximumFlow;
|
|
1432
|
+
let errorHighFlow;
|
|
1433
|
+
let errorLowFlow;
|
|
1434
|
+
if (valveId === "master") {
|
|
1435
|
+
errorMaximumFlow = !!(raw.payload[3] & 0b1000);
|
|
1436
|
+
errorHighFlow = !!(raw.payload[3] & 0b1_0000);
|
|
1437
|
+
errorLowFlow = !!(raw.payload[3] & 0b10_0000);
|
|
1438
|
+
}
|
|
1439
|
+
return new IrrigationCCValveInfoReport_1({
|
|
1440
|
+
nodeId: ctx.sourceNodeId,
|
|
1441
|
+
valveId,
|
|
1442
|
+
connected,
|
|
1443
|
+
nominalCurrent,
|
|
1444
|
+
errorShortCircuit,
|
|
1445
|
+
errorHighCurrent,
|
|
1446
|
+
errorLowCurrent,
|
|
1447
|
+
errorMaximumFlow,
|
|
1448
|
+
errorHighFlow,
|
|
1449
|
+
errorLowFlow,
|
|
1450
|
+
});
|
|
1349
1451
|
}
|
|
1350
1452
|
valveId;
|
|
1351
1453
|
connected;
|
|
@@ -1356,47 +1458,47 @@ let IrrigationCCValveInfoReport = class IrrigationCCValveInfoReport extends Irri
|
|
|
1356
1458
|
errorMaximumFlow;
|
|
1357
1459
|
errorHighFlow;
|
|
1358
1460
|
errorLowFlow;
|
|
1359
|
-
persistValues(
|
|
1360
|
-
if (!super.persistValues(
|
|
1461
|
+
persistValues(ctx) {
|
|
1462
|
+
if (!super.persistValues(ctx))
|
|
1361
1463
|
return false;
|
|
1362
1464
|
// connected
|
|
1363
1465
|
const valveConnectedValue = exports.IrrigationCCValues.valveConnected(this.valveId);
|
|
1364
|
-
this.ensureMetadata(
|
|
1365
|
-
this.setValue(
|
|
1466
|
+
this.ensureMetadata(ctx, valveConnectedValue);
|
|
1467
|
+
this.setValue(ctx, valveConnectedValue, this.connected);
|
|
1366
1468
|
// nominalCurrent
|
|
1367
1469
|
const nominalCurrentValue = exports.IrrigationCCValues.nominalCurrent(this.valveId);
|
|
1368
|
-
this.ensureMetadata(
|
|
1369
|
-
this.setValue(
|
|
1470
|
+
this.ensureMetadata(ctx, nominalCurrentValue);
|
|
1471
|
+
this.setValue(ctx, nominalCurrentValue, this.nominalCurrent);
|
|
1370
1472
|
// errorShortCircuit
|
|
1371
1473
|
const errorShortCircuitValue = exports.IrrigationCCValues.errorShortCircuit(this.valveId);
|
|
1372
|
-
this.ensureMetadata(
|
|
1373
|
-
this.setValue(
|
|
1474
|
+
this.ensureMetadata(ctx, errorShortCircuitValue);
|
|
1475
|
+
this.setValue(ctx, errorShortCircuitValue, this.errorShortCircuit);
|
|
1374
1476
|
// errorHighCurrent
|
|
1375
1477
|
const errorHighCurrentValue = exports.IrrigationCCValues.errorHighCurrent(this.valveId);
|
|
1376
|
-
this.ensureMetadata(
|
|
1377
|
-
this.setValue(
|
|
1478
|
+
this.ensureMetadata(ctx, errorHighCurrentValue);
|
|
1479
|
+
this.setValue(ctx, errorHighCurrentValue, this.errorHighCurrent);
|
|
1378
1480
|
// errorLowCurrent
|
|
1379
1481
|
const errorLowCurrentValue = exports.IrrigationCCValues.errorLowCurrent(this.valveId);
|
|
1380
|
-
this.ensureMetadata(
|
|
1381
|
-
this.setValue(
|
|
1482
|
+
this.ensureMetadata(ctx, errorLowCurrentValue);
|
|
1483
|
+
this.setValue(ctx, errorLowCurrentValue, this.errorLowCurrent);
|
|
1382
1484
|
if (this.errorMaximumFlow != undefined) {
|
|
1383
1485
|
const errorMaximumFlowValue = exports.IrrigationCCValues.errorMaximumFlow(this.valveId);
|
|
1384
|
-
this.ensureMetadata(
|
|
1385
|
-
this.setValue(
|
|
1486
|
+
this.ensureMetadata(ctx, errorMaximumFlowValue);
|
|
1487
|
+
this.setValue(ctx, errorMaximumFlowValue, this.errorMaximumFlow);
|
|
1386
1488
|
}
|
|
1387
1489
|
if (this.errorHighFlow != undefined) {
|
|
1388
1490
|
const errorHighFlowValue = exports.IrrigationCCValues.errorHighFlow(this.valveId);
|
|
1389
|
-
this.ensureMetadata(
|
|
1390
|
-
this.setValue(
|
|
1491
|
+
this.ensureMetadata(ctx, errorHighFlowValue);
|
|
1492
|
+
this.setValue(ctx, errorHighFlowValue, this.errorHighFlow);
|
|
1391
1493
|
}
|
|
1392
1494
|
if (this.errorLowFlow != undefined) {
|
|
1393
1495
|
const errorLowFlowValue = exports.IrrigationCCValues.errorLowFlow(this.valveId);
|
|
1394
|
-
this.ensureMetadata(
|
|
1395
|
-
this.setValue(
|
|
1496
|
+
this.ensureMetadata(ctx, errorLowFlowValue);
|
|
1497
|
+
this.setValue(ctx, errorLowFlowValue, this.errorLowFlow);
|
|
1396
1498
|
}
|
|
1397
1499
|
return true;
|
|
1398
1500
|
}
|
|
1399
|
-
toLogEntry(
|
|
1501
|
+
toLogEntry(ctx) {
|
|
1400
1502
|
const message = {
|
|
1401
1503
|
"valve ID": this.valveId,
|
|
1402
1504
|
connected: this.connected,
|
|
@@ -1414,40 +1516,41 @@ let IrrigationCCValveInfoReport = class IrrigationCCValveInfoReport extends Irri
|
|
|
1414
1516
|
message.errors = errors.map((e) => `\n· ${e}`).join("");
|
|
1415
1517
|
}
|
|
1416
1518
|
return {
|
|
1417
|
-
...super.toLogEntry(
|
|
1519
|
+
...super.toLogEntry(ctx),
|
|
1418
1520
|
message,
|
|
1419
1521
|
};
|
|
1420
1522
|
}
|
|
1421
1523
|
};
|
|
1422
1524
|
exports.IrrigationCCValveInfoReport = IrrigationCCValveInfoReport;
|
|
1423
|
-
exports.IrrigationCCValveInfoReport = IrrigationCCValveInfoReport = __decorate([
|
|
1525
|
+
exports.IrrigationCCValveInfoReport = IrrigationCCValveInfoReport = IrrigationCCValveInfoReport_1 = __decorate([
|
|
1424
1526
|
(0, CommandClassDecorators_1.CCCommand)(_Types_1.IrrigationCommand.ValveInfoReport)
|
|
1425
1527
|
], IrrigationCCValveInfoReport);
|
|
1426
1528
|
function testResponseForIrrigationCommandWithValveId(sent, received) {
|
|
1427
1529
|
return received.valveId === sent.valveId;
|
|
1428
1530
|
}
|
|
1429
1531
|
let IrrigationCCValveInfoGet = class IrrigationCCValveInfoGet extends IrrigationCC {
|
|
1430
|
-
constructor(
|
|
1431
|
-
super(
|
|
1432
|
-
|
|
1433
|
-
|
|
1434
|
-
|
|
1435
|
-
|
|
1436
|
-
|
|
1437
|
-
|
|
1438
|
-
|
|
1532
|
+
constructor(options) {
|
|
1533
|
+
super(options);
|
|
1534
|
+
this.valveId = options.valveId;
|
|
1535
|
+
}
|
|
1536
|
+
static from(_raw, _ctx) {
|
|
1537
|
+
// TODO: Deserialize payload
|
|
1538
|
+
throw new safe_1.ZWaveError(`${this.name}: deserialization not implemented`, safe_1.ZWaveErrorCodes.Deserialization_NotImplemented);
|
|
1539
|
+
// return new IrrigationCCValveInfoGet({
|
|
1540
|
+
// nodeId: ctx.sourceNodeId,
|
|
1541
|
+
// });
|
|
1439
1542
|
}
|
|
1440
1543
|
valveId;
|
|
1441
|
-
serialize() {
|
|
1544
|
+
serialize(ctx) {
|
|
1442
1545
|
this.payload = Buffer.from([
|
|
1443
1546
|
this.valveId === "master" ? 1 : 0,
|
|
1444
1547
|
this.valveId === "master" ? 1 : this.valveId || 1,
|
|
1445
1548
|
]);
|
|
1446
|
-
return super.serialize();
|
|
1549
|
+
return super.serialize(ctx);
|
|
1447
1550
|
}
|
|
1448
|
-
toLogEntry(
|
|
1551
|
+
toLogEntry(ctx) {
|
|
1449
1552
|
return {
|
|
1450
|
-
...super.toLogEntry(
|
|
1553
|
+
...super.toLogEntry(ctx),
|
|
1451
1554
|
message: {
|
|
1452
1555
|
"valve ID": this.valveId,
|
|
1453
1556
|
},
|
|
@@ -1460,24 +1563,23 @@ exports.IrrigationCCValveInfoGet = IrrigationCCValveInfoGet = __decorate([
|
|
|
1460
1563
|
(0, CommandClassDecorators_1.expectedCCResponse)(IrrigationCCValveInfoReport, testResponseForIrrigationCommandWithValveId)
|
|
1461
1564
|
], IrrigationCCValveInfoGet);
|
|
1462
1565
|
let IrrigationCCValveConfigSet = class IrrigationCCValveConfigSet extends IrrigationCC {
|
|
1463
|
-
constructor(
|
|
1464
|
-
super(
|
|
1465
|
-
|
|
1466
|
-
|
|
1467
|
-
|
|
1468
|
-
|
|
1469
|
-
|
|
1470
|
-
|
|
1471
|
-
|
|
1472
|
-
|
|
1473
|
-
|
|
1474
|
-
|
|
1475
|
-
|
|
1476
|
-
|
|
1477
|
-
|
|
1478
|
-
|
|
1479
|
-
|
|
1480
|
-
}
|
|
1566
|
+
constructor(options) {
|
|
1567
|
+
super(options);
|
|
1568
|
+
this.valveId = options.valveId;
|
|
1569
|
+
this.nominalCurrentHighThreshold = options.nominalCurrentHighThreshold;
|
|
1570
|
+
this.nominalCurrentLowThreshold = options.nominalCurrentLowThreshold;
|
|
1571
|
+
this.maximumFlow = options.maximumFlow;
|
|
1572
|
+
this.highFlowThreshold = options.highFlowThreshold;
|
|
1573
|
+
this.lowFlowThreshold = options.lowFlowThreshold;
|
|
1574
|
+
this.useRainSensor = options.useRainSensor;
|
|
1575
|
+
this.useMoistureSensor = options.useMoistureSensor;
|
|
1576
|
+
}
|
|
1577
|
+
static from(_raw, _ctx) {
|
|
1578
|
+
// TODO: Deserialize payload
|
|
1579
|
+
throw new safe_1.ZWaveError(`${this.name}: deserialization not implemented`, safe_1.ZWaveErrorCodes.Deserialization_NotImplemented);
|
|
1580
|
+
// return new IrrigationCCValveConfigSet({
|
|
1581
|
+
// nodeId: ctx.sourceNodeId,
|
|
1582
|
+
// });
|
|
1481
1583
|
}
|
|
1482
1584
|
valveId;
|
|
1483
1585
|
nominalCurrentHighThreshold;
|
|
@@ -1487,7 +1589,7 @@ let IrrigationCCValveConfigSet = class IrrigationCCValveConfigSet extends Irriga
|
|
|
1487
1589
|
lowFlowThreshold;
|
|
1488
1590
|
useRainSensor;
|
|
1489
1591
|
useMoistureSensor;
|
|
1490
|
-
serialize() {
|
|
1592
|
+
serialize(ctx) {
|
|
1491
1593
|
this.payload = Buffer.concat([
|
|
1492
1594
|
Buffer.from([
|
|
1493
1595
|
this.valveId === "master" ? 1 : 0,
|
|
@@ -1503,11 +1605,11 @@ let IrrigationCCValveConfigSet = class IrrigationCCValveConfigSet extends Irriga
|
|
|
1503
1605
|
| (this.useMoistureSensor ? 0b10 : 0),
|
|
1504
1606
|
]),
|
|
1505
1607
|
]);
|
|
1506
|
-
return super.serialize();
|
|
1608
|
+
return super.serialize(ctx);
|
|
1507
1609
|
}
|
|
1508
|
-
toLogEntry(
|
|
1610
|
+
toLogEntry(ctx) {
|
|
1509
1611
|
return {
|
|
1510
|
-
...super.toLogEntry(
|
|
1612
|
+
...super.toLogEntry(ctx),
|
|
1511
1613
|
message: {
|
|
1512
1614
|
"valve ID": this.valveId,
|
|
1513
1615
|
"nominal current high threshold": `${this.nominalCurrentHighThreshold} mA`,
|
|
@@ -1526,74 +1628,100 @@ exports.IrrigationCCValveConfigSet = IrrigationCCValveConfigSet = __decorate([
|
|
|
1526
1628
|
(0, CommandClassDecorators_1.CCCommand)(_Types_1.IrrigationCommand.ValveConfigSet),
|
|
1527
1629
|
(0, CommandClassDecorators_1.useSupervision)()
|
|
1528
1630
|
], IrrigationCCValveConfigSet);
|
|
1529
|
-
let IrrigationCCValveConfigReport = class IrrigationCCValveConfigReport extends IrrigationCC {
|
|
1530
|
-
constructor(
|
|
1531
|
-
super(
|
|
1532
|
-
|
|
1533
|
-
|
|
1534
|
-
|
|
1631
|
+
let IrrigationCCValveConfigReport = IrrigationCCValveConfigReport_1 = class IrrigationCCValveConfigReport extends IrrigationCC {
|
|
1632
|
+
constructor(options) {
|
|
1633
|
+
super(options);
|
|
1634
|
+
// TODO: Check implementation:
|
|
1635
|
+
this.valveId = options.valveId;
|
|
1636
|
+
this.nominalCurrentHighThreshold = options.nominalCurrentHighThreshold;
|
|
1637
|
+
this.nominalCurrentLowThreshold = options.nominalCurrentLowThreshold;
|
|
1638
|
+
this.maximumFlow = options.maximumFlow;
|
|
1639
|
+
this.highFlowThreshold = options.highFlowThreshold;
|
|
1640
|
+
this.lowFlowThreshold = options.lowFlowThreshold;
|
|
1641
|
+
this.useRainSensor = options.useRainSensor;
|
|
1642
|
+
this.useMoistureSensor = options.useMoistureSensor;
|
|
1643
|
+
}
|
|
1644
|
+
static from(raw, ctx) {
|
|
1645
|
+
(0, safe_1.validatePayload)(raw.payload.length >= 4);
|
|
1646
|
+
let valveId;
|
|
1647
|
+
if ((raw.payload[0] & 0b1) === _Types_1.ValveType.MasterValve) {
|
|
1648
|
+
valveId = "master";
|
|
1535
1649
|
}
|
|
1536
1650
|
else {
|
|
1537
|
-
|
|
1651
|
+
valveId = raw.payload[1];
|
|
1538
1652
|
}
|
|
1539
|
-
|
|
1540
|
-
|
|
1653
|
+
const nominalCurrentHighThreshold = 10 * raw.payload[2];
|
|
1654
|
+
const nominalCurrentLowThreshold = 10 * raw.payload[3];
|
|
1541
1655
|
let offset = 4;
|
|
1656
|
+
let maximumFlow;
|
|
1542
1657
|
{
|
|
1543
|
-
const { value, scale, bytesRead } = (0, safe_1.parseFloatWithScale)(
|
|
1658
|
+
const { value, scale, bytesRead } = (0, safe_1.parseFloatWithScale)(raw.payload.subarray(offset));
|
|
1544
1659
|
(0, safe_1.validatePayload)(scale === 0 /* l/h */);
|
|
1545
|
-
|
|
1660
|
+
maximumFlow = value;
|
|
1546
1661
|
offset += bytesRead;
|
|
1547
1662
|
}
|
|
1663
|
+
let highFlowThreshold;
|
|
1548
1664
|
{
|
|
1549
|
-
const { value, scale, bytesRead } = (0, safe_1.parseFloatWithScale)(
|
|
1665
|
+
const { value, scale, bytesRead } = (0, safe_1.parseFloatWithScale)(raw.payload.subarray(offset));
|
|
1550
1666
|
(0, safe_1.validatePayload)(scale === 0 /* l/h */);
|
|
1551
|
-
|
|
1667
|
+
highFlowThreshold = value;
|
|
1552
1668
|
offset += bytesRead;
|
|
1553
1669
|
}
|
|
1670
|
+
let lowFlowThreshold;
|
|
1554
1671
|
{
|
|
1555
|
-
const { value, scale, bytesRead } = (0, safe_1.parseFloatWithScale)(
|
|
1672
|
+
const { value, scale, bytesRead } = (0, safe_1.parseFloatWithScale)(raw.payload.subarray(offset));
|
|
1556
1673
|
(0, safe_1.validatePayload)(scale === 0 /* l/h */);
|
|
1557
|
-
|
|
1674
|
+
lowFlowThreshold = value;
|
|
1558
1675
|
offset += bytesRead;
|
|
1559
1676
|
}
|
|
1560
|
-
(0, safe_1.validatePayload)(
|
|
1561
|
-
|
|
1562
|
-
|
|
1677
|
+
(0, safe_1.validatePayload)(raw.payload.length >= offset + 1);
|
|
1678
|
+
const useRainSensor = !!(raw.payload[offset] & 0b1);
|
|
1679
|
+
const useMoistureSensor = !!(raw.payload[offset] & 0b10);
|
|
1680
|
+
return new IrrigationCCValveConfigReport_1({
|
|
1681
|
+
nodeId: ctx.sourceNodeId,
|
|
1682
|
+
valveId,
|
|
1683
|
+
nominalCurrentHighThreshold,
|
|
1684
|
+
nominalCurrentLowThreshold,
|
|
1685
|
+
maximumFlow,
|
|
1686
|
+
highFlowThreshold,
|
|
1687
|
+
lowFlowThreshold,
|
|
1688
|
+
useRainSensor,
|
|
1689
|
+
useMoistureSensor,
|
|
1690
|
+
});
|
|
1563
1691
|
}
|
|
1564
|
-
persistValues(
|
|
1565
|
-
if (!super.persistValues(
|
|
1692
|
+
persistValues(ctx) {
|
|
1693
|
+
if (!super.persistValues(ctx))
|
|
1566
1694
|
return false;
|
|
1567
1695
|
// nominalCurrentHighThreshold
|
|
1568
1696
|
const nominalCurrentHighThresholdValue = exports.IrrigationCCValues
|
|
1569
1697
|
.nominalCurrentHighThreshold(this.valveId);
|
|
1570
|
-
this.ensureMetadata(
|
|
1571
|
-
this.setValue(
|
|
1698
|
+
this.ensureMetadata(ctx, nominalCurrentHighThresholdValue);
|
|
1699
|
+
this.setValue(ctx, nominalCurrentHighThresholdValue, this.nominalCurrentHighThreshold);
|
|
1572
1700
|
// nominalCurrentLowThreshold
|
|
1573
1701
|
const nominalCurrentLowThresholdValue = exports.IrrigationCCValues
|
|
1574
1702
|
.nominalCurrentLowThreshold(this.valveId);
|
|
1575
|
-
this.ensureMetadata(
|
|
1576
|
-
this.setValue(
|
|
1703
|
+
this.ensureMetadata(ctx, nominalCurrentLowThresholdValue);
|
|
1704
|
+
this.setValue(ctx, nominalCurrentLowThresholdValue, this.nominalCurrentLowThreshold);
|
|
1577
1705
|
// maximumFlow
|
|
1578
1706
|
const maximumFlowValue = exports.IrrigationCCValues.maximumFlow(this.valveId);
|
|
1579
|
-
this.ensureMetadata(
|
|
1580
|
-
this.setValue(
|
|
1707
|
+
this.ensureMetadata(ctx, maximumFlowValue);
|
|
1708
|
+
this.setValue(ctx, maximumFlowValue, this.maximumFlow);
|
|
1581
1709
|
// highFlowThreshold
|
|
1582
1710
|
const highFlowThresholdValue = exports.IrrigationCCValues.highFlowThreshold(this.valveId);
|
|
1583
|
-
this.ensureMetadata(
|
|
1584
|
-
this.setValue(
|
|
1711
|
+
this.ensureMetadata(ctx, highFlowThresholdValue);
|
|
1712
|
+
this.setValue(ctx, highFlowThresholdValue, this.highFlowThreshold);
|
|
1585
1713
|
// lowFlowThreshold
|
|
1586
1714
|
const lowFlowThresholdValue = exports.IrrigationCCValues.lowFlowThreshold(this.valveId);
|
|
1587
|
-
this.ensureMetadata(
|
|
1588
|
-
this.setValue(
|
|
1715
|
+
this.ensureMetadata(ctx, lowFlowThresholdValue);
|
|
1716
|
+
this.setValue(ctx, lowFlowThresholdValue, this.lowFlowThreshold);
|
|
1589
1717
|
// useRainSensor
|
|
1590
1718
|
const useRainSensorValue = exports.IrrigationCCValues.useRainSensor(this.valveId);
|
|
1591
|
-
this.ensureMetadata(
|
|
1592
|
-
this.setValue(
|
|
1719
|
+
this.ensureMetadata(ctx, useRainSensorValue);
|
|
1720
|
+
this.setValue(ctx, useRainSensorValue, this.useRainSensor);
|
|
1593
1721
|
// useMoistureSensor
|
|
1594
1722
|
const useMoistureSensorValue = exports.IrrigationCCValues.useMoistureSensor(this.valveId);
|
|
1595
|
-
this.ensureMetadata(
|
|
1596
|
-
this.setValue(
|
|
1723
|
+
this.ensureMetadata(ctx, useMoistureSensorValue);
|
|
1724
|
+
this.setValue(ctx, useMoistureSensorValue, this.useMoistureSensor);
|
|
1597
1725
|
return true;
|
|
1598
1726
|
}
|
|
1599
1727
|
valveId;
|
|
@@ -1604,9 +1732,9 @@ let IrrigationCCValveConfigReport = class IrrigationCCValveConfigReport extends
|
|
|
1604
1732
|
lowFlowThreshold;
|
|
1605
1733
|
useRainSensor;
|
|
1606
1734
|
useMoistureSensor;
|
|
1607
|
-
toLogEntry(
|
|
1735
|
+
toLogEntry(ctx) {
|
|
1608
1736
|
return {
|
|
1609
|
-
...super.toLogEntry(
|
|
1737
|
+
...super.toLogEntry(ctx),
|
|
1610
1738
|
message: {
|
|
1611
1739
|
"valve ID": this.valveId,
|
|
1612
1740
|
"nominal current high threshold": `${this.nominalCurrentHighThreshold} mA`,
|
|
@@ -1621,31 +1749,32 @@ let IrrigationCCValveConfigReport = class IrrigationCCValveConfigReport extends
|
|
|
1621
1749
|
}
|
|
1622
1750
|
};
|
|
1623
1751
|
exports.IrrigationCCValveConfigReport = IrrigationCCValveConfigReport;
|
|
1624
|
-
exports.IrrigationCCValveConfigReport = IrrigationCCValveConfigReport = __decorate([
|
|
1752
|
+
exports.IrrigationCCValveConfigReport = IrrigationCCValveConfigReport = IrrigationCCValveConfigReport_1 = __decorate([
|
|
1625
1753
|
(0, CommandClassDecorators_1.CCCommand)(_Types_1.IrrigationCommand.ValveConfigReport)
|
|
1626
1754
|
], IrrigationCCValveConfigReport);
|
|
1627
1755
|
let IrrigationCCValveConfigGet = class IrrigationCCValveConfigGet extends IrrigationCC {
|
|
1628
|
-
constructor(
|
|
1629
|
-
super(
|
|
1630
|
-
|
|
1631
|
-
|
|
1632
|
-
|
|
1633
|
-
|
|
1634
|
-
|
|
1635
|
-
|
|
1636
|
-
|
|
1756
|
+
constructor(options) {
|
|
1757
|
+
super(options);
|
|
1758
|
+
this.valveId = options.valveId;
|
|
1759
|
+
}
|
|
1760
|
+
static from(_raw, _ctx) {
|
|
1761
|
+
// TODO: Deserialize payload
|
|
1762
|
+
throw new safe_1.ZWaveError(`${this.name}: deserialization not implemented`, safe_1.ZWaveErrorCodes.Deserialization_NotImplemented);
|
|
1763
|
+
// return new IrrigationCCValveConfigGet({
|
|
1764
|
+
// nodeId: ctx.sourceNodeId,
|
|
1765
|
+
// });
|
|
1637
1766
|
}
|
|
1638
1767
|
valveId;
|
|
1639
|
-
serialize() {
|
|
1768
|
+
serialize(ctx) {
|
|
1640
1769
|
this.payload = Buffer.from([
|
|
1641
1770
|
this.valveId === "master" ? 1 : 0,
|
|
1642
1771
|
this.valveId === "master" ? 1 : this.valveId || 1,
|
|
1643
1772
|
]);
|
|
1644
|
-
return super.serialize();
|
|
1773
|
+
return super.serialize(ctx);
|
|
1645
1774
|
}
|
|
1646
|
-
toLogEntry(
|
|
1775
|
+
toLogEntry(ctx) {
|
|
1647
1776
|
return {
|
|
1648
|
-
...super.toLogEntry(
|
|
1777
|
+
...super.toLogEntry(ctx),
|
|
1649
1778
|
message: {
|
|
1650
1779
|
"valve ID": this.valveId,
|
|
1651
1780
|
},
|
|
@@ -1658,20 +1787,21 @@ exports.IrrigationCCValveConfigGet = IrrigationCCValveConfigGet = __decorate([
|
|
|
1658
1787
|
(0, CommandClassDecorators_1.expectedCCResponse)(IrrigationCCValveConfigReport, testResponseForIrrigationCommandWithValveId)
|
|
1659
1788
|
], IrrigationCCValveConfigGet);
|
|
1660
1789
|
let IrrigationCCValveRun = class IrrigationCCValveRun extends IrrigationCC {
|
|
1661
|
-
constructor(
|
|
1662
|
-
super(
|
|
1663
|
-
|
|
1664
|
-
|
|
1665
|
-
|
|
1666
|
-
|
|
1667
|
-
|
|
1668
|
-
|
|
1669
|
-
|
|
1670
|
-
|
|
1790
|
+
constructor(options) {
|
|
1791
|
+
super(options);
|
|
1792
|
+
this.valveId = options.valveId;
|
|
1793
|
+
this.duration = options.duration;
|
|
1794
|
+
}
|
|
1795
|
+
static from(_raw, _ctx) {
|
|
1796
|
+
// TODO: Deserialize payload
|
|
1797
|
+
throw new safe_1.ZWaveError(`${this.name}: deserialization not implemented`, safe_1.ZWaveErrorCodes.Deserialization_NotImplemented);
|
|
1798
|
+
// return new IrrigationCCValveRun({
|
|
1799
|
+
// nodeId: ctx.sourceNodeId,
|
|
1800
|
+
// });
|
|
1671
1801
|
}
|
|
1672
1802
|
valveId;
|
|
1673
1803
|
duration;
|
|
1674
|
-
serialize() {
|
|
1804
|
+
serialize(ctx) {
|
|
1675
1805
|
this.payload = Buffer.from([
|
|
1676
1806
|
this.valveId === "master" ? 1 : 0,
|
|
1677
1807
|
this.valveId === "master" ? 1 : this.valveId || 1,
|
|
@@ -1679,9 +1809,9 @@ let IrrigationCCValveRun = class IrrigationCCValveRun extends IrrigationCC {
|
|
|
1679
1809
|
0,
|
|
1680
1810
|
]);
|
|
1681
1811
|
this.payload.writeUInt16BE(this.duration, 2);
|
|
1682
|
-
return super.serialize();
|
|
1812
|
+
return super.serialize(ctx);
|
|
1683
1813
|
}
|
|
1684
|
-
toLogEntry(
|
|
1814
|
+
toLogEntry(ctx) {
|
|
1685
1815
|
const message = {
|
|
1686
1816
|
"valve ID": this.valveId,
|
|
1687
1817
|
};
|
|
@@ -1692,7 +1822,7 @@ let IrrigationCCValveRun = class IrrigationCCValveRun extends IrrigationCC {
|
|
|
1692
1822
|
message.action = "turn off";
|
|
1693
1823
|
}
|
|
1694
1824
|
return {
|
|
1695
|
-
...super.toLogEntry(
|
|
1825
|
+
...super.toLogEntry(ctx),
|
|
1696
1826
|
message,
|
|
1697
1827
|
};
|
|
1698
1828
|
}
|
|
@@ -1703,20 +1833,21 @@ exports.IrrigationCCValveRun = IrrigationCCValveRun = __decorate([
|
|
|
1703
1833
|
(0, CommandClassDecorators_1.useSupervision)()
|
|
1704
1834
|
], IrrigationCCValveRun);
|
|
1705
1835
|
let IrrigationCCValveTableSet = class IrrigationCCValveTableSet extends IrrigationCC {
|
|
1706
|
-
constructor(
|
|
1707
|
-
super(
|
|
1708
|
-
|
|
1709
|
-
|
|
1710
|
-
|
|
1711
|
-
|
|
1712
|
-
|
|
1713
|
-
|
|
1714
|
-
|
|
1715
|
-
|
|
1836
|
+
constructor(options) {
|
|
1837
|
+
super(options);
|
|
1838
|
+
this.tableId = options.tableId;
|
|
1839
|
+
this.entries = options.entries;
|
|
1840
|
+
}
|
|
1841
|
+
static from(_raw, _ctx) {
|
|
1842
|
+
// TODO: Deserialize payload
|
|
1843
|
+
throw new safe_1.ZWaveError(`${this.name}: deserialization not implemented`, safe_1.ZWaveErrorCodes.Deserialization_NotImplemented);
|
|
1844
|
+
// return new IrrigationCCValveTableSet({
|
|
1845
|
+
// nodeId: ctx.sourceNodeId,
|
|
1846
|
+
// });
|
|
1716
1847
|
}
|
|
1717
1848
|
tableId;
|
|
1718
1849
|
entries;
|
|
1719
|
-
serialize() {
|
|
1850
|
+
serialize(ctx) {
|
|
1720
1851
|
this.payload = Buffer.allocUnsafe(1 + this.entries.length * 3);
|
|
1721
1852
|
this.payload[0] = this.tableId;
|
|
1722
1853
|
for (let i = 0; i < this.entries.length; i++) {
|
|
@@ -1725,9 +1856,9 @@ let IrrigationCCValveTableSet = class IrrigationCCValveTableSet extends Irrigati
|
|
|
1725
1856
|
this.payload[offset] = entry.valveId;
|
|
1726
1857
|
this.payload.writeUInt16BE(entry.duration, offset + 1);
|
|
1727
1858
|
}
|
|
1728
|
-
return super.serialize();
|
|
1859
|
+
return super.serialize(ctx);
|
|
1729
1860
|
}
|
|
1730
|
-
toLogEntry(
|
|
1861
|
+
toLogEntry(ctx) {
|
|
1731
1862
|
const message = {
|
|
1732
1863
|
"table ID": this.tableId,
|
|
1733
1864
|
};
|
|
@@ -1742,7 +1873,7 @@ let IrrigationCCValveTableSet = class IrrigationCCValveTableSet extends Irrigati
|
|
|
1742
1873
|
}
|
|
1743
1874
|
}
|
|
1744
1875
|
return {
|
|
1745
|
-
...super.toLogEntry(
|
|
1876
|
+
...super.toLogEntry(ctx),
|
|
1746
1877
|
message,
|
|
1747
1878
|
};
|
|
1748
1879
|
}
|
|
@@ -1752,22 +1883,32 @@ exports.IrrigationCCValveTableSet = IrrigationCCValveTableSet = __decorate([
|
|
|
1752
1883
|
(0, CommandClassDecorators_1.CCCommand)(_Types_1.IrrigationCommand.ValveTableSet),
|
|
1753
1884
|
(0, CommandClassDecorators_1.useSupervision)()
|
|
1754
1885
|
], IrrigationCCValveTableSet);
|
|
1755
|
-
let IrrigationCCValveTableReport = class IrrigationCCValveTableReport extends IrrigationCC {
|
|
1756
|
-
constructor(
|
|
1757
|
-
super(
|
|
1758
|
-
|
|
1759
|
-
this.tableId =
|
|
1760
|
-
this.entries =
|
|
1761
|
-
|
|
1762
|
-
|
|
1763
|
-
|
|
1764
|
-
|
|
1886
|
+
let IrrigationCCValveTableReport = IrrigationCCValveTableReport_1 = class IrrigationCCValveTableReport extends IrrigationCC {
|
|
1887
|
+
constructor(options) {
|
|
1888
|
+
super(options);
|
|
1889
|
+
// TODO: Check implementation:
|
|
1890
|
+
this.tableId = options.tableId;
|
|
1891
|
+
this.entries = options.entries;
|
|
1892
|
+
}
|
|
1893
|
+
static from(raw, ctx) {
|
|
1894
|
+
(0, safe_1.validatePayload)((raw.payload.length - 1) % 3 === 0);
|
|
1895
|
+
const tableId = raw.payload[0];
|
|
1896
|
+
const entries = [];
|
|
1897
|
+
for (let offset = 1; offset < raw.payload.length; offset += 3) {
|
|
1898
|
+
entries.push({
|
|
1899
|
+
valveId: raw.payload[offset],
|
|
1900
|
+
duration: raw.payload.readUInt16BE(offset + 1),
|
|
1765
1901
|
});
|
|
1766
1902
|
}
|
|
1903
|
+
return new IrrigationCCValveTableReport_1({
|
|
1904
|
+
nodeId: ctx.sourceNodeId,
|
|
1905
|
+
tableId,
|
|
1906
|
+
entries,
|
|
1907
|
+
});
|
|
1767
1908
|
}
|
|
1768
1909
|
tableId;
|
|
1769
1910
|
entries;
|
|
1770
|
-
toLogEntry(
|
|
1911
|
+
toLogEntry(ctx) {
|
|
1771
1912
|
const message = {
|
|
1772
1913
|
"table ID": this.tableId,
|
|
1773
1914
|
};
|
|
@@ -1782,37 +1923,38 @@ let IrrigationCCValveTableReport = class IrrigationCCValveTableReport extends Ir
|
|
|
1782
1923
|
}
|
|
1783
1924
|
}
|
|
1784
1925
|
return {
|
|
1785
|
-
...super.toLogEntry(
|
|
1926
|
+
...super.toLogEntry(ctx),
|
|
1786
1927
|
message,
|
|
1787
1928
|
};
|
|
1788
1929
|
}
|
|
1789
1930
|
};
|
|
1790
1931
|
exports.IrrigationCCValveTableReport = IrrigationCCValveTableReport;
|
|
1791
|
-
exports.IrrigationCCValveTableReport = IrrigationCCValveTableReport = __decorate([
|
|
1932
|
+
exports.IrrigationCCValveTableReport = IrrigationCCValveTableReport = IrrigationCCValveTableReport_1 = __decorate([
|
|
1792
1933
|
(0, CommandClassDecorators_1.CCCommand)(_Types_1.IrrigationCommand.ValveTableReport)
|
|
1793
1934
|
], IrrigationCCValveTableReport);
|
|
1794
1935
|
function testResponseForIrrigationValveTableGet(sent, received) {
|
|
1795
1936
|
return received.tableId === sent.tableId;
|
|
1796
1937
|
}
|
|
1797
1938
|
let IrrigationCCValveTableGet = class IrrigationCCValveTableGet extends IrrigationCC {
|
|
1798
|
-
constructor(
|
|
1799
|
-
super(
|
|
1800
|
-
|
|
1801
|
-
|
|
1802
|
-
|
|
1803
|
-
|
|
1804
|
-
|
|
1805
|
-
|
|
1806
|
-
|
|
1939
|
+
constructor(options) {
|
|
1940
|
+
super(options);
|
|
1941
|
+
this.tableId = options.tableId;
|
|
1942
|
+
}
|
|
1943
|
+
static from(_raw, _ctx) {
|
|
1944
|
+
// TODO: Deserialize payload
|
|
1945
|
+
throw new safe_1.ZWaveError(`${this.name}: deserialization not implemented`, safe_1.ZWaveErrorCodes.Deserialization_NotImplemented);
|
|
1946
|
+
// return new IrrigationCCValveTableGet({
|
|
1947
|
+
// nodeId: ctx.sourceNodeId,
|
|
1948
|
+
// });
|
|
1807
1949
|
}
|
|
1808
1950
|
tableId;
|
|
1809
|
-
serialize() {
|
|
1951
|
+
serialize(ctx) {
|
|
1810
1952
|
this.payload = Buffer.from([this.tableId]);
|
|
1811
|
-
return super.serialize();
|
|
1953
|
+
return super.serialize(ctx);
|
|
1812
1954
|
}
|
|
1813
|
-
toLogEntry(
|
|
1955
|
+
toLogEntry(ctx) {
|
|
1814
1956
|
return {
|
|
1815
|
-
...super.toLogEntry(
|
|
1957
|
+
...super.toLogEntry(ctx),
|
|
1816
1958
|
message: {
|
|
1817
1959
|
"table ID": this.tableId,
|
|
1818
1960
|
},
|
|
@@ -1825,27 +1967,28 @@ exports.IrrigationCCValveTableGet = IrrigationCCValveTableGet = __decorate([
|
|
|
1825
1967
|
(0, CommandClassDecorators_1.expectedCCResponse)(IrrigationCCValveTableReport, testResponseForIrrigationValveTableGet)
|
|
1826
1968
|
], IrrigationCCValveTableGet);
|
|
1827
1969
|
let IrrigationCCValveTableRun = class IrrigationCCValveTableRun extends IrrigationCC {
|
|
1828
|
-
constructor(
|
|
1829
|
-
super(
|
|
1830
|
-
|
|
1831
|
-
|
|
1832
|
-
throw new safe_1.ZWaveError(`${this.constructor.name}:
|
|
1833
|
-
}
|
|
1834
|
-
else {
|
|
1835
|
-
this.tableIDs = options.tableIDs;
|
|
1836
|
-
if (this.tableIDs.length < 1) {
|
|
1837
|
-
throw new safe_1.ZWaveError(`${this.constructor.name}: At least one table ID must be specified.`, safe_1.ZWaveErrorCodes.Argument_Invalid);
|
|
1838
|
-
}
|
|
1970
|
+
constructor(options) {
|
|
1971
|
+
super(options);
|
|
1972
|
+
this.tableIDs = options.tableIDs;
|
|
1973
|
+
if (this.tableIDs.length < 1) {
|
|
1974
|
+
throw new safe_1.ZWaveError(`${this.constructor.name}: At least one table ID must be specified.`, safe_1.ZWaveErrorCodes.Argument_Invalid);
|
|
1839
1975
|
}
|
|
1840
1976
|
}
|
|
1977
|
+
static from(_raw, _ctx) {
|
|
1978
|
+
// TODO: Deserialize payload
|
|
1979
|
+
throw new safe_1.ZWaveError(`${this.name}: deserialization not implemented`, safe_1.ZWaveErrorCodes.Deserialization_NotImplemented);
|
|
1980
|
+
// return new IrrigationCCValveTableRun({
|
|
1981
|
+
// nodeId: ctx.sourceNodeId,
|
|
1982
|
+
// });
|
|
1983
|
+
}
|
|
1841
1984
|
tableIDs;
|
|
1842
|
-
serialize() {
|
|
1985
|
+
serialize(ctx) {
|
|
1843
1986
|
this.payload = Buffer.from(this.tableIDs);
|
|
1844
|
-
return super.serialize();
|
|
1987
|
+
return super.serialize(ctx);
|
|
1845
1988
|
}
|
|
1846
|
-
toLogEntry(
|
|
1989
|
+
toLogEntry(ctx) {
|
|
1847
1990
|
return {
|
|
1848
|
-
...super.toLogEntry(
|
|
1991
|
+
...super.toLogEntry(ctx),
|
|
1849
1992
|
message: {
|
|
1850
1993
|
"table IDs": this.tableIDs
|
|
1851
1994
|
.map((id) => (0, strings_1.padStart)(id.toString(), 3, "0"))
|
|
@@ -1860,24 +2003,25 @@ exports.IrrigationCCValveTableRun = IrrigationCCValveTableRun = __decorate([
|
|
|
1860
2003
|
(0, CommandClassDecorators_1.useSupervision)()
|
|
1861
2004
|
], IrrigationCCValveTableRun);
|
|
1862
2005
|
let IrrigationCCSystemShutoff = class IrrigationCCSystemShutoff extends IrrigationCC {
|
|
1863
|
-
constructor(
|
|
1864
|
-
super(
|
|
1865
|
-
|
|
1866
|
-
|
|
1867
|
-
|
|
1868
|
-
|
|
1869
|
-
|
|
1870
|
-
|
|
1871
|
-
|
|
2006
|
+
constructor(options) {
|
|
2007
|
+
super(options);
|
|
2008
|
+
this.duration = options.duration;
|
|
2009
|
+
}
|
|
2010
|
+
static from(_raw, _ctx) {
|
|
2011
|
+
// TODO: Deserialize payload
|
|
2012
|
+
throw new safe_1.ZWaveError(`${this.name}: deserialization not implemented`, safe_1.ZWaveErrorCodes.Deserialization_NotImplemented);
|
|
2013
|
+
// return new IrrigationCCSystemShutoff({
|
|
2014
|
+
// nodeId: ctx.sourceNodeId,
|
|
2015
|
+
// });
|
|
1872
2016
|
}
|
|
1873
2017
|
duration;
|
|
1874
|
-
serialize() {
|
|
2018
|
+
serialize(ctx) {
|
|
1875
2019
|
this.payload = Buffer.from([this.duration ?? 255]);
|
|
1876
|
-
return super.serialize();
|
|
2020
|
+
return super.serialize(ctx);
|
|
1877
2021
|
}
|
|
1878
|
-
toLogEntry(
|
|
2022
|
+
toLogEntry(ctx) {
|
|
1879
2023
|
return {
|
|
1880
|
-
...super.toLogEntry(
|
|
2024
|
+
...super.toLogEntry(ctx),
|
|
1881
2025
|
message: {
|
|
1882
2026
|
duration: this.duration === 0
|
|
1883
2027
|
? "temporarily"
|