GUI: use a spinbox for ambient temperature instead of a text entry

Replaces lineEdit_ambient (QLineEdit) with doubleSpinBox_ambient
(QDoubleSpinBox, 0-50 degC, 0.5 deg steps) in brewpi.ui, regenerated
main_window.py via pyuic5 (same generator version, verified minimal diff).

brewpi_gui.py wires valueChanged instead of returnPressed - no more
manual float()/ValueError parsing of typed text, the signal already
hands over a valid float - with blockSignals guards around server-driven
updates (mirroring the existing doubleSpinBox_heatrate_soll pattern) so
applying a server echo doesn't immediately re-send the same value back.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01DkkuG48uHFCGKe6dPSERFk
This commit is contained in:
2026-06-22 22:52:36 +02:00
co-authored by Claude Sonnet 4.6
parent df91ec61f3
commit 8726b0a62d
3 changed files with 36 additions and 18 deletions
+8 -4
View File
@@ -1237,9 +1237,13 @@ class Ui_MainWindow(object):
self.label_ambient.setGeometry(QtCore.QRect(520, 500, 91, 31))
self.label_ambient.setAlignment(QtCore.Qt.AlignCenter)
self.label_ambient.setObjectName("label_ambient")
self.lineEdit_ambient = QtWidgets.QLineEdit(self.centralwidget)
self.lineEdit_ambient.setGeometry(QtCore.QRect(620, 500, 70, 31))
self.lineEdit_ambient.setObjectName("lineEdit_ambient")
self.doubleSpinBox_ambient = QtWidgets.QDoubleSpinBox(self.centralwidget)
self.doubleSpinBox_ambient.setGeometry(QtCore.QRect(620, 500, 70, 31))
self.doubleSpinBox_ambient.setDecimals(1)
self.doubleSpinBox_ambient.setMinimum(0.0)
self.doubleSpinBox_ambient.setMaximum(50.0)
self.doubleSpinBox_ambient.setSingleStep(0.5)
self.doubleSpinBox_ambient.setObjectName("doubleSpinBox_ambient")
self.btn_pot_reset = QtWidgets.QPushButton(self.centralwidget)
self.btn_pot_reset.setGeometry(QtCore.QRect(700, 500, 220, 31))
self.btn_pot_reset.setObjectName("btn_pot_reset")
@@ -1314,7 +1318,7 @@ class Ui_MainWindow(object):
self.plainTextUri.setPlainText(_translate("MainWindow", "ws://localhost:8765"))
self.btn_connect.setText(_translate("MainWindow", "Connect"))
self.label_ambient.setText(_translate("MainWindow", "Ambient [°C]"))
self.lineEdit_ambient.setToolTip(_translate("MainWindow", "Set the simulated/assumed ambient temperature - press Enter to apply"))
self.doubleSpinBox_ambient.setToolTip(_translate("MainWindow", "Set the simulated/assumed ambient temperature"))
self.btn_pot_reset.setToolTip(_translate("MainWindow", "Only available when the server\'s Pot is simulated"))
self.btn_pot_reset.setText(_translate("MainWindow", "Pot reset to ambient temperature"))
self.label_8.setText(_translate("MainWindow", "Host"))