Remove is_ prefix

This commit is contained in:
atse 2023-08-09 11:09:28 +08:00
parent bc4b5bb615
commit 05bc5d8809
2 changed files with 5 additions and 5 deletions

View File

@ -42,11 +42,11 @@ class Client:
await self._check_zero_limits()
def is_connecting(self):
def connecting(self):
"""Returns True if client is connecting"""
return self._connecting_task is not None
def is_connected(self):
def connected(self):
"""Returns True if client is connected"""
return self._writer is not None

View File

@ -515,7 +515,7 @@ class MainWindow(QtWidgets.QMainWindow, Ui_MainWindow):
@asyncSlot(int)
async def fan_set(self, value):
if not self.client.is_connected():
if not self.client.connected():
return
if self.fan_auto_box.isChecked():
with QSignalBlocker(self.fan_auto_box):
@ -526,7 +526,7 @@ class MainWindow(QtWidgets.QMainWindow, Ui_MainWindow):
@asyncSlot(int)
async def fan_auto_set(self, enabled):
if not self.client.is_connected():
if not self.client.connected():
return
if enabled:
await self.client.set_param("fan", "auto")
@ -563,7 +563,7 @@ class MainWindow(QtWidgets.QMainWindow, Ui_MainWindow):
async def on_connect_btn_clicked(self):
host, port = self.host_set_line.text(), self.port_set_spin.value()
try:
if not (self.client.is_connecting() or self.client.is_connected()):
if not (self.client.connecting() or self.client.connected()):
self.status_lbl.setText("Connecting...")
self.connect_btn.setText("Stop")
self.host_set_line.setEnabled(False)