Remove connection errored

This commit is contained in:
atse 2024-08-28 13:38:09 +08:00
parent 96b0ddc26c
commit 2a12d02bc8

View File

@ -33,7 +33,6 @@ class Thermostat(QObject, metaclass=PropertyMeta):
self._report_mode_task = None self._report_mode_task = None
self._poll_for_report = True self._poll_for_report = True
self._update_params_task = None self._update_params_task = None
self.connection_errored = False
super().__init__(parent) super().__init__(parent)
async def start_session(self, host, port): async def start_session(self, host, port):
@ -54,7 +53,6 @@ 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)
@ -117,7 +115,6 @@ class Thermostat(QObject, metaclass=PropertyMeta):
self.stop_watching() self.stop_watching()
await self._client.disconnect() await self._client.disconnect()
self.connection_state_changed.emit(ThermostatConnectionState.DISCONNECTED) self.connection_state_changed.emit(ThermostatConnectionState.DISCONNECTED)
self.connection_errored = False
async def set_ipv4(self, ipv4): async def set_ipv4(self, ipv4):
await self._client.set_param("ipv4", ipv4) await self._client.set_param("ipv4", ipv4)