gui: remember the ambient temperature in the user config

Persists whenever set via the entry, and re-applies automatically on
connect - so it survives a server restart (which would otherwise fall
back to config.json's ambient_temperature) without retyping it.
This commit is contained in:
2026-06-21 12:18:30 +02:00
parent 19be2a7670
commit 0a74aab43f
+6
View File
@@ -382,6 +382,11 @@ class Window(QtWidgets.QMainWindow, Ui_MainWindow):
# on_sud_changed() routes the reply to update_sud_forecast() instead
# of a save dialog.
self.msg_sud.send({'Save': True})
# Re-apply the last ambient temperature we set, in case the server
# restarted since (and so fell back to its own config.json default).
remembered_ambient = self.user_config.get('ambient_temperature')
if remembered_ambient is not None:
self.msg_system.send({'AmbientTemp': remembered_ambient})
def on_plot_timer(self):
self.plot.sample(
@@ -517,6 +522,7 @@ class Window(QtWidgets.QMainWindow, Ui_MainWindow):
value = float(self.lineEdit_ambient.text())
except ValueError:
return
self.user_config.set('ambient_temperature', value)
self.msg_system.send({'AmbientTemp': value})
def update_status_env_label(self):