Enforce unique temperature probe assignments
This commit is contained in:
@@ -168,7 +168,22 @@ bool assignTempSensorByIndex(int configIndex, int scanIndex) {
|
||||
return false;
|
||||
}
|
||||
|
||||
appConfig.tempSensors[configIndex].address = sensorAddressStrings[scanIndex];
|
||||
String selectedAddress = sensorAddressStrings[scanIndex];
|
||||
|
||||
for (int i = 0; i < MAX_TEMP_SENSORS; i++) {
|
||||
if (i == configIndex) {
|
||||
continue;
|
||||
}
|
||||
|
||||
if (appConfig.tempSensors[i].address == selectedAddress) {
|
||||
appConfig.tempSensors[i].address = "";
|
||||
appConfig.tempSensors[i].enabled = false;
|
||||
sensors.tempsF[i] = -127.0;
|
||||
sensors.online[i] = false;
|
||||
}
|
||||
}
|
||||
|
||||
appConfig.tempSensors[configIndex].address = selectedAddress;
|
||||
appConfig.tempSensors[configIndex].enabled = true;
|
||||
|
||||
return true;
|
||||
|
||||
Reference in New Issue
Block a user