forked from M-Labs/thermostat
hwrev updates
This commit is contained in:
parent
aadf8a2595
commit
903f9f8767
@ -39,7 +39,6 @@ class Thermostat(QObject, metaclass=PropertyMeta):
|
||||
async def start_session(self, host, port):
|
||||
self.connection_state_changed.emit(ThermostatConnectionState.CONNECTING)
|
||||
await self._client.connect(host, port)
|
||||
await self.get_hw_rev()
|
||||
self.connection_state_changed.emit(ThermostatConnectionState.CONNECTED)
|
||||
self.start_watching()
|
||||
|
||||
|
@ -97,7 +97,6 @@ class MainWindow(QtWidgets.QMainWindow):
|
||||
self.zero_limits_warning.set_limits_warning
|
||||
)
|
||||
|
||||
self.thermostat.hw_rev_update.connect(self._status)
|
||||
self.report_apply_btn.clicked.connect(
|
||||
lambda: self.thermostat.set_update_s(self.report_refresh_spin.value())
|
||||
)
|
||||
@ -134,6 +133,10 @@ class MainWindow(QtWidgets.QMainWindow):
|
||||
self.conn_menu.host_set_line.setEnabled(False)
|
||||
self.conn_menu.port_set_spin.setEnabled(False)
|
||||
self.connect_btn.setText("Disconnect")
|
||||
hw_rev_d = await self.thermostat.get_hw_rev()
|
||||
self.status_lbl.setText(
|
||||
f"Connected to Thermostat v{hw_rev_d['rev']['major']}.{hw_rev_d['rev']['minor']}"
|
||||
)
|
||||
|
||||
case ThermostatConnectionState.CONNECTING:
|
||||
self.status_lbl.setText("Connecting...")
|
||||
@ -166,11 +169,6 @@ class MainWindow(QtWidgets.QMainWindow):
|
||||
else:
|
||||
await self.autotuners.stop_pid_from_running(ch)
|
||||
|
||||
def _status(self, hw_rev_d: dict):
|
||||
self.status_lbl.setText(
|
||||
f"Connected to Thermostat v{hw_rev_d['rev']['major']}.{hw_rev_d['rev']['minor']}"
|
||||
)
|
||||
|
||||
@asyncSlot(int)
|
||||
async def on_report_box_stateChanged(self, enabled):
|
||||
await self.thermostat.set_report_mode(enabled)
|
||||
|
Loading…
Reference in New Issue
Block a user