Skip to content

Commit c149f36

Browse files
Restore Response-level action matching for non-IntelliCenter protocols, specifically addressing the Hayward Outbound action index mismatch. This ensures accurate action comparison in message processing. #1151
1 parent cde51e1 commit c149f36

1 file changed

Lines changed: 9 additions & 0 deletions

File tree

controller/comms/messages/Messages.ts

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1331,6 +1331,15 @@ export class Response extends OutboundCommon {
13311331
//
13321332
// NOTE: IntelliCenter response matching is handled in the IntelliCenter-specific block below
13331333
// to keep the logic in one place.
1334+
//
1335+
// Restore Response-level action matching for non-IntelliCenter protocols (e.g., Hayward).
1336+
// The Hayward Outbound action getter has a known index mismatch (reads source instead of action),
1337+
// so we use the Response object's action which stores it correctly in header[4].
1338+
// See: https://github.com/tagyoureit/nodejs-poolController/issues/1098
1339+
if (sys.controllerType !== ControllerType.IntelliCenter && this.action > 0) {
1340+
if (this.action === msgIn.action) return true;
1341+
else return false;
1342+
}
13341343
if (msgOut.protocol === Protocol.Pump) {
13351344
switch (msgIn.action) {
13361345
case 7:

0 commit comments

Comments
 (0)