Descriptive name

This commit is contained in:
atse 2024-08-28 10:24:37 +08:00
parent c81f09c9d8
commit b26747f527

View File

@ -123,20 +123,20 @@ class MainWindow(QtWidgets.QMainWindow):
self.loading_spinner.hide() self.loading_spinner.hide()
@asyncSlot(ThermostatConnectionState) @asyncSlot(ThermostatConnectionState)
async def _on_connection_changed(self, result): async def _on_connection_changed(self, state):
self.graph_group.setEnabled(result == ThermostatConnectionState.CONNECTED) self.graph_group.setEnabled(state == ThermostatConnectionState.CONNECTED)
self.report_group.setEnabled(result == ThermostatConnectionState.CONNECTED) self.report_group.setEnabled(state == ThermostatConnectionState.CONNECTED)
self.thermostat_settings.setEnabled( self.thermostat_settings.setEnabled(
result == ThermostatConnectionState.CONNECTED state == ThermostatConnectionState.CONNECTED
) )
self.conn_menu.host_set_line.setEnabled( self.conn_menu.host_set_line.setEnabled(
result == ThermostatConnectionState.DISCONNECTED state == ThermostatConnectionState.DISCONNECTED
) )
self.conn_menu.port_set_spin.setEnabled( self.conn_menu.port_set_spin.setEnabled(
result == ThermostatConnectionState.DISCONNECTED state == ThermostatConnectionState.DISCONNECTED
) )
match result: match state:
case ThermostatConnectionState.CONNECTED: case ThermostatConnectionState.CONNECTED:
self.connect_btn.setText("Disconnect") self.connect_btn.setText("Disconnect")
self.status_lbl.setText( self.status_lbl.setText(