Added ability to get circuit info by the device id

This is useful for EquipmentConfiguration and upcoming PumpStatus messages.
This commit is contained in:
2020-06-08 22:14:31 -05:00
parent 8d908aad5d
commit cd981c19ef

View File

@ -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;
}
};