From 730da5482f7b1e9779d163dfe9524daede5c9115 Mon Sep 17 00:00:00 2001 From: nick Date: Mon, 8 Jun 2026 09:07:38 -0600 Subject: [PATCH] firmware: expose temp lookup outside disabled UART block --- .../overland-controller.ino | 20 +++++++++---------- tests/test_http_api_contract.py | 4 ++-- 2 files changed, 12 insertions(+), 12 deletions(-) diff --git a/firmware/esp32/overland-controller/overland-controller.ino b/firmware/esp32/overland-controller/overland-controller.ino index 9b22b24..b66b82f 100644 --- a/firmware/esp32/overland-controller/overland-controller.ino +++ b/firmware/esp32/overland-controller/overland-controller.ino @@ -946,6 +946,16 @@ setInterval(load,3000); WebServer server(80); #define API_V1(path) "/api/v1" path + +int findTempConfigIndexById(const String& id) { + for (int i = 0; i < MAX_TEMP_SENSORS; i++) { + if (appConfig.tempSensors[i].id == id) { + return i; + } + } + return -1; +} + #if DASHBOARD_UART_ENABLED HardwareSerial DashboardSerial(2); String uartLineBuffer; @@ -2025,16 +2035,6 @@ int findRelayConfigIndexForUart(const String& id) { return -1; } -int findTempConfigIndexById(const String& id) { - for (int i = 0; i < MAX_TEMP_SENSORS; i++) { - if (appConfig.tempSensors[i].id == id) { - return i; - } - } - - return -1; -} - void handleUartMessage(const String& line) { DynamicJsonDocument doc(1024); DeserializationError error = deserializeJson(doc, line); diff --git a/tests/test_http_api_contract.py b/tests/test_http_api_contract.py index 23f69c7..3408dd7 100644 --- a/tests/test_http_api_contract.py +++ b/tests/test_http_api_contract.py @@ -458,5 +458,5 @@ def test_temp_config_lookup_is_available_to_http_handlers(): assert "findTempConfigIndexForUart" not in source helper_pos = source.index("int findTempConfigIndexById(") - uart_guard_pos = source.index("#if DASHBOARD_UART_ENABLED") - assert helper_pos < uart_guard_pos + first_uart_guard_pos = source.index("#if DASHBOARD_UART_ENABLED") + assert helper_pos < first_uart_guard_pos