forked from M-Labs/thermostat
Remove is_ prefix
This commit is contained in:
parent
bc4b5bb615
commit
05bc5d8809
|
@ -42,11 +42,11 @@ class Client:
|
||||||
|
|
||||||
await self._check_zero_limits()
|
await self._check_zero_limits()
|
||||||
|
|
||||||
def is_connecting(self):
|
def connecting(self):
|
||||||
"""Returns True if client is connecting"""
|
"""Returns True if client is connecting"""
|
||||||
return self._connecting_task is not None
|
return self._connecting_task is not None
|
||||||
|
|
||||||
def is_connected(self):
|
def connected(self):
|
||||||
"""Returns True if client is connected"""
|
"""Returns True if client is connected"""
|
||||||
return self._writer is not None
|
return self._writer is not None
|
||||||
|
|
||||||
|
|
|
@ -515,7 +515,7 @@ class MainWindow(QtWidgets.QMainWindow, Ui_MainWindow):
|
||||||
|
|
||||||
@asyncSlot(int)
|
@asyncSlot(int)
|
||||||
async def fan_set(self, value):
|
async def fan_set(self, value):
|
||||||
if not self.client.is_connected():
|
if not self.client.connected():
|
||||||
return
|
return
|
||||||
if self.fan_auto_box.isChecked():
|
if self.fan_auto_box.isChecked():
|
||||||
with QSignalBlocker(self.fan_auto_box):
|
with QSignalBlocker(self.fan_auto_box):
|
||||||
|
@ -526,7 +526,7 @@ class MainWindow(QtWidgets.QMainWindow, Ui_MainWindow):
|
||||||
|
|
||||||
@asyncSlot(int)
|
@asyncSlot(int)
|
||||||
async def fan_auto_set(self, enabled):
|
async def fan_auto_set(self, enabled):
|
||||||
if not self.client.is_connected():
|
if not self.client.connected():
|
||||||
return
|
return
|
||||||
if enabled:
|
if enabled:
|
||||||
await self.client.set_param("fan", "auto")
|
await self.client.set_param("fan", "auto")
|
||||||
|
@ -563,7 +563,7 @@ class MainWindow(QtWidgets.QMainWindow, Ui_MainWindow):
|
||||||
async def on_connect_btn_clicked(self):
|
async def on_connect_btn_clicked(self):
|
||||||
host, port = self.host_set_line.text(), self.port_set_spin.value()
|
host, port = self.host_set_line.text(), self.port_set_spin.value()
|
||||||
try:
|
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.status_lbl.setText("Connecting...")
|
||||||
self.connect_btn.setText("Stop")
|
self.connect_btn.setText("Stop")
|
||||||
self.host_set_line.setEnabled(False)
|
self.host_set_line.setEnabled(False)
|
||||||
|
|
Loading…
Reference in New Issue