Revert "dashboard: queue latest relay target states"

This reverts commit e1bbe2c135.
This commit is contained in:
2026-06-15 17:47:50 -06:00
parent e1bbe2c135
commit 44128f83be
@@ -541,6 +541,7 @@ static void relay_button_event_cb(lv_event_t *event)
pending_relay_previous_state[index] = previous_state;
}
// Latest-state queue: rapid taps overwrite this relay's desired target.
pending_relay_state[index] = next_state;
relay_command_pending[index] = true;
@@ -574,6 +575,8 @@ static void process_pending_relay_command()
bool next_state = pending_relay_state[index];
bool previous_state = pending_relay_previous_state[index];
// Clear before posting. If the user taps again after this command returns,
// the new desired state will be queued as a fresh command.
relay_command_pending[index] = false;
bool ok = post_relay_state(relay_id, next_state);
@@ -581,7 +584,8 @@ static void process_pending_relay_command()
if (ok) {
set_label_text_if_changed(system_status_label, last_system_status_text, "Relay command sent");
} else {
if (!relay_command_pending[index]) {
// Only revert if no newer desired state was queued for this relay.
if (!relay_command_pending[index] && index >= 0 && index < relay_count) {
relay_states[index] = previous_state;
update_relay_buttons();
}