Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 15 additions & 2 deletions scripts/pumps.js
Original file line number Diff line number Diff line change
Expand Up @@ -100,8 +100,21 @@
el.css({ display: '' });
if (data.pumpOnDelay === true)
el.find('div.picIndicator').attr('data-status', 'delay');
else
el.find('div.picIndicator').attr('data-status', data.command === 10 || data.relay > 0 ? 'on' : 'off');
else {
// Determine pump on/off status based on pump type
var isOn = false;
if (type.name === 'regalmodbus') {
// For modbus pumps, use actual speed/flow indicators
// Pump is considered "on" if it's actually running at a speed > 0
isOn = (typeof data.rpm !== 'undefined' && data.rpm > 0) ||
(typeof data.speed !== 'undefined' && data.speed > 0);
}
else {
// For relay-based pumps, use command or relay status
isOn = data.command === 10 || data.relay > 0;
}
el.find('div.picIndicator').attr('data-status', isOn ? 'on' : 'off');
}
}
el.attr('data-pumptype', data.type.val);
el.attr('data-id', data.id);
Expand Down