+
+ ${dev.address}
+ #${dev.index}
+
+
+ ${temps.slice(0,4).map((t,i)=>`
+
+ `).join("")}
+
+
`).join("");
+}
+
+async function assignTemp(id,index){
+ await fetch("/temps/assign",{
+ method:"POST",
+ headers:{"Content-Type":"application/json"},
+ body:JSON.stringify({id:id,index:index})
+ });
+
+ await fetch("/config/save",{method:"POST"});
+ await load();
+ alert("Temp probe assigned to "+id);
+}
+
+async function restartController(){
+ if(!confirm("Restart the controller now?")) return;
+ await fetch("/system/restart",{method:"POST"});
+ alert("Restart requested");
+}
+
+async function factoryReset(){
+ if(!confirm("Factory reset all controller configuration?")) return;
+ if(!confirm("This clears WiFi/BMS/relay/temp config. Continue?")) return;
+
+ await fetch("/config/factory-reset",{method:"POST"});
+ alert("Factory reset requested. Reconnect to the controller AP if needed.");
}
function renderConfigControls(data){