forked from M-Labs/thermostat
Assign connection_errored as well
This commit is contained in:
parent
bbe9a60824
commit
e849610658
@ -55,14 +55,11 @@ class Thermostat(QObject, metaclass=PropertyMeta):
|
|||||||
exc_info=True,
|
exc_info=True,
|
||||||
)
|
)
|
||||||
self.connection_error.emit()
|
self.connection_error.emit()
|
||||||
|
self.connection_errored = True
|
||||||
return
|
return
|
||||||
self._update_params_task = asyncio.create_task(self.update_params())
|
self._update_params_task = asyncio.create_task(self.update_params())
|
||||||
await asyncio.sleep(self._update_s)
|
await asyncio.sleep(self._update_s)
|
||||||
|
|
||||||
@pyqtSlot()
|
|
||||||
def timed_out(self):
|
|
||||||
self.connection_errored = True
|
|
||||||
|
|
||||||
async def get_hw_rev(self):
|
async def get_hw_rev(self):
|
||||||
return await self._client.hw_rev()
|
return await self._client.hw_rev()
|
||||||
|
|
||||||
|
@ -72,8 +72,6 @@ class MainWindow(QtWidgets.QMainWindow):
|
|||||||
|
|
||||||
self.thermostat.connection_error.connect(handle_connection_error)
|
self.thermostat.connection_error.connect(handle_connection_error)
|
||||||
|
|
||||||
self.thermostat.connection_error.connect(self.thermostat.timed_out)
|
|
||||||
|
|
||||||
self.thermostat.connection_state_changed.connect(self._on_connection_changed)
|
self.thermostat.connection_state_changed.connect(self._on_connection_changed)
|
||||||
|
|
||||||
self.autotuners = PIDAutoTuner(self, self.thermostat, 2)
|
self.autotuners = PIDAutoTuner(self, self.thermostat, 2)
|
||||||
|
Loading…
Reference in New Issue
Block a user