From cd981c19ef74b8412ac2fa11c96d220a935cdf1b Mon Sep 17 00:00:00 2001 From: Parnic Date: Mon, 8 Jun 2020 22:14:31 -0500 Subject: [PATCH] Added ability to get circuit info by the device id This is useful for EquipmentConfiguration and upcoming PumpStatus messages. --- messages/SLControllerConfigMessage.js | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/messages/SLControllerConfigMessage.js b/messages/SLControllerConfigMessage.js index 738141d..535bbcb 100755 --- a/messages/SLControllerConfigMessage.js +++ b/messages/SLControllerConfigMessage.js @@ -127,4 +127,16 @@ exports.SLControllerConfigMessage = class SLControllerConfigMessage extends SLMe isChem2() { return this.controllerType === 252 && this.hwType === 2; } + + getCircuitByDeviceId(deviceId) { + if (this.bodyArray) { + for (var i = 0; i < this.bodyArray.length; i++) { + if (this.bodyArray[i].deviceId === deviceId) { + return this.bodyArray[i]; + } + } + } + + return null; + } };