Add temperature assignment clear buttons

This commit is contained in:
2026-06-05 02:31:39 -06:00
parent 47dd9a7b8b
commit a86a0b58c4
2 changed files with 22 additions and 1 deletions
+1 -1
View File
@@ -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\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
- 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\n- Added per-slot WebUI Clear buttons for temperature probe assignments using the existing `/temps/clear` API.\n
@@ -499,6 +499,26 @@ async function assignTemp(id,index){
alert("Temp probe assigned to "+id);
}
async function clearTempAssignment(id){
if(!confirm("Clear probe assignment for "+id+"?")) return;
const r=await fetch("/temps/clear",{
method:"POST",
headers:{"Content-Type":"application/json"},
body:JSON.stringify({id:id})
});
if(!r.ok){
const msg=await r.text();
alert("Failed to clear temp assignment: "+msg);
return;
}
await fetch("/config/save",{method:"POST"});
await load();
alert("Temp probe assignment cleared for "+id);
}
async function restartController(){
if(!confirm("Restart the controller now?")) return;
await fetch("/system/restart",{method:"POST"});
@@ -548,6 +568,7 @@ function renderConfigControls(data){
<input id="tempWeather${i}" type="checkbox" ${t.weather?"checked":""}>
Weather
</label>
<button class="off" onclick="clearTempAssignment('${t.id}')">Clear</button>
</div>
</div>`).join("");
}