forked from M-Labs/thermostat
return hwrev when start_session
This commit is contained in:
parent
04d073bc18
commit
78e9068e2b
|
@ -37,7 +37,9 @@ class Thermostat(QObject, metaclass=PropertyMeta):
|
|||
|
||||
async def start_session(self, host, port):
|
||||
await self._client.connect(host, port)
|
||||
hw_rev_data = await self.get_hw_rev()
|
||||
self.start_watching()
|
||||
return hw_rev_data
|
||||
|
||||
async def run(self):
|
||||
self._update_params_task = asyncio.create_task(self.update_params())
|
||||
|
|
|
@ -186,9 +186,6 @@ class MainWindow(QtWidgets.QMainWindow):
|
|||
self.conn_menu.port_set_spin.setEnabled(False)
|
||||
self.connect_btn.setText("Disconnect")
|
||||
|
||||
self.hw_rev_data = await self.thermostat.get_hw_rev()
|
||||
logging.debug(self.hw_rev_data)
|
||||
|
||||
self._status(self.hw_rev_data)
|
||||
|
||||
case ThermostatConnectionState.CONNECTING:
|
||||
|
@ -223,7 +220,6 @@ class MainWindow(QtWidgets.QMainWindow):
|
|||
await self.autotuners.stop_pid_from_running(ch)
|
||||
|
||||
def _status(self, hw_rev_d: dict):
|
||||
logging.debug(hw_rev_d)
|
||||
self.status_lbl.setText(
|
||||
f"Connected to Thermostat v{hw_rev_d['rev']['major']}.{hw_rev_d['rev']['minor']}"
|
||||
)
|
||||
|
@ -265,7 +261,7 @@ class MainWindow(QtWidgets.QMainWindow):
|
|||
)
|
||||
)
|
||||
try:
|
||||
await self._connecting_task
|
||||
self.hw_rev_data = await self._connecting_task
|
||||
except (OSError, asyncio.CancelledError) as exc:
|
||||
await self.bail()
|
||||
if isinstance(exc, asyncio.CancelledError):
|
||||
|
|
Loading…
Reference in New Issue