Enforce unique temperature probe assignments
This commit is contained in:
@@ -163,4 +163,4 @@ Examples:
|
||||
5. Add config backup/restore.
|
||||
6. Improve BMS out-of-range behavior without changing NimBLE connect timeout.
|
||||
|
||||
- Fixed WebUI temperature probe scan by registering `/temps/scan`, `/temps/assign`, and `/temps/clear` firmware routes.\n\n- Added per-temperature-sensor `weather` flag and WebUI outside temperature badge with emoji thresholds: below 50°F ice, 50-74°F happy, 75-84°F sun, and 85°F+ fire.\n\n- Improved WebUI temperature sensor config checkbox layout with compact On/Weather controls.\n
|
||||
- Fixed WebUI temperature probe scan by registering `/temps/scan`, `/temps/assign`, and `/temps/clear` firmware routes.\n\n- Added per-temperature-sensor `weather` flag and WebUI outside temperature badge with emoji thresholds: below 50°F ice, 50-74°F happy, 75-84°F sun, and 85°F+ fire.\n\n- Improved WebUI temperature sensor config checkbox layout with compact On/Weather controls.\n\n- Temperature probe assignment now enforces one logical slot per physical DS18B20 address; assigning a probe to a new slot clears the old slot mapping.\n
|
||||
@@ -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