forked from M-Labs/thermostat
hw_rev
This commit is contained in:
parent
5dcf9e8f31
commit
43758e12a3
@ -39,10 +39,9 @@ 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)
|
||||||
hw_rev_data = await self.get_hw_rev()
|
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()
|
||||||
return hw_rev_data
|
|
||||||
|
|
||||||
async def run(self):
|
async def run(self):
|
||||||
self._update_params_task = asyncio.create_task(self.update_params())
|
self._update_params_task = asyncio.create_task(self.update_params())
|
||||||
|
@ -138,8 +138,6 @@ class ThermostatCtrlMenu(QtWidgets.QMenu):
|
|||||||
)
|
)
|
||||||
with QSignalBlocker(self.fan_auto_box):
|
with QSignalBlocker(self.fan_auto_box):
|
||||||
self.fan_auto_box.setChecked(fan_settings["auto_mode"])
|
self.fan_auto_box.setChecked(fan_settings["auto_mode"])
|
||||||
if not self.hw_rev_data["settings"]["fan_pwm_recommended"]:
|
|
||||||
self.set_fan_pwm_warning()
|
|
||||||
|
|
||||||
def set_fan_pwm_warning(self):
|
def set_fan_pwm_warning(self):
|
||||||
if self.fan_power_slider.value() != 100:
|
if self.fan_power_slider.value() != 100:
|
||||||
|
@ -58,7 +58,6 @@ class MainWindow(QtWidgets.QMainWindow):
|
|||||||
ui_file_path = importlib.resources.files("pytec.gui.view").joinpath("tec_qt.ui")
|
ui_file_path = importlib.resources.files("pytec.gui.view").joinpath("tec_qt.ui")
|
||||||
uic.loadUi(ui_file_path, self)
|
uic.loadUi(ui_file_path, self)
|
||||||
|
|
||||||
self.hw_rev_data = None
|
|
||||||
self.info_box = InfoBox()
|
self.info_box = InfoBox()
|
||||||
|
|
||||||
self.thermostat = Thermostat(
|
self.thermostat = Thermostat(
|
||||||
@ -229,7 +228,7 @@ class MainWindow(QtWidgets.QMainWindow):
|
|||||||
)
|
)
|
||||||
)
|
)
|
||||||
try:
|
try:
|
||||||
self.hw_rev_data = await self._connecting_task
|
await self._connecting_task
|
||||||
except (OSError, asyncio.CancelledError) as exc:
|
except (OSError, asyncio.CancelledError) as exc:
|
||||||
await self.thermostat.end_session()
|
await self.thermostat.end_session()
|
||||||
if isinstance(exc, asyncio.CancelledError):
|
if isinstance(exc, asyncio.CancelledError):
|
||||||
|
Loading…
Reference in New Issue
Block a user