forked from M-Labs/thermostat
Simply test for connectivity for turning PID off
This commit is contained in:
parent
e30d07d707
commit
96b0ddc26c
pytec
@ -57,6 +57,7 @@ class PIDAutoTuner(QObject):
|
|||||||
async def stop_pid_from_running(self, ch):
|
async def stop_pid_from_running(self, ch):
|
||||||
self.autotuners[ch].setOff()
|
self.autotuners[ch].setOff()
|
||||||
self.autotune_state_changed.emit(ch, self.autotuners[ch].state())
|
self.autotune_state_changed.emit(ch, self.autotuners[ch].state())
|
||||||
|
if self._thermostat.connected():
|
||||||
await self._thermostat.set_param("pwm", ch, "i_set", 0)
|
await self._thermostat.set_param("pwm", ch, "i_set", 0)
|
||||||
|
|
||||||
@asyncSlot(list)
|
@asyncSlot(list)
|
||||||
|
@ -159,10 +159,6 @@ class MainWindow(QtWidgets.QMainWindow):
|
|||||||
self.report_box.setChecked(False)
|
self.report_box.setChecked(False)
|
||||||
for ch in range(self.NUM_CHANNELS):
|
for ch in range(self.NUM_CHANNELS):
|
||||||
if self.autotuners.get_state(ch) != PIDAutotuneState.STATE_OFF:
|
if self.autotuners.get_state(ch) != PIDAutotuneState.STATE_OFF:
|
||||||
if self.thermostat.connection_errored:
|
|
||||||
# Don't send any commands, just reset local state
|
|
||||||
self.autotuners.autotuners[ch].setOff()
|
|
||||||
else:
|
|
||||||
await self.autotuners.stop_pid_from_running(ch)
|
await self.autotuners.stop_pid_from_running(ch)
|
||||||
|
|
||||||
@asyncSlot(int)
|
@asyncSlot(int)
|
||||||
|
Loading…
Reference in New Issue
Block a user