firmware: keep temp config lookup outside UART guard
This commit is contained in:
@@ -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;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user