Pre-init pot temperature input with ambient temp on first server push

Mirrors PyQt client which seeds doubleSpinBox_pot_temp from the
remembered ambient on startup. In the browser there is no persistence,
so the first AmbientTemp message from the server is used instead.
Flag resets on reconnect so it re-syncs if the server restarts.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01DF16nV2ispNw1C9SbvqbRQ
This commit is contained in:
2026-06-27 21:16:49 +02:00
co-authored by Claude Sonnet 4.6
parent 0316cfd33b
commit b4e7007c4a
+6
View File
@@ -32,6 +32,7 @@ let initialPowerSync = true;
let initialSpeedSync = true;
let initialHeatrateSync = true;
let initialTempSollSync = true;
let initialPotTempSync = true;
let ambientTemp = null;
let warpFactor = 1.0;
@@ -702,6 +703,10 @@ function onSystemChanged(msg) {
if (document.activeElement !== document.getElementById('ambient-temp')) {
document.getElementById('ambient-temp').value = msg.AmbientTemp;
}
if (initialPotTempSync) {
document.getElementById('pot-temp').value = msg.AmbientTemp;
initialPotTempSync = false;
}
updateEnvStatusLine();
}
if ('WarpFactor' in msg) {
@@ -755,6 +760,7 @@ function connect() {
initialSpeedSync = true;
initialHeatrateSync = true;
initialTempSollSync = true;
initialPotTempSync = true;
setConnected(true);
for (const channel of CHANNELS) {
ws.send(JSON.stringify({'+': channel}));