firmware: keep temp config lookup outside UART guard

This commit is contained in:
2026-06-08 09:04:59 -06:00
parent 75c1d4d909
commit 954bef4291
2 changed files with 18 additions and 6 deletions
@@ -2025,7 +2025,7 @@ int findRelayConfigIndexForUart(const String& id) {
return -1;
}
int findTempConfigIndexForUart(const String& id) {
int findTempConfigIndexById(const String& id) {
for (int i = 0; i < MAX_TEMP_SENSORS; i++) {
if (appConfig.tempSensors[i].id == id) {
return i;
@@ -2110,7 +2110,7 @@ void handleUartMessage(const String& line) {
if (strcmp(type, "config_temp") == 0) {
String id = doc["id"] | "";
int index = findTempConfigIndexForUart(id);
int index = findTempConfigIndexById(id);
if (index < 0) {
sendError(DashboardSerial, "unknown_temp_sensor");
@@ -2286,7 +2286,7 @@ void handleUartMessage(const String& line) {
int configIndex = -1;
if (id.length() > 0) {
configIndex = findTempConfigIndexForUart(id);
configIndex = findTempConfigIndexById(id);
} else if (slot >= 1 && slot <= MAX_TEMP_SENSORS) {
configIndex = slot - 1;
}
@@ -2313,7 +2313,7 @@ void handleUartMessage(const String& line) {
int configIndex = -1;
if (id.length() > 0) {
configIndex = findTempConfigIndexForUart(id);
configIndex = findTempConfigIndexById(id);
} else if (slot >= 1 && slot <= MAX_TEMP_SENSORS) {
configIndex = slot - 1;
}
@@ -3078,7 +3078,7 @@ void handleTempAssign() {
int configIndex = -1;
if (id.length() > 0) {
configIndex = findTempConfigIndexForUart(id);
configIndex = findTempConfigIndexById(id);
} else if (slot >= 1 && slot <= MAX_TEMP_SENSORS) {
configIndex = slot - 1;
}
@@ -3128,7 +3128,7 @@ void handleTempClear() {
int configIndex = -1;
if (id.length() > 0) {
configIndex = findTempConfigIndexForUart(id);
configIndex = findTempConfigIndexById(id);
} else if (slot >= 1 && slot <= MAX_TEMP_SENSORS) {
configIndex = slot - 1;
}