forked from M-Labs/thermostat
hwrev updates
This commit is contained in:
parent
dc5460f591
commit
7b662374bc
@ -39,7 +39,6 @@ class Thermostat(QObject, metaclass=PropertyMeta):
|
|||||||
async def start_session(self, host, port):
|
async def start_session(self, host, port):
|
||||||
self.connection_state_changed.emit(ThermostatConnectionState.CONNECTING)
|
self.connection_state_changed.emit(ThermostatConnectionState.CONNECTING)
|
||||||
await self._client.connect(host, port)
|
await self._client.connect(host, port)
|
||||||
await self.get_hw_rev()
|
|
||||||
self.connection_state_changed.emit(ThermostatConnectionState.CONNECTED)
|
self.connection_state_changed.emit(ThermostatConnectionState.CONNECTED)
|
||||||
self.start_watching()
|
self.start_watching()
|
||||||
|
|
||||||
|
@ -99,7 +99,6 @@ class MainWindow(QtWidgets.QMainWindow):
|
|||||||
self.zero_limits_warning.set_limits_warning
|
self.zero_limits_warning.set_limits_warning
|
||||||
)
|
)
|
||||||
|
|
||||||
self.thermostat.hw_rev_update.connect(self._status)
|
|
||||||
self.report_apply_btn.clicked.connect(
|
self.report_apply_btn.clicked.connect(
|
||||||
lambda: self.thermostat.set_update_s(self.report_refresh_spin.value())
|
lambda: self.thermostat.set_update_s(self.report_refresh_spin.value())
|
||||||
)
|
)
|
||||||
@ -143,6 +142,10 @@ class MainWindow(QtWidgets.QMainWindow):
|
|||||||
self.conn_menu.host_set_line.setEnabled(False)
|
self.conn_menu.host_set_line.setEnabled(False)
|
||||||
self.conn_menu.port_set_spin.setEnabled(False)
|
self.conn_menu.port_set_spin.setEnabled(False)
|
||||||
self.connect_btn.setText("Disconnect")
|
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:
|
case ThermostatConnectionState.CONNECTING:
|
||||||
self.status_lbl.setText("Connecting...")
|
self.status_lbl.setText("Connecting...")
|
||||||
@ -175,11 +178,6 @@ class MainWindow(QtWidgets.QMainWindow):
|
|||||||
else:
|
else:
|
||||||
await self.autotuners.stop_pid_from_running(ch)
|
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)
|
@asyncSlot(int)
|
||||||
async def on_report_box_stateChanged(self, enabled):
|
async def on_report_box_stateChanged(self, enabled):
|
||||||
await self.thermostat.set_report_mode(enabled)
|
await self.thermostat.set_report_mode(enabled)
|
||||||
|
Loading…
Reference in New Issue
Block a user