Skip to content

Commit 65326ca

Browse files
Copilotdorkmo
andcommitted
Fix redundant relay activation, fix typo, use Engine name/number for RPM sensors
Co-authored-by: dorkmo <1923070+dorkmo@users.noreply.github.com>
1 parent e181e84 commit 65326ca

File tree

2 files changed

+9
-6
lines changed

2 files changed

+9
-6
lines changed

TankAlarm-112025-Client-BluesOpta/TankAlarm-112025-Client-BluesOpta.ino

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1547,7 +1547,7 @@ static void sendAlarm(uint8_t idx, const char *alarmType, float inches) {
15471547
}
15481548
}
15491549

1550-
if (shouldActivateRelay) {
1550+
if (shouldActivateRelay && !gRelayActiveForTank[idx]) {
15511551
triggerRemoteRelays(cfg.relayTargetClient, cfg.relayMask, true);
15521552
gRelayActiveForTank[idx] = true;
15531553
gRelayActivationTime[idx] = millis();

TankAlarm-112025-Server-BluesOpta/TankAlarm-112025-Server-BluesOpta.ino

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -654,6 +654,7 @@ static const char CONFIG_GENERATOR_HTML[] PROGMEM = R"HTML(
654654
const card = document.getElementById(`sensor-${id}`);
655655
const type = card.querySelector('.monitor-type').value;
656656
const numField = card.querySelector('.tank-num-field');
657+
const numFieldLabel = numField.querySelector('span');
657658
const nameLabel = card.querySelector('.name-label');
658659
const heightLabel = card.querySelector('.height-label');
659660
const sensorTypeSelect = card.querySelector('.sensor-type');
@@ -665,15 +666,17 @@ static const char CONFIG_GENERATOR_HTML[] PROGMEM = R"HTML(
665666
heightLabel.textContent = 'Max Pressure';
666667
pulsesPerRevField.style.display = 'none';
667668
} else if (type === 'rpm') {
668-
numField.style.display = 'none';
669-
nameLabel.textContent = 'System Name';
669+
numField.style.display = 'flex';
670+
numFieldLabel.textContent = 'Engine Number';
671+
nameLabel.textContent = 'Engine Name';
670672
heightLabel.textContent = 'Max RPM';
671673
pulsesPerRevField.style.display = 'flex';
672674
// Auto-select Hall Effect RPM sensor type
673675
sensorTypeSelect.value = '3';
674676
updatePinOptions(id);
675677
} else {
676678
numField.style.display = 'flex';
679+
numFieldLabel.textContent = 'Tank Number';
677680
nameLabel.textContent = 'Tank Name';
678681
heightLabel.textContent = 'Height (in)';
679682
pulsesPerRevField.style.display = 'none';
@@ -739,15 +742,15 @@ static const char CONFIG_GENERATOR_HTML[] PROGMEM = R"HTML(
739742
const type = parseInt(card.querySelector('.sensor-type').value);
740743
const pin = parseInt(card.querySelector('.sensor-pin').value);
741744
742-
// For gas and rpm sensors, we hide the number but still need one for the firmware.
743-
// We'll use the index + 1.
745+
// For gas and RPM sensors, we still use the number field for the firmware.
746+
// For gas sensors, we use index + 1 as default. For RPM, user can enter engine number.
744747
let tankNum = parseInt(card.querySelector('.tank-num').value) || (index + 1);
745748
let name = card.querySelector('.tank-name').value;
746749
747750
if (monitorType === 'gas') {
748751
if (!name) name = `Gas System ${index + 1}`;
749752
} else if (monitorType === 'rpm') {
750-
if (!name) name = `RPM Sensor ${index + 1}`;
753+
if (!name) name = `Engine ${tankNum}`;
751754
} else {
752755
if (!name) name = `Tank ${index + 1}`;
753756
}

0 commit comments

Comments
 (0)